http://stackoverflow.com/comment/38553959
comment on: http://stackoverflow.com/q/24832002
score: 0
type: QuestionComment
type: Comment
has text: @Mritunjay `arr_diff([1,2,3], [1,3,3])` returns `[2, 3]`

http://stackoverflow.com/comment/38577383
has text: You may not be able to upvote, but you can 'accept' his answer. http://meta.stackexchange.com/questions/23138/how-to-accept-the-answer-on-stack-overflow
comment on: http://stackoverflow.com/a/24844844
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/comment/38562655
score: 0
comment on: http://stackoverflow.com/q/24832372
has text: Why not create an empty application layout and separate root level resources. Resource specifies the the 'app teplate'. The inner route specifies the 'page template.'
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24836392
has comment: http://stackoverflow.com/comment/83128790
score: 3
accepted answer of: http://stackoverflow.com/q/24834109
upvote count: 3
has comment: http://stackoverflow.com/comment/38562789
answers question: http://stackoverflow.com/q/24834109
has body: One possibility is to use document.querySelectorAll(":hover"); Which will return a NodeList of elements in deciding order from parent => child => ... => last child. So the last element in the NodeList will be most "specific", and it would (most of the time) be possible to construct a css path to that specific element by working backwards through the NodeList. For your second question, you are veering into extremely difficult territory! In general, if you are trying to extract information from an unknown html page it is simply not feasible to do so automatically/programmatically without knowing the page structure before hand. If you want your extension to only extract paths from a certain (small) number of sites then great...you can (manually) see if the sites have well structured markup and hard code those paths into your code. Otherwise, for any general site, finding similar paths should be left as an exercise to the user (perhaps using the hover method as mentioned above :))
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/38565493

http://stackoverflow.com/a/24775261
upvote count: 1
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24774927
type: Answer
has body: First of all, check if your url is ok, for example, if you are using php with codeigniter your url need to be like this: url: &lt;?php echo base_url()?&gt;mycontroller/myfunction and second, when I used ajax, I send data like this postData = { name: nameperson, contact: contact1 } $.ajax({ url: '/mycontroller/myfunction', data: postData type: 'post', success: function(result){ data = jQuery.parseJSON(result); if(data.result == "SUCCESS"){ clearMyFormData(); } else { showMessage(); } }

http://stackoverflow.com/a/24792740
score: 1
has comment: http://stackoverflow.com/comment/38479624
has comment: http://stackoverflow.com/comment/38479798
type: Answer
upvote count: 1
has body: Object values in JavaScript are references, not complete objects-as-values. When you assign bob[1] to jim, both jim and bob[1] reference the same object (the array). Changing the array via one reference does not affect the other reference; they're both pointing to the same (changed) array.
has comment: http://stackoverflow.com/comment/38479754
answers question: http://stackoverflow.com/q/24792707
has comment: http://stackoverflow.com/comment/38479609
downvote count: 0
has comment: http://stackoverflow.com/comment/38479617

http://stackoverflow.com/comment/44105671
comment on: http://stackoverflow.com/a/27849179
type: AnswerComment
score: 0
has text: There was a similar comment to the question, so I'd copy my reply: I can't see how AJAX/pagination can help with editable content. In reality, it's a full-featured editor similar to Word. E.g, it has a contextual spellchecker, which depends on the words around the cursor. Or how the user can navigate through and select a block of text that spans multiple pages. Thanks anyway!
type: Comment

twitter-bootstrap
tags question: http://stackoverflow.com/q/24784799
tags question: http://stackoverflow.com/q/24756159
tags question: http://stackoverflow.com/q/24844164
tags question: http://stackoverflow.com/q/24764423
tag name: twitter-bootstrap
tags question: http://stackoverflow.com/q/24832025
tags question: http://stackoverflow.com/q/24899026
tags question: http://stackoverflow.com/q/24760627
tags question: http://stackoverflow.com/q/24784472
tags question: http://stackoverflow.com/q/24785153
tags question: http://stackoverflow.com/q/24756953
tags question: http://stackoverflow.com/q/24846940
tags question: http://stackoverflow.com/q/24776814
tags question: http://stackoverflow.com/q/24844986
tags question: http://stackoverflow.com/q/24887923
tags question: http://stackoverflow.com/q/24791445
tags question: http://stackoverflow.com/q/24844037
tags question: http://stackoverflow.com/q/24823661
tags question: http://stackoverflow.com/q/24800813
tags question: http://stackoverflow.com/q/24755170
tags question: http://stackoverflow.com/q/24767897
tags question: http://stackoverflow.com/q/24887269
tags question: http://stackoverflow.com/q/24834362
tags question: http://stackoverflow.com/q/24834122
tags question: http://stackoverflow.com/q/24815838
tags question: http://stackoverflow.com/q/24878097
tags question: http://stackoverflow.com/q/24908004
tags question: http://stackoverflow.com/q/24896866
tags question: http://stackoverflow.com/q/24778305
tags question: http://stackoverflow.com/q/24829087
tags question: http://stackoverflow.com/q/24901731
tags question: http://stackoverflow.com/q/24801225
tags question: http://stackoverflow.com/q/24831093
tags question: http://stackoverflow.com/q/24836006
tags question: http://stackoverflow.com/q/24828543
tags question: http://stackoverflow.com/q/24905028
tags question: http://stackoverflow.com/q/24752687
tags question: http://stackoverflow.com/q/24879383
type: Tag
tags question: http://stackoverflow.com/q/24876105
tags question: http://stackoverflow.com/q/24852076
tags question: http://stackoverflow.com/q/24874465
tags question: http://stackoverflow.com/q/24788139
tags question: http://stackoverflow.com/q/24817601
tags question: http://stackoverflow.com/q/24867283
tags question: http://stackoverflow.com/q/24817808
tags question: http://stackoverflow.com/q/24882548
tags question: http://stackoverflow.com/q/24801906
tags question: http://stackoverflow.com/q/24902318
tags question: http://stackoverflow.com/q/24901315
tags question: http://stackoverflow.com/q/24790822
tags question: http://stackoverflow.com/q/24831077
tags question: http://stackoverflow.com/q/24880066
tags question: http://stackoverflow.com/q/24879811
tags question: http://stackoverflow.com/q/24804302
tags question: http://stackoverflow.com/q/24760420
tags question: http://stackoverflow.com/q/24893785
tags question: http://stackoverflow.com/q/24753687
tags question: http://stackoverflow.com/q/24752596
tags question: http://stackoverflow.com/q/24759944
tags question: http://stackoverflow.com/q/24786256
tags question: http://stackoverflow.com/q/24761605
tags question: http://stackoverflow.com/q/24753457
tags question: http://stackoverflow.com/q/24886889
tags question: http://stackoverflow.com/q/24904938
tags question: http://stackoverflow.com/q/24813521
tags question: http://stackoverflow.com/q/24774341
tags question: http://stackoverflow.com/q/24867510
tags question: http://stackoverflow.com/q/24859697
tags question: http://stackoverflow.com/q/24865650
tags question: http://stackoverflow.com/q/24872120
tags question: http://stackoverflow.com/q/24777630
tags question: http://stackoverflow.com/q/24776368
tags question: http://stackoverflow.com/q/24785622
tags question: http://stackoverflow.com/q/24799987
tags question: http://stackoverflow.com/q/24864694
tags question: http://stackoverflow.com/q/24800494
tags question: http://stackoverflow.com/q/24879598
tags question: http://stackoverflow.com/q/24876407
tags question: http://stackoverflow.com/q/24852835

http://stackoverflow.com/comment/38532100
has text: @Dayde - Nope that didn't work either. Doh!
score: 0
comment on: http://stackoverflow.com/q/24819781
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24802627
possible better answer: http://stackoverflow.com/a/39452020
type: AnsweredQuestion
tagged with: angularjs-ng-change
has title: Angular - ng-change not firing when ng-model is changed
has answer: http://stackoverflow.com/a/24802755
has answer: http://stackoverflow.com/a/52934821
type: Question
upvote count: 22
tagged with: angular-ngmodel
has body: The input is the following: &lt;input type="text" ng-model="repair.test" ng-change="action()" /&gt; The action() is executed when I manually type and change the input. However if I change the repair.test value by some other function programmatically, it doesnt fire the ng-change's action. I have read the angular tutorial and it's probably the expected behavior. https://docs.angularjs.org/api/ng/directive/ngChange "The expression is not evaluated when the value change is coming from the model." &lt;- I need this too. How can I fire an action in controller, when the model changes in any way? (typing in input or by any other function) Thanks for the help. Edit: The model value is actually the form.$valid, which has it's own Form controller around it (I think), that is why I used the action function to try to pass the value to the parent controller. So $scope.$watch at the moment doesn't work, only when it is initialised.
tagged with: javascript
score: 22
has answer: http://stackoverflow.com/a/39452020
has answer: http://stackoverflow.com/a/24802731
accepted answer: http://stackoverflow.com/a/24802731
downvote count: 0
favorite count: 0
tagged with: data-binding
tagged with: angularjs
answer count: 4

http://stackoverflow.com/q/24820170
answer count: 2
tagged with: typeof
accepted answer: http://stackoverflow.com/a/24820356
tagged with: javascript
has body: if (typeof $scope.input.gps === 'undefined') { $scope.msgBody = 'Location not found.'; } else { $scope.msgBody = $scope.input.gps+' not found.'; } flash.pop({title: 'Error', body: $scope.msgBody, type: 'error'}); Would there be an easier way to do this if statement and include it inside the flash.pop
tagged with: angularjs
has title: Simplifying Javascript if statement undefined
score: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24820211
tagged with: angularjs-scope
has answer: http://stackoverflow.com/a/24820356
has comment: http://stackoverflow.com/comment/38530723
possible better answer: http://stackoverflow.com/a/24820211
type: Question

http://stackoverflow.com/comment/38634081
comment on: http://stackoverflow.com/q/24845701
has text: I hosted the files on the internet ... I believe I don't need the download you provided to me in that case, right ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24882526
tagged with: html5-video
has body: I want to autoplay video in fullscreen. I searched and found out that Fullscreen API can be used to do this and found out that code similar to this can be used. viewFullScreen.addEventListener("click", function () { var docElm = document.documentElement; if (docElm.requestFullscreen) { docElm.requestFullscreen(); } else if (docElm.msRequestFullscreen) { docElm.msRequestFullscreen(); } else if (docElm.mozRequestFullScreen) { docElm.mozRequestFullScreen(); } else if (docElm.webkitRequestFullScreen) { docElm.webkitRequestFullScreen(); } }, false); This code works fine. But this will need some triggering event like mouse click or some keyboard input. But is it possible playing a video automatically in fullscreen without any triggering event as soon as the html file is opened?
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/24889831
favorite count: 0
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/24889831
has title: Autoplaying of video in player-fullscreen rather than background fullscreen using HTML5 and javascript
type: Question
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/65508297
type: QuestionComment
comment on: http://stackoverflow.com/q/24881345
has text: see also [What is the intention behind clause 2.2.4 of Promise/A+ spec?](http://stackoverflow.com/q/36932244/1048572)
score: 0
type: Comment

jquery
tags question: http://stackoverflow.com/q/24887923
tags question: http://stackoverflow.com/q/24839463
tags question: http://stackoverflow.com/q/24838675
tags question: http://stackoverflow.com/q/24754578
tags question: http://stackoverflow.com/q/24793571
tags question: http://stackoverflow.com/q/24801225
tags question: http://stackoverflow.com/q/24757569
tags question: http://stackoverflow.com/q/24858751
tags question: http://stackoverflow.com/q/24894237
tags question: http://stackoverflow.com/q/24772364
tags question: http://stackoverflow.com/q/24763421
tags question: http://stackoverflow.com/q/24808757
tags question: http://stackoverflow.com/q/24818970
tags question: http://stackoverflow.com/q/24873737
tags question: http://stackoverflow.com/q/24800399
tags question: http://stackoverflow.com/q/24838782
tags question: http://stackoverflow.com/q/24823781
tags question: http://stackoverflow.com/q/24765774
tags question: http://stackoverflow.com/q/24832702
tags question: http://stackoverflow.com/q/24866499
tags question: http://stackoverflow.com/q/24864559
tags question: http://stackoverflow.com/q/24895982
tags question: http://stackoverflow.com/q/24860546
tags question: http://stackoverflow.com/q/24865991
tags question: http://stackoverflow.com/q/24905688
tags question: http://stackoverflow.com/q/24783155
tags question: http://stackoverflow.com/q/24818931
tags question: http://stackoverflow.com/q/24890647
tags question: http://stackoverflow.com/q/24822280
tags question: http://stackoverflow.com/q/24774804
tags question: http://stackoverflow.com/q/24777494
tags question: http://stackoverflow.com/q/24796199
tags question: http://stackoverflow.com/q/24847282
tags question: http://stackoverflow.com/q/24880404
tags question: http://stackoverflow.com/q/24759335
tags question: http://stackoverflow.com/q/24886821
tags question: http://stackoverflow.com/q/24906775
tags question: http://stackoverflow.com/q/24897172
tags question: http://stackoverflow.com/q/24829216
tags question: http://stackoverflow.com/q/24766980
tags question: http://stackoverflow.com/q/24834431
tags question: http://stackoverflow.com/q/24781913
tags question: http://stackoverflow.com/q/24879728
tags question: http://stackoverflow.com/q/24768390
tags question: http://stackoverflow.com/q/24897723
tags question: http://stackoverflow.com/q/24791948
tags question: http://stackoverflow.com/q/24848645
tags question: http://stackoverflow.com/q/24846471
tags question: http://stackoverflow.com/q/24893838
tags question: http://stackoverflow.com/q/24789909
tags question: http://stackoverflow.com/q/24842089
tags question: http://stackoverflow.com/q/24844037
tags question: http://stackoverflow.com/q/24881705
tags question: http://stackoverflow.com/q/24835993
tags question: http://stackoverflow.com/q/24819545
tags question: http://stackoverflow.com/q/24873807
tags question: http://stackoverflow.com/q/24850351
tags question: http://stackoverflow.com/q/24903884
tags question: http://stackoverflow.com/q/24814587
tags question: http://stackoverflow.com/q/24831057
tags question: http://stackoverflow.com/q/24862822
tags question: http://stackoverflow.com/q/24837311
tags question: http://stackoverflow.com/q/24760596
tags question: http://stackoverflow.com/q/24802344
tags question: http://stackoverflow.com/q/24805842
tags question: http://stackoverflow.com/q/24833618
tags question: http://stackoverflow.com/q/24830281
tags question: http://stackoverflow.com/q/24812899
tags question: http://stackoverflow.com/q/24769929
tags question: http://stackoverflow.com/q/24834647
tags question: http://stackoverflow.com/q/24773142
tags question: http://stackoverflow.com/q/24858687
tags question: http://stackoverflow.com/q/24756877
tags question: http://stackoverflow.com/q/24771277
tags question: http://stackoverflow.com/q/24871399
tags question: http://stackoverflow.com/q/24858697
tags question: http://stackoverflow.com/q/24777886
tags question: http://stackoverflow.com/q/24806954
tags question: http://stackoverflow.com/q/24835907
tags question: http://stackoverflow.com/q/24782488

http://stackoverflow.com/a/24785740
has comment: http://stackoverflow.com/comment/38474912
downvote count: 0
score: 1
has body: You mentioned some good options, and the DDP client is probably the most robust way to go. However, you can just set up normal Node.js REST API endpoints using the webapp package (meteor add webapp). WebApp.rawConnectHandlers and WebApp.connectHandlers are just instances to which you can attach connect/express middleware or handlers. If you write to the MongoDB directly, it will fire events in Meteor, as long as you set up the oplog observe driver.
has comment: http://stackoverflow.com/comment/38475516
type: Answer
has comment: http://stackoverflow.com/comment/38476189
upvote count: 1
has comment: http://stackoverflow.com/comment/38475188
answers question: http://stackoverflow.com/q/24784939

http://stackoverflow.com/comment/38510623
type: AnswerComment
has text: No, I understand that I can pass an array. I want to know why it passes the entire object first. And why the key for the entire object is "".
type: Comment
comment on: http://stackoverflow.com/a/24809512
score: 0

http://stackoverflow.com/q/24822833
has answer: http://stackoverflow.com/a/24822940
accepted answer: http://stackoverflow.com/a/24822940
tagged with: onclick
downvote count: 0
has answer: http://stackoverflow.com/a/24823077
score: 1
has comment: http://stackoverflow.com/comment/38535460
type: Question
has comment: http://stackoverflow.com/comment/38535633
has comment: http://stackoverflow.com/comment/38535593
possible better answer: http://stackoverflow.com/a/24823023
has answer: http://stackoverflow.com/a/24823023
has comment: http://stackoverflow.com/comment/38535607
answer count: 3
upvote count: 1
tagged with: javascript
tagged with: jquery
has title: onchange() in JavaScript or Jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38535573
tagged with: onchange
has body: Good day, I have a drop down list where have a onchange function call updateView(). jsp code is as follow: &lt;s:select name="accountDateRange" onchange="updateView();" id="function" &gt; However, there is not only this drop down list using this function. Some other function may call updateView() to proceed. I have some code need to run when user do onchange on this drop down list, but I do not want this code to be run when other function call updateView(). Following is part of code of updateView(): function updateView() { // some other code here // here is the code that I only want to run during onchange $("#fromDate").val(""); // some other code here } I have try to put in a onclick function in the dropdown, in this onclick function, I will set a variable to true. So that I can using this variable to do checking before run the $("#fromDate").val("");, like: if (onchangeOnly = true){ $("#fromDate").val(""); } However, I found that the onchange will run first compare with onclick. Any way or idea to doing this? kindly advise. EDIT : function updateView() { // some other code here if ($("#function").val() == "TODAY") { // some other code here.. } else if ($("#function").val() == "DATERANGE") { // here is the code that I only want to run during onchange $('[name="accountDateRange"]').on('change',function(){ alert('this is specific to this dropdown only'); }); } // some other code here } I found that, even my $("#function").val() is not equal to "DATERANGE", it will also print out the alert('this is specific to this dropdown only'). Kindly point out what is my mistake.
type: AnsweredQuestion

http://stackoverflow.com/comment/38603779
type: AnswerComment
type: Comment
has text: @sensorario, NodeJS **is server side**. It's just that it's written in javascript...
comment on: http://stackoverflow.com/a/24858411
score: 0

http://stackoverflow.com/q/24880890
tagged with: javascript
tagged with: jquery
score: 0
accepted answer: http://stackoverflow.com/a/24880997
answer count: 1
has title: How to set close browser or tab when open pop up
has body: How to set show alert when close browser or tab. I tried use of javascript and jquery but my problem is not solved yet. Please tell me if you have any script for only close browser or tab when open alert. But not show alert in refresh page it iss display alert only close browser or tab.
linked to: http://stackoverflow.com/q/3888902
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/333665
duplicate of: http://stackoverflow.com/q/3888902
has answer: http://stackoverflow.com/a/24880997
type: Question

http://stackoverflow.com/a/24817899
answers question: http://stackoverflow.com/q/24792758
type: Answer
has body: Yes you can specify the behavior of .findOne() as is best shown in the native driver documentation. The only difference there is that in the mongoose implemetation the "options" document must be the "third" argument passed to the method. So you can supply a "sort" specification to this as is shown in the available options: Queue.findOne({ },null,{ "sort": { "_id": -1 } },function(err,doc) { Just for additional information you can do this in the MongoDB shell with the following, using the $orderby query option: db.collection.findOne({ "$query": { }, "$orderby": { "_id": -1 } }) Also the .findOne() method may only return one document, but it really is just a wrapper around .find() so all of the modifiers apply. The wrapping just calls .next() on the returned cursor, returns the document and discards the cursor. This longer example shows different ways in which this can be applied: var async = require('async'), mongoose = require('mongoose'), Schema = mongoose.Schema; mongoose.connect('mongodb://localhost/sequence'); var queueSchema = new Schema({ name: String, same: { type: String, default: "same" } }); var Queue = mongoose.model( "Queue", queueSchema ); var count = 0; async.series( [ // Remove any documents function(callback) { Queue.remove(function(err) { if (err) throw err; callback(); }); }, // Insert some new ones function(callback) { async.eachSeries( ["one","two","three"], function(item,callback) { var queue = new Queue({ name: item }); queue.save(function(err,doc) { if (err) throw err; console.dir(doc); callback(err,doc); }); }, function(err) { callback(err); } ); }, function(callback) { async.whilst( function() { return count &lt; 2 }, function(callback) { count++ async.series( [ // findOne is just the first one function(callback) { Queue.findOne({ "same": "same" },function(err,doc) { if (err) throw err; console.log( "FindOne:\n%s", doc ); callback(); }); }, // Or is sorted function(callback) { Queue.findOne( { "same": "same" }, null, { "sort": { "_id": -1 } …
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/q/24813400
accepted answer: http://stackoverflow.com/a/24814111
has body: I'm incrementing a bootstrap progress bar using javascript (See below). Every time the progress bar starts, it seems to jump to above the starting value, and then falls back down and correctly animates. Perhaps the problem stems from the fact that the progress bar is hidden at first, but I've stepped through the code and it all looks fine. Does anybody know how to get a smooth increment in the bootstrap progress bar? Incrementing Javascript: $(".click").click(function() { $(".progress").removeClass('hidden'); var prog_bar = $(".progress-bar"); var val = 0; (function myLoop (i) { setTimeout(function () { val += 1; prog_bar.attr('aria-valuenow', val); prog_bar.css('width', val + '%'); if (--i) myLoop(i); }, 500) })(100); }); See the JSFiddle for an example: jsfiddle
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: progress-bar
favorite count: 0
score: 2
has answer: http://stackoverflow.com/a/24814111
type: AnsweredQuestion
upvote count: 2
tagged with: twitter-bootstrap
type: Question
has title: Strange jumping behaviour with Bootstrap progress bar

http://stackoverflow.com/comment/38469282
score: 0
comment on: http://stackoverflow.com/q/24787321
type: Comment
type: QuestionComment
has text: Not that its the problem but your < /body> tag is missing the >

http://stackoverflow.com/comment/38497215
type: QuestionComment
score: 1
has text: There is hardly any difference in visibility between a cookie and your page source.
comment on: http://stackoverflow.com/q/24802289
type: Comment

http://stackoverflow.com/q/24857038
has title: Weird markup/binding behavior while using angular
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/24857535
has comment: http://stackoverflow.com/comment/38601537
accepted answer: http://stackoverflow.com/a/24857535
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: This is not a major issue, but I've never seen the behavior I'm about to describe, and I thought if a group of people could help me understand it, it would be you guys. Basically, when I put a button in a header, my data-ng-click did not fire. When I wrote out the same line again, the click worked fine. My question is basically, am I missing something with my code that causes my issue? I'll go through the steps I've just followed to troubleshoot this; I have a page, it looks like; Title Click Me I click the button, the showMe function which is defined in $scope in my controller doesn't alert as I would expect. So, I modify my code; Click Me Title Click Me And the alert shows. So, I wonder if it's something to do with my putting the button in header causing some issues for whatever. Title Click Me And nothing works. So, I decided to type out the same button again, above the existing button and see if a particular element was causing an issue. I started with button with data-ng-click. Alert fires. I keep adding things back in until I get Click Me Click me And the new button works. So, I delete the new button, the old button doesn't work. I delete the old button, the new button works. I open the file in a text editor and show all characters, nothing out of the ordinary, it's not a result of any copy and paste mistake. I'm obviously going to leave the new button in place, but if I an explanation is possible, then I would like to try and get one.
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38601662
type: AnsweredQuestion

utf
tag name: utf
tags question: http://stackoverflow.com/q/24841330
type: Tag

http://stackoverflow.com/comment/38600672
type: Comment
has text: @HanHai you're welcome. See this line of yours `if(myMood==images[0]){`? Well, `myMood` is an document Element, not an Array, so `==` will always return `false`. `</scripts>` is not a valid HTML tag, your JS is way too complicated for such a simple task. Read: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse and good luck with coding!
comment on: http://stackoverflow.com/a/24856599
score: 0
type: AnswerComment

http://stackoverflow.com/a/24758939
has body: Assuming $rootScope.module === directiveScope.module Then this "problem" is because you de reference scope.module instead of mutating it: var original = {name:"original"} ; var copy = original;// copy is a reference to original (copy === original) copy.name="copy";//mutating copy changes original console.log(original.name);//=copy //re assigning copy de references original //copy no longer has a reference to original //and carries it's own value copy={name:"changed"}; console.log(original.name);//=copy (not changed) A common mistake when passing object variables, sometimes you want to mutate them but re assign them and thereby de reference them and sometimes you don't want to change them but accidentally do by mutating them (someArray.sort() or someArray.push("new Item") or someObject.newItem=88 ...). angular.extend does not re assign scope.module or $rootScope.module, the following: angular.extend(scope.module, { title: 'Redeclared' }); Is the same as but slower than: scope.module.title="Redeclared"; If rootScope.module was {somevar:22} then both code examples would end up with {somevar:22,title:"Redeclared"} It could be used for a situation where you have to mutate scope.module with a received json object: scope.module.prop1 = receivedJSON.prop1; scope.module.prop2 = receivedJSON.prop2; //...many more scope.module.prop100 = receivedJSON.prop100; Would be a lot shorter with: angular.extend(scope.module, receivedJSON);
answers question: http://stackoverflow.com/q/24757601
downvote count: 0
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/a/24758487
answers question: http://stackoverflow.com/q/24757599
accepted answer of: http://stackoverflow.com/q/24757599
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
has body: You can do this in two ways: Run your script under 32-bit Windows Script Host (%windir%\SysWOW64\wscript.exe). In the script code, use the key name without Wow6432Node: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\CCleaner\DisplayVersion Read the registry using the WMI StdRegProv class and force the 32-bit mode using the __ProviderArchitecture flag. Here's an example: var HKEY_LOCAL_MACHINE = 0x80000002; var sValue = ReadRegStr(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\CCleaner", "DisplayVersion", 32); // &lt;------------ WScript.Echo(sValue); // Reads a REG_SZ value from the local computer's registry using WMI. // Parameters: // RootKey - The registry hive (see http://msdn.microsoft.com/en-us/library/aa390788.aspx for possible values). // Key - The key that contains the needed value. // Value - The value to get. // RegType - The registry bitness: 32 or 64. function ReadRegStr (RootKey, KeyName, ValueName, RegType) { var oCtx = new ActiveXObject("WbemScripting.SWbemNamedValueSet"); oCtx.Add("__ProviderArchitecture", RegType); var oLocator = new ActiveXObject("WbemScripting.SWbemLocator"); var oWMI = oLocator.ConnectServer("", "root\\default", "", "", "", "", 0, oCtx); var oReg = oWMI.Get("StdRegProv"); var oInParams = oReg.Methods_("GetStringValue").Inparameters; oInParams.Hdefkey = RootKey; oInParams.Ssubkeyname = KeyName; oInParams.Svaluename = ValueName; var oOutParams = oReg.ExecMethod_("GetStringValue", oInParams, 0, oCtx); return oOutParams.SValue; }

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

http://stackoverflow.com/comment/38607554
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24860160
has text: Oh, like that. I can't point you to specific things right now but I think you're best off looking into jQuery functions for this, rather than trying to build this from scratch. I'll gladly give it a shot if no answer is posted in a few hours time.
score: 0

http://stackoverflow.com/a/24856933
downvote count: 0
has comment: http://stackoverflow.com/comment/38601134
answers question: http://stackoverflow.com/q/24856789
has body: Here's a FIDDLE Title 1 Item 1 Item 2 Item 3 Title 2 Item 4 Item 5 Title 3 Item 6 Item 7 Item 8 Item 9 input { width: 252px; height: 28px; padding: 0 4px; line-height: 20px; border: 1px solid #ddd; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; } input:focus { outline: none; } input:focus + .hints-menu { display: block; } .hints-menu { background: #fff; position: relative; display: none; width: 240px; margin-top: 10px; padding: 10px; border: 1px solid #ddd; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; } .hints-menu:before, .hints-menu:after { bottom: 100%; left: 83%; border: solid transparent; content: ""; height: 0; width: 0; position: absolute; pointer-events: none; } .hints-menu:before { border-color: transparent; border-bottom-color: #ddd; border-width: 9px; margin-left: -9px; } .hints-menu:after { border-color: transparent; border-bottom-color: #fff; border-width: 8px; margin-left: -8px; } .hints-title, .hint { display: block; width: 100%; height: 22px; line-height: 22px; color: #555; } .hints-title { margin: 5px 0; text-align: center; font-size: 15px; } .hint { cursor: pointer; font-size: 14px; } .hint:hover { color: #6fa024; } and for .hint title you can use jQuery UI Tooltip
has comment: http://stackoverflow.com/comment/38601228
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/38601175
upvote count: 2
accepted answer of: http://stackoverflow.com/q/24856789
type: AcceptedAnswer

http://stackoverflow.com/comment/38675879
has text: Hint: `("yes" || "no")` is equivalent to `true`.
comment on: http://stackoverflow.com/q/24896638
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24855087
has body: I have a SELECT element and also a INPUT element on a form and I need to get always the concatenated value (the result of SELECT + INPUT) when any of those two elements are updated this include: SELECT change the selected value User start typing in INPUT element But I don't know how to achieve this. See this example below: J G V E Input values could be: select#rif = "J" input#username ="string" output = "Jstring" select#rif = "V" input#username ="str" output = "Vstr" But then I leave input#username without changes but change select#rif as follow: select#rif = "J" input#username ="str" output = "Jstr" select#rif = "V" input#username ="str" output = "Vstr" In other words the concatenation needs to be in both direction and output value should change all the time when select change their selected value or input change the text inside it by keyup or any other event. Can any give me some help?
has answer: http://stackoverflow.com/a/24855171
type: Question
has comment: http://stackoverflow.com/comment/38597122
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24855158
has comment: http://stackoverflow.com/comment/38597106
has title: Concatenate values as their are typing or when select changes
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24855151
accepted answer: http://stackoverflow.com/a/24855158
has answer: http://stackoverflow.com/a/24855151

angular-resource
tags question: http://stackoverflow.com/q/24874780
tag name: angular-resource
tags question: http://stackoverflow.com/q/24760214
type: Tag
tags question: http://stackoverflow.com/q/24874871

http://stackoverflow.com/a/24864681
score: 1
downvote count: 0
has body: Hi i have updated the jsfiddle provided by you please go through that.. its working fine and you can add code into the click method according to your need. Link for jsfiddle:- http://jsfiddle.net/TnbYm/14/
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/24863359

http://stackoverflow.com/comment/38640113
has text: so if you think that it's fine and you don't agree with other people's opinion - what your "question" is about then?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24877371
type: QuestionComment

http://stackoverflow.com/comment/38576316
type: Comment
score: 0
type: AnswerComment
has text: @charliefl this is pretty much what I was trying to do. I was not familiar with the second part though, so thank you for that!
comment on: http://stackoverflow.com/a/24843933

http://stackoverflow.com/q/24861403
answer count: 1
accepted answer: http://stackoverflow.com/a/24861505
has comment: http://stackoverflow.com/comment/38609004
has answer: http://stackoverflow.com/a/24861505
has body: I am having a json array which I want to parse it to a map object. The key should be the state and the value should be an array objects which has the same state. The sample json is given below: { "totalRec": 10, "content": [ { "name": "Pradeep", "age": "24", "state": "KA" }, { "name": "Praveen", "age": "30", "state": "KA" }, { "name": "Navnish", "age": "32", "state": "GOA" }, { "name": "Vinod", "age": "32", "state": "MH" }, { "name": "Vikas", "age": "32", "state": "MH" }, { "name": "Harry", "age": "44", "state": "MP" }, { "name": "Linda", "age": "22", "state": "GOA" }, { "name": "June", "age": "18", "state": "KA" }, { "name": "Sachin", "age": "32", "state": "GOA" }, { "name": "Arjun", "age": "30", "state": "UP" } ] } I tried using Underscore.js and used the following code: var some_map = _.object(_.map(data.content, function(item) { return [item.state, item] })); But the above code does not give me a list object as a value for a particular state. I want the value to hold all the objects which contain the state as key. Can you please let me know where I am going wrong?
type: AnsweredQuestion
has title: Parsing the json array to map using Underscore.js
tagged with: underscore.js
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38609043
score: 0
has comment: http://stackoverflow.com/comment/38609103

http://stackoverflow.com/q/24842049
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
has body: Is it possible to use a getJSON request inside another getJSON request, using jQuery? Something like this: // Population the Requests List // jQuery AJAX call for JSON $.getJSON( '/workspace/friends/sentRequests', function( data ) { // For each item in our JSON, add a table row and cells to the content string $.each(data, function(){ //Loading each user data into global variable. $.getJSON( '/workspace/friends/' + this.friendId, function( user ) { requestListData.push(user); }); requestTableContent += ' '; requestTableContent += ' ' + this.name + ' '; requestTableContent += ' ' + this.email + ' '; requestTableContent += ' ' + moment(useListData[-1].activity.date_established).format('MMMM Do YYYY') + ' '; requestTableContent += ' ' + this.gender + ' '; requestTableContent += ' Danger! '; }); // Inject the whole content string into our existing HTML table $('#requestList table tbody').html(requestTableContent); }); I was wondering if this is possible? And if so what I'm doing wrong here... EDIT: I'm asking this because it should populate a table with the data from the getJSON requests but it's not.
has answer: http://stackoverflow.com/a/24842199
favorite count: 0
accepted answer: http://stackoverflow.com/a/24842343
possible better answer: http://stackoverflow.com/a/24842199
upvote count: 2
has title: jQuery: Is it possible to use a getJSON request inside another getJSON request?
tagged with: getjson
has comment: http://stackoverflow.com/comment/38571759
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38572060
has comment: http://stackoverflow.com/comment/38572146
type: Question
answer count: 2
score: 2
has answer: http://stackoverflow.com/a/24842343

http://stackoverflow.com/comment/38495726
comment on: http://stackoverflow.com/a/24801318
score: 2
type: AnswerComment
type: Comment
has text: i think this is overwhelming for him... first of all he must know that 'function return' means...

http://stackoverflow.com/comment/43971945
score: 0
type: Comment
type: QuestionComment
has text: Hi have you got the answer..
comment on: http://stackoverflow.com/q/24753638

http://stackoverflow.com/comment/38641601
type: Comment
score: 0
type: QuestionComment
has text: I thought I was using...
comment on: http://stackoverflow.com/q/24878480

http://stackoverflow.com/q/24860128
type: Question
has comment: http://stackoverflow.com/comment/38607407
has comment: http://stackoverflow.com/comment/38610595
tagged with: http-status-code-400
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38606895
has comment: http://stackoverflow.com/comment/38607807
accepted answer: http://stackoverflow.com/a/24864190
has comment: http://stackoverflow.com/comment/38609367
score: 0
has comment: http://stackoverflow.com/comment/38612877
has body: I HAVE to make a PUT request but no matter what I try I get the statuscode 400 which means "The request cannot be fulfilled due to bad syntax." I can't figure out where the problem is. Here's the request part (using knockoutjs and dropwizard): self.save = function(person){ $.ajax("/testtest/hello-world?", { data: person, type: "PUT", contentType: "application/json" }); }; It doesn't even reach the servlet and as far as I know the URL is correct. Here's the request message: 0:0:0:0:0:0:0:1 - - [21/Jul/2014:08:02:45 +0000] "PUT /testtest/hello-world? HTTP/1.1" 400 - "http://localhost:8080/testtest/assets/index.htm" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36" 19 and the error message: Unrecognized token 'name': was expecting 'null', 'true', 'false' or NaN
has comment: http://stackoverflow.com/comment/38610570
has comment: http://stackoverflow.com/comment/38607291
has comment: http://stackoverflow.com/comment/38607012
has title: JSON PUT returns statuscode 400
tagged with: put
has comment: http://stackoverflow.com/comment/38609684
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38606666
has answer: http://stackoverflow.com/a/24864190

http://stackoverflow.com/comment/38667672
comment on: http://stackoverflow.com/q/24892315
score: 0
type: QuestionComment
has text: So if I understand correctly, you want to reverse what it does right now. You want it to check all the parent boxes upon checking a child box.
type: Comment

http://stackoverflow.com/comment/38774250
type: Comment
comment on: http://stackoverflow.com/a/24849117
has text: Well, I still haven't been able to fix it. But that might be because of my poor javascript knowledge.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38501348
has text: Derek it passes a JSON validator, cookie monster - I need it for unit testing
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24792818

http://stackoverflow.com/q/24791995
has body: I can use javascript to determine if the screen is touch device, but I can't translate that to PHP in order to include a specific file. &lt;script&gt; function isTouchDevice() { return 'ontouchstart' in window || !!(navigator.msMaxTouchPoints); } if(isTouchDevice()) { document.getElementById('touch').value = 1; } else { document.getElementById('touch').value = 0; } &lt;/script&gt; &lt;body&gt; &lt;input type='hidden' id='touch' value='0'/&gt; &lt;?php // This is where i need help // and yes...i know the code below is not proper php its just what i want to achieve. -- if ([touch screen is true]) then.... include ("sections/blog_widget_mobile.php"); else { include ("sections/blog_widget.php"); } ?&gt; I can't find a php version of the javascript function isTouchDevice(), so i thought the best way would be to apply a value to an html element and try to retrieve that value via php. Can anyone help? Any advice is appreciated
accepted answer: http://stackoverflow.com/a/24792294
favorite count: 0
has answer: http://stackoverflow.com/a/24792490
has title: PHP include specific file if screen is touch device?
has comment: http://stackoverflow.com/comment/38478384
tagged with: php
has comment: http://stackoverflow.com/comment/38478664
has answer: http://stackoverflow.com/a/24792294
possible better answer: http://stackoverflow.com/a/24792490
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/38478466
downvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/38478380
answer count: 2
tagged with: mobile
tagged with: javascript
upvote count: 2
tagged with: touch

http://stackoverflow.com/comment/38658181
type: Comment
score: 0
has text: define 'not giving proper output'
type: QuestionComment
comment on: http://stackoverflow.com/q/24887497

http://stackoverflow.com/q/24825577
has comment: http://stackoverflow.com/comment/38541581
score: 2
tagged with: cordova
upvote count: 2
possible better answer: http://stackoverflow.com/a/24825962
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24825962
has answer: http://stackoverflow.com/a/24829755
type: Question
has body: I am using Phonegap to develop an mobile app. Unlike web application, an mobile app is a static client which is updated less frequently than expected. Moreover, version management is required to maintain the dependency between server and client end. I am thinking about a way to make the mobile app more like a pure browser. And here is a potential solution. The initial index.html in Phonegap app gets the latest version from server and compares the version number cached in the browser/WebView; If the current version is behind the latest, it fetches the remote homepage and replaces the whole html document and caches the latest version number; Pros: No more need to publish new version of mobile apps; All platforms (mobile and web) use the latest version, no more manual update is required; Cons: Obvious delay when updating to new version, including the first launch; All scripts and styles must be cached in localStorage to prevent browser from reloading these files unexpectedly. I am sure some of you must have the same problem or idea. I will really appreciate if you share your thoughts here.
answer count: 2
tagged with: mobile
downvote count: 0
has title: A crazy but elegant solution to seamlessly update a hybrid app
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/24829755
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/38650988
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24883654
score: 0
has text: Have you removed the document ready handler to make the example shorter? If not, you need one.

javascript
tags question: http://stackoverflow.com/q/24845979
tags question: http://stackoverflow.com/q/24788016
tags question: http://stackoverflow.com/q/24820869
tags question: http://stackoverflow.com/q/24810788
tags question: http://stackoverflow.com/q/24900994
tags question: http://stackoverflow.com/q/24787242
tags question: http://stackoverflow.com/q/24771218
tags question: http://stackoverflow.com/q/24882721
tags question: http://stackoverflow.com/q/24871180
tags question: http://stackoverflow.com/q/24806167
tags question: http://stackoverflow.com/q/24817582
tags question: http://stackoverflow.com/q/24840135
tags question: http://stackoverflow.com/q/24843363
tags question: http://stackoverflow.com/q/24826740
tags question: http://stackoverflow.com/q/24783142
tags question: http://stackoverflow.com/q/24806255
tags question: http://stackoverflow.com/q/24817109
tags question: http://stackoverflow.com/q/24786381
tags question: http://stackoverflow.com/q/24798950
tags question: http://stackoverflow.com/q/24845736
tags question: http://stackoverflow.com/q/24817055
tags question: http://stackoverflow.com/q/24896172
tags question: http://stackoverflow.com/q/24883344
tags question: http://stackoverflow.com/q/24831496
tags question: http://stackoverflow.com/q/24857251
tags question: http://stackoverflow.com/q/24888138
tags question: http://stackoverflow.com/q/24865980
tags question: http://stackoverflow.com/q/24836801
tags question: http://stackoverflow.com/q/24862097
tags question: http://stackoverflow.com/q/24888024
tags question: http://stackoverflow.com/q/24794543
tags question: http://stackoverflow.com/q/24813461
tags question: http://stackoverflow.com/q/24770101
tags question: http://stackoverflow.com/q/24779873
tags question: http://stackoverflow.com/q/24780333
tags question: http://stackoverflow.com/q/24866059
tags question: http://stackoverflow.com/q/24805874
tags question: http://stackoverflow.com/q/24881418
tags question: http://stackoverflow.com/q/24778909
tags question: http://stackoverflow.com/q/24881440
tags question: http://stackoverflow.com/q/24750943
tags question: http://stackoverflow.com/q/24772668
tags question: http://stackoverflow.com/q/24864080
tags question: http://stackoverflow.com/q/24905344
tags question: http://stackoverflow.com/q/24909114
tags question: http://stackoverflow.com/q/24868806
tags question: http://stackoverflow.com/q/24908766
tags question: http://stackoverflow.com/q/24893756
tags question: http://stackoverflow.com/q/24900788
tags question: http://stackoverflow.com/q/24855004
tags question: http://stackoverflow.com/q/24761782
tags question: http://stackoverflow.com/q/24869545
tags question: http://stackoverflow.com/q/24791978
tags question: http://stackoverflow.com/q/24774529
tags question: http://stackoverflow.com/q/24832286
tags question: http://stackoverflow.com/q/24790350
tags question: http://stackoverflow.com/q/24896460
tags question: http://stackoverflow.com/q/24824603
tags question: http://stackoverflow.com/q/24878449
tags question: http://stackoverflow.com/q/24882150
tags question: http://stackoverflow.com/q/24907135
tags question: http://stackoverflow.com/q/24794946
tags question: http://stackoverflow.com/q/24765465
tags question: http://stackoverflow.com/q/24760341
tags question: http://stackoverflow.com/q/24840310
tags question: http://stackoverflow.com/q/24769579
tags question: http://stackoverflow.com/q/24832025
tags question: http://stackoverflow.com/q/24880454
tags question: http://stackoverflow.com/q/24812555
tags question: http://stackoverflow.com/q/24892988
tags question: http://stackoverflow.com/q/24837571
tags question: http://stackoverflow.com/q/24793505
tags question: http://stackoverflow.com/q/24845143
tags question: http://stackoverflow.com/q/24793070
tags question: http://stackoverflow.com/q/24800391
tags question: http://stackoverflow.com/q/24784373
tags question: http://stackoverflow.com/q/24749467
tags question: http://stackoverflow.com/q/24773621
tags question: http://stackoverflow.com/q/24853292
tags question: http://stackoverflow.com/q/24754197

http://stackoverflow.com/q/24775647
has answer: http://stackoverflow.com/a/24776379
tagged with: regex
has body: I have a function where I get some values dynamically and I send them to other function. function sample(){ //some code here var latlong1=//some value; var latlong2=//some value; fnSplitString(latlong1,latlong2); } I am sending these values to a function say function fnSplitString(l1,l2) { alert("Latlong1::::"+l1); alert("LatLong2::::"+l2); var splitStringLatLong=l1.split(","); alert("split1"+splitStringLatLong[0]); alert("split2"+splitStringLatLong[1]); } here my 'l1' and 'l2' are alerting the values properly as. Latlong1::::lat=78.23456,long=26.56789 Latlong2::::lat=74.57585,long=22.67890 I want to extract only the numeric values from these two strings. Hence I tried splitting it first till comma. But the split is not working at all. I do not get any alert message. Where is the mistake? And how do I extract only numeric from the string?
has comment: http://stackoverflow.com/comment/38446971
type: Question
has comment: http://stackoverflow.com/comment/38447319
has comment: http://stackoverflow.com/comment/38446907
has comment: http://stackoverflow.com/comment/38447392
tagged with: javascript
has title: Split a string in javascript not working
has comment: http://stackoverflow.com/comment/38447145
score: 0
has comment: http://stackoverflow.com/comment/38447075
answer count: 3
has answer: http://stackoverflow.com/a/24775957
has comment: http://stackoverflow.com/comment/38447320
has answer: http://stackoverflow.com/a/24775857
has comment: http://stackoverflow.com/comment/38447515
type: UnansweredQuestion

http://stackoverflow.com/comment/38552582
score: 0
comment on: http://stackoverflow.com/a/24831628
type: Comment
has text: I tried that. It shouldn't make a difference if I assigned the data to the global var obj.
type: AnswerComment

http://stackoverflow.com/comment/38681345
type: QuestionComment
has text: The delay is gonna be inevitable since there is travelling & waiting to receive/append involved. A suggestion to try, if you haven't, is maybe using a (javascript?) timer to play video (after ~100 ms delay) or send message (~100 ms before video play) to attempt some basic syncing.. But can message be sent before video playing?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24897963

http://stackoverflow.com/comment/38584838
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24848761
has text: Can you store a config for that user that has a boolean of whether or not they have credentials? like `if ( user.pass )`

http://stackoverflow.com/comment/45133867
score: 0
type: Comment
type: QuestionComment
has text: Actually i did, i didn't use any connection points, simply created a setter function that receives IDispatch* and stores it into a CComPtr<IDispatch>, later on invoked the callback using InvokeN().
comment on: http://stackoverflow.com/q/24755799

http://stackoverflow.com/a/24857210
score: 2
upvote count: 2
has body: First of all, give the div an id: &lt;div id="myDiv"&gt; 1 &lt;br /&gt; 2 &lt;br /&gt; 3 &lt;br /&gt; 4 &lt;/div&gt; Then: &lt;script&gt; // Take the content of the div and split it into an array var numbers = document.getElementById("myDiv").innerHTML.split(" &lt;br&gt; "); // Store the length of the array into a variable for repeated use in a loop var length = numbers.length; // Create a variable with zero value var sum = 0; // Iterate over the elements of the array and ... // keep adding them to the variable just created for(var i = 0; i &lt; length; i++){ // Because the elements of the array are strings ... // Convert them to numbers with the javascript function parseInt() sum += parseInt(numbers[i]); } // Now your sum is ready; alert it or use it in some other way alert(sum); &lt;/script&gt; DEMO
answers question: http://stackoverflow.com/q/24857146
accepted answer of: http://stackoverflow.com/q/24857146
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/38430910
score: 1
type: AnswerComment
type: Comment
has text: No, `this` is referring to the caller of its surrounding function, which is your firebase event callback. I'm not sure what firebase calls its event callbacks with, but after a quick debugging it looks to just be undefined. Edit: undefined, not window object.
comment on: http://stackoverflow.com/a/24767094

http://stackoverflow.com/comment/38552957
type: Comment
comment on: http://stackoverflow.com/q/24831795
score: 0
has text: I haven't done anything yet, I've just been researching and trying to find examples online.
type: QuestionComment

http://stackoverflow.com/q/24898044
type: Question
possible better answer: http://stackoverflow.com/a/24898157
has body: Is there a way to convert a string from a JavaScrip variable, into a downloadable file that users can download when clicking a button ? Thanks for any advice. Lorem Ipsum Download text as file !
accepted answer: http://stackoverflow.com/a/24898081
has answer: http://stackoverflow.com/a/24898157
has title: Is possible to save JavaScript variable as file?
upvote count: 36
tagged with: javascript
answer count: 3
favorite count: 0
has comment: http://stackoverflow.com/comment/38678486
linked to: http://stackoverflow.com/q/3665115
duplicate of: http://stackoverflow.com/q/3665115
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38678391
score: 35
has answer: http://stackoverflow.com/a/24898081
has comment: http://stackoverflow.com/comment/121668452
has answer: http://stackoverflow.com/a/24898263
downvote count: 1

http://stackoverflow.com/a/24782816
has comment: http://stackoverflow.com/comment/38460459
score: 4
answers question: http://stackoverflow.com/q/24782775
has comment: http://stackoverflow.com/comment/38460369
has comment: http://stackoverflow.com/comment/38460607
has comment: http://stackoverflow.com/comment/38460391
type: Answer
upvote count: 4
downvote count: 0
has body: This happens because of Angular $injector. When you provide an array as 2nd argument for .controller, the $injector tries to find all dependencies listed on it by their name and then inject them to the array's last element (which must be a function), so in your case, this is what happens: 'testFactory' -&gt; $scope undefined -&gt; $http undefined -&gt; $rootScope Your code should be either like this: as.controller('Test', ['$scope', '$http', '$rootScope', 'testFactory', function($scope, $http, $rootScope, testFactory) { // ... ... or like this: as.controller('Test', function($scope, $http, $rootScope, testFactory) { // ... Edit: As @sp00m stated, the second example should not be used if you are going to uglify (minify) your code, because the uglifier algorithm will replace those identifiers with something like: function(a, b, c, d) And then AngularJS will not be able to find those dependencies anymore, whereas the first example would look like this: ['$scope', '$http', '$rootScope', 'testFactory', function(a, b, c, d) Which is valid, because you are explicitly telling Angular which dependencies it must inject.

http://stackoverflow.com/q/24861148
tagged with: google-maps
has answer: http://stackoverflow.com/a/24861419
answer count: 1
accepted answer: http://stackoverflow.com/a/24861419
tagged with: jquery
tagged with: css
type: AnsweredQuestion
has title: How to give marker a z-index wild-googlemaps
has body: Probably impossible without using an API, but I'm going to ask anyway because it would save me so much pain and tears. Is there a way to give a googlemaps marker a z-index without using the API? I've got the plug-in called Wild-Googlemaps implemented on my wordpress site. And I've created a googlemaps div, with an overlaying div set to opacity:0.7 for styling purposes. Now I've lost the ability to click the marker, so I need to somehow change its z-index. Anyone had this problem or has any ideas? Much appreciated. Thanks in advance.
type: Question
tagged with: javascript
score: 0

http://stackoverflow.com/comment/38522493
comment on: http://stackoverflow.com/q/24814004
has text: It's not the `.css` that needs a callback, but the "*fire a different segment of code*". What exactly is that?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38652367
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24884296
type: AnswerComment
has text: FYI added demo, explanation and second option. :)

http://stackoverflow.com/comment/38442041
comment on: http://stackoverflow.com/q/24772364
type: QuestionComment
type: Comment
has text: thank you so much.i am going through it.but there is a problem i really don't know what will be the customer/user setup in terms of browsers.so is there any alternate of canvas ?
score: 0

http://stackoverflow.com/q/24784939
has body: I would like to send some data to a Meteor server, from a small bit of Javascript on a third-party domain. I would like to send lots of small things, as they happen, so I would like to use an io-socket. I can imagine a few ways of doing this: Connect to meteor's socket-io and "piggyback" it. Send custom events (namespaced to avoid collision), and somehow catch these on the server side. But I can't find the socket object to attach to on the server! Connect to meteor's socket-io, and pretend to be a meteor client. Catch messages with standard meteor functions on the server side. Is it possible to talk like a meteor client without a lot of protocol? Open a second IO socket listener on the server, and have clients attach to that. For that I would need to find the 'app' object. Run a completely separate Node process and have clients talk to that; it could save in the same MongoDB that Meteor uses. I could do this, but I liked the idea of keeping everything in one process. Also, I'm not sure if it would fire update events in Meteor. I would really like help with #1: Where can I find the iosocket object on the server? Failing that, is #2 feasible? How can I talk like a Meteor client?
tagged with: socket.io
has answer: http://stackoverflow.com/a/24785740
type: Question
upvote count: 2
answer count: 1
linked to: http://stackoverflow.com/q/14174281
tagged with: javascript
linked to: http://stackoverflow.com/q/15931368
has title: Send data to Meteor over iosocket, but not from a Meteor client (piggyback Meteor's io-socket)
has comment: http://stackoverflow.com/comment/38465565
tagged with: meteor
tagged with: node.js
favorite count: 0
score: 2
downvote count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/38578832
has text: I would recommend listening to JavaScript's `click` event and adding a CSS class to the appropriate div in the event handler. Then, apply whatever styles you'd like to in your CSS.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24845736
type: Comment

http://stackoverflow.com/a/24865722
upvote count: 2
accepted answer of: http://stackoverflow.com/q/24852015
has body: One reason could be that the jQuery library is loaded again and the widget's data is lost. Other similar issues covered in our troubleshooting section.
has comment: http://stackoverflow.com/comment/60034038
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/24852015
has comment: http://stackoverflow.com/comment/40623511

http://stackoverflow.com/comment/38490458
type: AnswerComment
type: Comment
has text: Plus, I just checked it again and ajax functionality in select2 is available only through search, and I need all the retreived options to show up.
score: 1
comment on: http://stackoverflow.com/a/24798334

internet-explorer-9
tag name: internet-explorer-9
tags question: http://stackoverflow.com/q/24825075
tags question: http://stackoverflow.com/q/24828066
tags question: http://stackoverflow.com/q/24812754
tags question: http://stackoverflow.com/q/24873093
type: Tag
tags question: http://stackoverflow.com/q/24892523

http://stackoverflow.com/comment/38614031
score: 0
comment on: http://stackoverflow.com/q/24864080
type: Comment
type: QuestionComment
has text: Please post some of code snippets you have tried so far.As the reference links might not exist anymore.

http://stackoverflow.com/q/24809870
tagged with: ruby-on-rails
has title: Using jbuilder variables in jquery
type: Question
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
tagged with: jbuilder
has body: I have my jbuilder variables posting a response on a form update (ex: update.html.erb update.js.builder) and I was just wondering how I go about using these variables in my jquery functions to update texts fields within a view after an update. Just to clarify I am using ruby on rails 4. Example I have an update action that's handled by a remote ajax call. update.js.builder: json.extract! @person, :name, :gender My response from builder after form update is: {"name":"Mark","gender":"Male"} I just want to access these variables in my jquery syntax so that I can change certain html id's text using these new instances. My question is how do I use/access these json variables in my jquery file? Do I need to convert them to javascript variables or do I have access to them and if so, how?
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/a/24842573
type: Answer
answers question: http://stackoverflow.com/q/24828560
accepted answer of: http://stackoverflow.com/q/24828560
type: AcceptedAnswer
score: 0
has body: Solved, and only requiring HTML. I just needed to amend the action of my FormA tag to the URL of FormB, like so: <-- form fields -->

http://stackoverflow.com/q/24788258
has answer: http://stackoverflow.com/a/24788735
type: Question
tagged with: ember-data
has body: I have code which at one point runs this line: var searchData = that.store.find("searchResult",{key: searchKey}); Essentially, I am trying to fetch all instances of the model searchResult. My model code is as follows: App.SearchResult = DS.Model.extend({ searchResultID: DS.attr('number'), entityID: DS.attr('number'), entityTypeID: DS.attr('number'), entityType: DS.attr('string'), searchText: DS.attr('string'), }); This is pretty much all I have with respect to searcHRestult on the client side. On the server side, I handle GET requests to the /searchResults route. this.resource('searchResults', {path: '/searchResults'}); The above is added to Ember Router. I will however require to pass in a parameter {criteria: "user location" } through this route. The idea is that on the server side, my code will search this criteria parameter, then only run sql based on what criteria is needed. (i.e. if criteria = "user location", the code will run the sql related to "user" and "location"). However, on the server side, when I check the value of request.params, the value shows to be []. So when I do: var searchData = that.store.find("searchResult",{criteria: "user location"}); The criteria parameter never shows server side. Even with the first line of code I posted here, the searchKey never shows server side. Am I missing something here? Do I have to do anything to enable parameter passing through to the server side ? (I am using node.js as server).
tagged with: javascript
score: 0
tagged with: ember.js
answer count: 1
has title: Appending Parameters to ember data request?
type: UnansweredQuestion

http://stackoverflow.com/comment/38407584
comment on: http://stackoverflow.com/a/24754771
score: 0
type: AnswerComment
has text: Thank you, Miraage! But it's only simple example. Can we set variable in this function? I have other function named isUser() to check user logged in or not. Please check the Jsfiddle. [http://jsfiddle.net/0udm9/9dPsb/6/](http://jsfiddle.net/0udm9/9dPsb/6/) Thanks
type: Comment

http://stackoverflow.com/q/24810955
has answer: http://stackoverflow.com/a/24811339
tagged with: google-chrome-extension
has title: chrome.storage.sync.get Alert not working
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24811339
has body: I have saved this setting: function save_options() { var tbColor = document.getElementById('Color').value; chrome.storage.sync.set({ 'tbColor': Color }, function() { var status = document.getElementById('status'); status.textContent = 'Settings were saved.'; setTimeout(function() { status.textContent = ''; }, 750); }); } and now I'm trying to see the setting via: alert(chrome.storage.sync.get({'tbColor'})); But I'm getting nothing (no alert shows). I know the overall thing is working because alert("Hello"); works. What am I doing wrong with getting these settings? I'm new, so please be easy on me :)
type: Question
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/comment/38637280
has text: @OscarJara yes I am trying it
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24875804
type: Comment

http://stackoverflow.com/comment/38454866
has text: @Jordan The regex stops before the tag because the --> marks the end of the comment.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24770128
type: AnswerComment

http://stackoverflow.com/comment/38595153
type: QuestionComment
comment on: http://stackoverflow.com/q/24854165
has text: http://stackoverflow.com/questions/242813/when-to-use-double-or-single-quotes-in-javascript
score: 0
type: Comment

http://stackoverflow.com/q/24871180
has answer: http://stackoverflow.com/a/24871313
score: 2
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/38627758
type: Question
upvote count: 2
answer count: 5
tagged with: addition
has body: I don't understand why in this example addition doesn't work: Click function handler(){ var button = document.getElementById('button'), count = document.getElementById('counter'); // count.textContent = 0; button.onclick = function(){ count.textContent++; //Why this works //but this does not //count.textContent + 1; console.log(typeof count.textContent); // Why is a string? } } window.onload = handler; And why (typeof count.textContent) is a string?
has answer: http://stackoverflow.com/a/24871404
has answer: http://stackoverflow.com/a/24871326
has title: Post increment and addition
has answer: http://stackoverflow.com/a/24871268
has answer: http://stackoverflow.com/a/24871240
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38627686

http://stackoverflow.com/q/24777242
has comment: http://stackoverflow.com/comment/38451416
has comment: http://stackoverflow.com/comment/38459269
has title: Redirection or Refresh Page After Zip Download
has comment: http://stackoverflow.com/comment/38458887
has comment: http://stackoverflow.com/comment/38460116
has body: I am calling the servlet through href in my .vm file(as I am using velocity framwork for front end) when the request goes to servlet I am downloading a file on that. The file genration for downloading in takes around 30 seconds so I want to indicate end user through pop-up, For this I have called a function on same href in my .vm file which is opening a pop up indicating that file is generating currently so please wait. but when file generation and downloading finish I want to remove that pop up. I was tried this through redirection on servlet but after googled I found that we can't change the status of response after downloading (link). I am calling javascript function and servlet in my vm file like this Generate Report overriderulehandler is calling my servlet and I am preparing file for download here and reportResponse is JS function in which I am opening popup. Please suggest me how should I do this task. If anyone have other idea about this please share. Any help is appreciated.
score: 8
has answer: http://stackoverflow.com/a/24782527
tagged with: java
type: UnansweredQuestion
tagged with: servlets
linked to: http://stackoverflow.com/q/17921797
answer count: 2
has comment: http://stackoverflow.com/comment/38501839
linked to: http://stackoverflow.com/q/19596657
downvote count: 0
has comment: http://stackoverflow.com/comment/38459145
tagged with: javascript
has answer: http://stackoverflow.com/a/40402519
favorite count: 0
has comment: http://stackoverflow.com/comment/38456544
upvote count: 8
type: Question

http://stackoverflow.com/q/24828905
has answer: http://stackoverflow.com/a/24867739
type: Question
has body: How can I develop a custom widget behaving like this sample: http://jsfiddle.net/anilca/u2HF7/ Here is my kickstart reading, but I could not find out how to define the templates of dropdownlists and link them together by change events. (function($) { var kendo = window.kendo, ui = kendo.ui, Widget = ui.Widget; var Editable = Widget.extend({ init: function(element, options) { var that = this; Widget.fn.init.call(this, element, options); that._create(); }, options: { name: "Editable", value: " ", editable: false }, _create: function() { var that = this; // create dropdowns from templates and append them to DOM }, _templates: { dropDown: "?" } }); ui.plugin(Editable); })(jQuery);
tagged with: custom-controls
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: kendo-ui
has title: Developing custom kendo ui widget
accepted answer: http://stackoverflow.com/a/24867739
upvote count: 1
type: AnsweredQuestion
score: 1

http://stackoverflow.com/a/24836926
answers question: http://stackoverflow.com/q/24836678
has comment: http://stackoverflow.com/comment/38636632
has comment: http://stackoverflow.com/comment/38671882
has comment: http://stackoverflow.com/comment/38669307
score: 0
has body: You can use a common controller for both directives. The following example creates two isolated directive that uses a common controller called ControllerOfDir1Dir2. var app = angular.module('app', []); app.controller('TestController', ['$scope', function($scope){}]); app.directive('dir1', function(){ return { restrict: 'EA', template: ' Sample text of dir1 ', scope: {}, link: ControllerOfDir1Dir2 }; }); app.directive('dir2', function(){ return { restrict: 'EA', template: ' Sample text of dir2 ', scope: {}, link: ControllerOfDir1Dir2 }; }); function ControllerOfDir1Dir2(scope, element, attr){ // You can get the node name (dir1 or dir2) using element[0].nodeName var existingHtml = element.html(); element.find('div').html(existingHtml + " And some added text"); }
has comment: http://stackoverflow.com/comment/38683521
has comment: http://stackoverflow.com/comment/38630019
type: Answer
has comment: http://stackoverflow.com/comment/38659706
has comment: http://stackoverflow.com/comment/38630090

http://stackoverflow.com/comment/38673185
score: 2
has text: That's plainly incorrect, given things like the HTML5 [history API](https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history#Adding_and_modifying_history_entries).
type: AnswerComment
comment on: http://stackoverflow.com/a/24895260
type: Comment

http://stackoverflow.com/a/24931033
type: Answer
has body: In your first code, change while(){ ... $tempg = $tempg + (strtotime ( " +1 days", $tempg ) ); ... } to while(){ ... $tempg = strtotime ( " +1 days", $tempg ); ... } Then it will calculate "+1 day" correctly and store that date into the array $arraymonitor.
score: 0
answers question: http://stackoverflow.com/q/24764130

http://stackoverflow.com/q/24803128
answer count: 2
has body: I would like to display asp.NET page which contains 4 update panels and data refresh on button click and for the firsttime. My questions are below How to Load page content first and then data? I do not want to keep my dataload methods in page load Is there anyway to refresh the page/updatepanel from code behind ( I did call __dopostback event or javascript from code behind.. it did not work) Thanks for your help &lt;asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server"&gt; &lt;ContentTemplate&gt; &lt;button id="btnCrashRefresh" onserverclick="btnCrashRefresh_ServerClick" type="submit" runat="server" class="btn btn-default pull-right" style="padding-top: 0px;padding-bottom: 0px;"&gt;&lt;span class="glyphicon glyphicon-refresh" &gt;&lt;/span&gt;&lt;/button&gt; &lt;asp:Label ID="Label1" class=" label-info pull-right" runat="server" Text="&lt;Date time&gt;" &gt;&lt;/asp:Label&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; Code Behind System.Timers.Timer myTimer = new System.Timers.Timer(); protected void Page_Load(object sender, EventArgs e) { if (! Page.IsPostBack) { SetInitialValues(); btnCrashRefresh.ServerClick += new EventHandler(btnCrashRefresh_ServerClick); myTimer.Interval = 2000; myTimer.Elapsed += new ElapsedEventHandler(myTimer_Elapsed); myTimer.Start(); } } void myTimer_Elapsed(object sender, ElapsedEventArgs e) { string script = "DoPostback();"; ScriptManager.RegisterStartupScript(btnCrashRefresh, this.GetType(), "Refresh", getjQueryCode(script), true); } Javascript function DoPostback() { __doPostBack('&lt;%=btnCrashRefresh %&gt;'); }
tagged with: javascript
tagged with: asp.net
tagged with: ajax
has answer: http://stackoverflow.com/a/24803575
has title: Refresh gridview inside updatepanel after data available
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38498346
type: Question
has answer: http://stackoverflow.com/a/24803996
score: 0

http://stackoverflow.com/q/24899637
type: Question
tagged with: perspective
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38681604
has answer: http://stackoverflow.com/a/24899875
tagged with: css-transforms
has comment: http://stackoverflow.com/comment/38681845
has comment: http://stackoverflow.com/comment/38681969
has comment: http://stackoverflow.com/comment/38681569
answer count: 1
favorite count: 0
upvote count: 2
has title: CSS3 Animation conflicting with click
has comment: http://stackoverflow.com/comment/38681615
tagged with: css
accepted answer: http://stackoverflow.com/a/24899875
score: 2
type: AnsweredQuestion
has body: So I have an animation that starts if the input is clicked, it's sort of the Windows 8 animation when you long press or right click. My JS: $("body").on('click',function(e){ if($(e.target).closest(".img_list")){ var inp = $(e.target).closest(".img_list").find("input")[0]; if(inp.checked){ $(e.target).closest(".img_list").addClass("clicked tilting"); }else{ $(e.target).closest(".img_list").removeClass("clicked tilting"); } } }); And the CSS of the toggled class: @keyframes tilter{ 0%{ -webkit-transform: perspective(320px) rotate3d(0, 1, 0, -8deg); transform: perspective(320px) rotate3d(0, 1, 0, -8deg); } 25%{ -webkit-transform: perspective(320px) rotate3d(0, 1, 0, 8deg); transform: perspective(320px) rotate3d(0, 1, 0, 8deg); } 50%{ -webkit-transform: perspective(320px) rotate3d(0, 1, 0, -8deg); transform: perspective(320px) rotate3d(0, 1, 0, -8deg); } 75%{ -webkit-transform: perspective(320px) rotate3d(0, 1, 0, 8deg); transform: perspective(320px) rotate3d(0, 1, 0, 8deg); } 100%{ -webkit-transform: perspective(320px) rotate3d(0, 1, 0, -8deg); transform: perspective(320px) rotate3d(0, 1, 0, -8deg); } } But it's conflicting with my click event, for some reason the target is not there when I click. It's hard to explain so I wrote a fiddle for you here if you click like a madman you'll eventually see this happen. It also has my original code which was easier than this, and cleaner. Can someone explain to me as to why this is a conflict?

http://stackoverflow.com/comment/38493515
comment on: http://stackoverflow.com/a/24799660
score: 1
type: AnswerComment
has text: @Steve, TilwinJoy, well, that's what I ended up with: http://jsfiddle.net/BSN5u/22/. Looks like perversion, but nevertheless...
type: Comment

http://stackoverflow.com/comment/38423329
has text: not many people are willing to touch eval...
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24763234
score: 0

http://stackoverflow.com/q/24873446
tagged with: fadein
has answer: http://stackoverflow.com/a/24873556
upvote count: 1
type: AnsweredQuestion
score: 1
has body: I have this function which makes my divs "slide" randomly every 3 seconds: $(function () { $('.fadein p:gt(0)').hide(); setInterval(function () { var randomize = 1 + Math.floor(Math.random() * $('.fadein &gt; p').length); $('.fadein &gt; p').fadeOut(); $('.fadein &gt; :nth-child(' + randomize + ')').fadeIn(); }, 3000); }); Here's the fiddle. The problem is that sometimes the slides are the same (as the random number generated is the same twice in a row). Can you help me creating some variable to store the last number generated so when the function calls Math.random(), if that number equals the last number generated it calls it again.
type: Question
accepted answer: http://stackoverflow.com/a/24873556
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: jQuery Math.random: avoid repeating same item
possible better answer: http://stackoverflow.com/a/24874051
tagged with: random
has answer: http://stackoverflow.com/a/24874051
favorite count: 0

http://stackoverflow.com/q/24813176
has title: meteor, Error: Method not found, trying to test with velocity
has comment: http://stackoverflow.com/comment/38519245
has comment: http://stackoverflow.com/comment/38518331
type: Question
has comment: http://stackoverflow.com/comment/38519355
tagged with: javascript
tagged with: meteorite
score: 0
tagged with: meteor
tagged with: node.js
has body: I am a bit new to meteor. I am trying to write some unit tests for a meteorite app someone wrote, and I am having some trouble with some package stuff. When running mrt (er, sudo mrt because otherwise I get a permissions error, but that's a different issue), a Proxy is started, MongoDB is started, Jasmine-Unit is loaded, and Kadira completes instrumenting the app, but then I get this: W20140717-16:13:43.277(-4)? (STDERR) W20140717-16:13:43.278(-4)? (STDERR) /Users/Tyler/.meteor/tools/858c88b520/lib/node_modules/fibers/future.js:173 W20140717-16:13:43.278(-4)? (STDERR) throw(ex); W20140717-16:13:43.278(-4)? (STDERR) ^ W20140717-16:13:43.297(-4)? (STDERR) Error: Method not found [404] W20140717-16:13:43.297(-4)? (STDERR) at _.extend.apply (packages/livedata/livedata_server.js:1378) W20140717-16:13:43.298(-4)? (STDERR) at _.extend.call (packages/livedata/livedata_server.js:1348) W20140717-16:13:43.298(-4)? (STDERR) at app/server/js/server.js:6:8 W20140717-16:13:43.298(-4)? (STDERR) at app/server/js/server.js:13:3 W20140717-16:13:43.299(-4)? (STDERR) at /Users/Tyler/Documents/TylersAwesomeDocuments/ProgrammyStuff/AdTribStuff/Repos/djmustard/.meteor/local/build/programs/server/boot.js:155:10 W20140717-16:13:43.299(-4)? (STDERR) at Array.forEach (native) W20140717-16:13:43.300(-4)? (STDERR) at Function._.each._.forEach (/Users/Tyler/.meteor/tools/858c88b520/lib/node_modules/underscore/underscore.js:79:11) W20140717-16:13:43.300(-4)? (STDERR) at /Users/Tyler/Documents/TylersAwesomeDocuments/ProgrammyStuff/AdTribStuff/Repos/djmustard/.meteor/local/build/programs/server/boot.js:82:5 I'm not really sure what to make of it. livedata is not in the packages directory. Not sure how to debug this. Any help with the error itself or how to go about figuring it out? Thanks! EDIT: at app/server/js/server.js:6:8 6 Meteor.call('S3config', { 7 key: '&lt;key&gt;', 8 secret: '&lt;secret&gt;', 9 bucket: '&lt;bucket&gt;', 10 directory: '&lt;directory&gt;' 11 });
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38518528

http://stackoverflow.com/comment/38469421
type: AnswerComment
comment on: http://stackoverflow.com/a/24785497
type: Comment
score: 1
has text: I figured it out, I had to add t.selectAll("tspan")... after the transitions. That along with your helpful post answers my question!

http://stackoverflow.com/comment/38413879
type: Comment
score: 1
has text: If you make a JSfiddle... then people may be able to help you better...
comment on: http://stackoverflow.com/q/24758183
type: QuestionComment

http://stackoverflow.com/q/24823143
tagged with: http://stackoverflow.com/tag/html
tagged with: php
tagged with: css
has answer: http://stackoverflow.com/a/24823324
type: Question
has title: how to open image in a box by jquery fancy box
tagged with: javascript
has comment: http://stackoverflow.com/comment/38536065
score: 0
has body: I want open image in fancy box window... I tried to do this...but this is not working properly I tried my code is bellow: $('#show_dialog').click(function() { $.fancybox({ type: 'inline', content: '#img_url' }); }); by this i calling my fancy box window: Show Image this is the div whcih i want to show: <img src="<?php echo $image_with_url?>" /> Invoice No. : <?php echo $ordmaster['invoice_number'];?> Date : <?php echo getDateFormat($ordmaster['order_received_date'],1);?> <?php if($formPage==''){?> <img src="<?php echo theme_url(); ?>images/print-icon.png" alt="" style="vertical-align:middle; margin-right:5px;" />Print Page<?php }?>
answer count: 1
tagged with: jquery
type: UnansweredQuestion

http://stackoverflow.com/q/24905520
tagged with: jquery
favorite count: 0
answer count: 5
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24905847
tagged with: node.js
has answer: http://stackoverflow.com/a/24905576
type: UnansweredQuestion
has title: Change value of div with new entry and don't append
has answer: http://stackoverflow.com/a/24905613
type: Question
has body: I am totally new to coding. Please help.I am obtaining tweet text using node.js and displaying using html. When I input new text the result should replace earlier result in #tweets and not append to it # submit
score: 1
has answer: http://stackoverflow.com/a/24905583
upvote count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/24905780

http://stackoverflow.com/a/24855084
type: Answer
accepted answer of: http://stackoverflow.com/q/24854866
answers question: http://stackoverflow.com/q/24854866
score: 0
type: AcceptedAnswer
has body: The only way is to use php or any other backend coding language that can handle the file manipulation for you. Below is an example if you use php5 so you can have a clue: &lt;?php // Specify filename $filename = 'myJsonFile.json'; // Read data transforming them to an array $data = json_decode(file_get_contents($filename), true); // Push to the array a new pair array_push($data, ['key' =&gt; 'value']); // Open file for writing $file = fopen($filename, 'w'); // Write data as json fwrite($file, json_encode($data)); // Close file fclose($file); ?&gt;

http://stackoverflow.com/comment/38673029
comment on: http://stackoverflow.com/a/24894672
score: 0
type: Comment
has text: Thanks Aadil. I just moved the jquery script above the js, but it didn't make any difference.
type: AnswerComment

http://stackoverflow.com/comment/38474867
score: 0
type: AnswerComment
has text: Yes, the array is defined at first by me also. Usig $j.each gives me an "undefined" array completely. What's wrong here?
type: Comment
comment on: http://stackoverflow.com/a/24789933

http://stackoverflow.com/q/24781913
has comment: http://stackoverflow.com/comment/38458982
has answer: http://stackoverflow.com/a/24782746
accepted answer: http://stackoverflow.com/a/24783827
type: Question
tagged with: html-table
answer count: 2
possible better answer: http://stackoverflow.com/a/24782746
has comment: http://stackoverflow.com/comment/38459128
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I'm using a HTML table to display my content on my webpage. I'm having trouble on figuring out how to make a columns contents display when it is hovered over. For example if I hovered over a cell on the table (which has the tool-tip enabled), the contents of that cell should appear in a tool-tip. I am currently using JavaScript & J Query to build the table, I have included static data to display in the table: var AuditLog = [ { UserID: "DJoe1", Action: "loggedIn", Date: "17 July 2014 11:02", AppID:"MyRoster", DeviceID: "-", Notes: "None" }, { UserID: "DJoe2", Action: "loggedIn", Date: "17 July 2014 10:49", AppID: "Train Dispatch", DeviceID: "-", Notes: "None" }, { UserID: "DJoe3", Action: "loggedIn", Date: "17 July 2014 10:29", AppID: "MyRoster", DeviceID: "-", Notes: "None" }, { UserID: "LJenkins2", Action: "loggedIn", Date: "17 July 2014 10:15", AppID: "Train Dispatch", DeviceID: "-", Notes: "None" }, { UserID: "LJenkins1", Action: "loggedIn", Date: "17 July 2014 10:11", AppID: "Train Dispatch", DeviceID: "-", Notes: "None" } ]; The column which needs the tool-tip is the Notes column. Table Structure: var AuditHTML = " " + " " + " " + " User ID " + " Action " + " Date " + " App ID " + " Device ID " + " Notes " + " " + " " + " "; for (s = 0; s < AuditLog.length; s++) { AuditHTML += " " + " " + AuditLog[s].UserID + " " + " " + AuditLog[s].Action + " " + " " + AuditLog[s].Date + " " + " " + AuditLog[s].AppID + " " + " " + AuditLog[s].DeviceID + " " + " " + AuditLog[s].Notes + " "; AuditHTML += " "; } AuditHTML += " "; $("#auditContent").html(AuditHTML); I have used a div to display the table on the page: Any help would be great!
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: How to make a columns contents display in a tool-tip when hovering over? HTML5
tagged with: css
has answer: http://stackoverflow.com/a/24783827
has comment: http://stackoverflow.com/comment/38459084
has comment: http://stackoverflow.com/comment/38458764
upvote count: 3
has comment: http://stackoverflow.com/comment/38459895
has comment: http://stackoverflow.com/comment/38459525
has comment: http://stackoverflow.com/comment/38458810
has comment: http://stackoverflow.com/comment/38459797
has comment: http://stackoverflow.com/comment/38458710
type: AnsweredQuestion
score: 3

http://stackoverflow.com/a/24798269
has body: You really really don't want to do this. A promise is the wrong abstraction for this. A promise represents the outcome of one eventual operation. A promise can only change its state once so even if you manage to promisify app.post correctly it will only be able to serve one client, once. Promises are an awesome abstraction - but this is definitely not a problem promises aim to solve. Instead, if you're interested in interesting abstractions with promises you can check kriskowal's (Q author) Q-IO or one of the promise routers where you return promises to respond but the handler itself is called multiple times. I cannot emphasize this enough - promises are an awesome abstraction but they do not solve or attempt to solve all your concurrency issues.
score: 19
upvote count: 19
accepted answer of: http://stackoverflow.com/q/24795911
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24795911
type: Answer
downvote count: 0

http://stackoverflow.com/comment/38542098
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24826003
has text: @Pointy - Ofcourse. I was referring to the case where the code was checking to see if it was already defined (not by itself). Otherwise, yes.
score: 0

http://stackoverflow.com/comment/38410764
score: 0
comment on: http://stackoverflow.com/q/24755779
type: Comment
type: QuestionComment
has text: @Stilgar - JavaScript flavour

http://stackoverflow.com/a/24793953
has body: You can use any query options(one or more) in one odata query. It is server's decision about how to apply these query options. For $expand, $skip and $top, it is possible and reasonable to use all of them in one odata query. Such as HttpGet ~/Customers?$expand=Orders&amp;$skip=5&amp;$top=6 But in the end, such request needs support from server side as I said above.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24780746

http://stackoverflow.com/comment/38512238
score: 0
has text: @Diodeus The previous answer changed the size before the page loaded so it was set back when the page rendered. This is to use the ajaxComplete to make the change after the load.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24810292

http://stackoverflow.com/comment/38525850
type: QuestionComment
comment on: http://stackoverflow.com/q/24817321
score: 0
has text: Proof of concept for replace using a callback function: http://jsfiddle.net/wolfemm/8e6At/
type: Comment

http://stackoverflow.com/comment/38529822
type: Comment
has text: @user3777766 Then, you are running from web server. But, what webserver are you using?
comment on: http://stackoverflow.com/a/24819737
type: AnswerComment
score: 0

http://stackoverflow.com/q/24877588
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has body: How to get value from custom attribute to be used in if else condition? I want to switch button between show & hide . if show button clicked it will hiden and the hide button showed. And also the same for opposites. So i can do show hide for my divs. Here's my codes + Show - Hide Content 1 + Show - Hide Content 2 + Show - Hide Content 3 CSS: .show_detail{cursor:pointer; color:red;} .hide_detail{cursor:pointer; color:red;} JS : $('.show_detail').click(function(){ var atribut_show = $('.show_detail').attr('target'); var atribut_hide = $('.hide_detail').attr('target-hide'); if (atribut_show == atribut_hide){ $('.hide_detail').show(); $(this).hide(); } $('.event_down').hide(); $('#event_down'+$(this).attr('target')).show(); }); and here's MY FIDDLE need your help to solve it.
tagged with: css
has answer: http://stackoverflow.com/a/24877720
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24877744
type: Question
has title: Jquery Show Hide with attribute
possible better answer: http://stackoverflow.com/a/24877694
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24877694
accepted answer: http://stackoverflow.com/a/24877744

http://stackoverflow.com/comment/38526245
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24817703
has text: Store the number in a separate variable.

http://stackoverflow.com/comment/38531502
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24807132
has text: @corgrath Though, it still doesn't deserve an up-vote :)) You're welcome :)
type: Comment

http://stackoverflow.com/comment/38512186
type: QuestionComment
score: 0
has text: @vico It grabs the screen width, and then based on that, if it is a small screen it will change the font-size of the a tag element.
comment on: http://stackoverflow.com/q/24810292
type: Comment

http://stackoverflow.com/a/24852098
has body: It's possible to hook all this up from the template but the expressions get very confusing. At the end of the day I think it's actually more "declarative" to indicate exactly what's about to happen with an ngChange directive. See working Plunkr here: http://plnkr.co/edit/WJ91H0NmiRcOY6H5lpTE?p=preview Basically, all you're doing is changing your data structure to look more like this: $scope.options = { 'a': ['b', 'c', 'd', 'e'], 'z': ['c', 'd', 'e', 'f'] }; You can also do this in many other ways and this method is going to work. For example, your level1 and level2 lists can be completely separate structures. That's pretty typical for most apps with nested lists of options because each option is going to be some table of entries in a database or similar. Then you just use an ng-change triggered off the user selecting an option in the first combo box: $scope.level1Change = function() { $scope.level2 = $scope.options[$scope.level1selection]; } This is an extra few lines of code, sure, but it still honors all of AngularJS's principles, it's clear and easy to understand... and it's actually much more efficient because the expressions are simpler and there are no filters required. If you change your original filter expression to call a function of your own, and put a console.log() on it, you'll be shocked at how often it gets called. Angular doesn't really have a good way to tell when it needs to call a filter so it tends to call them a LOT more than you'd think. Basically anything that triggers a digest is going to trigger this, even if the user isn't touching these form elements. If you REALLY want to get rid of this callback you can do exactly the same thing in your HTML template, like this: &lt;select name="level1" ng-model="level1selection" ng-options="level1 as level1 for (level1, level2) in options" ng-change="level2 = options[level1selection];"&gt;&lt;/select&gt;
score: 0
answers question: http://stackoverflow.com/q/24829871
type: Answer

http://stackoverflow.com/comment/38591685
comment on: http://stackoverflow.com/q/24852428
has text: Can someone provide me some links/books/tutorials if possible?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39753740
has text: I'm not very into jest, but have you seen [config.collectCoverage](http://facebook.github.io/jest/docs/api.html#config-collectcoverage-boolean)?
comment on: http://stackoverflow.com/q/24825860
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/q/24834072
has comment: http://stackoverflow.com/comment/38557195
type: AnsweredQuestion
downvote count: 0
type: Question
score: 3
has body: I have an identifiers of the elements, which look like this: form_book_1_2_3 What I want is to replace second digit in this identifier with other value. I used function 'match' with the following regexp: var regexp = /\d_(\d)_\d/; But it returns me array containing [1_2_3, 2] So, when I try to use function 'replace' it actually replace '1_2_3' string instead of only '2'. I don't understand how to point to the second matched element in the replace function. Or maybe my regexp is wrong?
tagged with: javascript
has answer: http://stackoverflow.com/a/24834102
accepted answer: http://stackoverflow.com/a/24834102
upvote count: 3
has title: JS replace digits with regular expressions
answer count: 1
has comment: http://stackoverflow.com/comment/38557171
favorite count: 0
tagged with: regex

http://stackoverflow.com/comment/57377623
type: AnswerComment
comment on: http://stackoverflow.com/a/24870523
type: Comment
score: 2
has text: Apparently the Parse JS SDK v1.7.x `Parse.Promise.when` will return an array of results, as expected, and as documented. See here: https://github.com/ParsePlatform/Parse-SDK-JS/issues/158

http://stackoverflow.com/a/24876782
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24815220
has body: I fixed this by adding an hour to the date. The problem is iOS and its non-handling of daylight savings. This is a temporary fix which needs to be applied and removed during the year as DST changes. From: parse: (resp) -&gt; rate : parseFloat(resp.rate) date : moment(resp.date, 'YYYY-MM-DD').toDate() To: parse: (resp) -&gt; rate : parseFloat(resp.rate) date : moment(resp.date, 'YYYY-MM-DD').add(1, 'hours').toDate()
answers question: http://stackoverflow.com/q/24815220
type: Answer
score: 0

http://stackoverflow.com/a/24845415
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38579111
answers question: http://stackoverflow.com/q/24845221
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38596279
type: Answer
has body: Express.js itself does not offer URL generation, only a built-in router. You would need to use an additional package to perform URL generation, or build it yourself. Maybe you find something fitting in this question's answers: URL generation for routes in express If you do not care about route generation and want to "hard code" the URLs, you would need to add a route for each static page, like this: // routes.js app.get("/pageA.html", function(req, res, next) { res.render("static/page_a", { templateLocals: "here" }) }; app.get("/pageB.html", function(req, res, next) { res.render("static/page_b") }; Or, if you have many of those pages, you could use a controller for this: // static_page_controller.js module.exports = function(pageTemplate) { return function(req, res, next) { return res.render("static/" + pageTemplate); } } And use it like this: // routes.js var staticController = require("./static_page_controller"); app.get("/pageA.html", staticController("page_a"));
has comment: http://stackoverflow.com/comment/38579587
has comment: http://stackoverflow.com/comment/38598930
accepted answer of: http://stackoverflow.com/q/24845221

http://stackoverflow.com/comment/38646473
comment on: http://stackoverflow.com/a/24877495
score: 0
type: Comment
has text: Thanks @smarx, I have a quick question: could you know of a good workaround to achieve the "diffing feature" which I could start from? I think there will be other people who'd want to do similar things.(extract the true delta)
type: AnswerComment

http://stackoverflow.com/a/24793215
has comment: http://stackoverflow.com/comment/38480485
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38512042
type: Answer
upvote count: 1
has body: Here's a cleaned-up version of the PHP replacement: $cleanName = preg_replace('/[][\'`~!@#$%^&amp;*()_|+=?;:\'",.&lt;&gt;{}\\\\\/\s-]+/', '', $r["accountname"]); Explanation The + at the end cuts down on the number of replacements in case you have several special chars in a row. In PHP, many characters don't need to be escaped in a character class preg_replace replaces all matches: there is no g flag
accepted answer of: http://stackoverflow.com/q/24793091
score: 1
answers question: http://stackoverflow.com/q/24793091

http://stackoverflow.com/comment/38672089
comment on: http://stackoverflow.com/a/24894572
has text: Wait!! Explain yourself a little more please, I just tried something in relation to your answer: `window.onload = function(){` made the script work.. `window.onload = function(){` but I changed it to work like this: `window.onload = function(){ window.onload + gitFire(); };` NOW, this works only using window. Why not document?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/24796443
type: Question
has answer: http://stackoverflow.com/a/24796483
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38486885
possible better answer: http://stackoverflow.com/a/24796482
has answer: http://stackoverflow.com/a/24796482
has title: Remove from array by matching start with or regex using Jquery
has comment: http://stackoverflow.com/comment/38486315
accepted answer: http://stackoverflow.com/a/24796483
has body: i'm trying to remove value from existing array. i have no idea to how to check the array for specific value and remove it. my array looks like ["Criteria.Make=scion", "Criteria.ModelName=xb", "Criteria.PriceMax=4000", "Criteria.ZipCode=23212", "Criteria.MaxDistance=50"] i want to check if array exist Criteria.PriceMax={what ever dynamically generated value} i need to remove from the array. i know i can use grep to remove it but i can come up with the exact need with my code I check that value like this $.inArray("Criteria.PriceMax",searchUrlBuilder)) &gt; -1 won't work properly regex match will be the best but i have no idea how to do that. thanks
type: AnsweredQuestion
tagged with: arrays
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/38505684
type: Comment
score: 0
comment on: http://stackoverflow.com/q/24806487
type: QuestionComment
has text: See http://stackoverflow.com/q/16384841/218196

http://stackoverflow.com/q/24872218
downvote count: 0
score: 1
has body: I am creating a page tab on Facebook, everything is working as expected besides the sharing of photos within the page tab. YouTube links work perfectly. What I would like to achieve is sharing of a photo previously uploaded to one of the page tabs photo albums. Basically replicating the action of clicking 'Share' when viewing a photo on Facebook. As an example I am using Asda's photo. FB.ui({ method: 'share', href: 'https://www.facebook.com/photo.php?fbid=710406002364140' }); This simply results in a dialog popping up momentarily with the loading animation. Assuming this may be because Facebook prevents scraping of their own URLs as seen on the Open Graph Debugger https://developers.facebook.com/tools/debug/ Facebook URLs aren't scrapable by this Debugger. Try your own. Could anyone shed any light on ways around this?
type: Question
tagged with: javascript
upvote count: 1
has title: Facebook Share Dialog - sharing a Facebook photo
tagged with: facebook-javascript-sdk
favorite count: 0
type: UnansweredQuestion
tagged with: facebook
answer count: 0

http://stackoverflow.com/a/24909086
upvote count: 7
score: 7
has comment: http://stackoverflow.com/comment/38703751
downvote count: 0
answers question: http://stackoverflow.com/q/24908049
has body: To remove the keyboard you need to lose the focus on the active element. No other solution. So display your pop-up and after remove the focus. Example: function clickInput() { openPopUp(); document.activeElement.blur(); // lose focus on the active element and hide keyboard } UPDATE: I do not know "mobiscroll". But to hide the keyboard you need to lose focus on the active element. document.activeElement &amp;&amp; document.activeElement.blur(); // This code remove the keyboard constantly.
has comment: http://stackoverflow.com/comment/38699903
type: Answer

http://stackoverflow.com/q/24778984
has comment: http://stackoverflow.com/comment/38452563
has body: I want to be able to click an Asp.net button which opens a file dialog, select a file and pass the file name to a textbox using javascript, i really do not know how to go about this.
has comment: http://stackoverflow.com/comment/38455276
tagged with: javascript
linked to: http://stackoverflow.com/q/2189615
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/38453092
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38452570
downvote count: 4
type: AnsweredQuestion
upvote count: 0
score: -4
has title: open file dialog box in javascript and get the value of the selected file
has answer: http://stackoverflow.com/a/24779073
accepted answer: http://stackoverflow.com/a/24779073
type: Question

http://stackoverflow.com/comment/38692486
has text: So you don't bind in Angular? What do you do then?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24905669
score: 0

http://stackoverflow.com/comment/38642424
score: 2
has text: There is a variable `COMPANY` that is global in scope, but naming your parameter `COMPANY` is as though you have `var COMPANY` inside the function. To reuse my example above, say you have `x=6; foo = (function(x) { return ++x; })();` Then `foo` is `NaN`, because the global `x` and the `x` used in the closure are different.
type: AnswerComment
comment on: http://stackoverflow.com/a/24878869
type: Comment

http://stackoverflow.com/comment/38429592
type: Comment
comment on: http://stackoverflow.com/a/24765015
type: AnswerComment
has text: Notice that the contents of "flare.json" are NOT an array, but an object -- `[]` vs `{}`. If I were you, I would figure out why "flare.json" is not being found and fix that. Open up your Developer Tools (I recommend Chrome's) and see where the browser is searching.
score: 0

http://stackoverflow.com/q/24775725
tagged with: loops
type: Question
accepted answer: http://stackoverflow.com/a/24775765
has answer: http://stackoverflow.com/a/24775846
has title: Loop through childNodes
score: 125
downvote count: 0
has body: I'm trying to loop through childNodes like this: var children = element.childNodes; children.forEach(function(item){ console.log(item); }); However, it output Uncaught TypeError: undefined is not a function due to forEach function. I also try to use children instead of childNodes but nothing changed. Does anybody know what's going on?
has answer: http://stackoverflow.com/a/24775912
tagged with: javascript
has answer: http://stackoverflow.com/a/53102064
answer count: 11
has answer: http://stackoverflow.com/a/49020694
has answer: http://stackoverflow.com/a/56967436
has answer: http://stackoverflow.com/a/75940598
favorite count: 0
possible better answer: http://stackoverflow.com/a/35832896
has answer: http://stackoverflow.com/a/42241074
has answer: http://stackoverflow.com/a/24775769
has answer: http://stackoverflow.com/a/35832896
upvote count: 125
has answer: http://stackoverflow.com/a/24775765
has answer: http://stackoverflow.com/a/74636994
type: AnsweredQuestion
tagged with: children

http://stackoverflow.com/a/24907692
has comment: http://stackoverflow.com/comment/38701387
type: Answer
has body: Probably you do not include external javascript file for validation. Please download the validation js files jquery.validate.min.js and additional-methods.js from: jquery.validate.min.js and additional-methods.js and copy into js folder and include the files:
score: 2
accepted answer of: http://stackoverflow.com/q/24907282
downvote count: 0
answers question: http://stackoverflow.com/q/24907282
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38729873
has comment: http://stackoverflow.com/comment/38699210

http://stackoverflow.com/a/24902074
score: 0
answers question: http://stackoverflow.com/q/24901967
type: Answer
has body: Make sure your answer is this(without FILL_ME_IN), this will work. it("should create arrays", function() { var emptyArray = []; expect(typeof(emptyArray)).toBe('object'); expect(emptyArray.length).toBe(0); }); hint: expect(0).toBe(FILL_ME_IN) will show you the error "Expected 0 to be 'Fill this value in'."

http://stackoverflow.com/a/24830321
upvote count: 1
score: 1
has body: You're just using the write keyword for your function. Then it's calling document.write(), which will replace everything by an empty string. Replace it by anything else : function writeIt() { ... } Update JSFiddle Side notes : Use document.getElementById("r") instead of document.getElementById("#r") Select "No wrap in " in your Fiddle to get inline calling to work
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24830173
answers question: http://stackoverflow.com/q/24830173
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/24766308
type: Question
score: 0
answer count: 2
tagged with: javascript
tagged with: jquery
has body: I'm using Jack Moore's jQuery tabs demo (http://www.jacklmoore.com/notes/jquery-tabs/). I need to modify the JS to display a specific tab initially (I thought about modifying the URL but that won't work in the scenario I need this for). I've got everything set up in this fiddle: http://jsfiddle.net/sfSex/ $('ul.tabs').each(function(){ // For each set of tabs, we want to keep track of // which tab is active and it's associated content var $active, $content, $links = $(this).find('a'); // If the location.hash matches one of the links, use that as the active tab. // If no match is found, use the first link as the initial active tab. $active = $($links.filter('[href="'+location.hash+'"]')[0] || $links[0]); $active.addClass('active'); $content = $($active[0].hash); // Hide the remaining content $links.not($active).each(function () { $(this.hash).hide(); }); // Bind the click event handler $(this).on('click', 'a', function(e){ // Make the old tab inactive. $active.removeClass('active'); $content.hide(); // Update the variables with the new link and content $active = $(this); $content = $(this.hash); // Make the tab active. $active.addClass('active'); $content.show(); // Prevent the anchor's default click action e.preventDefault(); }); }); I'm confident it's a very straightforward fix but I haven't been able to find an answer online. Thanks.
has answer: http://stackoverflow.com/a/24766601
has answer: http://stackoverflow.com/a/24766429
has title: Modify jQuery tab plugin to display specific tab on load [includes JSFiddle]
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24766601
possible better answer: http://stackoverflow.com/a/24766429

http://stackoverflow.com/q/24767517
has title: how to hide button, if the grid contains 'false' text in asp.net using jquery
type: Question
score: 0
has comment: http://stackoverflow.com/comment/38431405
has body: In my asp.net web page i have a grid & button. Code : <asp:GridView ID="gdvw" runat="server" AutoGenerateColumns="false" Width="100%" EmptyDataText="No record(s) found"> <asp:TemplateField HeaderText="Name"> </asp:TemplateField> <asp:TemplateField HeaderText="status"> </asp:TemplateField> <asp:TemplateField HeaderText="view"> </asp:TemplateField> </asp:GridView> the inner text of div View div(in 'view' column), that contains only one of the following two texts. 'true' and 'false'. if the text is 'true' then the submit button should be visible. else if the text is 'false' then the submit button should be hidden.
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38454881
tagged with: asp.net
has comment: http://stackoverflow.com/comment/38431511
has comment: http://stackoverflow.com/comment/38431435
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38435444

http://stackoverflow.com/comment/38748692
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/24816825
has text: I find this pretty good .... http://www.amazon.com/AngularJS-Brad-Green/dp/1449344852/ref=sr_1_2?ie=UTF8&qid=1406209359&sr=8-2&keywords=angularjs

http://stackoverflow.com/a/24846110
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/38825336
has comment: http://stackoverflow.com/comment/38755702
answers question: http://stackoverflow.com/q/24846089
upvote count: 2
has body: Using a textarea Too limit rows and characters in a textarea you can use my script I just made: JAVASCRIPT: function textarealimit(textarea, rows, chars, rowsleft_id, charsleft_id) { var newValue; var valueSegments = textarea.value.split('\n'); if(rows != undefined && valueSegments.length > rows) { // too many rows newValue = valueSegments.slice(0, rows).join("\n"); } if(chars != undefined && textarea.value.length > chars) { // too many chars if(newValue != undefined) newValue = newValue.substring(0, chars); else newValue = textarea.value.substring(0, chars); } if(newValue != undefined) textarea.value = newValue; if(rowsleft_id != undefined) { if(textarea.value == "") document.getElementById(rowsleft_id).innerHTML = rows; else if(rows - valueSegments.length >= 0) document.getElementById(rowsleft_id).innerHTML = rows - valueSegments.length; } if(charsleft_id != undefined) { if(chars != undefined) document.getElementById(charsleft_id).innerHTML = chars - textarea.value.length; } } HTML: Rows left: 4 Characters left: 43 If you use HTML5 you can even limit the characters by the maxlength attribute on the textarea control. If you do not want to show the rows or chars left, just use onkey....="textarealimit(this, 4, 43);". You can even only limit the rows by using onkey....="textarealimit(this, 4);". Here is a demo for you: http://jsfiddle.net/AmFnA/9/ The only limitation appears when the user gets new rows by auto line breaks due to the width limitation, so without pressing ENTER, because it will NOT count as new row. Also, you have to use keydown (when the user presses and holds this fires all the time), keyup (when the user releases, fires even when pressing ENTER) and onpaste (for richtclick -> paste), always. Thanks to Guilherme for reminding me on the paste part with his shorter version of that solution. Using multiple input fields Now there is another alternative Jukka mentioned. You can use an input field for each row. This will prevent the user to get line breaks…
has comment: http://stackoverflow.com/comment/38795879
has comment: http://stackoverflow.com/comment/38785374

http://stackoverflow.com/q/24859987
has comment: http://stackoverflow.com/comment/38648120
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24860324
accepted answer: http://stackoverflow.com/a/24882319
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/38606667
has comment: http://stackoverflow.com/comment/38607225
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24882319
tagged with: class
score: 0
has answer: http://stackoverflow.com/a/24860324
has title: Style property only from classes
tagged with: css
has body: Is it possible to get certain css style property computer only from classes, without taking into account possible run-time manipulation? For example: .container{ } .container .item { } .container.inactive .item { opacity:0.5; } Somewhere in javascript opacity of item changes to 1 via, say, $('.item').css('opacity',1) but then I need to know what was certain item's opacity without run-time modifications, based on only its classes. Structure of css is just an example and shouldn't be taken into account to check for opacity. Is it possible?
has comment: http://stackoverflow.com/comment/38606825
has comment: http://stackoverflow.com/comment/38606444
tagged with: styles

http://stackoverflow.com/comment/38626676
type: Comment
comment on: http://stackoverflow.com/a/24870119
has text: @meagar not mentioning any requirements for browsers is the exact reason you need to mention that it doesn't work in all browsers.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38400231
has text: change to ' ' on top. src is an attribute.
comment on: http://stackoverflow.com/q/24750511
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24799812
accepted answer of: http://stackoverflow.com/q/24799370
type: Answer
answers question: http://stackoverflow.com/q/24799370
has body: Just initialize discipline.events to an empty array before the inner forEach: if (...) { discipline.events = []; angular.forEach( ... ); }
type: AcceptedAnswer
score: 0

http://stackoverflow.com/comment/38701387
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24907692
has text: Please put the div inside of td.

http://stackoverflow.com/a/24791114
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/38476594
has comment: http://stackoverflow.com/comment/38476625
has body: You need to make sure your function is available globally when calling functions from the onclick attribute, try: triggerSave = function() { alert("triggerSave test alert"); $("#formTabPatientTrackingPost").submit(); } DEMO
type: Answer
score: 2
answers question: http://stackoverflow.com/q/24790893

http://stackoverflow.com/q/24812903
has comment: http://stackoverflow.com/comment/38517231
has answer: http://stackoverflow.com/a/31628562
has comment: http://stackoverflow.com/comment/38517244
type: UnansweredQuestion
tagged with: foreach
has title: Javascript- how do you convert this foreach loop to a regular for-loop?
has comment: http://stackoverflow.com/comment/38517361
tagged with: loops
has body: This nested loop is running really slow in my app so I'm trying to change it to use regular for-loops instead of foreach. I'm a little confused on the find() part. Can someone help me convert this nested loop so that it doesn't use any foreach loops? thanks. var filters = []; if (selectionTagFilters.length &gt; 0) { for (var i = 0; i &lt; selectionTagFilters.length; i++) { filterTree.forEach(function find(tag) { if (tag.tagCategoryId == selectionTagFilters[i].tag.tagCategoryId) { tag.tags.forEach(function find(tag) { if (tag.tagId == selectionTagFilters[i].tag.tagId) { filters.push({ tagHeader: tag.tagHeader, tagId: tag.tagId, tagCategoryId: tag.tagCategoryId }); } }); } }); } }
type: Question
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/q/24876144
score: 5
has answer: http://stackoverflow.com/a/26820784
has comment: http://stackoverflow.com/comment/39813054
upvote count: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/42214082
tagged with: javascript
has comment: http://stackoverflow.com/comment/41609227
has answer: http://stackoverflow.com/a/45584815
favorite count: 0
tagged with: c3.js
type: UnansweredQuestion
tagged with: css
has body: I am using c3.js and c3.css to make several graphs on one page. I have multiple charts and want to update the data every 60 seconds so I use set interval, get the updated data, and then load it to a chart, however, it puts all of the data in the most recently made chart. I attempted to add a bindto to the data so it goes to the correct graph, but it still loads onto the bottom graph. how can I fix this? ... &lt;div id='chart1'&gt;&lt;/div&gt; &lt;div id='chart2'&gt;&lt;/div&gt; ... function update()//this function collects the new data in arrays cols and xrows ... setInterval(function(){ update(); chart.unload(); chart.load({bindto:'#chart1',columns:cols, xs:xrows}); },3000);
has title: c3 chart.load with multiple charts
type: Question
tagged with: graph
tagged with: charts
answer count: 2

http://stackoverflow.com/a/28241165
upvote count: 1
answers question: http://stackoverflow.com/q/24773571
has body: Your application is using JST templates, this page describes them. JST is a hash that returns the template as a JavaScript function. Often this JST object (hash of functions) is created at build time and saved as a JavaScript file that is included somehow by the app. The input to the compiled JST object is a list of template .html files.
has comment: http://stackoverflow.com/comment/52232027
type: Answer
score: 1
downvote count: 0

http://stackoverflow.com/q/24775680
has answer: http://stackoverflow.com/a/24776215
has comment: http://stackoverflow.com/comment/38446917
has comment: http://stackoverflow.com/comment/38446874
has answer: http://stackoverflow.com/a/24775840
has comment: http://stackoverflow.com/comment/38446929
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/38446902
answer count: 3
has comment: http://stackoverflow.com/comment/38447127
upvote count: 0
has title: calling function using javascript
tagged with: jquery
has body: In my HTML page I've the following ul: &lt;ul id="inFile2"&gt;&lt;/ul&gt; and in my JavaScript page, I've this function function handleFileSelect(event) { var files = event.target.files; // FileList object console.log(files); // files is a FileList of File objects. display first file name file = files[0]; console.log(file); if (file) { readInputFile(file); console.log(file); } } I want to call the function in the ul. How could that happen? this is what I have tried so far el=document.getElementById('inFile2'); el.on("change",handleFileSelect); but gives me an error. What is the correct coding to call that function in the ul?
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38447020
has comment: http://stackoverflow.com/comment/38446892
has answer: http://stackoverflow.com/a/24775832
has comment: http://stackoverflow.com/comment/38447015
downvote count: 1
type: Question

http://stackoverflow.com/q/24828463
tagged with: angularjs-scope
linked to: http://stackoverflow.com/q/16866749
type: Question
has comment: http://stackoverflow.com/comment/38547553
downvote count: 0
has comment: http://stackoverflow.com/comment/38548818
tagged with: javascript
has comment: http://stackoverflow.com/comment/38547217
has comment: http://stackoverflow.com/comment/38548575
favorite count: 0
has comment: http://stackoverflow.com/comment/38548843
accepted answer: http://stackoverflow.com/a/24839410
answer count: 1
has answer: http://stackoverflow.com/a/24839410
tagged with: angularjs
upvote count: 1
has title: AngularJS : Nested Directives and Scope Inheritance
tagged with: angularjs-directive
type: AnsweredQuestion
has body: preamble: It seems like this question has been asked and answered before, but I cannot seem to get it working, so if my question boils down to "can you debug my code?", I apologize. I would like to write the following code: Public Protected Private This renders a bunch of radio buttons and labels which need to populate whatever is passed to the 's ngModel. I'm missing something scope-related. .directive("radioSet", function () { return { restrict: 'E', replace: true, scope: { ngModel: '=?', ngChange: '&', name: '@' }, transclude: true, template: ' ', controller: function () {} }; }) .directive("radioSetButton", function () { return { restrict: 'E', replace: true, require: ['^radioSet', '?ngModel'], scope: { ngModel: '=?', // provided by ^radioSet? ngValue: '=?', ngChange: '&', // provided by ^radioSet? name: '@' // provided by ^radioSet? }, transclude: true, link: function (scope, element, attr) { element.children().eq(0).attr("name", scope.name); // scope.name is null }, template: ' ' + ' ' + ' ' + ' ' }; }) Both the parent and child directives need their own scope definition, but it is unclear to me how to access to the radioSet's scope from within radioSetButton. thanks for the help. fiddle: http://jsfiddle.net/pmn4/XH5K2/2/
score: 1

http://stackoverflow.com/a/24899819
has comment: http://stackoverflow.com/comment/38682535
upvote count: 8
has comment: http://stackoverflow.com/comment/38682118
type: Answer
has comment: http://stackoverflow.com/comment/68648718
score: 8
has body: take a look: $( ".dropdown-submenu" ).click(function(event) { // stop bootstrap.js to hide the parents event.stopPropagation(); // hide the open children $( this ).find(".dropdown-submenu").removeClass('open'); // add 'open' class to all parents with class 'dropdown-submenu' $( this ).parents(".dropdown-submenu").addClass('open'); // this is also open (or was) $( this ).toggleClass('open'); }); demo: http://jsfiddle.net/ejLDg/18/
has comment: http://stackoverflow.com/comment/38682277
has comment: http://stackoverflow.com/comment/60973688
answers question: http://stackoverflow.com/q/24899026
accepted answer of: http://stackoverflow.com/q/24899026
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/tag/json
tags question: http://stackoverflow.com/q/24903189
tags question: http://stackoverflow.com/q/24796963
tags question: http://stackoverflow.com/q/24908812
tags question: http://stackoverflow.com/q/24770626
tags question: http://stackoverflow.com/q/24838932
tags question: http://stackoverflow.com/q/24893719
tags question: http://stackoverflow.com/q/24776062
tags question: http://stackoverflow.com/q/24754306
tags question: http://stackoverflow.com/q/24825044
tags question: http://stackoverflow.com/q/24907465
tags question: http://stackoverflow.com/q/24831709
tags question: http://stackoverflow.com/q/24831299
tags question: http://stackoverflow.com/q/24760338
tags question: http://stackoverflow.com/q/24796583
tags question: http://stackoverflow.com/q/24860433
tags question: http://stackoverflow.com/q/24778702
tags question: http://stackoverflow.com/q/24893158
tags question: http://stackoverflow.com/q/24812939
tags question: http://stackoverflow.com/q/24843599
tags question: http://stackoverflow.com/q/24837441
tags question: http://stackoverflow.com/q/24778018
tags question: http://stackoverflow.com/q/24755319
tags question: http://stackoverflow.com/q/24806260
tags question: http://stackoverflow.com/q/24836097
tags question: http://stackoverflow.com/q/24896631
tags question: http://stackoverflow.com/q/24868555
tags question: http://stackoverflow.com/q/24800337
tags question: http://stackoverflow.com/q/24755512
tags question: http://stackoverflow.com/q/24889632
tags question: http://stackoverflow.com/q/24871346
tags question: http://stackoverflow.com/q/24792088
tags question: http://stackoverflow.com/q/24909006
tags question: http://stackoverflow.com/q/24868265
tags question: http://stackoverflow.com/q/24890990
tags question: http://stackoverflow.com/q/24855186
tags question: http://stackoverflow.com/q/24763498
tags question: http://stackoverflow.com/q/24897516
tags question: http://stackoverflow.com/q/24890087
tags question: http://stackoverflow.com/q/24825549
tags question: http://stackoverflow.com/q/24812047
tags question: http://stackoverflow.com/q/24879546
tags question: http://stackoverflow.com/q/24833379
tags question: http://stackoverflow.com/q/24782828
tags question: http://stackoverflow.com/q/24817590
tags question: http://stackoverflow.com/q/24865142
tags question: http://stackoverflow.com/q/24776142
tags question: http://stackoverflow.com/q/24749655
tags question: http://stackoverflow.com/q/24763685
tags question: http://stackoverflow.com/q/24759985
tags question: http://stackoverflow.com/q/24840249
tags question: http://stackoverflow.com/q/24880717
tags question: http://stackoverflow.com/q/24828784
tags question: http://stackoverflow.com/q/24894532
tags question: http://stackoverflow.com/q/24877158
tags question: http://stackoverflow.com/q/24759268
tags question: http://stackoverflow.com/q/24832613
tags question: http://stackoverflow.com/q/24792280
tags question: http://stackoverflow.com/q/24857881
tags question: http://stackoverflow.com/q/24787966
tags question: http://stackoverflow.com/q/24834818
tags question: http://stackoverflow.com/q/24842580
tags question: http://stackoverflow.com/q/24761819
tags question: http://stackoverflow.com/q/24818188
tags question: http://stackoverflow.com/q/24820306
tags question: http://stackoverflow.com/q/24905057
tags question: http://stackoverflow.com/q/24901723
tags question: http://stackoverflow.com/q/24849564
tags question: http://stackoverflow.com/q/24905412
tags question: http://stackoverflow.com/q/24867375
type: Tag
tags question: http://stackoverflow.com/q/24841190
tags question: http://stackoverflow.com/q/24783040
tags question: http://stackoverflow.com/q/24898151
tags question: http://stackoverflow.com/q/24761344
tags question: http://stackoverflow.com/q/24796333
tags question: http://stackoverflow.com/q/24881517
tags question: http://stackoverflow.com/q/24859117
tags question: http://stackoverflow.com/q/24783490
tags question: http://stackoverflow.com/q/24756246
tags question: http://stackoverflow.com/q/24750939

http://stackoverflow.com/a/24869961
has body: JQuery UI has a number of images that should have come with it, they come in a folder called 'images' and should be placed in the same folder that you keep your jquery-ui css file. Right now, it looks as if you are keeping your css file inside your download directory, so you would need to copy your images folder (It should be part of the jquery-ui zip file) there. I would also recommend that you don't work off your download folder, and instead move your jquery-ui files to the folder where your actual project is. Also make sure that you update your html file to point your link and script tags to the new proper directory.
answers question: http://stackoverflow.com/q/24869688
score: 0
type: Answer

http://stackoverflow.com/q/24751739
answer count: 2
has answer: http://stackoverflow.com/a/24753665
accepted answer: http://stackoverflow.com/a/24753665
upvote count: 1
downvote count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38401729
favorite count: 0
possible better answer: http://stackoverflow.com/a/24753208
has answer: http://stackoverflow.com/a/24753208
has comment: http://stackoverflow.com/comment/38401909
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38401837
tagged with: php
has body: I want to get video tag html5 loading time.if on first 5 sec video is not play than page is redirect to another link Here My code : &lt;body onLoad="document.getElementById('myVideo').play();document.getElementById('myVideo').width=swidth;document.getElementById('myVideo').height=sheight;" style="background-color:#000;text-align:center;"&gt; &lt;video id="myVideo"&gt; &lt;source src="&lt;?php echo $this-&gt;baseUrl ?&gt;/xsn/XSun.webm" type="audio/webm" /&gt; &lt;source src="&lt;?php echo $this-&gt;baseUrl ?&gt;/xsn/XSun.mp4" codecs="avc1.42E01E, mp4a.40.2" type="audio/mpeg"&gt; &lt;source src="&lt;?php echo $this-&gt;baseUrl ?&gt;/xsn/XSun.ogv" type="audio/ogg"&gt; &lt;/video&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ $("#myVideo").bind('ended', function(){ location.href="&lt;?php echo $this-&gt;baseUrl ?&gt;"; }); }); &lt;/script&gt; Please help Thanks Amit Anand
type: AnsweredQuestion
has title: Get loading time in video tag html5
has comment: http://stackoverflow.com/comment/38401979
type: Question
score: 0

http://stackoverflow.com/comment/38428447
type: QuestionComment
has text: This occurs because you replace the contents of the HTML every time.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24765774

http://stackoverflow.com/comment/38700454
comment on: http://stackoverflow.com/a/24909514
has text: @Manwal start a galery whith data-lightbox="relattribute"
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38673776
score: 1
comment on: http://stackoverflow.com/q/24895550
has text: You can't have more than one element in the same page with the same id. You should use `data-id` or `class` to distinguish your "next" links.
type: QuestionComment
type: Comment

http://stackoverflow.com/a/24909712
score: 8
downvote count: 0
has body: I will post non jQuery solution and much more efficient then traversing the whole DOM tree: var x = document.evaluate('//comment()', document, null, XPathResult.ANY_TYPE, null), comment = x.iterateNext(); while (comment) { alert(comment.textContent); comment = x.iterateNext(); } However this solution is not for IE, which doesn't implement document.evaluate methods, that's why be aware and use it only if you don't have to support IE. Demo: http://jsfiddle.net/z6GU3/
answers question: http://stackoverflow.com/q/24909102
upvote count: 8
type: Answer

http://stackoverflow.com/comment/38483792
type: QuestionComment
comment on: http://stackoverflow.com/q/24795031
has text: Please clearly describe your problem.
type: Comment
score: 1

http://stackoverflow.com/a/25343158
answers question: http://stackoverflow.com/q/24805913
score: 0
has body: or will it just send the entire data as a single transaction? Unfortunatelly yes, on any document change it will send whole document, down to client. So I think, it is not wise, build db structure this way - mean one big document in one collection (instead of several collections). How DDP work and what it will sending you can see if you install and enable Meteor DDP Analyzer.
type: Answer

http://stackoverflow.com/comment/38624363
has text: Why don't you replace 3 with `$('.fadein > p').length` ?
comment on: http://stackoverflow.com/q/24869419
type: Comment
type: QuestionComment
score: 3

http://stackoverflow.com/a/76891051
answers question: http://stackoverflow.com/q/24892706
has body: To stop the video from playing when the modal is closed, do the same thing in reverse: $('.modal').on('hide.bs.modal', function() { $(this).find('iframe').attr('src', ''); });
score: 0
type: Answer

http://stackoverflow.com/comment/38653038
score: 0
type: AnswerComment
type: Comment
has text: Sorry I didn't get your comment. You link is just going back to this thread.
comment on: http://stackoverflow.com/a/24884846

http://stackoverflow.com/comment/38548598
has text: 2. so instead of this script.async = true; I could have script.async; right? thanks for the above a lot
type: Comment
comment on: http://stackoverflow.com/a/24829598
type: AnswerComment
score: 0

http://stackoverflow.com/q/24856880
tagged with: yui
has comment: http://stackoverflow.com/comment/38601476
has comment: http://stackoverflow.com/comment/38600589
has answer: http://stackoverflow.com/a/24856926
answer count: 1
tagged with: javascript
has body: As mentioned in the topic, does it matters? For example, I have 2 files: j1.min.js and j2.js. j1.min.js is already compressed by the YUI compressor. Can I concatenate these two files first and got an file called combined.js and then use YUI compressor to compress it? In this case, the ji.min.js is compressed twice.
has title: Does it matters if JS or CSS codes are compressed twice by YUI compressor?
score: 0
tagged with: css
type: UnansweredQuestion
tagged with: compression
type: Question

http://stackoverflow.com/a/24828926
type: Answer
has body: Hope this helps, Working code here HTML: Item 1.....more text here Opt 1 Opt 2 Item 2 Opt 1 Opt 2 CSS: .actions{display:none;} .item{margin:30px;} jQuery: $(document).on({ mouseenter: function () { $(this).children('.actions').stop().fadeIn('fast'); }, mouseleave: function () { $(this).children('.actions').stop().fadeOut('fast'); } }, '.item');
score: 0
answers question: http://stackoverflow.com/q/24828049

http://stackoverflow.com/comment/38478194
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24791806
has text: i wanted that when i hover on one element it runs the effect, only on that one element and not on all of them, here is a demo where it shows the problem: http://liveweave.com/A6mXFt

buffer
tags question: http://stackoverflow.com/q/24763082
tag name: buffer
type: Tag

http://stackoverflow.com/comment/38626822
type: QuestionComment
has text: Thanks, I multiplied the timestamp by 1000 and it works.
comment on: http://stackoverflow.com/q/24870370
score: 0
type: Comment

http://stackoverflow.com/comment/38595426
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/24853292
has text: Well, I'm sure some other things may break (like Function's `toString` - used in some DI frameworks for getting parameter names), but yes - I think breaking non-standard stuff is tolerable. By mentioning ES5 I meant that the feature is nonstandard in ES<=5 (it may become a standard with ES6).
type: Comment

http://stackoverflow.com/a/24858101
type: Answer
has body: The data that $.ajax function will put is a complete HTTP request, which json.loads() won't understand. In this case you need to instantiate a HTTP server which will process the HTTP requests and then process the HTTP payload with json.loads().
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/24858052
downvote count: 0

http://stackoverflow.com/comment/64397146
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/24783688
has text: thanks @DJMartin for updating the version. If we don't override the filter function separately, it shows pieChart without colors. http://jsfiddle.net/erk3g05d/

http://stackoverflow.com/comment/38684501
has text: No, if your ajax is correct, then the `type button` will definitely go into your controller without preventDefault, unless your ajax is wrong, put a breakpoint in your controller and and see if it go to your controller?
comment on: http://stackoverflow.com/a/24901035
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/24778884
has body: You can use the plugin option animateAnchor:false which you can find in the documentation. animateAnchor: (default true) Defines whether the load of the site when given an anchor (#) will scroll with animation to its destination or will directly load on the given section. Take into account that this only jumps directly to the section. In case you have an anchor with a section and and slide, the section will load directly and the slide will be reached after the automatic slide to it. Example of usage: $('#fullpage').fullpage({ anchors:['firstSlide', 'secondSlide'], animateAnchor: false });
upvote count: 2
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/24778365
type: Answer

http://stackoverflow.com/comment/38630418
has text: you can even omit the brackets in the for loop...pretty much anything that is just one line then you can remove the brackets
score: 1
comment on: http://stackoverflow.com/q/24872513
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24786985
has comment: http://stackoverflow.com/comment/38469191
has body: There's no such thing as what you're describing, but this gives you the same effect. var validate = function () { // ... validation code here } $("#signup").change(validate); $("#signup").ready(validate); You can create a function, assign to to a variable and then have a reference to that function. That reference can then be passed to anything that requires a function as a parameter - .change, .ready, setTimeout, setInterval, etc., etc.
type: AcceptedAnswer
upvote count: 1
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24786942
score: 1
answers question: http://stackoverflow.com/q/24786942

http://stackoverflow.com/q/24759298
type: AnsweredQuestion
type: Question
answer count: 2
tagged with: arrays
tagged with: javascript
has title: I need to put my LI array element into a UL but I cant
score: 0
has body: HERE IS THE CODE: I need to do a couple of things but I am pretty new coding :S. First I need to format the li elements I am loading into the array into a UL. them I need also to create a loop where I can print those 20 array elements repeating them to display 2300 elements. Thanks :) var _objetsOfArray = new Array(); var darFormato = function (numero){ var numero = document.createElement("li"); var contenido = document.createTextNode(i); numero.appendChild(contenido); document.body.insertBefore(numero); } for (i = 0; _objetsOfArray.length &lt; 20; i++ ){ _objetsOfArray.push (i); darFormato(i); };
has answer: http://stackoverflow.com/a/24759597
accepted answer: http://stackoverflow.com/a/24759597
has answer: http://stackoverflow.com/a/24759435
has comment: http://stackoverflow.com/comment/38415951
possible better answer: http://stackoverflow.com/a/24759435

http://stackoverflow.com/comment/38588146
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/24850609
has text: i think it's not the job for regex.
type: Comment

http://stackoverflow.com/q/24888909
type: UnansweredQuestion
tagged with: youtube
has body: I have slider with a video and some pictures . When I try to move to the next picture the video keeps playing . I researched on stack and tried some of their Ideas but its not working in my case. SO I tried to create a JsFiddle of it here is the link . To slide to next image you just have to click on the left or right side of the video . The script for slider is as follow $("#slider1").responsiveSlides({ startidx: 0, auto: false, pager: true, nav: true, speed: 500, maxwidth: 540, namespace: "transparent-btns" }); //$('.transparent-btns_nav').trigger('click'); $(document).on('click', '.transparent-btns_nav', function (event) { //here I guess we can add some script to stop the video }); And the HTML you can see in the fiddle . Thanks &amp; Regards
score: 0
has answer: http://stackoverflow.com/a/24889054
type: Question
tagged with: javascript
tagged with: jquery
has title: Script to stop Youtube video from playing in a slider
answer count: 1

http://stackoverflow.com/comment/38549162
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24829288
score: 0
has text: rails 4 yes, turbolinks no

http://stackoverflow.com/q/24776017
has answer: http://stackoverflow.com/a/24776196
has body: i want to repack array to be array again after loop. my code like this. HTML &lt;input class="btn" type="submit" value="Windows"&gt;&lt;br&gt; &lt;input class="btn" type="submit" value="Linux"&gt; Javascript var btn = document.getElementsByClassName('btn'); for(i=0; i&lt;btn.length; i++){ var a = [btn[i].value]; document.write(a.indexOf("Windows")); //return 0 } above code it doesn't work. i want to repack btn.value to var a then can be access by indexOf to return value index.
has comment: http://stackoverflow.com/comment/38447689
linked to: http://stackoverflow.com/q/24767380
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38447584
has answer: http://stackoverflow.com/a/24776199
answer count: 4
has title: Repack array to be array again after loop
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/24776090
score: 0
has answer: http://stackoverflow.com/a/24776254
has comment: http://stackoverflow.com/comment/38447662
has comment: http://stackoverflow.com/comment/38447440

http://stackoverflow.com/comment/38663696
comment on: http://stackoverflow.com/q/24887796
has text: There has to be a simpler way than re-factoring our code. I am not always going to have the same drill levels at any given series collection. I just need to link series 1 to series 2 on drill.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38656399
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24886616
score: 0
has text: Where is your "tr" attribute in your code? do you have any error in the console?

http://stackoverflow.com/a/24799482
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38492008
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38491986
has body: Change this code in your html markup: ng-app="MyApp" to ng-app="myApp"
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24799274
answers question: http://stackoverflow.com/q/24799274

http://stackoverflow.com/comment/38694885
has text: Just change `activeSection = $('.section').length - 1;` to `activeSection = 0;`
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24888283

http://stackoverflow.com/q/24788413
has comment: http://stackoverflow.com/comment/38471397
type: Question
has comment: http://stackoverflow.com/comment/38471344
answer count: 2
linked to: http://stackoverflow.com/q/17880977
upvote count: 0
favorite count: 0
has title: Redirecting users after they submit a form
has answer: http://stackoverflow.com/a/24789172
has answer: http://stackoverflow.com/a/24789168
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
downvote count: 1
has comment: http://stackoverflow.com/comment/38471583
has body: I'm trying to make a basic form that redirects users to any given web page I choose after they submit their response. Although the action element is located on a site that I can not manipulate. How would I go about doing this?
tagged with: javascript
score: -1

http://stackoverflow.com/comment/38625762
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24811163
has text: Any explanation for the downvote?
type: AnswerComment

http://stackoverflow.com/a/24795078
has comment: http://stackoverflow.com/comment/38485013
has comment: http://stackoverflow.com/comment/38483865
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38483893
type: Answer
accepted answer of: http://stackoverflow.com/q/24795031
has comment: http://stackoverflow.com/comment/38522165
has comment: http://stackoverflow.com/comment/38484233
has body: You may be looking for something like this: str = str.replace(/\bbreeding\b~?/g, '') A word boundary \b does not consume any characters. It asserts that on one side there is a word character, and on the other side there is not. Adding the quantifier ? will match ~ between zero and one time.
answers question: http://stackoverflow.com/q/24795031
upvote count: 3
has comment: http://stackoverflow.com/comment/38484168
score: 3
has comment: http://stackoverflow.com/comment/38484368

http://stackoverflow.com/q/24855579
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24864302
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/38598200
has comment: http://stackoverflow.com/comment/38598145
tagged with: three.js
has title: render result is pixelated (or: has lower resolution that it should)
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38598180
score: 7
has answer: http://stackoverflow.com/a/24864302
tagged with: webgl
upvote count: 7
has body: I'm doing some prototyping, and I'm displaying some data in 3D using three.js (version 68). Desired result of whole animation would be a bunch of colored balls (that represent protons and neutrons that are colored according to some schema). Everything works good, but for reasons unknown to me rendered results are pixcelated. Current version basically looks like that (this image is ~400px wide): I have checked all obvious things like: passing incorrect resolution, browser scaling and so forth. You can see this issue on this fiddle, and download the webpage here. And also here are revelant parts of code: Here is the coffeescript code that loads the animation: class AnimController ... set_up_scene: () -> @scene = new THREE.Scene() el = $(@element_name) @camera = new THREE.PerspectiveCamera(45 el.width()/el.height(), 1, 20000 ) @camera.position.set(100, 100, 0) @scene.add new THREE.AmbientLight 0x111111 @renderer = new THREE.WebGLRenderer() el.html(@renderer.domElement) controls = new THREE.OrbitControls(@camera, @renderer.domElement ); controls.addEventListener 'change', () => console.log("Change") @render() render: () -> requestAnimationFrame(() => @render) console.log "Render" if @update_scene material = new THREE.MeshBasicMaterial() #"color": 0xffff00, geometry = new THREE.SphereGeometry 5, 50, 50 console.log "Update" @update_scene = false @scene = new THREE.Scene() for particle in @curr_event p = particle['position'] sphere = new THREE.Mesh( geometry, material ); sphere.position.set(p[0], p[1], p[2]) @scene.add(sphere) @renderer.render(@scene, @camera)
type: Question
possible better answer: http://stackoverflow.com/a/24857368
answer count: 2
has answer: http://stackoverflow.com/a/24857368

jquery-mobile
tags question: http://stackoverflow.com/q/24884430
tags question: http://stackoverflow.com/q/24757754
tags question: http://stackoverflow.com/q/24755360
tags question: http://stackoverflow.com/q/24898436
type: Tag
tags question: http://stackoverflow.com/q/24760778
tags question: http://stackoverflow.com/q/24752553
tags question: http://stackoverflow.com/q/24831371
tags question: http://stackoverflow.com/q/24774720
tags question: http://stackoverflow.com/q/24842580
tags question: http://stackoverflow.com/q/24808757
tags question: http://stackoverflow.com/q/24759309
tags question: http://stackoverflow.com/q/24797190
tags question: http://stackoverflow.com/q/24787105
tags question: http://stackoverflow.com/q/24789188
tags question: http://stackoverflow.com/q/24871443
tags question: http://stackoverflow.com/q/24825460
tags question: http://stackoverflow.com/q/24870520
tags question: http://stackoverflow.com/q/24758847
tags question: http://stackoverflow.com/q/24759781
tags question: http://stackoverflow.com/q/24772281
tags question: http://stackoverflow.com/q/24761057
tags question: http://stackoverflow.com/q/24823874
tags question: http://stackoverflow.com/q/24890095
tags question: http://stackoverflow.com/q/24838930
tags question: http://stackoverflow.com/q/24902116
tags question: http://stackoverflow.com/q/24819706
tags question: http://stackoverflow.com/q/24805397
tags question: http://stackoverflow.com/q/24795215
tags question: http://stackoverflow.com/q/24853148
tags question: http://stackoverflow.com/q/24850821
tags question: http://stackoverflow.com/q/24766825
tag name: jquery-mobile
tags question: http://stackoverflow.com/q/24893637
tags question: http://stackoverflow.com/q/24795836

http://stackoverflow.com/comment/38680689
type: Comment
has text: yes that would be ok, but the link where do i put it? i want people to be able to click on it not just show them the pointer.
comment on: http://stackoverflow.com/a/24899205
score: 0
type: AnswerComment

http://stackoverflow.com/q/24770098
has comment: http://stackoverflow.com/comment/38441110
type: AnsweredQuestion
tagged with: backbone.js
type: Question
answer count: 1
has answer: http://stackoverflow.com/a/33463268
score: 0
tagged with: pagination
has comment: http://stackoverflow.com/comment/38463750
has title: Backbone - Populating multiple models from one fetch call in my controller
tagged with: rendr
has body: Say I have a collection (of search results, for example) which needs to be populated and a pagination model that needs to take values for current page, total number of pages, etc. In my controller, I make a GET call to an API which returns both search results and pagination information. How, then, can I fetch all this information and parse it into a collection and a separate model? Is this possible? I am using AirBNB's Rendr, which allows you to use a uniform code base to run Backbone on both the server and the client. Rendr forces me to parse the API response as an array of models, keeping me from being able to access pagination information. In Rendr, my controller would look like this: module.exports = { index: function (params, callback) { var spec = { pagination: { model: 'Pagination', params: params }, collection: { collection: 'SearchResults', params: params } }; this.app.fetch(spec, function (err, result) { callback(err, result); }); } } I apologize if this is not clear enough. Feel free to ask for more information!
tagged with: javascript
accepted answer: http://stackoverflow.com/a/33463268

http://stackoverflow.com/a/24852721
has comment: http://stackoverflow.com/comment/38593984
answers question: http://stackoverflow.com/q/24852428
type: Answer
has body: You can do. Declare the input variable in your javascript file. and use like this: $(document).ready(function() { var textbox = document.createElement('input'); var button = document.createElement('input'); $('.first-name').html(textbox); $('.first-name').find('input').attr({'id': 'first-name', 'type': 'text'}); $('.button-div').html(button); $('.button-div').find('input').attr({'id': 'save', 'type': 'button'}).val('Save'); }); &lt;body&gt; &lt;div class="first-name"&gt; &lt;/div&gt; &lt;div class="button-div"&gt; &lt;/div&gt; &lt;/body&gt; Note: This will be very complex
score: 0
has comment: http://stackoverflow.com/comment/38592613
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/38593213

http://stackoverflow.com/q/24854750
has comment: http://stackoverflow.com/comment/38596566
has body: I noticed when using DuckDuckGo, a tick appears next to a link when I've visited the page, as here: What particularly intrigues me is that, unlike purple links where the browser applies the a:visited pseudoclass, this is a separate element within the DOM: I'm aware that browsers leak information about visited links, and I'm also aware that it's possible for DDG to store which links I follow (though that seems to be against their MO). Is this a case of the former technique being used? EDIT: I've also checked my cookies, local &amp; session storage, websql &amp; indexedDB - the page uses none.
favorite count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/38596437
tagged with: css
type: AnsweredQuestion
score: 2
accepted answer: http://stackoverflow.com/a/24854879
has title: How does DuckDuckGo show icons according to if I've visited a page?
tagged with: browser-history
type: Question
tagged with: browser
has comment: http://stackoverflow.com/comment/38596516
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/24854879

http://stackoverflow.com/comment/38644693
has text: @user3377126, Can you please create fiddle demo for your issue?
type: Comment
comment on: http://stackoverflow.com/a/24870249
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38420384
type: QuestionComment
comment on: http://stackoverflow.com/q/24761578
type: Comment
has text: *"The problem is Jquery isn’t returning the list items in the list, its returning the number of list item in the list."* are you sure? php won't change the fact that .find returns a jQuery collection. View the source of the page (ctrl+u) and find the list. That's what jquery can see. If the list is empty, that's where your problem lies. Fix that before you start worrying about how jQuery interprets things.
score: 0

http://stackoverflow.com/q/24889255
accepted answer: http://stackoverflow.com/a/24930654
tagged with: javascript
score: 0
answer count: 1
has title: Can I Populate A Lookup/Optionset based on the results of a Lookup
tagged with: plugins
has answer: http://stackoverflow.com/a/24930654
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38736265
has comment: http://stackoverflow.com/comment/38662016
has comment: http://stackoverflow.com/comment/38667790
tagged with: dynamics-crm-2013
type: Question
tagged with: c#
has body: I'm creating a Issue entity in CRM 2013. I'm using a lookup to associate an Account to the issue. From here I want to be able to retrieve the orders that are associated with that account to associate the issue too. The end result would be a lookup/option set populated with the orders for the account which the user can then pick one from.
has comment: http://stackoverflow.com/comment/38662152

http://stackoverflow.com/q/24882503
accepted answer: http://stackoverflow.com/a/24882626
tagged with: javascript
has comment: http://stackoverflow.com/comment/38648968
linked to: http://stackoverflow.com/q/10804042
answer count: 1
has body: &lt;input type="date" id="startDate" /&gt; &lt;input type="date" id="endDate" /&gt; &lt;script&gt; $("#endDate").click(function () { var date1 = $("#startDate").val(); var date2 = $("#endDate").val(); var timeDiff = Math.abs(date2.getTime() - date1.getTime()); var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24)); alert(diffDays)​; }); &lt;/script&gt; getTime not work , and this message shown intellisense was unable to determine an accurate completion list for this expression How do I get the difference days between two Dates in this case and how can getTime work with me ?
linked to: http://stackoverflow.com/q/41948
has title: How do I get the difference days between two Dates in JavaScript?
has answer: http://stackoverflow.com/a/24882626
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38648974
score: 0
type: Question

http://stackoverflow.com/q/24788044
has body: I want to crop several images in a page using HTML5's canvas tag and JavaScript. The problem is that the page shows just one of the images. What should I do? The code I tried is below: &lt;canvas id="myCanvas" width="300" height="300"&gt;&lt;/canvas&gt; &lt;canvas id="myCanvas" width="300" height="300"&gt;&lt;/canvas&gt; &lt;canvas id="myCanvas" width="300" height="300"&gt;&lt;/canvas&gt; &lt;script&gt; var canvas = document.getElementById('myCanvas'); var context = canvas.getContext('2d'); var imageObj = new Image(); imageObj.onload = function() { // draw cropped image var sourceX = 0; var sourceY = 0; var sourceWidth = 200; var sourceHeight = 150; var destWidth = sourceWidth; var destHeight = sourceHeight; var destX = canvas.width / 2 - destWidth / 2; var destY = canvas.height / 2 - destHeight / 2; context.drawImage(imageObj, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight); }; imageObj.src ='http://static.adzerk.net/Advertisers/3478c54721cd466fb6f7d3afe16e97d4.gif'; &lt;/script&gt; The Fiddle: http://jsfiddle.net/soheilyou/54VTh/
favorite count: 0
upvote count: 2
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3808808
has title: Using Several Canvases at Once
type: Question
has answer: http://stackoverflow.com/a/24788128
accepted answer: http://stackoverflow.com/a/24788128
tagged with: canvas
downvote count: 0
tagged with: javascript
tagged with: crop
has comment: http://stackoverflow.com/comment/38470638
answer count: 1
has comment: http://stackoverflow.com/comment/38470724

http://stackoverflow.com/comment/38495214
comment on: http://stackoverflow.com/a/24801136
type: AnswerComment
score: 0
type: Comment
has text: Using this version `Model` is empty for other files.

http://stackoverflow.com/q/24908903
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38698533
has comment: http://stackoverflow.com/comment/38698827
has answer: http://stackoverflow.com/a/24909363
accepted answer: http://stackoverflow.com/a/24909363
type: Question
answer count: 1
tagged with: javascript
score: 4
linked to: http://stackoverflow.com/q/2603465
has title: How to create a print dialog that displays the current web page's screenshot
downvote count: 1
favorite count: 0
has body: I just want to know if there's easy way to create a print dialog for WordPress that outputs on the print dialogue box the actual view of a webpage. P perhaps a full page screenshot might work as long as it has the full page's height. I tried WP-Screenshot plugin on this page. The plugin outputs a screenshot that can be printed out by adding a print dialogue plugin. However, the the height of the image produced by WP-Screenshot can't be dynamic so I guess I need to find another solution. I can't find a plugin that has the functionality to print the current webpage with all the styles preserved in the print dialogue. So I'm thinking that screenshot might work. Any idea or suggestions?
upvote count: 5
tagged with: wordpress

http://stackoverflow.com/comment/38514436
type: QuestionComment
has text: @Casey Falk this is just an example
comment on: http://stackoverflow.com/q/24811205
score: 0
type: Comment

http://stackoverflow.com/q/24841490
tagged with: prerender
linked to: http://stackoverflow.com/q/8626812
has body: I'm developing a MEAN stack application (Mongo, Express, Angular, Node), and i want to share some pages on a Facebook fun page and have a personalised link like this one. https://www.evernote.com/shard/s414/sh/6c61c036-abc6-4eb9-b355-41af05760979/45fce4c1795580266f1247dba3452d62/res/31e7a3bd-7258-4910-bb05-5e2e61cd2d96/skitch.png I'm using dynamic og tags to show different data on shared link &lt;html itemscope itemtype="http://schema.org/Article"&gt; &lt;!-- Open Graph --&gt; &lt;meta property="og:title" content="{{og_title}}" /&gt; &lt;meta property="og:type" content="article" /&gt; &lt;meta property="og:url" content="{{og_url}}" /&gt; &lt;meta property="og:image" content="{{og_image}}" /&gt; &lt;meta property="og:description" content="{{og_description}}" /&gt; &lt;meta property="og:site_name" content="MYSITENAME" /&gt; &lt;meta property="fb:admins" content="MYAPPID" /&gt; These variable are retrieved from server by a $http.get() I'm using also prerender.io server running on my EC2 instance (on port 3000), in order to allow my javascript pages to be crawled perfectly. app.use(require('prerender-node').set('prerenderServiceUrl', 'http://'+ config.DNS +':3000/')); Prerender is working fine, because when i type http://DOMAINE.com:3000/http://DOMAINE.com/items/5376899f3230687806000016 i get a snapshot of the page and when i show the code source of this page i get correct data. &lt;!-- Open Graph data --&gt; &lt;meta property="og:title" content="Pink floyd CD"&gt; &lt;meta property="og:type" content="article"&gt; &lt;meta property="og:url" content="DOMAINE.com:80/items/53763aad67afe39d05000017"&gt; &lt;meta property="og:image" content="https://fpid.s3.amazonaws.com/items/4748_DarkSideOfTheMoon.jpg"&gt; .... My problem is when i share this url on Facebook http://DOMAINE.com/items/5376899f3230687806000016 instead of getting a good link with image, title and description, i get this poor link https://www.evernote.com/shard/s414/sh/ac398446-276e-46ae-bc1e-eab5fea5cc31/ac533…
favorite count: 0
has answer: http://stackoverflow.com/a/24842239
accepted answer: http://stackoverflow.com/a/24842239
tagged with: angularjs
tagged with: facebook
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24951631
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/38572788
type: Question
tagged with: javascript
has title: Facebook can't read dynamic og tags on a page developed by AngularJS
has answer: http://stackoverflow.com/a/24951631
score: 0
answer count: 2

http://stackoverflow.com/a/24894574
has body: Try to apply fadeIn function directly to jQuery result (not inside jQuery.each): $graphName.fadeIn(500, function() { $graphaxes.delay(500*index).fadeIn(800, function() { $(".circle").delay(500*index).fadeIn(800); }); });
type: Answer
answers question: http://stackoverflow.com/q/24894079
score: 0

http://stackoverflow.com/comment/38521860
has text: Id should be keep unique, you can give them different name.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24815286

http://stackoverflow.com/comment/38568410
comment on: http://stackoverflow.com/a/24840397
score: 0
type: Comment
has text: The data is retrieved by AJAX `dataType: 'json'` already. The issue i have is when i try to output a single value based on the key it gives me nothing in the alert.
type: AnswerComment

http://stackoverflow.com/comment/38659003
score: 0
comment on: http://stackoverflow.com/q/24887934
type: Comment
type: QuestionComment
has text: Offtopic: Nice identicon

http://stackoverflow.com/comment/38722509
type: AnswerComment
type: Comment
has text: This didn't work either. I got the same results that I used in my question.
comment on: http://stackoverflow.com/a/24904625
score: 0

http://stackoverflow.com/q/24838964
has body: I want to refactor code of which I post examples below. I am very new to AngularJS. Now when I saw the code, I was very curious about all the logic that is placed in the HTML code. = 2" class="step" ng-class="{active: data.step == 3, done: data.step > 3, left: data.preSpreadChoice == 1, right: data.preSpreadChoice == 3}" ng-scroll-here="data.step == 3"> data.emails.length von data.count – Math.max(0,data.count-data.emails.length) Members = 5 && data.multipleTeams" class="step" ng-class="{done: data.step > 5, active: data.step == 5}" ng-scroll-here="data.step == 5"> Shouldn't the HTML rather contain classes or attributes and the logic itself should be placed in JS files or JS code? Is this a good (or at least a common) way of developing AngularJS? Or should placing logic in HTML be avoided?
has answer: http://stackoverflow.com/a/24839265
tagged with: angularjs
score: 11
has answer: http://stackoverflow.com/a/24845815
upvote count: 11
type: AnsweredQuestion
tagged with: separation-of-concerns
has comment: http://stackoverflow.com/comment/38566077
accepted answer: http://stackoverflow.com/a/24845815
type: Question
has comment: http://stackoverflow.com/comment/38566012
tagged with: javascript
answer count: 2
has title: Should AngularJS logic be placed in HTML file?
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
possible better answer: http://stackoverflow.com/a/24839265
favorite count: 0

http://stackoverflow.com/q/24769218
accepted answer: http://stackoverflow.com/a/24769265
favorite count: 0
tagged with: jquery-select2
has comment: http://stackoverflow.com/comment/38457305
type: AnsweredQuestion
has body: I'm using Select2 on a select menu and when a user types into the search field, Select2 will search for those letters and display them even if they just appear in the middle of an option. For example, if I have a select like this: Apple Grape Prune My Select2 code looks like this: $('#e1').select2({ placeholder: "", allowClear: true, width: '600px', selectOnBlur: true, scrollpad: true, }); And the user simply types "p" in the search box, it will display all three options. What I want to happen in that situation is for it to just display "Prune." Is there any way to do this? I've looked around on Google and the documentation and either I'm missing something really crucial or it's just not there. Anybody got any words of wisdom on the matter?
downvote count: 1
has comment: http://stackoverflow.com/comment/38461728
has comment: http://stackoverflow.com/comment/38434708
type: Question
has answer: http://stackoverflow.com/a/24769265
has title: select2 search preloaded list as typed
score: -1
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/24846417
has title: How to select from cursor (or selection start) through the end of a Google Docs text document?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24860893
has comment: http://stackoverflow.com/comment/38599811
tagged with: google-docs
type: Question
tagged with: google-apps-script
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38599902
has body: I'm trying to figure out how to use DocumentApp.getActiveDocument().setSelection(range); in a Google Docs text document, to select all text from the current cursor position (or the beginning of the selection) through the end, but I don't understand how to create the necessary Range object to do this. (References: setSelection, Document) There is a helpful cursor inspector available from this issue-post, which makes it clear that the "offset" of a selection is relative to the current paragraph (or technically, Element) that it's in. So if the selection is the first five characters in list element three, then its offsets are 0 and 4, with no real context of the elements (paragraphs) before it or after it. Selecting through the end of the document (I've added in some empty paragraphs after the list): The closest thing I've found is this example, which increases the selection to include every table in the document. // Change the user's selection to a range that includes every table in the document. var doc = DocumentApp.getActiveDocument(); var rangeBuilder = doc.newRange(); var tables = doc.getBody().getTables(); for (var i = 0; i &lt; tables.length; i++) { rangeBuilder.addElement(tables[i]); } doc.setSelection(rangeBuilder.build()); So, how do you use RangeBuilder to create a Range that starts with the "current cursor position" (or start of the current selection), and ends with "document end"? Thank you.
score: 0

http://stackoverflow.com/a/24757071
type: Answer
has body: var strictVar; //declare strictVar in global scope for later usage function strictFunc() { 'use strict'; strictVar = 123; //set strictVar to 123 } strictFunc(); //call strictFunc(); console.log(strictVar); // =&gt; 123 It's bad practise to define variables without the "var" keyword for usage in the global scope. That's why it's not possible in strict mode. You have to declare that variable in the global scope first by using the var keyword. Then you can set its value in a function.
answers question: http://stackoverflow.com/q/24756780
has comment: http://stackoverflow.com/comment/38411496
score: 0

http://stackoverflow.com/comment/38456347
comment on: http://stackoverflow.com/a/24776484
type: Comment
has text: +1 For only answer that actually used v2.3.2. Here's a [2.3 fiddle](http://jsfiddle.net/KyleMit/jE9C3/), although I bet OP actually wants `icon-pencil`
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38683808
score: 0
comment on: http://stackoverflow.com/q/24900700
type: Comment
type: QuestionComment
has text: @diego.greyrobot I just pasted my trackmetrics.js file code.

http://stackoverflow.com/a/24775246
score: 2
downvote count: 0
upvote count: 2
has body: You can use load of JQuery if you want to load only partial part of you DOM $("#settingsContent).load(url); http://api.jquery.com/load/
answers question: http://stackoverflow.com/q/24774897
type: Answer

recursion
type: Tag
tags question: http://stackoverflow.com/q/24804905
tag name: recursion
tags question: http://stackoverflow.com/q/24870917
tags question: http://stackoverflow.com/q/24884641
tags question: http://stackoverflow.com/q/24880182
tags question: http://stackoverflow.com/q/24877313
tags question: http://stackoverflow.com/q/24762104
tags question: http://stackoverflow.com/q/24865411
tags question: http://stackoverflow.com/q/24803832

http://stackoverflow.com/comment/61573509
type: Comment
comment on: http://stackoverflow.com/q/24783269
type: QuestionComment
has text: without seeing your template, this is hard to answer; however, it could be that .barClassName is not a part of this particular view. The events can only listen to DOM elements that are children of your ItemView.
score: 0

http://stackoverflow.com/comment/38558007
comment on: http://stackoverflow.com/a/24834429
type: AnswerComment
type: Comment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/57589/discussion-between-lucuma-and-mitch-glenn).
score: 0

http://stackoverflow.com/comment/38414681
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24755352
has text: Please edit the question not in a way, so the context, between the question and answer is no longer recognizable. I have edited them to the previous version.
score: 0

http://stackoverflow.com/q/24873809
linked to: http://stackoverflow.com/q/24847190
has answer: http://stackoverflow.com/a/24874000
has comment: http://stackoverflow.com/comment/38633201
has comment: http://stackoverflow.com/comment/38633603
has body: I'm trying to work out how to match arrays that share the same elements, but not necessarily in the same order. For example, these two arrays share the same set of elements, even though they're in a different order. Is there any way to determine whether two arrays contain the same elements? var search1 = ["barry", "beth", "debbie"]; var search2 = ["beth", "barry", "debbie"]; if (search1 == search2) { document.write("We've found a match!"); } else { document.write("Nothing matches"); } I've got a Codepen of this running at the moment over here: http://codepen.io/realph/pen/grblI
possible better answer: http://stackoverflow.com/a/24873982
has answer: http://stackoverflow.com/a/24874076
answer count: 5
has comment: http://stackoverflow.com/comment/38633094
linked to: http://stackoverflow.com/q/7837456
type: AnsweredQuestion
has title: JavaScript: How to match out-of-order arrays
accepted answer: http://stackoverflow.com/a/24874083
has comment: http://stackoverflow.com/comment/38633010
type: Question
has answer: http://stackoverflow.com/a/24873982
has answer: http://stackoverflow.com/a/24874083
has answer: http://stackoverflow.com/a/24874019
tagged with: javascript
has comment: http://stackoverflow.com/comment/38633381
score: 0

http://stackoverflow.com/tag/html
tags question: http://stackoverflow.com/q/24864718
tags question: http://stackoverflow.com/q/24760928
tags question: http://stackoverflow.com/q/24822593
tags question: http://stackoverflow.com/q/24840441
tags question: http://stackoverflow.com/q/24816829
tags question: http://stackoverflow.com/q/24839929
tags question: http://stackoverflow.com/q/24890124
tags question: http://stackoverflow.com/q/24853282
tags question: http://stackoverflow.com/q/24788437
tags question: http://stackoverflow.com/q/24878710
tags question: http://stackoverflow.com/q/24841973
tags question: http://stackoverflow.com/q/24788416
tags question: http://stackoverflow.com/q/24778984
tags question: http://stackoverflow.com/q/24815407
tags question: http://stackoverflow.com/q/24779140
tags question: http://stackoverflow.com/q/24791608
tags question: http://stackoverflow.com/q/24831689
tags question: http://stackoverflow.com/q/24879730
tags question: http://stackoverflow.com/q/24840261
tags question: http://stackoverflow.com/q/24773996
tags question: http://stackoverflow.com/q/24878965
tags question: http://stackoverflow.com/q/24769070
tags question: http://stackoverflow.com/q/24876052
tags question: http://stackoverflow.com/q/24845683
tags question: http://stackoverflow.com/q/24783504
tags question: http://stackoverflow.com/q/24832316
tags question: http://stackoverflow.com/q/24843457
tags question: http://stackoverflow.com/q/24885882
tags question: http://stackoverflow.com/q/24801380
tags question: http://stackoverflow.com/q/24846874
tags question: http://stackoverflow.com/q/24883441
tags question: http://stackoverflow.com/q/24767668
tags question: http://stackoverflow.com/q/24779112
tags question: http://stackoverflow.com/q/24818956
tags question: http://stackoverflow.com/q/24817619
tags question: http://stackoverflow.com/q/24843865
tags question: http://stackoverflow.com/q/24813438
tags question: http://stackoverflow.com/q/24878356
tags question: http://stackoverflow.com/q/24827048
tags question: http://stackoverflow.com/q/24901520
tags question: http://stackoverflow.com/q/24824956
tags question: http://stackoverflow.com/q/24879312
tags question: http://stackoverflow.com/q/24879674
tags question: http://stackoverflow.com/q/24870987
tags question: http://stackoverflow.com/q/24755057
tags question: http://stackoverflow.com/q/24872044
tags question: http://stackoverflow.com/q/24751374
tags question: http://stackoverflow.com/q/24836165
tags question: http://stackoverflow.com/q/24851722
tags question: http://stackoverflow.com/q/24760932
tags question: http://stackoverflow.com/q/24777906
tags question: http://stackoverflow.com/q/24906830
tags question: http://stackoverflow.com/q/24828989
tags question: http://stackoverflow.com/q/24762902
tags question: http://stackoverflow.com/q/24868297
tags question: http://stackoverflow.com/q/24900642
tags question: http://stackoverflow.com/q/24835814
tags question: http://stackoverflow.com/q/24763756
tags question: http://stackoverflow.com/q/24902696
tags question: http://stackoverflow.com/q/24882270
tags question: http://stackoverflow.com/q/24834397
tags question: http://stackoverflow.com/q/24778424
tags question: http://stackoverflow.com/q/24827138
tags question: http://stackoverflow.com/q/24817183
tags question: http://stackoverflow.com/q/24794506
tags question: http://stackoverflow.com/q/24839567
tags question: http://stackoverflow.com/q/24896072
tags question: http://stackoverflow.com/q/24817676
tags question: http://stackoverflow.com/q/24886457
tags question: http://stackoverflow.com/q/24860962
tags question: http://stackoverflow.com/q/24796209
tags question: http://stackoverflow.com/q/24791074
tags question: http://stackoverflow.com/q/24830222
tags question: http://stackoverflow.com/q/24847183
tags question: http://stackoverflow.com/q/24838009
tags question: http://stackoverflow.com/q/24864648
tags question: http://stackoverflow.com/q/24903873
tags question: http://stackoverflow.com/q/24832990
tags question: http://stackoverflow.com/q/24785673
tags question: http://stackoverflow.com/q/24773199

http://stackoverflow.com/q/24785609
favorite count: 0
tagged with: angularjs
upvote count: 2
score: 2
type: AnsweredQuestion
has body: I have a directive with a link function that, inside it, performs a scope.$on('$destroy', cleanup). I'd like to open the browser's JavaScript console and trigger the $destroy to make sure cleanup is getting called and executing correctly. How can I do this? Inside the link function, I've set window.blahblah = scope;, then tried window.blahblah.trigger('$destroy') in the JavaScript console, but not firing. Eventually I'm going to have to write a test in the .spec.js file for this directive, so knowing how to do that, too, would be helpful.
has comment: http://stackoverflow.com/comment/38465855
accepted answer: http://stackoverflow.com/a/24785825
type: Question
tagged with: javascript
has title: Angular scope.$on('$destroy')
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/24785825

http://stackoverflow.com/q/24836165
tagged with: css
type: AnsweredQuestion
has title: document.execCommand not obeying CSS
has body: I have a contentEditable &lt;div&gt; which I'm turning into a very simple text editor. When 'tab' is pressed, a bullet point is created using document.execCommand('insertUnorderedList'); which works great. Here's the problem though: HTML: &lt;div id="wysiwyg"&gt; &lt;/div&gt; CSS: #wysiwyg{ font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif; font-weight: normal; font-size: 0.9em; color: rgb(70,70,70); } #wysiwyg ul li { font-family: 'Calendas Regular', serif !important; font-size: 1em; } When I create a bullet point using the document.execCommand('insertUnorderedList'); though, it gets styled as if it were just any old text inside my #wysiwyg, not as if it were a bullet point, but if I insert some initial text (via HTML, not via using the contentEditable-ness) in the #wysiwyg then it styles bullet points correctly. Any ideas what's up? Thanks
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38561361
has comment: http://stackoverflow.com/comment/38569974
has comment: http://stackoverflow.com/comment/38561243
has answer: http://stackoverflow.com/a/24845740
tagged with: javascript
has comment: http://stackoverflow.com/comment/38561278
answer count: 1
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/18383803
accepted answer: http://stackoverflow.com/a/24845740
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/38446701
type: Comment
type: QuestionComment
has text: 1. Type "sails.js" into Google and search. 2. Click the first link. 3. Click "Getting Started". 4. Do what it says.
score: 8
comment on: http://stackoverflow.com/q/24775604

http://stackoverflow.com/q/24842752
answer count: 1
has comment: http://stackoverflow.com/comment/38573152
has body: I'm using the autocompleter of "http://www.devbridge.com/sourcery/components/jquery-autocomplete/" but in a previous version because of its lightweight and speed. the version I used can be found here: https://code.google.com/p/jquery-autocomplete/source/browse/ Within that I try to receive results with &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt; $(function() { $("#ac1").autocomplete('search.php', { selectFirst: true }); $("#flush").click(function() { var ac = $("#ac1").data('autocompleter'); if (ac &amp;&amp; $.isFunction(ac.cacheFlush)) { ac.cacheFlush(); } else { alert('Error flushing cache'); } }); the data.php is very easy structured: $data = array( "Berlin" =&gt; "10178", "Hamburg" =&gt; "20038", "München" =&gt; "80331", and the search.php file is the following: &lt;?php include 'data.php'; include 'data.php'; function autocomplete_format($results) { foreach ($results as $result) { echo $result[0] . '|' . $result[1] . "\n"; } } if (isset($_GET['q'])) { $q = strtolower($_GET['q']); if ($q) { foreach ($data as $key =&gt; $value) { if (strpos(strtolower($key), $q) !== false) { $results[] = array($key, $value); } } } } $output = 'autocomplete'; if (isset($_GET['output'])) { $output = strtolower($_GET['output']); } if ($output === 'json') { echo json_encode($results); } else { echo autocomplete_format($results); } Now I got 2 Questions: As you see, the data.php consists special charakters like "ü" and "ö". these arent shown correctly in the result. could anybody help me and tell how to fix this? and the second question is how to echo the second part after the city name and the "=>" regarding to the searched city? Thank you very much for helping
has comment: http://stackoverflow.com/comment/38573160
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24842885
has title: use special characters in ajax
type: Question
has comment: http://stackoverflow.com/comment/38593379
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/24842885

http://stackoverflow.com/comment/38562443
comment on: http://stackoverflow.com/q/24837039
score: 3
type: Comment
has text: Loop backwards. Or adjust `i` inside the `if` that does the `.splice()`. (Also, there's no JSON in your code: JSON is a string format. What you have is objects and an array.)
type: QuestionComment

http://stackoverflow.com/comment/38462150
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24764355
has text: I want to see the page only with message 'No data'. I dont want user to see the "One or more participants failed to draw()×" message. But i found the solution, I added google.visualization.events.addListener(chart, 'error', function (err) { google.visualization.errors.removeError(err.id); }); After this Line var chart = new google.visualization.Dashboard(document.getElementById('dashboard')). bind([categoryPicker], [table,pie]); . Thanks Asgallant For your quick response.
score: 0

http://stackoverflow.com/comment/38635067
type: AnswerComment
comment on: http://stackoverflow.com/a/24874784
has text: It would (and I use it), but not everyone wants the overhead, and so much of the old insanity is finally gone now that nearly all of us can say bye-bye to IE7... IE8 has `querySelectorAll`, for instance; *quelle modern*! ;-)
type: Comment
score: 1

http://stackoverflow.com/q/24858171
has comment: http://stackoverflow.com/comment/38603182
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/39280166
answer count: 2
has comment: http://stackoverflow.com/comment/38603078
has comment: http://stackoverflow.com/comment/41340076
tagged with: newline
has comment: http://stackoverflow.com/comment/41344426
tagged with: ecmascript-5
tagged with: javascript
downvote count: 6
upvote count: 34
linked to: http://stackoverflow.com/q/81656
has answer: http://stackoverflow.com/a/26345085
accepted answer: http://stackoverflow.com/a/26345085
linked to: http://stackoverflow.com/q/2846283
score: 28
has comment: http://stackoverflow.com/comment/38603250
tagged with: code-formatting
has comment: http://stackoverflow.com/comment/38605317
possible better answer: http://stackoverflow.com/a/25219017
type: AnsweredQuestion
has title: Are there semicolon insertion dangers with continuing operators on next line?
has answer: http://stackoverflow.com/a/25219017
has body: Historically, I like to break expressions so that the "it's clearly incomplete" bias is shown on the continued line: var something = foo + bar + baz(mumble); This is an attitude that comes from working in languages which need semicolons to terminate expressions. The first line is already obviously incomplete due to no-semicolon, so it's better to make it clear to the reader that the second line is not complete. The alternative would be: var something = foo + bar + baz(mumble); That's not as good for me. Now the only way to tell that baz(mumble); isn't standalone (indentation aside) is to scan your eyes to the end of the previous line. * (Which is presumably long, as you needed to break it in the first place.)* But in bizarro JavaScript land, I started seeing people changing code from things that looked like the first form to the second, and warning about "automatic semicolon insertion". It certainly causes some surprising behaviors. Not really wanting to delve into that tangent at the time I put "learn what automatic semicolon insertion is and whether I should be doing that too" into my infinite task queue. When I did look into it, I found myself semi-sure... but not certain... that there aren't dangers with how I use it. It seems the problems would come from if I had left off the + on accident and written: var something = foo + bar baz(mumble); ...then JavaScript inserts a semicolon after foo + bar for you, seemingly because both lines stand alone as complete expressions. I deduced perhaps those other JavaScript programmers thought biasing the "clearly intentionally incomplete" bit to the end of the line-to-be-continued was better, because it pinpointed the location where the semicolon wasn't. Yet if I have stated my premise correctly, I am styling my broken lines in a way that the ensuing lines are "obviously incomplete". If that weren't the case then I wouldn't consider my way an advantage in the first place. Am I correct, that my way is not a risk for the condit…

http://stackoverflow.com/q/24760832
tagged with: cordova
upvote count: 1
tagged with: webview
downvote count: 1
type: AnsweredQuestion
has body: I cannot call a JavaScript method from Java! I included this in the main java file: JavaScriptInterface jsInterface = new JavaScriptInterface(this); cordova_webview.getSettings().setJavaScriptEnabled(true); cordova_webview.addJavascriptInterface(jsInterface, "JSInterface"); @Override protected void onPause() { super.onPause(); cordova_webview.loadUrl("javascript:punish()"); Log.d(TAG, "onPause"); } BUT I get this error in logacat: 07-15 17:25:18.490: D/CORDOVA_ACTIVITY(6422): onPause 07-15 17:25:18.495: D/CordovaLog(6422): null: Line 1 : Uncaught ReferenceError: punish is not defined 07-15 17:25:18.495: E/Web Console(6422): Uncaught ReferenceError: punish is not defined at null:1 the method is in index.js, which is included in the html. However I tried to include the method in the html through a &lt;script&gt; tag and it's executing, but only after onResume! How can I solve this?
tagged with: android-webview
has answer: http://stackoverflow.com/a/24762863
type: Question
answer count: 2
tagged with: javascript
has title: Cannot call javascript methods from java
score: 0
has answer: http://stackoverflow.com/a/24763093
tagged with: android
accepted answer: http://stackoverflow.com/a/24762863
favorite count: 0
possible better answer: http://stackoverflow.com/a/24763093

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

http://stackoverflow.com/q/24869277
tagged with: javascript
has answer: http://stackoverflow.com/a/24870102
answer count: 2
upvote count: 1
has title: Get date value from date picker
favorite count: 0
has comment: http://stackoverflow.com/comment/38624540
has comment: http://stackoverflow.com/comment/38624352
has answer: http://stackoverflow.com/a/24871148
type: AnsweredQuestion
downvote count: 0
possible better answer: http://stackoverflow.com/a/24871148
score: 1
has comment: http://stackoverflow.com/comment/38624085
has body: I am very new to MVC and I am trying to get the date the user selects from the date picker and display another set of dates based on a user input. The date picker works fine however I am not sure how to get the value of the date and pass it to the calculation. I have created a textbox to get the number of days the user wants displayed and the button to initiate the calculation, however the way I created the button also created another text box. Here is the view code: @using (Html.BeginForm()) { Enter The Number Of Days To Display Date: @Html.TextBoxFor(model => model.DaysToBeViewed)
type: Question
tagged with: c#
accepted answer: http://stackoverflow.com/a/24870102
tagged with: asp.net-mvc

http://stackoverflow.com/a/24905128
score: 0
answers question: http://stackoverflow.com/q/24904830
type: Answer
has body: Updated The solution is to access the needed variable as a property of the containing object. If defined in the global scope using var , in javascript the value is assigned as a property of the global object, and it can be accessed using the self explanatory keyword globalThis In JavaScript, there's always a global object defined. In a web browser, when scripts create global variables defined with the var keyword, they're created as members of the global object. (In Node.js this is not the case.) var subcatlist1 = 'aa'; var subcatlist2 = 'bb'; var subcatlist3 = 'cc'; var itemNumber = parseInt(Math.random() * 3) + 1 $('#test').html(globalThis['subcatlist' + itemNumber]) See also "Variable" variables in JavaScript Original answer If having a list of variables is mandatory you could use eval() like this: $(element).html(eval("subcatlist"+ itemNumber)); eval can be harmful and should be avoided in most cases

http://stackoverflow.com/a/24815893
type: Answer
has body: you can use the change event - http://api.jquery.com/change/ which will be triggered when the selected value changes $("select").change(function (){});
score: 0
has comment: http://stackoverflow.com/comment/38523040
answers question: http://stackoverflow.com/q/24815740

http://stackoverflow.com/comment/38421762
comment on: http://stackoverflow.com/q/24761320
type: Comment
type: QuestionComment
has text: @SMcCrohan I added the breakpoints - and it looks like response is bein returned with a status code 201. Any other ideas?
score: 0

http://stackoverflow.com/q/24777980
score: 0
answer count: 1
tagged with: lightbox
has answer: http://stackoverflow.com/a/24780010
tagged with: javascript
has comment: http://stackoverflow.com/comment/38454341
has comment: http://stackoverflow.com/comment/38450913
tagged with: zooming
type: UnansweredQuestion
tagged with: php
has title: light box not working only zooming function working
has body: Click to enlarge Click to enlarge this is the code we are using zoom the product and onclick to light box pop the image here it works only for zoom it is not worked for lightbox . can any one help me?
type: Question

http://stackoverflow.com/a/24861477
score: 0
has body: This wont work because incase you have javascript disabled it will generate 3 tags ( and Merging 2 forms in one which is not very clean and can have unwanted sideeffects. I would suggest you do it otherwise, create 2 complete forms mark them with an ID. The JavaScript version should be hidden by default. Then JavaScript should perform the changes that are nesessary only if JavaScript works. &lt;form id="this_is_for_javascript_mode" method="post" style="display: none;"&gt; -put form content here...- &lt;/form&gt; &lt;form id="this_is_for_non_javascript_mode" method="post"&gt; -put form content here...- &lt;/form&gt; And then simply control visiblity by JavaScript. This will work because a script-tag will not be executed if JavaScript id disabled in the browser! &lt;script type="text/javascript&gt; $("#this_is_for_non_javascript_mode").remove(); //Remove non-js version $("#this_is_for_javascript_mode").css("display", "block"); //Make js version visible &lt;/script&gt;
type: Answer
answers question: http://stackoverflow.com/q/24861375

http://stackoverflow.com/a/24996837
has comment: http://stackoverflow.com/comment/38866947
upvote count: 1
downvote count: 1
type: Answer
has body: Use the "download" attribute of tag "a". download This should work with the latest Chrome and Firefox but not work on IE.
has comment: http://stackoverflow.com/comment/38865590
answers question: http://stackoverflow.com/q/24836384
score: 0

http://stackoverflow.com/q/24802189
type: UnansweredQuestion
tagged with: python
tagged with: selenium-webdriver
score: 3
has body: I have semi-automated test with selenium webdriver (using python 3). Semi-automated means, that there are some routines, which happens every time, but also there is some user interaction with browser (possible page refreshs, redirecting, ...) What I need is to permanently inject javascript code, which is executed with everytime page is refreshed. Selenium execute_script makes anonymous function wrapper and is lost with every refresh. So is there any way to create such routine? Possible (and just fine) work-around would be to detect when browser is refreshed (and I'm not sure if it is possible) and each time inject the js again. I don't what to create any browser extension, because the js code is only a part of a framework and is being developed. (And also I need to do this in Chrome and Firefox, which would require even more work to handle it). Thank you for help :)
tagged with: selenium
type: Question
has title: Permanently / on-every-refresh injected javascript with selenium
tagged with: javascript
upvote count: 3
has answer: http://stackoverflow.com/a/24803435
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/38458177
type: Comment
comment on: http://stackoverflow.com/a/24780173
has text: I don't use any xml file in my project, only java classes. Do you know the equivalent to that line in java code?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38654556
has text: yeah. Thanks alot for the help. I tried to vote. but it says that i need 15 reputation for that. Again thanks for replying. Peace
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24885157
type: AnswerComment

http://stackoverflow.com/comment/38479935
has text: @Cyberdelphos thank you, I am looking into the SSI suggestion you made, and I agree with your sentiment.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24792636
type: Comment

http://stackoverflow.com/q/24779253
tagged with: razor
tagged with: asp.net-mvc-4
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24780918
has body: i try to show a googlemaps map in my mvc4 partial view. It worked if i hardcode the latitude and longitude in the javascript - but i want to make it more dynamically. So i tried to replace the long and lat with variables. But i only got a grey googlemaps view. Here is my code. What is wrong? Can anyone help me to fix this? @{ var lat = 6.9167; var lng = 79.8473; }
type: Question
tagged with: google-maps
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/24780918
has title: MVC4/Razor with Google Maps

http://stackoverflow.com/comment/38460082
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24782433
type: Comment
has text: Certainly! And also throw a try-except in the view in case the update fails for some reason. I was meaning to leave those details out since they can potentially be confusing, but it's probably a good idea to include them. Thanks, Karthikr!

http://stackoverflow.com/a/70169316
has body: You can also use a plain HTML element inside your SVG by using a foreignObject. For example, I used the following to append an HTML div to my svg object. svg.append("foreignObject") .attr("width", blockWidth) .attr("height", blockHeight) .append("xhtml:div") .style("color", "#000") .style("text-align", "center") .style("width", "100%") .style("height", "100%") .style("padding", "5px") .style("font-size", `${fontSize}px`) .style("overflow-y", "auto") .html("The text to display") Result: The text to display You could also use a .attr('class', 'classname') instead of all the .style(...) calls and insert styles through a stylesheet if your styles are static. Source (and more info/options) from this SO answer.
answers question: http://stackoverflow.com/q/24784302
downvote count: 0
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/comment/38461543
type: AnswerComment
has text: They say it's nearly always bad. Oh well, I'm just presenting different options / possibilities.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24783451

http://stackoverflow.com/comment/136669699
has text: Where do you put this code?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/69766193
type: Comment

http://stackoverflow.com/a/24799780
answers question: http://stackoverflow.com/q/24784240
type: Answer
score: 0
has body: okay, I solved the problem, but it's a too much mixing of javascript and jquery now I think (my jquery is not so good...) so maybe someone can show me a (cleaner) jquery-only-code? fiddle html: <- -> One Two Three content 1 content 2 content 3 JS: $(document).ready(function(){ $('ul.tabs li').click(function(){ var tab_id = $(this).attr('data-tab'); $('ul.tabs li').removeClass('current'); $('.tab-content').removeClass('current'); $(this).addClass('current'); $("#"+tab_id).addClass('current'); }); }); $(document).ready(function(){ $('.tab_nav').click(function(){ if(this.id == 'next_left') { $d = 'l'; } if(this.id == 'next_right') { $d = 'r'; } $max = document.getElementsByClassName('tab-link').length; $currentlink = document.getElementsByClassName('current')[0].id; $arraylink = $currentlink.split('-'); $curlink = $arraylink[1]; $('ul.tabs li').removeClass('current'); $('.tab-content').removeClass('current'); if ($d == 'l') { if ($curlink == 1) { $link = "#link-"+ $max; $tab = "#tab-"+ $max; } else { $link = "#link-" + ($curlink-1); $tab = "#tab-" + ($curlink-1); } } else if ($d == 'r' ) { if ($curlink == $max) { $link = "#link-1"; $tab = "#tab-1"; } else { $link = "#link-" + (parseInt($curlink)+1); $tab = "#tab-" + (parseInt($curlink)+1); } } $($link).addClass('current'); $($tab).addClass('current'); }); });

http://stackoverflow.com/a/24904708
score: 0
has body: course = $(this).find("a").text();
type: Answer
answers question: http://stackoverflow.com/q/24904537

http://stackoverflow.com/q/24899537
has comment: http://stackoverflow.com/comment/38681997
possible better answer: http://stackoverflow.com/a/24899762
has comment: http://stackoverflow.com/comment/38681404
accepted answer: http://stackoverflow.com/a/24899903
has answer: http://stackoverflow.com/a/24899762
tagged with: http://stackoverflow.com/tag/html
has body: I have string containing json data built dynamically with some html inserted for syntax highlighting. console.log(highlightedJson); { "time": "11:09:09 PM", "milliseconds_since_epoch": 1406070549038, "date": "07-22-2014" } Styling to be applied to classes: pre { outline: 1px solid #ccc; padding: 5px; margin: 5px; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word; } .string { color: green; } .number { color: darkorange; } .boolean { color: blue; } .null { color: magenta; } .key { color: red; } Trying to inject this as html into a dom element .. var pre = document.createElement('pre'); // also tried this, but again, syntax highlighting is not rendered //pre.appendChild(highlightedJson)); pre.appendChild(document.createTextNode(highlightedJson)) document.getElementById("body").appendChild(pre); When this code runs, the string is appended to , but syntax highlighting is not showing. I know using pre.innerHTML = highlightedJson; gets the result I'm after but this html injection method is discouraged in firefox addons. Project is not using jquery Can anyone suggest an approach?
has title: Safely inject html string into tag keeping syntax highlighting intact
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38681742
type: Question
has answer: http://stackoverflow.com/a/24899903
tagged with: javascript
has comment: http://stackoverflow.com/comment/38681606
has comment: http://stackoverflow.com/comment/38681817
score: 0
answer count: 2

http://stackoverflow.com/comment/38553817
type: Comment
type: QuestionComment
has text: I was thinking of creating a filter, but unable to do that :(
score: 0
comment on: http://stackoverflow.com/q/24832192

http://stackoverflow.com/comment/38618941
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24864763
has text: Your singleton factory function is over engineering. You should keep things as simple as possible. You could just as well have it written as `var point = function(x, y) { return {x: x, y: y}; };`
score: 0

http://stackoverflow.com/comment/38410529
score: 0
has text: No, I've simply made the button with function `map.setZoom(18)` for test.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24753028

http://stackoverflow.com/q/24799931
has comment: http://stackoverflow.com/comment/38494258
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/38492934
has answer: http://stackoverflow.com/a/24801133
favorite count: 0
has comment: http://stackoverflow.com/comment/38492741
accepted answer: http://stackoverflow.com/a/24801133
upvote count: 1
has comment: http://stackoverflow.com/comment/38492997
has comment: http://stackoverflow.com/comment/38493063
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38494046
downvote count: 3
has title: I need to be able to get the Dropdown box Value to pass over to the onClick Color
has comment: http://stackoverflow.com/comment/38492879
type: Question
has comment: http://stackoverflow.com/comment/38493105
score: -2
tagged with: javascript
tagged with: jquery
has body: I need to change the color off table cell's when clicked using the colour that is selected on the Dropdown box, I am quite new to jQuery so I am kind of stuck. At the moment in the table all off my Cell's have this code on them turning them red when they are clicked but i have a dropdown box at the bottom off the page that i want to change the color off the onclick color to the value off the dropdown box I have put the code for the table, script and Dropdown List that i have used below. &lt;table class="tg" id="nr" align="center"&gt; &lt;tr&gt; } &lt;th class="tc"&lt;/th&gt; &lt;th class="tg-031e"&gt;12&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th class="tc"&gt;Monday&lt;/th&gt; &lt;td class="tc-031e" id="mycell &lt;/td&gt;&gt; &lt;td onclick="this.style.backgroundColor = 'myVar'; " class="tc-031e"&gt; &lt;/table&gt; &lt;script&gt; function color_change(){ var sel = document.getElementById('color'), myVar = sel.options[sel.selectedIndex].value; document.getElementById("tg-031e").style.backgroundColor=myVar; &lt;/script&gt; &lt;p style="width: 1016px; text-align: center;"&gt; &amp;nbsp;Choose a Color&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;select name="Color" id="Color"&gt; &lt;option value="#ff0000"&gt;Red&lt;/option&gt; &lt;option value="Green"&gt;Green&lt;/option&gt; &lt;option value="Orange"&gt;Orange&lt;/option&gt; &lt;option value="Blue"&gt;Blue&lt;/option&gt; &lt;/select&gt; &lt;/p&gt;
has comment: http://stackoverflow.com/comment/38492951

http://stackoverflow.com/q/24783095
has comment: http://stackoverflow.com/comment/38848492
tagged with: javascript
has comment: http://stackoverflow.com/comment/38849861
has answer: http://stackoverflow.com/a/25015670
answer count: 2
has answer: http://stackoverflow.com/a/24803206
accepted answer: http://stackoverflow.com/a/25015670
has title: requirejs optimizer named module bug
favorite count: 0
possible better answer: http://stackoverflow.com/a/24803206
has body: I want to define a module, that does nothing but require other modules, to make sure they are included. like this: File: common.js define(['routes/index_route', 'routes/guides_route']);``` r.js output is: define(['routes/index_route', 'routes/guides_route']); this is wrong because it is supposed to output a named module. However if i define it with a dummy function callback like this: File common.js define(['routes/index_route', 'routes/guides_route'], function() {}); r.js outputs properly. define('routes/common',['routes/index_route', 'routes/guides_route'], function() {}); Is it okay to define a module with a sole purpose of requiring other modules like this? And why does r.js behave like this? Edit I am having trouble with the amd lingo so i will define my problem. I have a router.js which includes all the modules. File: router.js define(['routes/index_route', 'routes/guides_route', 'routes/other_route'], function() { }); I include all these routes ('index_route, guides_route'), but i don't really need any references. So instead of including a bunch of routes inside router.js like this, i want to include all these routes in a seperate file, and include just that file inside router.js. File: router.js define(['routes/common'], function() {}); File: routes/common.js define(['routes/index_route', 'routes/guides_route', 'routes/other_route']); Then the above problem arises. TL;DR I think you are confusing what require and define is. and what r.js is used for. I though the difference between require(['module'], function() {}) and define(['module'], function() {}) is require function is immediately called, define function is called only when its required by some other module. So if you want to request modules you need to use require insead of define makes no sense. TL;DR Just tell me the difference between: define(['module']); define(['module'], function() {}) In terms of how optimizer operates on them. That will tell me why optimizer outputs differently in two cases. …
tagged with: requirejs
tagged with: ruby-on-rails
tagged with: node.js
type: AnsweredQuestion
score: 0
tagged with: amd
upvote count: 1
downvote count: 1
type: Question

http://stackoverflow.com/comment/38418472
type: Comment
comment on: http://stackoverflow.com/a/24760632
type: AnswerComment
has text: Thanks, Just found this also works: ` `
score: 0

http://stackoverflow.com/q/24782299
score: 0
answer count: 1
tagged with: ios
tagged with: jquery
type: UnansweredQuestion
has body: I want to display a popup if instagram is not installed. I have this code right now: setTimeout(function () { $.mobile.changePage( "dialog-instagram.html", { role: "dialog" }); }, 5); window.location = "instagram://media?id=" + element.title; If instagram is installed on mobile phone, this launch the app and shows the photo I want. If not installed, launch dialog-instagram.html Thanks ok. The problem is that dialog-instagram.html is always launched. I just want it to launch if app is not opened. I understand why, code is launched with 5 seconds of delay. Can that be done? How can I know if window.location is succesful or not?
has title: Execute code if native app not exists in javascript
type: Question
has answer: http://stackoverflow.com/a/24782402
tagged with: javascript
linked to: http://stackoverflow.com/q/627916

http://stackoverflow.com/q/24795911
score: 7
tagged with: express
favorite count: 0
has title: How to promisify NodeJS Express with Bluebird
has answer: http://stackoverflow.com/a/24798269
tagged with: promise
has comment: http://stackoverflow.com/comment/38486864
accepted answer: http://stackoverflow.com/a/24798269
upvote count: 7
tagged with: node.js
type: AnsweredQuestion
tagged with: bluebird
has body: I'm using NodeJS with Express and using Bluebird for promises. I'm trying to promisify app object as below but once promisified functions always throw errors. Part of the code is below: var express = require('express'), app = express(), bodyParser = require('body-parser'), Promise = require("bluebird"); app.postAsync = Promise.promisify(app.post); app.postAsync('/api/v1/users/update').then(function(req, res, next) { // never gets here }) .catch(function(err) { console.log("doh!!!"); }); I tried to promisifyAll with same effect. Why is it failing and is there any way to promisify post/get?
type: Question
has comment: http://stackoverflow.com/comment/38485517
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/38544335
has text: I edited in a basic example to show one way to access that info outside of the callback. (Better than using `setTimeout` :P, but there are other better solutions as well - it all depends on how your code is structured)
comment on: http://stackoverflow.com/a/24816397
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38537799
type: QuestionComment
has text: Put code `randomTrack = tracks[Math.floor(Math.random()*tracks.length)];` in your `playTrackR` function
comment on: http://stackoverflow.com/q/24824046
score: 0
type: Comment

http://stackoverflow.com/comment/68384666
comment on: http://stackoverflow.com/q/24836843
has text: Sorry for people trying to use Aptana but, I gave up trying to use it. I use netbeans for HTML, CSS and javascript. I've been doing a lot of my experimenting lately with Komodo edit for node and Angular.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38542677
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24826455
has text: Thanks, but it is not a mobile device. Will it work with IE ?
type: AnswerComment

http://stackoverflow.com/a/24823527
upvote count: 1
score: 1
has body: the last li element, that contains the anchor tag you want to replace, first empty that and then appens the anchor tag you want to add. $("#ancLockProposal").empty(); $("$ancLockProposal").append("Lock"); hope this helps.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24822546
answers question: http://stackoverflow.com/q/24822546
type: Answer

http://stackoverflow.com/comment/38599956
comment on: http://stackoverflow.com/a/24856163
score: 0
type: Comment
has text: Perfect.. I've altered you're original example to also style the background of any of the same post_type img's wrapped in the '' tag. So now what should I do to exclude the navigation links? Is there a way to check the existing class for the **parent element** of the link this finds? Here is my thought process of how it "could" work if the code language was corrected `if $(this).parent('li').TheParentsClass('main-nav') then do nothing else run the code to add the class`
type: AnswerComment

http://stackoverflow.com/comment/38430339
score: 0
type: AnswerComment
type: Comment
has text: o.k. I understand some things just need to know where exactly to write the event?
comment on: http://stackoverflow.com/a/24765011

http://stackoverflow.com/comment/38549929
comment on: http://stackoverflow.com/a/24824078
has text: the dataTable is vanishing FTER I WRITE YOUR CODE
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/24798892
has answer: http://stackoverflow.com/a/24798946
tagged with: javascript
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38491142
score: 1
has body: In a jQuery plugin code, I see the following: $window.on('resize.' + instance.guid, function () { instance.registerTimeout('resizeTimeout', function () { // stuff }, 60); }); What does such resize.instanceId event mean and where does it come from? It does not seem to be anywhere in this library (nor in jQuery itself). When debugging I see that it is actually triggered for a regular resize event.
has title: resize.instanceId events in jQuery
upvote count: 1
type: Question

http://stackoverflow.com/q/24877781
has answer: http://stackoverflow.com/a/24878171
type: AnsweredQuestion
has title: How to enable/disable a button on parent modal popup from child in the IFrame using javascript
score: 0
type: Question
has body: I am trying to disable/enable a button of the parent window from the child window. The following is a snippet from the parent page. &lt;ajaxToolkit:ModalPopupExtender ID="mpeTest" runat="server" CancelControlID="btnClose" PopupControlID="pnl1" TargetControlID="showMpe"/&gt; &lt;asp:Panel ID="pnl1" runat="server" &gt; &lt;ContentTemplate&gt; &lt;iframe id="ContentIframe" runat="server"&gt; &lt;p&gt;Your browser does not support iframes.&lt;/p&gt; &lt;/iframe&gt; &lt;/ContentTemplate&gt; &lt;p class="submitButton"&gt; &lt;asp:Button ID="btnClose" runat="server" Text="Close" /&gt; &amp;nbsp; &lt;asp:Button ID="btnTest" runat="server" Text="EnableDisable" /&gt; &lt;/p&gt; &lt;/asp:Panel&gt; In the child page that is loaded in the iframe, I have a grid view with LinkButtons. I am attempting to get one of these LinkButtons to disable/enable the btnTest from the parent window. I have tried many things but I can't seem to figure this out... for example: &lt;script type="text/javascript" &gt; $(document).ready(function() { jQuery('[id$="linkButtonDisable"]').click(function() { window.parent.opener.document.getElementById("btnTest").disabled = true; }); }); &lt;/script&gt; Can anyone please help me out. I am fairly new to this
accepted answer: http://stackoverflow.com/a/24878171
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: asp.net

http://stackoverflow.com/q/24894388
score: 0
has comment: http://stackoverflow.com/comment/38671410
tagged with: javascript
tagged with: jquery
has body: These are the errors in my console, Uncaught SyntaxError: Unexpected token &lt; jwplayer(1).js:1 GET file:///Users/Desktop/home/homes_files/84820220.html net::ERR_FILE_NOT_FOUND homes_files/84820220.html:1 GET file:///Users/Desktop/home/homes_files/bLBBWlYJp_w.html net::ERR_FILE_NOT_FOUND homes_files/bLBBWlYJp_w.html:1 GET file:///Users/Desktop/home/homes_files/bLBBWlYJp_w(1).html net::ERR_FILE_NOT_FOUND homes_files/bLBBWlYJp_w(1).html:1 GET file:///Users/Desktop/home/homes_files/getSegment.html net::ERR_FILE_NOT_FOUND homes_files/getSegment.html:1 GET file:///Users/Desktop/home/homes_files/index.a92414725f76870a42ebbab80c488823.html net::ERR_FILE_NOT_FOUND homes_files/index.a92414725f76870a42ebbab80c488823.html:1 GET file:///Users/Desktop/home/homes_files/images/overlay.png net::ERR_FILE_NOT_FOUND jquery-1.7.2.min.js:2 Uncaught SyntaxError: Failed to execute 'postMessage' on 'Window': Invalid target origin '' in a call to 'postMessage'. st.aa03925d5a5cf99815b298eaa597d946.js:1 broadcastSendMessage st.aa03925d5a5cf99815b298eaa597d946.js:1 (anonymous function) st.aa03925d5a5cf99815b298eaa597d946.js:1 (anonymous function) st.aa03925d5a5cf99815b298eaa597d946.js:1 GET file:///Users/Desktop/home/images/sep-02.png net::ERR_FILE_NOT_FOUND jquery-1.7.2.min.js:3 My questions is, If I want to track down the origin of these errors what is the rule of them? For example, GET file:///Users/Desktop/home/homes_files/images/overlay.png net::ERR_FILE_NOT_FOUND jquery-1.7.2.min.js:2 I know the error here is the file path should actually be Users/Desktop/home/images/overlay.png Now the file referenced in my example is, jquery-1.7.2.min.js:2 But no where in that file does it mention the incorrect file path for me to change. How can i track errors like this using the console? Also I am using Chrome Devtools Autosave, so if there is a way to do this without ever leaving the console that would be great. Thanks!
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38671689
answer count: 0
has comment: http://stackoverflow.com/comment/38671788
tagged with: google-chrome
type: Question
has title: Using Chrome Inspect Element For Tracking Down Errors

http://stackoverflow.com/a/24905601
type: Answer
has comment: http://stackoverflow.com/comment/38721200
has body: Just fixed the bug, please download the latest version. Note name changes of the new version, $DirectionNavigatorOptions -&gt; $ArrowNavigatorOptions $JssorDirectionNavigator$ -&gt; $JssorArrowNavigator$ $JssorNavigatorOptions -&gt; $BulletNavigatorOptions $JssorNavigator$ -&gt; $JssorBulletNavigator$
accepted answer of: http://stackoverflow.com/q/24901520
score: 0
answers question: http://stackoverflow.com/q/24901520
type: AcceptedAnswer

http://stackoverflow.com/comment/38474383
type: Comment
type: QuestionComment
has text: @DanielGimenez I'm a bit confused. You are saying the last value of i was 3 but then you say that gets incremented one more time so shouldn't the last value be 4? -- undefined undefined vs. 4 undefined
score: 0
comment on: http://stackoverflow.com/q/24789591

graphics
tag name: graphics
type: Tag
tags question: http://stackoverflow.com/q/24755691
tags question: http://stackoverflow.com/q/24784413

http://stackoverflow.com/a/24768959
answers question: http://stackoverflow.com/q/24768795
downvote count: 1
has comment: http://stackoverflow.com/comment/38461179
upvote count: 62
has comment: http://stackoverflow.com/comment/38461674
accepted answer of: http://stackoverflow.com/q/24768795
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/97984936
has body: Here is a quick and dirty concept. It basically compares the offset().top of the element to the top of the window, and the offset().top + height() to the bottom of the window: function getVisible() { var $el = $('#foo'), scrollTop = $(this).scrollTop(), scrollBot = scrollTop + $(this).height(), elTop = $el.offset().top, elBottom = elTop + $el.outerHeight(), visibleTop = elTop &lt; scrollTop ? scrollTop : elTop, visibleBottom = elBottom &gt; scrollBot ? scrollBot : elBottom; $('#notification').text(`Visible height of div: ${visibleBottom - visibleTop}px`); } $(window).on('scroll resize', getVisible).trigger('scroll'); html, body { margin: 100px 0; } #foo { height: 1000px; background-color: #C00; width: 200px; margin: 0 auto; } #notification { position: fixed; top: 0; left: 0; } &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"&gt;&lt;/script&gt; &lt;div id="foo"&gt;&lt;/div&gt; &lt;div id="notification"&gt;&lt;/div&gt; The logic can be made more succinct if necessary, I've just declared separate variables for this example to make the calculation as clear as I can.
score: 61
has comment: http://stackoverflow.com/comment/48010405
type: Answer

http://stackoverflow.com/comment/38597725
type: Comment
comment on: http://stackoverflow.com/a/24855402
score: 0
type: AnswerComment
has text: Hi thanks for this it although I'm still wondering why it happens a fix is greatly appreciated. :) I'm going to put it around -300 because the bug ranged from -400 to -965.

http://stackoverflow.com/comment/38495861
has text: @realtebo after 2nd look at your code is probably because the event listener is outside of angularjs and you need a $scope.$digest() after resolving the promise
score: 0
comment on: http://stackoverflow.com/q/24801460
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24871938
accepted answer: http://stackoverflow.com/a/24873276
type: AnsweredQuestion
has body: I want multiple variables toggled as true or false depending on the current route, which the controller checks when the page loads. VpcYeoman.SuperTableController = Ember.ArrayController.extend({ routedToLocations: false, routedToUsers: false, currentPath: '/', checkCurrentPath: function() { if ( currentPath == '/users') this.set( 'routedToUsers', true ) } elsif ( currentPath == '/locations' ) { this.set( 'routedToLocations', true ) } }); superTable.hbs {{#if routedToUsers}} Users! {{/if}} {{#if routedToLocations}} Locations {{/if}} in users.hbs {{render superTable model}} //which will result in the string 'Users!' in locations.hbs {{render superTable model}} //which will result in the string 'Locations!' Or maybe i could add the variables, like routedToUsers, inside of the 'users' controller with set values. It would look like, - users_controller.js - routedToUsers: true, canBeEdited: false, canBeDeleted: true, This way, each super-table has those variables except they are already predefined. Another example. - locations_controller.js - routedToUsers: false, // this is obviously false but for example's sake routedToLocations: true, canBeEdited: false, canBeDeleted: false, So if I clicked a #link-to on another page that routed me to 'users' for instance, the controller would use 'checkCurrentPath' to make sure that I was indeed on the users page.
type: Question
has answer: http://stackoverflow.com/a/24892705
tagged with: javascript
has title: I want multiple variables toggled as true or false depending on the current route
tagged with: controller
score: 0
has answer: http://stackoverflow.com/a/24873276
answer count: 2
possible better answer: http://stackoverflow.com/a/24892705
tagged with: jquery
tagged with: handlebars.js
tagged with: ember.js

http://stackoverflow.com/a/24894145
type: Answer
has body: First of all you would need to get rid of position: absolute to improve selecting, anyway I guess that it isn't possible? In that case only solution that comes to my mind is creating white filling of '&nbsp;` between next part of text Demo: http://jsfiddle.net/SQ39f/3/
upvote count: 0
score: -2
downvote count: 2
answers question: http://stackoverflow.com/q/24893756

http://stackoverflow.com/a/24822819
score: 0
has body: Just extending Doug R's solution from angular directive encapsulating a delay for ng-change you can make use of the directive based solution. Thereby after a change in the input element, the required actions take place after a configurable amount of delay. You can see the same in http://jsfiddle.net/Lrt7e/1/ &lt;input ng-model="vars.value" ng-change="updateValue(vars.value)" ng-delay="1000" /&gt;
has comment: http://stackoverflow.com/comment/38535805
type: Answer
has comment: http://stackoverflow.com/comment/38536740
answers question: http://stackoverflow.com/q/24819348

http://stackoverflow.com/comment/38652955
has text: @anubhava http://stackoverflow.com/questions/24884641/retrieving-several-capturing-groups-recursively-with-regexp/24884846#comment38652874_24884641
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24884846
type: AnswerComment

http://stackoverflow.com/comment/38603072
type: Comment
type: QuestionComment
has text: Try the [HTML5 Drag and Drop feature](http://www.w3schools.com/html/html5_draganddrop.asp)
score: 2
comment on: http://stackoverflow.com/q/24858164

http://stackoverflow.com/comment/38481808
comment on: http://stackoverflow.com/q/24793660
type: Comment
type: QuestionComment
has text: This is the first time I have had to do something where the console can help me a lot. I am not used to checking. I think I learned my lesson here haha. Removing the dot made a big difference. Thanks.
score: 0

http://stackoverflow.com/comment/38661631
has text: No, i want to test that printFoo does the right thing. So mock the caller of printFoo
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24887686
score: 0

http://stackoverflow.com/comment/38409303
comment on: http://stackoverflow.com/q/24755646
type: QuestionComment
type: Comment
has text: this is strange. Well, have u tried when then/done ? http://api.jquery.com/jquery.when/
score: 0

http://stackoverflow.com/q/24815365
type: Question
has comment: http://stackoverflow.com/comment/38522055
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/72387579
linked to: http://stackoverflow.com/q/45300903
has comment: http://stackoverflow.com/comment/38521969
score: 0
tagged with: animation
has comment: http://stackoverflow.com/comment/127879632
has title: Canvas rendering animation slow on safari
has body: Recently I am working on a animation draw on canvas. The animation is to create a radical gradient circle and move the outside circle from one side to the opposite. So it looks like the search light effect. The Html code is &lt;canvas id="intro-canvas"&gt;&lt;/canvas&gt; The javascript part is: var canvas = document.getElementById("intro-canvas"); var ctx = canvas.getContext("2d"); canvas.width = $window_w; canvas.height = $window_h; var $start = 0; var $frames = 120; function intro() { (function animloop() { $start++; if ($start &lt;= $frames) { $canvas_timer = requestAnimFrame(animloop); render_canvas(); } })(); } var $xmin = (window.innerWidth - 635) / 2; var $xmax = $xmin + 635; var $ymin = (window.innerHeight - 300) / 2; var $ymax = $ymin + 300; var centerx = randomIntFromInterval($xmin, $xmax); var centery = randomIntFromInterval($ymin, $ymax); var center_disx = randomIntFromInterval(450, 500); var center_disy = randomIntFromInterval(450, 500); var xstep = (center_disx + center_disx - 280) / 120; var ystep = (center_disy + center_disy - 280) / 120; if (centerx &gt; window.innerWidth / 2) { var centerx2 = centerx + center_disx; } else { var centerx2 = centerx - center_disx; } if (centery &gt; window.innerHeight / 2) { var centery2 = centery + center_disy; } else { var centery2 = centery - center_disy; } var $r1 = randomIntFromInterval(150, 200); var $r2 = $r1 + randomIntFromInterval(700, 750); function render_canvas() { ctx.clearRect(0, 0, $window_w, $window_h); var grd = ctx.createRadialGradient(centerx, centery, $r1, centerx2, centery2, $r2); $r2 -= 2; if (centerx &gt; window.innerWidth / 2) { centerx2 -= (xstep); } else { centerx2 += (xstep); } if (centery &gt; window.innerHeight / 2) { centery2 -= (ystep); } else { centery2 += (ystep); } grd.addColorStop(0, "#531f69"); grd.addColorStop(0.5, "#8e217d"); grd.addColorStop(1, "#ffffff"); ctx.fillStyle = grd; ctx.fillRect(0, 0, $window_w, $window_h); } function render_last_canvas() { $('#intro &gt; img').animate…
tagged with: canvas
answer count: 1
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/comment/38684821
type: Comment
has text: click your btnSave, and watch the new item appear in the network tab, the min.map is not an issue here
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24901035

http://stackoverflow.com/comment/38498384
type: AnswerComment
type: Comment
has text: This will not work in all cases: If the user makes his choice and decides to select another option it will not fire since the dropdown is already focused.
comment on: http://stackoverflow.com/a/24802701
score: 0

http://stackoverflow.com/a/24850658
accepted answer of: http://stackoverflow.com/q/24850454
score: 0
type: AcceptedAnswer
has body: You are looking at the wrong element. The selector #active:nth-child(2) isn't looking for the second child in the element with id="active", it looks for an element with that id that is the second child. You would use #active p:nth-child(2) to look for the paragraph inside the element. However, you will run into a problem as you are adding an id to the element. The second time that you click something you will have that id on two elements, so you will get the text from that element and the text from the previous element. Also, as an id should be unique in the page, you may even get some unexpected behaviour in some browsers. You don't need to set the id on the element to find it, you already have a reference to it in this that you can use. Specify this as context, and use the selector p:nth-child(2): $('.object').click(function(){ //Gets the text from this item's title section. var title = $('p:nth-child(2)', this).text() //Sets the title printed in the overlay to whatever the title of the clicked item was. $('#overlay_title').html(title) console.log( title ) $('#overlay_align').fadeIn("fast"); }) Demo: http://jsfiddle.net/6D9JD/
type: Answer
answers question: http://stackoverflow.com/q/24850454

http://stackoverflow.com/comment/38596264
type: Comment
type: QuestionComment
has text: I guess what I am asking is if I have the inline code there what would be the structure of creating $http driven version something like the following
comment on: http://stackoverflow.com/q/24854519
score: 0

http://stackoverflow.com/a/24797767
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/24797678
has body: You need to use $scope.$apply to update your bindings when changing it outside of an Angular function. socket.on('new message', function(data){ console.log(data); // console.logging results in the entire message $scope.receive = data; $scope.$apply(); }); It can also be used like this, which captures any errors thrown inside the function and updates anyway. socket.on('new message', function(data){ console.log(data); // console.logging results in the entire message $scope.$apply(function () { $scope.receive = data; }); });
accepted answer of: http://stackoverflow.com/q/24797678
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38488838
has comment: http://stackoverflow.com/comment/38489285
upvote count: 1

http://stackoverflow.com/comment/38449908
type: AnswerComment
has text: You welcome : ) I have one more suggestion – you can disable send button until all fields will be valid.
comment on: http://stackoverflow.com/a/24777298
score: 0
type: Comment

http://stackoverflow.com/a/24902686
has body: please use scope for that you can use $scope.searchKeyword or you can use add different model name on the element {{searchKeyword}} And in controller: $scope.ngModel
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38689581
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/24902592
answers question: http://stackoverflow.com/q/24902592

http://stackoverflow.com/a/24798809
accepted answer of: http://stackoverflow.com/q/24798666
type: Answer
downvote count: 0
score: 7
has body: First mistake in your code is in the line return "Hi, I am" + " " + name. remove fullstop or just concatenate it as below return "Hi, I am" + " " + name+"." and then write console.log(nameString("Amir")); check it here fiddle
has comment: http://stackoverflow.com/comment/38490711
has comment: http://stackoverflow.com/comment/38490870
upvote count: 7
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24798666

http://stackoverflow.com/comment/38534529
type: Comment
comment on: http://stackoverflow.com/q/24822280
type: QuestionComment
has text: dont use HTML at last ,better to use json
score: 0

http://stackoverflow.com/q/24761344
has comment: http://stackoverflow.com/comment/38420332
has answer: http://stackoverflow.com/a/24761398
linked to: http://stackoverflow.com/q/14499783
has comment: http://stackoverflow.com/comment/38420151
type: Question
has body: i have created a javascript function to take json variables and do 'Stuff' with them http://jsfiddle.net/57fXb/1/#&amp;togetherjs=5vxD5KeLBa Here is the function code function Machinecycle(ZW, Number) { var machines = { "Machines": [ {"cycle":1,"percent":1}, {"cycle":2,"percent":-2}, "cycle":3,"percent":3} ] }; // obj = JSON.parse(machines); var cycle = machines.Machines[Number].cycle; var percent = machines.Machines[Number].percent; if (cycle &lt; 480) { document.getElementById('ZW01001').style.backgroundColor = 'lime'; document.write(cycle); document.write(percent); } else { document.getElementById('ZW01001').style.backgroundColor = 'red'; } } When running this code as Machinecycle('ZW01001',0): ZW01001 being the Id of the Div and 0 being the records that is needed out of the JSON i get the error Uncaught TypeError: Cannot read property 'style' of null which i am assuming that is because it cant find the Div with the Id given to the function but i cant figure out why, this is running in it's own JavaScript file, however i also tried it in the html file with no success any help would be much appropriated
has comment: http://stackoverflow.com/comment/38420304
duplicate of: http://stackoverflow.com/q/14028959
score: 0
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
downvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/38420024
has title: Not sure why this isn't working JavaScript function
tagged with: javascript
has comment: http://stackoverflow.com/comment/38420049
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38419958
favorite count: 0
linked to: http://stackoverflow.com/q/14028959

http://stackoverflow.com/comment/38438769
comment on: http://stackoverflow.com/q/24771222
score: 0
type: QuestionComment
type: Comment
has text: @Busches I know I was attempting to experiment with php echos to javascript functions to see if I could some how get this to work through that, but it didn't. I just never changed back to just calling javascript directly. Is there anyway to access an empty php variable and set it equal to an already existing javascript variable?

http://stackoverflow.com/comment/38526374
comment on: http://stackoverflow.com/q/24817845
type: Comment
type: QuestionComment
score: 0
has text: for that `select_store` method in your controller there should be a `js.erb` file. Can you show this one?

http://stackoverflow.com/comment/38473202
comment on: http://stackoverflow.com/a/24787844
type: AnswerComment
score: 0
has text: That's what I thought. AJAX can't load data from your local file system, and PHP won't run from your local file system. You've got the files in XAMPP, just start the XAMPP server and change the URL to match the server (it is probably something like `'http://localhost/traveltrak/travelGraphData.php'`).
type: Comment

http://stackoverflow.com/a/24803553
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24802665
score: 15
type: AcceptedAnswer
has body: By default, the origin of the SVG drawing is the same as the origin of the container. It means that the (0,0) of your drawing is in the upper left corner of the SVG element. To center the content, you should translate the drawing relatively to the container. It can be achieved by modifying the viewBox attribute (four values expected : "minx miny width height") of the SVG element with respect to the result of the getBBox() method. A live example at http://jsfiddle.net/3cp3c/. svg.setAttribute("viewBox", (bbox.x-10)+" "+(bbox.y-10)+" "+(bbox.width+20)+" "+(bbox.height+20)); svg.setAttribute("width", (bbox.width+20) + "px"); svg.setAttribute("height",(bbox.height+20) + "px");
type: Answer
answers question: http://stackoverflow.com/q/24802665
upvote count: 15

http://stackoverflow.com/q/24800968
has answer: http://stackoverflow.com/a/24801565
accepted answer: http://stackoverflow.com/a/24801565
has body: I am trying to make a jquery tab that remembers which tab was last when the page refresh. I have found the fiddle below and adapted to my needs in php but i am novice with jave script and i don`t fully understand how it works so i can not figure it out hou could i do in javascript or javascript combined with php to remember what tab was when page refreshed. HTML: Tab A Tab B Tab C Tab D Content of A Content of B Content of C Content of D JavaScript: $('#tabs') .tabs() .addClass('ui-tabs-vertical ui-helper-clearfix'); Fiddle
possible better answer: http://stackoverflow.com/a/24801360
tagged with: javascript
answer count: 2
has comment: http://stackoverflow.com/comment/38494521
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/24801360
has comment: http://stackoverflow.com/comment/38494661
has comment: http://stackoverflow.com/comment/38494505
tagged with: php
score: 2
type: AnsweredQuestion
upvote count: 2
has title: jQuery vertical tabs which remain on refresh
type: Question

http://stackoverflow.com/a/24895979
answers question: http://stackoverflow.com/q/24894685
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/38675636
has body: I love Yury Tarabanko's solution, but it took me some time to understand what it does (including reading and understanding about reduce(). I can't comment on you @YuryTarabanko, but how did you come up with this? The solution I whould come up with, is this one. You can access it the same as Yury's solution (keys[ajaxResponseNumber]). I tested it with jsPerf and this is faster in Firefox, but that's not relevant in this case. var keys = {}; for (var x in enuTable) { if (enuTable.hasOwnProperty(x)) { keys[enuTable[x]] = x; } }
has comment: http://stackoverflow.com/comment/38674870

http://stackoverflow.com/comment/38643544
has text: after the redirect, nope: http://puu.sh/alSjj/6eb3fa33e8.jpg Though on the initial pageload I get a couple missing image errors. http://puu.sh/alSmu/8ff3d9d1c0.png I didn't think that could be causing it :3 Any other ideas?
type: Comment
comment on: http://stackoverflow.com/a/24879465
type: AnswerComment
score: 0

http://stackoverflow.com/q/24809097
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/24811368
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38509967
upvote count: 3
has title: How do I make a menu pop up when the user clicks the menu button?
type: Question
has body: I'm new to web development and I dont have much experience. I have been trying to create a menu that becomes visible when the user clicks it. I have been able to make it pop-up but it doesnt stay visible. It becomes visible for a second and turns invisible again. I have tried this with the 'display' property as well. However, that has the same results. Here is my code: Entrepreneur Home Motivation Books Videos Any help will be appreciated. Thank You.
score: 3
has comment: http://stackoverflow.com/comment/38510629
accepted answer: http://stackoverflow.com/a/24811368
tagged with: javascript
has comment: http://stackoverflow.com/comment/38510599
has comment: http://stackoverflow.com/comment/38510089
answer count: 1
linked to: http://stackoverflow.com/q/11936816
downvote count: 0

http://stackoverflow.com/comment/38435007
score: 0
type: Comment
has text: Also thanks. Any idea how to make it so that, while the animation is playing, it cannot be interrupted? EG while the tongue is sliding you can mouseover it and it freaks out.
comment on: http://stackoverflow.com/a/24749905
type: AnswerComment

http://stackoverflow.com/a/24751832
has comment: http://stackoverflow.com/comment/38401917
type: Answer
has body: Try this: Find fiddle Here JS (Uses jQuery) $(document).ready(function () { $("label:contains(Not Recommended)").css("color", "red"); });
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38402123
answers question: http://stackoverflow.com/q/24751667
has comment: http://stackoverflow.com/comment/38401981
has comment: http://stackoverflow.com/comment/38402009
downvote count: 0

http://stackoverflow.com/comment/38534797
type: QuestionComment
score: 0
has text: http://jsfiddle.net/AWHJu/ Yeah, the latter doesn't work. The function is not the same as the returned class.
comment on: http://stackoverflow.com/q/24822443
type: Comment

http://stackoverflow.com/comment/38668682
has text: So you want the modal to open before it starts loading the video inside of the iframe, that is inside the modal, correct?
type: QuestionComment
comment on: http://stackoverflow.com/q/24892706
type: Comment
score: 0

http://stackoverflow.com/q/24865473
answer count: 2
has comment: http://stackoverflow.com/comment/38616686
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/24867875
has comment: http://stackoverflow.com/comment/38616601
has comment: http://stackoverflow.com/comment/38616921
has comment: http://stackoverflow.com/comment/38617238
has comment: http://stackoverflow.com/comment/38617081
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38617026
has body: I have quite a few forms on my site that are submitted using jQuery ajax. When I recently disabled JavaScript to do a bit of testing, I noticed these form submit the usual way. Is there anything that can be done to prevent them from being submitted at all when javascript is not available or disabled? My forms do not have a method or action. These are specified in ajax itself. I use a button instead of Anything I can do to stop them from being submitted? I know I can generate/enable buttons and things after the page loads, but what if a user were to deliberately disable JavaScript after the page loaded?
has answer: http://stackoverflow.com/a/24865687
tagged with: php
has comment: http://stackoverflow.com/comment/38616623
tagged with: forms
has title: Prevent a form that's submitted using AJAX from submitting when JavaScript is disabled or not available
type: Question
has comment: http://stackoverflow.com/comment/38617421

http://stackoverflow.com/q/24877623
has body: So I don't use jQuery for everything, but I do use it for the good stuff such as AJAX, and right now that son of gun is giving me some issues. Below is a code that should change my upload progress bar while of course uploading. function uploadProgess(){ var info = document.getElementById('infor'); var images = document.getElementsByName('file[]')[0].files; $.ajax({ beforeSend: function(XMLHttpRequest){ XMLHttpRequest.upload.addEventListener("progress", function(evt){ if (evt.lengthComputable) { document.getElementById('progress-bar').style.display="block"; var percentComplete = (evt.loaded / evt.total * 100) + '%'; //Do something with upload progress document.getElementById('progress').style.width = percentComplete; } }, false); }, type: 'POST', url: "administration.php?mode=styling&amp;part=pics_management", data:{method:"upload",file:images}, success: function(response) { info.innerHTML = response; }, error:function(response){ info.innerHTML = response; } }).done(function(){ window.location.href = window.location.href; }); } This function is invoked when we click the submit button of the form. $('#upload_images').click(function(e){ e.preventDefault(); uploadProgess(); }); But i am getting Uncaught TypeError: Illegal invocation jQuery.js:4 not sure what I did to invoke another property or whatever I did that was "illegal" Can someone explain what is wrong in my code?
downvote count: 1
has comment: http://stackoverflow.com/comment/38640209
type: AnsweredQuestion
score: -1
has comment: http://stackoverflow.com/comment/38640146
type: Question
has answer: http://stackoverflow.com/a/24878466
upvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/38640258
answer count: 1
has comment: http://stackoverflow.com/comment/38640172
has comment: http://stackoverflow.com/comment/38640120
has title: Ajax upload progress bar using jQuery
accepted answer: http://stackoverflow.com/a/24878466

linechart
tags question: http://stackoverflow.com/q/24827896
tag name: linechart
tags question: http://stackoverflow.com/q/24858382
type: Tag

http://stackoverflow.com/q/24872077
has comment: http://stackoverflow.com/comment/38632708
type: Question
has comment: http://stackoverflow.com/comment/38643136
possible better answer: http://stackoverflow.com/a/24872371
type: AnsweredQuestion
has body: Suppose I use Node.js to try to run two async calls to get some answers. I know there's an async package, where you can just pass two functions, and an optional callback. async.parallel([fun1(){callback(null,1);}, fun2(){callback(null,2);}], function(err, results) { }); But suppose I have a priority now, if fun1 returns a value, then I do not need fun2's answer, only if fun1 returns null, then I wait for fun2. So I don't want to use the callback function, because the callback waits for both functions to finish, and fun2 may take very long. Right now I just use a very exhaustive way by creating a callback function for both async calls. function(){ var theAnswer,FromFun1,FromFun2; var reply1,reply2; fun1(reply1="answered";FromFun1=1;complete()); fun2(reply2="answered";FromFun2=2;complete()); function complete(answer){ if(reply1=="answered"){ theAnswer=FromFun1; }else if(reply1==null){ // Don't do anything because fun1 is not finished running. }else if(reply2=="answered"){ theAnswer=FromFun2; }else{ // Both have no answer, err. } } } Is there a better way to do this?
accepted answer: http://stackoverflow.com/a/24875547
has title: Nodejs parallel async call, but with priority
upvote count: 4
tagged with: parallels
answer count: 2
has comment: http://stackoverflow.com/comment/38655270
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/38642348
tagged with: asynchronous
tagged with: node.js
score: 4
has answer: http://stackoverflow.com/a/24875547
has answer: http://stackoverflow.com/a/24872371

http://stackoverflow.com/comment/38662923
has text: correct this problem first: `Sometimes the PHP file takes a LONG (and I mean VERY long) time to respond or sometimes does not respond at all` BTW: why is this irregular?
type: Comment
score: 1
comment on: http://stackoverflow.com/q/24887079
type: QuestionComment

http://stackoverflow.com/comment/38508330
comment on: http://stackoverflow.com/a/24807915
has text: Or even just close the tab - which invalidates your last point?
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/24827533
tagged with: php
accepted answer: http://stackoverflow.com/a/24828265
has answer: http://stackoverflow.com/a/24827729
has comment: http://stackoverflow.com/comment/38544680
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24828036
tagged with: forms
has comment: http://stackoverflow.com/comment/38544686
type: Question
has body: I am creating a form such that when the user click the "submit" button, it prevents the default action, serializes a subset of the fields, and then proceeds to submit all of the information via the POST array (PHP). I am encountering a problem where the form is basically not submitting when I use the .submit() method. When I disable my javascript, the form submits fine (just with the wrong information, as the array is not serialized). But as soon as I re-enable my js, clicking the submit button does nothing except show my test console.log(var) in console. Here is some of my code, hopefully you can see what I am doing wrong. All of the online documentation says to use .submit(), but it doesn't seem to work, no matter what I try. HTML: Entry Properties Specify entry properties, permissions, etc. Parameter Value Group Graham Test Project Project 1 Project 2 Protocol PCR & Gel Item Storage Permissions Only I can access this entry Only group members can access this entry Everyone can access this entry <input type="submit" id="submitEntry" style="font-family:Raleway;" class="inputButton" type="button" name="submit" value="Submit Entry" / And the accompanying javascript: var entrySubmit = $('#submitEntry'); entrySubmit.on('click', initEntrySubmission); function initEntrySubmission(e) { e.preventDefault(); var serializedProtocol = $("#protocolForm :input").serialize(); console.log(serializedProtocol); $('#serialInput').val(serializedProtocol); $('#entryForm').submit(); } PHP Form (which I don't think is the issue but figured I would include it anyways) <?php // add_entry.php session_start(); include_once 'creds.php'; $con=mysqli_connect("$db_hostname","$db_username","$db_password","$db_database"); if (isset($_POST['group'])){ $lab = $_SESSION['labname']; $author = $_SESSION['username']; $name = $_POST['entryName']; $group = $_POST['group']; $protocol = $_POST['protocol']; $permission = $_POST['permission']; $array = $_POST['serialInput']; $filearray = $_POST['fileArray']; $…
tagged with: javascript
tagged with: jquery
has title: jQuery $('#id').submit() not working
score: 0
has answer: http://stackoverflow.com/a/24828265
has comment: http://stackoverflow.com/comment/38544671
has comment: http://stackoverflow.com/comment/38544719
has answer: http://stackoverflow.com/a/24827628
has answer: http://stackoverflow.com/a/24828036
has answer: http://stackoverflow.com/a/24827659
answer count: 5
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/24836115
score: 2
accepted answer of: http://stackoverflow.com/q/24835915
answers question: http://stackoverflow.com/q/24835915
upvote count: 2
type: AcceptedAnswer
downvote count: 0
has body: Well APPARENTLY, problem is in 64 bit version of windows installer, the 32 bit is working fine!
type: Answer

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

http://stackoverflow.com/q/24832819
tagged with: jquery
has title: localscroll.js - Can not seem to figure out how to set up the links
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I have only just been introduced to HTML code 3 days ago and have not learnt much and this would probably be an easy fix but the title says it all. I am unsure on how to set up the page links so I can use the smooth scrolling jQuery plugin, localscoll.js. Oh and im trying to link .section2 to .arrow and servers.png Javascript: HTML: CSS: .arrow { margin-top: 470px; text-align: center; } .section2 { background: url(section2/background.png); background-position: center; width: 100%; height: 515px; margin-bottom: 0; position: relative; }
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24833199
type: Question
has comment: http://stackoverflow.com/comment/38555438
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/24870335
has body: The error would be due to the title element rather than the meta being pointed to. For it, you'll either want to use tag= or #{...}, but not both on the same element. title= title title #{title} The 1st form expects the content that follows the = to be a valid JavaScript expression, which #{...} isn't currently considered. The 2nd form instead treats the content as plain text, with the exception of #{...} sections that Jade allows for interpolating/inserting the results of code.
type: Answer
accepted answer of: http://stackoverflow.com/q/24870283
answers question: http://stackoverflow.com/q/24870283
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/38654771
has text: I'd rather use separate `eq` call, like this: `$('.main-menu').eq(1)`. In this case, it won't matter much (performance-wise) though.
comment on: http://stackoverflow.com/a/24883762
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/24904304
has comment: http://stackoverflow.com/comment/38690370
type: Question
has body: Is it possible to 'POST' or 'PUT' a JSON object to an API with Casperjs? I can successfully do a GET call to my API. I just can't seem to get a POST/PUT to work. I am trying to send a JSON object to my website through the API I have setup. I am using the newest version of Casperjs and am setting --web-security=no through the command line. I read the documentation but have found no place to add header values to the AJAX call. I see there is an "options" parameter but the following doesn't work. I know the JSON and the URL are all correct because I have tried it with the chrome extension postman. I just can't seem to figure out how to add headers. try { return JSON.parse(__utils__.sendAJAX("url to API", 'POST', jsonObject, false, { dataType: "json", headers:{ contentType: "application/json; charset=utf-8" } })); } catch (e) { console.log(e); } Nothing is returned in the try/catch. If I print the JSON.parse it is just HTML from my webpage asking for proper headings. I have tried different variations of settings and even tried passing nothing. For Example: try { return JSON.parse(__utils__.sendAJAX("url to API", 'POST', jsonObject, false, null)); } catch (e) { console.log(e); } Still no luck.
has title: Sending POST/PUT via AJAX using casperjs
has answer: http://stackoverflow.com/a/24904625
tagged with: javascript
has comment: http://stackoverflow.com/comment/38722626
has comment: http://stackoverflow.com/comment/38722431
tagged with: ajax
has comment: http://stackoverflow.com/comment/50338774
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38767798
favorite count: 0
tagged with: casperjs
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/38767769
tagged with: phantomjs
has comment: http://stackoverflow.com/comment/38767816
score: 1
has comment: http://stackoverflow.com/comment/38794704

indy
type: Tag
tag name: indy
tags question: http://stackoverflow.com/q/24755352

http://stackoverflow.com/a/24859950
answers question: http://stackoverflow.com/q/24817981
score: 16
upvote count: 16
has body: You'll need to use data-parsley-trigger="keyup"(http://parsleyjs.org/doc/index.html#psly-ui-for-form) if you want that your fields auto-validates on keyup event. You could define it field by field, or on the whole form is directly in the &lt;form&gt; tag. Best
accepted answer of: http://stackoverflow.com/q/24817981
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/24759768
tagged with: http://stackoverflow.com/tag/json
type: Question
has title: Using hbs and getting error of "Arguments to path.join must be strings"?
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/24759927
tagged with: express
accepted answer: http://stackoverflow.com/a/24759927
has body: I want to apply some templates to JSON data (eventually will be getting the data from a url) using hbs and express. As a newbie using express 4, I found a lot of previous posts and solution really confusing as some functions are depreciated in express 4. I combined some snippets of codes and got a result like this: var engines = require('consolidate'); var express = require('express'); var hbs = require('hbs'); app = express(); app.set('views', __dirname+ '/views'); app.set('view engine', 'hbs'); app.set("view options", { layout: true }); // ROUTES app.get('/', function (req, res){ var data = {"employees":[ {"firstName":"John", "lastName":"Doe"}, {"firstName":"Anna", "lastName":"Smith"}, {"firstName":"Peter", "lastName":"Jones"} ]} res.render('index', JSON.stringify(data)); }); app.listen(3000); I have also tried just putting a simple string in res.render, such as res.render('index', 'haha'); But it still doesn't work. Any insights please..? EDITED: The directory of my template is views - index.hbs and I actually only put &lt;hi&gt; Hi &lt;/h1&gt; in this file.
answer count: 1
favorite count: 0
tagged with: handlebars.js
upvote count: 1
tagged with: node.js
type: AnsweredQuestion
score: 1

http://stackoverflow.com/a/36364801
has body: There is a way to do this without clearing the canvas or starting over, but you have to man handle the creation of the chart so that the data is in the same format for when you update. Here is how I did it. var ctx = document.getElementById("myChart").getContext("2d"); if (chartExists) { for (i=0;i&lt;10;i++){ myNewChart.scale.xLabels[i]=dbLabels[i]; myNewChart.datasets[0].bars[i].value=dbOnAir[i]; } myNewChart.update(); }else{ console.log('chart doesnt exist'); myNewChart = new Chart(ctx).Bar(dataNew); myNewChart.removeData(); for (i=0;i&lt;10;i++){ myNewChart.addData([10],dbLabels[i]); } for (i=0;i&lt;10;i++){ myNewChart.datasets[0].bars[i].value=dbOnAir[i]; } myNewChart.update(); chartExists=true; } I basically scrap the data loaded in at creation, and then reform with the add data method. This means that I can then access all the points. Whenever I have tried to access the data structure that is created by the: Chart(ctx).Bar(dataNew); command, I can't access what I need. This means you can change all the data points, in the same way you created them, and also call update() without animating completely from scratch.
type: Answer
answers question: http://stackoverflow.com/q/24785713
score: 0

http://stackoverflow.com/comment/38537585
type: Comment
type: QuestionComment
has text: Do you want to save it as an image file or a file that 64 bit encoded PNG URL?
comment on: http://stackoverflow.com/q/24823034
score: 0

http://stackoverflow.com/comment/38597096
has text: Yes, as you can see, I don't know how to fix that. Do you know how?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24854307

http://stackoverflow.com/q/24855951
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26037271
has comment: http://stackoverflow.com/comment/40785376
upvote count: 1
has title: How to fix iFrame issues (iOS) in Cordova/Phonegap?
answer count: 1
favorite count: 0
tagged with: cordova
type: UnansweredQuestion
has body: I have an iframe in my Cordova app and I am having severe problems with it. On an iPad, the iframe isn't maximized, but only loaded in one corner. Can anybody help solve my problem... Here's my iframe code...
downvote count: 0
score: 1
tagged with: iframe
type: Question
tagged with: ios

http://stackoverflow.com/comment/38447759
score: 0
type: Comment
has text: tell me what you have in log of console
type: AnswerComment
comment on: http://stackoverflow.com/a/24775319

http://stackoverflow.com/comment/38479976
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/24792928
type: Comment
has text: I assume this is jQuery-UI? What does your console tell you? Also check your network tab in Chrome. http://code.tutsplus.com/articles/chrome-dev-tools-networking-and-the-console--net-28167

http://stackoverflow.com/comment/38638768
type: AnswerComment
type: Comment
has text: in your case, `newVal` is `event.target.value + 1`
comment on: http://stackoverflow.com/a/24876956
score: 0

http://stackoverflow.com/a/24854808
has comment: http://stackoverflow.com/comment/38837429
has comment: http://stackoverflow.com/comment/38840152
has comment: http://stackoverflow.com/comment/38840161
has comment: http://stackoverflow.com/comment/38846076
has comment: http://stackoverflow.com/comment/38872697
has comment: http://stackoverflow.com/comment/38870361
has comment: http://stackoverflow.com/comment/38844460
answers question: http://stackoverflow.com/q/24853834
has comment: http://stackoverflow.com/comment/38597365
has comment: http://stackoverflow.com/comment/38916093
has comment: http://stackoverflow.com/comment/38597531
score: 0
has comment: http://stackoverflow.com/comment/38871514
has comment: http://stackoverflow.com/comment/38845025
has comment: http://stackoverflow.com/comment/38596883
has comment: http://stackoverflow.com/comment/38597846
has body: First thing I would do is change the way you're sending channels in Parse.Push.send() channels: [user], Assuming user is a string that matches loggedUser from the previous code.
has comment: http://stackoverflow.com/comment/38839753
has comment: http://stackoverflow.com/comment/38597213
has comment: http://stackoverflow.com/comment/38596833
type: Answer

http://stackoverflow.com/q/24768492
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/47627141
has body: My difficulty here could be my mathematical illiteracy, but I was trying to sort some numbers in a JavaScript array and this is the solution I found online. It does indeed work, but my question is why?! I would really like to understand this piece of code properly. The site, W3 Schools says: You can fix this by providing a function that returns -1, 0, or 1: var points = [40, 100, 1, 5, 25, 10]; points.sort(function(a,b){return a-b}); Why would only -1, 0 or 1 be returned? I have Googled, and return can return pretty much any value you want. Again, if this is an incredibly dumb question I apologise.
has answer: http://stackoverflow.com/a/24768656
type: Question
has answer: http://stackoverflow.com/a/24768663
has answer: http://stackoverflow.com/a/59510105
tagged with: javascript
answer count: 6
accepted answer: http://stackoverflow.com/a/24768663
downvote count: 0
has answer: http://stackoverflow.com/a/24768666
possible better answer: http://stackoverflow.com/a/24768685
favorite count: 0
has title: Why does points.sort(function(a, b){return a-b}); return -1, 0 or 1?
has answer: http://stackoverflow.com/a/24768685
score: 11
upvote count: 11

http://stackoverflow.com/a/24835299
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24831671
type: Answer
has body: Solved, this is a problem of closure thx to @levi : for (i in namespaces) { namespaces[i].on('connection',handleConnection(namespaces[i])); function handleConnection(ns) { return function (socket){ socket.on('chat message', function(msg){ ns.emit('chat message', msg); }); } } } Now my code works :)
score: 0
answers question: http://stackoverflow.com/q/24831671

http://stackoverflow.com/comment/38429276
type: QuestionComment
comment on: http://stackoverflow.com/q/24766028
has text: @Glegan, thank you. but that's not what I am looking for now. If possible, please just help me out to edit my code because I am very sure what I am looking will work with that code if the code is arranged correctly..
score: 0
type: Comment

http://stackoverflow.com/comment/38994635
type: QuestionComment
score: 0
has text: It appears that you've solved the question. Is there anything you still need help with, or are unclear about?
comment on: http://stackoverflow.com/q/24760420
type: Comment

http://stackoverflow.com/q/24779314
has answer: http://stackoverflow.com/a/24779384
type: Question
has title: Showing JSON on page?
answer count: 2
accepted answer: http://stackoverflow.com/a/24779384
tagged with: javascript
tagged with: jquery
score: 0
has body: I'm outputting JSON on to my page, I wish to put it all into an input using .val() but all I get out to the input is: [Object object] How can I get the JSON in to the input so the user can see it?
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24779387
has answer: http://stackoverflow.com/a/24779387

http://stackoverflow.com/comment/38684390
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24901110
has text: I mentioned two libraries that make it easier to deal with these things, and they'll clean up the syntax a lot. Look into `async` and `Promises`. I'm only going to provide a native JS solution. You can abstract it further and make it prettier from there.
score: 1

http://stackoverflow.com/comment/38521133
score: 0
has text: Just put one together using http://angular-google-maps.org/#!/ and went well. Created filter functions in my controller to filter different marker types
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24814352

http://stackoverflow.com/q/24832094
has comment: http://stackoverflow.com/comment/38557506
has comment: http://stackoverflow.com/comment/38553820
tagged with: simulate
has comment: http://stackoverflow.com/comment/38557633
has answer: http://stackoverflow.com/a/49337990
upvote count: 1
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/38556904
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38556077
tagged with: keydown
linked to: http://stackoverflow.com/q/10455626
has comment: http://stackoverflow.com/comment/38553579
downvote count: 0
has comment: http://stackoverflow.com/comment/38709653
score: 1
has body: I need help on how I could simulate a keypress/keydown, specifically spacebar when clicking on a label. I need to do it with only javascript or mootools, no jquery please. I'm using a script I found for a dropdown with multiselect. What I need to do is that when they select one of the options in the dropdown this one is selected as well on the checkboxes on the bottom. I added an event change in order to do this, but it's not working correctly since the script for the multiselect is moving the inputs into an &lt;li&gt; tag and adding a label. (Here is the link) I already tried adding an event click to the &lt;li&gt; and label without luck. I also tried to add a fireEvent to the label and li. If you click the checkbox on the dropdown the event works correctly or if you hit spacebar. So I've run out of solutions to this problem. Any ideas? I would really appreciate any tips on how to do this.
tagged with: mootools
type: Question
tagged with: keypress
has comment: http://stackoverflow.com/comment/38564660
has title: How to simulate a key press when click javascript/mootools?
tagged with: javascript

http://stackoverflow.com/a/24875705
has body: document.getElementById('aRow')[i].width = (optWidth + 60).toString() + "px"; That code expects .getElementById() to return a NodeList when the id is used by more than one element on the page. Browsers used to do that, but as far as I can tell both Firefox and Chrome don't. Using the same id for multiple elements is contrary to the purpose of an identifier. You can get your code to work in browsers that support .querySelectorAll() by changing code like that to document.querySelectorAll('#aRow')[i] // ... whatever ... Oh, and in general an error like "Cannot [do something] property "something" of undefined" means that you've got code like x.something but x is undefined; in other words, the code has expectations that aren't being satisfied, so it fails with that error. Therefore to track down the source of such errors, you just have to look through the code for places where the property name is used after a . or inside square brackets.
type: Answer
has comment: http://stackoverflow.com/comment/38636816
score: 2
answers question: http://stackoverflow.com/q/24875501
has comment: http://stackoverflow.com/comment/38636893
accepted answer of: http://stackoverflow.com/q/24875501
has comment: http://stackoverflow.com/comment/38699690
type: AcceptedAnswer
downvote count: 0
upvote count: 2

http://stackoverflow.com/a/24955472
has body: here is the code for load more records as per you want. It will only apply on LIST only remember. Secnha Load More plugin Ext.plugin.ListPagingView Note: In 'Store' you need to apply config >> pageSize pageSize: 30, //Any Damm Number { xtype: 'panel', flex: 1, layout: 'fit', items: [ { xtype:'list', itemId:'asd', disableSelection:true, id:'asd', itemTpl:new Ext.XTemplate( '&lt;div class="maindiv"&gt;'+ '&lt;/div&gt;' ), store:'xyz', plugins: [ { xclass: 'Ext.plugin.ListPaging', noMoreRecordsText:'No More Products', loadMoreText:'Load More', autoPaging: true } ], itemHeight:60 } ] }
answers question: http://stackoverflow.com/q/24905766
score: 0
type: Answer

http://stackoverflow.com/comment/38569241
comment on: http://stackoverflow.com/a/24836475
score: 0
type: AnswerComment
has text: @Derek朕會功夫 `id` element omitted,sorry for that.
type: Comment

http://stackoverflow.com/q/24896866
downvote count: 0
favorite count: 0
tagged with: twitter-bootstrap
upvote count: 1
tagged with: php
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24896976
score: 1
has body: I have two problems with my code, but because I am not quite sure that they are not related, I'll ask them together. Question one: My button group, static + dynamically generated (by a PHP while loop of a MySQL query) drop down loads on the first page load. However, after loading content with Ajax the drop down menu does not work anymore (no drop down) and buttons don't react anymore. How come? Question two: How can I pass a variable from my PHP generated drop down to the Ajax load call? The first link (ID=1) works, all others do nothing (not even an error). If I make the ID static (make Ajax calls for every different link ID with their own IDNR) they all work. Code: HTML/PHP: <?php $querygenre = "SELECT lib_genre.genre_name as name, lib_genre.genre_id as id from lib_edition join lib_editionrelatestowork on lib_editionrelatestowork.edition_id = lib_edition.edition_id join lib_workhasgenre on lib_workhasgenre.work_id = lib_editionrelatestowork.work_id inner join lib_genre on lib_genre.genre_id = lib_workhasgenre.genre_id group by lib_genre.genre_id order by name asc"; $resultgenre = $db->query($querygenre); while ($result_row = $resultgenre->fetch(PDO::FETCH_ASSOC)) { $genrename = $result_row['name']; $genreid = $result_row['id']; ?> <a href="#" id="genre" idnr="<?php echo $genreid?>"> <?php echo $genrename?> <?php } ?> ... At the end of the HTMP/PHP file:
tagged with: mysql
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24896976
tagged with: ajax
has title: Ajax load from PHP/MySQL generated Bootstrap drop down with variable pass
answer count: 1

http://stackoverflow.com/comment/38520800
score: 0
comment on: http://stackoverflow.com/a/24814691
type: AnswerComment
type: Comment
has text: Now it works but only if you tap the link. If you click it with the left mouse button the problem persists.

http://stackoverflow.com/a/24902319
has body: Okay that is a lot of code and deeply nested. From what I can see, you need to return two promises that are currently not being returned 27: return query.find().then(function(results) { 104: return Parse.Promise.when(promises).then(function(results) { In addition you have two promises towards the bottom that should either be chained together with a then(), or made parallel with Parse.Promise.when. In either case the result needs to be returned also. 232: newMComparisonArray.save({ 244: mComparisonQuery.find({ So the problems with the code are simply related to promises being created but no waited for. Whenever you create a promise you should be thinking about who is listening for the promise to complete and ensure the promise is returned to the listener.
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/24895383
has comment: http://stackoverflow.com/comment/38759973
has comment: http://stackoverflow.com/comment/38718729
has comment: http://stackoverflow.com/comment/38719239
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24895383

http://stackoverflow.com/q/24872205
has answer: http://stackoverflow.com/a/24872241
downvote count: 2
linked to: http://stackoverflow.com/q/1458724
type: AnsweredQuestion
tagged with: popup
accepted answer: http://stackoverflow.com/a/24872291
type: Question
has title: Jquery PopUp Just One Time
answer count: 2
upvote count: 0
score: -2
tagged with: bpopup
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/24872291
has body: I am trying to resolve this. In my page I have the Bpopup plugin. so here is my code: SCRIPT: &lt;script type="text/javascript"&gt; $(document).ready(function() { $('#element_to_pop_up').bPopup({ speed: 650, transition: 'slideDown' }); }); &lt;/script&gt; ELEMENT THAT SHOWS THE POPUP &lt;div id="element_to_pop_up"&gt; &lt;a class="b-close"&gt;&lt;a/&gt; &lt;p&gt; hi &lt;/p&gt; &lt;/div&gt; What I want to do is to make that popup appear only once a day. I know it has something to do with cookies. Please help me.
possible better answer: http://stackoverflow.com/a/24872241

http://stackoverflow.com/comment/38556753
comment on: http://stackoverflow.com/q/24833371
type: Comment
type: QuestionComment
has text: is your calendar control doing a postback everytime you change the date?
score: 0

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

http://stackoverflow.com/a/24768785
type: Answer
has body: The easiest way for me is to just get the visual of the data as a tree from the console. $.getJSON(url, function(data){ console.log(data) });
answers question: http://stackoverflow.com/q/24764810
score: 0

http://stackoverflow.com/q/24776542
tagged with: prototype
score: 0
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38450696
has comment: http://stackoverflow.com/comment/38450963
answer count: 0
has comment: http://stackoverflow.com/comment/38456443
has title: Javascript - safely extending functions
upvote count: 1
downvote count: 1
tagged with: extend
type: Question
has comment: http://stackoverflow.com/comment/38456368
has body: I've read several methods of extending functions on here and in other places, however I'm using the call syntax in my own implementation and I'm wondering if this is safe or if I will run into issues with more complex functions and objects? Plunker - http://plnkr.co/edit/Jbnxl505ZasuqeZlizh4 (check console output ) Code also below for reference function test ( ) { } test.prototype = { init: function() { console.log ("super"); } } function subclass() { test.call(this); } subclass.prototype = Object.create(test.prototype); subclass.prototype.init = function() { test.prototype.init.call(this); console.log("subclass"); }; var superclass = new test(); superclass.init(); var subclasser = new subclass(); subclasser.init();
tagged with: function
has comment: http://stackoverflow.com/comment/38452190
tagged with: javascript
tagged with: inheritance

http://stackoverflow.com/a/24765794
has body: You can't use Javascript variables in PHP. They're totally different systems.
downvote count: 4
upvote count: 0
answers question: http://stackoverflow.com/q/24765663
type: Answer
score: -4

http://stackoverflow.com/comment/38567556
comment on: http://stackoverflow.com/a/24836748
has text: created a new question.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38443148
score: 0
comment on: http://stackoverflow.com/q/24773798
type: Comment
type: QuestionComment
has text: You can use `ajaxOptions`

http://stackoverflow.com/comment/38666589
comment on: http://stackoverflow.com/q/24868234
score: 0
type: Comment
type: QuestionComment
has text: Ok, I don't understand the question then, I'm afraid.

http://stackoverflow.com/comment/38652938
type: Comment
comment on: http://stackoverflow.com/a/24884846
has text: Won't this also match `someID@email.com` where `#` as first character is missing?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38672487
has text: Hey! That worked even better, although it doesn't explain what's going on, it's a solution. You should change your answer to that and I'll except it! Thank you.
type: Comment
comment on: http://stackoverflow.com/a/24894572
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38645349
has text: Use a bignum library, floats for cash are trash.
comment on: http://stackoverflow.com/q/24880454
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/38654682
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/24885552
has text: Works for me. You're creating the regular expression wrong, but it's harmless. It should be either `var pattern = /^\s/;` or `var pattern = new RegExp("^\\s");` But I just checked in IE8, and it works even if you do that, so that's not the actual problem. (Correctly defined: http://jsbin.com/ruhuv/1, incorrectly but harmless: http://jsbin.com/ruhuv/2)
type: Comment

http://stackoverflow.com/q/24798961
answer count: 1
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/24799310
has comment: http://stackoverflow.com/comment/38491043
has body: In a rare situation, a name of a person has an apostrophe due to which the javascript error occurs. ctx.println(" " + childrenVar2 + "['" + gb.getCode() + "'].push( new Array('" + clientSummary.getFullName() + "', '" +clientSummary.getId().toString() + "'));"); the above line of code generates below line in javascript groupLetterRegardingOptionChildren['ADLTMEM'].push( new Array('Mr Java O'Reilly', '3117482')); please suggest a solution for above so that the name is not affected.
favorite count: 0
has title: Name containing an apostrophe is returned by getter method
type: UnansweredQuestion
downvote count: 1
tagged with: java
has comment: http://stackoverflow.com/comment/38491066
type: Question
upvote count: 0

http://stackoverflow.com/comment/38684622
has text: what do you mean by inline script? my script and html are inside 1 VIEW
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24901035
type: Comment

http://stackoverflow.com/comment/38643451
type: QuestionComment
has text: Set preserve console on page navigation and see if there are errors in the console.
comment on: http://stackoverflow.com/q/24879446
score: 0
type: Comment

http://stackoverflow.com/comment/38672777
comment on: http://stackoverflow.com/q/24895053
has text: What he said ^^ Really, all you're missing is some getElementById JavaScript to populate you form fields in your divs.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38512716
comment on: http://stackoverflow.com/q/24809835
type: QuestionComment
has text: Yes this code is part of a directive, I just took it out for the example. And yes @runTarm you are right, I can't just use focus and blur as I need the event to bubble from the anchor element up to its parent ` `
score: 0
type: Comment

http://stackoverflow.com/comment/38650430
comment on: http://stackoverflow.com/a/24883142
type: Comment
has text: Interesting, I'd have guessed they were both equally fast. Got a source to back that up?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38445917
comment on: http://stackoverflow.com/a/24774979
type: Comment
has text: No not directly, i change the value of my checkbox via javascript. so i want reload the my checkbox. with the new value.
score: 0
type: AnswerComment

http://stackoverflow.com/q/24802756
type: AnsweredQuestion
tagged with: build
has body: I'm developing a mobile app with Dojo and I'm using the Dojo toolkit SDK (about 30 MB) For an HTML 5 mobile app it would be toooooo large to assemble it in an app package for Android, iOS or Windows Phone and hopefully after Binging and Googling for a solution to get only the "required" modules and I've found it on build.dojotoolkit.org I uploaded my index.html single file to get automatically the 33 required packages and downloaded the generated custom build (about 500 KB) ... The issue now is how can I use this custom build of Dojo Thanks.
has title: how-to use dojo custom build
type: Question
tagged with: mobile
has answer: http://stackoverflow.com/a/24875247
accepted answer: http://stackoverflow.com/a/24875247
tagged with: javascript
score: 0
answer count: 1
tagged with: dojo

http://stackoverflow.com/comment/38658656
comment on: http://stackoverflow.com/a/24857245
has text: The article is correct (as far as I can tell from skimming over it), but your attempt of `.bind()`ing is futile. You did not use `this` in your code, so you don't have any problems with it. You might want to read the [scope chapter](https://github.com/getify/You-Dont-Know-JS/blob/master/this%20&%20object%20prototypes/ch1.md#its-scope) again: *To be clear, `this` does **not**, in any way, refer to a function's **lexical scope***. "Unless that scope is the global scope", the article seems to have forgotten to add (which is just source of more confusion)
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/24807363
score: 1
downvote count: 0
type: Answer
has body: You could start with this. Expand my answer accordingly. $('#macaroniButton').click(function(){ $("#macaroni").show().siblings('div').hide(); });
answers question: http://stackoverflow.com/q/24806997
upvote count: 1

http://stackoverflow.com/comment/38613087
comment on: http://stackoverflow.com/q/24858730
type: Comment
type: QuestionComment
has text: i am not dealing with count. problem is that i want call callback function when the loop is completed.The callback should return the result of executed query.
score: 0

http://stackoverflow.com/comment/38512065
type: Comment
has text: Not a problem, I'm happy to help either way :)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24808281

http://stackoverflow.com/comment/38527719
comment on: http://stackoverflow.com/a/24812428
type: Comment
has text: I can't think of a way to do this without capturing groups being available. Since you need to check if there is text on the next line. I would say capture groups are a pretty essential feature in regular expressions, surprised it's not supported.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38694454
score: 1
type: AnswerComment
has text: I say use `NetUtils` and copy the file to just the `ProfD` folder and on uninstall of your addon make sure to delete that file. Or use netutils to read it with `file input stream` and then send it to `process` with `file output stream`, this way is actually kind of interesiting i would learn a lot from it. Post up a topic we can have some experts on the forum answer that, im very interested to see that answer.
type: Comment
comment on: http://stackoverflow.com/a/24906114

http://stackoverflow.com/comment/38619916
type: QuestionComment
has text: What if there is a way of destroying bullets that have been in existence for say 10 seconds. How do I remove bullets from the view?
score: 0
comment on: http://stackoverflow.com/q/24862089
type: Comment

http://stackoverflow.com/q/24861296
score: 0
has answer: http://stackoverflow.com/a/24861423
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has answer: http://stackoverflow.com/a/24861916
has answer: http://stackoverflow.com/a/24861325
has answer: http://stackoverflow.com/a/24861364
has answer: http://stackoverflow.com/a/24861531
has answer: http://stackoverflow.com/a/24861367
type: AnsweredQuestion
has body: I am using below Html code and I want to get all the &lt;li&gt; tags from the &lt;div id="divSelect"&gt; and I want to get text from all li tags. Please help , how to use .each() and .find() using JQuery. Thanks
possible better answer: http://stackoverflow.com/a/24861325
type: Question
upvote count: 1
has title: How to find each li from Div and how to get text of each tag?
answer count: 7
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24861916
has answer: http://stackoverflow.com/a/24861332
favorite count: 0

http://stackoverflow.com/comment/38671129
type: AnswerComment
comment on: http://stackoverflow.com/a/24894134
type: Comment
has text: Because most links are working fine (usually about 1/4 fails, although it can vary), I'm assuming it has to do with the server I am scraping, not my local machine. Can you explain changing to a robust DNS again? If I know the issue is not with the URLs being bad, but rather the server I am attempting to connect to, is this still something I should try? Lastly, I had attempted pushing all bad URLs to an array, and then iterating through the array to re-try all of the URLs but was getting confused with the asynchronous JavaScript. Would a try/catch work better? Thanks a lot for the help.
score: 0

http://stackoverflow.com/a/24906085
answers question: http://stackoverflow.com/q/24905028
score: 0
has body: i am using codeigniter so it was hard implementing the suggestions, i later got it to work by doing this: on the button that triggers the modal i hyave: &lt;a data-toggle="modal" href="&lt;?php echo base_url(); ?&gt;admin/profile/edit/&lt;?php echo $row['id']; ?&gt;" class="btn btn-warning btn-xs" &gt;Edit&lt;/a&gt; then below my code i have: &lt;?php if(@$show_edit_modal): ?&gt; &lt;script&gt;$("#edit_modal").modal('show'); &lt;/script&gt; &lt;?php endif;?&gt; on the admin/profile/edit: i had public function profile($arg1="", $arg2=""){ if($arg1=='edit' &amp;&amp; !(empty($arg2)){ $data['profile'] = my qyuery to get the row where id=$arg2; $data['show_edit_modal']=true; //this set to true so when the page loads modal will pop up $this-&gt;load-&gt;view('mypage'); //page loads and modal pops up then on modal i can access my data from database } }
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/24905028

fullpage.js
tags question: http://stackoverflow.com/q/24859082
tags question: http://stackoverflow.com/q/24884120
tags question: http://stackoverflow.com/q/24793062
tag name: fullpage.js
tags question: http://stackoverflow.com/q/24778365
type: Tag

http://stackoverflow.com/q/24798830
tagged with: css
has body: I've been trying layout with css the div (dark blue) so that changes size according to the size of the window without covering the bottom panel, I thought that with the height to 100% official, but not understand because it ignores the panel below, and ends moving off the page now that see not let me post pictures, so something is also what I have: html: hi i'm a message you can't see me and this css #container{//This container is attached to the right side right: 0; width: 300px; position: fixed; height: 100%; top: 0; color: white; padding: 20px; } #darkBlue{//this div cover the next div height: 100%; border: 1px solid white; background: #3a5193; bottom: 100px; } #anotherPanel{//i can't see this div....... height: 100px; botton: 0px; } Not sure if you can solve with css, or have to resort to using javascript (which is something I want to avoid), anyone knows some property who can help me? UPDATE: This is the picture of what layout attempt: https://www.dropbox.com/s/t9nl5mb3sq85m3j/repro.png
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/38491855
has comment: http://stackoverflow.com/comment/38491179
has title: covers another div with div height of 100%
has answer: http://stackoverflow.com/a/24799092
tagged with: javascript
has answer: http://stackoverflow.com/a/24799033
has answer: http://stackoverflow.com/a/24799095
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24799033
has comment: http://stackoverflow.com/comment/38491063
type: Question
accepted answer: http://stackoverflow.com/a/24799095
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/38462227
comment on: http://stackoverflow.com/a/24780137
score: 0
type: AnswerComment
type: Comment
has text: It's indeed the most simple way.

http://stackoverflow.com/q/24788878
has answer: http://stackoverflow.com/a/24788959
has answer: http://stackoverflow.com/a/24788903
answer count: 5
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has answer: http://stackoverflow.com/a/24788917
has title: Passing arguments in jquery ajax resulting in undefined
downvote count: 0
score: 1
favorite count: 0
has body: I'm new to jQuery. I'm creating a cascading dropdown using jquery ajax. So based on the changed value of first dropdown, the second script fetches values from database from second dropdown. &lt;script&gt; $(document).ready(function () { $("#builder_group").change(function () { var selected_builder = $(this).val(); alert(selected_builder); $.ajax({ type: 'POST', url: 'getGroupzCode.php', data: 'selected_builder', datatype: 'json', success: function (data) { // Call this function on success console.log(data); var yourArray = JSON.parse(data); console.log(yourArray); $.each(yourArray, function (index, yourArray) { $('#builder_group1').append($('&lt;option/&gt;', { value: yourArray.id, text: yourArray.name, })); }); }, error: function () { displayDialogBox('Error', err.toString()); } }); }); }); &lt;/script&gt; Problem is when I alert the selected value from first dropdown it works i.e alert(selected_builder) works , but when I try to pass it to the script it is showing as undefined in PHP script. How can I solve this.
tagged with: ajax
type: Question
has answer: http://stackoverflow.com/a/24789001
has answer: http://stackoverflow.com/a/24788997
has comment: http://stackoverflow.com/comment/38472344
upvote count: 1

http://stackoverflow.com/comment/38397986
type: QuestionComment
has text: Sorry, it's unclear to me...
type: Comment
comment on: http://stackoverflow.com/q/24749619
score: 0

http://stackoverflow.com/a/24764300
upvote count: 2
has comment: http://stackoverflow.com/comment/38425279
has body: What you are looking for is called a range and is an input element: To get the out put you could use JavaScript and : JSFiddle Example
accepted answer of: http://stackoverflow.com/q/24764252
has comment: http://stackoverflow.com/comment/38427666
answers question: http://stackoverflow.com/q/24764252
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/38427881
score: 2

http://stackoverflow.com/q/24895244
accepted answer: http://stackoverflow.com/a/24895364
type: AnsweredQuestion
score: 2
has body: I know if it was a snake it would have bit me. But I can't see why it works in _Layout header file, but not in specific Index page where I need it. I can't see having this code in every page that uses the _Layout.cshtml. Here is jQuery code that works IF in _Layout. I cut and paste it into Index.cshtml and it won't even fire an alert. What it is expected to do: It clears an input if the other input changes (can only search by either name or ID). not represented here are the javascript surrounding tags. I tried just an alert with all other code turned off. For some reason the javascript tag is not firing. $(document).ready(function () { alert('doc ready in _layout just fired'); $('#SearchString').on('input', function () { $('#SearchID').val(''); }); $('#SearchID').on('input', function () { $('#SearchString').val(''); }); }); This doesn't work in Index.cshtml wherever it is placed: &lt;script type="text/javacript"&gt; alert('code in Index test'); &lt;/script&gt; ====================================== So, this just in: I put the jQuery code needed for single page in a ".js" file with nothing in there but the code. Then I referenced this file at the top of my Index.cshtml and it works: &lt;script src="@Url.Content("~/Scripts/search.js")" type="text/javascript"&gt;&lt;/script&gt; Now, this is a nice workaround that gives some degree of separation for those that like that, but I hate saying this is the answer to why Index.cshtml was bypassing the javacript tags with jQuery code in them. So I'm not answering my question, just saying so it might help someone else who has pulled out almost all their hair. . . .
has answer: http://stackoverflow.com/a/24895364
has title: $(document).ready works when inserted into _Layout.cshtml :: doesn't work when inserted into Index.cshtml
type: Question
tagged with: asp.net-mvc
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 1
favorite count: 0
upvote count: 2

http://stackoverflow.com/a/24776241
score: 0
has body: I got it to work in firefox, chrome and safari. Here is the JSFiddle link. @-webkit-keyframes fadeIn { 0% { opacity:0; } 100% { opacity:1; } } @keyframes fadeIn { 0% { opacity:0; } 100% { opacity:1; } } .fade-in { opacity:0; /* make things invisible upon start */ -webkit-animation: fadeIn 1s ease-in; animation: fadeIn 1s ease-in; -webkit-animation-fill-mode: forwards; animation-fill-mode:forwards; } .fade-in.one { -webkit-animation-delay: 0.7s; animation-delay: 0.7s; } Hope this helps!
type: Answer
answers question: http://stackoverflow.com/q/24774720

http://stackoverflow.com/q/24759985
tagged with: ajax
has answer: http://stackoverflow.com/a/24760027
has answer: http://stackoverflow.com/a/24760492
answer count: 4
has comment: http://stackoverflow.com/comment/38417121
accepted answer: http://stackoverflow.com/a/24760020
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24760030
score: 1
upvote count: 1
type: Question
has title: I have a JSON response like this, and I'm having trouble access the value for some reason
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has body: JSON response: { "success" : "false" } Way I thought you access the data: if (data.success[0] == "false") { alert("Login Successful"); } else { alert("Login Failed"); } It's going to the else condition. What am I doing wrong?
has answer: http://stackoverflow.com/a/24760020
tagged with: arrays
downvote count: 0
possible better answer: http://stackoverflow.com/a/24760027
favorite count: 0

http://stackoverflow.com/q/24888187
has comment: http://stackoverflow.com/comment/38660312
tagged with: javascript
has comment: http://stackoverflow.com/comment/45664628
has comment: http://stackoverflow.com/comment/44259210
has answer: http://stackoverflow.com/a/27921037
has comment: http://stackoverflow.com/comment/44077158
has answer: http://stackoverflow.com/a/27934504
has comment: http://stackoverflow.com/comment/44267908
has answer: http://stackoverflow.com/a/27891630
has comment: http://stackoverflow.com/comment/44269776
tagged with: webbrowser-control
has comment: http://stackoverflow.com/comment/38686087
favorite count: 0
has comment: http://stackoverflow.com/comment/38686185
tagged with: contenteditable
has comment: http://stackoverflow.com/comment/68095910
has comment: http://stackoverflow.com/comment/38660025
has answer: http://stackoverflow.com/a/24907455
has comment: http://stackoverflow.com/comment/44269286
tagged with: http://stackoverflow.com/tag/html
score: 13
has title: Editable HTML content is very laggy when it is large
has comment: http://stackoverflow.com/comment/44263513
has answer: http://stackoverflow.com/a/27835990
has answer: http://stackoverflow.com/a/27936312
type: AnsweredQuestion
has body: For example, I have the following simple HTML page, where the [SOME FIELD] is repeating many times to make up for about 200K of the file size: [SOME FIELD] [SOME FIELD] ... [SOME FIELD] As the content grows, the editing experience is becoming very laggy. It's literally impossible to type or edit the content. Here is a complete repro case. To see what I mean, just move the cursor to the end of the editable content and try editing. It lags big time under IE and Chrome, making it almost impossible to type. It works great under Firefox, though. The problem: I need to get it working reasonably fast under IE. So far, I got close with IE8 emulation (with ), so this works (under IE). However, I need to support IE=edge, too. Any advice on how to make this happen would be greatly appreciated. IMO, it's a bug (which I submitted here for IE and here for Chrome), but I'm looking for any workaround. Updated, a bounty is offered for any solution that works while loaded in stand-alone IE browser or a custom application hosting WebBrowser control, using IE=edge HTML document mode. Updated, the corresponding IE bug reported was just closed as "Won't fix".
upvote count: 14
has comment: http://stackoverflow.com/comment/38659803
has comment: http://stackoverflow.com/comment/44078421
has answer: http://stackoverflow.com/a/27818273
accepted answer: http://stackoverflow.com/a/27936312
downvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/27849179
answer count: 8
has answer: http://stackoverflow.com/a/27849179
tagged with: internet-explorer

http://stackoverflow.com/q/24798475
score: 0
has comment: http://stackoverflow.com/comment/38502018
has title: Jquery/JS css animation works wrong on hover
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/38490717
has answer: http://stackoverflow.com/a/24824164
accepted answer: http://stackoverflow.com/a/24824164
tagged with: css
has comment: http://stackoverflow.com/comment/38490431
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38496483
type: Question
has body: I am trying to animate some dots all over the screen and they should stop on hover. The code: function dot(_options) { this.id = _options.id; this.speedX = 0; this.speedY = 0; this.posx = _options.posx; this.posy = _options.posy; this.width; this.height; this.animation = true; }; dot.prototype.animationStep = function() { if(this.animation == true) { while (this.speedX == 0) this.speedX = randPos(-3, 3); while (this.speedY == 0) this.speedY = randPos(-3, 3); if (this.posx + this.speedX &lt;= 0 || this.posx + this.speedX + this.width &gt;= $(window).width()-2){ if(this.speedX &lt; 0){ this.speedX = randPos(1.5, 3); } else { this.speedX = randPos(-1.5, -3); } } if (this.posy + this.speedY &lt;= 0 || this.posy + this.speedY + this.height &gt;= $(window).height()-85){ if(this.speedY &lt; 0){ this.speedY = randPos(1, 3); } else { this.speedY = randPos(-1, -3); } } this.posx += this.speedX; this.posy += this.speedY; this.width = $('#dot' + this.id).width(); this.height = $('#dot' + this.id).height(); $('#dot' + this.id).parent().css({ 'left': this.posx + 'px', 'top': this.posy + 'px' }); // $('#dot' + this.id).html(this.speedX + ' / ' + this.speedY); } } dot.prototype.pause = function(){ this.speedX = 0; this.speedY = 0; } dot.prototype.unpause = function() { while (this.speedX == 0) this.speedX = randPos(-3, 3); while (this.speedY == 0) this.speedY = randPos(-3, 3); } var dots = []; dots.push(new dot({ id: 1, posx: 100, posy: 100 })); dots.push(new dot({ id: 2, posx: 100, posy: 100 })); dots.push(new dot({ id: 3, posx: 100, posy: 100 })); dots.push(new dot({ id: 4, posx: 100, posy: 100 })); dots.push(new dot({ id: 5, posx: 100, posy: 100 })); dots.push(new dot({ id: 6, posx: 100, posy: 100 })); window.setInterval(function() { for (var i = 0; i &lt; dots.length; i++) { dots[i].animationStep(); } }, 16); function randPos(max, min) { return (Math.random() * (max - min + 1)) + min; } $(document).ready(function(){ $('.dot').hover( function(){ var dataid = $('div', this).attr(…
tagged with: javascript
has comment: http://stackoverflow.com/comment/38490816
tagged with: browser

http://stackoverflow.com/comment/38469347
type: Comment
comment on: http://stackoverflow.com/a/24787330
type: AnswerComment
has text: This fixes the problem, however now the original page is empty and white. But adding a response.redirect later on in the code then invalidates the form post / new tab.
score: 0

http://stackoverflow.com/q/24828275
tagged with: http://stackoverflow.com/tag/html
has body: I am using parsley.js for form validation. I read through the documentation on the website and followed their examples, but it does not seem to work as expected. Here's the test file I created: <doctype> Parsley Parsley.js Form Validation Name Any suggestions on what's going wrong?
type: UnansweredQuestion
type: Question
tagged with: parsley.js
has answer: http://stackoverflow.com/a/24859911
has answer: http://stackoverflow.com/a/55898920
score: 0
has title: parsleyJs validation on form not working
answer count: 2
tagged with: validation
tagged with: javascript

http://stackoverflow.com/a/24849675
has body: set the optimized-option of the markers to false
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24836258
answers question: http://stackoverflow.com/q/24836258
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/63362806
has comment: http://stackoverflow.com/comment/38593672
has comment: http://stackoverflow.com/comment/38594095

http://stackoverflow.com/q/24905991
downvote count: 0
has comment: http://stackoverflow.com/comment/38696640
has title: addEventListener event not showing the popup size correct in Google chrome
has comment: http://stackoverflow.com/comment/38693419
favorite count: 0
type: UnansweredQuestion
answer count: 0
score: 1
upvote count: 1
tagged with: google-chrome
type: Question
tagged with: javascript
has body: I am working on project that uses twitter4j API.I need to connect Twitter with my application. https://api.twitter.com/oauth/authorize?oauth_token=UHQ0f8KtX2yaNoY1oneZoQDmXTW5Pie3TQjNZb6Q. This is the url of the popup I need on a button click. I was using window.open(PAGE.authURL,"twitterAuthWin", "status = 1, width = 800, resizable = 0") command and it seems like blocked by popup blocker in Google chrome. I solved this problem by changing the command to document.getElementById("authtwitacc").addEventListener("click",function({window.open(PAGE.authURL,"twitterAuthWin", "status = 1, width = 800, resizable =0");},false) Now the popup blocker doesnt block my popup in any browser and I am happy. I still have an issue with the size of the popup only in chrome.It is not showing the actual size. I need width = 800 as I am specified in the command.All other browsers are working fine.Please help me to solve this problem
has comment: http://stackoverflow.com/comment/38693919

google-maps
tags question: http://stackoverflow.com/q/24837613
tag name: google-maps
tags question: http://stackoverflow.com/q/24782828
tags question: http://stackoverflow.com/q/24893787
tags question: http://stackoverflow.com/q/24791010
tags question: http://stackoverflow.com/q/24844915
tags question: http://stackoverflow.com/q/24754585
tags question: http://stackoverflow.com/q/24853312
tags question: http://stackoverflow.com/q/24835867
tags question: http://stackoverflow.com/q/24898796
tags question: http://stackoverflow.com/q/24905148
tags question: http://stackoverflow.com/q/24768772
tags question: http://stackoverflow.com/q/24863372
tags question: http://stackoverflow.com/q/24827926
tags question: http://stackoverflow.com/q/24893267
tags question: http://stackoverflow.com/q/24879934
tags question: http://stackoverflow.com/q/24767919
tags question: http://stackoverflow.com/q/24852598
tags question: http://stackoverflow.com/q/24861148
tags question: http://stackoverflow.com/q/24820462
tags question: http://stackoverflow.com/q/24906272
tags question: http://stackoverflow.com/q/24750384
tags question: http://stackoverflow.com/q/24862401
tags question: http://stackoverflow.com/q/24789814
tags question: http://stackoverflow.com/q/24823656
tags question: http://stackoverflow.com/q/24836258
tags question: http://stackoverflow.com/q/24840980
tags question: http://stackoverflow.com/q/24814352
tags question: http://stackoverflow.com/q/24902425
tags question: http://stackoverflow.com/q/24905145
tags question: http://stackoverflow.com/q/24871819
tags question: http://stackoverflow.com/q/24884739
tags question: http://stackoverflow.com/q/24876052
tags question: http://stackoverflow.com/q/24800444
tags question: http://stackoverflow.com/q/24756136
tags question: http://stackoverflow.com/q/24781871
tags question: http://stackoverflow.com/q/24845228
tags question: http://stackoverflow.com/q/24792605
tags question: http://stackoverflow.com/q/24900859
tags question: http://stackoverflow.com/q/24774139
tags question: http://stackoverflow.com/q/24894023
tags question: http://stackoverflow.com/q/24761057
tags question: http://stackoverflow.com/q/24773753
tags question: http://stackoverflow.com/q/24802865
tags question: http://stackoverflow.com/q/24839714
tags question: http://stackoverflow.com/q/24884197
tags question: http://stackoverflow.com/q/24865158
tags question: http://stackoverflow.com/q/24776492
tags question: http://stackoverflow.com/q/24782366
tags question: http://stackoverflow.com/q/24790831
type: Tag
tags question: http://stackoverflow.com/q/24800324
tags question: http://stackoverflow.com/q/24800687
tags question: http://stackoverflow.com/q/24792855
tags question: http://stackoverflow.com/q/24759763
tags question: http://stackoverflow.com/q/24839509
tags question: http://stackoverflow.com/q/24799649
tags question: http://stackoverflow.com/q/24757047
tags question: http://stackoverflow.com/q/24763824
tags question: http://stackoverflow.com/q/24873647
tags question: http://stackoverflow.com/q/24767241
tags question: http://stackoverflow.com/q/24775175
tags question: http://stackoverflow.com/q/24860433
tags question: http://stackoverflow.com/q/24888987
tags question: http://stackoverflow.com/q/24829727
tags question: http://stackoverflow.com/q/24853148
tags question: http://stackoverflow.com/q/24805935
tags question: http://stackoverflow.com/q/24883358
tags question: http://stackoverflow.com/q/24890375
tags question: http://stackoverflow.com/q/24783182
tags question: http://stackoverflow.com/q/24779253
tags question: http://stackoverflow.com/q/24857983
tags question: http://stackoverflow.com/q/24905363
tags question: http://stackoverflow.com/q/24869218

http://stackoverflow.com/q/24781935
tagged with: javascript
tagged with: ionic-framework
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/24790470
has body: I am currently porting a Javascript "app" into AngularJS and one part of this app would be too long to recode. What I would like to do is to use a simple javascript instruction like alert("message") within the ionic sideMenu sample available here : http://ionicframework.com/getting-started/ I already tried by including this into indext.html as well as in search.html but nothing would help &lt;script src="js/test.js" type="text/javascript"&gt;&lt;/script&gt; This is my test.js (I get no output for the console.log neither) function test() { console.log('test'); alert("Secon test"); } test(); //first method for calling the function, won't work And calling it within an attribute won't work neither : &lt;ion-content class="has-header" scroll="false" onload="test()"&gt; Could you please tell me why this is not working and how to fix it? Thank you in advance
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38468412
has comment: http://stackoverflow.com/comment/38475353
has comment: http://stackoverflow.com/comment/38468480
type: Question
has title: Using simple JS within ionic sidemenu sample (AngularJS)
has comment: http://stackoverflow.com/comment/38458525

http://stackoverflow.com/comment/38550520
type: Comment
type: QuestionComment
score: 6
has text: https://www.npmjs.org/doc/files/npm-folders.html
comment on: http://stackoverflow.com/q/24830586

http://stackoverflow.com/comment/105199486
type: AnswerComment
type: Comment
score: 25
comment on: http://stackoverflow.com/a/55260552
has text: Best answer hands down! More info here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap#For_adding_and_removing_items_during_a_map

http://stackoverflow.com/comment/38402139
has text: setTimeout will lag. For longer periods it's probably best to either sync with server every now and then or use client side `new date()` to fix the lag.(also depending on what kind of time you want to use, not everyones time is the same!)
type: Comment
comment on: http://stackoverflow.com/a/24751717
score: 1
type: AnswerComment

http://stackoverflow.com/comment/38588199
type: AnswerComment
has text: so, i edited my code to suit your question. is it answer your question ?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24850178

http://stackoverflow.com/a/24864025
type: Answer
has comment: http://stackoverflow.com/comment/38613889
answers question: http://stackoverflow.com/q/24863916
has comment: http://stackoverflow.com/comment/38613966
score: 3
upvote count: 3
has body: You're concatenating the result of calling $.each(), which in the case of jQuery, returns the entire list val. What you want to do is call $.map(), which returns an array of results of the callback for every item of val. You then need to join() the strings together. Should look like this (untested): var html = '&lt;div class="list-group"&gt;'+ $.map(val,function(key,value){ return 'value: ' + value + '&lt;br/&gt;'; }).join() +'&lt;/div&gt;';
accepted answer of: http://stackoverflow.com/q/24863916
has comment: http://stackoverflow.com/comment/38613853
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38614064
has comment: http://stackoverflow.com/comment/38613831

http://stackoverflow.com/comment/38452469
has text: Can you make a JSfiddle?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24778424
score: 1

http://stackoverflow.com/comment/38490670
type: QuestionComment
type: Comment
score: 0
has text: @adeneo it is not very convenient when using Karma-runner, and may be it is not possible at all with it, I did not check this
comment on: http://stackoverflow.com/q/24798675

http://stackoverflow.com/q/24764819
accepted answer: http://stackoverflow.com/a/24767520
score: 0
tagged with: node.js
has title: Why am I unable to import a module with Typescript / node.js?
tagged with: typescript
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38426565
type: Question
has body: File: util.ts class Util { task1 () { return 9; } } module.exports = new Util(); File: base.ts // &lt;reference path="../../Utils/util.ts" /&gt; import util = require('../../Utils/util.js'); class child { } I am trying to import the util module but when I do this it gives me an error saying. Error 1 Unable to resolve external module ''../../Utils/util.js''. C:\Protractor\Latest\Test\Test\Scripts\Admin\Common\base.ts 4 1 Test Can someone help tell me what I am doing wrong? Here's the location of my files: C:\Protractor\Latest\Test\Test\Scripts\Utils\util.js C:\Protractor\Latest\Test\Test\Scripts\Utils\util.ts C:\Protractor\Latest\Test\Test\Scripts\Admin\Common\base.ts
answer count: 1
has answer: http://stackoverflow.com/a/24767520
tagged with: javascript

http://stackoverflow.com/q/24843599
type: Question
score: 0
has title: How to manipulate a JSONArray in JQuery
answer count: 1
has answer: http://stackoverflow.com/a/24843658
tagged with: jquery
has comment: http://stackoverflow.com/comment/38574608
tagged with: php
has body: i have a php function which returns me this code in JSON {"0":{"title":"Dans l’appartement"},"1":{"title":"A l’aéroport - Départ de Béatrice"},"2":{"title":"Visite chez Jean-Louis"},"3":{"title":"Anita à la matenité"},"4":{"title":"Visite chez Jean-Louis 2"},"5":{"title":"Héléna présentée à la famille"},"6":{"title":"Chez des proches"},"7":{"title":"Soirée souvenir avec un proche - Photos, histoires"},"8":{"title":"Douceline tenant un bébé"},"9":{"title":"Visite chez Jean-Louis 3"},"10":{"title":"Baptême de Alexandra - Dans l’église"}} and i want to manipulated in JQuery I’ve did this but it doesn’t work $.each(json, function(item, value) { console.log(value); $.each(value, function() { console.log(this.title); }); }); any ideas thanks a lot
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38574703
tagged with: javascript

http://stackoverflow.com/q/24827964
has title: Browserify with twitter bootstrap
answer count: 4
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
downvote count: 0
possible better answer: http://stackoverflow.com/a/33138958
linked to: http://stackoverflow.com/q/24978244
has answer: http://stackoverflow.com/a/41874158
tagged with: browserify-shim
has answer: http://stackoverflow.com/a/24834257
accepted answer: http://stackoverflow.com/a/24834257
type: Question
score: 37
has comment: http://stackoverflow.com/comment/38560385
has comment: http://stackoverflow.com/comment/39152248
has body: There are many similar questions including answers here on stack overflow, but none of them have worked for me, so here I am asking you guys. I appreciate everyone's time. I recently started using gulp with browserify, and that works great. I then tried to use browserify for the front-end using: Backbone and Bootstrap3. things are appearing to work, until I try to require the js file that comes with Bootstrap. I get an error in my chrome tools stating: jQuery is undefined. I have attempted to shim it in, but I am very confused by the shim. I am using jQuery 2.1.1, so I should not need to shim jQuery, but it exists in the shim now, as I was desperate and trying everything. Here is my package.json and my main.js file: --------------package.json------------------ { "name": "gulp-backbone", "version": "0.0.0", "description": "Gulp Backbone Bootstrap", "main": "main.js", "scripts": { "test": "echo \"Error: no test specified\" &amp;&amp; exit 1" }, "author": "Rob Luton", "license": "ISC", "devDependencies": { "jquery": "^2.1.1", "backbone": "^1.1.2", "browserify": "^4.2.1", "gulp": "^3.8.6", "vinyl-source-stream": "^0.1.1", "gulp-sass": "^0.7.2", "gulp-connect": "^2.0.6", "bootstrap-sass": "^3.2.0", "browserify-shim": "^3.6.0" }, "browser": { "bootstrap": "./node_modules/bootstrap-sass/assets/javascripts/bootstrap.js", "jQuery": "./node_modules/jquery/dist/jquery.min.js" }, "browserify": { "transform": ["browserify-shim"] }, "browserify-shim": { "jquery": "global:jQuery", "bootstrap": { "depends": [ "jQuery" ] } } } ------------------------- main.js ---------------------- var shim = require('browserify-shim'); $ = require('jquery'); var Backbone = require('backbone'); Backbone.$ = $; var bootstrap = require('bootstrap'); /* the following logs fine if I comment out the bootstrap require, otherwise I get 'jQuery undefined' */ console.log(Backbone); $(function() { alert('jquery works'); });
has answer: http://stackoverflow.com/a/47362344
tagged with: javascript
tagged with: browserify
has answer: http://stackoverflow.com/a/33138958
favorite count: 0
upvote count: 37

http://stackoverflow.com/comment/38422624
type: Comment
comment on: http://stackoverflow.com/q/24762957
score: 0
type: QuestionComment
has text: But it doesn't? What is your question?

http://stackoverflow.com/q/24790671
has comment: http://stackoverflow.com/comment/38476391
tagged with: navigation
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/24791209
score: 0
has comment: http://stackoverflow.com/comment/38476187
has body: I have created a jsfiddle to help see the working code. I have been trying to achieve the sticky menu that automatically changes the color of the list item that is active. But I am now adding an image in the center as one of the list items. Somehow it breaks the nav-active code. I also have a code that is suppose to make the img go margin-top:-29%; when the person scrolls beyond 50 px. that doesnt show up on the jsfiddle for some reason but works. At first I thought is the second script that is conflicting it. Then I noticed that it breaks on the third list item. Am I doing something that breaks it? I am not quite sure why it should break the momentum of the code. Can someone please guide me?? PS: This may or may not help but I also get this error on the console Uncaught TypeError: Cannot read property 'top' of undefined Uncaught TypeError: Cannot read property 'top' of undefined (index):543 (anonymous function) (index):543 p.event.dispatch jquery.min.js:2 g.handle.h line 543 is from the script var divPos = $(theID).offset().top; // get the offset of the div from the top of page this error is visible irrespective of the issue I am asking help for, but doesn't usual affect my user experience. My knowledge of javascript is basic and I cannot really understand how I am breaking the code. Please help! EDIT : I tried removing the image and it works fine here Thanks to jtorrescr I have been able to achieve what I need but now I am faced with the constant error on console Uncaught Error: Syntax error, unrecognized expression: Z.error bg Z.compile bm h.querySelectorAll.bm Z p.fn.extend.find p.fn.p.init p (anonymous function) p.event.dispatch g.handle.h //for the js line var divPos = $(theID).offset().top; // get the offset of the div from the top of page
accepted answer: http://stackoverflow.com/a/24791209
tagged with: css
type: AnsweredQuestion
has title: nav active class wont work because of image in list

http://stackoverflow.com/q/24842884
possible better answer: http://stackoverflow.com/a/24843177
tagged with: function
tagged with: button
tagged with: javascript
has comment: http://stackoverflow.com/comment/38578352
answer count: 3
has comment: http://stackoverflow.com/comment/38573555
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/38573275
has answer: http://stackoverflow.com/a/24843177
accepted answer: http://stackoverflow.com/a/24843252
tagged with: text
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38575781
score: 1
has answer: http://stackoverflow.com/a/24843252
has title: Rainbow Scrolling Text Using
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/24843554
has body: I would like to turn a small paragraph into rainbow text, in which the colors scroll from right to left in an infinite loop using JavaScript. I currently have this paragraph: H e l l o ! Click for RAINBOW! ` I am fairly new to JavaScript so I am not sure how to write the activ() function to infinitely scroll the colors. EDIT: I would like to thank Ben for the looping script, but now I also need to know how to use the activ() function to change the color of a element. I have tried the following script: function activ() { document.getElementById("s1").style.color = 'magenta'; } But the color will not change. I am trying to keep the script as simple as possible, but also make it work. FINAL EDIT: I used Ivan's "UPD Without JQuery" code and added a few colors, and this is what I end up with: Hello! Pabam! The result.

http://stackoverflow.com/a/24877569
answers question: http://stackoverflow.com/q/24877253
type: Answer
has comment: http://stackoverflow.com/comment/38639996
score: 2
downvote count: 0
has body: There is no way to modify that particular response without breaking existing clients. If you can break existing clients, or if you are working with clients that you control, you could wrap the object in another object, setting two keys: GUID and data. For example: var json = JsonConvert.SerializeObject(new { data = foo, GUID = bar, }); Where bar is the GUID that you want to use, and foo is one of two things: The JSON string from the response. This will result in the final object looking like so: { data: "{\"sa\":[\"BHDQ9TLPeaeVuSSgXv9bsOIVFUWbOpivMKhGki7YPLzIXEyHuxRAZhDgts2sEcBQpLBuKJZCtcmSlzWZ9iK0AAA=\",\"BAhyo7T0Wq1WBLXnyN4vo1L94rWLhCCv4DqROi+p9XHO6UeS0Gw6xh1JAKOtXBU2fA432LkNqng8cUt1eAX0bqs=\",\"BGFmyTreWY5pICAcf3itoqbfhs5brOmIDLNF3V7p7slPYdCSVhwWUT5mHD6Lb5kNi\/Qy9tracNUtVgvo3f51FrI=\",\"BMV7RIwoz+LdFgD2fq7UZ7E88KFq\/03381NDYFIKYgUKxEzuXoj6hZfSB0slX5fdaL44Lf6i\/UjDzPQt2XUG8NE=\",\"BL8BnU5WvFn7vIlKi14dWsqykNf1\/nmE55YXFGwLx9Qu3VvDblULt\/U8CXPI1vD8+wMXCRnkunXqxlsFqgghf8w=\"],\"sb\":[\"BInTtgTAn\/zkmrkporhV5DvPZRq5YWm8e\/m02oq55UfY3RxIhOplJgwLjgKMHKYDthYEBcqNNNuVbbWnbtKVAqA=\",\"BJbh5y95wHGjmAPDFNqgewnBxtqVke0sloDD2S3IdrWZ95JfP77rtXZ4lTG8g9PuTLJbl4exZUnM16260WxJ9wU=\",\"BKevE9i2J8CicXHX3elCoQPEpTOmJyGOlBskIbFMFGQFhJ5TD7N1221rhhH9HY6DsfRojmefozsQYzo7Pokp+Hg=\",\"BJbVTRyh8WwCxfR7jRXnran4td7k5+vEfM+HWxeAibneSjdMRQ1Fg6QxKLu+Zu1aPdXqD8M29kABOTAiYopVuQE=\",\"BFv3alDqjo7ckdB2vuxJ15Gur1xsgATjLe9drt\/XU9AkbN+AELCv+mF1Xy8+83L2A1p8aGxF4b7dsrMed27u1j4=\"],\"sz\":\"BF1IiqMz0KmT4gZN6euJquWFt2UmVjyOEdaX0jH8uQMAPG8DBoyneT2PJ9NQTE2xBOP9TtAb1d2O+iCojFqzkvI=\"}", guid: "00000000-0000-0000-0000-000000000000" } And you would get at the data through two calls to JSON.parse (or the equivalent). The deserialized object from the JSON response. This will result in the final object looking like so (most data removed for brevity sake): { data: { sa: [], sb: [], sz: "" }, guid: "00000000-0000-0000-0000-000000000000" } And you would access data through response.data. Why any modification can brea…
has comment: http://stackoverflow.com/comment/38640266
upvote count: 2

http://stackoverflow.com/a/24766204
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: In javascript, using .value returns a String, so you need to use parseInt() or parseFloat() when assigning money and interest. Otherwise it will perform string concatenation on use of +. Based on what you want for your inputs, you'll want to change your javascript to: function calculation() { var money = parseFloat(document.getElementById('money').value); var interest = parseInt(document.getElementById('interest').value); var sum = money + (money / 100 * interest); document.getElementbyId('sum').innerHTML = sum; }
answers question: http://stackoverflow.com/q/24766106

http://stackoverflow.com/comment/38571678
score: 0
type: Comment
type: QuestionComment
has text: What does the code look like? And keep in mind that JSLint thinks it's a lot smarter than it really is :)
comment on: http://stackoverflow.com/q/24842016

http://stackoverflow.com/a/76796055
has body: Been researching when I came to this question but none of the answers worked for me. However, just in case there is anyone else who visits this question within this same time frame, I found an answer. $("#id option:selected").prop("selected", false); Or $("#id").val([]); Both worked for me, clearing all selected values from a select field whether it has the multiple attribute or not.
score: 0
answers question: http://stackoverflow.com/q/24771308
type: Answer

http://stackoverflow.com/comment/38485001
comment on: http://stackoverflow.com/a/24794516
score: 1
type: AnswerComment
type: Comment
has text: @Benjamin IMHO, this is not exactly the same as the deferred anti pattern. The deffered anti pattern you mention is when the deferred can be removed completely without a lose of functionality. But yes, your answer is much simpler and also handle error well.

http://stackoverflow.com/q/24793197
has comment: http://stackoverflow.com/comment/38480482
upvote count: 1
has body: Is there a syntax that will allow me to use ng-model to bind to a scope property with the same name as the element I am binding to? So, in the following example: &lt;input name="myinputname" type="text" ng-model="?" /&gt; is there something I can use as the ng-model value that will resolve to "myinputname", without requiring me to hard-code it?
type: Question
has answer: http://stackoverflow.com/a/24794687
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38481298
has comment: http://stackoverflow.com/comment/38480471
has title: Angular ng-model bind to element name
score: 1

http://stackoverflow.com/a/24896976
downvote count: 0
answers question: http://stackoverflow.com/q/24896866
has comment: http://stackoverflow.com/comment/38763900
has comment: http://stackoverflow.com/comment/38715213
has body: I'm not sure but try this: Change id="genre" to class="genre" and $('#genre') to $('.genre'). Your HTML attribute is duplicated.
type: Answer
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/24896866
type: AcceptedAnswer

http://stackoverflow.com/q/24761578
type: AnsweredQuestion
score: 0
has body: I have several long list in my index page, so I decided to create them once in a PHP document and include them in the main index page wherever necessary using PHP require() function. The problem is Jquery isn’t returning the list items in the list, its returning the number of list item in the list. Code inside index.php: <?php require("list.php"); ?> Code inside list.php: Element 1 Element 2 Element 3 Element 4 Element 5 I’m not echoing the html code, just want the content of list.php in place of require() The Jquery code: $('.some-list').children(); OR $('.some-list').find('li'); Both doesn’t work Here’s what I’m getting in the console $('.some-list ').find('li'); > v.fn.v.init[191] If I include the list items inside index.php i.e. not including it through PHP, everything works fine. Jquery version I’m using is 1.8.3 Am I missing something? Please help me on this.
has answer: http://stackoverflow.com/a/24761923
type: Question
possible better answer: http://stackoverflow.com/a/24761736
has answer: http://stackoverflow.com/a/24761736
answer count: 3
accepted answer: http://stackoverflow.com/a/24761923
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38420384
has comment: http://stackoverflow.com/comment/38420883
has answer: http://stackoverflow.com/a/24761647
has title: Jquery not returning elements included via PHP require() function
tagged with: http://stackoverflow.com/tag/html
tagged with: php

http://stackoverflow.com/comment/38625200
comment on: http://stackoverflow.com/q/24842252
score: 0
type: Comment
type: QuestionComment
has text: I'm going to report that

http://stackoverflow.com/q/24762893
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38423626
has title: jQuery Load Divs Broken
score: 0
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/24763369
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to create an HTML order type page with 3 buttons using jQuery Mobile: Pick Up Drop Off Ship It I've created the buttons and placed them properly on the page. Now, I'd like to display a unique form based on which button is clicked by the user. Taking a look at examples it appears my options are jQuery, AJAX or Javascript. I'm already using jQuery so I tried going that route with no luck. Having added in the load HTML and JS Alert... my page will completely ignore the loading of HTML, but still display the alert. I've verified that my divs are properly named and that each link has a proper id set. So I gave up on jQuery for a bit. On to javascript... add my logic in the between tags and again... it ignores loading of HTML content. I've tried putting things in divs, renaming divs, moving my form code to a seperate .html and .txt, but still no luck. I found a working example here and tried forcing its code into my page. Again, it does not load anything on button click when included in my page. (I'm using Chrome Version 35.0.1916.153) Currently, the code for my page is as follows: Order Type Pick Up Drop Off Ship It Continue Container #1 Whole bunch of text 1 Container #2 Whole bunch of text 2 Container #3 Whole bunch of text 3 What is going on here that jQuery/Javascript refuse to load in my content to my divs? Can someone help point me in the right direction? Thank you!
possible better answer: http://stackoverflow.com/a/24763192
has comment: http://stackoverflow.com/comment/38422508
has answer: http://stackoverflow.com/a/24763192
accepted answer: http://stackoverflow.com/a/24763369

http://stackoverflow.com/a/24756606
has body: From this issue: https://github.com/angular/angular.js/issues/5172 You can use the $animateProvider.classNameFilter this way angular will animate only specific classes. You should inject the provider either in your config of angular or in the root controller of the application. EDIT: Here is the documentation for the provider: https://docs.angularjs.org/api/ng/provider/$animateProvider Basically you should provide a RegExp EDIT: I looked at the code of the $animateProvider here: https://github.com/angular/angular.js/blob/master/src/ng/animate.js#L5 Take a look at the following code: this.classNameFilter = function(expression) { if(arguments.length === 1) { this.$$classNameFilter = (expression instanceof RegExp) ? expression : null; } return this.$$classNameFilter; }; This means that you should pass your expression as follows: $animateProvider.classNameFilter(new RegExp('/animate-item\b/g'));
type: Answer
answers question: http://stackoverflow.com/q/24756117
score: 0
has comment: http://stackoverflow.com/comment/38422604

http://stackoverflow.com/comment/38542925
comment on: http://stackoverflow.com/a/24826455
score: 0
type: AnswerComment
has text: https://dl.dropboxusercontent.com/u/9197067/test.html doesn't work. Am i I forgeting something ? In fact it is not a tablet, but a "touch screen computer" and it's running on Internet Explorer
type: Comment

http://stackoverflow.com/comment/38578719
comment on: http://stackoverflow.com/q/24845670
type: Comment
has text: @CommonsWare nope no `console.log()` messages seen
type: QuestionComment
score: 0

http://stackoverflow.com/q/24891143
accepted answer: http://stackoverflow.com/a/24891287
upvote count: 3
possible better answer: http://stackoverflow.com/a/24891274
type: Question
score: 3
tagged with: javascript
tagged with: angularjs-scope
answer count: 3
has answer: http://stackoverflow.com/a/24891287
downvote count: 0
tagged with: angular-ui
has answer: http://stackoverflow.com/a/24891277
favorite count: 0
has body: I recently realized I had not used ng-Controller to declare the official scope of my controller in the HTML but had only mentioned it in $routeProvider and all APPEARS to be well. Does any one know any disadvantage to leaving it as such? Only defining and the making reference to my controller in the $routeProvider?
tagged with: angularjs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24891274
has title: Do you have to us ng-Controller in the view or can you just declare it in the $routeProvider?

http://stackoverflow.com/comment/38678653
type: QuestionComment
comment on: http://stackoverflow.com/q/24896970
has text: I just saw you you commented and removed the event listeners, up and running now! Thank you! , if you'd like post without listeners as answer
score: 0
type: Comment

http://stackoverflow.com/comment/38525723
type: QuestionComment
score: 0
has text: Can you show example of what you're starting with and what you want to end up with. Optional: Also a snippet to show how you currently do it.
comment on: http://stackoverflow.com/q/24817347
type: Comment

http://stackoverflow.com/a/24936627
score: 0
has comment: http://stackoverflow.com/comment/42136646
answers question: http://stackoverflow.com/q/24853024
type: Answer
has body: I finally implemented this tutorial with kaminari (instead of will paginate) : http://www.sitepoint.com/infinite-scrolling-rails-basics/. FYI, there are 2 or 3 adaptations to perform to make that tutorial work with kaminary. Ask me if you want to know more about that. after that, it works just fine on smartphones and consumes very low ressources client-side. V.

http://stackoverflow.com/a/24815372
has comment: http://stackoverflow.com/comment/38521988
answers question: http://stackoverflow.com/q/24815315
has comment: http://stackoverflow.com/comment/38522914
has comment: http://stackoverflow.com/comment/38522247
has comment: http://stackoverflow.com/comment/38522134
has comment: http://stackoverflow.com/comment/38522003
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38522178
upvote count: 1
has comment: http://stackoverflow.com/comment/38548933
has body: Have you try db.search('participants', '"d7fa26b3"'). BTW, you are using full text search that is not suppose to do. You have to tokenize your string and index them manually.
has comment: http://stackoverflow.com/comment/38547521
has comment: http://stackoverflow.com/comment/38552289
type: Answer

http://stackoverflow.com/a/24820639
type: Answer
score: 16
upvote count: 16
has comment: http://stackoverflow.com/comment/38531789
accepted answer of: http://stackoverflow.com/q/24820593
has body: Use readonly attribute instead : $('#textBox').prop('readonly', true); Use .attr() instead of .prop() if you're using jQuery &lt; 1.9
answers question: http://stackoverflow.com/q/24820593
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38531752

http://stackoverflow.com/comment/38578956
score: 1
has text: Why the downvote? This is the kind of question new js- and jquery-users look for.
comment on: http://stackoverflow.com/q/24845557
type: QuestionComment
type: Comment

http://stackoverflow.com/a/24820946
has comment: http://stackoverflow.com/comment/38532542
has comment: http://stackoverflow.com/comment/38532142
upvote count: 1
downvote count: 0
has body: take a look at .hasClass() to check if element has a class. you can use it in a if and than addClass if($('.class').hasClass('className')) { $('.class').addClass('xy'); //or $('.class').removeClass('className'); //and so on //.class could be #id as well }
has comment: http://stackoverflow.com/comment/38532282
has comment: http://stackoverflow.com/comment/38531967
type: Answer
has comment: http://stackoverflow.com/comment/38532114
has comment: http://stackoverflow.com/comment/38532228
answers question: http://stackoverflow.com/q/24820891
score: 1

http://stackoverflow.com/q/24886457
tagged with: javascript
has comment: http://stackoverflow.com/comment/38655989
possible better answer: http://stackoverflow.com/a/24893532
has comment: http://stackoverflow.com/comment/38657199
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/24891539
favorite count: 0
has title: getElementsByTagName how to get xml data
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24906750
accepted answer: http://stackoverflow.com/a/24906750
tagged with: http://stackoverflow.com/tag/xml
type: AnsweredQuestion
has body: I'm using this scipt to make a browser compatible xml reader. However I never used one of these badboys, and I have no idea how can I get the data from the object tag below. I need to print it int this part: document.write(x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue); But here is the full code (with the object xml tag. *somedate* *somename* *someip*
downvote count: 0
score: 1
type: Question
has answer: http://stackoverflow.com/a/24893532

http://stackoverflow.com/comment/38698103
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24908716
has text: the answer is based on your question's contents!

http://stackoverflow.com/comment/38710257
has text: Ever get a chance to try this out?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24811951
type: Comment

http://stackoverflow.com/q/24800528
has comment: http://stackoverflow.com/comment/38493864
accepted answer: http://stackoverflow.com/a/24800762
score: 0
answer count: 1
tagged with: facebook-javascript-sdk
tagged with: facebook-graph-api
tagged with: facebook
has comment: http://stackoverflow.com/comment/38493705
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24800762
has title: Display message when JavaScript function works
type: Question
has body: I want to display a message when this function works : function testAPI() { FB.login(function(){ FB.api('/me/feed', 'post', {message: 'Hello World'}); }, {scope: 'publish_actions'}); My attempt was this and it didn't work : function testAPI() { FB.login(function(response){ FB.api('/me/feed', 'post', {message: 'Hello World'}); }, {scope: 'publish_actions'},{complete(response);}); } I'm getting this error : Uncaught SyntaxError: Unexpected token var How can I make this work? Thanks.
tagged with: javascript
has comment: http://stackoverflow.com/comment/38494221
has comment: http://stackoverflow.com/comment/38493745

http://stackoverflow.com/a/24826152
accepted answer of: http://stackoverflow.com/q/24825563
score: 3
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38542001
upvote count: 3
type: Answer
has body: Store your link inside the function instead of the href attribute: Click Change JS to this: function url2div(url, element) { var iframe = document.createElement('iframe'); iframe.setAttribute('src', url); element.appendChild(iframe); } JSFiddle Demo #1 if you want to open the link in the same iframe, store the link in any other property other than href. Then, use your current function and it should work fine! Click JSFiddle Demo #2
answers question: http://stackoverflow.com/q/24825563
has comment: http://stackoverflow.com/comment/38542387
downvote count: 0

http://stackoverflow.com/a/24851557
type: Answer
has body: In the document.ready function you can trigger the click event like $('input.ShowResellerAccounts').trigger('click');
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/24851538
upvote count: 2

http://stackoverflow.com/comment/38675552
type: Comment
has text: I will rename the column
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/24896408

http://stackoverflow.com/a/24825065
has body: The fastest way I would say is native. var items = ["a","b","c"]; var table = document.createElement('table'); var header = document.createElement('thead'); header.innerHTML = " Your Header "; var body = document.createElement('tbody'); items.forEach(function (item) { var row = document.createElement('tr'); var cell = document.createElement('td'); cell.innerHTML = item; row.appendChild(cell); body.appendChild(row); }); table.appendChild(header); table.appendChild(body); document.getElementById('target').appendChild(table); Edit If you want a quick benchmark of your possibility to join elements from an array into a string you can run this script (maybe better put it inside a big foreach and take out some averages, I left this to you :) ) My results were that forEach is far slower than join but plain for is double fast than join // Prepare array var array = []; for(var i=0;i<10000;i++) { array[i] = "a"; } var string = ""; var timestart = 0; var timeend = 0; // misure join time timestart = window.performance.now(); string = array.join(""); timeend = window.performance.now(); joinTime = timeend-timestart; // misure foreach time string = ""; timestart = window.performance.now(); array.forEach(function (item) { string += item; }); timeend = window.performance.now(); foreachTime = timeend-timestart; // misure for time string = ""; timestart = window.performance.now(); for (i=0; i<array.length; i++) { string += array[i]; } timeend = window.performance.now(); forTime = timeend-timestart; alert("Join time: " + joinTime + "\nForeach time: " + foreachTime + "\nFor time: " + forTime);
upvote count: 2
answers question: http://stackoverflow.com/q/24824823
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/90842486

http://stackoverflow.com/comment/38680802
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24899061
score: 0
has text: No, I'm using the `topClosed` property to stop that. If you create a new instance, the way you wrote it you will bind the click Event again. You could always use a variable scoped outside of the Object for that. It would work like a static variable. I'll show example.

http://stackoverflow.com/comment/38510730
type: AnswerComment
comment on: http://stackoverflow.com/a/24809512
type: Comment
has text: @Siddharth from the quoted text above "Initially it gets called with an empty key representing the object being stringified". `key` is always a string, because objects keys in JS are always strings. So an empty `key` is an emtpy string, or `""`.
score: 1

http://stackoverflow.com/q/24893804
linked to: http://stackoverflow.com/q/11274354
tagged with: php
possible better answer: http://stackoverflow.com/a/24893865
has answer: http://stackoverflow.com/a/24940703
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38670565
has answer: http://stackoverflow.com/a/24893865
has title: Escaping a Javascript Code Block and Function for PHP output
has comment: http://stackoverflow.com/comment/38678494
has comment: http://stackoverflow.com/comment/38671144
type: Question
tagged with: escaping
has comment: http://stackoverflow.com/comment/38670883
has comment: http://stackoverflow.com/comment/38670716
tagged with: echo
has body: I keep getting ILLEGAL STRING or ILLEGAL TOKEN. Any thoughts? I imagine this is an escaping issue, but have not found the correct solution.I am escaping the single quotes as other code is escaped in the same area. I have tried: escaping the special characters like &amp; as well. "Heredoc" and believe this is part of my solution, but still getting the errors. Here is the code: &lt;?php $STRING .=' &lt;script type="application/javascript"&gt; function onPictureChanged() { var href="http://pinterest.com/pin/create/button/?url="\' + encodeURIComponent(location.href.replace(location.hash, "")) + \'"&amp;media="\' + $(\'#fullResImage\').attr(\'src\'); jQuery(\'.pp_social\').append(“&lt;div class=\'pinterest\' &gt;&lt;a href=\'”+ href +”\' class=\'pin-it-button\' count-layout=\'horizontal\' target=\'_blank\'&gt;&lt;img border=\'0\' src=\'http://assets.pinterest.com/images/PinExt.png\' title=\'Pin It\' /&gt;&lt;/a&gt;&lt;/div&gt;”); } &lt;/script&gt;'; echo $STRING;
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24940703
has comment: http://stackoverflow.com/comment/38671020
score: 0
answer count: 2

http://stackoverflow.com/a/24787328
has comment: http://stackoverflow.com/comment/38469252
accepted answer of: http://stackoverflow.com/q/24787242
type: AcceptedAnswer
has body: First of all, that javascript code does not work, this does: var TestObject = { justTest: -2, go: function (justTest) { // is '123' now this.justTest = justTest; }, InnerObject: { innerMethod: function () { // alerts 123. It's ok. alert(TestObject.justTest); $(id).animate({ height: '50px' }, 300, function () { // alerts -2 now! Why? alert(TestObject.justTest); }) } } }; I tested it and it gives me the "123" alert both times..
answers question: http://stackoverflow.com/q/24787242
has comment: http://stackoverflow.com/comment/38469369
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/38469195
has comment: http://stackoverflow.com/comment/38469294
has comment: http://stackoverflow.com/comment/38469210
has comment: http://stackoverflow.com/comment/38469285
upvote count: 1
downvote count: 1

http://stackoverflow.com/q/24908592
tagged with: box
has title: Box upload files using ajax
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/38699947
has comment: http://stackoverflow.com/comment/38697816
has comment: http://stackoverflow.com/comment/38698131
has comment: http://stackoverflow.com/comment/38759015
tagged with: boxapiv2
has comment: http://stackoverflow.com/comment/39152918
answer count: 1
has comment: http://stackoverflow.com/comment/38707147
tagged with: javascript
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/38463365
tagged with: box-api
has body: I try to upload a file using Box.com API from https://gist.github.com/seanrose/5570650. I received the following error: `XMLHttpRequest cannot load "https://upload.box.com/api/2.0/files/content". No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin localhost' is therefore not allowed access." What can I do? How can I upload files to Box.com using AJAX?

http://stackoverflow.com/comment/38673815
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24893794
score: 0
has text: hmmmmm.....I am pulling in a jsonp feed in both of the pages using the google api that I am trying to pull into the divs.....maybe that's the problem....will have to experiment a bit...I did not try just html pages

http://stackoverflow.com/comment/38627070
score: 0
comment on: http://stackoverflow.com/q/24870617
type: Comment
type: QuestionComment
has text: My Transitioning effect not working.when i click `fade out` and `fade in`.it doesn't show transition effect.it's Just like `visible` and `hidden` property

http://stackoverflow.com/a/26831113
has comment: http://stackoverflow.com/comment/110691935
type: Answer
has comment: http://stackoverflow.com/comment/97399487
has comment: http://stackoverflow.com/comment/76896857
upvote count: 68
answers question: http://stackoverflow.com/q/24768795
score: 67
has comment: http://stackoverflow.com/comment/60826575
downvote count: 1
has body: Calculate the amount of px an element (height) is in viewport Fiddle demo This tiny function will return the amount of px an element is visible in the (vertical) Viewport: function inViewport($el) { var elH = $el.outerHeight(), H = $(window).height(), r = $el[0].getBoundingClientRect(), t=r.top, b=r.bottom; return Math.max(0, t>0? Math.min(elH, H-t) : Math.min(b, H)); } Use like: $(window).on("scroll resize", function(){ console.log( inViewport($('#elementID')) ); // n px in viewport }); that's it. jQuery .inViewport() Plugin jsFiddle demo from the above you can extract the logic and create a plugin like this one: /** * inViewport jQuery plugin by Roko C.B. * http://stackoverflow.com/a/26831113/383904 * Returns a callback function with an argument holding * the current amount of px an element is visible in viewport * (The min returned value is 0 (element outside of viewport) */ ;(function($, win) { $.fn.inViewport = function(cb) { return this.each(function(i,el) { function visPx(){ var elH = $(el).outerHeight(), H = $(win).height(), r = el.getBoundingClientRect(), t=r.top, b=r.bottom; return cb.call(el, Math.max(0, t>0? Math.min(elH, H-t) : Math.min(b, H))); } visPx(); $(win).on("resize scroll", visPx); }); }; }(jQuery, window)); Use like: $("selector").inViewport(function(px) { console.log( px ); // `px` represents the amount of visible height if(px > 0) { // do this if element enters the viewport // px > 0 }else{ // do that if element exits the viewport // px = 0 } }); // Here you can chain other jQuery methods to your selector your selectors will dynamically listen to window scroll and resize but also return the initial value on DOM ready trough the first callback function argument px.
has comment: http://stackoverflow.com/comment/60825766
has comment: http://stackoverflow.com/comment/77005790
has comment: http://stackoverflow.com/comment/60825817
has comment: http://stackoverflow.com/comment/76901382
has comment: http://stackoverflow.com/comment/87503937
has comment: http://stackoverflow.com/comment/97402120

http://stackoverflow.com/q/24856089
has comment: http://stackoverflow.com/comment/38599167
has comment: http://stackoverflow.com/comment/39066281
has comment: http://stackoverflow.com/comment/38599192
has comment: http://stackoverflow.com/comment/38599119
has comment: http://stackoverflow.com/comment/38599110
has body: I have a page that I set the script-src of the content security policy like this: script-src 'self' *.uservoice.com *.intuit.com ajax.googleapis.com localhost:* When I load the page with a hard-coded inline script I have created myself to test, it is blocked like expected: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' *.uservoice.com *.intuit.com ajax.googleapis.com localhost:* ". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution. However, when I insert a new script tag dynamically, the script isn't blocked, for example, this still executes: $("body").append(" ") I am using Chrome as the browser here for testing. I was hoping that this script would be blocked as well, since that would really help to prevent xss. Is there something I can change to block this type of script injection as well?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25171378
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/38599265
has title: Why isn't this inline javascript blocked by content security policy?
linked to: http://stackoverflow.com/q/21428259
has comment: http://stackoverflow.com/comment/38609744
type: Question
score: 8
tagged with: content-security-policy
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: xss
has comment: http://stackoverflow.com/comment/39304849
upvote count: 8

http://stackoverflow.com/a/24773510
upvote count: 1
answers question: http://stackoverflow.com/q/24753191
downvote count: 0
has body: With JQuery, use the scrollLeft() property of the document! This would work $(window).scroll(function(event) { $(id).css("margin-left", 400-$(document).scrollLeft()); }); See also http://jsfiddle.net/zhQkq/9/
type: Answer
score: 1

http://stackoverflow.com/comment/38499940
score: 0
has text: @RafaelFonseca google for `_GET` method: `test.html?paramName=paramVal&paramName2=paramVal2`
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24803124

asp.net
tags question: http://stackoverflow.com/q/24865961
tags question: http://stackoverflow.com/q/24857950
tags question: http://stackoverflow.com/q/24803128
tags question: http://stackoverflow.com/q/24902139
tags question: http://stackoverflow.com/q/24873722
tags question: http://stackoverflow.com/q/24752984
tags question: http://stackoverflow.com/q/24881115
tags question: http://stackoverflow.com/q/24864745
tags question: http://stackoverflow.com/q/24833371
tags question: http://stackoverflow.com/q/24789663
tags question: http://stackoverflow.com/q/24859396
tags question: http://stackoverflow.com/q/24804657
tags question: http://stackoverflow.com/q/24817055
tags question: http://stackoverflow.com/q/24754892
tags question: http://stackoverflow.com/q/24834063
tags question: http://stackoverflow.com/q/24767517
tags question: http://stackoverflow.com/q/24881840
tags question: http://stackoverflow.com/q/24858947
tags question: http://stackoverflow.com/q/24797758
tags question: http://stackoverflow.com/q/24776126
tags question: http://stackoverflow.com/q/24870799
tags question: http://stackoverflow.com/q/24864156
tags question: http://stackoverflow.com/q/24782896
tags question: http://stackoverflow.com/q/24842036
tags question: http://stackoverflow.com/q/24770212
tags question: http://stackoverflow.com/q/24763234
tags question: http://stackoverflow.com/q/24877781
tags question: http://stackoverflow.com/q/24759354
tags question: http://stackoverflow.com/q/24779249
tags question: http://stackoverflow.com/q/24858697
tags question: http://stackoverflow.com/q/24853282
tags question: http://stackoverflow.com/q/24755170
tags question: http://stackoverflow.com/q/24821649
tags question: http://stackoverflow.com/q/24866549
tags question: http://stackoverflow.com/q/24780855
tags question: http://stackoverflow.com/q/24862472
tags question: http://stackoverflow.com/q/24880844
tags question: http://stackoverflow.com/q/24853957
tags question: http://stackoverflow.com/q/24840577
tags question: http://stackoverflow.com/q/24796526
tags question: http://stackoverflow.com/q/24863795
tags question: http://stackoverflow.com/q/24891303
tags question: http://stackoverflow.com/q/24773350
tags question: http://stackoverflow.com/q/24782456
tags question: http://stackoverflow.com/q/24775273
tags question: http://stackoverflow.com/q/24860090
tags question: http://stackoverflow.com/q/24783067
tags question: http://stackoverflow.com/q/24887173
tags question: http://stackoverflow.com/q/24884171
tags question: http://stackoverflow.com/q/24822145
tags question: http://stackoverflow.com/q/24803094
tags question: http://stackoverflow.com/q/24859490
tags question: http://stackoverflow.com/q/24753321
tags question: http://stackoverflow.com/q/24884319
tags question: http://stackoverflow.com/q/24811207
tags question: http://stackoverflow.com/q/24902870
type: Tag
tags question: http://stackoverflow.com/q/24853038
tags question: http://stackoverflow.com/q/24819099
tags question: http://stackoverflow.com/q/24761163
tags question: http://stackoverflow.com/q/24758733
tags question: http://stackoverflow.com/q/24780915
tags question: http://stackoverflow.com/q/24786746
tags question: http://stackoverflow.com/q/24788121
tags question: http://stackoverflow.com/q/24774887
tags question: http://stackoverflow.com/q/24770422
tags question: http://stackoverflow.com/q/24799188
tags question: http://stackoverflow.com/q/24887271
tags question: http://stackoverflow.com/q/24902542
tags question: http://stackoverflow.com/q/24850356
tags question: http://stackoverflow.com/q/24875598
tags question: http://stackoverflow.com/q/24795385
tags question: http://stackoverflow.com/q/24791099
tags question: http://stackoverflow.com/q/24856178
tags question: http://stackoverflow.com/q/24898341
tags question: http://stackoverflow.com/q/24760338
tags question: http://stackoverflow.com/q/24781414
tags question: http://stackoverflow.com/q/24776033
tags question: http://stackoverflow.com/q/24797445
tags question: http://stackoverflow.com/q/24789869

http://stackoverflow.com/comment/38617628
comment on: http://stackoverflow.com/q/24863372
score: 0
has text: @Dr.Molle, the behaviour is inconsistent. Either both of them should scroll or not.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24874886
answers question: http://stackoverflow.com/q/24874797
type: Answer
upvote count: 4
downvote count: 0
score: 4
has body: var array = $.map($('[title][title!=""]'), function(el) { return el.title }); FIDDLE Selects all elements that has a title attribute that is not empty, and maps the titles to an array
accepted answer of: http://stackoverflow.com/q/24874797
type: AcceptedAnswer

http://stackoverflow.com/comment/38837830
comment on: http://stackoverflow.com/q/24858270
has text: @yoah It has the same effect even if I set a value directly, `pixels[index] = 120`. Are you saying that when you visit the fiddle on your android, that it is not surrounded by a tinted red background?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38466108
comment on: http://stackoverflow.com/q/24782416
score: 0
type: Comment
type: QuestionComment
has text: can you check by putting an alert or a console.log call **after** the assignment `var dtStartTime = new Date(strStartTime);` e.g `alert(dtStartTime)` to check whether the date is correct. Also in the error callback can you add a parameter to check what is the error code. The error callback is passed the object `GlobalizationError` as a parameter type.

http://stackoverflow.com/comment/38608616
has text: Might be helpful: http://stackoverflow.com/questions/17447373/how-can-i-target-only-internet-explorer-11-with-javascript
score: 1
comment on: http://stackoverflow.com/q/24861073
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38634545
comment on: http://stackoverflow.com/a/24870814
score: 0
has text: @Joseph Silber gotcha, makes sense now.
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/38646470
type: Comment
has text: Note, that transitions came in CSS3.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/24880675

http://stackoverflow.com/comment/38651830
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24878802
has text: My ember version is 1.6.0... So.. not the same problem as http://stackoverflow.com/questions/22429099/query-params-not-updating-in-controller

http://stackoverflow.com/comment/38678291
score: 0
type: QuestionComment
type: Comment
has text: So you want to execute render() of controller for every single route Marionette matches, right?
comment on: http://stackoverflow.com/q/24780212

http://stackoverflow.com/a/24823828
upvote count: 1
has body: Even I am new to android but what I think that there is problem in URI To open up a Uri in android it should have a structure like file:///storage/.... (there should be 3 backslashes ) You can get more details here The best place to save a pdf can be your sdcard or internal storage. Then the pdf will be available in your device even after the application closes. If you wish to have the same pdf file, available in different devices while testing your application in different device/ or even in emulator you can save it in the assert folder of your android project. hope this helps
downvote count: 0
answers question: http://stackoverflow.com/q/24790566
type: Answer
score: 1

http://stackoverflow.com/comment/38457141
type: AnswerComment
comment on: http://stackoverflow.com/a/24779399
type: Comment
has text: I know it will, but the variable "targetID" should'nt change
score: 0

http://stackoverflow.com/comment/38558002
score: 0
comment on: http://stackoverflow.com/a/24834429
type: Comment
has text: I don't understand how I can use that function to get the specific id of say banner_heading?
type: AnswerComment

http://stackoverflow.com/a/24872241
answers question: http://stackoverflow.com/q/24872205
has body: Use Javascript cookies for this: Click the W3Schools reference will help you http://www.w3schools.com/js/js_cookies.asp
score: 0
type: Answer

http://stackoverflow.com/a/24871030
answers question: http://stackoverflow.com/q/24870925
type: Answer
score: 3
upvote count: 3
downvote count: 0
has body: In the normal course of things, that's fine, because you're using a function declaration. This works, for instance: foo(); function foo() { console.log("Hi there"); } Function declarations are processed upon entry to the scope, before any step-by-step code is executed, as long as they're in the same code compilation unit (on browsers, that's a script element). So if it's not working, that tells us that the function is declared in a different scope than the code in which it's called, or in a different code compilation unit. This fails, for instance: foo(); $(document).ready(function() { function foo() { console.log("Hi there"); } }); ...because foo is contained within the function we're giving to ready, so it doesn't exist outside of it, and we can't call it. Similarly, this fails: &lt;script&gt; foo(); &lt;/script&gt; &lt;script&gt; function foo() { console.log("Hi there"); } &lt;/script&gt; ...because the declaration is in a code compilation unit after the one where we tried to use it, so it doesn't exist yet when we try to use it. So you'll want to look at where your function is declared, and where you're using it, and make sure you're only using it from a place that can actually see it.

http://stackoverflow.com/a/24871832
upvote count: 3
score: 3
has body: You can do it like this: var data_arr='Time', 'Dollar', 'BTC'; var hour=-24; var dollar = [2000,3000,4000]; var btc = [100,200,300]; for(var index=0;index&lt;dollar.length;index++){ data_arr.push([hour+'h', dollar[index], btc[index]]); hour++; } var data = new google.visualization.arrayToDataTable(data_arr);
accepted answer of: http://stackoverflow.com/q/24870637
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24870637
type: Answer

http://stackoverflow.com/comment/38537780
comment on: http://stackoverflow.com/a/24806900
type: Comment
type: AnswerComment
has text: if your javascript code is correct, following the steps above should work.
score: 0

http://stackoverflow.com/q/24888349
type: Question
score: 1
tagged with: extjs4.2
has comment: http://stackoverflow.com/comment/38668618
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/24940598
has title: Passing additional parameters to callback function in Extjs 4.2.0
has body: I have a handler funciton attached to a button which makes an ajax call and acts based on success and failure. on success, it calls another function with default response parameter. How can we pass an additional parameter along with the server response json object. Below is the code example. buttonClick: function(button,e,eOpts){ makeAjaxCall( null, url, { scope:this, fn: this.onSubmit// want to pass additional custom parameter to this function. } ) } // function d onSubmit: function(response) { var object = Ext.JSON.decode(response.responseText) } based upon the additional parameter i will decide the functionality, as this function onSubmit() is called by two different button clicks.Please help
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
favorite count: 0

http://stackoverflow.com/a/56967436
has comment: http://stackoverflow.com/comment/117112845
has comment: http://stackoverflow.com/comment/117108360
type: Answer
upvote count: 6
score: 5
has comment: http://stackoverflow.com/comment/117108050
downvote count: 1
answers question: http://stackoverflow.com/q/24775725
has body: Couldn't resist to add another method, using childElementCount. It returns the number of child element nodes from a given parent, so you can loop over it. for(var i=0, len = parent.childElementCount ; i &lt; len; ++i){ ... do something with parent.children[i] }

http://stackoverflow.com/q/24798216
favorite count: 0
possible better answer: http://stackoverflow.com/a/24798312
has answer: http://stackoverflow.com/a/24798312
has answer: http://stackoverflow.com/a/24798461
answer count: 4
type: AnsweredQuestion
has title: Hide cells depending on select value - generated HTML
score: 1
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/24798461
tagged with: javascript
tagged with: jquery
has body: I have a problem writing a function to hide two cells depending on the selected value. The biggest problem is that the HTML is generated and there can be one such select or eight of them. And to make things more interesting, every one of this select is placed in a separate div and while one is shown, others are hidden. Here is the function I use to toggle cells. Cells can be shown only if selected value is 'Z', otherwise they must be hidden. It works only on the first select while other are completely ignored. I was trying to use .each() function for every element with id="selector" but there was quite a mass with element indexes and it didn't work either. $("#selector").change(function(){ if($(this).val().trim() == 'Z'){ $("#labelToHide").toggle(true); $("#selectToHide").toggle(true); } else { $("#labelToHide").toggle(false); $("#selectToHide").toggle(false); } }); Here is the working JSFiddle. It might look incomplete, but it is enough to simulate real situation. Bellow is the XML code I work with from which the HTML is generated. &lt;xh:td class="RightColumn" id="selectToHide"&gt; &lt;form:selectOne ...&gt; &lt;!-- form code --&gt; &lt;/form:selectOne&gt; &lt;/xh:td&gt; Is there some way I can make this script work only for currently shown div? Or is there some other workaround?
has answer: http://stackoverflow.com/a/24798931
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24798375
downvote count: 0
has comment: http://stackoverflow.com/comment/38489952
has comment: http://stackoverflow.com/comment/38489567

http://stackoverflow.com/q/24801130
type: Question
has body: I'm trying to post to a page on facebook using the facebook API. But I want to customize the post target. When I post to a page on facebook I get these results : You get Shared with : (languages...) and News feed targeting : (languages...) But when I post to a page on my custom website using the facebook api I get these results : I only get the News feed targeting and not the shared with... Does anybody knows what to use to get the Shared with options using the facebook API? To get the News feed targeting I'm using : var feed_targeting = { 'locales': ["1001", "1", "2", "4", "9"], }; But I want to know what to use for the Shared with option.... Thanks
accepted answer: http://stackoverflow.com/a/25787472
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Add targeting when posting to a page using Facebook API
answer count: 1
tagged with: facebook-graph-api
tagged with: facebook
upvote count: 1
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/25787472

http://stackoverflow.com/comment/38534992
comment on: http://stackoverflow.com/q/24822280
has text: @jQueryAngryBird: Maybe he has no influence on the content of the remote site, if he has, json would definitly be a better approach.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24906043
answers question: http://stackoverflow.com/q/24905908
has body: You can add event listeners to DOM elements you add manually, but you either have to add the event listeners AFTER you've created the DOM elements or you have to switch to using delegated event handling on a parent object or change the timing of when you add the event listeners in your current loop until all your dynamic links are already created. In this case, I'd suggest that you just add the event handler right when you create the new links. function linkClick() { chrome.tabs.create({url: this.href}); } window.addEventListener('DOMContentLoaded', function() { var urls= document.querySelectorAll('a.url'); for(i=0,len=urls.length;i&lt;len; i++) { urls[i].addEventListener('click', linkClick, false); // &lt;== change this } }, false); chrome.storage.local.get(['bookmarks'], function(data) { var jsonString = JSON.stringify(data); var resultObject = JSON.parse(jsonString); //var body = document.body; for(var i in resultObject.bookmarks) { var bookmark = resultObject.bookmarks[i]; var div = document.createElement('div'); var a = document.createElement('a'); var body = document.body; body.appendChild(div); div.appendChild(a); a.setAttribute('class', 'url'); a.setAttribute('href', bookmark.url); a.innerHTML = bookmark.title; a.addEventListener('click', linkClick, false); // &lt;== add this } });
score: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24905908
has comment: http://stackoverflow.com/comment/38697682

http://stackoverflow.com/comment/38516477
type: Comment
comment on: http://stackoverflow.com/a/24812547
has text: I need to keep it as a class. How do I do this with a class??
score: 0
type: AnswerComment

http://stackoverflow.com/a/24807496
answers question: http://stackoverflow.com/q/24795432
upvote count: 5
has body: The tooltip position is set inline, so you need to listen for DOM insertion of the tooltip and change the position manually. Mutation events are deprecated, so use a MutationObserver if it is available (Chrome, Firefox, IE11) and a DOMNodeInserted event handler if not (IE 9, 10). This will not work in IE8. google.visualization.events.addOneTimeListener(myChart, 'ready', function () { var container = document.querySelector('#myChartDiv &gt; div:last-child'); function setPosition () { var tooltip = container.querySelector('div.google-visualization-tooltip'); tooltip.style.top = 0; tooltip.style.left = 0; } if (typeof MutationObserver === 'function') { var observer = new MutationObserver(function (m) { for (var i = 0; i &lt; m.length; i++) { if (m[i].addedNodes.length) { setPosition(); break; // once we find the added node, we shouldn't need to look any further } } }); observer.observe(container, { childList: true }); } else if (document.addEventListener) { container.addEventListener('DOMNodeInserted', setPosition); } else { container.attachEvent('onDOMNodeInserted', setPosition); } }); The MutationObserver should be fine, but the events may need some work; I didn't test them.
score: 5
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/65999631
type: Answer
has comment: http://stackoverflow.com/comment/38785891
accepted answer of: http://stackoverflow.com/q/24795432
has comment: http://stackoverflow.com/comment/38961839

http://stackoverflow.com/a/24845752
answers question: http://stackoverflow.com/q/24845557
has body: I guess the question how to disable form submit when 'enter' key is pressed. Well, listen for the 'keypress' event, if the keyCode is === 13 prevent the default behavior of the event and stop it from being propagated. Please refer this fiddle Markup: Vanilla JavaScript: var form = document.querySelector('#form'); form.addEventListener('submit', function(e){ e.preventDefault(); e.stopPropagation(); alert('Submit event'); }); var noSubmitOnReturns = document.querySelectorAll('.no-submit-on-return'); [].slice.call(noSubmitOnReturns).forEach(function(noSubmitOnReturn){ noSubmitOnReturn.addEventListener('keypress', function(e){ e.preventDefault(); e.stopPropagation(); alert('Keypress event'); }); }); It is better to keep the default behavior as is for the sake of accessibility. However, should be required for some elements, please disable the 'enter' key only for those elements. But not on the form submit. User can 'tab' to the 'submit' button and press the 'enter' key. At that time, 'enter' key press needs to be honored.
score: 0
type: Answer

http://stackoverflow.com/a/24787844
accepted answer of: http://stackoverflow.com/q/24786359
has comment: http://stackoverflow.com/comment/38475180
has body: Your dates are not input correctly; the format is 'Date(year, month, day, hours, minutes, seconds)'. You need to replace "travel_time_date" with "Date": $results['rows'][] = array('c' =&gt; array( array('v' =&gt; "Date($year, $month, $day, $hour, $minute, $second)"), array('v' =&gt; $row['travel_time_duration']) ));
has comment: http://stackoverflow.com/comment/38473202
has comment: http://stackoverflow.com/comment/38470809
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/38474380
score: 1
has comment: http://stackoverflow.com/comment/38508233
has comment: http://stackoverflow.com/comment/38476498
has comment: http://stackoverflow.com/comment/38470397
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38476532
answers question: http://stackoverflow.com/q/24786359
has comment: http://stackoverflow.com/comment/38478599
has comment: http://stackoverflow.com/comment/38470678

http://stackoverflow.com/a/24844221
answers question: http://stackoverflow.com/q/24844164
has body: This is straight from the documents: $('#InfoModalColor2').modal('show'); Just place that in a ready handler
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/24844164

http://stackoverflow.com/comment/38470996
comment on: http://stackoverflow.com/q/24788211
score: 1
has text: It's a bit unclear to me what exactly are you trying to achieve? Could you please explain more?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38665645
score: 0
type: Comment
type: QuestionComment
has text: Viewmodel test are much more stable than full Dom tests so nothing wrong with that . To test the Foo function, just execute and assert it? Use qunit or jasmine etc
comment on: http://stackoverflow.com/q/24887686

http://stackoverflow.com/comment/38436073
has text: You should use the HTML `style` attribute as little as possible. Use CSS instead for style.
comment on: http://stackoverflow.com/a/24769867
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/q/24849688
favorite count: 0
has answer: http://stackoverflow.com/a/24870871
tagged with: http://stackoverflow.com/tag/svg
type: UnansweredQuestion
tagged with: gradient
upvote count: 1
type: Question
has title: How to rotate gradient using SVG.js?
has body: How to rotate gradient using SVG.js? I tried var gradient = draw.gradient('linear', function(stop) { stop.at(0, '#f2b181') stop.at(1, '#de6d1e') }).rotate(45); but with no effect.
downvote count: 0
answer count: 1
tagged with: javascript
score: 1

http://stackoverflow.com/comment/38526073
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24817651
score: 0
has text: first you can check what value holds by selected variable using alert()

http://stackoverflow.com/q/24779231
has title: Use Enter to tab to next div, not input?
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24779461
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/38453195
tagged with: css
has body: Got a funky one i cant quite solve. I am using Divs that are contenteditable to receive info from the customer, Tabbing through works fine but it would be even speedier if i could simply hit Enter to tab to the next div and im not sure how to achieve this. I Created this fiddle here: http://jsfiddle.net/zkDfm/ Owner Details Mr: Mrs: Email: Mobile No: Phone No: Address:
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24779461
linked to: http://stackoverflow.com/q/8546252
type: Question
duplicate of: http://stackoverflow.com/q/8546252

http://stackoverflow.com/comment/38568915
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24840441
has text: @JuanMendes I was just stating to avoid "try it or gtfo", but as I had searched around and couldn't find what I was looking for (as you can see I was not too good at explaining it, at least not with the title) I didn't know how I would try something out before asking, or alike.
score: 0

angularjs
tags question: http://stackoverflow.com/q/24875290
tags question: http://stackoverflow.com/q/24877015
tags question: http://stackoverflow.com/q/24878200
tags question: http://stackoverflow.com/q/24875182
tags question: http://stackoverflow.com/q/24810121
tags question: http://stackoverflow.com/q/24789152
tags question: http://stackoverflow.com/q/24786471
tags question: http://stackoverflow.com/q/24874921
tags question: http://stackoverflow.com/q/24790050
tags question: http://stackoverflow.com/q/24789119
tags question: http://stackoverflow.com/q/24820505
tags question: http://stackoverflow.com/q/24882735
tags question: http://stackoverflow.com/q/24769922
tags question: http://stackoverflow.com/q/24832054
tags question: http://stackoverflow.com/q/24831630
tags question: http://stackoverflow.com/q/24815131
tags question: http://stackoverflow.com/q/24897168
tags question: http://stackoverflow.com/q/24898278
tags question: http://stackoverflow.com/q/24771593
tags question: http://stackoverflow.com/q/24856143
tags question: http://stackoverflow.com/q/24809241
tags question: http://stackoverflow.com/q/24765722
tags question: http://stackoverflow.com/q/24809807
tags question: http://stackoverflow.com/q/24785388
tags question: http://stackoverflow.com/q/24813976
tags question: http://stackoverflow.com/q/24808913
tags question: http://stackoverflow.com/q/24800399
tags question: http://stackoverflow.com/q/24868951
tags question: http://stackoverflow.com/q/24828649
tags question: http://stackoverflow.com/q/24856544
tags question: http://stackoverflow.com/q/24833900
tags question: http://stackoverflow.com/q/24818520
tags question: http://stackoverflow.com/q/24861522
tags question: http://stackoverflow.com/q/24886461
tags question: http://stackoverflow.com/q/24760214
tags question: http://stackoverflow.com/q/24811958
tags question: http://stackoverflow.com/q/24864956
tags question: http://stackoverflow.com/q/24903451
tags question: http://stackoverflow.com/q/24788171
tags question: http://stackoverflow.com/q/24822693
tags question: http://stackoverflow.com/q/24805558
tags question: http://stackoverflow.com/q/24819100
tags question: http://stackoverflow.com/q/24838745
tags question: http://stackoverflow.com/q/24775877
tags question: http://stackoverflow.com/q/24785271
tags question: http://stackoverflow.com/q/24809835
tags question: http://stackoverflow.com/q/24863173
tags question: http://stackoverflow.com/q/24841490
tags question: http://stackoverflow.com/q/24799948
tags question: http://stackoverflow.com/q/24804216
tags question: http://stackoverflow.com/q/24768977
tags question: http://stackoverflow.com/q/24857038
tags question: http://stackoverflow.com/q/24806361
tags question: http://stackoverflow.com/q/24755188
tags question: http://stackoverflow.com/q/24853493
tags question: http://stackoverflow.com/q/24773307
tags question: http://stackoverflow.com/q/24791142
tags question: http://stackoverflow.com/q/24826835
tags question: http://stackoverflow.com/q/24821632
tags question: http://stackoverflow.com/q/24858899
tags question: http://stackoverflow.com/q/24872040
tags question: http://stackoverflow.com/q/24765788
tags question: http://stackoverflow.com/q/24872987
tags question: http://stackoverflow.com/q/24881345
tags question: http://stackoverflow.com/q/24786956
tags question: http://stackoverflow.com/q/24851889
tags question: http://stackoverflow.com/q/24895908
tags question: http://stackoverflow.com/q/24775724
tags question: http://stackoverflow.com/q/24777033
tags question: http://stackoverflow.com/q/24813316
tags question: http://stackoverflow.com/q/24771696
tags question: http://stackoverflow.com/q/24833955
tags question: http://stackoverflow.com/q/24861424
tags question: http://stackoverflow.com/q/24763738
tags question: http://stackoverflow.com/q/24817284
tags question: http://stackoverflow.com/q/24763626
type: Tag
tags question: http://stackoverflow.com/q/24900727
tags question: http://stackoverflow.com/q/24780192
tags question: http://stackoverflow.com/q/24798549

http://stackoverflow.com/comment/38525596
type: Comment
has text: Why the loops instead of `document.body.innerHTML = document.body.innerHTML.replace(/\shello\s/g, 'hi').replace(/\sHello\s/g, 'Hi');` ?
score: 3
comment on: http://stackoverflow.com/a/24817334
type: AnswerComment

http://stackoverflow.com/comment/38535722
type: AnswerComment
has text: No this is not working for me still.I checked in console and found out the same htmlString value. :P
type: Comment
score: 0
comment on: http://stackoverflow.com/a/24822755

http://stackoverflow.com/a/24808349
answers question: http://stackoverflow.com/q/24781091
has comment: http://stackoverflow.com/comment/38530956
has body: WHITESPACE_ONLY and PRETTY_PRINT get pretty close, but there isn't a "concat" only mode. The compiler does have the capability to create "output bundles" but it isn't exposed on the command-line: https://github.com/google/closure-compiler/blob/52ae79693589834930cbfc01fe78f4efa8f6c518/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L1966
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24781091
has comment: http://stackoverflow.com/comment/38545475
has comment: http://stackoverflow.com/comment/39781597
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/39763443

http://stackoverflow.com/comment/38502235
comment on: http://stackoverflow.com/a/24802469
has text: Thanks pressed on the link but it doesn't quite work the same as my code. In mine I can click inside the searchbar and type soemthing. However, it doesn't matter 90% there. There is one thing however, how do I use the selected_value variable and use it in a standard js function? what I want to do is execute a normal js function when dropdown menu changes? Many thanks.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38475243
type: Comment
comment on: http://stackoverflow.com/a/24787658
score: 1
has text: @LaurensKling: `JST` should be the pre-compiled version of the templates, they could be Underscore or Handlebars or ... You can pass whole models to the template but cloning the data by calling `toJSON` is a recommended best practice to help keep your templates from accidentally changing your data.
type: AnswerComment

http://stackoverflow.com/a/24862616
accepted answer of: http://stackoverflow.com/q/24859431
answers question: http://stackoverflow.com/q/24859431
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38642173
has body: As far as I can get from your question that you need to limit the number of files while uploading multiple files, you can validate that on client side using a small javascript. All you need is just to access the length property of the input box for uploading the images. HTML: &lt;form method="POST"&gt; &lt;input id="fileupload" class="image" type="file" name="files[]" multiple="" /&gt; &lt;div class="validation" style="display:none;"&gt; Upload Max 4 Files allowed &lt;/div&gt; &lt;/form&gt; Javascript: $('#fileupload').change(function(){ //get the input and the file list var input = document.getElementById('fileupload'); if(input.files.length&gt;4){ $('.validation').css('display','block'); }else{ $('.validation').css('display','none'); } }); Demo Your other file name extension validation for letting only image files in upload remains the same.
upvote count: 1
has comment: http://stackoverflow.com/comment/38615811
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/38611620
score: 1

http://stackoverflow.com/q/24765828
linked to: http://stackoverflow.com/q/9597052
score: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38428753
has title: Send with $post parameter in Angulars.js
tagged with: http
has body: I try to send a handsontable table data using $http POST with Angulars.js The code below: var $container = $("div#table"); var handsontable = $container.data('handsontable'); $scope.saveData = function() { $http.post('save.php', {'data':handsontable.getData()}).success(function(res,status) { if (res.result === 'ok') { console.log('Data saved'); } else { console.log('Save error'); } }); } But I get a 'Save error' with Undefined index: data in &lt;b&gt;C:\xampp\htdocs\angular\save.php I the development tool in Chrome I get Request payload of this form: {"data":[[fdf,gsgg,gsg,null,null,null],[sgsg,sgg,sgg,ggs,null,null]]} I changed parameters in $http.post to get it work but no solution, Thank you to give some advices!!!
tagged with: post
has answer: http://stackoverflow.com/a/24766532
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/24889134
downvote count: 0
has comment: http://stackoverflow.com/comment/38661617
has body: create an Hyperlink like Submit Bind onclick event like this $("#submitForm").click(function(e){ e.preventDefault(); // store url in a variable var url=$(this).data("href"); // create a callback in update() function which will be called when ajax request completes update(function(){ // now redirect the user window.location = url; }); }); Add a callback in your function like this function update(callback) { $.ajax({ type: "POST", url: "classes/fact-find-data.class.php", data: $("#pay-form").serialize(), beforeSend: function () { $('#dvloader').show(); }, success: function (html) { ............................... in the end callback(); } }); }
answers question: http://stackoverflow.com/q/24888850
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/38661564

http://stackoverflow.com/a/24852870
answers question: http://stackoverflow.com/q/24852784
score: 0
has comment: http://stackoverflow.com/comment/38592561
has comment: http://stackoverflow.com/comment/38592477
has body: You should return an empty array or null so that you can identify an error with your database module.exports.getWaitingOrders = function getWaitingOrders(callback) { pool.query("SELECT * FROM live_order_table WHERE isWaiting = 1;", function(err, rows, fields) { if (err) { return new Error('Db error: ' + err) ; } if (rows.length &lt;= 0) { callback(err , []); // you should return an empty response here so that you can differentiate between error and no order } rows.forEach(function(row) { var order = { orderID: row.order_id } }); } } orderDb.getWaitingOrders(function handleWaitingOrders(err, orders){ // do your error handling here });
type: Answer

http://stackoverflow.com/q/24792562
has comment: http://stackoverflow.com/comment/38479394
type: Question
tagged with: ecmascript-5
tagged with: javascript
tagged with: prototype
score: 0
has body: Environment: - Chrome console I understand: Boolean.prototype; // Boolean {} Number.prototype; // Number {} I can't understand: Error.prototype; // d {name: "Error", message: ""} Question: Error` is different, why? Specification? meaning of the d?
has title: Why is Error.prototype a d {name: "Error", message: ""}, when Boolean.prototype is a Boolean {}?
answer count: 1
has comment: http://stackoverflow.com/comment/38479558
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38479441
has answer: http://stackoverflow.com/a/24792825

http://stackoverflow.com/a/24809113
accepted answer of: http://stackoverflow.com/q/24808826
score: 3
answers question: http://stackoverflow.com/q/24808826
downvote count: 0
has comment: http://stackoverflow.com/comment/38509902
type: AcceptedAnswer
upvote count: 3
has comment: http://stackoverflow.com/comment/38510044
has body: You may need to increase the maximum amount of files you can have open. Try running ulimit -n 1024.
type: Answer
has comment: http://stackoverflow.com/comment/38510091

http://stackoverflow.com/a/24840978
type: AcceptedAnswer
upvote count: 2
has comment: http://stackoverflow.com/comment/38569674
type: Answer
has body: You should put the event binding $("menu").mouseleave() outside. Demo: http://jsfiddle.net/7Uc72/
score: 2
accepted answer of: http://stackoverflow.com/q/24840936
answers question: http://stackoverflow.com/q/24840936
downvote count: 0

http://stackoverflow.com/q/24758442
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24760917
has body: I have a SVG sprite with looks like the following schema: Image Image Image Image Image Image Image Image Image Where Image is an image and all nine images are the sprite. They are all on one layer. There is a tutorial for sprites with PNG files here but I could not find how to make SVG files work. How do I set the coordinates for the frames when I use an SVG sprite? How do I use an SVG sprite? Edit: Here is the code for the tutorial.
type: Question
tagged with: canvas
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: KineticJS: How can I use an SVG Sprite with KineticJS Sprites?
tagged with: kineticjs

http://stackoverflow.com/q/24856789
has title: Input field with dropdown Hints
answer count: 1
downvote count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/24856933
type: AnsweredQuestion
has body: Hi I want to create an html input field with a hints menu. The effect should be like the image below. After clicking on the input field, the dropdown menu appears. I wonder whether there are any plug-in or code example doing something similar? Thank yoU!
score: 1
tagged with: jquery
favorite count: 0
tagged with: web-deployment
type: Question
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/24856933
tagged with: frontend
upvote count: 2

http://stackoverflow.com/comment/38650565
score: 0
type: Comment
type: QuestionComment
has text: Ha just looked at your link it's not the jQuery date picker anyway bit's DatePicker v4.4 by frequency-decoder.com
comment on: http://stackoverflow.com/q/24883139

http://stackoverflow.com/q/24902507
has answer: http://stackoverflow.com/a/24902521
has answer: http://stackoverflow.com/a/24903091
downvote count: 0
has comment: http://stackoverflow.com/comment/38686954
tagged with: jquery
has comment: http://stackoverflow.com/comment/38686960
favorite count: 0
has body: I have a ul which is list, I would like to get the selected value in different function and the list looks like below Select Destination HSR Bommanahalli Kormangala by applying some CSS,JS I am able to get selected value of list like this... $(".dropdown-menu li a").click(function(){ var selText = $(this).text();///User selected value...**** $(this).parents('.btn-group').find('.dropdown-toggle').html(selText+' '); }); but if i am trying to get this selected value in different function its not working...like this function BusinessLogic(){ var selText = $('.dropdown-menu li a').text(); alert("Its displaying Entire List"+selText); } How to do I get selected value of that list in different function?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38686953
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38687142
possible better answer: http://stackoverflow.com/a/24902521
type: Question
has answer: http://stackoverflow.com/a/24902587
has answer: http://stackoverflow.com/a/24902578
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24902578
score: 4
has title: Get Selected value from by Id in jquery or javascript
upvote count: 4

http://stackoverflow.com/a/24771656
has comment: http://stackoverflow.com/comment/38440271
upvote count: 3
has comment: http://stackoverflow.com/comment/38439707
has comment: http://stackoverflow.com/comment/38439265
has comment: http://stackoverflow.com/comment/38440375
accepted answer of: http://stackoverflow.com/q/24771623
downvote count: 0
has comment: http://stackoverflow.com/comment/38476381
type: AcceptedAnswer
has body: Look into setTimeout. e.g. setTimeout(myFunction, 3000) will call myFunction in 3 seconds. $(document).ready(function() { $('body').addClass('js'); var $menu = $('#menu'), $menulink = $('.menu-link'); $menulink.click(function() { $menulink.toggleClass('active'); $menu.toggleClass('active'); // If I'm understanding the question correctly, // you want the menu to go away after 3 seconds setTimeout(function() { $menulink.toggleClass('active', false); $menu.toggleClass('active', false); }, 3000); return false; }); });
has comment: http://stackoverflow.com/comment/38439329
answers question: http://stackoverflow.com/q/24771623
type: Answer
has comment: http://stackoverflow.com/comment/38439276
score: 3

http://stackoverflow.com/comment/38664849
type: QuestionComment
comment on: http://stackoverflow.com/q/24890563
score: 0
type: Comment
has text: Could you use onBlur and onFocus?

http://stackoverflow.com/q/24813452
has answer: http://stackoverflow.com/a/24813926
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/24813926
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has title: Jquery Selectable TD Return
type: AnsweredQuestion
type: Question
has body: I have a table that is connected to Jquery selectable, and Im trying to get it to grab the value of the selected table item and put it in a text box. I keep getting [object object] as the table value here is the script &lt;script&gt; $( "#drilldowntable" ).selectable( { filter:"td", stop: function(){ $(".ui-selected", this).each(function(){ var index = $("#drilldowntable td").val(this); $("#graphinfo").val(index); } )} }); &lt;/script&gt; any ideas why this is happening?
tagged with: javascript

http://stackoverflow.com/a/24850100
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38590385
has body: Using canvas for something like that might be a little bit too expensive. There are two ways to create text on them - using canvas to draw text or using another HTML element on top of each canvas and put the text in it. I recommend the latter. Here is an example using a div container and a span inside it (as a canvas sibling) to show the text: http://jsfiddle.net/gY9wk/9/ (added a few effects to make it look nicer) The new structure is this: Hey there This is a description Again, I'd recommend not to use canvases for backgrounds as they are too heavy. A simple 1px-high horizontal line with repeat-y property would do the trick and would look identical. And I especially don't recommend using canvas to render text, not just for the reasons mentioned above, but for SEO as well (web crawlers won't see the canvas-rendered text). Of course, if you plan to create some animations, then the canvas is the way to go. And here's an example how to render text on canvas (see the purple one) if you still want to do it: http://jsfiddle.net/gY9wk/10/. Bear in mind that CSS resizing will stretch whatever is rendered on canvas, and changing the width or height attributes of the canvas element will clear the canvas and you'd need to rerender whatever was on it. context.fillStyle = 'red'; context.font = "16px Arial"; context.lineWidth = 4; context.fillText("Hey, I'm rendered on canvas", 30, 30); Second question, the white space is coming from canvases being displayed inline by default. The easiest way is to set them to: canvas {display: block;} and to remove the line break elements (brs). Like this: http://jsfiddle.net/gY9wk/5/
type: Answer
accepted answer of: http://stackoverflow.com/q/24850051
has comment: http://stackoverflow.com/comment/38588780
has comment: http://stackoverflow.com/comment/38588720
has comment: http://stackoverflow.com/comment/38615281
answers question: http://stackoverflow.com/q/24850051
score: 0
has comment: http://stackoverflow.com/comment/38588880

http://stackoverflow.com/q/24837693
score: 4
upvote count: 4
linked to: http://stackoverflow.com/q/1651118
has comment: http://stackoverflow.com/comment/38566307
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has title: Stop execute previous javascript in iframe
tagged with: http://stackoverflow.com/tag/html
has body: If I click on button javascript will be append to iframe. example: Click me! var iframe = here_is_iframe_object; $('#run").click(function(e) { $(iframe).find("script[id=myScript]").remove(); $(iframe).append(" "); }); If I put into the textarea setInterval with alert for example and after that put simple alert, it will be execute setInterval with alert and new alert at the same time. setInterval(function() { alert(true); }, 5000); How to stop previous javascript and execute only new code? Thanks in advance.
type: AnsweredQuestion
tagged with: iframe
has answer: http://stackoverflow.com/a/24840615
accepted answer: http://stackoverflow.com/a/24840615
type: Question
tagged with: javascript

http://stackoverflow.com/q/24858270
score: 5
has comment: http://stackoverflow.com/comment/38695890
linked to: http://stackoverflow.com/q/5883220
has comment: http://stackoverflow.com/comment/38695637
linked to: http://stackoverflow.com/q/23497925
has comment: http://stackoverflow.com/comment/38687537
has body: I'm trying to duotone an image and plaster it onto a canvas. Works in desktop browsers: Chrome Firefox Safari Internet Explorer Fails in mobile browsers: Android Workable demo on JSFiddle, this example works in Chrome but fails in Android's default browser. The code is: &lt;style&gt; body { background-color: gray; } &lt;/style&gt; &lt;canvas id="mycanvas" width="64" height="64"&gt;&lt;/canvas&gt; &lt;script&gt; var image = new Image(); image.src = 'image.png'; image.onload = function () { //once the image finishes loading var context = document.getElementById("mycanvas").getContext("2d"); context.drawImage(image, 0, 0); var imageData = context.getImageData(0, 0, 64, 64); var pixels = imageData.data; var numPixels = pixels.length; for (var i = 0; i &lt; numPixels; i++) { //for every pixel in the image var index = i * 4; var average = (pixels[index] + pixels[index + 1] + pixels[index + 2]) / 3; pixels[index] = average + 255; //red is increased pixels[index + 1] = average; //green pixels[index + 2] = average; //blue //pixels[index + 3] = pixels[index + 3]; //no changes to alpha } context.clearRect(0, 0, 64, 64); //clear the image context.putImageData(imageData, 0, 0); //places the modified image instead } &lt;/script&gt; The summary is: set the background color to gray so alpha can be observed easier create a canvas 64 by 64 load a image of a smiley face on a transparent background draw the image onto the canvas get the image's data for every pixel, make the red stronger replace the altered image on the canvas The smiley face looks like this (block-quoted so you can tell it's transparent): However, in comparison with the chrome and android browser, The background of the android drawing is reddish while the chrome drawing is completely transparent. So... What happened here? How can I change the code so that the android drawing matches with the chrome drawing? Note: I already tried if (pixels[index + 3] == 0) continue;, and I'm aware of this, but it won't work for images…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38876511
has comment: http://stackoverflow.com/comment/38847101
has comment: http://stackoverflow.com/comment/38880484
upvote count: 5
has comment: http://stackoverflow.com/comment/38687694
has comment: http://stackoverflow.com/comment/38695810
has comment: http://stackoverflow.com/comment/38687504
has comment: http://stackoverflow.com/comment/38882037
type: Question
tagged with: alpha
has comment: http://stackoverflow.com/comment/38695545
accepted answer: http://stackoverflow.com/a/25008721
tagged with: canvas
has comment: http://stackoverflow.com/comment/38729798
downvote count: 0
has comment: http://stackoverflow.com/comment/38695420
answer count: 1
has comment: http://stackoverflow.com/comment/38750901
tagged with: javascript
has comment: http://stackoverflow.com/comment/38837830
has comment: http://stackoverflow.com/comment/38882093
has comment: http://stackoverflow.com/comment/38687177
favorite count: 0
has comment: http://stackoverflow.com/comment/38729383
tagged with: android
has title: Image alpha on default Android browser
has comment: http://stackoverflow.com/comment/38835997
has answer: http://stackoverflow.com/a/25008721
has comment: http://stackoverflow.com/comment/38695350

http://stackoverflow.com/q/24898291
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/38678951
upvote count: 5
has answer: http://stackoverflow.com/a/24974453
possible better answer: http://stackoverflow.com/a/24974353
tagged with: getjson
has title: Get all posts from a Tumblr blog using jQuery getJson
type: AnsweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/57390589
tagged with: tumblr
type: Question
score: 3
has answer: http://stackoverflow.com/a/24974353
tagged with: javascript
has comment: http://stackoverflow.com/comment/38820965
answer count: 2
accepted answer: http://stackoverflow.com/a/24974453
has body: I want to get all text posts of a Tumblr blog with jQuery getJson using Tumblr's API. I tried using the following code, but I just got 20 posts: function loadPosts () { var key = "api_key=xBcVPLfdDKpH0GjMCd1whW7rPoYkzLgZD3ZwpzndISFI4huSpA" var api = "https://api.tumblr.com/v2/blog/only-text-posts.tumblr.com/" var post_amount $.getJSON(api + "info?" + key,function(data) { post_amount = data.response.blog.posts $.getJSON(api + "posts/text?&amp;filter=text&amp;limit=" + post_amount + "&amp;" + key,function(data) { $.each(data.response.posts, function(i, item) { var content = item.body $("#Posts ul").append('&lt;li&gt;' + content + '&lt;/li&gt;') }); }) }) } Here is a good sample Tumblr blog for testing: http://only-text-posts.tumblr.com/
tagged with: jquery

http://stackoverflow.com/q/24763485
upvote count: 2
type: UnansweredQuestion
has body: I have a click event attached to an element via JQuery in a loop (loop variable i): $('#id_'+i).click(function() {ItemClick(i)}); And defined somewhere else: function ItemClick(x) { alert(x); } As expected, this doesn't work as expected, because of the closure. I'd like to see a different number shown for each different click event, instead I just get the last value of i. I know I need to turn the i in the closure to something that somehow isn't attached to the scope of the closure, but it eludes me, even after trying various examples. Such as: $('#id_'+i).click(function() {ItemClick(function(x){return x)(i))}); Is there a neat and concise way of doing this? EDIT After looking at the duplicate, I now have two answers (please close the question): Answer A $('#id_'+i).data('index',i); $('#id_'+i).click( function() { ItemClick($(this).data('index')); } ); Answer B $('#id_'+i).click( function(index) { return function () { ItemClick(index) }; }(i) );
score: 2
tagged with: closures
type: Question
linked to: http://stackoverflow.com/q/1451009
has title: Click Event Closure Inside Loop
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
duplicate of: http://stackoverflow.com/q/1451009
tagged with: events
favorite count: 0
has answer: http://stackoverflow.com/a/24763540
has comment: http://stackoverflow.com/comment/38423648

http://stackoverflow.com/a/24867253
downvote count: 0
answers question: http://stackoverflow.com/q/24866499
has comment: http://stackoverflow.com/comment/38620255
score: 3
upvote count: 3
has body: The number of steps need to be defined for the y axis. In the speedometer's code: yAxis: { min: 0, max: 200, labels: {step:2}, title: { text: 'Speed' } } In the tachometer's code: yAxis: { min: 0, max: 5, labels: {step:2}, title: { text: 'RPM' } } See http://jsfiddle.net/y62sj/ for the full code.
type: Answer
has comment: http://stackoverflow.com/comment/38621160

http://stackoverflow.com/comment/38411496
type: AnswerComment
type: Comment
has text: I really mentioned to use inside function block. Thanks anyway.
comment on: http://stackoverflow.com/a/24757071
score: 0

http://stackoverflow.com/q/24853908
has title: Move canvas line up and down based on variable value on the page load with smooth transistion
type: UnansweredQuestion
type: Question
tagged with: canvas
tagged with: javascript
tagged with: jquery
has body: I am working on canvas I have created Vertical line, horizontal line What exactly I want move my horizontal line based on variable value till the height of vertical line. So for that I have created one function call move() in this function i have variable call linemove. If my value was 0 the horizontal line should be in the bottom of the vertical line again If i enter the value of 20 in that variable it has to move smoothly towards up. So If i gave 100 it has to move to top of the horizontal li I don't no how to apply variable for the vertical canvas Here is my javascript function I have started function move() { var linemove = 0; } Here is the fiddle Link Thanks in advance Maha
has answer: http://stackoverflow.com/a/24854642
score: 0
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/q/24873651
linked to: http://stackoverflow.com/q/24512386
type: Question
has comment: http://stackoverflow.com/comment/46069702
has title: Compression On the Server, JavaScript lz-string decompression on the Client
tagged with: javascript
has body: At the moment, my app is making an AJAX call to a C# method that returns a JSONResult of about 600K. I then compress this using lz-string and save it to session storage. To improve efficiency, I'm thinking of compressing this data on the server and sending a compressed copy to the browser. There are lots of C# tools I can use to compress data. However, I need to compress this in such a way that lz-string can decompress it on the client. Has anyone done something like this? If so, how?
has comment: http://stackoverflow.com/comment/46047704
downvote count: 0
favorite count: 0
type: UnansweredQuestion
answer count: 0
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46128833

http://stackoverflow.com/comment/38574902
score: 0
type: AnswerComment
has text: Its strange. Everything is in UTF-8 and these are still there :/ What does null bytes mean?
type: Comment
comment on: http://stackoverflow.com/a/24841376

http://stackoverflow.com/q/24817379
linked to: http://stackoverflow.com/q/359788
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/11666301
accepted answer: http://stackoverflow.com/a/24817533
has comment: http://stackoverflow.com/comment/38525741
has title: Convert String to Function in AngularJS
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/38525683
type: Question
has answer: http://stackoverflow.com/a/24817529
tagged with: angularjs-service
tagged with: javascript
score: 4
possible better answer: http://stackoverflow.com/a/24817529
has comment: http://stackoverflow.com/comment/38525727
upvote count: 4
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/24817533
favorite count: 0
tagged with: angularjs
has body: I am trying to convert strings to AngularJS Service method calls in a controller. For example, I would like to convert the string "Contact.send(email)" to call an existing service method. I thought to use: window["Contact"]["send"](email); as in this thread - How to execute a JavaScript function when I have its name as a string - but it says that the Contact service is undefined, despite being injected into the controller.
has comment: http://stackoverflow.com/comment/38525602

http://stackoverflow.com/a/24765634
downvote count: 0
has body: As I told you in the comments, if you set the WIDTH and HEIGHT in the property "STYLE" off you div, it's opening with that WIDTH/HEIGHT. Ex: http://jsfiddle.net/tiagoajacobi/dKbp7/ If you wan't to say to the FancyBox, to open with an specific WIDTH or HEIGHT, you must use the attribute "autoSize". JS Example: $(".fancybox").fancybox({ 'autoSize': false, 'width': 200, 'height': 140 }); JsFiddle Ex: http://jsfiddle.net/tiagoajacobi/mCQ5j/
accepted answer of: http://stackoverflow.com/q/24763324
upvote count: 2
answers question: http://stackoverflow.com/q/24763324
type: AcceptedAnswer
type: Answer
score: 2

http://stackoverflow.com/q/24774997
accepted answer: http://stackoverflow.com/a/24775505
answer count: 3
has title: Creating unique URLs/Pages from MySQL DB on HTML form submit
has body: The forums have been a huge help on this project so far. I'm looking for some guidance on the next step of my project here. What I have is a form that feeds user submitted information into a MySQL database. This database then feeds this information to a main page displaying all of the information in the DB. What I am looking to do is add something to my form that creates a new unique URL/page when the form is submitted. I have already designed the HTML/CSS template for this page and it is designed to display only one set of information as opposed to the entire DB worth. I am looking for some guidance as to how I can create the pages and unique URLs on the form submit. What is the best way to get this fresh information feeding from the DB immediately? I need to somehow automatically recreate the HTML and CSS files as well on the server, this I am unfamiliar with. EDIT: After @Jacky Cheng pointed out that this was possible without creating new versions of the HTML/CSS files I would be inclined to go about having a single HTML file on the server that is dynamic. Thanks for any help as you guys have been great so far. Including code for the form which I am submitting to the DB from, and the page which I will be pulling info from. This is the form: <?php include_once 'post_func.inc.php'; connect(); ?> Event Register Event Register Event Name: Event Type: <?php query_eventtype() ?> Venue: <?php query_venue() ?> <?php close() ?> This is the page I want filling with information from the DB after the form is submitted and the url is generated. <?php include_once 'event_func.inc.php'; connect(); ?> <?php query_eventname() ?> <?php query_eventname() ?> <?php query_eventvenue() ?> <?php query_eventtype() ?> <?php close() ?> What changes need to be made to the form in order for the url to be generated on submit and the event page to be able to jump between urls/sets of data dynamically, per-say? Sorry for the beginner questions but this site really seems to be the best resource …
has answer: http://stackoverflow.com/a/24775505
has answer: http://stackoverflow.com/a/24794041
has answer: http://stackoverflow.com/a/24780316
has comment: http://stackoverflow.com/comment/38445932
tagged with: php
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: mysql
tagged with: forms
type: Question
upvote count: 1
linked to: http://stackoverflow.com/q/16600708
tagged with: apache
possible better answer: http://stackoverflow.com/a/24780316
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/38445669

http://stackoverflow.com/comment/38408330
type: AnswerComment
score: 0
type: Comment
has text: How can a function have more than one name? It can be assigned to multiple variables, but those aren't its name, they're just other ways to refer to it.
comment on: http://stackoverflow.com/a/24755403

http://stackoverflow.com/q/24752081
has title: Changing the main image in a gallery slider by clicking on a separate link using JavaScript
accepted answer: http://stackoverflow.com/a/24752359
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24752359
type: AnsweredQuestion
type: Question
has body: Hi I'm trying to change the main image inside a gallery slider using separate thumbnail links with HTML5 and JavaScript. Gallery Slider pic 1 pic 2 pic 3 pic 4 pic 5 I have the JavaScript slider working correctly when I slide back and forth but I can't change the main image inside "container" div or the "description" div when I click on separate thumbnail links. Do I need to create another function? If possible could I please have the explanation in JavaScript since I'm trying to learn more about it. Please find my JavaScript below. var Image = ["Fimages/img1.png", "Fimages/img2.png","Fimages/img3.png","Fimages/img4.png","Fimages/img5.png"]; var Description = ["1.description...", "2. description...", "3. description...", "4. description...", "5.description..."]; var Image_Number = 0; var Image_Length = Image.length -1; function slide(num){ Image_Number = Image_Number + num; if (Image_Number > Image_Length){ Image_Number = 0; } if (Image_Number < 0){ Image_Number = Image_Length; } document.slideshow.src=Image[Image_Number]; document.getElementById("description").innerHTML = Description[Image_Number]; return false; } //Do I need another function to call up an Image and a Description? function thumbnail(x){ }
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/24847425
answers question: http://stackoverflow.com/q/24844969
has comment: http://stackoverflow.com/comment/38584298
type: Answer
has body: Map bounds are updated each time the map is moved (either by pan or zoom). So you can use moveend event for your purpose map.on('moveend', function(e) { var bounds = map.getBounds(); });
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24844969
score: 50
type: AcceptedAnswer
upvote count: 50

http://stackoverflow.com/comment/38522604
has text: If it's printed from the web page, look at [**`this`**](http://stackoverflow.com/a/19115657/2518525).
score: 0
comment on: http://stackoverflow.com/q/24815710
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38680751
comment on: http://stackoverflow.com/a/24899213
has text: I would use an attribute or class to signal the state of the html element as opposed to relying on the text of it. Reason being, you may change the text at some point and that will break your functionality. Functionality should in no way be tied to the content of the html element.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38493232
has text: post your code please
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24800279

http://stackoverflow.com/a/24776560
score: 0
accepted answer of: http://stackoverflow.com/q/24776386
answers question: http://stackoverflow.com/q/24776386
type: AcceptedAnswer
has body: You'll need to add 'px' to the height value: function height() { var h = window.innerHeight; document.getElementById("bg").style.height = h+'px'; } And obviously call the function at some point height(); Check out the fiddle - http://jsfiddle.net/MRttV/
type: Answer

http://stackoverflow.com/comment/38743216
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24908305
has text: Don't do that (generate code automatically), at least not at the beginning. I wouldn't start doing this until the moment when you can actually understand what this code is doing. Also, those functions, which DreamWeaver used for you, are going to be removed from PHP in the future versions, so your code will not work anymore (unless you use older, slower and less secure versions of PHP).

http://stackoverflow.com/comment/38663750
comment on: http://stackoverflow.com/q/24889628
type: QuestionComment
type: Comment
score: 2
has text: You can give higher priority to directive one. Refer to https://docs.angularjs.org/api/ng/service/$compile - priority

http://stackoverflow.com/a/24934294
has body: I can confirm, I have the same issue with the latest versions as you specified. One solution is apparently to use jquery.fileupload. I haven't tried it yet. But, will post if it is successful.!
answers question: http://stackoverflow.com/q/24842830
upvote count: 0
type: Answer
downvote count: 1
score: -1

http://stackoverflow.com/comment/38687636
comment on: http://stackoverflow.com/a/24902844
type: AnswerComment
type: Comment
score: 0
has text: Directives in the main HTML page may create child scopes which inherit from the parent scope, and ultimately to $rootScope. So it is more correct to say that any ng-click executing a function under a directive is bound to the element's current scope (which could be inherited or it could be a child scope created by the directive). You can execute ng-click by defining the click handler on the elements current scope (or any parent scope since it inherits scope).

http://stackoverflow.com/comment/38538314
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24821663
type: QuestionComment
has text: Hm, you should make the `require` parameter lowercase still. And again, what kind of promise does your controller expect? What library are you using for promises?

http://stackoverflow.com/q/24835974
upvote count: 4
type: AnsweredQuestion
has body: I have an application built with AngularJS and .NET Web API that uses Http Basic Authentication for security. They're on different subdomains eg: mydomain.com &amp; api.mydomain.com I have a secure url on the web api 'https://api.mydomain.com/downloadFile' that generates an excel file that I need to download on the client. I tried getting the file to download through angularjs using HTML5 Blob objects but kept getting 'File corrupt' error messages when the file tried to open. The solution I came up with was to create a hidden iframe for downloading the file &lt;iframe style="display:none;" ng-src="{{downloadFileUrl}}"&gt;&lt;/iframe&gt; And setting $scope.downloadFileUrl in the controller $scope.downloadFile = function () { $scope.downloadFileUrl = $sce.trustAsResourceUrl('https://api.mydomain.com/downloadFile'); }; This works but I'm forced to log in to the api again because the HTTP 'Authorization' header isn't being sent as part of the request from the iframe. Is there a way to pass the 'Authorization' header with the request from the iframe or any other way to securely download a file from the server without having to log in again?
possible better answer: http://stackoverflow.com/a/39502695
type: Question
tagged with: http-authentication
has answer: http://stackoverflow.com/a/25048752
accepted answer: http://stackoverflow.com/a/25048752
has title: AngularJS + Web API - How to securely download an excel file without having to log in again
answer count: 2
downvote count: 0
tagged with: asp.net-web-api
tagged with: javascript
score: 4
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/39502695

http://stackoverflow.com/a/24804252
has body: Ok this seems to work, I removed your ajax call to load the XML and pasted the XML in the fiddle itself. Also, I'm not an XML guru so there might be an easier method for the first part. http://jsfiddle.net/gt8vK/4/ var x= " 431000527 SLBM 35.4150 139.725 JP SGM 244660180 PD8027 52.4066 4.82345 lalallal "; var xmlDoc = new DOMParser().parseFromString(x,'text/xml'); var allShips = xmlDoc.getElementsByTagName("Ship"); console.log(xmlDoc.getElementsByTagName("Ship")[0].getElementsByTagName("MMSI")[0].childNodes[0].text) var ships = []; for (var i = 0, l = allShips.length; i < l; i++) { ships.push({ name: 'MMSI' + (i + 1).toString(), originalName: allShips[i].getElementsByTagName("MMSI")[0].childNodes[0].nodeValue, latitude: allShips[i].getElementsByTagName("LATITUDE")[0].childNodes[0].nodeValue, longitude: allShips[i].getElementsByTagName("LONGITUDE")[0].childNodes[0].nodeValue }) } var map = new google.maps.Map(document.getElementById('map-canvas'), { zoom: 2 , center: new google.maps.LatLng(0, 0), mapTypeId: google.maps.MapTypeId.ROADMAP }); var infowindow = new google.maps.InfoWindow(); var marker, i; for (i = 0; i < ships.length; i++) { marker = new google.maps.Marker({ position: new google.maps.LatLng(ships[i].latitude, ships[i].longitude), map: map }); google.maps.event.addListener(marker, 'click', (function(marker, i) { return function() { infowindow.setContent(ships[i].name); infowindow.open(map, marker); } })(marker, i)); } Basically I placed all the ships in an object, instead of creating a new variable for each one, this will keep everything cleaner and you can still access each one of them, just use ships['number'] instead of shipNumber.
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24802865
type: Answer
accepted answer of: http://stackoverflow.com/q/24802865

node.js
tags question: http://stackoverflow.com/q/24896443
tags question: http://stackoverflow.com/q/24809826
tags question: http://stackoverflow.com/q/24863326
tags question: http://stackoverflow.com/q/24871368
tags question: http://stackoverflow.com/q/24775604
tags question: http://stackoverflow.com/q/24808278
tags question: http://stackoverflow.com/q/24835466
tags question: http://stackoverflow.com/q/24908391
tags question: http://stackoverflow.com/q/24840610
tags question: http://stackoverflow.com/q/24876021
tags question: http://stackoverflow.com/q/24763863
tags question: http://stackoverflow.com/q/24844682
tags question: http://stackoverflow.com/q/24849183
tags question: http://stackoverflow.com/q/24831496
tags question: http://stackoverflow.com/q/24751875
tags question: http://stackoverflow.com/q/24907135
tags question: http://stackoverflow.com/q/24794316
tags question: http://stackoverflow.com/q/24817615
tags question: http://stackoverflow.com/q/24817267
tags question: http://stackoverflow.com/q/24887911
tags question: http://stackoverflow.com/q/24869267
tags question: http://stackoverflow.com/q/24906890
tags question: http://stackoverflow.com/q/24808072
tags question: http://stackoverflow.com/q/24840330
tags question: http://stackoverflow.com/q/24873457
tags question: http://stackoverflow.com/q/24867482
tags question: http://stackoverflow.com/q/24786235
tags question: http://stackoverflow.com/q/24837580
tags question: http://stackoverflow.com/q/24760649
tags question: http://stackoverflow.com/q/24857214
tags question: http://stackoverflow.com/q/24815008
tags question: http://stackoverflow.com/q/24784939
tags question: http://stackoverflow.com/q/24897525
tags question: http://stackoverflow.com/q/24761819
tags question: http://stackoverflow.com/q/24855619
tags question: http://stackoverflow.com/q/24845221
tags question: http://stackoverflow.com/q/24783095
tags question: http://stackoverflow.com/q/24785201
tags question: http://stackoverflow.com/q/24770639
tags question: http://stackoverflow.com/q/24875083
tags question: http://stackoverflow.com/q/24885345
tags question: http://stackoverflow.com/q/24800511
tags question: http://stackoverflow.com/q/24894163
tags question: http://stackoverflow.com/q/24904296
tags question: http://stackoverflow.com/q/24784901
tags question: http://stackoverflow.com/q/24756392
tags question: http://stackoverflow.com/q/24764819
tags question: http://stackoverflow.com/q/24859069
tags question: http://stackoverflow.com/q/24812433
tags question: http://stackoverflow.com/q/24787895
tags question: http://stackoverflow.com/q/24756670
tags question: http://stackoverflow.com/q/24791300
tags question: http://stackoverflow.com/q/24791260
tags question: http://stackoverflow.com/q/24783040
tags question: http://stackoverflow.com/q/24823782
tags question: http://stackoverflow.com/q/24902061
tags question: http://stackoverflow.com/q/24901007
tags question: http://stackoverflow.com/q/24847810
tags question: http://stackoverflow.com/q/24813176
tags question: http://stackoverflow.com/q/24869959
tags question: http://stackoverflow.com/q/24836489
tags question: http://stackoverflow.com/q/24808826
tags question: http://stackoverflow.com/q/24901516
tags question: http://stackoverflow.com/q/24771824
tags question: http://stackoverflow.com/q/24769962
tags question: http://stackoverflow.com/q/24754107
tags question: http://stackoverflow.com/q/24903056
tags question: http://stackoverflow.com/q/24834463
tags question: http://stackoverflow.com/q/24824456
tags question: http://stackoverflow.com/q/24896386
tags question: http://stackoverflow.com/q/24858730
tags question: http://stackoverflow.com/q/24878242
tags question: http://stackoverflow.com/q/24880671
tags question: http://stackoverflow.com/q/24796865
tags question: http://stackoverflow.com/q/24887731
tags question: http://stackoverflow.com/q/24898920
tags question: http://stackoverflow.com/q/24890107
tags question: http://stackoverflow.com/q/24832286
tags question: http://stackoverflow.com/q/24798322
tags question: http://stackoverflow.com/q/24829204

http://stackoverflow.com/q/24842379
favorite count: 0
has comment: http://stackoverflow.com/comment/38572415
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38572677
has comment: http://stackoverflow.com/comment/38572633
has body: I have a function that is being random at specific time within a range. I am having trouble relooping my function or reverts the counter back to one so it continue looping after the range. Here is my code: var i = 1; function imgLoop() { setTimeout(function () { var rand = makeUniqueRandom(); j = rand; img4 = '&lt;div id="deck" class="center" &gt;' img4 += '&lt;img class="img_deck" src="http://example.com/images/' + j + '.jpg" /&gt;'; img4 += '&lt;/div"&gt;' $(img4).hide().appendTo("#img_brd").fadeIn('slow'); i++; setTimeout(function () { if (i &lt; 30) { $("#img_deck_border").remove().toArray(); imgLoop(); } }, 2000) }, 100) } imgLoop(); I tried passing parameter to imgLoop() as imgLoop(i) then imgLoop(1) but outputs wrong and doubles the appending of images. Thank you for helping.
score: 1
upvote count: 1
has title: Image loop - reloop
type: Question
has answer: http://stackoverflow.com/a/24842824
tagged with: javascript
answer count: 1
downvote count: 0
tagged with: jquery

http://stackoverflow.com/comment/38633829
type: Comment
has text: Might be an option, but when any other route is fired it replace the layout content, maybe i could do and append after the homeview but it doesn't feel clean, but gotta try. I'm checking right now the option of saving the iframe contents and placing it again, but i figure out that it seems to be impossible to append content to an iframe if is not in the dom, and taking out of the dom (detaching it) removes it contents but not the element itself :S
comment on: http://stackoverflow.com/a/24873735
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38456296
score: 0
type: AnswerComment
has text: "urMethod", is that my $scope.submitForm?
comment on: http://stackoverflow.com/a/24780755
type: Comment

http://stackoverflow.com/comment/38660301
has text: You realise that `new Date(2013, 12, 18)` will create a date for 18 January, 2014?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24880187

http://stackoverflow.com/q/24823661
has comment: http://stackoverflow.com/comment/38540724
has comment: http://stackoverflow.com/comment/38539881
has comment: http://stackoverflow.com/comment/38593009
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38540906
score: 1
has comment: http://stackoverflow.com/comment/38547700
has comment: http://stackoverflow.com/comment/38548225
has comment: http://stackoverflow.com/comment/38597931
type: Question
has comment: http://stackoverflow.com/comment/38547917
tagged with: owl-carousel
answer count: 1
has body: I am using the Twitter Bootstrat Freelance theme (http://startbootstrap.com/templates/freelancer/) and have incorporated Own Carousel.js (http://www.owlcarousel.owlgraphic.com/demos/demos.html). All is working well apart from whenever I click an image to view it in a modal window, it appears the wrong size - until I resize my browser window, or refresh the page, or eg press f12. It then seems to 'fix itself'. Not sure if this is a js conflict issue or I am doing something silly (I am quite new to js). I have looked at the console and can't see any errors, I have also tried different versions of jquery and bootstrap however no difference. I have created a jsfiddle here http://jsfiddle.net/johnny_s/34L6t/2/ If you view the jsfiddle, try click an image and once it opens in the modal window, resize the screen slightly and you will see what I mean. It somehow suddenly fixes itself. I would appreciate any help or direction on this issue, as I am trying to create a personal project which needs to be finished quite soon :s
downvote count: 0
tagged with: javascript
has title: Strange image re-size issue
tagged with: jquery
has comment: http://stackoverflow.com/comment/38567880
has comment: http://stackoverflow.com/comment/38567335
favorite count: 0
accepted answer: http://stackoverflow.com/a/24859668
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/24859668
upvote count: 1

http://stackoverflow.com/a/24887603
has comment: http://stackoverflow.com/comment/56900356
answers question: http://stackoverflow.com/q/24881467
type: Answer
has comment: http://stackoverflow.com/comment/56895884
downvote count: 0
score: 1
has body: As I can understand, you want to always show a tooltip for a given data segment You can use following code snippet: var pieChart = $("#chartContainer").dxPieChart({ dataSource: data, series: {} }).dxPieChart("instance"); pieChart.getSeries().getPointByArg("Second").showTooltip(); See working sample here And demo here
upvote count: 1

http://stackoverflow.com/q/24868027
tagged with: javascript
linked to: http://stackoverflow.com/q/270612
has answer: http://stackoverflow.com/a/24868149
upvote count: 1
has title: Javascript scroll to bottom doesn't always scroll to bottom
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38621679
has body: I am using an Iframe which reloads itself every 5 seconds. It makes use of javascript to automaticly scroll to the bottom because it has too much content to display in one go, but sometimes after a refresh the scroll bar doesn't go down all the way. Leaving me scrolling it down myself. I really don't know what it is. Maybe one of you has a better peice of Javascript suited for this. Javascript: &lt;script&gt; var objDiv = document.getElementById("chat"); objDiv.scrollTop = objDiv.scrollHeight; &lt;/script&gt; The HTML div: &lt;div id="chat" class="scroll"&gt; *Content going on for 150 lines...* &lt;/div&gt; Thanks in advance.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38625826
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/24868149
type: Question
has comment: http://stackoverflow.com/comment/38621591

http://stackoverflow.com/q/24871724
score: 0
has body: I have some log in information that needs to be displayed in more than one place on an Angular.js backed UI. To this end, I have set up two controllers to return a service object created in app.factory. The reason this has been created as a service is to have the two controllers share the same model object. What I would like to do is use ng-bind to send initial model values with the page content on initial page load (so as to avoid any delay while values are retrieved). I wondered if the html element value on ng-bind would update the logInRegistrationUi object in this example, but rather the element content is overwritten with the initialisation value ('example initial value') on the logInRegistrationUi object. var app = angular.module('fr', []); app.factory('logInRegistrationUiService', function() { var logInRegistrationUi = { logInRegistrationVisible: false, userLoggedIn: false, userEmailAddress: 'example initial value' }; var logInRegistrationUiService = { logInRegistrationUi: logInRegistrationUi }; return logInRegistrationUiService; }); app.controller('logInRegistrationFormController', function ($scope, logInRegistrationUiService) { $scope.logInRegistrationUi = logInRegistrationUiService.logInRegistrationUi; console.log('logInRegistrationVisible (logInRegistrationFormController): ' + $scope.logInRegistrationUi.logInRegistrationVisible) }); app.controller('logInRegistrationStatusController', function ($scope, logInRegistrationUiService) { $scope.logInRegistrationUi = logInRegistrationUiService.logInRegistrationUi; console.log('logInRegistrationVisible (logInRegistrationStatusController): ' + $scope.logInRegistrationUi.logInRegistrationVisible) }); The HTML source on page load - The ng-bind spans have literal content, in an attempt to have the element value update the service model. .... test@example.com .... .... test@example.com .... But instead of the service model object having the userEmailAddress, property updated, the text 'example initial value' is rendere…
has comment: http://stackoverflow.com/comment/38629453
has answer: http://stackoverflow.com/a/24872137
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38628912
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38629096
has title: What is the correct way to set $scope values on page load in a service scenario?
accepted answer: http://stackoverflow.com/a/24872137
type: Question
has comment: http://stackoverflow.com/comment/38634445
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38629208
has comment: http://stackoverflow.com/comment/38629147
has comment: http://stackoverflow.com/comment/38629119

http://stackoverflow.com/comment/38525553
type: Comment
type: QuestionComment
has text: Can u please create the fiddle for the same.
score: 0
comment on: http://stackoverflow.com/q/24817327

http://stackoverflow.com/comment/38540644
type: AnswerComment
comment on: http://stackoverflow.com/a/24824543
score: 0
type: Comment
has text: That would be an easy way to do it but a very unaccurate way. There's no specific time, it dpeneds on the client machine, you could add a delay of 5, 10 seconds but maybe the user will leave the page before that gets triggered. Why don't you use google analytics ?

http://stackoverflow.com/a/24851192
accepted answer of: http://stackoverflow.com/q/24848590
upvote count: 5
has body: This will be much easier to achieve if you enter your axis values as numbers instead of strings: var data = google.visualization.arrayToDataTable([ ['Day', 'Visit', 'Applic.'], [1, 19, 1], [2, 100, 9], [3, 103, 18], [4, 42, 8], [5, 34, 2], [6, 63, 9], [7, 35, 7], [8, 427, 51], [9, 314, 38], [10, 71, 4], [11, 27, 0], [12, 25, 0], [13, 78, 0], [14, 54, 0], [15, 60, 0], [16, 47, 0], [17, 29, 0], [18, 16, 0], [19, 10, 0], [20, 26, 0], [21, 200, 0], [22, 255, 0], [23, 160, 0], [24, 30, 0], [25, 35, 0], [26, 9, 0] ]); You can then specify the hAxis.ticks option to tell the chart which values should be labeled on the axis: hAxis: { title: 'Days', ticks: [0, 5, 10, 15, 25] }
has comment: http://stackoverflow.com/comment/80746051
score: 5
downvote count: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24848590
type: Answer

http://stackoverflow.com/comment/38459145
type: QuestionComment
comment on: http://stackoverflow.com/q/24777242
has text: Please check the first link of shailesh which is saying that we cann't download resource through ajax.
score: 0
type: Comment

http://stackoverflow.com/a/24817641
score: 0
answers question: http://stackoverflow.com/q/24817109
has comment: http://stackoverflow.com/comment/38526667
has body: I have updated your fiddle... moving the closing div tag so that it contains the toggled content helps. http://jsfiddle.net/49GkJ/5/ html hover on me 30 Miles 50 Miles jquery $("#hoverDiv").hover(function () { $("#hiddenDiv").slideToggle(); }); css #hiddenDiv { display:none; }
type: Answer

http://stackoverflow.com/q/24798868
tagged with: facebook-graph-api
favorite count: 0
has comment: http://stackoverflow.com/comment/38491456
has comment: http://stackoverflow.com/comment/38491878
tagged with: facebook
tagged with: php
has body: I am using graph-api provided by facebook. The version is 3.1.0. My code is working fine but it displays all the images of user irrespective of the albums. I want to change my code so that user can see only images of the album he/she has selected. I mean images shall be displayed album wise. My code below: index.php <?php /********************************************************************** * Plugin Name: Facebook Plugin * * Plugin URI: http://www.picpixa.com/ * * Version: 1.0 * * Author: Ashish Shah * * Description: Plugin To Import Images From User's Facebook Account * * as well as post the image of personalized product to * * his/her facebook account * **********************************************************************/ session_start(); include_once '/home/picpixa/wp-config.php'; include_once "fbmain.php"; ini_set("display_errors",1); ?> Facebook Images <?php if(isset($_POST['copy']) && $_POST['facebook']) { $imgArray = $_POST['facebook']; $current_user = wp_get_current_user(); if(isset($current_user->ID) && trim($current_user->ID)!='' && trim($current_user->ID)!=0){ $extraSessionStr = 'usr-'.md5($current_user->ID).'/'; $user = $current_user->ID; }else{ $sesstionId = session_id(); $user = $sesstionId; $extraSessionStr = $sesstionId.'/'; } $i=1; foreach ($imgArray as $img) { //$fileName=basename($img); $imgExt = pathinfo($img); //This will become an array with keys ('dirname','basename','extension','filename') $imageName = "FB-image"; $fileName=$imageName.".".$imgExt['extension']; // Read file content $file_content = file_get_contents($img); //Check wether the file is exists or not rename the file if exists if(!file_exists('/home/picpixa/server/php/files/'.$extraSessionStr.$fileName)){ file_put_contents('/home/picpixa/server/php/files/'.$extraSessionStr.$fileName, $file_content); //file_put_contents('/home/picpixa/server/php/thumbnails/'.$extraSessionStr.$fileName, $file_content); $i++; } else{ //echo "Entered in else part"; while(file_exists('/home/picpixa/s…
has answer: http://stackoverflow.com/a/24864768
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24849527
has answer: http://stackoverflow.com/a/24849527
downvote count: 1
type: Question
tagged with: javascript
score: -1
accepted answer: http://stackoverflow.com/a/24864768
tagged with: facebook-php-sdk
answer count: 2
has comment: http://stackoverflow.com/comment/38564603
upvote count: 0
has title: Facebook Graph API: I want to display user images album wise

http://stackoverflow.com/q/24840610
answer count: 1
has comment: http://stackoverflow.com/comment/38696349
favorite count: 0
has body: I wrapped a C++ standard library std::map&lt;T1,T2&gt; that I want to expose as a Node.JS addon. I want to have two functions, Set for adding a new value to the hash table, and Get for looking up value from the map. I want a single function that would work for "arbitrary" type. This means Get would have to extract value of type T1 from Args[0] (note that Args is of type v8::Arguments). See the code below. template&lt;typename T1, typename T2&gt; class Hash : public node::ObjectWrap { public: static v8::Persistent&lt;v8::FunctionTemplate&gt; constructor; static void Init(v8::Handle&lt;v8::Object&gt; target); protected: /* ... */ static v8::Handle&lt;v8::Value&gt; New(const v8::Arguments&amp; Args); // new object static v8::Handle&lt;v8::Value&gt; Set(const v8::Arguments&amp; Args); // set H[x]=y static v8::Handle&lt;v8::Value&gt; Get(const v8::Arguments&amp; Args); // return H[x] private: std::map&lt;T1, T2&gt; H; }; /* ... */ template&lt;typename T1, typename T2&gt; v8::Handle&lt;v8::Value&gt; Hash&lt;T1, T2&gt;::Get(const v8::Arguments&amp; Args) { v8::HandleScope HandleScope; THash&lt;T1, T2&gt;* H = ObjectWrap::Unwrap&lt;Hash&lt;T1, T2&gt; &gt;(Args.This()); // TODO: I want to extract argument Args[0] of type T1, call it x, and then // return argument y=H-&gt;get(x) of type T2. return v8::Undefined(); } Is there a way to do this? If yes, what is the way of doing it? In case there is no way of extracting an arbitrary type, what is the best practice in case I am willing to restrict to several predefined types? For example, T=int, T=std::string, T=MyType1, and T=MyType2.
tagged with: node.js
tagged with: c++
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: v8
tagged with: embedded-v8
has title: V8 Javascript engine: v8::Arguments and function templates
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38656628
has answer: http://stackoverflow.com/a/24907655
upvote count: 1
accepted answer: http://stackoverflow.com/a/24907655

http://stackoverflow.com/q/24861073
has body: I dont want to allow users to access my site with Microsoft Internetexplorer (ANY VERSION). What I´ve found so far was to detect if it´s lower or equal version 10. A very annoing thing: Internetexplorer >v10 doesn´t admit to be a InternetExplorer. What i´ve found and tried so far: if(navigator.appVersion.indexOf("MSIE")!=-1){ alert("You use IE. That´s no good."); } or if ( $.browser.msie ) { alert( $.browser.version ); } and http://msdn.microsoft.com/en-us/library/ie/ms537509%28v=vs.85%29.aspx I would use any solution if it is in javascript, jquery or php if there is one.
linked to: http://stackoverflow.com/q/21825157
has title: Detect if any kind of IE (MSIE)
has comment: http://stackoverflow.com/comment/38608548
has answer: http://stackoverflow.com/a/24861307
tagged with: php
has comment: http://stackoverflow.com/comment/38608398
duplicate of: http://stackoverflow.com/q/21825157
type: AnsweredQuestion
score: 52
has comment: http://stackoverflow.com/comment/38608825
has comment: http://stackoverflow.com/comment/38608691
has comment: http://stackoverflow.com/comment/38608522
has answer: http://stackoverflow.com/a/24861606
possible better answer: http://stackoverflow.com/a/24861185
type: Question
linked to: http://stackoverflow.com/q/10964966
has answer: http://stackoverflow.com/a/24861185
tagged with: internet-explorer
upvote count: 54
has comment: http://stackoverflow.com/comment/56660069
linked to: http://stackoverflow.com/q/9900311
has answer: http://stackoverflow.com/a/24861460
has answer: http://stackoverflow.com/a/24861266
has comment: http://stackoverflow.com/comment/38608386
has comment: http://stackoverflow.com/comment/38608616
has comment: http://stackoverflow.com/comment/38609197
downvote count: 2
has comment: http://stackoverflow.com/comment/77785082
has comment: http://stackoverflow.com/comment/38608469
accepted answer: http://stackoverflow.com/a/24861307
tagged with: javascript
answer count: 6
tagged with: jquery
linked to: http://stackoverflow.com/q/17447373
favorite count: 0
has answer: http://stackoverflow.com/a/24861399
has comment: http://stackoverflow.com/comment/38608450

http://stackoverflow.com/comment/38510140
has text: Use hasClass to check current state, toggleClass to change one class on another. Do not use css method, put everything in class.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24809237
score: 1

http://stackoverflow.com/a/24854913
downvote count: 0
has body: In HTML5 there is no need for JavaScript: &lt;input required pattern="[A-Z](.*[aeiou].*[^aeiou].*|.*[^aeiou].*[aeiou].*)"&gt; http://jsfiddle.net/sfjT9/ If you need to check validity in JavaScript, use this: yourInput.checkValidity(); W3C specification: http://www.w3.org/TR/html5/forms.html#dom-cva-checkvalidity WHATWG specification: http://www.whatwg.org/specs/web-apps/current-work/#the-constraint-validation-api:dom-cva-checkvalidity
has comment: http://stackoverflow.com/comment/38596689
upvote count: 2
has comment: http://stackoverflow.com/comment/38596707
type: Answer
answers question: http://stackoverflow.com/q/24854759
score: 2

http://stackoverflow.com/q/24900117
tagged with: angular-ui
has body: I am new to Angular and having issues with the AngularUI bootstrap toolkit where clicking on an item in the dropdown, doesn't fill the textbox with the full value. The dropdown box disappears when clicked and only the characters that were typed are left in. Here is the code (start typing "spy" into the textbox) http://plnkr.co/edit/WYLn0c6HvuOLl1pJBCxa?p=preview &lt;body&gt; &lt;div data-ng-controller="AssetCtrl"&gt; &lt;br /&gt; &lt;input type="text" ng-model="selected" typeahead="asset.ticker as typeaheadLabel(asset) for asset in assets | filter:{ticker:$viewValue}" class="form-control"&gt; &lt;/div&gt; &lt;script&gt; var ConsoleApp = angular.module('ConsoleApp', ['ui.bootstrap']); function AssetCtrl($scope) { $scope.assets = [{ "assetClass": "stock", "ticker": "spy", "description": "S&amp;P" }]; $scope.typeaheadLabel = function(item) { return item.ticker.toUpperCase() + ' (' + item.assetClass + ') - ' + item.description; }; } ConsoleApp.controller('AssetCtrl', AssetCtrl); &lt;/script&gt; &lt;/body&gt;
tagged with: angularjs
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/24900548
has title: AngularUI Boostrap typeahead doesn't select when item is clicked
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/24900548
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/a/24774532
has comment: http://stackoverflow.com/comment/38446114
answers question: http://stackoverflow.com/q/24773307
upvote count: 7
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38516193
type: Answer
has comment: http://stackoverflow.com/comment/38490498
has body: Use a closure. Let me show you a simple example // JavaScript on Client-Side window.onload = function() { var f = (function() { for (i = 0; i &lt; 3; i++) { (function(i){ var xhr = new XMLHttpRequest(); var url = "closure.php?data=" + i; xhr.open("GET", url, true); xhr.onreadystatechange = function () { if (xhr.readyState == 4 &amp;&amp; xhr.status == 200) { console.log(xhr.responseText); // 0, 1, 2 } }; xhr.send(); })(i); } })(); }; // Server-Side (PHP in this case) &lt;?php echo $_GET["data"]; ?&gt; In your case... wrap the asynchronous call/function with a closure for (var i=0; i&lt; this.selectedAvailableUnits.length; i++) { (function(i) { // &lt;--- the catch var unit = this.selectedAvailableUnits[i]; var unitId = unit.unitId; var url = '/incident/' + currentIncidentId + '/assignUnit/' + unitId $http.post(url).then(function(response) { // DOING SOMETHING }, function(error) { alert(error); }); })(i); // &lt;---- (the i variable might be omitted if it's not needed) } The section below is not directly related to the question but rather to the comments related to this answer. The example submitted on jsFiddle mentioned in the comments and shown below is buggy and as such it doesn't prove anything. It's true that this snippet, even not using a closure, yields 'Hello Kitty' three times; actually, if you replace console.log() method with the an alert() one you will see that it yields 'Hello Kitty' six, nine or even twelve times. So, what the hell is going one ;) how it's possible to get the alert window popping up six, nine or twelve times within a loop of three iterations?! // your example (a) // my comments // var f = (function() { for (i = 0; i &lt; 3; i++) { //(function(){ // this way you can't have multiple scopes var xhr = new XMLHttpRequest(); var url = "closure.php?data=your-data"; // use /echo/html/ for testing on jsfiddle.net xhr.open("GET", url, true); // use POST for testing on jsfiddle.net xhr.onreadystatechange = function () { // this way you might catch…
has comment: http://stackoverflow.com/comment/38488683
downvote count: 0
has comment: http://stackoverflow.com/comment/38445702
has comment: http://stackoverflow.com/comment/38566048
score: 7
accepted answer of: http://stackoverflow.com/q/24773307
has comment: http://stackoverflow.com/comment/38479348
has comment: http://stackoverflow.com/comment/38479611

ajax
tags question: http://stackoverflow.com/q/24846608
tags question: http://stackoverflow.com/q/24839145
tags question: http://stackoverflow.com/q/24780451
tags question: http://stackoverflow.com/q/24908700
tags question: http://stackoverflow.com/q/24788286
tags question: http://stackoverflow.com/q/24856439
tags question: http://stackoverflow.com/q/24822208
tags question: http://stackoverflow.com/q/24794950
tags question: http://stackoverflow.com/q/24872086
tags question: http://stackoverflow.com/q/24819432
tags question: http://stackoverflow.com/q/24773497
tags question: http://stackoverflow.com/q/24830924
tags question: http://stackoverflow.com/q/24843839
tags question: http://stackoverflow.com/q/24828300
tags question: http://stackoverflow.com/q/24907465
tags question: http://stackoverflow.com/q/24764274
tags question: http://stackoverflow.com/q/24898264
tags question: http://stackoverflow.com/q/24796464
tags question: http://stackoverflow.com/q/24877623
tags question: http://stackoverflow.com/q/24872482
tags question: http://stackoverflow.com/q/24872388
tags question: http://stackoverflow.com/q/24877290
tags question: http://stackoverflow.com/q/24796280
tags question: http://stackoverflow.com/q/24858331
tags question: http://stackoverflow.com/q/24755993
tags question: http://stackoverflow.com/q/24819854
tags question: http://stackoverflow.com/q/24778702
tags question: http://stackoverflow.com/q/24895891
tags question: http://stackoverflow.com/q/24825055
tags question: http://stackoverflow.com/q/24788481
tags question: http://stackoverflow.com/q/24808303
tags question: http://stackoverflow.com/q/24795145
tags question: http://stackoverflow.com/q/24838455
tags question: http://stackoverflow.com/q/24888850
tags question: http://stackoverflow.com/q/24842752
tags question: http://stackoverflow.com/q/24771997
tags question: http://stackoverflow.com/q/24837033
tags question: http://stackoverflow.com/q/24876597
tags question: http://stackoverflow.com/q/24905028
tags question: http://stackoverflow.com/q/24878596
tags question: http://stackoverflow.com/q/24830146
tags question: http://stackoverflow.com/q/24833958
tags question: http://stackoverflow.com/q/24833358
tags question: http://stackoverflow.com/q/24861435
tags question: http://stackoverflow.com/q/24792766
tags question: http://stackoverflow.com/q/24819501
tags question: http://stackoverflow.com/q/24825054
tags question: http://stackoverflow.com/q/24881928
tags question: http://stackoverflow.com/q/24802368
tags question: http://stackoverflow.com/q/24805410
tags question: http://stackoverflow.com/q/24778809
tags question: http://stackoverflow.com/q/24781258
tags question: http://stackoverflow.com/q/24861295
tags question: http://stackoverflow.com/q/24886160
tags question: http://stackoverflow.com/q/24853059
tags question: http://stackoverflow.com/q/24889382
tags question: http://stackoverflow.com/q/24753685
tags question: http://stackoverflow.com/q/24856492
tags question: http://stackoverflow.com/q/24784380
tags question: http://stackoverflow.com/q/24835267
tags question: http://stackoverflow.com/q/24887211
tags question: http://stackoverflow.com/q/24897505
tags question: http://stackoverflow.com/q/24815645
type: Tag
tags question: http://stackoverflow.com/q/24809503
tags question: http://stackoverflow.com/q/24819099
tags question: http://stackoverflow.com/q/24773599
tags question: http://stackoverflow.com/q/24895732
tags question: http://stackoverflow.com/q/24836619
tags question: http://stackoverflow.com/q/24847343
tags question: http://stackoverflow.com/q/24849087
tags question: http://stackoverflow.com/q/24789872
tags question: http://stackoverflow.com/q/24882238
tags question: http://stackoverflow.com/q/24861171
tags question: http://stackoverflow.com/q/24796215
tags question: http://stackoverflow.com/q/24779637
tags question: http://stackoverflow.com/q/24810872
tags question: http://stackoverflow.com/q/24816691
tags question: http://stackoverflow.com/q/24893296
tags question: http://stackoverflow.com/q/24902828

http://stackoverflow.com/q/24765663
type: Question
duplicate of: http://stackoverflow.com/q/13840429
score: -2
has body: I have this query (Javascript) function that it's changed an input value every time I change the select menu. I bring the value from a php variable. (See the example). For every option in my select I insert a value from 1 to n like this: $i = 0; foreach($videos as $val) { echo '&lt;option value='.$i.'&gt;'.$val-&gt;title.'&lt;/option&gt;'; $i++; } So the idea am I bringing the option value with JQuery and I want to use in a PHP expression that I use in Javascript and I want to know how put the javascript variable in PHP expression in this case (See my example PHP echo $videos [ii] -&gt;title; Exactly this expression the ii it's a javascript variable and the rest is PHP) $('select').change(function(){ var i = $( "#select option:selected" ).val(); var ii = parseInt(i,10); $( "#titre" ).val("&lt;?php echo $videos[ii]-&gt;title; ?&gt;"); }); Thanks
has title: How to deal with PHP variables in javascript
tagged with: javascript
has answer: http://stackoverflow.com/a/24766102
tagged with: jquery
has answer: http://stackoverflow.com/a/24765971
has answer: http://stackoverflow.com/a/24765886
has comment: http://stackoverflow.com/comment/38427962
answer count: 7
has answer: http://stackoverflow.com/a/24765861
favorite count: 0
has comment: http://stackoverflow.com/comment/38427976
has answer: http://stackoverflow.com/a/24766307
type: UnansweredQuestion
upvote count: 1
tagged with: php
has answer: http://stackoverflow.com/a/24765970
downvote count: 3
linked to: http://stackoverflow.com/q/13840429
has answer: http://stackoverflow.com/a/24765794

http://stackoverflow.com/q/24802817
has answer: http://stackoverflow.com/a/24802953
has answer: http://stackoverflow.com/a/24803055
score: 0
has title: Efficient function declaration in JavaScript
has answer: http://stackoverflow.com/a/24803388
accepted answer: http://stackoverflow.com/a/24802953
has body: I have some javascript code that needs to run every 6 seconds that looks like this: this.y = function() { //some logic that may or may not call y_a or y_b this.y_a = function() { //some logic } this.y_b = function() { //some logic } var self = this; setTimeout(function(){ self.y(); }, 6000); } y_a and y_b are not needed outside the scope of y. As this function is being called every 6 seconds, is it significantly inefficient to keep redeclaring y_a and y_b? Or should I define them once outside the scope of y?
has comment: http://stackoverflow.com/comment/38497992
answer count: 4
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/24803044
possible better answer: http://stackoverflow.com/a/24803055
tagged with: javascript

http://stackoverflow.com/comment/38437687
type: Comment
has text: cookie monster, my mistake. `_.chain(items).filter(function(x) { return x > 0}).value().length;` should do it
comment on: http://stackoverflow.com/a/24770846
score: 1
type: AnswerComment

http://stackoverflow.com/a/24867038
downvote count: 0
score: 1
upvote count: 1
has body: this will check to see if the string contains inc or not, if it contains it, it will give you the second last part of the string. var current_path_fragment = 'article/page/4'; if(current_path_fragment.indexOf("inc")){ var splittedString= current_path_fragment.split('/').reverse(); var secondLastPart= splittedString[1]; }
answers question: http://stackoverflow.com/q/24866857
type: Answer

http://stackoverflow.com/q/24835395
has comment: http://stackoverflow.com/comment/38560090
tagged with: mongodb
has comment: http://stackoverflow.com/comment/38560093
has comment: http://stackoverflow.com/comment/38560040
accepted answer: http://stackoverflow.com/a/24840894
has body: I am creating a forum with Angular - it interfaces with Node/Mongo, so there are plenty of requests that need to be executed to fill the page with the required data. Everything works exactly as it should locally, but when I upload to Openshift...the site seems to be very buggy, and it doesn't seem to execute more than half of the requests (if not all) or the requests I put in to make the forum function. I am using a yeoman MEAN stack called angular-fullstack. If you have yeoman you can create the seed with yo angular-fullstack. The only things I had to change within that seed to get it to upload to openshift were: server.js ... // Set default node environment to development process.env.NODE_ENV = process.env.NODE_ENV || 'development'; ... to ... // Set default node environment to development process.env.NODE_ENV = process.env.NODE_ENV || 'production'; ... The above line refers to this code in lib/config/express.js: if ('development' === env) { app.use(require('connect-livereload')()); // Disable caching of scripts for easier testing app.use(function noCache(req, res, next) { if (req.url.indexOf('/scripts/') === 0) { res.header('Cache-Control', 'no-cache, no-store, must-revalidate'); res.header('Pragma', 'no-cache'); res.header('Expires', 0); } next(); }); app.use(express.static(path.join(config.root, '.tmp'))); app.use(express.static(path.join(config.root, 'app'))); app.set('views', config.root + '/app/views'); } if ('production' === env) { app.use(compression()); app.use(errorHandler()); app.use(favicon(path.join(config.root, 'public', 'favicon.ico'))); app.use(express.static(path.join(config.root, 'public'))); app.set('views', config.root + '/views'); } ... // Error handler - has to be last if ('development' === app.get('env')) { app.use(errorHandler()); } So let me know if you notice anything wrong with that production chunk of code - that is what is being run. Also, the Mongo URI needed to be changed to work with the MongoDB cartridge I set up on Openshift: mong…
has comment: http://stackoverflow.com/comment/38560068
has comment: http://stackoverflow.com/comment/38560043
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38560049
tagged with: javascript
tagged with: express
favorite count: 0
has comment: http://stackoverflow.com/comment/38560057
has answer: http://stackoverflow.com/a/24840894
has comment: http://stackoverflow.com/comment/38560054
has title: Site works locally / Not on Openshift (syncing local, global npm package versions with server, global npm package versions)
tagged with: node.js
has comment: http://stackoverflow.com/comment/38560080
has comment: http://stackoverflow.com/comment/38560034
has comment: http://stackoverflow.com/comment/38560067
has comment: http://stackoverflow.com/comment/38560072
has comment: http://stackoverflow.com/comment/38569341
upvote count: 1
tagged with: openshift
type: Question
has comment: http://stackoverflow.com/comment/38560103
linked to: http://stackoverflow.com/q/24847384
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/38560059
has comment: http://stackoverflow.com/comment/38560083
has comment: http://stackoverflow.com/comment/38569325

http://stackoverflow.com/a/24882588
accepted answer of: http://stackoverflow.com/q/24880951
type: AcceptedAnswer
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24880951
has body: Your code hard to read, no code style, and some synax error. However, you'd better create model outside of you view's initialize function, and pass the model as a para when new a view: var modelA = new Model_A(); var viewA = new Model_A_View({ model: modelA }); var modelB = new Model_B(); var viewB = new Model_B_View({ model: modelB }); viewB.listenTo(modelA, "change:ok", viewB.dosomethingFunction);

http://stackoverflow.com/comment/71283785
score: 2
has text: ```navigator.userAgent.match(/rv:11/)``` you must fix this one because it contains no ``:`` marks in your regex string
type: AnswerComment
comment on: http://stackoverflow.com/a/24861307
type: Comment

http://stackoverflow.com/comment/38622296
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/24868429
has text: Why not just try it out?

http://stackoverflow.com/comment/38614778
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24855939
type: Comment
has text: Hi @billy, I setup encoding and decodeing and getting data back from PHP. It all displayed okay in the application. So I echoed the update error and it showed an error near So I manually changed 'times new roman' to "times new roman" and it updated ok. So it looks like the update fails when seeing ''. How do I address this issue ?

http://stackoverflow.com/q/24761404
tagged with: javascript
has comment: http://stackoverflow.com/comment/38419925
possible better answer: http://stackoverflow.com/a/24762236
has comment: http://stackoverflow.com/comment/38420655
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/24762236
has title: Make sticky div function responsive
has comment: http://stackoverflow.com/comment/38420821
has comment: http://stackoverflow.com/comment/38420613
has comment: http://stackoverflow.com/comment/38421401
has comment: http://stackoverflow.com/comment/38420992
tagged with: jquery
has comment: http://stackoverflow.com/comment/38421786
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to figure out how to turn off the sticky ability for my div when my site begins to scale to a specific size (767px). I tried changing the the position from absolute to relative in a media query. But when I tried to scroll past the div the whole screen scrolls back up to the div instead of allowing me to scroll down. How can I remove the sticky effect when I scale to 767px and enable it when I scale to 768 and above? $(function() { var $sidebar = $("#postRecipe"), $window = $(window), offset = $sidebar.offset(), topPadding = 15; $window.scroll(function() { if ($window.scrollTop() &gt; offset.top) { $sidebar.stop().animate({ marginTop: $window.scrollTop() - offset.top + topPadding }); } else { $sidebar.stop().animate({ marginTop: 0 }); } }); }); The CSS #postRecipe { position:absolute; float:left; width:30%; } #content { float:right; width:50%; } http://jsfiddle.net/y8KGG/4/
tagged with: css
has comment: http://stackoverflow.com/comment/38421283
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38420865
has comment: http://stackoverflow.com/comment/38420009
has answer: http://stackoverflow.com/a/24763001
accepted answer: http://stackoverflow.com/a/24763001
type: Question
has comment: http://stackoverflow.com/comment/38421208
has comment: http://stackoverflow.com/comment/38420470

http://stackoverflow.com/a/24799989
downvote count: 0
has body: Your code works. Perhaps the selector #Gridinvoice is wrong. EDIT: Here is your code, updated to use the JSON data: $.each(data.Dpurchaseinvoice, function (key, item) { $("#Gridinvoice").append(' ' + item.pInvoiceDate + ' ' + item.pSupplierInvoiceNumber + ' ' + item.pType + ' ') }); Notice the data.Dpurchaseinvoice and the prefix item.pXXX.
type: Answer
has comment: http://stackoverflow.com/comment/38492865
has comment: http://stackoverflow.com/comment/38539163
has comment: http://stackoverflow.com/comment/38534745
has comment: http://stackoverflow.com/comment/38493020
has comment: http://stackoverflow.com/comment/38493269
upvote count: 1
has comment: http://stackoverflow.com/comment/38563064
score: 1
answers question: http://stackoverflow.com/q/24799553
accepted answer of: http://stackoverflow.com/q/24799553
type: AcceptedAnswer

http://stackoverflow.com/comment/38678275
comment on: http://stackoverflow.com/q/24897723
type: Comment
type: QuestionComment
has text: Your answer is here: http://stackoverflow.com/questions/20442628/cors-jquery-ajax-request
score: 0

http://stackoverflow.com/a/24883151
downvote count: 0
answers question: http://stackoverflow.com/q/24882728
type: Answer
has body: PHP is executed first, server side. Once PHP is done, your browser ( client ) gets the result, Javascript is executed on the client, so after PHP is done. You can't mix javascript and PHP as you did with: &lt;script&gt; function getAlan() { $(document.body).append('&lt;?php setAlan(); ?&gt;'); } function getMark() { $(document.body).append('&lt;?php setMark(); ?&gt;'); } function show() { alert(' &lt;?php echo "{$_SESSION['passed_user']}" ?&gt; '); } &lt;/script&gt; However you can use Javascript to call some server side PHP script with ajax ( Asynchronous JavaScript and XML ). http://www.w3schools.com/ajax/default.ASP
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24882728
score: 1
type: AcceptedAnswer

http://stackoverflow.com/q/24767380
upvote count: 1
type: Question
has title: auto change to the next song after ended
score: 1
answer count: 2
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/24776017
favorite count: 0
has answer: http://stackoverflow.com/a/24767686
has body: I want to auto to play next song after ended until last song. currently this my code. HTML JavaScript $() is document.getElementById(). i make it owns. // my codes is not JQuery but Pure JavaScript. var btn = document.getElementsByClassName('btn'); for(i=0; i < btn.length; i++){ btn[i].addEventListener('click', function(v){ $('audio').src = v.target.getAttribute('name'); $('audio').play(); }, false); //Above codes is not problem but bottom for auto to change next song after ended btn[i].index = i; $('audio').addEventListener('ended', function(){ $('audio').src = btn[this.index+1].getAttribute('name'); $('audio').play(); }, false); } // my ended works is when song ended it will get current index array song then +1 the current index array and play it until last song. but it doesn't work.
has answer: http://stackoverflow.com/a/24767828
type: UnansweredQuestion

http://stackoverflow.com/comment/38584189
has text: makes sense. this from your answer : `escape function redefinition would only happen after` made me think that redefinition was getting executed.
comment on: http://stackoverflow.com/a/24848308
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/24771237
type: Answer
has comment: http://stackoverflow.com/comment/38438479
score: 2
accepted answer of: http://stackoverflow.com/q/24771183
answers question: http://stackoverflow.com/q/24771183
has body: Try this: $(window).bind('resize', function() { $('body').prepend('&lt;div&gt;' + $(window).width() + '&lt;/div&gt;'); }); JSFiddle Demo Works fine in FF and Safari on the maximize/restore button.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/60998569
upvote count: 2

http://stackoverflow.com/a/24774637
has comment: http://stackoverflow.com/comment/38444810
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38445121
answers question: http://stackoverflow.com/q/24774548
type: Answer
upvote count: 3
has body: Use the end of string $ anchor to replace the preceding space and numbers that follow at the end of the string. str = str.replace(/ [0-9]+$/, ''); If you want to retain the space character, just remove it from the regular expression. Working Demo
accepted answer of: http://stackoverflow.com/q/24774548
score: 3

http://stackoverflow.com/comment/38493347
has text: yes, give me 2 minuts, I'll edit the answer with an explanation
comment on: http://stackoverflow.com/a/24799974
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/39878697
type: AnswerComment
type: Comment
has text: Awesome. I missed this too! Works 100% perfect now.
comment on: http://stackoverflow.com/a/24861710
score: 0

http://stackoverflow.com/comment/38648025
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24881830
has text: No, but you can do something like this, http://stackoverflow.com/questions/13640559/asp-net-mvc-url-action-in-external-js-file or declare settings variable in your master
score: 0

http://stackoverflow.com/a/24842644
has comment: http://stackoverflow.com/comment/38583236
has comment: http://stackoverflow.com/comment/38573166
has comment: http://stackoverflow.com/comment/38573142
has comment: http://stackoverflow.com/comment/38573902
has body: Try this answer. https://stackoverflow.com/a/4998892/1640577 complete: function() { $('#namesListView').listview('refresh'); }
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/38574023
type: Answer
answers question: http://stackoverflow.com/q/24842580
score: 1
has comment: http://stackoverflow.com/comment/38573038

trace
tag name: trace
type: Tag
tags question: http://stackoverflow.com/q/24825393

http://stackoverflow.com/q/24880717
has answer: http://stackoverflow.com/a/24880801
type: Question
tagged with: javascript
has body: I'm having trouble retrieving JSON data from a PHP file using jQuery's $.post() method. I can see that a XHR POST request was logged in the console but the response message doesn't appear. Could someone please shed light on why this is happening? form <form action="<?php echo htmlentities($_SERVER['SCRIPT_NAME']); ?>" method="post" id="gradeForm"> What is your current total grade? What is your target grade? What is your final exam worth? Submit **Server side code** <?php $response = validate_form(); if (!empty($response)) { echo ' '; var_dump($response); echo ' '; exit(json_encode($response)); } else { $response = success(); echo ' '; var_dump($response); echo ' '; exit(json_encode($response)); } // validate form input function validate_form() { $response = array(); // currentGrade must be filled out and be a number. if (! (filter_has_var(INPUT_POST, 'currentGrade') && (filter_input(INPUT_POST, 'currentGrade', FILTER_VALIDATE_INT)))) { $currentGrade = array(); $currentGrade['msg'] = "You need to enter a number for current grade"; $response[] = $currentGrade; } // currentGrade must be 0 or greater if ($_POST['currentGrade'] < 0) { $currentGrade = array(); $currentGrade['msg'] = "Current grade must be greater than or equal to zero"; $response[] = $currentGrade; } // targetGrade must be filled out and be a number. if (! (filter_has_var(INPUT_POST, 'targetGrade') && (filter_input(INPUT_POST, 'targetGrade', FILTER_VALIDATE_INT)))) { $targetGrade = array(); $targetGrade['msg'] = "You need to enter a number for target grade"; $response[] = $targetGrade; } // finalWorth must be filled out and be a number. if (! (filter_has_var(INPUT_POST, 'finalWorth') && (filter_input(INPUT_POST, 'finalWorth', FILTER_VALIDATE_INT)))) { $finalWorth = array(); $finalWorth['msg'] = "Your final exam worth needs to be a number."; $response[] = $finalWorth; } $response['success'] = false; return $response; } function success() { $response = array(); $currentGrade = $_POST['currentGrade']; $targe…
answer count: 3
has comment: http://stackoverflow.com/comment/38645782
tagged with: jquery
type: UnansweredQuestion
has title: Trouble retrieving JSON form data with jQuery's $.post() method
has comment: http://stackoverflow.com/comment/38645822
has answer: http://stackoverflow.com/a/24880786
tagged with: php
has answer: http://stackoverflow.com/a/24880785
score: 0
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/38639971
has text: @realph Yeah. Open up your browser's console (for chrome: command-alt-J on mac, control-shift-J on windows). It should appear there. `console.log` is generally a better debugging tool than `document.write` (jsfiddle doesn't let you use `document.write` anyway).
type: AnswerComment
comment on: http://stackoverflow.com/a/24874083
score: 0
type: Comment

http://stackoverflow.com/a/24806827
answers question: http://stackoverflow.com/q/24806772
has comment: http://stackoverflow.com/comment/85485055
has body: Just .filter() it first: var sources = images.filter(function(img) { if (img.src.split('.').pop() === "json") { return false; // skip } return true; }).map(function(img) { return img.src; }); If you don't want to do that, which is not unreasonable since it has some cost, you can use the more general .reduce(). You can generally express .map() in terms of .reduce: someArray.map(function(element) { return transform(element); }); can be written as someArray.reduce(function(result, element) { result.push(transform(element)); return result; }, []); So if you need to skip elements, you can do that easily with .reduce(): var sources = images.reduce(function(result, img) { if (img.src.split('.').pop() !== "json") { result.push(img.src); } return result; }, []); In that version, the code in the .filter() from the first sample is part of the .reduce() callback. The image source is only pushed onto the result array in the case where the filter operation would have kept it. update — This question gets a lot of attention, and I'd like to add the following clarifying remark. The purpose of .map(), as a concept, is to do exactly what "map" means: transform a list of values into another list of values according to certain rules. Just as a paper map of some country would seem weird if a couple of cities were completely missing, a mapping from one list to another only really makes sense when there's a 1 to 1 set of result values. I'm not saying that it doesn't make sense to create a new list from an old list with some values excluded. I'm just trying to make clear that .map() has a single simple intention, which is to create a new array of the same length as an old array, only with values formed by a transformation of the old values.
has comment: http://stackoverflow.com/comment/67382484
has comment: http://stackoverflow.com/comment/95018760
has comment: http://stackoverflow.com/comment/85484862
has comment: http://stackoverflow.com/comment/85017183
has comment: http://stackoverflow.com/comment/67382472
type: Answer
upvote count: 1285
has comment: http://stackoverflow.com/comment/93748132
has comment: http://stackoverflow.com/comment/54556443
has comment: http://stackoverflow.com/comment/95009910
has comment: http://stackoverflow.com/comment/115684599
has comment: http://stackoverflow.com/comment/117180848
has comment: http://stackoverflow.com/comment/67394398
has comment: http://stackoverflow.com/comment/54559296
has comment: http://stackoverflow.com/comment/54557842
downvote count: 5
accepted answer of: http://stackoverflow.com/q/24806772
has comment: http://stackoverflow.com/comment/67382462
score: 1280
has comment: http://stackoverflow.com/comment/54557164
has comment: http://stackoverflow.com/comment/109078917
type: AcceptedAnswer

http://stackoverflow.com/comment/38423413
score: 0
comment on: http://stackoverflow.com/a/24760849
type: AnswerComment
has text: Thanks, I knew there must be a way to get it done using one $interval; so much cleaner that way. Thanks again.
type: Comment

http://stackoverflow.com/q/24875598
has title: ASP.Net How can I iterate all rows in grid using javascript
tagged with: javascript
score: 0
answer count: 1
tagged with: asp.net
has body: i am having trouble in calculation in grid, i made function but it works only on 1st row of grid and calculate total of first row of grid and then show this value in grand total textbox too. I want to do the same on all 4 rows of grid, what do i do? Kindly help. function CalculateTotal() { var Gtot = 0; var RowCount = 0; //var RowCount = document.getElementById('&lt;%= hfGrdRows.ClientID%&gt;').value - 0; //alert(RowCount); var grid = document.getElementById('&lt;%= Grd_Exams.ClientID%&gt;'); for (var i = 1; i &lt; grid.rows.length ; i++) { var cell = grid.rows[i].cells; //var HTML = cell[0].innerHTML; var Participation = document.getElementById('txtCl_Part').value - 0; var Assgnmnt = document.getElementById('txtAssgnmnt').value - 0; var Quiz = document.getElementById('txtQuiz').value - 0; var WrPaper = document.getElementById('txtWP').value - 0; var OSME = document.getElementById('txtOSME').value - 0; //for (var i = 1; i &lt; grdLength - 1; i++) { var Total = parseFloat(Participation) + parseFloat(Assgnmnt) + parseFloat(Quiz) + parseFloat(WrPaper) + parseFloat(OSME); if (!isNaN(Total)) { document.getElementById('txtTotal').value = Total; } else { alert("Nikal"); } } var getTotal = document.getElementById('txtTotal').value - 0; var Gtot = parseInt(Gtot) + parseFloat(getTotal); if (!isNaN(Gtot)) { document.getElementById('txtGTot').value = Gtot; } else { alert("Cannot Show Total"); } var Percentage = (parseFloat(Gtot) * 100) / 400; if (!isNaN(Percentage)) { document.getElementById('txtPercent').value = Percentage; } else { alert("Cannot show percentage"); } }
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24875658
type: Question
tagged with: c#

http://stackoverflow.com/a/31604321
upvote count: 3
has comment: http://stackoverflow.com/comment/51188231
type: Answer
score: 3
has body: You can find the documentation for the invitation API of Linkedin here. However, after reading the documentation, you will see that whoever uses your application to make a new connection will be redirected in Linkedin with the corresponding "invitation message" that is sent on each invitation, so that he verifies the message (or even change it before making the invitation). Thus, your application will not be capable to create new connections, without the person that initiates the connection be informed about that.
downvote count: 0
answers question: http://stackoverflow.com/q/24820531
has comment: http://stackoverflow.com/comment/51197313

http://stackoverflow.com/a/24848228
has comment: http://stackoverflow.com/comment/52544772
type: Answer
has comment: http://stackoverflow.com/comment/66846410
has comment: http://stackoverflow.com/comment/52532147
has comment: http://stackoverflow.com/comment/66840444
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24841855
upvote count: 223
answers question: http://stackoverflow.com/q/24841855
has body: React provides an interface for what you are trying to do via the ref attribute. Assign a component a ref, and its current attribute will be your custom component: class Parent extends React.Class { constructor(props) { this._child = React.createRef(); } componentDidMount() { console.log(this._child.current.someMethod()); // Prints 'bar' } render() { return ( &lt;div&gt; &lt;Child ref={this._child} /&gt; &lt;/div&gt; ); } } Note: This will only work if the child component is declared as a class, as per documentation found here: https://facebook.github.io/react/docs/refs-and-the-dom.html#adding-a-ref-to-a-class-component Update 2019-04-01: Changed example to use a class and createRef per latest React docs. Update 2016-09-19: Changed example to use ref callback per guidance from the ref String attribute docs.
score: 223

http://stackoverflow.com/a/24749445
score: 0
has body: Your are using only one equal, always remember... a single equal is assignment of value, and will almost always return true, double equals is a comparison, and triple equals a type strict comparison. That being said, try changing it to: if(document.forms[0].sex.value == "male") { var yearsleft = Math.round (76 - age); } else if(document.forms[0].sex.value == "female") { var yearsleft = 81 - age; } Let us know if that helps.
type: Answer
answers question: http://stackoverflow.com/q/24749397
has comment: http://stackoverflow.com/comment/38398853

http://stackoverflow.com/comment/38526214
comment on: http://stackoverflow.com/q/24813375
has text: i would follow this way: extended some constructor from BB collection, add method like createStub and in this method add logic of creating models - like @Kyle Needham provided, then you can easily use in any instance of you upgraded constructor, like this- myColl.createStub(8);
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/51475375
has text: I found that Polymer 1.0 not working on Sony Ericson XPERIA default browser. It throws an exception "Window is not defined"
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24889485

http://stackoverflow.com/a/24870457
has comment: http://stackoverflow.com/comment/38627219
has comment: http://stackoverflow.com/comment/38628582
answers question: http://stackoverflow.com/q/24869542
score: 7
type: AcceptedAnswer
downvote count: 0
has body: If you don't have a template, you can use Template.body. Here's a simple example: if (Meteor.isClient) { Template.body.events({ 'click .AddPlaceButton': function (e) { e.preventDefault(); console.log("You pressed the button"); } }); }
type: Answer
has comment: http://stackoverflow.com/comment/38627101
upvote count: 7
accepted answer of: http://stackoverflow.com/q/24869542

http://stackoverflow.com/comment/38625900
score: 3
comment on: http://stackoverflow.com/q/24836384
type: QuestionComment
type: Comment
has text: I'm not asking if Solution 1 is better than Solution 2. All the available solutions I currently have thought of will not work. I'm looking for a Solution to the issue I'm having, not an opinion on what solution I should use, since currently there are none.

http://stackoverflow.com/comment/38882093
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24858270
has text: @FedericoReghenzani Looks like exactly what I'm going through. In my experience however, those support forums never actually have any solutions. (Opened in 2011 in this case, and still nothing) I'll probably star it though.

http://stackoverflow.com/comment/38538874
comment on: http://stackoverflow.com/a/24818445
type: Comment
has text: I actually started writing a plugin that does this very thing! Thanks for posting the answer!
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38420763
type: QuestionComment
has text: Yea, the issue was that Google Charts was getting added after onload/document(ready). Catching the callback fixed the issue.
comment on: http://stackoverflow.com/q/24760341
score: 0
type: Comment

http://stackoverflow.com/q/24883939
has body: I am trying to include a dropbox-album via fancybox, but the iframe-window doesn't show anything. Fancybox is already included and working fine with other contents. jQuery 1.10.1 My href: Dropbox My fancybox js: $(".various").fancybox({ maxWidth : 800, maxHeight : 600, fitToView : false, width : '70%', height : '70%', autoSize : true, closeClick : false, openEffect : 'none', closeEffect : 'none' }); Thx for any ideas =)
answer count: 1
tagged with: dropbox
has answer: http://stackoverflow.com/a/24897874
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38659123
has comment: http://stackoverflow.com/comment/38668895
tagged with: javascript
tagged with: jquery
has title: Dropbox album view with fancybox2
type: Question
tagged with: fancybox
score: 0
tagged with: iframe

http://stackoverflow.com/comment/38641748
type: AnswerComment
score: 0
type: Comment
has text: @jfriend00 thats awesome. Is there any place that you recommend to learn more about the costs of reparenting, or even to a greater extent the advantages of the hierarchical nature of the DOM?
comment on: http://stackoverflow.com/a/24878482

http://stackoverflow.com/q/24807111
has answer: http://stackoverflow.com/a/24807915
linked to: http://stackoverflow.com/q/57854
has comment: http://stackoverflow.com/comment/38585253
upvote count: 24
type: Question
has body: Is it possible to close browsers, using JavaScript, PHP, or HTML without a prompt? I was using this answer: How can I close a browser window without receiving the "Do you want to close this window" prompt? I was using Internet Explorer but it has since been updated to version 10 (soon to be updated to 11) and this exploit does not work. If there is a solution in a different (but updated) browser, that could work as well.
has title: Close Browser without Prompt
downvote count: 9
tagged with: javascript
score: 15
has comment: http://stackoverflow.com/comment/38528896
tagged with: browser
answer count: 2
has answer: http://stackoverflow.com/a/34114311
has comment: http://stackoverflow.com/comment/38585530
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/38436658
has text: add this to your HTML file somewhere in the ` ` tag: ` ` it will load all of the jqueryUI styles for you
comment on: http://stackoverflow.com/a/24769866
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38544178
type: QuestionComment
comment on: http://stackoverflow.com/q/24826430
has text: @CBroe yes you right, I messed
score: 0
type: Comment

http://stackoverflow.com/a/24774844
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24774288
score: 3
upvote count: 3
has body: By doing so: $(document).ready(function(){ $('#Inser_btn').click(function(){ $('.download_list').each(function(){ var checked = $(this).find('.toggle'); if(checked.is(':checked')){ $('input[name="banners_image_local"]').val($(this).find('a').html()); return false; } }); }); }); Here is a demo Fiddle

http://stackoverflow.com/a/24827163
type: Answer
has comment: http://stackoverflow.com/comment/38609727
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/38648276
answers question: http://stackoverflow.com/q/24824220
has comment: http://stackoverflow.com/comment/38608899
accepted answer of: http://stackoverflow.com/q/24824220
has body: Well here is my code: http://jsfiddle.net/htWW6/ This is the script: $(document).ready(function(){ $('select').bind('change',function(){ var loc = $(this).val(); location = "/tagged/" + loc; }); }); This is jquery, so if your theme currently has this installed (many do) then that code should work off the shelf. If not then it is very easy to add jquery, but if you need a pure JS solution, I cannot help with that. Although the other answer does offer some insight.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38771165

http://stackoverflow.com/q/24796170
accepted answer: http://stackoverflow.com/a/24796342
has comment: http://stackoverflow.com/comment/38485863
score: 0
has title: Javascript mouseenter event fired twice
possible better answer: http://stackoverflow.com/a/24796406
tagged with: javascript
has answer: http://stackoverflow.com/a/24796406
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38485915
has answer: http://stackoverflow.com/a/24796342
has comment: http://stackoverflow.com/comment/38486526
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/38485899
has body: .on("mouseenter") and .on("mouseleave"), when console.log the event, in both cases the event.type is "mouseover" Is that normal ? I though that for mouseenter you see event.type "mouseenter" My problem is that javascript mouseenter event fired twice when hovering over the element. I can see that the event.fromElement is different in both fired events. How do I stop the bubbling ? event.stopProppagation, doesn't work &lt;span class="foo-wrapper"&gt; &lt;i class="icon-circle"&gt;&lt;/i&gt; &lt;/span&gt; $(".foo-wrapper .icon-circle").on("mouseenter", function(e){ e.stopPropagation(); cur_target = $(e.target); $("#tooltip").css({'top': parseInt(cur_target.offset().top-116), 'left': parseInt(cur_target.offset().left-141)}).fadeIn(150); } When the mouse enter the .icon-circle, it fires twice.

http://stackoverflow.com/a/24817968
has comment: http://stackoverflow.com/comment/38546024
has comment: http://stackoverflow.com/comment/38550565
answers question: http://stackoverflow.com/q/24817676
downvote count: 0
type: Answer
score: 3
has body: Yes, I see the issue on my iPhone. I'm looking at the source code on the Live Demo you linked to, and you're not using forceHeight: false as you claim to be. It reads: &lt;script type="text/javascript"&gt; skrollr.init({ smoothScrolling: false, mobileDeceleration: 0.004 }); &lt;/script&gt; Try changing it to: &lt;script type="text/javascript"&gt; var s = skrollr.init({ forceHeight: false, smoothScrolling: false, mobileDeceleration: 0.004 }); &lt;/script&gt;
has comment: http://stackoverflow.com/comment/38545773
has comment: http://stackoverflow.com/comment/38546077
upvote count: 3

http://stackoverflow.com/comment/38567614
type: AnswerComment
score: 0
type: Comment
has text: no..its not malformed..i have edited my que.but see this is whole json response{ "status": { "statusCode": 200,"title": " needs", "classname": "NeedController" }, "needs": { "Needs": [{needTitle": "Need a book","needDescription": "story book","fromCustomer": "abc","needDate": "2014-05-15T12:57:13Z","needID": 23, "referrals":{"referrals":[{"referredBy":"xyz","referredOn":"2013-11-19T06:56:18Z","rererralId":3,"referralStatus":"declined","needId":3}]}}and from this response i want to calculate length of the nested array referrals
comment on: http://stackoverflow.com/a/24839716

http://stackoverflow.com/a/24872106
has comment: http://stackoverflow.com/comment/38629834
has comment: http://stackoverflow.com/comment/38629969
has comment: http://stackoverflow.com/comment/38629658
has comment: http://stackoverflow.com/comment/38629869
has comment: http://stackoverflow.com/comment/38630094
answers question: http://stackoverflow.com/q/24872086
has body: try assigning "this" to a variable: jQuery(document).ready(function($) { var request; $('a[rel="bookmark"]').mouseenter(function() { var that=this; // other stuff request = $.ajax({ dataType: "JSON", url: '&lt;?php echo admin_url("admin-ajax.php"); ?&gt;', data: {"action": "our_ajax_function", "id": dataId}, success: function(data){ // other stuff var gettitle = $(that).data('title','Permanent Link to '); } }) }); also while using the HTML5 Data Attribute you can get or modify the data in jQuery with the data() function: $(that).data('title','Permanent Link to '); //sets the "data-title" of the selected element as "Permanent Link to "
downvote count: 1
has comment: http://stackoverflow.com/comment/38631075
has comment: http://stackoverflow.com/comment/38630833
upvote count: 3
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/38630303
has comment: http://stackoverflow.com/comment/38629908
has comment: http://stackoverflow.com/comment/38629663

http://stackoverflow.com/a/24826378
has body: You need to know on your button click what is your "placeholder" text and submit only if the text is different from the placeholder
answers question: http://stackoverflow.com/q/24826160
score: 0
type: Answer

http://stackoverflow.com/q/24762237
favorite count: 0
has comment: http://stackoverflow.com/comment/38421388
tagged with: php
has comment: http://stackoverflow.com/comment/42145720
has title: Smarty variable inside javascript
type: AnsweredQuestion
score: 3
tagged with: smarty
possible better answer: http://stackoverflow.com/a/24767900
accepted answer: http://stackoverflow.com/a/24829882
has body: I am really starting with Smarty and I do not understand this fact: if I put the next code inside my template index.tpl &lt;script type="text/javascript"&gt; function toAlert() { alert('{$text}' ); } &lt;/script&gt; I can access to the function toAlert and show the content of Smarty variable {{$text}}, but if I put this code into a js file lije javascript.js and I try to access it by putting into de template the link: I cannot access to the function as well. Can anyone tell me why or help wher can I find this specific info? thank you!!
downvote count: 1
has answer: http://stackoverflow.com/a/24767900
type: Question
upvote count: 4
answer count: 2
has comment: http://stackoverflow.com/comment/42145281
tagged with: javascript
has answer: http://stackoverflow.com/a/24829882

http://stackoverflow.com/a/24907625
has comment: http://stackoverflow.com/comment/38696808
has comment: http://stackoverflow.com/comment/38696898
answers question: http://stackoverflow.com/q/24907586
has comment: http://stackoverflow.com/comment/38696828
downvote count: 1
has comment: http://stackoverflow.com/comment/38696227
upvote count: 3
type: Answer
has comment: http://stackoverflow.com/comment/38697033
score: 2
has body: You need to escape the line breaks by putting a \ at the end of each line, and also your single quotes by putting \' instead of '. JavaScript expects a string to be terminated in the same line it starts - that's why it says "unterminated string...". To tell it that it goes on, you will have to escape the line break. That's what the backslash is for. This code will work: $('#myTable tbody').append( ' \ \ \ \ \ \ \ \ \ ' );
has comment: http://stackoverflow.com/comment/38696999

http://stackoverflow.com/q/24805994
score: -1
has answer: http://stackoverflow.com/a/24806065
has comment: http://stackoverflow.com/comment/38503896
downvote count: 1
type: Question
has body: I have made for myself input field price check numbers, dot and if comma then replace it to dot. With change function I change comma to dot and use .toFixed(n) I am trying to create one function so then I can call it from different inputs. It is not good idea to create for 20 input 20 change functions. HTML: &lt;input id="txtId" type="text" onkeyup="NumAndTwoDecimals(event , this);"&gt;&lt;/input&gt; &lt;br&gt; &lt;input id="txtId2" type="text" onkeyup="NumAndTwoDecimals(event , this);"&gt;&lt;/input&gt; JS $('#txtId').change(function( event ) { var newVal = String($(this).val()).replace(/\,/g,'.'); var regexp = /^([0-9]+[\.]?[0-9]?[0-9]?|[0-9]+)$/g; if (regexp.test(newVal)) { $(this).val(Number(newVal).toFixed(2)); }else{ // error $(this).val(''); } }); window.NumAndTwoDecimals = function(e , field) { var val = field.value; var re = /^([0-9]+[\,||\.]?[0-9]?[0-9]?|[0-9]+)$/g; var re1 = /^([0-9]+[\,||\.]?[0-9]?[0-9]?|[0-9]+)/g; if (re.test(val)) { //do something here } else { val = re1.exec(val); if (val) { field.value = val[0]; } else { field.value = ""; } } } Demo: http://jsfiddle.net/8vaaZ/5/
tagged with: javascript
has title: Use jquery change function for all fields
tagged with: function
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38503840
type: UnansweredQuestion

python
tags question: http://stackoverflow.com/q/24861207
tags question: http://stackoverflow.com/q/24794298
tags question: http://stackoverflow.com/q/24897069
tags question: http://stackoverflow.com/q/24858052
tags question: http://stackoverflow.com/q/24843104
tags question: http://stackoverflow.com/q/24870896
tags question: http://stackoverflow.com/q/24829204
tags question: http://stackoverflow.com/q/24903378
tag name: python
tags question: http://stackoverflow.com/q/24780681
tags question: http://stackoverflow.com/q/24876571
tags question: http://stackoverflow.com/q/24871598
tags question: http://stackoverflow.com/q/24841178
tags question: http://stackoverflow.com/q/24753013
tags question: http://stackoverflow.com/q/24794408
tags question: http://stackoverflow.com/q/24829726
tags question: http://stackoverflow.com/q/24768580
tags question: http://stackoverflow.com/q/24895642
tags question: http://stackoverflow.com/q/24772500
tags question: http://stackoverflow.com/q/24857011
type: Tag
tags question: http://stackoverflow.com/q/24852376
tags question: http://stackoverflow.com/q/24871336
tags question: http://stackoverflow.com/q/24841168
tags question: http://stackoverflow.com/q/24832924
tags question: http://stackoverflow.com/q/24882778
tags question: http://stackoverflow.com/q/24840785
tags question: http://stackoverflow.com/q/24850991
tags question: http://stackoverflow.com/q/24802189

http://stackoverflow.com/a/24851612
type: AcceptedAnswer
score: 0
downvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/24842036
has body: I did it like this: var table = document.getElementById('&lt;%=tableID.ClientID %&gt;'); for (var i = 0; i &lt; table.rows.length; i++) { //get first column (labels) var lblCtrl = table.rows[i].cells[0].childNodes[0]; //get second column (textBoxes) var txtCtrl = table.rows[i].cells[1].childNodes[0]; //check that the second column is a textBox if (txtCtrl.tagName == "INPUT" || txtCtrl.tagName == "SELECT") { alert(txtCtrl.value); } if (!(lblCtrl.tagName == "INPUT" || lblCtrl.tagName == "SELECT")) { alert(lblCtrl.innerHTML); } }
accepted answer of: http://stackoverflow.com/q/24842036
upvote count: 1

http://stackoverflow.com/comment/38475359
comment on: http://stackoverflow.com/q/24789997
has text: Are you talking about styling the buttons & background?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38556525
comment on: http://stackoverflow.com/q/24833144
has text: btw, cool guys use FireBug to extract values from unselectable HTML elements :P
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24766402
favorite count: 0
has comment: http://stackoverflow.com/comment/38429414
has title: how do i parse json value and get id into variable
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24766515
upvote count: 1
downvote count: 1
type: Question
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/24766515
answer count: 1
has body: hello i am having this code of jquery: var fbuid = zuck; var fbjson = $.getJSON("https://graph.facebook.com/"+fbuid); how to get the id from json directly into var : { id: "4", first_name: "Mark", gender: "male", last_name: "Zuckerberg", link: "https://www.facebook.com/zuck", locale: "en_US", name: "Mark Zuckerberg", username: "zuck" } all i would like to get id from json to var as below: var fbjson.id; how i do it using jquery?
tagged with: jquery

http://stackoverflow.com/comment/38565217
type: QuestionComment
has text: @logan yes. http://jsfiddle.net/stN8U/1/ this solved my problem Thank you.
comment on: http://stackoverflow.com/q/24837646
score: 0
type: Comment

http://stackoverflow.com/q/24789043
type: AnsweredQuestion
downvote count: 2
has answer: http://stackoverflow.com/a/24789056
possible better answer: http://stackoverflow.com/a/24789073
type: Question
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/38472602
has title: How can i do this if statement without refreshing the page?
answer count: 2
has body: I'm building a responsive website using css medias and JQuery. I created a script to check the page width: if ($(window).width() &lt; 1240) { $("#menu").toggle(); //hide menu $('#body-wrap').toggleClass('shifted'); //puts the body width to 100% $('#navbar').toggleClass('shifted'); //puts the navbar width to 100% } But this code only works when I refresh the page. How can I do it automatically? Thanks.
upvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/24789073
favorite count: 0
accepted answer: http://stackoverflow.com/a/24789056

http://stackoverflow.com/comment/38666632
comment on: http://stackoverflow.com/a/24832315
has text: You realize that is a functionality provided by the operating system, and not your application, right?
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/25685588
accepted answer of: http://stackoverflow.com/q/24788525
answers question: http://stackoverflow.com/q/24788525
type: Answer
downvote count: 0
score: 3
has body: It was summernote's bug. Now I fixed it. Thanks you for reporting. Release Note: https://github.com/HackerWins/summernote/releases/tag/v0.5.8 Commit: http://goo.gl/35ln9F
upvote count: 3
type: AcceptedAnswer

http://stackoverflow.com/a/26735173
upvote count: 1
type: Answer
downvote count: 0
has body: Two issues. Firstly your virtual host looks to be configured wrong. Your webroot should be web/ and you should ideally rewrite app.php to hide it. Secondly, and your actual question: you are probably missing certain parameters in your config so your command line can determine your server name: parameters: router.request_context.host: example.org router.request_context.scheme: https router.request_context.base_url: my/path
answers question: http://stackoverflow.com/q/24807676
score: 1

http://stackoverflow.com/comment/38483742
type: QuestionComment
has text: there may be js files in dts_inbound.php file which may be conflicting with datepicker files
score: 0
comment on: http://stackoverflow.com/q/24794946
type: Comment

http://stackoverflow.com/q/24898920
score: 0
answer count: 1
has title: Downloading Images by Count
tagged with: asynchronous
accepted answer: http://stackoverflow.com/a/24899335
has body: I'm using async to download uri's on each request and close when a count is reached, however I discovered that i'm still running into the same problem of the files not being downloaded properly and exiting before it reaches it's max. What's the best way to resolve this? As always, thanks for the help. async.each(images, function (image, callback) { var uri = image.attribs.src; var random = (Math.random() * (3 - 1) + 1) | 0; var stream = fs.createWriteStream(outFile); request(uri).pipe(stream); stream.on('finish', callback); console.log('[' + chalk.green('✓') + ']' + ' wrote image ' + count); count++; if (count === commander.max) { process.exit(0); } sleep.sleep(random); }, function (error) { if (error) { console.log('[' + chalk.red('×') + ']' + ' failed on image ' + count); } });
tagged with: node.js
type: AnsweredQuestion
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/24899335

http://stackoverflow.com/comment/38449586
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24777197
has text: @user3004356 What you're showing in your comment is just an array ? What do you need to do with it ?
score: 0

http://stackoverflow.com/q/24761281
possible better answer: http://stackoverflow.com/a/24761402
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/24762145
has comment: http://stackoverflow.com/comment/38419724
type: Question
has body: I'm pretty new to Angular and trying the ng-options. In my controller, I have: $scope.permissionLevels = [ { value: "ROLE_READ", text: "Read Only" }, { value: "ROLE_WRITE", text: "Write" } ]; In my template, I have: Depending on the view, I want to hide either Read or Write. So in my controller, I have another flag that indicates what view it is. Before I used ng-options, I had a normal select drop down and did something like this: Read Only Write Is there a way to do this with ng-options? Thanks.
tagged with: javascript
upvote count: 13
favorite count: 0
accepted answer: http://stackoverflow.com/a/24762844
has comment: http://stackoverflow.com/comment/38422272
answer count: 3
has title: hiding an option in ng-options
has answer: http://stackoverflow.com/a/24762844
has answer: http://stackoverflow.com/a/24761402
tagged with: angularjs
score: 13

http://stackoverflow.com/a/24844661
upvote count: 1
has body: This is more of a general Javascript question and not really specific to the add-on SDK. E.g. here is the same thing for AJAX or Node. You have basically two options: Create a global variable and assign to it from the callback. E.g. // will be undefined at first, of course var output; self.port.on("gotURL", function(callback) { console.log("gotURL"); output = callback; }); setInterval(function() { console.log("output: " + output); }, 1000); The output will look something like this (i.e. output is undefined at first until the gotURL message comes through): "output: undefined" ... "output: undefined" "gotURL" "output: something" ... Global variables always have a hackish feeling, so just stick to proper callbacks. self.port.on("gotURL", function(callback) { console.log("gotURL"); myOtherAPI.doSomething(callback); });
downvote count: 0
answers question: http://stackoverflow.com/q/24839445
type: Answer
has comment: http://stackoverflow.com/comment/38584104
score: 1

css
tags question: http://stackoverflow.com/q/24793660
tags question: http://stackoverflow.com/q/24854088
tags question: http://stackoverflow.com/q/24876436
tags question: http://stackoverflow.com/q/24803729
tags question: http://stackoverflow.com/q/24811967
tags question: http://stackoverflow.com/q/24779525
tags question: http://stackoverflow.com/q/24861119
tags question: http://stackoverflow.com/q/24793563
tags question: http://stackoverflow.com/q/24823143
tags question: http://stackoverflow.com/q/24781177
tags question: http://stackoverflow.com/q/24886919
tags question: http://stackoverflow.com/q/24752098
tags question: http://stackoverflow.com/q/24817427
tags question: http://stackoverflow.com/q/24853810
tags question: http://stackoverflow.com/q/24752153
tags question: http://stackoverflow.com/q/24818080
tags question: http://stackoverflow.com/q/24814169
tags question: http://stackoverflow.com/q/24864756
tags question: http://stackoverflow.com/q/24750623
tags question: http://stackoverflow.com/q/24767340
tags question: http://stackoverflow.com/q/24855559
tags question: http://stackoverflow.com/q/24880791
tags question: http://stackoverflow.com/q/24884120
tags question: http://stackoverflow.com/q/24768748
tags question: http://stackoverflow.com/q/24806733
tags question: http://stackoverflow.com/q/24909155
tags question: http://stackoverflow.com/q/24776521
tags question: http://stackoverflow.com/q/24779780
tags question: http://stackoverflow.com/q/24871690
tags question: http://stackoverflow.com/q/24803753
tags question: http://stackoverflow.com/q/24816074
tags question: http://stackoverflow.com/q/24833884
tags question: http://stackoverflow.com/q/24843980
tags question: http://stackoverflow.com/q/24846471
tags question: http://stackoverflow.com/q/24781110
tags question: http://stackoverflow.com/q/24798475
tags question: http://stackoverflow.com/q/24812161
tags question: http://stackoverflow.com/q/24774516
tags question: http://stackoverflow.com/q/24894136
tags question: http://stackoverflow.com/q/24875251
tags question: http://stackoverflow.com/q/24882871
tags question: http://stackoverflow.com/q/24859871
tags question: http://stackoverflow.com/q/24860032
tags question: http://stackoverflow.com/q/24864919
tags question: http://stackoverflow.com/q/24859072
tags question: http://stackoverflow.com/q/24801610
tags question: http://stackoverflow.com/q/24772505
tags question: http://stackoverflow.com/q/24880113
tags question: http://stackoverflow.com/q/24842026
tags question: http://stackoverflow.com/q/24755802
tags question: http://stackoverflow.com/q/24815407
tags question: http://stackoverflow.com/q/24783561
tags question: http://stackoverflow.com/q/24879730
tags question: http://stackoverflow.com/q/24840261
tags question: http://stackoverflow.com/q/24781364
tags question: http://stackoverflow.com/q/24878864
tags question: http://stackoverflow.com/q/24769070
tags question: http://stackoverflow.com/q/24798500
tags question: http://stackoverflow.com/q/24886360
tags question: http://stackoverflow.com/q/24885882
tags question: http://stackoverflow.com/q/24767668
tags question: http://stackoverflow.com/q/24878356
tags question: http://stackoverflow.com/q/24827048
tags question: http://stackoverflow.com/q/24901520
tags question: http://stackoverflow.com/q/24879674
tags question: http://stackoverflow.com/q/24818770
tags question: http://stackoverflow.com/q/24870987
tags question: http://stackoverflow.com/q/24782860
tags question: http://stackoverflow.com/q/24876571
tags question: http://stackoverflow.com/q/24822402
tags question: http://stackoverflow.com/q/24769771
tags question: http://stackoverflow.com/q/24816240
tags question: http://stackoverflow.com/q/24836165
tags question: http://stackoverflow.com/q/24864858
tags question: http://stackoverflow.com/q/24868297
tags question: http://stackoverflow.com/q/24900642
tags question: http://stackoverflow.com/q/24838136
tags question: http://stackoverflow.com/q/24800345
tags question: http://stackoverflow.com/q/24780692
tags question: http://stackoverflow.com/q/24817183

http://stackoverflow.com/comment/38482949
type: AnswerComment
has text: @TGH +1 for clarity. :)
type: Comment
comment on: http://stackoverflow.com/a/24794573
score: 0

http://stackoverflow.com/q/24858951
has answer: http://stackoverflow.com/a/24859070
has answer: http://stackoverflow.com/a/24859064
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38605780
tagged with: v8
upvote count: 1
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/38605642
downvote count: 0
has comment: http://stackoverflow.com/comment/38605719
tagged with: javascript
has body: The Performance Tips for JavaScript in V8 says: Don't load uninitialized or deleted elements. And gives the following examples. // example1 a = new Array(); for (var b = 0; b &lt; 10; b++) { a[0] |= b; // Oh no! } // example2 a = new Array(); a[0] = 0; for (var b = 0; b &lt; 10; b++) { a[0] |= b; // Much better! 2x faster. } Now I am wondering why just the first element of the array uninitialized can cause the huge performance difference. I think after the a[0] is assigned for the first time in the loop, the two examples should perform the same. So it should takes almost the same time as they run. Thanks for all the answers.
has comment: http://stackoverflow.com/comment/38605807
has title: JS performace: why don't load uninitialized or deleted elements
has comment: http://stackoverflow.com/comment/38605879
score: 1
favorite count: 0

http://stackoverflow.com/q/24870799
has body: I'm working on a Asp.net MVC application. In my project, I'm using a third party JavaScript library called Dhtmlx Scheduler. There is a function in this library then writes all the data on the scheduler into XML format. I then need to manipulate this data, and write in back onto a &lt;textarea&gt; on my view page. as of now this is what I have: View: function save() { var url = "/Home/Save" var xml = scheduler.toXML(); $.ajax({ url: url, Type: "POST", dataType: 'json', async: false, data: { xmlString: xml }, contentType: 'application/json; charset=utf-8', success: alert("File Saved in C:\\ Drive as Tasks.xml") }); } Controller: public ActionResult Save(string xmlString) { XmlDocument doc = new XmlDocument(); try { doc.LoadXml(xmlString); } catch(Exception e) { Console.WriteLine(e); } doc.Save(@"C:\\Tasks.xml"); W6ViewModel viewModel = new W6ViewModel(); viewModel.engineers = db.W6ENGINEERS.ToList(); viewModel.tasks = db.W6TASKS.ToList(); viewModel.skills = db.W6TASKS_REQUIRED_SKILLS1.ToList(); viewModel.categories = db.W6TASKTYPECATEGORY.ToList(); gatherInfo(viewModel); return View("Index", viewModel); } When trying to save three events (Dhtmlx objects) it works flawlessly, when trying to add more data to the XML I get this error (read form FireBug): The length of the query string for this request exceeds the configured maxQueryStringLength value. Any help would be greatly appreciated. Thanks! Firebug Console:
tagged with: javascript
tagged with: ajax
has answer: http://stackoverflow.com/a/24870959
has comment: http://stackoverflow.com/comment/38627287
has comment: http://stackoverflow.com/comment/38627356
accepted answer: http://stackoverflow.com/a/24871324
answer count: 3
has comment: http://stackoverflow.com/comment/38627359
downvote count: 0
has comment: http://stackoverflow.com/comment/38627873
has title: Asp.Net Sending large amounts of data from view to controller
tagged with: asp.net
possible better answer: http://stackoverflow.com/a/24871904
has comment: http://stackoverflow.com/comment/38627095
favorite count: 0
has answer: http://stackoverflow.com/a/24871904
has comment: http://stackoverflow.com/comment/38626951
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38627004
score: 1
has answer: http://stackoverflow.com/a/24871324
upvote count: 1
has comment: http://stackoverflow.com/comment/38627710
linked to: http://stackoverflow.com/q/8159321
type: Question
tagged with: c#
tagged with: asp.net-mvc

http://stackoverflow.com/comment/38627095
comment on: http://stackoverflow.com/q/24870799
has text: In firebug - is json sent in body request? If yes, you should try to get content of body directly from request `Stream`, not via binder.
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/38482989
has text: +1 for CDN but no downloads please. Can you show me a CDN example using DatePicker?
type: Comment
comment on: http://stackoverflow.com/a/24794550
score: 0
type: AnswerComment

http://stackoverflow.com/q/24819781
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38530584
has title: Warning: Task "karma" not found. Use --force to continue
has body: I've generated an AngularJS project by using Yeoman by running yo Angular myProjectName And I then ran grunt to build the project. But then the build got abborted because of warnings: Deans-MacBook-Air:frontend dean$ grunt Running "newer:jshint" (newer) task Running "newer:jshint:all" (newer) task Running "jshint:all" (jshint) task ✔ No problems Running "newer-postrun:jshint:all:1:/Users/dean/Desktop/myProjectName/frontend/node_modules/grunt-newer/.cache" (newer-postrun) task Running "newer:jshint:test" (newer) task No newer files to process. Warning: Task "karma" not found. Use --force to continue. Aborted due to warnings. Execution Time (2014-07-18 07:37:37 UTC) loading tasks 3ms ▇ 3% newer:jshint 3ms ▇ 3% newer:jshint:all 6ms ▇▇ 6% jshint:all 75ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 79% newer-postrun:...-newer/.cache 1ms ▇ 1% newer:jshint:test 5ms ▇▇ 5% Total 95ms Deans-MacBook-Air:frontend dean$ So yeah... I tried running npm install -g generator-karma and then restarting my terminal after it installed but that didn't work either. I'm using a macbook running OSX 10.9.4 fyi.
tagged with: macos
tagged with: yeoman
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/44640537
has answer: http://stackoverflow.com/a/27949758
tagged with: karma-runner
upvote count: 7
possible better answer: http://stackoverflow.com/a/44640537
has comment: http://stackoverflow.com/comment/38531063
type: Question
score: 7
linked to: http://stackoverflow.com/q/17313157
accepted answer: http://stackoverflow.com/a/27949758
has comment: http://stackoverflow.com/comment/38530452
has comment: http://stackoverflow.com/comment/38538331
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/38532875
tagged with: javascript
has comment: http://stackoverflow.com/comment/38532631
has comment: http://stackoverflow.com/comment/38532100
has comment: http://stackoverflow.com/comment/38535296
favorite count: 0

http://stackoverflow.com/a/54851834
has body: Here is my solution which have time complexity of o(n) function getfirstNonRepeatingCharacterInAString(params) { let count = {}; for (let i = 0; i &lt; params.length; i++) { let count1 = 0; if (!count[params.charAt(i)]) { count[params.charAt(i)] = count1 + 1; } else { count[params.charAt(i)] = count[params.charAt(i)] + 1; } } for (let key in count) { if (count[key] === 1) { return key; } } return null; } console.log(getfirstNonRepeatingCharacterInAString("GeeksfoGeeks"));
type: Answer
answers question: http://stackoverflow.com/q/24793051
score: 0

http://stackoverflow.com/comment/38494462
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24800681
type: AnswerComment
has text: Thank you! at least the collasping works. Still, the sidebar doesn't collapse when I resize the window's width: here is the website. Appreciate any advice.

http://stackoverflow.com/a/24762456
has comment: http://stackoverflow.com/comment/38422778
downvote count: 0
answers question: http://stackoverflow.com/q/24762153
upvote count: 2
type: Answer
score: 2
has body: var groupedObj = {}; for(var i = 0; i&lt; arrayOne.length; i ++) { if (typeof groupedObj[arrayOne[i]] === "undefined") groupedObj[arrayOne[i]] = []; groupedObj[arrayOne[i]].push(arrayTwo[i]); } groupedObj will contain your desired result

http://stackoverflow.com/q/24892790
has comment: http://stackoverflow.com/comment/38672362
tagged with: knockout.js
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38672099
score: 0
has comment: http://stackoverflow.com/comment/38671424
tagged with: http://stackoverflow.com/tag/html
has body: Currently I am working on a card voting system. I can get it to work properly in a jsfiddle but when i use microsoft visual studious and debug it, the cards do not display. Here is my fiddle http://jsfiddle.net/grahamwalsh/6RnXM/ and here is my code Voting (Html) Voting Selected Card Voting (CSS) body {.profile { width: 50px; height: 80px; color: black; background-color:silver; border: 1px solid black; float: left; line-height:80px; text-align: center; margin: 2px; } .highlight { background: yellow !important; border:1px solid #000; color: black; } } function Card(number) { this.active = ko.observable(false); this.name = ko.observable(number); } var model = function () { var cards = [1, 2, 3, 5, 8, 13, 20, 40, 100]; for (var i = 0 ; i < cards.length ; i++) cards[i] = new Card(cards[i]); var items = ko.observableArray(cards) var selectedItems = ko.computed(function () { return _.filter(items(), function (item) { return item.active(); }); }) var clicked = function (item) { items().forEach(function (item) { item.active(false) }); item.active(!this.active()); }; var save = function () { alert("sending items \n" + ko.toJSON(selectedItems())); } return { items: items, selectedItems: selectedItems, save: save, clicked: clicked } } ko.applyBindings(model); Voting (Js) function Card(number) { this.active = ko.observable(false); this.name = ko.observable(number); } var model = function () { var cards = [1, 2, 3, 5, 8, 13, 20, 40, 100]; for (var i = 0 ; i < cards.length ; i++) cards[i] = new Card(cards[i]); var items = ko.observableArray(cards) var selectedItems = ko.computed(function () { return _.filter(items(), function (item) { return item.active(); }); }) var clicked = function (item) { items().forEach(function (item) { item.active(false) }); item.active(!this.active()); }; var save = function () { alert("sending items \n" + ko.toJSON(selectedItems())); } return { items: items, selectedItems: selectedItems, save: save, clicked: clicked } } ko.applyBindings(model);
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38671886
has title: Divs display in fiddle but not when i debug
has comment: http://stackoverflow.com/comment/38673369
answer count: 0

http://stackoverflow.com/comment/38596668
comment on: http://stackoverflow.com/a/24854367
has text: Maybe try returning something ... return checkPos(diff, function (e) { return e; });
score: 0
type: AnswerComment
type: Comment

funcunit
tag name: funcunit
tags question: http://stackoverflow.com/q/24790871
type: Tag

http://stackoverflow.com/a/24862722
has comment: http://stackoverflow.com/comment/38649771
has comment: http://stackoverflow.com/comment/38650295
has comment: http://stackoverflow.com/comment/38656285
has comment: http://stackoverflow.com/comment/38643985
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24862400
score: 1
has comment: http://stackoverflow.com/comment/38643676
has comment: http://stackoverflow.com/comment/38644314
has body: In your Plunker given the value from the Gender is getting within the $scope.user $scope.submitTheForm=function(){ myService.setForm($scope.user); $scope.user={}; }; Check this Working Demo
answers question: http://stackoverflow.com/q/24862400
has comment: http://stackoverflow.com/comment/38653593
has comment: http://stackoverflow.com/comment/38643927
has comment: http://stackoverflow.com/comment/38700140
has comment: http://stackoverflow.com/comment/38613621
has comment: http://stackoverflow.com/comment/38657562
has comment: http://stackoverflow.com/comment/38643755
has comment: http://stackoverflow.com/comment/38643845
has comment: http://stackoverflow.com/comment/38643742
has comment: http://stackoverflow.com/comment/38643588
upvote count: 1
has comment: http://stackoverflow.com/comment/38643792
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38648900
has comment: http://stackoverflow.com/comment/38644036
has comment: http://stackoverflow.com/comment/38654263
type: Answer

http://stackoverflow.com/comment/38641666
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24878480
score: 0
has text: @Josh: You mean a newer one, don't you? "Removed in 1.9" means it's not in 1.9.1 anyway.

http://stackoverflow.com/a/24879465
has comment: http://stackoverflow.com/comment/38643347
type: AcceptedAnswer
has body: Try this: $('#quote_form').submit(function(e) { e.preventDefault(); select(); }); instead of: $('#quote_form').submit(function(e) { event.preventDefault();//error event is undefinded select(); }); Update If you add onclick="this.form.submit()" its submitting form and firing jquery submit event. I found a solution: remove onclick from select and add click event in document.ready, also remove error(0) its giving error error not defined. $("#peak_usage").change(function(){ $('#quote_form').submit(); }); You can also set: ^^^^^^^^^^^^^^^^^^^^^^^^ Reason: Because this.form will give you the form of the form element. and $('#quote_form') gives you form object. DEMO
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24879446
answers question: http://stackoverflow.com/q/24879446
score: 1
has comment: http://stackoverflow.com/comment/38643544
upvote count: 1

http://stackoverflow.com/comment/38699252
type: Comment
has text: @dakov no problem, I noticed while debugging that you might have nested too deep the actual setTimeout check using mutation.addedNodes.length :) That's why it is worth to simplify as it is known without doing so with the callback in the first place. I would suggest that use mutations.forEach loop only if you really need to know more about the elements you have added.
comment on: http://stackoverflow.com/a/24909147
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38628782
comment on: http://stackoverflow.com/q/24871690
score: 0
has text: Have you looked at parallax.js/stellar.js/etc or are you trying to do this yourself as an exercise?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38468492
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24786956
has text: Missing `/>` on the button?

http://stackoverflow.com/q/24777295
has body: When I try to remove all rules with chrome.declarativeContent.onPageChanged.removeRules(), it says: Error in response to events.removeRules: Error: Invalid value for argument 1. Property '.1': Value does not match any valid type choices, Property '.2': Value does not match any valid type choices. This is the code, I just copied it from here: https://developer.chrome.com/extensions/examples/api/pageAction/pageaction_by_url/background.js // When the extension is installed or upgraded ... chrome.runtime.onInstalled.addListener(function () { console.log('installed'); // Replace all rules ... chrome.declarativeContent.onPageChanged.removeRules(undefined, function () { console.log('removed'); // With a new rule ... chrome.declarativeContent.onPageChanged.addRules([ { conditions: [ new chrome.declarativeContent.PageStateMatcher({ pageUrl: { urlEquals: 'www.google.com' } }) ], actions: [new chrome.declarativeContent.ShowPageAction(), console.log('hi'), init()] } ]); }); }); The weird thing is that the console says (in this order): hi installed removed error above (error in response to...) Any help would be appreciated. Thanks.
has title: chrome.declarativeContent.onPageChanged.removeRules(undefined, function(){}) not working
has answer: http://stackoverflow.com/a/24778426
type: UnansweredQuestion
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/38451345
type: Question
tagged with: declarative
upvote count: 4
has comment: http://stackoverflow.com/comment/38451291
answer count: 1
downvote count: 0
tagged with: javascript
score: 4
favorite count: 0
tagged with: runtime-error
tagged with: google-chrome-extension

http://stackoverflow.com/comment/38455849
comment on: http://stackoverflow.com/a/24763553
score: 0
type: AnswerComment
type: Comment
has text: @Yogesh what do you mean by doesn't work? Can you elaborate on what is not working? You are not getting input field values in controller or what?

http://stackoverflow.com/q/24863143
upvote count: 1
tagged with: knockout.js
answer count: 1
has answer: http://stackoverflow.com/a/24866644
tagged with: javascript
has title: knockout apply binding to dynamically loaded html from ajax mvc contrib grid
type: AnsweredQuestion
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/24866644
tagged with: jquery
favorite count: 0
tagged with: mvccontrib-grid
type: Question
has body: I have an AJAX MVC Contrib Grid implementation, that already existed and now I am in a situation where I am trying to bolt on some knockout functionality... and I want to know if this is possible without changing the whole grid implementation. This is the refresh grid function that is setting the container html when the pagination changes. scope.refreshGrid = function (container, url) { if (url) container.data(scope.selectors.actionUrlAttribute, url); $.post((url || container.data(scope.selectors.actionUrlAttribute)), scope.getParams(), function(html) { container.html($(html).html()); scope.bindDeleteButtons(); }).done(function() { container.trigger("refresh.ctb.grid"); }); } one of the columns for the grid is custom column that uses Html.Partial like this: column.Custom(x =&gt; Html.Partial("_CartSelection", new CartSelection(x.Id))); The partial view has the below markup with some knockout data bindings &lt;input type="checkbox" value="@Model.Id" data-bind="enable: (selectionEnabled() || $element.checked), checked: selectionIds" /&gt; This works for the first page of results, when the paging is selected to change the page and the container html() is updated the bindings no longer work but the KO viewModel still has the correct selectionIds.. which is what I was expecting to happen. The KO view model is being applied as shown below, where the grid has a wrapper parent div with an id of "cart": $(function() { var viewModel = new IP.Configuration.CartSelector(new IP.Router()); ko.applyBindings(viewModel, document.getElementById("cart")); }); I have already seen comments in other posts about how you shouldn't re-apply bindings. In my case it seems I want to apply bindings but only to some child nodes that are being dynamically loaded. Is this possible? UPDATE: Almost had this working by adding a cart-selection class to each checkbox and doing the below in a rebind function on the viewModel, where self is the viewModel: $("#cart .cart-selection").each(function(index, i…
tagged with: asp.net-mvc-4

http://stackoverflow.com/a/25172740
has comment: http://stackoverflow.com/comment/114176278
has comment: http://stackoverflow.com/comment/87794428
accepted answer of: http://stackoverflow.com/q/24753908
type: Answer
has comment: http://stackoverflow.com/comment/88534236
has comment: http://stackoverflow.com/comment/71284078
has comment: http://stackoverflow.com/comment/86786699
has comment: http://stackoverflow.com/comment/67006649
answers question: http://stackoverflow.com/q/24753908
upvote count: 374
type: AcceptedAnswer
downvote count: 0
has body: You need to have a @require in the user script header to load jQuery. Something like: // @require https://code.jquery.com/jquery-3.6.0.min.js (Selecting your desired version from the of list of available versions of jQuery)
score: 374

http://stackoverflow.com/comment/38544719
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/24827533
has text: *Forms and their child elements should not use input names or ids that conflict with properties of a form, such as submit, length, or method. Name conflicts can cause confusing failures.* ` `

http://stackoverflow.com/a/24927865
type: Answer
answers question: http://stackoverflow.com/q/24888980
upvote count: 1
score: 1
downvote count: 0
has body: Either use your own solution or you will have to specify onclick as a valid attribute to prevent the stipping of this attribute using the tinymce valid_elements setting. Example: valid_elements: "@[id|class|title|style|onmouseover|onclick]," + "a[name|href|target|title|alt]," + "#p,blockquote,-ol,-ul,-li,br,img[src|height|width],-sub,-sup,-b,-i,-u," + "-span[data-mce-type],hr",

http://stackoverflow.com/q/24763824
score: 0
answer count: 1
has title: Load Multiple XML on Google Maps
type: UnansweredQuestion
has body: I am trying to load points from two different XML files onto my Google Map. Points from both XML files load and show up, however when I click on the points loaded with the second xml file there is no balloon that pops up showing its html like the first xml files points do. If I remove the script that loads the first xml file, the balloons show up fine for the second xml file like so: I need to know how to map the points from both xml files and keep the balloons working, I can't figure it out. Here is some of the code loading the xml files: function load() { var map = new google.maps.Map(document.getElementById("map"), { center: new google.maps.LatLng(30.214632, -97.799502), zoom: 9, mapTypeId: 'roadmap' }); var infoWindow = new google.maps.InfoWindow; // Change this depending on the name of your PHP file downloadUrl("phpsqlsearch_genxml2.php", function(data) { var xml = data.responseXML; var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i &lt; markers.length; i++) { var name = markers[i].getAttribute("name"); var lastname = markers[i].getAttribute("lastname"); var address = markers[i].getAttribute("address"); var fulladdress = markers[i].getAttribute("fulladdress"); var city = markers[i].getAttribute("city"); var zip = markers[i].getAttribute("zip"); var state = markers[i].getAttribute("state"); var type = markers[i].getAttribute("type"); var point = new google.maps.LatLng( parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng"))); var html = "&lt;b&gt;" + name + " " + lastname +"&lt;/b&gt; @ &lt;b&gt;" + type + "&lt;/b&gt; &lt;br/&gt;" + address + "&lt;/b&gt; &lt;br/&gt;" + fulladdress; var icon = customIcons[type] || {}; var marker = new google.maps.Marker({ map: map, position: point, icon: icon.icon, shadow: icon.shadow }); var ctaLayer = new google.maps.KmlLayer('/kmz/&lt;?php echo $name ?&gt;.kmz'); ctaLayer.setMap(map); bindInfoWindow(marker, map, infoWindow, html); } }); downloadUrl("/trucks/xmldat…
has answer: http://stackoverflow.com/a/24764167
type: Question
tagged with: google-maps
tagged with: javascript
tagged with: google-maps-api-3

http://stackoverflow.com/a/24815411
upvote count: 17
type: Answer
downvote count: 0
score: 17
has body: I usually split various client related functionality (I usually call them handlers) into individual modules, and then require and use them in whatever file creates the socket.io connection. Here is an example module, that exports a function which expects to be passed a socket.io client: /* register-handler.js */ module.exports = function (client) { // registration related behaviour goes here... client.on('register', function (data) { // do stuff }); }; Which is consumed by a file that creates a new socket, listens for connections, and passes them to the handler, which then listens to events on the client. /* main.js */ // require your handlers var handleRegister = require('./register-handler'); // .. set up socket.io socket.on('connection', function (client) { // register handlers handleRegister(client); });
accepted answer of: http://stackoverflow.com/q/24815106
answers question: http://stackoverflow.com/q/24815106
type: AcceptedAnswer

http://stackoverflow.com/comment/38509959
score: 0
type: AnswerComment
has text: Thanks for a quick response.
comment on: http://stackoverflow.com/a/24790486
type: Comment

http://stackoverflow.com/q/24840967
has body: I need to create a form of calculator, where the user inputs their information to get the result. I need 3 numbers, each in a seperate field, to be added together and then subtracted from 6000 via a submit button. The result will appear in a fourth field, text read only. Then (this is the part I can't seem to find) the number created in that fourth field will be subtracted from 2000 and divided by 3, the result appearing in a fifth field. Makes sense? Here is more of a breakdown: One: ### Two: ### Three: ### Four (6000-(one+two+three)): ### Five ((2000-four)/3): ### Here is some code I have already: One &amp;nbsp;&lt;input name=text type=text value=0&gt;&lt;br&gt; Two &amp;nbsp;&lt;input name=text type=text value=0&gt;&lt;br&gt; Three &amp;nbsp;&lt;input name=text type=text value=0&gt;&lt;br&gt;&lt;br&gt; &lt;input type=button value="Calculate" onclick="subtract()"&gt;&lt;br&gt;&lt;br&gt; Four &lt;br&gt;&lt;br&gt;&lt;input name=sum id=sum type=text readonly&gt;&lt;/font&gt; &lt;script language=javascript&gt; function subtract() { var sum =6000; var valid = true; var inputs = document.getElementsByName( 'text'); for(i =0; i &lt; inputs.length; i++) { if( inputs[i].value.match( /^[0]*(\d+)$/)) { sum -= parseInt(RegExp.$1); } else {valid=false;} } if(valid) { document.getElementById( 'sum').value = sum; } else{ alert("Please enter numbers only"); } } &lt;/script&gt; Any help is much appreciated!
type: AnsweredQuestion
has title: HTML/Javascript Calculation
score: 0
tagged with: math
type: Question
has answer: http://stackoverflow.com/a/24841077
tagged with: javascript
tagged with: divide
answer count: 1
tagged with: calculator
accepted answer: http://stackoverflow.com/a/24841077
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/24822800
tagged with: function
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24822916
has answer: http://stackoverflow.com/a/24822916
has body: I have a function that checks if a number is divisible by 2.5, if it isn't it adds 0.5 then calls itself again with the new value. It returns undefined when I call it like below but if I console.log instead of returninside the function then the correct rounded up value displays. function n(num){ if(num % 2.5 === 0){ return num; }else{ num += 0.5; n(num) } } console.log(n(13.5)) Any ideas?
tagged with: undefined
favorite count: 0
has answer: http://stackoverflow.com/a/24822903
upvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24822903
score: 1
type: Question
has title: Recurring function returning undefined
answer count: 2

http://stackoverflow.com/a/24886595
type: Answer
downvote count: 0
has body: Solution: One should actually use the correct syntax if one wants code to run correctly... $('#'+event.relatedTarget.id).hide(); This would actually be a correct and working solution : http://jsfiddle.net/Zyy2N/3/
accepted answer of: http://stackoverflow.com/q/24875396
score: 1
answers question: http://stackoverflow.com/q/24875396
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/38449580
has text: The field on which to apply the custom renderer in only known at run-time, thus your proposal will not do it. Thanks for answering in any case.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24762883

http://stackoverflow.com/q/24892403
score: 2
has answer: http://stackoverflow.com/a/24893193
downvote count: 0
tagged with: ios
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29267042
type: Question
has body: I'm trying use the Facebook slider menu on iOS, with the PhoneGap. The problem is that I am not able to insert data in sqlite, When clicking on the save button I got this error: "Uncaught ReferenceError: cordova is not defined". This is the source: Registration Form
has answer: http://stackoverflow.com/a/58715929
has comment: http://stackoverflow.com/comment/93222584
has comment: http://stackoverflow.com/comment/38667840
tagged with: cordova
upvote count: 2
has answer: http://stackoverflow.com/a/24897139
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38667833
has title: “Uncaught ReferenceError: cordova is not defined”
answer count: 4

http://stackoverflow.com/comment/38610098
has text: i tried to upload the file in a server and i changed the url but i get the same error also. Thanks
score: 0
comment on: http://stackoverflow.com/q/24861171
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/98149646
type: AnswerComment
has text: This seems to be a solution for how to delete all of an object's properties, leaving you with `object === {}`. This in no ways answers the OP's question.
type: Comment
score: 2
comment on: http://stackoverflow.com/a/49277569

http://stackoverflow.com/comment/38593182
has text: Yes I think that's where the `undefined` in the OP version is coming from; the assignment leaves `this.color` as `undefined`.
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/24853222

http://stackoverflow.com/q/24761070
answer count: 2
tagged with: jsp
type: UnansweredQuestion
has title: JSP/Javascript: How to dynamically change a header based on the page im on
has comment: http://stackoverflow.com/comment/38419690
type: Question
has answer: http://stackoverflow.com/a/24761296
tagged with: javascript
has answer: http://stackoverflow.com/a/24992342
has body: I have a header.jsp file that is included in all my pages on the website what acts as a template for all my header content (e.g site titles, logos, home links etc.). Inside this header.jsp I want to set up a page title in a h1 tag (for example) that would change to show the title of whatever page I am on when navigating through the pages of the website. My initial thought was to use javascript to achieve this however based on the tutorials, most people are using frameworks like angular which I dont really want to resort to using unless there was no alternative. Is there any way I can change my headers to pick up whatever page I am on using raw JavaScript? Or, is there anything in jsp that can also make this possible? If so how can I achieve this?
score: 0

http://stackoverflow.com/comment/38477070
has text: @naomik That is the Manhattan distance and it is used for some applications - I don't know if it is applicable here.
type: AnswerComment
comment on: http://stackoverflow.com/a/24791090
type: Comment
score: 0

http://stackoverflow.com/a/24961553
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24882597
has body: The mapping of camelized case and underscored case is done in ActiveModelAdapter.pathForType function. You can override it and make your changes there. For instance, to change from camelized case to underscored case: App.ApplicationAdapter = DS.ActiveModelAdapter.extend({ pathForType: function(type) { var decamelized = Ember.String.decamelize(type); var underscored = Ember.String.underscore(decamelized); //Alternatively, you can change urls to dasherized case using this line //var dasherized = Ember.String.dasherize(decamelized); return Ember.String.pluralize(underscored); } }); The strange part is that the latest Ember Data already has this code in ActiveModelAdapter. You may want to check the version you are running and upgrade to that instead of the change I suggest above.
accepted answer of: http://stackoverflow.com/q/24882597
upvote count: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/24867628
answer count: 1
linked to: http://stackoverflow.com/q/1631959
tagged with: onbeforeunload
type: UnansweredQuestion
type: Question
has title: beforeunload event for cookie delete and page refresh
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/24868525
has comment: http://stackoverflow.com/comment/38620822
has body: In my webpage I want to logout a user when s/he closes the window. To capture this event I am using beforeunload event handler. But when I do close the tab the removeCookie is not called. Here is the sample code. This is a modified code of this SO Question var preventUnloadPrompt; var messageBeforeUnload = "my message here - Are you sure you want to leave this page?"; $('a').live('click', function () { preventUnloadPrompt = true; }); $('form').live('submit', function () { preventUnloadPrompt = true; }); if ($("#refreshFlag").val() == 1) { preventUnloadPrompt = true; }; $(window).bind("beforeunload", function (e) { var rval; if ($("#refreshFlag").val() == 1) { preventUnloadPrompt = true; }; if (preventUnloadPrompt) { return; } else { removeCookie(); window.location = "/"; } return rval; }) I am using JQuery 1.5.2. What I want is when a user refresh the page it should refresh and when the tab is closed the "removeCookie" should be called. What is it that I am doing wrong in the above code? UPDATE As the refresh was giving problem this event was dropped from the project.

http://stackoverflow.com/q/24756947
downvote count: 0
tagged with: javascript
has title: handle click on Ext.js panel header
tagged with: extjs
has body: I am trying to handle clicks on ext.js panel header (living inside of an accordion with other panels..), now the header is an extended header, and it contains a number of items (not tools) in it. Problem is that when I set titleCollapse:true, clicks on my items are propagated to the header, which collapses. I want to set titleCollapse:true so I the users will be able to collapse/expand by clicking the header and not only the collapse tool. But, then, this problem..
answer count: 1
tagged with: extjs5
score: 1
favorite count: 0
type: UnansweredQuestion
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/24757769

http://stackoverflow.com/comment/38555877
has text: AJAX expects a response. If you bounce out of the page at the server side, AJAX won't get a response. You shouldn't be using AJAX. Whatever you intend to do with that AJAX call needs to be done as a simple POST to the PHP file.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24833358
type: QuestionComment

http://stackoverflow.com/q/24803912
has comment: http://stackoverflow.com/comment/38510834
favorite count: 0
accepted answer: http://stackoverflow.com/a/24843097
has comment: http://stackoverflow.com/comment/38563306
has comment: http://stackoverflow.com/comment/38499942
has answer: http://stackoverflow.com/a/24843097
type: AnsweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38567421
has comment: http://stackoverflow.com/comment/38504918
type: Question
has title: Update the form on select change Struts2
tagged with: jsp
tagged with: javascript
has body: I have select tag outside the form , in onchange event of select i publish the listenTopics of anchor tag and get the result in json which is correct but it replaces the form with json data I need to update the form. Any idea what might be wrong here or there is any other way to do this. &lt;script type="text/javascript"&gt; function reloadForm() { $.publish('reloadFormList'); } &lt;/script&gt; &lt;div id="body" style="text-align: center;width: 100%;"&gt; &lt;s:form id="formSelect" style="margin-top:20px;"&gt; &lt;s:select list="model.classList" name="model.selectedID" listKey="classID" listValue="className" headerKey="-1" headerValue="" theme="simple" label="Class" style="margin-bottom:10px;" onchange="reloadForm();" /&gt; &lt;sj:a formIds="formSelect" href="getEmailSett" targets="form" style="display:none;" listenTopics="reloadFormList"&gt;&lt;/sj:a&gt; &lt;/s:form&gt; &lt;s:form id="form"&gt; &lt;s:checkbox label="OPtion1" title="OPtion1" name="model.chk_option1" style="margin-top:20px;"&gt;&lt;/s:checkbox&gt; &lt;s:checkbox label="OPtion2" title="OPtion2" name="model.chk_option2" style="margin-top:20px;"&gt;&lt;/s:checkbox&gt; &lt;sj:submit id="formSubmit" href="mysubmit" value="Update" indicator="indicator" button="true" /&gt; &lt;/s:form&gt; &lt;/div&gt;
has comment: http://stackoverflow.com/comment/38567660
tagged with: struts2
tagged with: struts2-jquery
has comment: http://stackoverflow.com/comment/38557676
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/38512462

http://stackoverflow.com/q/24845143
tagged with: jquery
has comment: http://stackoverflow.com/comment/38577854
accepted answer: http://stackoverflow.com/a/24856163
type: AnsweredQuestion
has title: For all links, add css to switch color of link based off Post Type using JS or PHP - Wordpress
has body: I'm not sure what route to start down or what would be the appropriate way to do what I'm trying to accomplish here. Whether it's possible to do in PHP, or how to do it in JS, any help is greatly appreciated. For each link found on a page, (possibly found within widgets,theme's template pages, forums, etc.), how do I search and find out the post_type and then append a specific link color for that particular type? So for example: For a list of recent posts in a sidebar widget (here is the best way I can describe the code intentions): For each post_type, dynamically set the following 'post'= color:black, 'project' = color:dark blue, 'topics' = color:dark green, and so on. Additionally, if there is a link to another post anywhere else in the site, such as in another post's body content or even a forum topic, I need to append a class to that link. Then my CSS can be something along the lines of .forum-post-link{color: #006400;} .project-post-link{color: #00008B;} .standard-post-link{color:#000;}
has comment: http://stackoverflow.com/comment/38598645
type: Question
has comment: http://stackoverflow.com/comment/38598555
tagged with: php
tagged with: css
answer count: 1
score: 0
has answer: http://stackoverflow.com/a/24856163
tagged with: wordpress
tagged with: javascript

http://stackoverflow.com/a/24827178
has comment: http://stackoverflow.com/comment/38544016
downvote count: 0
has body: Because inline css attribute has more priority then included one. So when you set it with jQuery it got like this: style="border-color: #af0621". Try to use !important in your css: .profile_nav_item:hover { border-color: #af0621 !important; }
has comment: http://stackoverflow.com/comment/38544191
has comment: http://stackoverflow.com/comment/38544185
answers question: http://stackoverflow.com/q/24827138
score: 1
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/38544413

http://stackoverflow.com/comment/38676341
score: 2
comment on: http://stackoverflow.com/q/24896994
type: Comment
type: QuestionComment
has text: No, there's no way to do that with CSS, do you want to do it with javascript then, as you've tagged the question as such ?

http://stackoverflow.com/comment/38401935
comment on: http://stackoverflow.com/q/24751430
type: Comment
type: QuestionComment
has text: you have written `document.getElementById('postTW').checked` but I don't see the ID's anywhere. please post some more code.
score: 0

http://stackoverflow.com/q/24823782
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24865954
upvote count: 3
type: Question
tagged with: mongodb
tagged with: javascript
score: 3
answer count: 1
downvote count: 0
has title: time series and aggregation framework (mongo)
favorite count: 0
has body: I'm trying to synchronise two functions I run in my app. First one checks the count of the documents I save to MongoDB every time block (e.g. every 10 seconds) in the real time: var getVolume = function(timeBlock, cb) { var triggerTime = Date.now(); var blockPeriod = triggerTime - timeBlock; Document.find({ time: { $gt: blockPeriod } }).count(function(err, count) { log('getting volume since ', new Date(blockPeriod), 'result is', count) cb(triggerTime, count); }); }; and then I have the second function which I use whenever I want to get a data for my graph (front end): var getHistory = function(timeBlock, end, cb) { Document.aggregate( { $match: { time: { $gte: new Date(end - 10 * timeBlock), $lt: new Date(end) } } }, // count number of documents based on time block // timeBlock is divided by 1000 as we use it as seconds here // and the timeBlock parameter is in miliseconds { $group: { _id: { year: { $year: "$time" }, month: { $month: "$time" }, day: { $dayOfMonth: "$time" }, hour: { $hour: "$time" }, minute: { $minute: "$time" }, second: { $subtract: [ { $second: "$time" }, { $mod: [ { $second: "$time" }, timeBlock / 1000 ]} ]} }, count: { $sum: 1 } } }, // changing the name _id to timeParts { $project: { timeParts: "$_id", count: 1, _id: 0 } }, // sorting by date, from earliest to latest { $sort: { "time": 1 } }, function(err, result) { if (err) { cb(err) } else { log("start", new Date(end - 10 * timeBlock)) log("end", new Date(end)) log("timeBlock", timeBlock) log("&gt;****", result) cb(result) } }) } and the problem is that I can't get the same values on my graph and on the back-end code (getVolume function) I realised that the log from getHistory is not how I would expect it to be (log below): start Fri Jul 18 2014 11:56:56 GMT+0100 (BST) end Fri Jul 18 2014 11:58:36 GMT+0100 (BST) timeBlock 10000 &gt;**** [ { count: 4, timeParts: { year: 2014, month: 7, day: 18, hour: 10, minute: 58, second: 30 } }, { count: 6, timeParts: { year: 2014, month: 7, day: 18, hour: …
tagged with: aggregation-framework
has answer: http://stackoverflow.com/a/24865954

http://stackoverflow.com/a/24910412
has body: With ngTagsInput it is possible to both select from autocomplete, or add tag if it's not in the list Docs: http://mbenford.github.io/ngTagsInput/demos See Demo: http://run.plnkr.co/plunks/bDx54d/
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24908941
answers question: http://stackoverflow.com/q/24908941
type: Answer

http://stackoverflow.com/comment/38400680
comment on: http://stackoverflow.com/q/24751153
has text: y dont u place the script function after
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24793242
has title: JavaScript / Node Syntax Misunderstanding
type: Question
has comment: http://stackoverflow.com/comment/38480554
score: 0
has comment: http://stackoverflow.com/comment/44037657
has comment: http://stackoverflow.com/comment/44036758
tagged with: passport.js
tagged with: node.js
answer count: 0
has comment: http://stackoverflow.com/comment/44038448
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38480586
has body: I'm working on a Node.js app. Everytime I think I understand JavaScript, a curve ball is thrown at me that I don't understand. Currently, I'm trying to use passport.js to authenticate a user. I have the following code (which works): passport.authenticate('google')(req, res, function() { // TODO: Handle a user not authenticating // This is the happy path. It will always execute. However, it should only execute if a user authenticated with google. logger.info('user authenticated'); res.redirect(307, '/auth-confirm'); }); My challenge is, I need to detect when a user fails to authenticate with Google. If they succeed, I need to get the access token. However, I do not know how to do either of these because I do not understand the syntax of this call. Specifically, I don't understand what (req, res, function() {...}) is. Is that line saying that passport.authenticate returns a function. So, req, res, and function() { ... } are passed as parameters to the function that passport.authenticate returns? If that's the case, I still don't know how to get the access token returned by google.
tagged with: javascript

http://stackoverflow.com/a/24822658
type: Answer
has body: That is something that git will manage it self. Git will store deltas, so when you are pushing, actually git internally will push only the delta. If I did understood you properly, what you want is actually the default behavior of git and you don't have to worry about that. Check this link too about how git works: How does git store files?
upvote count: 1
has comment: http://stackoverflow.com/comment/38604703
score: 1
answers question: http://stackoverflow.com/q/24821333
accepted answer of: http://stackoverflow.com/q/24821333
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/38609897
type: Comment
comment on: http://stackoverflow.com/a/24861511
score: 0
type: AnswerComment
has text: The Angular way would be to use a scope variable to build HTML, not the other way round. So, you'd do something like: ` ` and then do the desired behaviour based on the `exprResult` value. Hiding those divs inside would work independently.

http://stackoverflow.com/a/24841999
answers question: http://stackoverflow.com/q/24841925
has body: Does each reply button have an ID that matches the comment ID? That would allow you to know which button was pressed (this.id or this.name) and would correspond to the related comments field. your input would be and your button would be Click Me! in your button js you can do something like var buttonID = this.id; var commentID = 'comments' + buttonID.substring(6); var commentObj = document.getElementById(commentID);
has comment: http://stackoverflow.com/comment/38571714
has comment: http://stackoverflow.com/comment/38571634
type: Answer
score: 0

http://stackoverflow.com/comment/38486517
comment on: http://stackoverflow.com/q/24796069
type: Comment
type: QuestionComment
has text: Do you get any compilation error? May be you need to get it with its namespace like this: `@YourApplication.Resources.Login`
score: 0

http://stackoverflow.com/comment/38683349
comment on: http://stackoverflow.com/q/24900650
score: 2
has text: That's not how you use `addEventListener`.... and it's syntax hasn't been changed.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24897380
has comment: http://stackoverflow.com/comment/38677231
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/38774699
has title: How to add jQuery box on div
has body: I have created some sets of div blocks with MySQL and PHP. I created the blocks with this code: while($row = mysqli_fetch_array($result)) { echo "&lt;div&gt;".$row['chanelname'].$row['chaneldescription']."&lt;/div&gt;"; } Now I wonder what will happen if the in my database store thousands of channel list. Then the div will increase. Now I want to load all the divs and show 10 divs in one time. I want to put the divs in a JQuery box like below. I want to have JQuery pagination on my div collection.
type: Question
linked to: http://stackoverflow.com/q/3705318
answer count: 2
upvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
score: 0
has answer: http://stackoverflow.com/a/24949051
has answer: http://stackoverflow.com/a/24900303
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
tagged with: css

http://stackoverflow.com/comment/38502586
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24805235
has text: @Tom Yes, it's showing the wrong text because your code is not adequately testing the object property names. Have you actually tried the code I suggested?

http://stackoverflow.com/comment/38408385
type: Comment
has text: I'm using the content-editable attribute purely as a unique selector. Nothing more.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24755259

http://stackoverflow.com/a/24776305
answers question: http://stackoverflow.com/q/24763691
upvote count: 3
type: Answer
downvote count: 0
has body: There's some minor defects in your manifest file. The script files you use in your popup or options page should not be declared as content scripts. Including them into their respective html files is enough (which you are already doing), considering you're not planning to inject them into other external web pages. Popup and option pages are not content scripts. They are privileged to use the Chrome APIs just as background scripts are. Content scripts are injected into other web sites. If you are really meaning to do that, you should most likely also include the "run_at" property. Then again, it depends on what you want to do with it. "content_scripts": [{ "matches": ["http://*/*","https://*/*"], "js": ["jquery.js","chat.js","options.js"], "run_at": "document_end" }] However, content scripts don't have the privilege to access the tabs API. Using your background scripts simultaneously as content scripts leads to those type errors and might eventually break your extension, yet it still might seem as though your extension is working - in the scope of the background scripts (popup, options), at least. Strictly separate background and content scripts. If you don't need to inject code into other web sites, I'd suggest you remove it alongside with the permissions - the permission warning when installing your extension would be unnecessarily demanding if you ask for permission to read and modify user data on all web sites, anyway.
score: 3

http://stackoverflow.com/a/24784805
upvote count: 1
has comment: http://stackoverflow.com/comment/38464557
has body: var $a = $("td").children(); $("td").append($("&lt;div /&gt;").append($a)); I am not 100% sure what you mean about possibilities. There are more than a few ways to accomplish it. This is just one quick way. Essentially you create a selector to point at what you want moved, and then append it to where you need it. Fiddle with your example: http://jsfiddle.net/kt4F2/ var $a = $("td").children(); $("td").append($("&lt;div /&gt;").append($a)); An alternate: http://jsfiddle.net/w9GCh/ the second uses $.wrapAll() $("td").children().wrapAll("&lt;div /&gt;");
type: Answer
has comment: http://stackoverflow.com/comment/38464275
downvote count: 0
has comment: http://stackoverflow.com/comment/38464451
answers question: http://stackoverflow.com/q/24784628
score: 1

http://stackoverflow.com/q/24869858
has comment: http://stackoverflow.com/comment/38625229
answer count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38625379
tagged with: http://stackoverflow.com/tag/html
type: Question
has title: If I refresh or click a button to go to a link, link works, but if I type the URL, it does not
tagged with: refresh
score: 0
has body: Right now, I have a very data-intensive set of HTML and JS documents that are all connected through a Nav-Bar. One of the pages works only if I go to the page via Navbar, and it loads fine. If I refresh the page, it also continues to work exactly how I wanted it to. However, when I copy the exact same URL which is on the page when I load it, and try going directly to the website via URL, the page doesn't load all the JSON files, etc. that it needs to. I find this odd because in all 3 cases, I am accessing the same HTML document, but I'm not sure why using the link does not work. Edit: To reiterate, when I type in the link, the main CSS, etc. still works, the site design is still there, however, for some reason, the JS doesn't load all of the JSON files and content that is necessary.
tagged with: navbar

http://stackoverflow.com/q/24885883
upvote count: 5
tagged with: javascript
has title: ReferenceError: Can't find variable: define at ... with 'grunt test' using jasmine in require.js
tagged with: gruntjs
answer count: 1
downvote count: 0
tagged with: jasmine
favorite count: 0
type: UnansweredQuestion
tagged with: requirejs
tagged with: phantomjs
type: Question
has answer: http://stackoverflow.com/a/24886328
score: 5
has body: I'm a little confused. In my little project I'm using Jasmine, Require.js, Phantomjs and Grunt (all these via Yeoman). So when run I grunt test in the terminal, I get the error: &gt;&gt; ReferenceError: Can't find variable: define at &gt;&gt; test/spec/testSpec.js:15 Warning: No specs executed, is there a configuration error? Use --force to continue. Aborted due to warnings. But when I perform the test in a browser, the test goes fine... Here's my simple test spec: define(['spec/test'], function(Test) { describe('Test for unit-test', function() { describe('Test namespace', function() { it('should be defined', function() { expect(Test).toBeDefined(); }); }); }); }); Module: define([], function () { var Test = {}; return Test; }); Can someone help me solve this, please? Many thanks

http://stackoverflow.com/comment/38747540
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24804109
type: QuestionComment
has text: @Tasos mainly the default browser of iPad, safari

http://stackoverflow.com/comment/38499417
type: Comment
has text: The afetrLoad callback is called correctly. But _dropAction method of the Dropupload widget is still the same. I think I need to extend the widget and create a custom component.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/24801196

http://stackoverflow.com/comment/105702521
has text: chrome.history now returns undefined.
comment on: http://stackoverflow.com/a/24894710
type: AnswerComment
score: 5
type: Comment

http://stackoverflow.com/comment/38513611
score: 0
type: Comment
has text: sorry, fiddle resets the frame, so resize the result frame to be wider and hit Run. Then resize result frame to be smaller and re-hit Run. Well, you get my point
comment on: http://stackoverflow.com/a/24810723
type: AnswerComment

http://stackoverflow.com/q/24780270
has title: In Cascading dropdown fails but first works fine using jquery Ajax
tagged with: php
has comment: http://stackoverflow.com/comment/38456319
has comment: http://stackoverflow.com/comment/38455824
has comment: http://stackoverflow.com/comment/38455413
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24780893
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/38455508
has comment: http://stackoverflow.com/comment/38455469
has body: I have a dropdown that lists the data fetched from database using PHP and jQuery Ajax. First dropdown List fetches data successfully and populates it in the dropdown. HTML for first dropdownlist : $(document).ready(function () { $(function() { $.ajax({ type: 'POST', url: 'getGroupzBase.php', datatype: 'json', success: function(data) { // Call this function on success console.log(data); var yourArray = JSON.parse(data); console.log(yourArray); $.each(yourArray, function (index, yourArray) { $('#builder_group').append($('&lt;option/&gt;', { value: yourArray.id, text : yourArray.name, })); }); }, error: function() { displayDialogBox('Error', err.toString()); } }); }); And the dropdown tag - &lt;select id="builder_group"&gt;&lt;/select&gt; For the second dropdown menu does not work with the first dropdown. I have to use jQuery Ajax for the second dropdown as well. HTML for second dropdownlist : &lt;script&gt; $("#builder_group").change(function(){ console.log("Hello 1"); $('#Ivrmapping_groupZCode').find('option').remove().end(); //clear the city ddl var builder = $(this).find("option:selected").text(); alert(builder); //do the ajax call $.ajax({ url:'getGroupzCode.php' type:'GET', data:{city:builder}, dataType:'json', cache:false, success: function(data) { // Call this function on success console.log(data); var yourArray = JSON.parse(data); console.log(yourArray); $.each(yourArray, function (index, yourArray) { ); }); }, error: function() { displayDialogBox('Error', err.toString()); } }); }); }); &lt;/script&gt; And the dropdown tag - &lt;select name="Ivrmapping[groupZCode]" id="Ivrmapping_groupZCode"&gt;.. &lt;/select&gt; Why is the second dropdownlist not working with first. Can we have more than one jQuery Ajax calls in one page.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38455253
has comment: http://stackoverflow.com/comment/38455714

http://stackoverflow.com/q/24804312
tagged with: css-content
upvote count: 0
has title: HTML entities in CSS content (convert entities to escape-string at runtime)
has comment: http://stackoverflow.com/comment/38500431
has body: I know that html-entities like &amp;nbsp; or &amp;#246; or &amp;#x0F0; can not be used inside a css like this: div.test:before { content:"text with html-entities like `&amp;nbsp;` or `&amp;#246;` or `&amp;#x0F0;`"; } There is a good question with good answers dealing with this problem: Adding HTML entities using CSS content But I am reading the strings that are put into the css-content from a server via AJAX. The JavaScript running at the users client receives text with embedded html-entities and creates style-content from it instead of putting it as a text-element into an html-element's content. This method helps against thieves who try to steal my content via copy&amp;paste. Text that is not part of the html-document (but part of css-content) is really hard to copy. This method works fine. There is only this nasty problem with that html-entities. So I need to convert html-entities into unicode escape-sequences at runtime. I can do this either on the server with a perl-script or on the client with JavaScript, But I don't want to write a subroutine that contains a complete list of all existing named entities. There are more than 2200 named entities in html5, as listed here: http://www.w3.org/TR/2011/WD-html5-20110113/named-character-references.html And I don't want to change my subroutine every time this list gets changed. (Numeric entities are no problem.) Is there any trick to perfom this conversion with javascript? Maybe by adding, reading and removing content to the DOM? (I am using jQuery)
has answer: http://stackoverflow.com/a/24805184
accepted answer: http://stackoverflow.com/a/24805184
tagged with: dom
type: Question
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/38500567
tagged with: html-entities
has comment: http://stackoverflow.com/comment/38500963
answer count: 1
downvote count: 1
favorite count: 0
linked to: http://stackoverflow.com/q/190396
tagged with: css
has comment: http://stackoverflow.com/comment/38504836
type: AnsweredQuestion

http://stackoverflow.com/comment/38484750
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24762551
has text: Thanks @faby i got the reason why its behaving this way. Do you have any idea how we can avoid calling drop in this scenario. So, that the actual parent shouldn't get added to the 'droppable'.

http://stackoverflow.com/comment/38442644
comment on: http://stackoverflow.com/q/24773497
type: Comment
type: QuestionComment
has text: `{ return true; alert(str1); }` looks very nice
score: 1

http://stackoverflow.com/comment/38495312
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24800864
score: 0
has text: The network panel doesn't show the pages that should load and skips them. doesn't give me any perception of what the problem can be except the thing that it doesn't load for an unknown reason. stopping loading while scrolling might be a good idea in general. It would be nice if you will help me out with this.. :) I rewrote the console.log. I hope it's more understandable.

http://stackoverflow.com/a/24825252
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24801190
has body: What I ended up doing: I added a hidden input field to my form and when an event is clicked, I filled up the input field value with a string (for example "Clicked") eventClick: function (calEvent, jsEvent, view) { $("#MyNewHiddenInputField").val("Clicked"); $("#MyForm").submit(); } Then if this input field is filled with a value (which happens only by a click on an event), I fill the hidden field value through my controller on form submit to save the hidden field value after the page reload. and after i used this value in fullcalendar loading, i just remove its value.. loading: function (isLoading, view) { // some code if (isLoading) { //some code } else { if ($("#MyNewHiddenInputField").val() == "Clicked" &amp;&amp; // some other conditions) { // Do what you wanna do } // Now clear my hidden field $("#Clicked").val(""); } } therefore, page load after an event click will be recognized from other type of loading. i hope am clear! i am not sure if there is any better way to do it, if i come across a better solution, i will update my answer :)
type: Answer
score: 0
accepted answer of: http://stackoverflow.com/q/24801190

http://stackoverflow.com/q/24855516
tagged with: http://stackoverflow.com/tag/html
tagged with: php
score: 2
type: AnsweredQuestion
upvote count: 2
accepted answer: http://stackoverflow.com/a/24855575
type: Question
has body: I'm making an upload function with php, which works fine. Only, because the maximum size in my php ini file is 32mb, I can't upload anything bigger than that. And that's fine with me. BUT: I want to prevent uploading when the combined size of all the files that are added to input-file, is over 32mb. I found this script which alerts the file size after adding the files, which is a start: $(function(){ $('#file').change(function(){ var file=this.files[0] alert(file.size||file.fileSize) }) }) But when testing I found out that it only returns the size of one file. How can I alter this code to return the size of all the files that are added to the input field? Or is there another way to do this? HTML: Tutorial PHP code: $file_dest = "photos/orig/"; $thumb_dest = "photos/thumbs/"; if(!empty($_FILES['files']['name'][0])){ $files = $_FILES['files']; $uploaded = array(); $failed = array(); $allowedExt = array('png', 'jpg', 'gif'); foreach($files['name'] as $position => $file_name) { $file_tmp = $files['tmp_name'][$position]; $file_size = $files['size'][$position]; $file_error = $files['error'][$position]; $file_ext = explode('.', $file_name); $file_ext = strtolower(end($file_ext)); if(in_array($file_ext, $allowedExt)){ if($file_error == 0){ if($file_size <= 20000000){ $file_name_new = uniqid('', true)."_".$file_name; $file_move = $file_dest.$file_name_new; if(move_uploaded_file($file_tmp, $file_move)){ $uploaded[$position] = $file_dest; }else{ $failed[$position] = "[{$file_name}] failed to upload."; } }else{ $failed[$position] = "[{$file_name}] is too large."; } }else{ $failed[$position] = "[P$file_name}] errored with code {$file_error}"; } }else{ $failed[$position] = "[{$file_name}] file extension '{$file_ext}' is not allowed."; } } if(!empty($uploaded)){ print_r($uploaded); } if(!empty($failed)){ print_r($failed); } }else{ echo "No files were added."; } Sidenote: The code's not finished yet, I still have to add security measures. Please ignore the lack thereof.
tagged with: javascript
has answer: http://stackoverflow.com/a/24855581
has title: Show combined size of multiple uploaded files
answer count: 2
possible better answer: http://stackoverflow.com/a/24855581
downvote count: 0
tagged with: jquery
tagged with: file-upload
has answer: http://stackoverflow.com/a/24855575
favorite count: 0

http://stackoverflow.com/q/24778918
linked to: http://stackoverflow.com/q/21729210
linked to: http://stackoverflow.com/q/32177060
has comment: http://stackoverflow.com/comment/38460457
has comment: http://stackoverflow.com/comment/38455619
favorite count: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/82610450
upvote count: 3
has answer: http://stackoverflow.com/a/47824528
has comment: http://stackoverflow.com/comment/82611719
has answer: http://stackoverflow.com/a/63146469
type: Question
score: 3
has comment: http://stackoverflow.com/comment/78462322
has comment: http://stackoverflow.com/comment/82611660
tagged with: activex
possible better answer: http://stackoverflow.com/a/63146469
has title: Suppress ADO Security Warning in JavaScript/HTM Page
has comment: http://stackoverflow.com/comment/41590121
tagged with: ado
has body: I have a fully functioning site stored on a network drive along with an Access Database which acts as the site's database. Due to lack of server side code, I am forced to use JavaScript to create an ADO ActiveX object to connect to the database. This works. The problem I am having is that whenever the user opens the site an ADO Security warning appears asking if they trust the site. If they press 'Cancel' the error thrown is: Safety settings on this computer prohibit accessing a data source on another domain however the database is stored in the same network directory as the site... If they press 'OK' the site opens fine. Is there any way of stopping this warning from appearing?
answer count: 2
accepted answer: http://stackoverflow.com/a/47824528
tagged with: activexobject
downvote count: 0
tagged with: javascript
tagged with: ms-access

http://stackoverflow.com/comment/38488935
type: QuestionComment
type: Comment
has text: I see, yeah too bad that JSHint complains about `expr;` like this... In this case it's useful code, and if it's not useful, I suppose all JS engines will remove it anyway (at least if it's in hot code).
score: 0
comment on: http://stackoverflow.com/q/24780333

http://stackoverflow.com/comment/38605367
score: 0
type: AnswerComment
has text: No probs, glad it's helped. Thanks for pointing out the error.
comment on: http://stackoverflow.com/a/24785319
type: Comment

http://stackoverflow.com/comment/38601449
comment on: http://stackoverflow.com/q/24857251
score: 0
has text: @djay: ahh, that's what I think I call ApplicationController
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38463817
has text: don't you need $scope.$apply() on your closeClick function too?
type: QuestionComment
comment on: http://stackoverflow.com/q/24775175
score: 0
type: Comment

http://stackoverflow.com/comment/38651224
type: Comment
has text: @Carpetsmoker have you read what you posted? fortunately my changes follow these rules, thanks anyway.
comment on: http://stackoverflow.com/q/24882980
score: 0
type: QuestionComment

http://stackoverflow.com/comment/38437740
type: AnswerComment
comment on: http://stackoverflow.com/a/24770870
type: Comment
score: 1
has text: @AnApprentice: do you seriously cannot handle it for already 15 minutes?

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

http://stackoverflow.com/comment/38624245
has text: Yep, provided all of Q's dependencies are available.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24869295

http://stackoverflow.com/a/51794457
score: 41
has comment: http://stackoverflow.com/comment/93882913
type: Answer
has comment: http://stackoverflow.com/comment/102769883
downvote count: 2
has comment: http://stackoverflow.com/comment/102766364
has comment: http://stackoverflow.com/comment/105853609
has body: I think the most simple way to skip some elements from an array is by using the filter() method. By using this method (ES5) and the ES6 syntax you can write your code in one line, and this will return what you want: let images = [{src: 'img.png'}, {src: 'j1.json'}, {src: 'img.png'}, {src: 'j2.json'}]; let sources = images.filter(img =&gt; img.src.slice(-4) != 'json').map(img =&gt; img.src); console.log(sources);
answers question: http://stackoverflow.com/q/24806772
upvote count: 43

http://stackoverflow.com/comment/38697682
comment on: http://stackoverflow.com/a/24906043
score: 0
type: AnswerComment
has text: The strangest thing happened. When I added/edited the lines you suggested, URLs in the HTML file stopped appearing. In fact, it looks like no `div` or `a` tags have been appended to body.
type: Comment

http://stackoverflow.com/comment/38406301
has text: as per viewsource, class="online-name" used for span tag and not for ..then $( "a.online-name" ) is wrong
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24753627

http://stackoverflow.com/comment/38612332
comment on: http://stackoverflow.com/a/24861185
score: 0
type: Comment
has text: Yes, sorry, I have updated the answer.
type: AnswerComment

http://stackoverflow.com/comment/38484494
has text: @Rajaprabhu Aravindasamy: This was not a duplicate of those questions. This was a simple error in calling the function rather than passing it.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24795372

http://stackoverflow.com/q/24808757
has comment: http://stackoverflow.com/comment/38509638
answer count: 0
score: 0
tagged with: css-transitions
has comment: http://stackoverflow.com/comment/38819265
type: Question
tagged with: jquery-mobile
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38510057
has comment: http://stackoverflow.com/comment/38547625
has comment: http://stackoverflow.com/comment/38629859
type: UnansweredQuestion
has title: Nifty Modal Transitions and animations with Jquery Mobile
has body: Have any of you implemented Nifty Modal Transitions with Jquery Mobile? If so, please let know how to go about doing this. http://tympanus.net/Development/ModalWindowEffects/

http://stackoverflow.com/a/24796846
downvote count: 0
has body: You are looking for something like this $('#tab1').click(function(){ var nextId = $(this).parents('.tab-pane').next().attr("id"); $('[href=#'+nextId+']').tab('show'); })
type: Answer
answers question: http://stackoverflow.com/q/24796766
has comment: http://stackoverflow.com/comment/38487287
score: 1
upvote count: 1

http://stackoverflow.com/q/24762409
score: 1
tagged with: gruntjs
type: Question
downvote count: 0
tagged with: javascript
tagged with: browserify
tagged with: node.js
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: browserify-shim
has body: I'm trying to browserify my library where there are Buffer core module being use in different places. I want to shim this core Buffer with another library that we are using. I have tried to look into https://github.com/thlorenz/browserify-shim where I can specify my module that I want to shim but it doesn't seem to work. I've created file called shim.js var Buffer = require('myModule').Buffer; module.exports = { Buffer: { exports: Buffer } }; in Package.json { ... "dependencies": { "MD5": "^1.2.1", "browser-request": "^0.3.1", "browserify-shim": "^3.6.0", ... }, "devDependencies": { ... }, "browserify-shim": "./shims.js" } And in Gruntfile.js (I'm using grunt-browserify) browserify: { src: "./index.js", options: { transform: ['browserify-shim'], browserifyOptions: { builtins: false }, bundleOptions: { standalone: "mylibrary" } } } }, Right now when I grunt build the file I'm still seeing this being require in: [function(_dereq_,module,exports){ (function (Buffer){ And in my browser is complaining about Uncaught Error: Module name "buffer" has not been loaded yet for context: _. Use require([])
has title: Browserify Shim Buffer core module

http://stackoverflow.com/q/24909017
linked to: http://stackoverflow.com/q/196702
linked to: http://stackoverflow.com/q/6303490
tagged with: angularjs
type: UnansweredQuestion
has body: I have angularjs +bootstrap site with some directives, controllers, services, providers, etc. What is the best guide for scripts including? In case when i include all scripts in a header this can affect on a page loading performance as scripts loading is blocking operation. Is this correct to include angular.js and bootstrap.js in a header, and all controllers, directives, my custom scripts in a footer?
has title: Correct way to include angularjs scripts on page
has answer: http://stackoverflow.com/a/24909183
has answer: http://stackoverflow.com/a/24909355
type: Question
tagged with: javascript
score: 0
answer count: 2

http://stackoverflow.com/comment/38492365
type: AnswerComment
comment on: http://stackoverflow.com/a/24799632
score: 0
type: Comment
has text: This also adds separate event handler for each element, which is very bad idea

http://stackoverflow.com/comment/38562714
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24799649
has text: @naota...<<< 日本語 means just "Japanese" in Japanese >>> Thank you for the information. Please refer to my previous comment about "日本語" string.
score: 0

http://stackoverflow.com/q/24800053
accepted answer: http://stackoverflow.com/a/24822736
has title: How to maintain a PHP object through successives AJAX calls
type: Question
possible better answer: http://stackoverflow.com/a/24800122
has answer: http://stackoverflow.com/a/24800122
has comment: http://stackoverflow.com/comment/38494215
tagged with: javascript
has answer: http://stackoverflow.com/a/24800542
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/24822736
has body: I am programming a php page for controlling a serial port using some in-screen-buttons. When I press a button, this sends some data through the serial port and it shows its response. All this is working OK. Now, I need to listen continuously the serial port in order to receive data that I haven't ask for. I'm trying to do it with a timer in javascript, but every time I execute the PHP code through AJAX, serial port is restarted and its buffer is flushed. I need to pass the object that controls the serial port to the javascript code before finish the execution of the PHP code. And when pressing a button, I need to pass this object to the new PHP code. How can I do this? Thanks a lot
has answer: http://stackoverflow.com/a/24800160
tagged with: serial-port
tagged with: php
answer count: 4
type: AnsweredQuestion

http://stackoverflow.com/a/24787431
score: 2
answers question: http://stackoverflow.com/q/24787321
has comment: http://stackoverflow.com/comment/38922481
has comment: http://stackoverflow.com/comment/38477179
upvote count: 4
has comment: http://stackoverflow.com/comment/38469415
type: Answer
has comment: http://stackoverflow.com/comment/38469365
has comment: http://stackoverflow.com/comment/38934172
has body: Removing the &lt;form&gt; tag will fix your problem. Clicking the button submits the form and reloads the page, resetting the page to its original state.
downvote count: 2
has comment: http://stackoverflow.com/comment/38469525

http://stackoverflow.com/comment/38450264
score: 0
has text: in addition, just a comment regarding your meta data. You should'nt really use inline styles i.e `style=""`. Use the proper syntax, it enables us to see your code more clearly.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24777630

http://stackoverflow.com/comment/38678288
type: QuestionComment
type: Comment
has text: Everything is just a giant property bag in Javascript. `x.y` is just a shortcut for `x['y']`
comment on: http://stackoverflow.com/q/24897940
score: 0

http://stackoverflow.com/comment/38484154
score: 0
type: AnswerComment
has text: Also the mouse becomes hidden when hove over to the right of the player
type: Comment
comment on: http://stackoverflow.com/a/24784023

http://stackoverflow.com/q/24771780
tagged with: node.js
has title: an error about tailable cursor for a query in mongoose
type: Question
tagged with: mongodb
downvote count: 0
answer count: 1
tagged with: mongoose
tagged with: javascript
has answer: http://stackoverflow.com/a/24773611
favorite count: 0
score: 1
has body: User model contian SubscriptionSchema and AccessToken Schema, I had defined this two plugin schemas with {capped : 234556} too. var User = new Schema({ email : String , firstName : String , password : String , isAdmin : Boolean , lastSeen : Date , subscriptions : [ SubscriptionSchema ] , accessTokens : [ AccessToken ] }, { toObject : { virtuals : true } , toJSON : { virtuals : true } , capped : 234556 }); var streamTest = User.find().limit(1).tailable().stream(); When I try to run the above code, I still get the error: MongoError: tailable cursor requested on non capped collection
type: UnansweredQuestion
tagged with: stream
upvote count: 1

http://stackoverflow.com/q/24753173
favorite count: 0
linked to: http://stackoverflow.com/q/6913512
upvote count: 2
answer count: 2
has comment: http://stackoverflow.com/comment/38404605
has title: How to sort a json with two items
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/24753238
has answer: http://stackoverflow.com/a/24753407
has body: I have a JSON, as seen below, and I want to sort this JSON data with rowNo and columnNo. How can I do this? jsonArrayFull: { Dashboard: [{ "id": "three-col-layout-div1", "rowNo": "1", "columnNo": "0", "colspan": "1", "rowspan": "1", "title": "Harvester Productivity Analysis", "dashlet": "MIS/MISViewer/HarvesterProductivityAnalysis", "bgColor": "#854db0", "width": "31.1216429699842%", "height": "29.985007496251875%" }, { "id": "three-col-layout-div2", "rowNo": "1", "columnNo": "1", "colspan": "1", "rowspan": "1", "title": "Expense Analysis", "dashlet": "MIS/MISViewer/ExpenditureAnalysis", "bgColor": "#83a143", "width": "31.1216429699842%", "height": "29.985007496251875%" }, { "id": "three-col-layout-div3", "rowNo": "1", "columnNo": "2", "colspan": "1", "rowspan": "1", "title": "Labour Utilization", "dashlet": "MIS/MISViewer/LabourUtilization", "bgColor": "#a32a2a", "width": "31.1216429699842%", "height": "29.985007496251875%" }] } I did this script but its not working for(var i=0;i&lt;newDiv.length;i++) { newDiv[i].dashlets.sort(function(obj1, obj2) { return obj1.rowNo - obj2.rowNo; }); }
score: 2
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
type: Question

http://stackoverflow.com/comment/38695536
type: Comment
has text: `var a = [],person = new Object(); person = { name : "admin",type:"admin",id:"545421fdsfvdb" }; var id = person.id; a[id] = []; delete person.id a[id].push(person); console.log(a) ;` is it ?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24907171

http://stackoverflow.com/q/24828066
tagged with: jquery
favorite count: 0
type: Question
tagged with: checkbox
has comment: http://stackoverflow.com/comment/38550837
has answer: http://stackoverflow.com/a/24828312
linked to: http://stackoverflow.com/q/2389341
has answer: http://stackoverflow.com/a/24828228
has title: How do I check if a file has been selected in a element?
downvote count: 7
has answer: http://stackoverflow.com/a/25159574
upvote count: 20
has answer: http://stackoverflow.com/a/27681358
tagged with: internet-explorer-9
answer count: 5
tagged with: javascript
has body: I have multiple checkboxes and a file upload input. I would like to re-enable a button if one or more checkbox's are checked AND if the input value is not null. Here is a link to bootply Here my html Submit Here is my javascript starting point: Updated via Karl Bind a change event on all input and then use some condition: $('.upload-block input').change(function() { $('#upload-btn').prop( 'disabled', !($('.upload-block :checked').length && $('#InputFile').val())); }); Example This works for all the checkboxes and #InputFile has a value other than none. i.e. where a file has been chosen. However this does not work in IE9 How can I update this to work in IE9?
score: 13
has comment: http://stackoverflow.com/comment/38553230
possible better answer: http://stackoverflow.com/a/27681358
has comment: http://stackoverflow.com/comment/38545816
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38553040
has answer: http://stackoverflow.com/a/24828108
accepted answer: http://stackoverflow.com/a/24828228

http://stackoverflow.com/q/24825055
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/38539687
has comment: http://stackoverflow.com/comment/38539664
type: UnansweredQuestion
tagged with: php
has body: I'm making an app where there's loads of products, each with a button. My plan is the user clicks one of the buttons and I have a javascript (jquery) function which starts making an ajax request every second using the id of the button as a parameter to identify the product. The function I'm planning on using is the 2nd answer here Execute an Ajax request every second The idea is to check the status of the product (which can change constantly) every second while the user is interested in it. When the user clicks the button again I want to stop checking this particular product's status but I can't figure out how to do this. In my head I imagine the user might have clicked 3 buttons so there's 3 ajax requests every second happening, each with a different product id. How can I stop the recurring request which has the id of the product the user has clicked stop?
has comment: http://stackoverflow.com/comment/38539654
has answer: http://stackoverflow.com/a/24825336
downvote count: 1
type: Question
linked to: http://stackoverflow.com/q/20371695
has comment: http://stackoverflow.com/comment/38539863
tagged with: javascript
score: -1
upvote count: 0
has title: Stopping a recurring ajax call
answer count: 1

http://stackoverflow.com/q/24847190
has answer: http://stackoverflow.com/a/24847330
upvote count: 5
has body: Example: var array1 = [ {'key':1, 'property1': 'x'}, {'key':2, 'property1': 'y'} ] var array2 = [ {'key':2, 'property2': 'a'}, {'key':1, 'property2': 'b'} ] I want merge(array1, array2) to give me: [ {'key':1, 'property1': 'x', 'property2' : 'b'}, {'key':2, 'property1': 'y', 'property2' : 'a'} ] Is there an easy way to do this? EDIT: several people have answered without looking too closely at my problem, please be note that I want to match similar objects in each array and combine their properties into my final array. Keys are unique and there will only ever be at most one object with a particular key in each array.
tagged with: javascript
score: 5
answer count: 3
has title: How do I merge an array of objects in Javascript?
accepted answer: http://stackoverflow.com/a/24847271
downvote count: 0
has comment: http://stackoverflow.com/comment/38581457
favorite count: 0
has answer: http://stackoverflow.com/a/24848195
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24847271
possible better answer: http://stackoverflow.com/a/24847330
type: Question

http://stackoverflow.com/comment/38536630
has text: Hi as you told you to try @Rachits code but it is not working. I have created jsFiddle so can you check. http://jsfiddle.net/d6rs5/
comment on: http://stackoverflow.com/a/24821688
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38585690
score: 0
type: AnswerComment
type: Comment
has text: Your use of jQuery is fine. Are you sure the url returns a JSON formatted array? Like in the sample link: http://api.jquery.com/jquery.getjson/.
comment on: http://stackoverflow.com/a/24849117

http://stackoverflow.com/comment/38722120
type: Comment
score: 2
comment on: http://stackoverflow.com/q/24908834
has text: SMIL doesn't work very well with `<use>` elements in Firefox I'm afraid.
type: QuestionComment

http://stackoverflow.com/comment/38467744
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24786636
has text: No. You cannot get this information for obvious reasons.
type: AnswerComment

http://stackoverflow.com/q/24804109
has comment: http://stackoverflow.com/comment/39397297
upvote count: 8
type: Question
has answer: http://stackoverflow.com/a/24968083
has comment: http://stackoverflow.com/comment/38777186
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/24954561
has comment: http://stackoverflow.com/comment/38737965
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38835354
answer count: 4
tagged with: ipad
score: 8
has comment: http://stackoverflow.com/comment/38744222
favorite count: 0
has answer: http://stackoverflow.com/a/24941255
has title: iPad scroll - header only set to fixed when scrolling ends
has comment: http://stackoverflow.com/comment/38747540
has comment: http://stackoverflow.com/comment/38748313
has comment: http://stackoverflow.com/comment/38810595
has comment: http://stackoverflow.com/comment/38750850
has answer: http://stackoverflow.com/a/24954561
tagged with: css
has comment: http://stackoverflow.com/comment/38739806
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/8107722
has body: I set my hero-unit to position fixed after scrolling down to it's position. So for the first 70px of the page the hero-unit scrolls along with the rest until the top reaches the hero-unit which then needs to be fixed. Not fixed Fixed This works fine everywhere and also the ipad except that the position is set to fixed when the scroll is finished instead of during the scrolling like the browser. I know it's because the scroll event is not fired during the momentum scrolling. I tried to fix this using the following code but it did not work: document.addEventListener("touchstart", function(){ $('body').prepend(' touch start '); that.tid = setInterval(function(){ $.event.trigger( { type: "touchcontinuem" } ); },10) }, false); document.addEventListener("touchend", function(){ $('body').prepend(' touch end '); clearTimeout(that.tid); }, false); $(document).on("touchcontinuem", function(){ $('body').prepend(' touch continuem '); }); What I want to achieve is that the hero-unit can be set to fixed while the scroll is still busy. If anyone can suggest an improvement or an alternative I would greatly appreciate because i'm stuck right now.
downvote count: 0
accepted answer: http://stackoverflow.com/a/24968083
has answer: http://stackoverflow.com/a/25026217

http://stackoverflow.com/q/24801911
has body: Is this possible to have a class in JS and declare 2 method names from string? I mean something like this: function MyClass() { var methods = ['hello', 'hey']; for (var i in methods) { this[methods[i]] = function() { alert('This is method ' + methods[i]); } } } This should create me a class with function hello and hey. I need to create a few functions which have very similar body but different names. I don't want to use eval, so the code can be compiled.
has answer: http://stackoverflow.com/a/24802064
has comment: http://stackoverflow.com/comment/38496777
type: AnsweredQuestion
tagged with: oop
has title: How to create a class method with name from string?
score: 0
type: Question
accepted answer: http://stackoverflow.com/a/24802064
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38496239

http://stackoverflow.com/q/24800510
has comment: http://stackoverflow.com/comment/38494099
has body: i have a small problem. i'm trying to develop a simple menu with jquery, the model based my menù is here. I tried to develop it, I can play the animation of all elements at the same time but only one at a time and I can not. The following is my code html and js: JS $('.menu').hover( function () { $(".mText",this).stop(true).animate({ top: '70px' }, 400, 'easeOutCubic'); $(".mText_over",this).stop(true).animate({ top: '0px' }, 500, 'easeOutCubic'); }, function () { if ((!$('li').hasClass('with_ul')) || (!$('li').hasClass('sfHover'))) { $(".mText").stop(true).animate({ top: '0px' }, 400, 'easeInOutCubic'); $(".mText_over").stop(true).animate({ top: '-70px' }, 400, 'easeInOutCubic'); } } ); HTML About Us About Us Portfolio Portfolio Laystras Mausya Leryse aksase masaysa Services Services Tutorials Tutorials Contacts Contacts
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/38494000
tagged with: javascript
tagged with: jquery
has title: Hover in and Hover out menù
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/24801383
accepted answer: http://stackoverflow.com/a/24801383
favorite count: 0
has comment: http://stackoverflow.com/comment/38494234
tagged with: css
score: 2
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/38494289

http://stackoverflow.com/a/24752922
has comment: http://stackoverflow.com/comment/38404042
has body: This should be, for(y = 0; y &lt; aText.length;y++) and this for(var x = aBina.length-1; x &gt;= 0; x--){ instead for(var x = aBina.lenght-1; x &gt;= 0; x--){ for(y = 0; y &lt; aText.lenght;y++) you mispelled this one, "LENGTH"
type: Answer
answers question: http://stackoverflow.com/q/24752825
has comment: http://stackoverflow.com/comment/38404192
score: 0

http://stackoverflow.com/comment/38470467
has text: In your fiddle, the items are not clickable... and you have not put any CSS styling
score: 0
comment on: http://stackoverflow.com/q/24787980
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24752614
score: 2
has body: You can use a builder function: sol.obtainWorklists(buildCallback(i, callbackFunction)); ...where buildCallback looks like this: function buildCallback(index, func) { return function() { var args = [index]; args.push.apply(args, arguments); func.apply(this, args); }; } Complete example below Then in your callback, expect the i value as the first argument with the arguments that obtainWorklists normally provides following it. How that works: When you call buildCallback, you pass in the i value and the callback you want called. buildCallback returns a new function which has that information bound to it (it's a closure over the index and func arguments in the call to buildCallback). When obtainWorklists calls the function buildCallback created, we create an array with the i value (index) followed by the arguments that were received from obtainWorklists. Then we call the callback, using the same this value that the function was called with, and the args array; your callback will see the entries in args as discrete arguments. If you don't care about the this value in your callback, you can use ES5's Function#bind instead: sol.obtainWorklists(callbackFunction.bind(null, i)); That does much the same thing, but doesn't preserve the this used to call it. Complete example for builder function (live copy): // obtainWorklists stand-in function obtainWorklists(func) { setTimeout(function() { // Just call it with a random number func(rand(100, 200)); }, rand(100, 500)); } // Code to get worklists var i; for (i = 0; i &lt; 10; ++i) { obtainWorklists(buildCallback(i, callback)); } function buildCallback(index, func) { return function() { var args = [index]; args.push.apply(args, arguments); func.apply(this, args); }; } // Your callback function callback(index, value) { display("Index is " + index + ", value is " + value); } // ========= Utility functions function rand(min, max) { return Math.floor(Math.random() * (max - min)) + min; } function display(msg) { var p = document.create…
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38403952
has comment: http://stackoverflow.com/comment/38404575
has comment: http://stackoverflow.com/comment/38404321
type: Answer
accepted answer of: http://stackoverflow.com/q/24752504
answers question: http://stackoverflow.com/q/24752504
downvote count: 0

http://stackoverflow.com/comment/38716566
comment on: http://stackoverflow.com/a/24879620
score: 0
type: AnswerComment
type: Comment
has text: JS strings may be UTF-16, but is there anything that says that the _regex engine_ works on that basis, as opposing to matching on actual code points?

http://stackoverflow.com/q/24800687
has comment: http://stackoverflow.com/comment/38494190
has answer: http://stackoverflow.com/a/24800961
tagged with: http://stackoverflow.com/tag/json
has body: I am trying to read the JSON file that is stored in the same directory with this code. I need to retrieve the GPS information and use it to plot markers on the map. However, nothing appear after running the code. This is my JSON file. [{ "SourceFile": "C:/Users/wolvix/Downloads/sample image/1024-2006_1011_093752.jpg", "ExifToolVersion": 9.65, "FileName": "1024-2006_1011_093752.jpg", "Directory": "C:/Users/wolvix/Downloads/sample image", "FileSize": "205 kB", "FileModifyDate": "2014:06:29 18:42:21+08:00", "FileAccessDate": "2014:06:29 18:42:20+08:00", "FileCreateDate": "2014:06:29 18:42:21+08:00", "FilePermissions": "rw-rw-rw-", "FileType": "JPEG", "MIMEType": "image/jpeg", "JFIFVersion": 1.01, "ExifByteOrder": "Little-endian (Intel, II)", "ImageDescription": "KONICA MINOLTA DIGITAL CAMERA", "Make": "Konica Minolta Camera, Inc.", "Model": "DiMAGE A2", "Orientation": "Horizontal (normal)", "ModifyDate": "2006:10:11 09:37:52", "ExifVersion": "0221", "DateTimeOriginal": "2006:10:11 09:37:52", "CreateDate": "2006:10:11 09:37:52", "GPSVersionID": "0.0.2.2", "GPSLatitudeRef": "South", "GPSLongitudeRef": "East", "GPSAltitudeRef": "Above Sea Level", "Compression": "JPEG (old-style)", "Keywords": "Australia", "By-line": "John Harmon", "Province-State": "New South Wales", "Country-PrimaryLocationCode": "AUS", "Country-PrimaryLocationName": "Australia", "Caption-Abstract": "Sydney Harbor from the Manly-Sydney ferry", "URL": "", "ImageWidth": 1024, "ImageHeight": 768, "GPSAltitude": "0 m Above Sea Level", "GPSLatitude": "33 deg 51' 21.91\" S", "GPSLongitude": "151 deg 13' 11.73\" E", "GPSPosition": "33 deg 51' 21.91\" S, 151 deg 13' 11.73\" E", "ImageSize": "1024x768" }, { "SourceFile": "C:/Users/wolvix/Downloads/sample image/12382975864_09e6e069e7_o.jpg", "ExifToolVersion": 9.65, "FileName": "12382975864_09e6e069e7_o.jpg", "Directory": "C:/Users/wolvix/Downloads/sample image", "FileSize": "6.0 MB", "FileModifyDate": "2014:07:17 18:37:24+08:00", "FileAccessDate": "2014:07:17 18:…
tagged with: markers
has title: $.getJSON for loop on local
has comment: http://stackoverflow.com/comment/38501004
type: Question
tagged with: google-maps
has comment: http://stackoverflow.com/comment/38503249
upvote count: 0
score: -2
has comment: http://stackoverflow.com/comment/38494110
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/38494041

http://stackoverflow.com/comment/38573583
score: 1
has text: @GitaarLAB Good point, I'm not sure why I didn't think of that (somehow forgot they were using `$.ajax()`). Since they are using jQuery, that's definitely the "better" solution
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24843015

http://stackoverflow.com/q/24878540
has title: toggle text area on button click
score: 0
has answer: http://stackoverflow.com/a/24878744
has body: I want to enable the text area, when I click the toggle button. Once the comments are saved from the text area, it has to hide and return to the old position. Since I'm a newbie, struggling a little. Thanks in advance :-) Save EDIT: here is the jfiddle link. http://jsfiddle.net/suP8z/5/
type: AnsweredQuestion
tagged with: button
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24878653
linked to: http://stackoverflow.com/q/5468350
type: Question
has answer: http://stackoverflow.com/a/24878592
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/24878592
answer count: 3
has answer: http://stackoverflow.com/a/24878653

http://stackoverflow.com/a/24850105
has body: Because the obj does not reference the parsed object in memory. So these are 2 different declarations. If you do this: var a = [ 10 ], b = [ 10 ]; Then there are 2 instances of arrays with the same values, but that doesn't make them the same array. So a != b, even though 10 == 10. You can increase the value of a[0] to 15, but that doesn't change the value of b[0] to 15. Therefore, if you want to compare objects, you have to loop through them and check if the values of the objects are the same. A function to compare (borrowed from jQuery object equality ) $.fn.equals = function(compareTo) { if (!compareTo || this.length != compareTo.length) { return false; } for (var i = 0; i &lt; this.length; ++i) { if (this[i] !== compareTo[i]) { return false; } } return true; };
upvote count: 5
score: 5
answers question: http://stackoverflow.com/q/24850074
downvote count: 0
has comment: http://stackoverflow.com/comment/38587071
has comment: http://stackoverflow.com/comment/38587061
type: Answer

http://stackoverflow.com/q/24882984
has title: Angular-UI ng-grid - issue with using 2 data grids on one page
has body: I am using ng-grid-2.0.11 to create data grids. I am creating 2 data grids on a page. The second one is not showing data. Can someone please help.
answer count: 1
tagged with: javascript
tagged with: ng-grid
score: 0
has answer: http://stackoverflow.com/a/24884961
tagged with: angularjs
type: UnansweredQuestion
type: Question

http://stackoverflow.com/q/24757754
has body: I just recently started working with jQuery Mobile. I ran into a issue that I don't get quite yet. I got this code. What it does is that it triggers the toggle twice. One for jQuery and the other for jQuery Mobile (works as expected when removing reference to jQM). Any ideas on how to avoid this for use with Mobile? Adding namespace...? var navigation = $main_nav.find("[data-toggle-id='" + target + "']"); navigation.toggle(200, function() { console.log('toogle'); }); EDIT Demo: http://jsfiddle.net/4mpdR/4/ I don't get the same behaviour here but this is basically my setup. Edit2 $(function () { $(document).on('click', '.nav__toggle', function () { var $main_nav = $('.main-nav'); var target = $(this).data('target'); var navigation = $main_nav.find("[data-toggle-id='" + target + "']"); navigation.toggle(200, function() { console.log('toogle'); }); }); }); Edit3 It's just a &lt;nav&gt;. looking in the console I see that it triggers twice and one time it has the reference to my actual .js file, second is the VM[number], removing jQuery Mobile eliminates the VM. [nav.main-nav__collapse.clearfix, prevObject: jQuery.fn.jQuery.init[1], context: document, selector: ".main-nav [data-toggle-id='main-nav__collapse']", constructor: function, init: function…] 0: nav.main-nav__collapse.clearfix context: document length: 1 prevObject: jQuery.fn.jQuery.init[1] selector: ".main-nav [data-toggle-id='main-nav__collapse']" __proto__: Object[0]
has answer: http://stackoverflow.com/a/24758424
has comment: http://stackoverflow.com/comment/38412776
has comment: http://stackoverflow.com/comment/38412680
has comment: http://stackoverflow.com/comment/38413323
has comment: http://stackoverflow.com/comment/38413321
type: Question
score: 0
has title: jQuery toggle and jQuery Mobile toggle, both trigger?
tagged with: mobile
answer count: 1
tagged with: jquery-mobile
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38413625
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion

http://stackoverflow.com/comment/38585930
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24849491
has text: your div with id undertekst is not visiable as it has display:none how it can show you fadeOut(); you should use fadeIn() and the selector .BigYellowTwo is incorrect you should use .BigYellow
type: Comment

http://stackoverflow.com/a/24827731
type: Answer
has comment: http://stackoverflow.com/comment/38546129
has comment: http://stackoverflow.com/comment/38546854
has comment: http://stackoverflow.com/comment/38545725
has comment: http://stackoverflow.com/comment/38545989
score: 0
answers question: http://stackoverflow.com/q/24827451
has body: You need to pass the e.target.id to the document.getElementById method like this: var x = document.getElementById(e.target.id) Have you checked your javascript console for errors?
has comment: http://stackoverflow.com/comment/38545426

http://stackoverflow.com/a/24819444
type: Answer
has comment: http://stackoverflow.com/comment/38529298
has comment: http://stackoverflow.com/comment/38529394
has body: Basically .children() look for the first level of child elements at the same time .find() will look for the descendants. This is the basic difference between the both. Say for example if you have .name in the nested level, then .children() wont return it at the same time .find() would return it. To know more about it just read .children() and .find().
has comment: http://stackoverflow.com/comment/38529468
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24819426
accepted answer of: http://stackoverflow.com/q/24819426
has comment: http://stackoverflow.com/comment/38529353

http://stackoverflow.com/a/24803841
upvote count: 6
answers question: http://stackoverflow.com/q/24803709
has body: In application.css it should be *= require jquery-ui
downvote count: 0
type: Answer
score: 6

http://stackoverflow.com/q/24799987
has body: The problem is that checkboxes that are inside tab-panel tabs doesn't check. JSFiddle link HTML Code here: Home Profiles Messages Any ideas? How can I make those checkboxes do the check and uncheck function?
type: AnsweredQuestion
tagged with: twitter-bootstrap
upvote count: 3
has comment: http://stackoverflow.com/comment/38493136
type: Question
has title: Bootstrap CheckBox Into TabPanel Tab Doesn't Check/Uncheck
has answer: http://stackoverflow.com/a/24800246
score: 3
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24800246
has answer: http://stackoverflow.com/a/24800397
answer count: 2
has comment: http://stackoverflow.com/comment/38493047
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38493155
tagged with: php
accepted answer: http://stackoverflow.com/a/24800397

http://stackoverflow.com/q/24779525
has comment: http://stackoverflow.com/comment/38454676
has comment: http://stackoverflow.com/comment/38454026
has body: I have a problem when showing hidden (display: none) elements using jQuery. It's the last div before my footer and when I display the hidden div, it seems to run into my footer. When I show it on certain screens it works (works fine from full view on my MacBook Pro). I'm thinking it's some kind of div height issue but I'm not too sure. I've tried various fixes from other height related jQuery issues on StackOverflow, but can't seem to find one that works for me. I have an unordered list with 4 list elements, that when highlighted, show some additional information under them. The height of the 4 li elements are different because of word count, so I changed the display settings for a minute to get the heights of them and they were: Network 128px Learn 51px Promote 77px Perform 77px And here is the code I'm using.. HTML LEARN PROMOTE NETWORK PERFORM Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vitae adipisci assumenda, atque magnam! Quod laboriosam quo reprehenderit deleniti omnis ipsum nulla explicabo eos hic labore, atque pariatur voluptatum earum ut minus repellendus nesciunt voluptas dolorum, natus distinctio architecto? Voluptatibus delectus odio iste voluptate harum officiis eligendi laboriosam mollitia error expedita quas perferendis corrupti natus alias, quam sapiente, magnam repellendus, vitae enim magni. Nesciunt nam odio rerum cumque quibusdam voluptates dolore est quas unde reiciendis. Dolore laborum, fugiat praesentium aperiam quisquam. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vitae adipisci assumenda, atque magnam! Quod laboriosam quo reprehenderit deleniti omnis ipsum nulla explicabo eos hic labore, atque pariatur voluptatum earum ut minus repellendus nesciunt voluptas dolorum, natus distinctio architecto? Voluptatibus delectus odio iste voluptate harum officiis eligendi laboriosam mollitia error expedita quas perferendis corrupti natus alias, quam sapiente, magnam repellendus, vitae enim magni. Nesciunt nam odio rerum cumqu…
has title: Show hidden Div running into my footer
has comment: http://stackoverflow.com/comment/38456007
tagged with: css
tagged with: height
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38458412
has comment: http://stackoverflow.com/comment/38454633
has comment: http://stackoverflow.com/comment/38454166
has comment: http://stackoverflow.com/comment/38453858
has comment: http://stackoverflow.com/comment/38454313
has comment: http://stackoverflow.com/comment/38454577
has comment: http://stackoverflow.com/comment/38471100
has comment: http://stackoverflow.com/comment/38453891
type: Question
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/a/24813833
answers question: http://stackoverflow.com/q/24813388
has body: Use this to find all character codes: http://unixpapa.com/js/key.html You can use CTRL-F to find what character code you need. function ort() { // if { OR } OR | OR ~ are pressed. (Character codes 122-127) if ((event.keyCode &gt; 32 &amp;&amp; event.keyCode &lt; 48) || (event.keyCode &gt; 57 &amp;&amp; event.keyCode &lt; 65) || (event.keyCode &gt; 90 &amp;&amp; event.keyCode &lt; 97) || (event.keyCode &gt; 122 &amp;&amp; event.keyCode &lt; 127)) { // prevent default behaviour event.preventDefault(); return false; } }
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/38558034
score: 1
has comment: http://stackoverflow.com/comment/38553584
upvote count: 1

http://stackoverflow.com/comment/38645238
type: QuestionComment
comment on: http://stackoverflow.com/q/24879374
score: 0
type: Comment
has text: I forgot to mention, there are situations where I need to inject two templates into a page and need to bootstrap the app in an element that is a parent of both of them. I tried moving ng-csp above and even tried erasing both of the lines adding ng-app and ng-csp, I still get the bootstrap error.

http://stackoverflow.com/comment/38454747
type: Comment
has text: i already do this... but not working... validate textarea is shown if i use "required" or not... & whenever i write anything on textarea then also it shows red...
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24780014

http://stackoverflow.com/q/24766880
tagged with: jquery
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/24766940
has body: I'm trying to make an element respond when the user clicks and drags the mouse. I need the response to happen every mousemove while the single mousedown event is happening. I'm using jQuery, but I'm open to a pure JS implementation as well. Here is what I've tried: $('.element').on('mousedown', function (e) { $('.element').on('mousemove', function (e) { console.log("response"); }); $('.element').off('mousedown'); }); This works, but it will work after I clicked once, even if I don't keep doing the mousedown.
upvote count: 1
answer count: 1
accepted answer: http://stackoverflow.com/a/24766940
tagged with: javascript
has title: Click and Drag using jQuery
type: AnsweredQuestion
downvote count: 0
score: 1

http://stackoverflow.com/q/24897940
has comment: http://stackoverflow.com/comment/38678233
favorite count: 0
tagged with: type-conversion
tagged with: types
has answer: http://stackoverflow.com/a/25775673
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24898054
has comment: http://stackoverflow.com/comment/38678264
has comment: http://stackoverflow.com/comment/38678374
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/38678288
has title: javascript, Converting or Casting an object
has body: how to type cast or convert objects in java script ? for example var e = document.getElementById('body'); // e is instance of HTMLBodyElement e = &lt;type cast to HTMLElement&gt; e ; // e is instance of HTMLElement
type: Question
answer count: 2
tagged with: casting
downvote count: 0
has comment: http://stackoverflow.com/comment/38730147
tagged with: javascript
tagged with: prototype

http://stackoverflow.com/comment/38546941
score: 0
type: Comment
type: QuestionComment
has text: Because you declare the var h two times
comment on: http://stackoverflow.com/q/24828743

http://stackoverflow.com/q/24866976
tagged with: primefaces
has answer: http://stackoverflow.com/a/24874843
accepted answer: http://stackoverflow.com/a/24874843
tagged with: javascript
has body: In JSF2 i want to set some integer value. For example: &lt;f:setPropertyActionListener target="#{aBean.aValue}" value="2" /&gt; How can i set integer value from javascript command: PrimeFaces.widgets["widgerVarValue"].paginator.getCurrentPage()
tagged with: jsf-2
upvote count: 1
answer count: 1
favorite count: 0
has title: JSF setPropertyActionListener setting javascript integer value
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question

http://stackoverflow.com/comment/38455167
has text: You should post the solution as an answer and when possible mark it as "the answer" for your question.
score: 1
comment on: http://stackoverflow.com/q/24778941
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38636608
comment on: http://stackoverflow.com/q/24874653
has text: @IvyLynx it loads the bars the way i want it to, but I want the percentages to stop at 98% for bar 1 and 160% for bar 2.. thats the part i couldnt figure out
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/38437492
comment on: http://stackoverflow.com/q/24770623
has text: Strongly suggest you stay away from mixing languages until you have some proficiency with at least one of them
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38678924
type: QuestionComment
has text: I recommend brushing up on jQuery, because after the `$.ajax` line, you've given it up entirely. The rest of it is just plain javascript!
type: Comment
comment on: http://stackoverflow.com/q/24897646
score: 0

http://stackoverflow.com/a/24819892
answers question: http://stackoverflow.com/q/24813034
downvote count: 0
has comment: http://stackoverflow.com/comment/38530328
has body: assets/templates is used for JST and, Example is used client side server side include ? https://github.com/visionmedia/ejs#includes views/header.ejs title: <%- title %> views/layout.ejs <% include header %> ... extends? (Japanese) ※ roundabout http://nantokaworks.com/node-advent2013-day20/ Both of Server Side and Client Side ? sorry. no idea about it... assets/common/header.ejs title: <%- title %> views/layout.ejs <% include ../assets/common/header %> It may be used in both in this way... new ejs({url: 'assets/common/header.ejs'}).render(data); or grunt-contrib-copy, folder views/common to assets/common
upvote count: 6
score: 6
type: Answer

http://stackoverflow.com/comment/38692742
has text: Well this breaks naturally as your demo had them all at `window` height or `height:100%` If you want differing heights, you will have to calculate the heights of all the `sections` first and then make the browser scroll to the combined height of all sections before `activeSection`
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24888283

http://stackoverflow.com/comment/38439562
type: QuestionComment
comment on: http://stackoverflow.com/q/24771788
has text: Is this a joke or something...
score: 2
type: Comment

http://stackoverflow.com/comment/38567684
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24839931
type: QuestionComment
has text: Suffered a lot? Any examples? Maybe try http://regexpal.com/ play with it, also you will find help here http://www.regular-expressions.info/tutorial.html

http://stackoverflow.com/q/24878816
type: AnsweredQuestion
has title: Get Count/Length/Size of Kendo UI DropDownList
has comment: http://stackoverflow.com/comment/38642246
type: Question
score: 5
tagged with: asp.net-mvc
tagged with: kendo-dropdown
upvote count: 5
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 1
favorite count: 0
tagged with: kendo-ui
has body: I am tring to get count of Kendo UI DropDownList but I am not getting right value. By taking count of Kendo UI, I want to remove last item from Kendo DropDownList. I tried following but not working: 1. var dropDown = $("#RoleDrp").data("kendoDropDownList"); var len = dropDown.value().length+1; var itemToRemove = dropDown.dataSource.at(len); dropDown.dataSource.remove(itemToRemove); dropDown.select(0); I am getting length as 6 but I have total 13 items in DropDownList. 2. var len = dropDown.length; I am getting undefined.
has comment: http://stackoverflow.com/comment/132938183
has answer: http://stackoverflow.com/a/24878887
accepted answer: http://stackoverflow.com/a/24878887

http://stackoverflow.com/a/24781265
score: 1
has comment: http://stackoverflow.com/comment/38458614
has comment: http://stackoverflow.com/comment/38459970
has body: What's happening when someone currently hovers, it does one thing while hovering and when they leave it has to d a sort of cleanup which are the two functions within hoverintent, namely over and out so the code would need to be split into two event listeners one for click of the element and one for blur I have chained the two listeners to the inital selector so it should all work. var nav = { init: function() { // Add parent class to items with sub-menus jQuery("ul.sub-menu").parent().addClass('parent'); var menuTop = 40; var menuTopReset = 80; // Enable click dropdowns for window size above tablet width jQuery("nav").find(".menu li.parent").on('click', function (event) { if($(event.target).parent().hasClass('menu-item-has-children')){ event.preventDefault(); }; if (jQuery('#container').width() &gt; 767 || jQuery('body').hasClass('responsive-fixed')) { // Setup menuLeft variable, with main menu value var subMenuWidth = jQuery(this).find('ul.sub-menu').first().outerWidth(true); var mainMenuItemWidth = jQuery(this).outerWidth(true); var menuLeft = '-' + (Math.round(subMenuWidth / 2) - Math.round(mainMenuItemWidth / 2)) + 'px'; var menuContainer = jQuery(this).parent().parent(); // Check if this is the top bar menu if (menuContainer.hasClass("top-menu")) { if (menuContainer.parent().parent().parent().hasClass("top-bar-menu-right")) { menuLeft = ""; } else { menuLeft = "-1px"; } menuTop = 30; menuTopReset = 40; } else if (menuContainer.hasClass("header-menu")) { menuLeft = "-1px"; menuTop = 28; menuTopReset = 40; } else if (menuContainer.hasClass("mini-menu") || menuContainer.parent().hasClass("mini-menu")) { menuTop = 40; menuTopReset = 58; } else { menuTop = 44; menuTopReset = 64; } // Check if second level dropdown if (jQuery(this).find('ul.sub-menu').first().parent().parent().hasClass("sub-menu")) { menuLeft = jQuery(this).find('ul.sub-menu').first().parent().parent().outerWidth(true) - 2; } jQuery(this).find('ul.sub-menu').first().addClass('show-dropdown').css('top…
has comment: http://stackoverflow.com/comment/38459955
has comment: http://stackoverflow.com/comment/38458524
upvote count: 1
has comment: http://stackoverflow.com/comment/38458605
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38459727
accepted answer of: http://stackoverflow.com/q/24780545
type: Answer
answers question: http://stackoverflow.com/q/24780545
downvote count: 0

http://stackoverflow.com/q/24819006
answer count: 3
has comment: http://stackoverflow.com/comment/38529427
upvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38528399
has body: I have a hidden input as follows: &lt;input class="item_shipval" type="hidden" value="" id="shipvalue"&gt; and javascript code as follows: &lt;script type="text/javascript"&gt; if (shipEmpty){ var shipval = myObject; document.getElementById('shipvalue').value = shipval; } else { var shipval = "Registered_Air_Mail"; document.getElementById('shipvalue').value = shipval; } //console.log (shipval); &lt;/script&gt; Console.log is showing the shipval values fine. But it is not passed to hidden input value with id "shipvalue". What is wrong with the code above ? Thanks in advance. I am a javascript newbie..
favorite count: 0
has answer: http://stackoverflow.com/a/24819231
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38528696
has answer: http://stackoverflow.com/a/24819260
has comment: http://stackoverflow.com/comment/38529108
downvote count: 2
has comment: http://stackoverflow.com/comment/38528624
has comment: http://stackoverflow.com/comment/38528498
type: Question
has title: javascript variable not being passed to hidden input value
score: -2
has comment: http://stackoverflow.com/comment/38529158
has comment: http://stackoverflow.com/comment/38528693
has answer: http://stackoverflow.com/a/24819131
has comment: http://stackoverflow.com/comment/38529070
has comment: http://stackoverflow.com/comment/38529113

http://stackoverflow.com/q/24764810
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38426462
has title: Populate web data from a JSON Array using php
has comment: http://stackoverflow.com/comment/38426269
has answer: http://stackoverflow.com/a/24768785
has comment: http://stackoverflow.com/comment/38427617
downvote count: 0
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/24764928
type: UnansweredQuestion
tagged with: php
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38426728
has body: I have been playing around with JSON for a few days and I really think it's a pretty cool way to interchange data making use of it... I am building an app using jquery mobile where I am trying to populate Json data, so far I have tried this approach: From a json file named movie-details.json I have this: {"movies":[{"id":"1","name":"Dabangg2","picUrl":"http:\/\/www.naz8.com\/images\/Dabangg2.jpg"},{"id":"2","name":"Talassh","picUrl":"http:\/\/www.naz8.com\/images\/talassh.jpg"},{"id":"3","name":"JAB TAK HAI JAAN","picUrl":"http:\/\/www.naz8.com\/images\/jthj.jpg"},{"id":"4","name":"Khiladi 786","picUrl":"http:\/\/www.naz8.com\/images\/khiladi786.jpg"}]} and I can get the data via the following to dynamically create a detailed listview: how can I populate the data from a php file, for example movie-details.php: <?php include('connection.php'); $var = array(); $sql = "SELECT * FROM movies"; $result = mysqli_query($con, $sql); while($obj = mysqli_fetch_object($result)) { $var[] = $obj; } echo '{"movies":'.json_encode($var).'}'; ?> What variables do I have to declare to fetch the json data from the objet in the php file? For example: // JUST AN IDEA... I AM CONFUSED.. var url="...."; $.getJSON(url,function(...){ $.each(movie.movies, function(i,...) Your help is greatly appreciated...
upvote count: 1
type: Question
answer count: 2

http://stackoverflow.com/comment/38526574
has text: Having a look at the XML returned by your `phpsqlajax_genxml2.php` script, I can see that the `content` parameters are indeed HTML encoded, ie `content="&amp;lt;b&amp;gt;This is Bold Text&amp;lt;/b&amp;gt;"`. Quick question, why XML?
comment on: http://stackoverflow.com/q/24817808
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/38501614
type: AnswerComment
score: 0
type: Comment
has text: It may be, but I never found this way :)
comment on: http://stackoverflow.com/a/24780666

http://stackoverflow.com/a/24762863
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24760832
answers question: http://stackoverflow.com/q/24760832
type: AcceptedAnswer
downvote count: 0
score: 1
has body: You could try this, in your javascript code, set: window.fn = punish; and then call window.fn() from your android code: cordova_webview.loadUrl("javascript:window.fn()"); 'fn' is not special here. We are just trying to make your function visible or accessible. 'window' object is already accessible, so we just set a reference to your function there. So, for example, window.myFunc1 = punish; .. would be fine too. I'm not entirely sure why this is required, but I'm posting this here anyway.

http://stackoverflow.com/q/24815740
answer count: 1
tagged with: javascript
tagged with: drop-down-menu
score: 0
has comment: http://stackoverflow.com/comment/38522707
has comment: http://stackoverflow.com/comment/38522640
has body: I'm looking for a solution beside mouseover so the detection is also effective with arrow up/down button.
has answer: http://stackoverflow.com/a/24815893
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38523105
has title: How to detect highlighted in a drop-down menue?
type: Question

http://stackoverflow.com/q/24870157
upvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/24870278
favorite count: 0
type: AnsweredQuestion
score: -5
has body: I cant seem to get multiple IF statements to work on my script. I want an image to appear when three input fields have text in, and not when only one or two have text in. Any help would be much appreciated. HTML: Full Name * Company * Email Address * Right click and save link as to download pdf Javascript:
type: Question
has answer: http://stackoverflow.com/a/24870278
tagged with: if-statement
downvote count: 5
tagged with: javascript
has title: Multiple IF statements showing image when input are completed

http://stackoverflow.com/comment/38466364
type: AnswerComment
comment on: http://stackoverflow.com/a/24780277
has text: Your answer is *exactly* what I wrote... Except you are still confused about what you are doing. `Function("v", "return ...")` is exactly like writing `function(v){return ...}` and has nothing to do with scope issues. And `customRenderers` is indeed a property of the component that can be affected after it is created... Just like my example does if you bother reading it... (sigh)
type: Comment
score: 0

http://stackoverflow.com/comment/38546372
has text: Thanks for the clarification. :D Yeah I tried to remove the onload and it still works. Hahaha! :D You're right that the text/javascript is missing. :D
type: AnswerComment
comment on: http://stackoverflow.com/a/24815239
type: Comment
score: 0

http://stackoverflow.com/a/24770812
score: 1
has comment: http://stackoverflow.com/comment/38437671
answers question: http://stackoverflow.com/q/24770792
has comment: http://stackoverflow.com/comment/38437676
has comment: http://stackoverflow.com/comment/38437651
has body: var cnt = _.map(items, function(x){ return x.count; }) .filter(function(i) { return i &gt; 0; }) .length; JSFiddle: http://jsfiddle.net/cwF4X/1/
has comment: http://stackoverflow.com/comment/38437566
has comment: http://stackoverflow.com/comment/38437576
upvote count: 1
has comment: http://stackoverflow.com/comment/42738767
type: Answer
has comment: http://stackoverflow.com/comment/42741092
downvote count: 0

http://stackoverflow.com/a/24848562
accepted answer of: http://stackoverflow.com/q/24848500
answers question: http://stackoverflow.com/q/24848500
type: Answer
has comment: http://stackoverflow.com/comment/38584151
has comment: http://stackoverflow.com/comment/38584169
has comment: http://stackoverflow.com/comment/38584110
has comment: http://stackoverflow.com/comment/38584115
has body: Something like this should work var selects = $('#range, #fabric, #colour'); selects.on('change', function() { var el = selects.map(function(i, item) { return item.value.indexOf('all_') === 0 ? '' : '.' + item.value; }).get().filter(function(x) { return x.length; }).join(''); $('#fabric_options li').show().not(s?s:'*').hide(); }); FIDDLE It starts with showing all the list items, then joins the values together to create a clas selector, leaving out the class if all_something is selected etc. and then hides everything that doesn't match, and if nothing is selected excludes everything.
upvote count: 5
has comment: http://stackoverflow.com/comment/38584198
score: 5
has comment: http://stackoverflow.com/comment/38584123
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/38702053
type: Comment
has text: Or do you mean to actually redefine a functions name property? :) If so, do you know a possible way? I'm not a 100 sure but afaik you can't redefine a functions name in ECMAScript5
type: AnswerComment
comment on: http://stackoverflow.com/a/24908575
score: 0

http://stackoverflow.com/a/24952808
has comment: http://stackoverflow.com/comment/73346750
score: 0
has body: Found the soluction in this thread: How to create generic (reusable) JavaScript autocomplete function Apparently calling it as autocomp("#searchGuyInput"); doesn't work and you need to call it as: $(function() { autocomp("#searchGuyInput"); }); I still don't get what these $(function() calls do so if anyone wants to clarify it I would be very glad.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24894454
type: Answer
accepted answer of: http://stackoverflow.com/q/24894454

http://stackoverflow.com/q/24764645
type: AnsweredQuestion
type: Question
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24764809
score: 0
has title: jQuery UI: Container div resizes
answer count: 1
has answer: http://stackoverflow.com/a/24764809
has body: In the following example there are two draggable divs in a container div. When the second draggable div is removed (by clicking on the button) the first div moves up and the container is resized (see jsfiddle). The first div should not move when the second div is removed, as its position is absolute. What's wrong with this code? The HTML: Remove and the javascript: $(document).ready(function(){ var $div0 = $(' ').appendTo('#container'); $div0.draggable(); $div0.offset({ top: 200, left: 350}); $div0.css('background-color','white'); $div0.css('width','150px'); $div0.css('height','200px'); $div0.text(0); var $div1 = $(' ').appendTo('#container'); $div1.draggable(); $div1.offset({ top: 200, left: 50}); $div1.css('background-color','white'); $div1.css('width','150px'); $div1.css('height','200px'); $div1.text(1); }); function removeDiv () { $('#div0').remove(); }

phonegap-build
tags question: http://stackoverflow.com/q/24845075
type: Tag
tag name: phonegap-build

http://stackoverflow.com/comment/38563807
comment on: http://stackoverflow.com/a/24829066
has text: thanks it really help me and i will keep that in mind. and I would have chose your answer but i have selected a answer.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/81433373
type: Comment
comment on: http://stackoverflow.com/a/24877544
type: AnswerComment
has text: Cannot find name 'cordova'. L38: ngAfterViewInit() { L39: cordova.plugins.Keyboard.disableScroll(true);
score: 0

http://stackoverflow.com/comment/47514602
comment on: http://stackoverflow.com/q/24828743
score: 0
has text: possible duplicate of ['Hoisted' JavaScript Variables](http://stackoverflow.com/questions/29667199/hoisted-javascript-variables)
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24821582
has body: I am trying to use angular's form validation from inside a templateUrl. I have a directive that loads a templateUrl in which i have a form with inputs that get ng-required and ng-regex values from directive scope. Now, i tried to put in my directive's scope form: '=', but when i access scope.form it is undefined. I must specify that my submit button is outside of the form, and when clicked ng-click='save($index)' it must first check that the form is valid and then proceed with saving the edited data. scope.save() is defined in my directive. this is from template: {{row[c.name]}} {{row[c.name]}} edit {{$index}} save cancel and this is from my directive: scope: { settings: '=', source: '=', form: '=' }, templateUrl: function (element, attr) { return attr.templateUrl || 'src/grid.html'; }, link: function (scope, element, attrs) { scope.editMode = []; scope.editing = false; scope.previousData = {}; scope.edit = function(field) { scope.editing = scope.source.data.indexOf(field); scope.editMode[scope.editing] = true; scope.previousData = angular.copy(field); }; scope.save = function(index){ console.log(scope.form); scope.editMode[index] = false; if (scope.editing !== false ) { //do the saving scope.editing = false; } }; scope.cancel = function(index){ scope.editMode[index] = false; if (scope.editing !== false) { scope.source.data[scope.editing] = scope.previousData; scope.editing = false; } }
favorite count: 0
tagged with: scope
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43218170
upvote count: 3
tagged with: directive
has answer: http://stackoverflow.com/a/27948075
accepted answer: http://stackoverflow.com/a/27948075
type: AnsweredQuestion
score: 3
tagged with: javascript
has title: AngularJS - Form Validation in a templateUrl of a directive
type: Question
answer count: 1
downvote count: 0

http://stackoverflow.com/a/24875247
type: Answer
downvote count: 0
score: 1
has body: You just have to include Dojo.js (in the downloaded zip file) in your project that will contain all the Dojo modules you need, instead of using the CDN.
accepted answer of: http://stackoverflow.com/q/24802756
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24802756

http://stackoverflow.com/comment/38464776
score: 0
type: AnswerComment
type: Comment
has text: FWIW I'd factor out the repeated deferencing of `ui.dragabble` and probably also employ jQuery chaining.
comment on: http://stackoverflow.com/a/24784664

http://stackoverflow.com/q/24763234
answer count: 1
has comment: http://stackoverflow.com/comment/38423329
tagged with: asp.net
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24763474
accepted answer: http://stackoverflow.com/a/24763474
has title: javascript escape double quote in eval
type: Question
tagged with: javascript
score: 0
tagged with: eval
has body: I have a link button in gridview like below &lt;asp:LinkButton ID="lbtnEdit" runat="server" OnClientClick='&lt;%# String.Format("Edit(\"{0}\", \"{1}\");return false;",Eval("Comment").ToString(),Eval("Status")) %&gt;' &gt;Edit&lt;/asp:LinkButton&gt; It works fine except there are double quote in comment. I tried change it to Eval("Comment").ToString().Replace(/'/g, "\'") but got error like " The server tag is not well formed." Any suggestion please

http://stackoverflow.com/comment/38634377
comment on: http://stackoverflow.com/a/24874586
has text: Yeah, I actually had like that at first - same outcome.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/24900906
possible better answer: http://stackoverflow.com/a/24900941
type: Question
tagged with: object
tagged with: javascript
linked to: http://stackoverflow.com/q/7102704
has body: var i = "test"; var test1 = { test: 3, b: 3 }; console.log(test1.i); Sorry if it's a simple answer, I am still learning. var i is looping to something different every few seconds and var i will always be something on test1.
accepted answer: http://stackoverflow.com/a/24900961
answer count: 2
upvote count: 0
has answer: http://stackoverflow.com/a/24900941
favorite count: 0
has answer: http://stackoverflow.com/a/24900961
score: -3
has comment: http://stackoverflow.com/comment/38683861
duplicate of: http://stackoverflow.com/q/7102704
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38683852
downvote count: 3
has title: Getting an object with a variable. -javascript-

http://stackoverflow.com/q/24909117
has comment: http://stackoverflow.com/comment/38744304
type: UnansweredQuestion
tagged with: firefox-addon-sdk
has comment: http://stackoverflow.com/comment/38709820
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/38747552
type: Question
tagged with: javascript
has title: Notification not displaying supplied image
has comment: http://stackoverflow.com/comment/38706167
tagged with: firefox-addon
has body: I'm trying to show a notification using an image I receive over a socket as an arrayBuffer. The notification shows, but without the image supplied. The standard firefox logo/icon is used instead. Any help would be appreciated. The code seems to run without any errors, or rather, no errors are are thrown/stack trace printed when the notification is created. Here is the code to create the notification: ps_worker.port.on("notification", function(notification){ //DISPLAY LINK TO USER var arrayBuffer_icon = notification.icon; var arrayBuffer_largeicon = notification.largeicon; var str = String.fromCharCode.apply(null,arrayBuffer_icon); var base64String = utils.btoa(str).replace(/.{76}(?=.)/g,'$&amp;\n'); var dataUri = "data:image/png;base64,"+ base64String; notifications.notify({ title: notification.app + ": " + notification.title, text: notification["subject"] + "\n" + notification.content, data: "did gyre and gimble in the wabe", // data is a string passed through to the on click listener iconURL: dataUri, onClick: function (data) { console.log(data); } }); }); the utils.btoa call is implemented as described here: https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Unit_testing The relevant server code is (node.js): function send_notification_to_socket(user, notification, target){ fs.readFile(notification.iconpath, function(err, buf){ if(socketstore.get_socket_by_id(user)){ socket = socketstore.get_socket_by_id(user); notification["icon"] = buf; socket.emit('notification', notification); }else{ console.log("No socket for user " + user); } }); } Any ideas on what I might be doing wrong?

http://stackoverflow.com/comment/38634557
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24872060
has text: @Alex yes you right. that was the problem, but I don't want it to have any value
score: 0

http://stackoverflow.com/comment/38675144
type: Comment
has text: Thanks. The code you stated above, if (!ng.defined(fcs_cal.get_last_selected_date())) alert("Please select a date"); Does that go in the area as a script or in the ng.ready area?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24895134

http://stackoverflow.com/a/24834552
has comment: http://stackoverflow.com/comment/38558337
type: Answer
answers question: http://stackoverflow.com/q/24815056
accepted answer of: http://stackoverflow.com/q/24815056
score: 0
type: AcceptedAnswer
has body: You can still further filter the store on the client side after it has been loaded and remote filtered on the server: http://help.rallydev.com/apps/2.0rc3/doc/#!/api/Ext.data.Store-method-filterBy

http://stackoverflow.com/q/24862347
has comment: http://stackoverflow.com/comment/38611071
has comment: http://stackoverflow.com/comment/38610670
answer count: 2
has comment: http://stackoverflow.com/comment/38610755
tagged with: arrays
downvote count: 0
has comment: http://stackoverflow.com/comment/38610896
possible better answer: http://stackoverflow.com/a/62317032
favorite count: 0
has comment: http://stackoverflow.com/comment/38611366
has comment: http://stackoverflow.com/comment/38610805
has comment: http://stackoverflow.com/comment/38610777
has comment: http://stackoverflow.com/comment/38611519
has comment: http://stackoverflow.com/comment/38610862
linked to: http://stackoverflow.com/q/26568536
has answer: http://stackoverflow.com/a/24862414
has title: Remove all elements after a position in an array of objects in Javascript using splice
has comment: http://stackoverflow.com/comment/38610948
type: AnsweredQuestion
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/38610626
has comment: http://stackoverflow.com/comment/38610620
type: Question
accepted answer: http://stackoverflow.com/a/24862414
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has answer: http://stackoverflow.com/a/62317032
has body: I am wondering if there is an easy way to splice out all elements after a key position. array.splice(index,howmany,item1,.....,itemX) The docs say the 2nd element that specifies the number of elements to be removed is a required field, is there a caveat to get this done? P.S - Not looking for the normal brute force solutions.

http://stackoverflow.com/a/25283689
upvote count: 3
answers question: http://stackoverflow.com/q/24893756
has body: To expand on my comment about extending the divs to remove the gap, here's some css you could add to the page in your example. Set the width of the divs to cover the gap between the left- and right-hand columns. I've zeroed the border, margin, and padding, and set the line height to make things look neat: div { border: 0; margin: 0; padding: 0; line-height: 18px; } div div { width: 81px; height: 18px; } Fiddle: http://jsfiddle.net/SQ39f/18/ If you know what the text looks like in advance (e.g. if you've got a table of results), this is the easiest option. If the lines are not uniformly laid out, you can use javascript to calculate the appropriate width for the divs -- iterate through the lefthand divs, subtract the 'left' position from that of the next sibling. This is fairly easily achieved with JQuery.
score: 3
downvote count: 0
type: Answer

http://stackoverflow.com/a/32380589
downvote count: 0
type: Answer
upvote count: 1
has body: I had this same error, but just resolved it. I don't think my issue was the same as Jason's but perhaps it will help others with an issue similar to mine. My issue resulted from me specifying 'img' rather than 'image' in: var imgData = canvas.toDataURL("img/jpeg", 1.0); This took me a little trial and error to figure out, because the console did not complain about "img" and I am used to abbreviating image as img in other contexts, so I must have just fat fingered it. In a similar vein you also need to make sure you specify jpeg rather than jpg.
score: 1
answers question: http://stackoverflow.com/q/24769424

http://stackoverflow.com/q/24835425
answer count: 1
tagged with: javascript
tagged with: opencart
score: 0
has answer: http://stackoverflow.com/a/24837113
type: UnansweredQuestion
has title: Retrieve JSON from javascript to php (OpenCart controller)
has body: There is a nice JSON object in console.log, but can't seem to retrieve it in controller. function checkOut(data) { $.ajax({ url: 'index.php?route=sale/customer/checkout&amp;token=&lt;?php echo $token; ?&gt;&amp;customer_id=&lt;?php echo $customer_id; ?&gt;&amp;products=' + data, type: 'post', dataType: 'html', data: 'products=' + encodeURIComponent(data), cache: false, beforeSend: function() { $('.success, .warning').remove(); $('#button-checkout').attr('disabled', true); $('#checkout').before('&lt;div class="attention"&gt;&lt;img src="view/image/loading.gif" alt="" /&gt; &lt;?php echo $text_wait; ?&gt;&lt;/div&gt;'); }, complete: function() { $('#button-checkout').attr('disabled', false); $('.attention').remove(); }, success: function(html) { console.log(data); $('#checkout').html(html); } }); } Sending data via get only seems to send a string, [object Object]. Change the dataType to json and all the html in result page disappears. Experimented with $.parseJSON(data);, which returns null value in console.log. What's the method to retrieve the data object so it can be json_decode($data, TRUE)d and available as a php array?
tagged with: http://stackoverflow.com/tag/json
type: Question

http://stackoverflow.com/comment/38677282
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24873704
has text: The problem is that the third party calls the js file internally, and I don't want to hack around in the component.

http://stackoverflow.com/comment/38644762
comment on: http://stackoverflow.com/q/24879374
score: 0
type: QuestionComment
has text: Also move the `angularDiv.classList.add('ng-csp');` up to before `angular.bootstrap`.
type: Comment

http://stackoverflow.com/a/24798676
downvote count: 0
has comment: http://stackoverflow.com/comment/38490765
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/24798666
has body: you will have to call that function. console.log(nameString("Amir")); If you will say console.log(nameString) it will just print the value of varibale nameString which is a function. There is a . in your function in last of return statement, remove that.

gruntjs
tags question: http://stackoverflow.com/q/24850884
tags question: http://stackoverflow.com/q/24869893
tags question: http://stackoverflow.com/q/24762831
tags question: http://stackoverflow.com/q/24795185
tags question: http://stackoverflow.com/q/24853010
tags question: http://stackoverflow.com/q/24860277
tags question: http://stackoverflow.com/q/24791260
tags question: http://stackoverflow.com/q/24823544
tags question: http://stackoverflow.com/q/24878864
tags question: http://stackoverflow.com/q/24800338
tags question: http://stackoverflow.com/q/24824456
tags question: http://stackoverflow.com/q/24878850
tags question: http://stackoverflow.com/q/24902860
tags question: http://stackoverflow.com/q/24765074
tags question: http://stackoverflow.com/q/24844061
tags question: http://stackoverflow.com/q/24785176
tags question: http://stackoverflow.com/q/24844263
tags question: http://stackoverflow.com/q/24767092
type: Tag
tags question: http://stackoverflow.com/q/24887500
tags question: http://stackoverflow.com/q/24826682
tags question: http://stackoverflow.com/q/24908391
tags question: http://stackoverflow.com/q/24763863
tags question: http://stackoverflow.com/q/24867928
tags question: http://stackoverflow.com/q/24807970
tags question: http://stackoverflow.com/q/24885883
tags question: http://stackoverflow.com/q/24762409
tags question: http://stackoverflow.com/q/24779226
tags question: http://stackoverflow.com/q/24831800
tag name: gruntjs
tags question: http://stackoverflow.com/q/24881372
tags question: http://stackoverflow.com/q/24757050
tags question: http://stackoverflow.com/q/24871069
tags question: http://stackoverflow.com/q/24782303
tags question: http://stackoverflow.com/q/24846519
tags question: http://stackoverflow.com/q/24755552

http://stackoverflow.com/a/40622895
type: Answer
accepted answer of: http://stackoverflow.com/q/24890375
answers question: http://stackoverflow.com/q/24890375
score: 0
has body: document.booking.elements['distance'].value = mi; document.booking.elements['timetaken'].value = time_taken;
type: AcceptedAnswer

http://stackoverflow.com/comment/38522213
type: Comment
has text: Is it possible to build a simple [jsfiddle](http://jsfiddle.net/) we can play with? You may want to give each image on which you want the "pinit" overlay a class like "pinner". Then filter your jQuery selection by that class: `$('img.pinner').pinit();`.
score: 1
comment on: http://stackoverflow.com/q/24815457
type: QuestionComment

http://stackoverflow.com/q/24781091
score: 1
linked to: http://stackoverflow.com/q/3198915
type: Question
possible better answer: http://stackoverflow.com/a/24950394
tagged with: google-closure-compiler
has answer: http://stackoverflow.com/a/24950394
tagged with: javascript
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/24808349
accepted answer: http://stackoverflow.com/a/24808349
favorite count: 0
has comment: http://stackoverflow.com/comment/38468781
tagged with: google-closure
has body: I have a project moved into my hands recently. It uses Google Closure to compile multiple JS files into one final.js. Sometimes I need to debug final.js in the browser, but the problem is Closure always compress JavaScript code with shorten function and variable names. So I can't debug final.js properly in the browser. My question is, is there any way to use Google Closure to just concatenate JS files without compressing? The answer can be some CLI options or even hacking the source code. PS. I've tried --formatting PRETTY_PRINT, but the final code still got compressed.
has title: Can I use Google Closure only for concatenating JavaScript files?
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/a/24877366
type: AcceptedAnswer
type: Answer
has body: Thanks for your reply, it helped me to build my own solution. Here is what I did : App.on = function(callback) { App.socket.on(this.reference, callback); } And I call it like a simple listener : App.on(function(data) { console.log(data); }); Simply pass a callback function from App.on, pass this function to socket.on, and do whatever you want in this function from App.on
accepted answer of: http://stackoverflow.com/q/24836395
answers question: http://stackoverflow.com/q/24836395
score: 0

http://stackoverflow.com/comment/38557939
has text: I suspect that's not possible... You'd have to run the entire browserify process on the client side for every page load, and that's usually on the seconds scale. Browserify is pretty magical, but I do believe you'll need the server-side bundling to make it work...
type: QuestionComment
type: Comment
score: 2
comment on: http://stackoverflow.com/q/24833367

http://stackoverflow.com/q/24776317
tagged with: jquery-selectors
downvote count: 0
score: 1
answer count: 4
favorite count: 0
has body: I have a list structure like this (note the two lists with .browser class and one of them with data-click="yes") Group 1 Item_1 Item_2 Item_3 Group_2 Item_4 Item_5 Item_6 Group_3 Item_1 Item_2 Group_4 Item_1 Item_2 Item_3 Item_3 I would like to assign an on click action with jQuery to the A elements within the element, however I do not want this behavior to propagate further to the A elements in the child element . Moreover, it is important for me to keep the class .browser for both those lists. I tried to use :not selector in the following way $("body").on("click", "UL.browser[data-click='yes'] :not(.browser) A", function (event) { // do something }); and many other variants, but without success. It is also important for me to use the structure with appending the event to body since I am changing the structure dynamically. I found many variants of this problem here, however none of them is quite the same and they did not work for me. I sense that I misunderstand the :not selector in some way, however I still can't get it right.
upvote count: 1
has answer: http://stackoverflow.com/a/24777052
type: AnsweredQuestion
has title: Select all children except those in a marked group with jQuery
has answer: http://stackoverflow.com/a/24776437
type: Question
has answer: http://stackoverflow.com/a/24776398
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24776398
possible better answer: http://stackoverflow.com/a/24776473
has answer: http://stackoverflow.com/a/24776473

http://stackoverflow.com/comment/38481627
comment on: http://stackoverflow.com/a/24780432
type: Comment
has text: use `.html()` to change the innerHTML
score: 0
type: AnswerComment

http://stackoverflow.com/q/24907341
has comment: http://stackoverflow.com/comment/38721862
answer count: 4
has comment: http://stackoverflow.com/comment/38736379
has comment: http://stackoverflow.com/comment/38756457
tagged with: yammer
has comment: http://stackoverflow.com/comment/55661445
type: Question
has comment: http://stackoverflow.com/comment/38776243
has answer: http://stackoverflow.com/a/24921412
upvote count: 5
has answer: http://stackoverflow.com/a/24951166
has title: Yammer JS SDK — problems with CORS
score: 5
tagged with: cors
has answer: http://stackoverflow.com/a/24923309
downvote count: 0
tagged with: javascript
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24910418
has body: It seems like something has changed on the Yammer side, because my app (not yet published to the Yammer Global App Directory) has stopped working, resulting in an obscure CORS error, that doesn't tell a thing about the problem. So the workflow is very simple — I'm ensuring that user is logged in by calling getLoginStatus() (which pops-up a window and immediately closes it. Irritating, but can live with that) Sending a request to messages/in_group/ID.json wrapped in a yam.platform.request, as suggested by the Yammer JS SDK manual Here's the console screenshot: In the Yammer App settings there's a single Javascript Origin, which is https://buzztale.com, which is exactly the one, the request is made from. This happened before, but then disappeared itself (really confusing). And now it seems to be back… Hope somebody has any suggestions regarding this issue. In order to get to the app, here's the URL — https://buzztale.com/yammer.

http://stackoverflow.com/comment/38421898
comment on: http://stackoverflow.com/q/24762348
score: 0
type: Comment
type: QuestionComment
has text: @kapa no it is not. when i access events[0].name i can get the name of the event. the error is directly involved with the arrays inside the new_event var.

http://stackoverflow.com/comment/38459493
comment on: http://stackoverflow.com/a/24781800
has text: He says he's not getting to the success function.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38431320
type: Comment
has text: you need to refer to those fields as: `f.['payment[cc_name]'].value` and `f.['payment[ship_name]'].value` respectively.
comment on: http://stackoverflow.com/a/24767076
type: AnswerComment
score: 0

http://stackoverflow.com/a/25071084
answers question: http://stackoverflow.com/q/24768341
type: Answer
has comment: http://stackoverflow.com/comment/39004679
has body: Have you tried using ng-cloak? https://docs.angularjs.org/api/ng/directive/ngCloak Add the bit of CSS they include on that page to your site's CSS. Then, add the 'ng-cloak' class to your p tags. This will hide them until Angular loads. Then Angular will remove the ng-cloak classes, and the items will be hidden based on the ng-show tags.
score: 0

http://stackoverflow.com/comment/38533547
comment on: http://stackoverflow.com/a/24821688
score: 0
type: AnswerComment
has text: Hey that's great help and It's working perfect but I am still want to understand how to update cookie value because sometimes I want to update cookie value also.
type: Comment

http://stackoverflow.com/q/24754197
tagged with: android
tagged with: http://stackoverflow.com/tag/html
tagged with: html5-audio
answer count: 0
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38412263
tagged with: javascript
has comment: http://stackoverflow.com/comment/38406528
tagged with: audiojs
downvote count: 0
score: 1
has body: On iOS and desktop I don't have problems playing my HTML5 audio with audio.js – everything works fine. But with Android the play-button needs three taps to play! I've also written a issue about this on audio.js' github: https://github.com/kolber/audiojs/issues/177 REPRO: go to http://kolber.github.io/audiojs/ on a Android phone (I tested with Xperia Z1/Android 4.4.2) expected the play/pause button to be in play state initally, but is in loading state clicking play makes the button go into play state clicking again sets the button into loading state clicking again sets the button into playing state, and this time finally plays the audio! How can I make it play with only one tap/click??
favorite count: 0
type: UnansweredQuestion
has title: Playing HTML5 Audio using audio.js requires three taps on Android

http://stackoverflow.com/a/24896408
answers question: http://stackoverflow.com/q/24896295
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38675552
has body: use mysql_real_escape_string() in every $_POST and $_GET And condition is a reserved word try to rename this.
downvote count: 0

http://stackoverflow.com/a/24811163
downvote count: 2
has comment: http://stackoverflow.com/comment/90881642
score: 0
has comment: http://stackoverflow.com/comment/38625762
type: Answer
has body: Undeclared variables or variables without a value have a type of 'undefined'. It's important to note that unlike some other languages (like PHP, for example) 'undefined' is a Javascript keyword that can be checked against, for example: if(cancel == undefined) { alert('Cancel is undefined!'); }; You can check for the type of a Javascript variable using the javascript typeof command, for example: var cancel; var typeOfCancel = typeof cancel; // In this case, undefined var cancel = true; var typeOfCancel = typeof cancel; // In this case, boolean This can lead to an extra check, when working with javascript, to see if a variable has been set, as in: if(cancel == undefined || cancel == null || cancel == '') { // React to the empty value here } You can see this working here: http://jsfiddle.net/7bu84/
answers question: http://stackoverflow.com/q/24811001
upvote count: 2

http://stackoverflow.com/a/24777366
score: 0
has comment: http://stackoverflow.com/comment/38449980
type: Answer
has comment: http://stackoverflow.com/comment/38449927
has body: How about this: var amountChecked = $('input:checked');
answers question: http://stackoverflow.com/q/24777311

http://stackoverflow.com/a/24760497
upvote count: 1
type: AcceptedAnswer
has body: You can use this regex: var s ='Lat = 38.7970308\n' + 'Long = -100.8665928'; var m = s.match(/[+-]?(?:\d+(?:\.\d+)?|\.\d+)/g); //=&gt; ["38.7970308", "-100.8665928"]
type: Answer
answers question: http://stackoverflow.com/q/24760396
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24760396
score: 1

http://stackoverflow.com/q/24776521
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: What is the best global way to detect screen orientation on tablets
linked to: http://stackoverflow.com/q/13867347
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24776662
favorite count: 0
has comment: http://stackoverflow.com/comment/38448302
tagged with: orientation
upvote count: 2
type: UnansweredQuestion
tagged with: css
has answer: http://stackoverflow.com/a/24776673
score: 2
has body: I'm looking for a global solution which will detect orientation on tablets (not just iPad or Android device but the more the better). One solution : device.portrait = function() { return (window.innerHeight / window.innerWidth) &gt; 1; }; device.landscape = function() { return (window.innerHeight / window.innerWidth) &lt; 1; }; My point of view is that this above is not working well. I need good solution to load dedicated images in carousel on portrait view and dedicated image on landscape view when orientation change. Cheers.
type: Question

http://stackoverflow.com/q/24752111
tagged with: jsp
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38402566
type: Question
has body: Getting error: missing ) after argument list when reading csv file but when i am using to alert in javascript or assigning it to any variable in javascript. OUTPUT: Name,Party,Province,Age,Gender "Mourani, Maria",BlocQuebecois,Quebec,43,Female "Sellah, Djaouida",NDP,Quebec,30,Female "St-Denis, Lise",NDP,Quebec,72,Female "Fry, Hedy",Liberal,BritishColumbia,71,Female "Turmel, Nycole",NDP,Quebec,70,Female "Sgro, Judy",Liberal,Ontario,68,Female "Raynault, Francine",NDP,Quebec,67,Female "Davidson, Patricia",Conservative,Ontario,66,Female Error: Page renders:
score: 0
has answer: http://stackoverflow.com/a/24752529
answer count: 1
tagged with: java
has title: SyntaxError: missing ) after argument list while reading csv file and alerting in js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24752529

http://stackoverflow.com/comment/38619825
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24866845
has text: when I look at document.cookies in the script on some other site it says the following: CFID=141701010; CFTOKEN=5599abd5d67ae4a4-7C095B6D-9CD9-D5A9-300B140A02F494F9; __qca=P0-285957599-1404239672015; __utma=1.1407759513.1404239672.1405887047.1405948443.68; __utmz=1.1404239672.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmv=1.|1=User%20Type=non-member=1; _cb_ls=1; _chartbeat2=BL1dzWBm0jTrC6undF.1403386051352.1405951394845.1111100011111111; _chartbeat_uuniq=3; __utmb=1.4.10.1405948443; __utmc=1
type: Comment

http://stackoverflow.com/a/24907137
downvote count: 0
has comment: http://stackoverflow.com/comment/38705099
has body: try this: var x=xmlDoc.getElementsByTagName("object"); for (i=0;i<x.length;i++) { document.write(" "); document.write(" Last Communication "); var item = x[i]; if(item !== undefined) { var itemElements = item.getElementsByTagName("property"); if(itemElements.length > 0) { if(itemElements[0].childNodes.length > 0) { document.write(itemElements[0].childNodes[0].nodeValue || ''); } } } //... }
answers question: http://stackoverflow.com/q/24906830
type: Answer
has comment: http://stackoverflow.com/comment/38701773
score: 1
has comment: http://stackoverflow.com/comment/38714343
upvote count: 1
has comment: http://stackoverflow.com/comment/38695563
accepted answer of: http://stackoverflow.com/q/24906830
type: AcceptedAnswer

http://stackoverflow.com/comment/39100060
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24784666
has text: Isnt wrapping jquery in a directive considered bad practice?
score: 0

http://stackoverflow.com/comment/38684624
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/24901334
has text: You're doing `echo $userID;` but it hasn't yet been assigned. So add `$userID = $_POST['userID'];`
type: Comment

http://stackoverflow.com/a/24845157
score: 3
upvote count: 3
has body: It sounds like you're putting the script element in your main page, but then trying to use it in an iframe on the page. Also, you're using window.parent.parent which goes two levels up the containment hierarchy, which seems suspicious. The iframe and the main window are two different environments. Globals (like your autoscroll) in the main page are not in scope for the iframe's code. The iframe can access the parent window's globals, provided they're from the same origin, via the parent symbol: parent.autoscroll(); Then use window, or window.paren, depending on whether you want to scroll the parent or its parent. It's all about being relative to the document in which the script is included. Since that was clear as mud: Let's assume your goal is to scroll the main window that the iframe is in: Option 1: Put it in the iframe (probably best): In the main window: Nothing. In the iframe &lt;script language="JavaScript"&gt; function autoscroll() { window.parent.scrollTo(0,0); // &lt;== Only one `parent`, if you want the iframe's parent } &lt;/script&gt; and onload="autoscroll();" Or: Option 2: Put it in the main window: In the main window: &lt;script language="JavaScript"&gt; function autoscroll() { window.scrollTo(0,0); // &lt;== No `parent` at all, if you want the main window } &lt;/script&gt; In the iframe: onload="parent.autoscroll();"
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/24845139
has comment: http://stackoverflow.com/comment/38578151

http://stackoverflow.com/q/24859093
has comment: http://stackoverflow.com/comment/38604870
type: Question
score: 14
has answer: http://stackoverflow.com/a/24859509
has comment: http://stackoverflow.com/comment/38605067
has answer: http://stackoverflow.com/a/24859253
has comment: http://stackoverflow.com/comment/38605020
has answer: http://stackoverflow.com/a/24859135
has answer: http://stackoverflow.com/a/24859166
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/24859126
duplicate of: http://stackoverflow.com/q/3680429
linked to: http://stackoverflow.com/q/5855135
has answer: http://stackoverflow.com/a/24859126
answer count: 5
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/24859135
type: AnsweredQuestion
upvote count: 14
has body: So, I was going to make an overlay thing for my website where an element is fixed over the site and placed above everything. But this means that nothing else behind the element can be effected. Here's a JSFiddle reproducing this problem. You'll notice that you cannot highlight the black text, and the JavaScript event doesn't fire. Here is the CSS + HTML I've used to create this problem: HTML You can't highlight me! D: You cannot highlight the text behind this DIV. It also doesn't fire click events. main-container: This holds the content. container-content: This is the content behind the fixed DIV container-fixed: This is the DIV the overlaps "container-content" CSS #main-container { width: 90%; margin: 5%; position: relative; height: 500px; overflow: auto; } #container-content { width: 100%; height: auto; } #container-fixed { width: 100%; height: 100%; position: absolute; top: 0; left: 0; color: red; } Is what I'm trying to achieve even possible? Both CSS and JavaScript (jQuery) answers are allowed.
has title: Click through an element, affecting what's behind it

http://stackoverflow.com/q/24828560
has title: Submitting FormB upon submission of FormA using VBScript.ASP and JavaScript
accepted answer: http://stackoverflow.com/a/24842573
has body: My client has a long subscription form (FormB). They've asked me to send out an email to a rental list of contacts, asking them to subscribe. They want to use FormB, which is on their website, but are concerned that it might be too long and would put people off subscribing. I do not have dev access to FormB. I would like to create an identical form (FormA), one which can pre-populate based on the contact details that I have in my database when a contact clicks through from my email. The client feels this would make the subscription process easier. Is there a way using VBScript.ASP and/or JavaScript to pass the submitted values from FormA to FormB, and submit FormB automatically when they click submit on FormA? Thanks in advance for the help. I'm happy to provide more details if required.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24829158
tagged with: forms
tagged with: vbscript
has answer: http://stackoverflow.com/a/24842573
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/24829158
tagged with: javascript
score: 0

http://stackoverflow.com/q/24784582
score: 1
has title: Javascript Module Pattern value is showing undefined in alert
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/24784758
has body: I want the result of rate and qunatity in Amont text box near amount button but it showing me 0 in textbox and when alerting value it shows undefined can anyone please help me i am at very beginer level in javascript...Any Help will be appreciated. Here is My HTML Item id : Catogeory : Quantity : Rate : Discount : Sr# Catogeory Quantity Rate Amount % Discount Net Action And Javascript is $(document).ready(function(){ var calc = new calculate(); calc.rate(); calc.discount(); }); var calculate = function(){ var txt_quantity = $('#txt_Quan_tity').val(); var txt_rate = $('#txt_Ra_te').val(); var txt_Amount = $('#txt_Amo_unt').val(); var txt_discount = $('#txt_Disc_ount').val()/100; var txt_net = $('#txt_Net').val(); debugger var total_amount = txt_quantity * txt_rate; // Total var total_net = txt_discount * txt_Amount; return{ rate : function(){ $('#txt_Ra_te').on('input',function(){ alert(txt_rate); // $('#txt_Amo_unt').val(total_amount); }); }, // End Rate Function discount : function(){ $('#txt_Disc_ount').on('input',function(){ // $('#txt_Net').val(total_net); }); } }; };
has comment: http://stackoverflow.com/comment/38464207
tagged with: http://stackoverflow.com/tag/html
tagged with: module
accepted answer: http://stackoverflow.com/a/24784758
has comment: http://stackoverflow.com/comment/38464113
type: AnsweredQuestion
upvote count: 1
tagged with: design-patterns
type: Question
has comment: http://stackoverflow.com/comment/38464571

http://stackoverflow.com/comment/38682457
type: Comment
has text: If you want to do it from the other direction. You want to use [`.has()`](http://api.jquery.com/has/)
comment on: http://stackoverflow.com/a/24900139
type: AnswerComment
score: 0

http://stackoverflow.com/a/24814243
has comment: http://stackoverflow.com/comment/38520640
has comment: http://stackoverflow.com/comment/38520597
has comment: http://stackoverflow.com/comment/38520229
has comment: http://stackoverflow.com/comment/38520676
has comment: http://stackoverflow.com/comment/38520545
has body: Try removing the string interpolation omg(svglayout(key).width)
score: 0
has comment: http://stackoverflow.com/comment/38520482
type: Answer
has comment: http://stackoverflow.com/comment/38519974
has comment: http://stackoverflow.com/comment/38519913
has comment: http://stackoverflow.com/comment/38520524
answers question: http://stackoverflow.com/q/24814196

http://stackoverflow.com/a/27784552
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24768617
answers question: http://stackoverflow.com/q/24768617
type: Answer
has body: I think you can't, the idea for this is to be used as locator for finding the element, so if it's not an element you won't be able, you can get around using .toMatch() so it will try finding at least one result, otherwise you must say that will be equal to all the text expected "Showing 1 of 2".
score: 1
upvote count: 1

http://stackoverflow.com/comment/121573536
type: QuestionComment
comment on: http://stackoverflow.com/q/24909114
score: 0
has text: What is "VB"? [Visual Basic for Applications](https://en.wikipedia.org/wiki/Visual_Basic_for_Applications) (VBA)?
type: Comment

http://stackoverflow.com/comment/38478192
comment on: http://stackoverflow.com/a/24791398
type: Comment
has text: What do you mean? In the fiddle? Or on your page?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38681161
comment on: http://stackoverflow.com/q/24898436
score: 0
type: QuestionComment
has text: @MatthewBlancarte I appreciate the effort but I prefer a "clean" way of doing this :)
type: Comment

http://stackoverflow.com/comment/38554443
has text: alert($(this).data('brand')); printing abc for couple of items. so condition should match ideally.
score: 0
comment on: http://stackoverflow.com/q/24832590
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38580206
score: 5
type: QuestionComment
type: Comment
has text: Please retitle your question.
comment on: http://stackoverflow.com/q/24846511

http://stackoverflow.com/comment/38454608
has text: @Piwwoli: My approach to software development is to "respect the user". They may be paying for their data usage on mobile; why force them to download the jQuery library just so I can add an onClick event? But, that just my style.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24779471

http://stackoverflow.com/q/24871368
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/38630505
has title: Socket.io Multiple messages emitted from one event
has body: I've been looking for quite a while for a solution but haven't found anything yet. I'm trying to emit a message from a server every time the server sees that a file has changed in a specified directory. However, instead of only emitting one message, it insists on emitting the same message three times. I am using chokidar to watch the directory, and inside of the 'change' event I emit the message. Server side code: var express = require('express') , app = express() , http = require('http') , server = http.Server(app) , io =require('socket.io')(server) , chokidar = require('chokidar'); server.listen(1234); app.use('/public', express.static( __dirname + '/public')); app.get('/', function(request, response){ var ipAddress = request.socket.remoteAddress; console.log("New express connection from: " + ipAddress); response.sendfile(__dirname + '/public/index.html'); //Server client }); var watcher = chokidar.watch("temp", {ignored: /[\/\\]\./, persistent: true}); watcher.on('change', function(path){ console.log(path + " has changed."); fs.readFile(path,'utf8', function(err, data){ if(err) { return console.log(err); } else { var json = JSON.parse(data), recPsec, type; recPsec = json.data[0].values[0]; type = json.data[0].values[16]; var compiled = { "recPsec" : recPsec, "type" : type } var jsonMessage = JSON.stringify(compiled) io.sockets.emit('message', JSON.stringify(jsonMessage)); console.log("Sent message"); } }); }); watcher.on('unlink', function(path){ console.log('File: ', path, ' has been removed'); }); watcher.on('add', function(path){ console.log("hi"); fs.readFile(path,'utf8', function(err, data){ if(err) { return console.log(err); } else { var json = JSON.parse(data), recPsec, type; recPsec = json.data[0].values[0]; type = json.data[0].values[16]; var compiled = { "recPsec" : recPsec, "type" : type } var jsonMessage = compiled; io.sockets.emit('message', JSON.stringify(jsonMessage)); console.log("message sent"); } //fs.unlinkSync(path); }); }); Client Side: var s…
score: 1
has comment: http://stackoverflow.com/comment/38630258
upvote count: 1
tagged with: socket.io
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38631125
tagged with: express
has comment: http://stackoverflow.com/comment/49635763
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/38631019
favorite count: 0
has answer: http://stackoverflow.com/a/33074757

http://stackoverflow.com/a/24817730
answers question: http://stackoverflow.com/q/24817497
score: 0
type: Answer
has body: I didn't really get the question and since I don't have the required reputation to comment, I will give you the answer based on my predictions; If you want the provided table to appear inside the HTML body ( for example ) then simply replace alert box with document.getElementbyID("quote_item").innerHTML = html_str; If you want the entire HTML to appear in the , create a pre tag inside a tag inside the ` pre id="quote_item" /pre` and replace the alert box in your javascript with; document.getElementbyID("quote_item").innerHTML = html_str; P.S: enclose pre inside &lt; >, stackoverflow's overriding it into an HTML content, not sure how the quotes here work as I'm still new :S

http://stackoverflow.com/a/24884445
type: Answer
has comment: http://stackoverflow.com/comment/38693692
has comment: http://stackoverflow.com/comment/38682766
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24884185
has comment: http://stackoverflow.com/comment/38652395
upvote count: 1
has body: I feel that this is an abuse of regexp. I'd suggest to write a validate method (pseudocode) instead: validate(input): text = input.replace('.', '') if(text.length &gt; 9) return false; if(! /^\\d+$/.matches(text)) return false; pos = input.indexOf('.') if(pos &lt; input.length-2) return false; if(index.count('.') &gt; 1) return false; return true; } Each line checks one assumption. That way, the code is easy to understand and easy to extend.

http://stackoverflow.com/q/24771696
tagged with: ionic-framework
answer count: 2
has answer: http://stackoverflow.com/a/24794151
downvote count: 0
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has body: So I'm trying to use ionic to build a simple mobile app. I've looked at ionic tutorials and googled quite a bit but I'm not quite getting it. I have created a nav bar that shows up on every page by adding this code to the index.html page: I added a navicon to the right side of the nav bar on one of my pages with this code: <ion-view title="Hanzi Options"> <ion-content>...etc I would like to be able to click on the navicon and see a side menu containing a basic html page called sidemenu.html that is located in the templates folder. Here is the start of the code in that file: <ion-side-menus> Back <ion-side-menu side="left"> Navigate <ion-content class="has-header"> <ion-list> Friends ...etc I added this code to my app.js file in the .config section: .state('app.sidemenu', { url: "/sidemenu", abstract: true, templateUrl: "templates/sidemenu.html", controller: 'NavCtrl' }) and an empty NavCtrl to my controllers.js file: .controller('NavCtrl', function($scope) { }); I suspect that maybe my .state code isn't quite right but not sure. Also, do I need to add something to the NavCtrl controller to open/close the side menu? Many thanks in advance!
upvote count: 3
has comment: http://stackoverflow.com/comment/38441541
has answer: http://stackoverflow.com/a/24771987
type: Question
has title: ionic side menu does not appear
score: 3
tagged with: javascript

http://stackoverflow.com/comment/38460019
comment on: http://stackoverflow.com/a/24767804
type: AnswerComment
score: 0
type: Comment
has text: Actually for personal use. I'm trying to create some simple apps to help familiarize myself if JS/Jquery. Used this script has a map of sorts to add/update ssn/dob/phone number fields.

http://stackoverflow.com/comment/38550103
type: Comment
comment on: http://stackoverflow.com/q/24829727
has text: I tried being more specific.
score: 0
type: QuestionComment

http://stackoverflow.com/a/24782824
type: Answer
has comment: http://stackoverflow.com/comment/38484637
score: 0
has body: I would rather inject $window into your LoginController. You could then define this method in the controller : $scope.go = function(path = "#/Dashboard/") { return $window.location = path; }; Then use it in your template: &lt;ANY ng-click="go()"/&gt; &lt;ANY ng-click="go('#/Temp/')"/&gt;
answers question: http://stackoverflow.com/q/24779726
has comment: http://stackoverflow.com/comment/38491810

http://stackoverflow.com/comment/38725821
type: Comment
comment on: http://stackoverflow.com/a/24899335
score: 0
has text: I don't see any need to pause between requests. Essentially, what your current implementation is doing is invoking all the requests, sleeping for a bit, and then existing before finishing the requests. To keep things simple, just implement the callback like this: `function() { console.log('I am done'); }`. Also, you should remove the process.exit call.
type: AnswerComment

http://stackoverflow.com/comment/38428945
type: Comment
score: 1
comment on: http://stackoverflow.com/a/24765780
type: AnswerComment
has text: It depends on how much you care. If you judge that little damage or annoyance can be done and neither you nor anyone else cares if something happens to it, so be it. But I would encourage everyone that if they're going to do something, do it right. As I said in an edit, there are premade templates in Visual Studio (I suppose it depends on what version you have) that have the security stuff preconfigured for you. You can just edit the app to suit your purposes from there.

http://stackoverflow.com/q/24825054
has answer: http://stackoverflow.com/a/24825334
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/280049
has answer: http://stackoverflow.com/a/24825330
answer count: 4
has comment: http://stackoverflow.com/comment/38539760
has title: How to check whether the image from the specified URL loaded or not
has comment: http://stackoverflow.com/comment/38541002
type: Question
has answer: http://stackoverflow.com/a/24825253
has body: Through an ajax call, I am procuring URLs which I need to use to change the src of an img. However this is taking time. Meanwhile i need to show loading or something. How do i check whether $("#img#).attr("src","http:\\fsomething "); has loaded the image on the page or not?
tagged with: javascript
score: 0
tagged with: jquery
linked to: http://stackoverflow.com/q/280049
has answer: http://stackoverflow.com/a/24825235
tagged with: ajax

http://stackoverflow.com/a/24848150
score: 1
type: Answer
upvote count: 1
has body: As for the searching first and last names why not just run another filter on your filtered results? You could split the search by spaces. results = namesCollection.filter(function(item) { return item.get('First_Name') == (search.split(' ')[0]);}); if(search.split(' ').length &gt; 1){ results = namesCollection.filter(function(item) { return item.get('Last_Name') == (search.split(' ')[1]);}); } As for finding a similar string that might work with mispelled words you are probably going to need something like a Levenshtein function which allows you to calculate the similarity between to strings. You could then determine based on your own threshold whether or not to consider it a match. Here is a js library for it If you want to do partial matches as well assuming they are correctly spelled you could first search for exact matches and if one is found use it (let's say for the first name which means there is only one element after split). If an exact match is not found then try a partial match with an indexOf(). If you get a match on the first name and there is also a last name (meaning there are more than one elements in the split) then attempt an exact match of the last name. If that last name match fails then do the partial match search.
downvote count: 0
answers question: http://stackoverflow.com/q/24847468

http://stackoverflow.com/comment/38417131
type: Comment
has text: Exposing all the usernames in your web application to the client seems like a major security risk. While AngularJS is extremely powerful, you want to perform security-sensitive operations server-side rather than client-side.
score: 2
comment on: http://stackoverflow.com/a/24759815
type: AnswerComment

http://stackoverflow.com/a/24773498
type: Answer
accepted answer of: http://stackoverflow.com/q/24773067
answers question: http://stackoverflow.com/q/24773067
has body: You can do it by using Angular-Bootstrap easily, without going for using Jquery plugin. Working Demo basictabs.html Content for Tab 1 Content for Tab 2 Content for Tab 3 But if you are very specific and want to achieve that by using JQuery UI Try this out Working Demo AngularJS Plunker
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/24775704
tagged with: javascript
tagged with: gulp
score: 0
tagged with: asynchronous
has comment: http://stackoverflow.com/comment/38446919
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/69182517
has comment: http://stackoverflow.com/comment/44119040
tagged with: task
tagged with: build
linked to: http://stackoverflow.com/q/24619290
has title: gulp run-sequence: tasks apparently running when prev task is not yet finished
type: Question
has body: we're using gulp and run-sequence in order to build our application having the following sequence in place: gulp.task('build', function(cb) { runSequence( 'lint', 'clean', 'compile-templates', 'copy-dependencies', 'compile-styles', 'revall', 'cdnize', 'overlays', cb ); }); Here is what the single tasks do and use (pasting the specific code would be quite long so I'll try to give the picture briefly describing the tasks): 'compile-templates': using jade (~1.1.5) + gulp-minify-html (^0.1.3), it picks up all our jade files and compiles them to html files 'copy-dependencies': using gulp-spa (0.2.2) + gulp-uglify (^0.2.1) + gulp-concat (^2.1.7) + gulp-ngmin (^0.1.2), it aggregate all our javascript files and angular templates building and minifying our vendor.js and app.js files together with the small/index.html and large/index.html files. 'compile-styles': using gulp-compass (~1.1.3) + gulp-minify-css (~0.3.1), it compiles our scss files into our desktop.css and mobile.css files 'revall': using gulp-rev-all (~0.3.0), takes care of revving all the prev generated files 'cdnize': using gulp-cdnizer (^0.2.6), it substitutes paths for our js and css files updating them with our CDN urls inside the small/index.html and large/index.html files 'overlays': using gulp-replace (^0.3.0), it will find the previously generated and revved css files and fill up their actual name inside our small/index.html and large/index.html files replacing some other placeholders as well. here is our 'overlays' task code: gulp.task('overlays', function() { var styles = fs.readdirSync('./dist/styles'); var desktopCss = ''; var mobileCss = ''; for (var index in styles) { var style = styles[index]; if (style.indexOf('desktop' + 'rev') &gt; -1) { desktopCss = style.replace('.css', ''); } if (style.indexOf('mobile' + 'rev') &gt; -1) { mobileCss = style.replace('.css', ''); } } return gulp.src('./dist/large/index.html') .pipe(plugins.replace('DIST_CSS', desktopCss)) .pipe(plugins.if(!isDev, gulp.dest('./…

http://stackoverflow.com/comment/38706120
comment on: http://stackoverflow.com/a/24907445
score: 0
type: AnswerComment
type: Comment
has text: I still think you don't have a valid reason to wrap the promise. Just because you're returning a subtype of promise doesn't mean it's not a promise. If what bothers you is the fact you're returning a subtype (it really shouldn't) you can return `$q.when($http(...` which wouldn't be nearly as bad (because it can't leak or suppress errors) but would still be redundant imo.

http://stackoverflow.com/q/24862628
score: 0
has title: drag and dropping html element
has comment: http://stackoverflow.com/comment/38614627
possible better answer: http://stackoverflow.com/a/24864712
accepted answer: http://stackoverflow.com/a/24865348
has answer: http://stackoverflow.com/a/24864712
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38613326
answer count: 2
has comment: http://stackoverflow.com/comment/38613436
has body: problem is here when I drag Drag this to lokesh.exe to Lokesh.exe I am getting source id:2 but destinationid is null. when i drag-me into box it is giving correct results like source id and destination id. I have tried below code: //html drag-me Lokesh.exe Drag this to lokesh.exe //javascript function drag(ev) { ev.dataTransfer.setData("Text",ev.target.id); } function drop(ev) { ev.preventDefault(); //console.log(ev.dataTransfer); var data=ev.dataTransfer.getData("Text"); //ev.target.appendChild(document.getElementById(data)); var sourceid=document.getElementById(data).id; alert("source id:"+sourceid); var destinationid=ev.target.id; alert("destinationid:"+destinationid); } function allowDrop(ev){ ev.preventDefault(); }
has comment: http://stackoverflow.com/comment/38613777
has answer: http://stackoverflow.com/a/24865348
tagged with: javascript

http://stackoverflow.com/a/24853462
type: Answer
answers question: http://stackoverflow.com/q/24853362
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24853362
type: AcceptedAnswer
downvote count: 0
has body: UPDATE: as @mu is too short suggested you can use the built-in method collection.each too. r.each(function(model){ ... }) I believe you can do r.models. Hope this helps toPost: function(id){ var myattori = new Attori(); myattori.fetch({ success: function(r) { console.log(r);// collection correctly filled _.each(r.models, function(model) { console.log(model);//undefined }, this); } }); },

http://stackoverflow.com/comment/38591184
score: 0
has text: Yeah, it will execute when they submit the form, but only after validation passes. validateForm will execute first and then execute newWindow
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24851311

http://stackoverflow.com/q/24856031
has title: shadow dom script to watch for changes in host
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has body: I am creating an app where I need to manage a collection of elements that take advantage of the shadow dom. Since the template tag encapsulates content, I can keep the style and script with the elements in order for them to act on events. What I would like to know is if it is possible for script inside the shadowRoot to observe changes to properties of the host. My proposed path is to attach a data attribute to the host and have shadow script listen for changes to it and then update elements inside the shadowRoot. I am aware that it is possible to use javascript to access elements in the shadowRoot and change them, but my desire is to experiment in modularization and reusability. I ultimately would like for this component to be reusable and react to changes in the hosts attributes.
answer count: 1
favorite count: 0
tagged with: shadow-dom
upvote count: 1
tagged with: css
has answer: http://stackoverflow.com/a/25020082
type: AnsweredQuestion
score: 1
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25020082
has comment: http://stackoverflow.com/comment/38601070
has comment: http://stackoverflow.com/comment/38599294
tagged with: web-component

http://stackoverflow.com/a/24795191
answers question: http://stackoverflow.com/q/24795108
type: Answer
score: 1
upvote count: 1
downvote count: 0
has body: In JavaScript, string comparison is case sensitive. You can compare two strings case insensitively with the following code. var equal = str1.toUpperCase() === str2.toUpperCase();

http://stackoverflow.com/q/24889520
favorite count: 0
type: AnsweredQuestion
downvote count: 3
score: -3
type: Question
has answer: http://stackoverflow.com/a/24889924
has title: Jquery or javascript: dragging an image to a certain position to change pages
accepted answer: http://stackoverflow.com/a/24889924
has body: im making a one page layout of a website, i would like to ask if it is possible to use a draggable image to a certain position to change pages? im not that good with jquery and js so please bear with me.
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/38652343
comment on: http://stackoverflow.com/q/24884416
type: QuestionComment
type: Comment
has text: @AmitAgrawal its vaild
score: 0

http://stackoverflow.com/q/24820462
has title: Display my location in embedded google maps
tagged with: google-maps
tagged with: google-maps-markers
downvote count: 1
has comment: http://stackoverflow.com/comment/38533018
favorite count: 0
has comment: http://stackoverflow.com/comment/38536889
has comment: http://stackoverflow.com/comment/38533230
has comment: http://stackoverflow.com/comment/38538409
answer count: 0
type: UnansweredQuestion
score: 1
tagged with: iframe
has comment: http://stackoverflow.com/comment/38543658
type: Question
has comment: http://stackoverflow.com/comment/38531684
has comment: http://stackoverflow.com/comment/38542801
tagged with: javascript
has body: I am using iframe to display embedded google maps: &lt;iframe id="map_canvas" name="map_canvas" src="http://maps.google.com/maps/ms?ie=UTF8&amp;amp;msa=0&amp;amp;msid=205427380680792264646.0004fe643d107ef29299a&amp;amp;output=embed" width="100%" height="600px"&gt; &lt;/iframe&gt; And I would like to add a placemarker to this iframe, which will display my current location, without the need to redirect to google maps webpage. I tried to implement it with this script, but it doesnt work: Could you help me please ? &lt;script type="text/javascript"&gt; var watchId; var map; var myLocation; var myLocationMarker = null; function initialize() { var mapOptions = { center : new google.maps.LatLng(58, 16), zoom : 7, mapTypeId : google.maps.MapTypeId.ROADMAP }; map = map = new google.maps.Map(document .getElementById("map_canvas"), mapOptions); if (navigator.geolocation) { var optn = { enableHighAccuracy : true, timeout : Infinity, maximumAge : 0 }; watchId = navigator.geolocation.watchPosition(showPosition, showError, optn); } else { alert('Geolocation is not supported in your browser'); } } function showPosition(position) { if (myLocationMarker != null) { myLocationMarker.setMap(null); } myLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); myLocationMarker = new google.maps.Marker({ position : myLocation, map : map }); } function showError(error) { switch (error.code) { case error.PERMISSION_DENIED: alert("User denied the request for Geolocation."); break; case error.POSITION_UNAVAILABLE: alert("Location information is unavailable."); break; case error.TIMEOUT: alert("The request to get user location timed out."); break; case error.UNKNOWN_ERROR: alert("An unknown error occurred."); break; } } &lt;/script&gt;
tagged with: google-maps-api-3
upvote count: 2

http://stackoverflow.com/comment/38481007
comment on: http://stackoverflow.com/q/24793505
has text: That's an XHTML "strict" thing. Pay no attention to it.
score: 2
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24822090
has answer: http://stackoverflow.com/a/28406539
favorite count: 0
answer count: 5
has answer: http://stackoverflow.com/a/24822199
tagged with: datepicker
has answer: http://stackoverflow.com/a/24822169
tagged with: twitter-bootstrap-3
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38534261
has answer: http://stackoverflow.com/a/28981144
type: Question
score: 3
has title: Error: Object doesn't support property or method 'datetimepicker'.. Can't seem to create a datepicker
upvote count: 3
has answer: http://stackoverflow.com/a/40599097
has body: Always getting an error whenever I try to create a datepicker in my form. Can anyone help me out? I believed I have referenced the proper CSS, JS, Bootstrap and JQuery files. here's my attempt at creating a datepicker Birth Date Any insight (and possibly a code fix) would be greatly appreciated!!
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/38447080
score: 0
type: Comment
type: QuestionComment
has text: @parat10 You could try writing what you want to do in pseudo code and then translate it into javascript
comment on: http://stackoverflow.com/q/24775285

http://stackoverflow.com/comment/38544267
type: AnswerComment
type: Comment
score: 0
has text: @Nick, Is your code inside an mvc controller ? Make sure you have a reference to System.Web.Mvc dll in your project.
comment on: http://stackoverflow.com/a/24810164

http://stackoverflow.com/a/61897699
type: Answer
answers question: http://stackoverflow.com/q/24827929
downvote count: 0
score: 7
has body: Starting in M83, Chromium has a requestVideoFrameCallback() API, which might solve your issue. You can use the mediaTime to get a consistent timestamp, as outlined in this Github issue. From there, you could try something like this: var frameCounter = (time, metadata) =&gt; { let count = metadata.mediaTime * frameRate; console.log("Got frame: " + Math.round(count)); // Capture code here. video.requestVideoFrameCallback(frameCounter); } video.requestVideoFrameCallback(frameCounter) This will only fire on new frames, but you may occasionally miss one (which you can detect from a discontinuity in the metadata.presentedFrames count). You might also be slightly late in capturing the frame (usually 16ms, or one call to window.requestAnimationFrame() later than when the video frame is available). If you're interested in a high level overview of the API, here's a blogpost, or you can take a look at the API's offical github.
upvote count: 7

http://stackoverflow.com/comment/38429701
comment on: http://stackoverflow.com/a/24766513
type: AnswerComment
has text: Yes, that's the key line here. :)
score: 0
type: Comment

http://stackoverflow.com/a/24853793
type: AcceptedAnswer
type: Answer
score: 0
answers question: http://stackoverflow.com/q/24852699
accepted answer of: http://stackoverflow.com/q/24852699
has body: Handlebars.registerHelper('reverse_for', function(from, to, decrease, options) { var result = String(''); for(var i = parseInt(from); i &gt;= parseInt(to); i -= parseInt(decrease)) { result += String(options.fn({'index':parseInt(i)})); } return result; }); doesn't seem to have the problem. In the templates I do now use {{ index }} and not {{ this }} To output the value The parseInt and String casting didn't seem to affect the irradical results but returning it as an object with only the index key seems not to have this strange behavior.

http://stackoverflow.com/comment/39110017
score: 0
has text: here is the link: jsfiddle.net/xDf4Z/10 @Mike'Pomax'Kamermans
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24876436

http://stackoverflow.com/comment/38651990
comment on: http://stackoverflow.com/q/24884185
has text: check [Simple regular expression for a decimal with a precision of 2](http://stackoverflow.com/questions/308122/simple-regular-expression-for-a-decimal-with-a-precision-of-2)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24825537
has comment: http://stackoverflow.com/comment/38540665
has comment: http://stackoverflow.com/comment/38540722
has body: I am trying to create an array with some values, then assign a variable a value contained in one of the arrays. I want to then return the name of the array if true. I have got as far as the following (http://jsfiddle.net/4DhqW/1/) &lt;script&gt; var internal = 'WKF1'; Daily = [WKF1,WKF2,WKF3,WKF3,WKF4,WKF5]; Weekly = [WKF6,WKF7,WKF8]; Monthly = [WKF9,WKF10]; function frequency(wkf, array) { if (wkf in //arrays daily weekly monthly ) { return //array name } } document.write(frequency(internal)); //this should return the name of the array &lt;/script&gt; Can someone please guide me, thanks in advance.
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/38540628
possible better answer: http://stackoverflow.com/a/24825717
has answer: http://stackoverflow.com/a/24825696
has answer: http://stackoverflow.com/a/24825717
tagged with: javascript
has title: Javascript: check value if in array then return array name
linked to: http://stackoverflow.com/q/237104
type: AnsweredQuestion
tagged with: arrays
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/24825696
favorite count: 0
type: Question

http://stackoverflow.com/a/24764288
type: Answer
has body: This seems like a strange issue and I cannot fully explain the issue. But when debugging and stepping though the code, every time you update the classname of one of the elements, your collection of txts decrements. Therefore, this is the only way I can think of to fix it. Basically the same thing you have, but instead I start with the last element of the txts array, instead of the first. function validate() { var txts = document.getElementsByClassName('txt'); for (var i = txts.length - 1; i &gt;= 0; i--) { if (txts[i].value === "") txts[i].className = 'txtError'; } }
has comment: http://stackoverflow.com/comment/38425310
has comment: http://stackoverflow.com/comment/38425355
score: 0
answers question: http://stackoverflow.com/q/24764094

http://stackoverflow.com/a/24831445
has body: Let's add a function to our controller scope: $scope.diffMins = function(pingDate) { var now = new Date(); var diffMs = (now-pingDate); return Math.round(((diffMs % 86400000) % 3600000) / 60000); } =5}"> Station ID: {{ beat.stationID }} Uptime: css: .longtime {color: red} This assumes you have a beat.lastPinged as an javascript date. You could also put the business logic inside diffMins and just return true or false. ng-class works by assinging a class with the name from the left if the right side evaluates as true. There is also an ng-style that does something similar with css style attributes.
answers question: http://stackoverflow.com/q/24831299
score: 0
has comment: http://stackoverflow.com/comment/38619739
has comment: http://stackoverflow.com/comment/38618346
type: Answer
has comment: http://stackoverflow.com/comment/38629161
has comment: http://stackoverflow.com/comment/38554314
has comment: http://stackoverflow.com/comment/38554607
has comment: http://stackoverflow.com/comment/38554759

http://stackoverflow.com/comment/38696732
comment on: http://stackoverflow.com/a/24905763
score: 0
type: AnswerComment
type: Comment
has text: Another dug and found that if you remove a sablayme path to the configuration file when you press the hotkey displays: CSScomb error: /home/kirill/.config/sublime-text-3/Packages/CSScomb/node_modules/csscomb/node_modules/csscomb-core/lib/core.js:412 throw e; ^ Please check the validity of the block starting from line #2 2*| background: #262626; 3 | background: -moz-linear-gradient(top, #262626 0%, #010101 100%); Gonzales PE version: 3.0.0-10 CSScomb Core version: 2.0.2

http://stackoverflow.com/q/24815621
duplicate of: http://stackoverflow.com/q/11985863
has answer: http://stackoverflow.com/a/24815638
has title: How to use ng-repeat without specific name in AngularJs
type: Question
answer count: 2
has body: I am developing website with AngularJS. I grabbed the json data from the server. and I need to display it on the table. Json data format is { {"a" :1,"b": 2,"c":3}, {"a" :3,"b": 4,"c":5}, {"a" :1,"b": 2,"c":3} } The problem is each bracket's names; a, b,c are the dynamic data from the server so that the server guy can change the name. There is my psedocode &lt;tr ng-repeat = "jsonObj in jsonArray"&gt; &lt;td ng-repeat = "name in jsonObj"&gt;{{name}} &lt;/td&gt; &lt;/tr&gt; it doesn't work. I think I know what it doesn't work. but I cant think of how to change without knowing the name of json array. Since a, b,c are dynamic, i can't just type {{jsonObj.a}} {{jsonObj.b}} I hope anyone can help me to fix this. Thank you
tagged with: javascript
has answer: http://stackoverflow.com/a/24815747
favorite count: 0
score: 0
linked to: http://stackoverflow.com/q/11985863
tagged with: angularjs
type: UnansweredQuestion
upvote count: 1
downvote count: 1

http://stackoverflow.com/comment/38499405
comment on: http://stackoverflow.com/q/24803729
has text: have you looked up anything in this space? there are many jquery plugins which already exist for this feature
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38477849
comment on: http://stackoverflow.com/a/24791451
score: 1
type: AnswerComment
has text: I suspect that you are executing that function before all media are loaded. Try to wrap that function inside $(window).load(function() { });
type: Comment

http://stackoverflow.com/a/24908599
answers question: http://stackoverflow.com/q/24908391
type: Answer
has body: To minify files you need, for example, uglify. Install it with this command: npm install grunt-contrib-uglify --save-dev Then, add it in your Gruntfile grunt.loadNpmTasks('grunt-contrib-uglify'); Finally, you have to change the code of your Gruntfile: grunt.initConfig({ jshint: { options: { curly: true, eqeqeq: true, eqnull: true, browser: true, globals: { jQuery: true } }, myFiles: ['js/**/*.js'] }, uglify:{ dest : { files: { 'js/app.min.js': ['js/app.js'] } } }, }); Regards.
accepted answer of: http://stackoverflow.com/q/24908391
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/38697968
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38698051

http://stackoverflow.com/comment/38535160
has text: The 3 is a default value? As per your solution, I need to change it every time. This is not fine.I need to get it from the attribute start
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24822695
type: Comment

http://stackoverflow.com/q/24785256
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/24785333
tagged with: sorting
has answer: http://stackoverflow.com/a/24787165
type: AnsweredQuestion
has body: I am making an app that requires the user to click on a location and then will be directed to the location via Google Maps.The locations are an array of JSON files. This is what the list looks like when complied... I have this code to split up my coordinates because the coordinates are backwards in the JSON file and they need to be flipped. var FormatCoords = function(){ CoordinateToString = location.Point.coordinates.toString() SplitCord = CoordinateToString.split(",") $scope.Lat = SplitCord[1]; $scope.Lon = SplitCord[0]; var FinalCord = Lat.concat(Lon); }; My question is how do I get the above code to run for a location when it is clicked? Here is a plunk to my code if you want to check it out... http://plnkr.co/edit/OZZRgiEcrLzreW3lrc5v?p=preview
tagged with: angularjs
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/24787165
has title: Splitting Specific Strings
score: 0
tagged with: http://stackoverflow.com/tag/json
possible better answer: http://stackoverflow.com/a/24785333

date
tags question: http://stackoverflow.com/q/24791402
tags question: http://stackoverflow.com/q/24894648
tags question: http://stackoverflow.com/q/24790345
tags question: http://stackoverflow.com/q/24883760
tag name: date
tags question: http://stackoverflow.com/q/24786045
tags question: http://stackoverflow.com/q/24795668
tags question: http://stackoverflow.com/q/24766991
tags question: http://stackoverflow.com/q/24854522
tags question: http://stackoverflow.com/q/24758126
tags question: http://stackoverflow.com/q/24764137
tags question: http://stackoverflow.com/q/24867242
type: Tag
tags question: http://stackoverflow.com/q/24880064
tags question: http://stackoverflow.com/q/24796784
tags question: http://stackoverflow.com/q/24761093
tags question: http://stackoverflow.com/q/24875254
tags question: http://stackoverflow.com/q/24831355
tags question: http://stackoverflow.com/q/24809027
tags question: http://stackoverflow.com/q/24886906
tags question: http://stackoverflow.com/q/24889445
tags question: http://stackoverflow.com/q/24829726
tags question: http://stackoverflow.com/q/24827377
tags question: http://stackoverflow.com/q/24870753
tags question: http://stackoverflow.com/q/24870370
tags question: http://stackoverflow.com/q/24772716
tags question: http://stackoverflow.com/q/24759944
tags question: http://stackoverflow.com/q/24877700

http://stackoverflow.com/comment/38676689
comment on: http://stackoverflow.com/a/24896238
type: AnswerComment
type: Comment
score: 1
has text: @AdmiralAdama The problem is underflow, not overflow. `-18*Math.pow(10,33)` computes just fine in Javascript, because it is using a floating point representation: `-1.8000000000000002e+34`

http://stackoverflow.com/comment/38406528
score: 0
has text: Maybe you have slower internet connection with the phone and it needs to load longer before you can play audio?
comment on: http://stackoverflow.com/q/24754197
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24842988
type: Answer
answers question: http://stackoverflow.com/q/24842789
has comment: http://stackoverflow.com/comment/38573596
has body: What you need to do is create the layout container dynamically. &lt;div id="tablecontainer"&gt;&lt;/div&gt; &lt;script&gt; require( ["dojo/dom", "dojox/layoutTableContainer"], function ( dom, tablecontainer ) { var noOfCol = 3; var tblCont = new tablecontainer({ cols:noOfCol , customClass:'employee_labels', labelWidth:210 }, dom.byId("tablecontainer")); }); &lt;/script&gt;
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/a/24793902
type: Answer
answers question: http://stackoverflow.com/q/24793810
has comment: http://stackoverflow.com/comment/38505676
has comment: http://stackoverflow.com/comment/38505740
has comment: http://stackoverflow.com/comment/38506863
has comment: http://stackoverflow.com/comment/38504849
has body: Since I'm using JSFiddle, it won't let me put document.write but you can still how it works.. Check out this Fiddle, below are the changes that I made.. HTML: &lt;p&gt;&lt;input type="button" id="submit-btn" value="Submit Information" &gt;&lt;/p&gt; JS: function newWindow() { alert("New Window"); } function askForHelp () { var volunteer = document.getElementById('state').value; if (volunteer == "New York" || volunteer == "NY" || volunteer == "New Jersey" || volunteer == "NJ") { alert("test test test"); } } document.getElementById('submit-btn').addEventListener("click", function(){ newWindow(); askForHelp(); });
score: 0
has comment: http://stackoverflow.com/comment/38504452

http://stackoverflow.com/comment/38538288
has text: I need the ability to hide from the user accordion elements without removing them from the panel, while switching to the child elements should ignore hidden elements. The screenshot shows that this is not happening and after switching elements - hidden elements are not ignored. I am sorry for my English)
comment on: http://stackoverflow.com/q/24820316
score: 0
type: Comment
type: QuestionComment

storage
tag name: storage
tags question: http://stackoverflow.com/q/24906122
type: Tag

http://stackoverflow.com/comment/38631595
type: QuestionComment
comment on: http://stackoverflow.com/q/24873042
score: 1
has text: You should ask refactoring question in http://codereview.stackexchange.com/
type: Comment

http://stackoverflow.com/q/24832590
answer count: 1
has comment: http://stackoverflow.com/comment/38554530
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38554779
has comment: http://stackoverflow.com/comment/38554669
has comment: http://stackoverflow.com/comment/38554453
has comment: http://stackoverflow.com/comment/38554581
has comment: http://stackoverflow.com/comment/38554580
type: Question
has title: Filter the data using jquery in HTML page
has comment: http://stackoverflow.com/comment/38554443
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38554404
score: 0
has body: I am trying to filter the data available in HTML page. Suppose there are three brands available in the page: "abc", "pqrs", "xyz" and brandNameSelected="abc". Now to filter the data on the page i am using this code snip. $(".product-container").filter(function () { alert($(this).data('brand')); return $(this).data("brand").indexOf(brandNameSelected) &gt; -1; }).each(function (index, item) { alert("here"); $(item).css("background-color", "red"); }); alert($(this).data('brand')); printing all the brands available. but i am not reaching to alert("here"); Can please some one help to figure out what is wrong?
has answer: http://stackoverflow.com/a/24832963
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/24868397
answers question: http://stackoverflow.com/q/24868265
type: Answer
accepted answer of: http://stackoverflow.com/q/24868265
has comment: http://stackoverflow.com/comment/38622702
score: 1
has body: Set response.setContentType("application/json"), write JSON string to the response, then using request dispatcher forward your request back. A callback success function should handle the JSON object. Don't forget to flash response, because it's buffered and also useful to turn off cache with headers.
upvote count: 1
has comment: http://stackoverflow.com/comment/38622279
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/24821893
has comment: http://stackoverflow.com/comment/38534007
downvote count: 1
type: Answer
has body: In DOM level 2 you can't, in level 3 (non yet supported) you will have eventListenerList that will do the job. Actually you have to take an array for events. You can build your addevent method: var events = []; var addEvent = function (event, node, fn) { var i = 0, len = events.length, nullix = -1; while (i != len) { if (events[i] == null) { if (nullix == -1) nullix = i; i++; continue; } if (events[i].event == event &amp;&amp; events[i].node == node &amp;&amp; events[i].fn == fn) { return this; } i++; } if (nullix != -1) { events[nullix] = { event: event, node: node, fn: fn } } else { events[events.length] = { event: event, node: node, fn: fn }; } node.addEventListener(event, fn); };
upvote count: 0
has comment: http://stackoverflow.com/comment/38533880
has comment: http://stackoverflow.com/comment/38534143
score: -1
answers question: http://stackoverflow.com/q/24821569
has comment: http://stackoverflow.com/comment/38534067
has comment: http://stackoverflow.com/comment/38534171

http://stackoverflow.com/comment/38649658
has text: surprisingly this.store.find('check_list') results in the same error as this.store.find('checkList')
score: 0
comment on: http://stackoverflow.com/q/24882597
type: QuestionComment
type: Comment

http://stackoverflow.com/q/24900855
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24907884
has body: I have a backgridjs table below. var columns = [{ name: "_id", label: "account#", editable:"false", cell: "string" }, { name: "class", label: "class", editable:"false", cell: "string" },{ name: "date", label: "Date", editable:"false", cell: "string" },{ name: "id", label: "id", editable:"false", cell: "string" },{ name: "total", label: "Total", editable:"false", cell: Backgrid.NumberCell.extend({ orderSeparator: ',' }), cell: "number" }]; var PageableTerritories = Backbone.PageableCollection.extend({ model: Territory, url: "/payroll", state: { pageSize: 15 }, mode: "client" // page entirely on the client side }); var pageableTerritories = new PageableTerritories(); var CaptionFooter = Backgrid.Footer.extend({ render: function () { this.el.innerHTML = ' ' return this; } }); // Set up a grid to use the pageable collection var pageableGrid = new Backgrid.Grid({ columns: [{ // enable the select-all extension name: "", cell: "select-row", headerCell: "select-all", }].concat(columns), collection: pageableTerritories, footer: CaptionFooter // <-- }); // Render the grid var $example1 = $("#example-1-result"); $example1.append(pageableGrid.render().el) // Initialize the paginator var paginator = new Backgrid.Extension.Paginator({ collection: pageableTerritories }); // Render the paginator $example1.after(paginator.render().el); // Initialize a client-side filter to filter on the client // mode pageable collection's cache. var filter = new Backgrid.Extension.ClientSideFilter({ collection: pageableTerritories, fields: ['_id',"Order Class","techId"], placeholder: "search" }); // Render the filter $example1.before(filter.render().el); // Add some space to the filter and move it to the right $(filter.el).css({float: "right", margin: "20px"}); // Fetch some data pageableTerritories.fetch({reset: true}); Everything works great and as expected, except I'm having a hard time figuring out how to set a total footer cell for the total column. If I type the command below in the console I…
type: Question
has comment: http://stackoverflow.com/comment/38685344
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38705361
answer count: 2
has comment: http://stackoverflow.com/comment/38711284
tagged with: javascript
tagged with: backbone.js
score: 0
has title: sum footer in backgridjs
tagged with: backgrid
has answer: http://stackoverflow.com/a/24923362

http://stackoverflow.com/q/24865453
accepted answer: http://stackoverflow.com/a/24865526
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38616577
has comment: http://stackoverflow.com/comment/38616659
type: Question
has comment: http://stackoverflow.com/comment/38616676
tagged with: javascript
has body: I have several forms in one page and all 3 of them call the same function for validation validateForm() the code for validation is if (document.forms["myForm"]) { var fieldsToCheck = [ ['fname', lang.FirstName], ['lname', lang.LastName], ['email', lang.Email], ['phone_num', lang.PhoneNumber] ]; } // end if there is a form named myforms else if (document.forms['addressform']) { // save a location form , ['town', lang.Town] is a dropdown var fieldsToCheck = [ ['nickname', lang.AddressNickname], ['street_no', lang.StreetNumber], ['address', lang.Address] ]; } // end forms else if (document.forms['passform']) { // save a new password var fieldsToCheck = [ ['txtNewPassword', lang.NewPassword], ['ctxtNewPassword', lang.ConfirmPassword]]; } // end forms and the forms are like this: &lt;form action="/action" name="passform" onsubmit="return validateForm()" method="POST"&gt; where name is passform other forms have myform and addressform. Now whenever I submit a form it always tries to find out the text inputs from the first form, which I guess is because document.form["formname"] checks to see if the form exists and proceeds, since it exists it does not matter which form you submitted, is there a way around this??? important: i know this is probably the wrong way to validate forms, since I could do form.submit() function validate etc, but unfortunately the code is not mine, so if there is a solution with this setup i prefer it!
tagged with: jquery
has title: Identifying which form is submitted
has answer: http://stackoverflow.com/a/24865526
score: 0
possible better answer: http://stackoverflow.com/a/24865610
answer count: 2
has answer: http://stackoverflow.com/a/24865610

http://stackoverflow.com/q/24894091
has body: Good evening. I'm trying to create an interactive graph. By "interactive graph" I mean: For example I have a fixed size coordinate system: x = (0,10), y = (-2, 2) And I want to plot a function of time, for example f(t) = sin(t), where x = t, y = f(t) But because of my fixed size coordinate system I will be able to see sin(t) only till t &lt;= 10 Does JavaScript has library which would shift graph not changing size of coordinate system?
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/24896452
type: AnsweredQuestion
tagged with: jqplot
type: Question
accepted answer: http://stackoverflow.com/a/24896452
tagged with: javascript
has title: Javascript Interacative graph

http://stackoverflow.com/comment/38620563
has text: Please include your code
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/24867441

http://stackoverflow.com/comment/38459585
comment on: http://stackoverflow.com/q/24782106
has text: Can you post the page source in a pastebin link? Are there any errors in your browsers dev console?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29114169
has body: If you are mixing calls to module('someApp') and inject($someDependency) you will get this error. All your calls to module('someApp') must occur before your calls to inject($someDependency).
accepted answer of: http://stackoverflow.com/q/24900067
answers question: http://stackoverflow.com/q/24900067
type: AcceptedAnswer
type: Answer
score: 67
upvote count: 68
downvote count: 1

http://stackoverflow.com/comment/38443980
score: 0
type: Comment
has text: thank you guys . i got solution in nodejs var images = require("images"); images("input.jpg") //Load image from file .size(600) .draw(images("download.png"), 50, 100) .draw(images("index.png"),450,100) .save("output.jpg", { quality : 600 });
comment on: http://stackoverflow.com/a/24773100
type: AnswerComment

http://stackoverflow.com/comment/38508760
score: 0
type: Comment
type: QuestionComment
has text: I tried using if (shipEmpty && isEmpty){ $("#shippingSelect option:selected").text() );
comment on: http://stackoverflow.com/q/24808031

http://stackoverflow.com/q/24807676
score: 1
has comment: http://stackoverflow.com/comment/38509948
upvote count: 1
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has title: FOS JS RoutingBundle produces routes for localhost only
has answer: http://stackoverflow.com/a/26735173
tagged with: symfony
favorite count: 0
has body: JS RoutingBundle is generating routes for localhost only. Why could this be so? On my dev-server Routing.generate('index'); "/web/app.php/" On my prod-server Routing.generate('index'); "https://localhost/web/app.php/" Note: Neither of these servers are my localhost.
tagged with: fosuserbundle
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26734109

simple-html-dom
tags question: http://stackoverflow.com/q/24760384
tag name: simple-html-dom
type: Tag

http://stackoverflow.com/comment/38499919
comment on: http://stackoverflow.com/q/24784792
type: Comment
type: QuestionComment
has text: Well that was more or less a guess; I don't see anything in your code that looks like something that would cause that particular exception.
score: 0

http://stackoverflow.com/comment/38698625
has text: Don't pollute the global scope with variables. Pass a *callback* into `test()` instead
comment on: http://stackoverflow.com/q/24909006
score: 2
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38522160
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24815439
score: 0
has text: http://jsfiddle.net/cyberjo50/awmd8/

http://stackoverflow.com/comment/38661818
comment on: http://stackoverflow.com/a/24889166
score: 0
has text: Thank you, that helped, but is there a way to get the animation on hover in to COMPLETE each time its hovered? What I mean by this is I want the animation to execute fully when I hover over it, regardless of whether or not I hover OUT in the middle of the animation?
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38547609
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24829037
has text: Thank you for this, I think i wrote it this way because i am not familiar with php , or the `$_SESSION` attribute (i guess ive been wasting my time). Could you point me in a more narrow direction to look up some documentation on how to use the `$_SESSION` to do this type of saving? ty

http://stackoverflow.com/a/24888355
has body: requestArray[i].request.origin is a string containing 2 numbers. The google.maps.LatLng constructor expects two numbers. var marker = new google.maps.Marker({ position: new google.maps.LatLng(requestArray[i].request.origin), map: map, icon: image, shape: shape, title: Labelarray[i] + ' - ' + requestArray[i].request.origin, zIndex: i }); You need to either save that as a google.maps.LatLng object or parse the numbers out of the string to construct the google.maps.LatLng object: var coords = requestArray[i].request.origin.split(","); var latlng = new google.maps.LatLng(parseFloat(coords[0]), parseFloat(coords[1])); var marker = new google.maps.Marker({ position:latlng, map: map, icon: image, shape: shape, title: Labelarray[i] + ' - ' + requestArray[i].request.origin, zIndex: i }); working fiddle code snippet: var directionsService = new google.maps.DirectionsService(); var num, map, data; var requestArray = [], renderArray = []; // A JSON Array containing some people/routes and the destinations/stops var jsonArray = { "Journey1": ["-38.076600, 176.722100", "-38.279641, 175.897505"], "Journey2": ["-38.279641, 175.897505", "-38.058217, 175.783939"], "Journey3": ["-38.058217, 175.783939", "-37.964919, 175.478964"], "Journey4": ["-37.964919, 175.478964", "-38.323678, 175.152163"], "Journey5": ["-38.323678, 175.152163", "-38.274879, 175.894551"], "Journey6": ["-38.274879, 175.894551", "-38.095284, 176.076530"], "Journey7": ["-38.095284, 176.076530", "-38.075316, 176.716276"], "Journey8": ["-38.075316, 176.716276", "-38.076600, 176.722100"] } // 16 Standard Colours for navigation polylines var colourArray = ['Maroon', 'Green', 'Olive', 'DarkBlue', 'Violet', 'Teal', 'Gray', 'Silver']; var Labelarray = [ 'Kawerau Depot, Ex: CHH Kawerau - Cogen Plant Kinleith - Hogfuel - CHH KINLEITH', 'Cogen Plant Kinleith - TD Haulage Pinedale - Empty', 'TD Haulage Pinedale - Gascoigne Farms Cambridge - Post Peeling - Untreated - GASCOIGNE FARMS LTD', 'Gascoigne Farms Cambridge - Tregoweth T…
answers question: http://stackoverflow.com/q/24883358
score: 0
type: Answer

http://stackoverflow.com/a/42714796
downvote count: 0
has body: As an addition to the existing answers, I use the following function as alias: cloud() { curl -X PUT -u "&lt;username&gt;:&lt;password&gt;" "https://&lt;hostname&gt;/remote.php/webdav/${2:-$1}" --data-binary @"./$1" } Just replace &lt;username&gt;, &lt;password&gt; and &lt;hostname&gt; and put this in your .bash_aliases and you can upload your files with: cloud filename cloud path filename
type: Answer
answers question: http://stackoverflow.com/q/24758167
upvote count: 4
score: 4

http://stackoverflow.com/comment/38577903
has text: Even if you were to use a textarea I'm sure the caret would still move around.
score: 0
comment on: http://stackoverflow.com/q/24845254
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24884739
has comment: http://stackoverflow.com/comment/38655177
tagged with: javascript
tagged with: google-maps-api-3
tagged with: google-maps
tagged with: google-maps-markers
score: 2
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/24886456
tagged with: animation
has comment: http://stackoverflow.com/comment/38654411
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/38655445
type: Question
has body: I'm trying to use this demo to animate a symbol over line. Google Maps API - Animating Symbols My problem that I want to use image but not Google symbol, but when I'm using the code above, the image not showing up, only the Google symbol. Here is the relevant code. All the rest is exactly like in the example. var line = new google.maps.Polyline({ path: lineCoordinates, map: map, icons: [{ icon: 'icons/cannon.png', offset: '100%' }] });
has title: Animating Symbols - Google Maps API
accepted answer: http://stackoverflow.com/a/24886456

http://stackoverflow.com/comment/38525772
has text: yes id of the another text field.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24817497
score: 0

http://stackoverflow.com/comment/38423702
comment on: http://stackoverflow.com/q/24762771
score: 0
has text: `.cloneNode(true)` will clone the descendants too. I'm having trouble understanding the issue from your description. However, It seems like you're giving the old button a new ID, but never giving one to the new button. So on the next click, there'll be no `"add-switch"` to fetch. Is that the issue?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24771788
tagged with: javascript
has comment: http://stackoverflow.com/comment/38439595
downvote count: 4
answer count: 3
has comment: http://stackoverflow.com/comment/38443343
has comment: http://stackoverflow.com/comment/38439562
upvote count: 0
has comment: http://stackoverflow.com/comment/38440568
tagged with: jquery
has title: How can a Java code could being used in a Jquery keeping it in a same form
favorite count: 0
has comment: http://stackoverflow.com/comment/38440586
possible better answer: http://stackoverflow.com/a/24771867
has answer: http://stackoverflow.com/a/24771867
has body: I have made a code in Java but wanted to use it in Jquery because my whole project works on jquery now how can I use this code in Jquery making sure that it fuctionality to take random number from an array doesn't changes.My code is as follows :- import java.util.Random; public class ARRAan { public static void main(String[] args) { int cards[]={1,2,3,6,1,25,24,2,62,85,65,}; int temp1; int temp; Random randIndex = new Random(); for (int i = 0; i &lt;cards.length; i++) { temp1 = randIndex.nextInt(i+2); temp = cards[i]; cards[i] = cards[temp1]; cards[temp1] = temp; System.out.println( cards[i] ); } } } Now where I wanted to use this program in Jquery is- function shuffle() { return 0.5 - Math.random(); }
has comment: http://stackoverflow.com/comment/38439467
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24771923
score: -4
has answer: http://stackoverflow.com/a/24771944
type: Question
accepted answer: http://stackoverflow.com/a/24771923
tagged with: java

http://stackoverflow.com/comment/38616611
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24860220
type: Comment
has text: @user3848253 So I cannot help you then. When I put this code into Smarty TPL file it works for me, it includes both files and hide one of divs.

http://stackoverflow.com/comment/38419495
comment on: http://stackoverflow.com/a/24759945
type: Comment
has text: Thank you, that was very useful and helped me to understand how directives work. TBH I didn't get how to create custom directives from Angular tutorial. Just one more question. Your code for user check was working not like it should. It was enabling me to send form when login was used, and locking when noona was using it. It works more like is login available than user exist and I dont get why. I needed to change the true and false values to their opposites to make it work like it should - if user picks login which is already in database(returned by rest).
score: 0
type: AnswerComment

google-maps-api-3
tags question: http://stackoverflow.com/q/24893787
tags question: http://stackoverflow.com/q/24853312
tags question: http://stackoverflow.com/q/24835867
tags question: http://stackoverflow.com/q/24823656
tags question: http://stackoverflow.com/q/24840980
tags question: http://stackoverflow.com/q/24753028
tags question: http://stackoverflow.com/q/24767919
tags question: http://stackoverflow.com/q/24820462
tags question: http://stackoverflow.com/q/24792605
tags question: http://stackoverflow.com/q/24750384
tags question: http://stackoverflow.com/q/24862401
tags question: http://stackoverflow.com/q/24836258
tags question: http://stackoverflow.com/q/24795050
tags question: http://stackoverflow.com/q/24905145
tags question: http://stackoverflow.com/q/24898990
tags question: http://stackoverflow.com/q/24884739
tags question: http://stackoverflow.com/q/24884197
tags question: http://stackoverflow.com/q/24839509
tags question: http://stackoverflow.com/q/24799649
tags question: http://stackoverflow.com/q/24766416
tags question: http://stackoverflow.com/q/24773753
tags question: http://stackoverflow.com/q/24839714
tags question: http://stackoverflow.com/q/24883358
tags question: http://stackoverflow.com/q/24783182
tag name: google-maps-api-3
tags question: http://stackoverflow.com/q/24782366
tags question: http://stackoverflow.com/q/24790831
type: Tag
tags question: http://stackoverflow.com/q/24800324
tags question: http://stackoverflow.com/q/24759763
tags question: http://stackoverflow.com/q/24763824
tags question: http://stackoverflow.com/q/24840198
tags question: http://stackoverflow.com/q/24905148
tags question: http://stackoverflow.com/q/24863372
tags question: http://stackoverflow.com/q/24805935
tags question: http://stackoverflow.com/q/24879934
tags question: http://stackoverflow.com/q/24857983
tags question: http://stackoverflow.com/q/24852598
tags question: http://stackoverflow.com/q/24837613

http://stackoverflow.com/q/24816340
has title: Text fades in on hover background darkens
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/24818050
tagged with: javascript
has answer: http://stackoverflow.com/a/24817935
score: 0
possible better answer: http://stackoverflow.com/a/24817935
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/24818050
has body: Demo: http://jleblanc.pancakeapps.com/index.html all html/css in page source. I am making a website for my mom and I am trying to hide the text on the .one .two and .three divs until the mouse hovers over them. I am trying to make the background fade to rgba(0,0,0,0.6) on hover as well. I am not very skilled with javascript either. Does anyone have an idea on how I could do it? / EDIT- I want the text to fade in from the background, sorry for the confusion. /
type: AnsweredQuestion

http://stackoverflow.com/q/24846280
possible better answer: http://stackoverflow.com/a/24846446
tagged with: android
type: AnsweredQuestion
tagged with: cordova
has title: Phonegap - inserting variable into database
has answer: http://stackoverflow.com/a/24846446
type: Question
tagged with: database
score: 0
answer count: 2
has body: I'm trying to insert variables values to a data base but it comes out as 'undefined'. It is all inside device ready. I'm testing 1st with the variable 'absenceDateFrom'. var absenceType = document.getElementById('absenceType') var absenceText = document.getElementById('noteNewAbsence') var absenceDateFrom = document.getElementById('absenceFrom') var absenceDateTo = document.getElementById('absenceTo') db.transaction( function(tx) { tx.executeSql("INSERT INTO absences (id,type,absenceFrom,absenceTo,note,aproved,picture) VALUES (" + id++ + ",'" + String(absenceType.value) + "','" + absenceDateFrom.value.toString + "','" + absenceDateTo.value.toString + "','" + "random note (this works but if i put absenceText.value it comes out undefined also" + "'," + "'true'" + "," + "'image.jpg'" + ")"); }, transaction_error); I also tried with '?' and [absenceDateFrom] in the end, like I saw on another answer and it still comes out undefined: var absenceType = document.getElementById('absenceType') var absenceText = document.getElementById('noteNewAbsence') var absenceDateFrom = document.getElementById('absenceFrom') var absenceDateTo = document.getElementById('absenceTo') db.transaction( function(tx) { tx.executeSql("INSERT INTO absences (id,type,absenceFrom,absenceTo,note,aproved,picture) VALUES (" + id++ + ",'" + String(absenceType.value) + "'," + "?" + ",'" + absenceDateTo.value.toString + "','" + "random note (this works but if i put absenceText.value it comes out undefined also" + "'," + "'true'" + "," + "'image.jpg'" + ")", [absenceDateFrom.value] ); }, transaction_error); output: http://prntscr.com/44eb31
has answer: http://stackoverflow.com/a/24848599
accepted answer: http://stackoverflow.com/a/24848599
tagged with: sqlite
tagged with: javascript

http://stackoverflow.com/q/24867864
score: 0
has title: Allow user input during javascript loop and make it work in Chrome
answer count: 1
type: UnansweredQuestion
has body: I'm trying to program a music play button with the following features: Click once to play the track A second click while the track is playing will fade it out A third click while the track is fading will stop the track. I implemented the fade with a loop that decreases the volume. I have two problems. First, it appears that during the time the volume-reduction loop is executing, user clicks are ignored, so my third feature is not working. The second problem is that while my implementation works quite well in Firefox, in Chrome, there is no fade, the music simply drops to 0 volume. &lt;script&gt; var status = 'S' ; function pausecomp(ms) { ms += new Date().getTime(); while (new Date() &lt; ms){} } function play_it( aud_id ) { if ( status == 'S' ) { var offset = $("#"+aud_id+"_offset")[0].value ; if ( offset &gt; $("#" + aud_id )[0].duration ) { alert ( "offset beyond end of track" ); return; } $("#" + aud_id)[0].currentTime = offset ; $("#" + aud_id)[0].volume = 1 ; $("#" + aud_id)[0].play() ; status = 'P' ; $("#"+aud_id+"_div").css('backgroundColor', 'cyan') ; } else if ( status == 'P' ) { $("#"+aud_id+"_div").css('backgroundColor', 'green') ; status = 'F' ; fadeout( aud_id ) ; stop( aud_id ); status = 'S' ; } else if ( status == 'F' ) { stop( aud_id ) ; status = 'S' ; } } function fadeout(aud_id) { // reduce the volume by .01 every 60 ms var volume = $("#" + aud_id)[0].volume ; var stop = 100 ; if ( volume &gt; 0 ) { stop = Math.floor( 100*volume ) ; } for ( var i = 1 ; i &lt; stop ; i++ ) { reduceVol($("#" + aud_id)[0]); pausecomp(60) ; } $("#" + aud_id)[0].volume = 0 ; } function reduceVol(audio_obj) { var volume = audio_obj.volume ; volume = volume - 0.01 ; if ( volume &gt;= 0 ) { audio_obj.volume = volume ; } } function stop(aud_id) { $("#" + aud_id)[0].pause() ; } &lt;/script&gt; &lt;div style='display:inline-block; width:300px;'&gt; &lt;h3&gt;&lt;% $events[$i] || '' %&gt;&lt;/h3&gt; &lt;audio id="my_audio_&lt;% $i %&gt;"&gt; &lt;source src="&lt;% $src %&gt;mp…
tagged with: html5-audio
tagged with: google-chrome
type: Question
has comment: http://stackoverflow.com/comment/38621453
tagged with: javascript
has answer: http://stackoverflow.com/a/24868077

http://stackoverflow.com/a/25165838
has body: Use this guide (shameless self promotion) to setup your configurations. Then debug should just work as is. Also, you won't need to run gulp from commandline separately, since webstorm will do that for you.
upvote count: 8
downvote count: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24765791
score: 8
answers question: http://stackoverflow.com/q/24765791
type: Answer

http://stackoverflow.com/comment/38484233
has text: I meant any tag, for this instance, lets say I want to remove `all+posts`.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24795078

http://stackoverflow.com/a/24756109
type: Answer
has body: I can see result being set in the code you posted, however what we cannot see is where result is being set to get the content you are 'saying' it contains. That way we could help you interpret the application of these proven recommendations a lot better. But in anycase, have a look at these resources to help you in your quest. http://bl.ocks.org/mbostock/7555321 How to dynamically display a multiline text in D3.js?
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/24755321
downvote count: 0

http://stackoverflow.com/q/24848955
has body: To show a Clock on the WordPress website, I'm using a simple code suggested at the following link: JavaScript Clock &mdash; plus2net.com I changed the display function to: function display_ct() { var strcount var now = new Date(); var d = Date.UTC(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds() ); // obtain local UTC offset and convert to msec localOffset = now.getTimezoneOffset() * 60000; var c = new Date(d + localOffset); document.getElementById('ct').innerHTML = c; tt=display_c(); } So that it's showing: Sun Jul 20 2014 14:57:47 GMT+0600 (Central Asia Standard Time) The site is a Bangladesh-based site, so I need to show the time to be GMT+6 always. But I want to format the display like below: Dhaka: Jul 20 2014 02:57:47 PM I know I can show the string Dhaka:, but I can't modify the view of the JS to this. I've checked getFullYear(), getMonth() etc. but each time they are returning single value. How come the large output comes out from the date() function then? I din't check my code otherwise Dhaka. I'm sorry, I'm novice in JavaScripting. :(
tagged with: php
accepted answer: http://stackoverflow.com/a/24849365
type: AnsweredQuestion
score: 0
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/24849365
answer count: 1
has title: JavaScript date() - for date-time clock

http://stackoverflow.com/q/24779124
tagged with: event-handling
tagged with: jquery
type: UnansweredQuestion
has title: Get selector in Jquery delegate event handler
has comment: http://stackoverflow.com/comment/38452830
has answer: http://stackoverflow.com/a/24779350
type: Question
has comment: http://stackoverflow.com/comment/38453006
tagged with: javascript
has comment: http://stackoverflow.com/comment/38452824
has body: I have the following code Here i have 2 selectors "td.slot" and "td.slot1" and 2 events "mouseover" and "mouseleave". As you can see i am using e.type to get one of the events. Now i want to know if there is a way like e.selector where i can get one of the selectors $(document).ready(function(){ $("table").delegate('td.slot,td.slot1','mouseover mouseleave',function(e){ var row = $(this).parent()[0]; var rowHead = row.cells[0]; var colHead = row.parentNode.rows[0].cells[$(this).index()]; if (e.type == 'mouseover') { $(rowHead).css("background-color","orange"); $(colHead).css("background-color","orange"); } else { $(rowHead).css("background-color","white"); $(colHead).css("background-color","white"); } });
score: 0
tagged with: delegates
has comment: http://stackoverflow.com/comment/38452807
tagged with: jquery-selectors
answer count: 1

http://stackoverflow.com/q/24855619
favorite count: 0
tagged with: router
tagged with: node.js
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/24865247
downvote count: 0
has comment: http://stackoverflow.com/comment/38598176
has comment: http://stackoverflow.com/comment/38598142
type: Question
has answer: http://stackoverflow.com/a/24865247
has title: Get POST request when using Router middleware
tagged with: javascript
has body: I'm using Passport to authenticate my users on NodeJS. Currently I'm using ExpressJS and I'm trying to route my traffic. I currently use the following code: website.js (main file) require("./routes.js")(app); routes.js var pages = { home: require("./pages/home"), about: require("./pages/about"), register: require("./pages/register"), login: require("./pages/login"), api: require("./api/index") }; module.exports = function(app) { app.use("/", pages['home']); for (page in pages) { app.use("/" + page, pages[page]); } app.get("/logout", function(req, res) { req.logout(); req.redirect("/"); }); } register.js var express = require('express'); var router = express.Router(); var app = express(); router.get("/", function(req, res) { res.render("register", { page: "Register", message: req.flash("registerMessage") }); }); app.post("/", passport.authenticate("register", { successRedirect: "/about/", failureRedirect: "/register/", failureFlash: true, successFlash: "Logged in!" })); module.exports = router; The problem I am facing is that POST requests to this will result in a 404. The page is not found. The GET request (so /register) properly shows the registration form, but upon submitting I get a 404. If I change router.get("/", function(req,res){}) to router.use("/", function(req, res, next) {}), I will get HTTP 500 errors when I call "Next()" (Can't set headers after they are sent.), and POST still doesn't work. Could anyone tell me how to correctly catch POST requests behind router middleware?
tagged with: express
upvote count: 3
has comment: http://stackoverflow.com/comment/38600972
answer count: 1

http://stackoverflow.com/comment/38402093
comment on: http://stackoverflow.com/q/24751886
score: 0
type: Comment
type: QuestionComment
has text: Yes..I made a replica of the original image and change it opacity.

animation
tags question: http://stackoverflow.com/q/24787174
tags question: http://stackoverflow.com/q/24749630
tags question: http://stackoverflow.com/q/24874030
tags question: http://stackoverflow.com/q/24756117
tags question: http://stackoverflow.com/q/24864486
tags question: http://stackoverflow.com/q/24766915
tags question: http://stackoverflow.com/q/24880815
tags question: http://stackoverflow.com/q/24783304
tags question: http://stackoverflow.com/q/24857010
tags question: http://stackoverflow.com/q/24868951
type: Tag
tags question: http://stackoverflow.com/q/24888910
tags question: http://stackoverflow.com/q/24832509
tags question: http://stackoverflow.com/q/24818216
tag name: animation
tags question: http://stackoverflow.com/q/24846898
tags question: http://stackoverflow.com/q/24843636
tags question: http://stackoverflow.com/q/24815365
tags question: http://stackoverflow.com/q/24792139
tags question: http://stackoverflow.com/q/24871690
tags question: http://stackoverflow.com/q/24846534
tags question: http://stackoverflow.com/q/24875251
tags question: http://stackoverflow.com/q/24883585
tags question: http://stackoverflow.com/q/24769070
tags question: http://stackoverflow.com/q/24750271
tags question: http://stackoverflow.com/q/24764680
tags question: http://stackoverflow.com/q/24751587
tags question: http://stackoverflow.com/q/24772704
tags question: http://stackoverflow.com/q/24876908
tags question: http://stackoverflow.com/q/24771138
tags question: http://stackoverflow.com/q/24802344
tags question: http://stackoverflow.com/q/24884739
tags question: http://stackoverflow.com/q/24773996
tags question: http://stackoverflow.com/q/24825485
tags question: http://stackoverflow.com/q/24825212

http://stackoverflow.com/a/24755018
type: Answer
upvote count: 3
score: 3
has body: var re = /^[A-Za-z\'\s\.\,]+$/ try this regular expression work for your requirement
downvote count: 0
answers question: http://stackoverflow.com/q/24754914

http://stackoverflow.com/a/24855601
accepted answer of: http://stackoverflow.com/q/24854640
has body: After some ardent research, this is a known issue with Firefox's sub-pixel rendering. More obvious demonstrations of the effect can be found here and here. The phenomenon is referred to as "pixel snapping" and it occurs rather frequently in Firefox's animation, particularly at the conclusion of a transition. The solution, which is also proposed in the Bugzilla thread, is to add rotate(0.0001deg) to the scaling transform. This greatly reduces the effect but does not entirely eliminate it. However, it is the best I can hope for, so I'm accepting it as the answer.
upvote count: 20
has comment: http://stackoverflow.com/comment/38598132
downvote count: 0
score: 20
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42641027
has comment: http://stackoverflow.com/comment/74873524
type: Answer
answers question: http://stackoverflow.com/q/24854640
has comment: http://stackoverflow.com/comment/90311545

http://stackoverflow.com/a/24824822
upvote count: 1
downvote count: 0
has body: Its clearly a closure issue. Read more here Also it's suggested using $resource over $http. (ng-resource). Check out the example to post in for loop using resource. for(var i=0; i&lt;$scope.ListOfRecordsToPost.length; i++){ var postSuccessCallback = function(postRec) { console.info('Posted ' + postRec); }($scope.ListOfRecordsToPost[i]); lsProductionService.post({}, postSuccessCallback); }
type: Answer
score: 1
answers question: http://stackoverflow.com/q/24773307

http://stackoverflow.com/comment/38664204
comment on: http://stackoverflow.com/a/24888533
score: 0
type: AnswerComment
has text: are you see the demo link, will write console data.list object, It's have data or not
type: Comment

http://stackoverflow.com/q/24824725
has answer: http://stackoverflow.com/a/24824941
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24824941
score: 0
tagged with: requirejs
has body: I have RequireJS running on my IIS server, for my MVC web app. Is it possible to make RequireJS pick up the minified versions of the files, rather than their unminified? Visual Studio makes all of these files and they seem to be going to waste. My understanding of NodeJS servers is they can open the javascript files to send dependencies aswell, but I cannot see that happening with MVC.
type: AnsweredQuestion
has title: RequireJS optomization without Node.js?
tagged with: asp.net-mvc
tagged with: amd
type: Question

http://stackoverflow.com/comment/38535840
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24819771
has text: did you add jquery.min.js??

http://stackoverflow.com/q/24766170
type: Question
tagged with: javascript
tagged with: google-apps-script
score: 0
answer count: 2
tagged with: google-sheets
possible better answer: http://stackoverflow.com/a/24780426
has answer: http://stackoverflow.com/a/24784997
has title: create a dropdown with links in google sheets?
has answer: http://stackoverflow.com/a/24780426
has body: I have a google spreadsheet with records that include a client name, and multiple links to their associated projects. If I were using excel, I would create comboboxes that pop up when you click their "links" attribute, and then you could click the links from inside that combobox. However, google apps script doesn't support comboboxes. An alternative I thought of was creating dropdowns that contain the links, but this does not work, either. Is there any way I can get a similar functionality from a google spreadsheet?
accepted answer: http://stackoverflow.com/a/24784997
tagged with: combobox
type: AnsweredQuestion

http://stackoverflow.com/a/31740703
type: Answer
has comment: http://stackoverflow.com/comment/51416246
has body: Instead of: node.nodeValue = "New value"; I did the following: var parentNode = node.parentNode; parentNode.removeChild(node); var newElm = doc.createTextNode("New value"); parentNode.appendChild(newElm); And it works fine!
score: 1
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/51452475
answers question: http://stackoverflow.com/q/24885069

http://stackoverflow.com/a/24884060
type: Answer
answers question: http://stackoverflow.com/q/24871061
accepted answer of: http://stackoverflow.com/q/24871061
type: AcceptedAnswer
score: 0
has body: It works as expected: you have changed month/year options, but all others (day, hour etc.) are used as defaults. dateTimeLabelFormats doesn't prevent from displaying different interval on xAxis. To change that use minTickInterval.

http://stackoverflow.com/q/24825129
has answer: http://stackoverflow.com/a/24825197
linked to: http://stackoverflow.com/q/16184428
type: AnsweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38539767
has body: Im trying to include a file with ng-include, but it don't work. The file should be included when you press on a button: Jämför Here is my function in the controller: $scope.getPartial = function() { $scope.showCompare = '../partials/compare.html'; console.log($scope.showCompare); }; And here is my div: Nothing is included. Have I done something wrong?
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38541118
tagged with: angularjs-ng-include
has comment: http://stackoverflow.com/comment/38540938
upvote count: 1
accepted answer: http://stackoverflow.com/a/24825197
answer count: 1
favorite count: 0
has title: include page with ng-include, angularjs
tagged with: angularjs

http://stackoverflow.com/a/24830308
answers question: http://stackoverflow.com/q/24830173
has body: You can't name a function as write(). If you will call onclick=write() the function document.write() being called. So your DOM is being cleared. And you are not getting anything. Rename your function. Put this line in function to add div in body document.body.appendChild(name);
score: 0
type: Answer

http://stackoverflow.com/a/24755293
accepted answer of: http://stackoverflow.com/q/24755057
answers question: http://stackoverflow.com/q/24755057
downvote count: 0
score: 1
has body: You can solve this problem with CSS only. Demo. MDN. #byte_content { white-space: pre}
has comment: http://stackoverflow.com/comment/38410790
upvote count: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/38484993
comment on: http://stackoverflow.com/a/24793557
has text: No they are not, but I would bet they are referenced way more often than the W3C documentation is. Nonetheless, I will remove the link and mention of w3schools from my answer and stick with the authoritative reference.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38606356
comment on: http://stackoverflow.com/a/24859962
type: AnswerComment
score: 0
type: Comment
has text: do i need to mention some path anywhere?

http://stackoverflow.com/comment/38594543
has text: @VotetoClose It's not a child inheritance problem. Look at the html markup.
score: 1
comment on: http://stackoverflow.com/q/24853810
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24845007
tagged with: javascript
favorite count: 0
tagged with: ember.js
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/24845542
score: 1
has body: I am attempting to write a test in my ember-cli application that tests whether a particular controller action will take the user to a specific route based on the value of an input on the page. Here's the error I'm getting: IndexController: the setTable action navigates to the tables route ✘ Died on test #1 at http://localhost:7357/assets/qunit.js:425 at test (http://localhost:7357/assets/vendor.js:72425) at :29 at http://localhost:7357/assets/vendor.js:54 at http://localhost:7357/assets/test-loader.js:14: 'null' is not an object (evaluating 'target.transitionToRoute') If I attempt it in the browser this is the error I get in the console: Error while loading route: undefined My route is defined, here's my router: import Ember from 'ember'; var Router = Ember.Router.extend({ location: AccelewaiterENV.locationType }); Router.map(function() { this.route('table', { path: '/table/:table_id' }); }); export default Router; Here's my test: import { test, moduleFor } from 'ember-qunit'; moduleFor('controller:index', 'IndexController', { // Specify the other units that are required for this test. // needs: ['controller:foo'] }); test('the setTable action navigates to the tables route', function() { var controller = this.subject(); controller.set('tableNumber', 1); controller.send('setTable'); ok(controller.get('currentPath') === '/table/1'); }); Here's my template: {{input type="text" valueBinding="tableNumber" class="form-control input-lg" placeholder="Enter Table #"}} Ok And here's my controller: import Ember from 'ember'; export default Ember.Controller.extend({ tableNumber: null, actions: { setTable: function() { var tableNumber = this.get('tableNumber'); console.log(this.transitionTo); this.transitionToRoute('table/' + tableNumber); } } }); I also have a table controller created, it's currently empty though. Any help greatly appreciated!
type: Question
has title: Testing Ember.js route navigation from within a controller
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/38531027
type: AnswerComment
comment on: http://stackoverflow.com/a/24820035
type: Comment
has text: @user3852052: Ah, gotcha. Then the above should work.
score: 0

http://stackoverflow.com/comment/38460243
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24782433
type: Comment
has text: thanks, but I think that works for update a single record, what I'm trying to do is "refresh"the whole list to get the new result just added, in fact I want to update the whole list (companies), but thanks again I will use that for the single record update

http://stackoverflow.com/comment/38679879
has text: Thanks for the response, I edited the post to answer your question
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24898436

reference
tags question: http://stackoverflow.com/q/24794532
type: Tag
tags question: http://stackoverflow.com/q/24882906
tags question: http://stackoverflow.com/q/24836801
tag name: reference

http://stackoverflow.com/a/24767831
score: 0
answers question: http://stackoverflow.com/q/24764132
has body: Try this, here's a FIDDLE $(window).resize(function() { if($(this).width() &lt; 360) { $('.reponsiveTap').slideUp(400, 'linear'); $('.in-row h2').on('click', function() { $('.reponsiveTap').stop().slideUp(400, 'linear').removeClass('active'); $(this).next('.reponsiveTap').stop().slideToggle(400, 'linear').addClass('active'); }); } else { $('.reponsiveTap').slideDown(400, 'linear'); $('.in-row h2').off('click'); } });
type: Answer

http://stackoverflow.com/a/24777572
downvote count: 0
has comment: http://stackoverflow.com/comment/38451052
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/24777047
upvote count: 1
answers question: http://stackoverflow.com/q/24777047
has body: Lets say you have two templates called aaa.html and bbb.html. If you want your choose dynamically between them in your directive you could write app.directive('mycustomer', function(){ return { templateUrl: function(el, attr) { return attr.template + '.html'; } } }); and then called them like this &lt;div mycustomer template="aaa"&gt;&lt;/div&gt; &lt;div mycustomer template="bbb"&gt;&lt;/div&gt;
type: AcceptedAnswer

http://stackoverflow.com/comment/38531234
comment on: http://stackoverflow.com/q/24819325
has text: What does your `select2` binding handler look like?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24813438
tagged with: javascript
tagged with: ajax
linked to: http://stackoverflow.com/q/1732348
score: 0
has body: I'm attempting to write some JavaScript code (in particular, a Chrome extension) which does the following: Retrieve some web page's contents via AJAX. Get some content from that page by locating certain elements inside of the HTML string and getting their contents. Do a thing with that data. I have 1) and 3) working, but I'm having some trouble achieving step 2) in a reasonable way. I currently have 2) implemented via jQuery(htmlString) and then using normal jQuery selectors and etc. to extract the data I want. The problem is that jQuery actually adds the retrieved HTML to the current page, loading and executing all external resources / scripts in the process. This is obviously bad. So I'm looking for a way to get the text and HTML in certain tags inside my HTML string without: Loading or executing ANY scripts or resources (images, CSS, etc.) referenced in the HTML string. Trying to remove external resources with regular expressions, since we all know what happens when you parse [X]HTML with regex. I believe that I can achieve what I want using jsdom and jQuery, since jsdom has a FetchExternalResources option which can be set to false. However, jsdom seems to only work in NodeJS, not in the browser. Is there any reasonable way to do this?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38518965
answer count: 1
has comment: http://stackoverflow.com/comment/38518543
has comment: http://stackoverflow.com/comment/38518785
has title: Parse HTML retrieved via AJAX in JavaScript
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24814973
accepted answer: http://stackoverflow.com/a/24814973
type: Question

http://stackoverflow.com/q/24811877
tagged with: css
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24812045
type: Question
has answer: http://stackoverflow.com/a/24812934
accepted answer: http://stackoverflow.com/a/24812934
tagged with: javascript
has body: For example this is menu : 1 2 3 4 5 6 I need to hide the 6 on resize, after that 5, and the menu will look like that: 1 6 5 2 3 4
has title: How can i create a responsive menu on html css and jquery,that hide li element one by one?
score: 0
answer count: 3
tagged with: jquery
has answer: http://stackoverflow.com/a/24812045
has comment: http://stackoverflow.com/comment/38515474
has answer: http://stackoverflow.com/a/24812740
has comment: http://stackoverflow.com/comment/38515247
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38515581

http://stackoverflow.com/q/24854607
has body: I have been building out a website in angular with the aim of running no web server on the backend and using web services to retrieve whatever dynamic content can be retrieved. I built a blogger widget yesterday that dynamically retrieves most recent blog-posts from a range of configurable blogs and renders them on the webpage. I would ideally like to do something similar with Google Drive and render the content of public documents by calling an API. Two questions: Should I be dynamically retrieving and rendering this contents in the first place, or should I simply create static HTML files? Maybe my desire to separate logic from data is just over-complicating things. If I am not over-complicating matters, where should I persist these files? I could potentially post them as blog entries and retrieve them as I did for my blogger widget. I do feel like since they are not blogs, they should not be treated as such. Is there an API call for Google Drive that would enable me to get the contents of a Google Doc (which is accessible either publicly or by anyone with the link) as HTML and return them in a JSON response?
tagged with: persistence
score: 0
has answer: http://stackoverflow.com/a/24855338
tagged with: client-side
tagged with: angularjs
type: UnansweredQuestion
has title: Web service that publishes text documents to the cloud so they can be dynamically retrieved via API call and rendered on client side?
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/24853312
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24862255
type: Question
has title: Symbols cut off by map tiles
upvote count: 9
score: 9
tagged with: google-maps
downvote count: 0
answer count: 1
tagged with: javascript
has body: When I add an arrow to a polyline, it's cut off when the arrow lays on the edge of a map tile. This can be reproduced with the sample code from the docs (https://developers.google.com/maps/documentation/javascript/examples/overlay-symbol-arrow), just make it draggable and move it a little. Here's how it looks when not on edge: Here's how it looks on edge: The problem exists in both release (3.16) and experimental (3.17) versions. I've reported it on google's bugtracker, but it will probably take years before they fix it. So, does anyone know a workaround? Edit: Oh, I should probably add that it doesn't happen with small strokeWeight, it has to be a bit larger like on the image.
favorite count: 0
tagged with: google-maps-api-3

http://stackoverflow.com/comment/38645513
comment on: http://stackoverflow.com/q/24880539
score: 0
type: Comment
type: QuestionComment
has text: You can't pass any arguments to inline onclick handlers AFAIK (with the exclusion of `this` i think). You'll need to find some other way to access `email`.

http://stackoverflow.com/comment/38661825
score: 0
type: Comment
type: QuestionComment
has text: the resize method does not change anything. with "controlled by zoom level thresholds" i mean, that baselayer switch automatically when passing over a distinct zoom level (in contrast to the method of clicking a button where the layer change is fluent)
comment on: http://stackoverflow.com/q/24884285

http://stackoverflow.com/q/24898436
has comment: http://stackoverflow.com/comment/38679879
has title: Require.js: load file from build but don't execute it
tagged with: jquery-mobile
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38680129
tagged with: jquery
type: UnansweredQuestion
tagged with: ember.js
has comment: http://stackoverflow.com/comment/38679630
tagged with: requirejs
has comment: http://stackoverflow.com/comment/38681161
has comment: http://stackoverflow.com/comment/38681140
has body: I'm working on an application that combines ember.js and jquery-mobile.js In order to make those two play nice with each other, I need to load JQM after Ember is initialized. So I use the following code in my main file, app.js: require.config({ baseUrl: 'resources/js/', waitSeconds: 200, paths: { text: 'lib/require/text', ember: 'lib/ember-1.5.1.min', jquery: 'lib/jquery-2.1.1.min', mobile: 'lib/jquery.mobile-1.4.2.min', handlebars: 'lib/handlebars-1.3.0.min', }, shim: { 'ember': { deps: ['handlebars', 'text', 'jquery'] } } }); define('app', [ 'jquery', 'app/many/files', 'ember' ], function($, ManyFiles) { $(document).bind('mobileinit', function() { $.mobile.ajaxEnabled = false; $.mobile.pushStateEnabled = false; $.mobile.linkBindingEnabled = false; $.mobile.hashListeningEnabled = false; $.mobile.ignoreContentEnabled = true; }); App = Ember.Application.create({ ready: function() { require(['mobile']); } }); // Initialize stuff... } (As you can see, jqm is loaded only when the ember application is ready) This works great, but when I build all the files into a single minified js file, I run into this problem: As soon as the code requires JQM, I see an http call on the network tab which goes to grab jquery-mobile.js Of course this is an unpleasant process. The only solution I can think of is to load JQM along with all the other dependencies but not execute it. Then, the code can execute JQM instead of requiring the file. However I am not experienced on require.js and I have no idea on how to do that. Any help is appreciated. Other methods to accomplish the same thing are also appreciated Thanks EDIT: Why does JQM needs to get loaded after Ember? Because JQM add wrappers, classes and events on the DOM that interfere with ember... and things get really bad
has comment: http://stackoverflow.com/comment/38680687
has comment: http://stackoverflow.com/comment/38680903
type: Question
has answer: http://stackoverflow.com/a/24899690
has comment: http://stackoverflow.com/comment/38680168

http://stackoverflow.com/a/24877943
type: Answer
score: 8
answers question: http://stackoverflow.com/q/24816322
downvote count: 1
upvote count: 9
has comment: http://stackoverflow.com/comment/38646921
has body: Your menu is basically just a bunch of nested lists; after looking at this post, I was able to take your subMenu data structure and adapt it to generate a simple list: HTML Javascript function MenuCtrl($scope) { $scope.subMenu = [ { title: "User Manual", subMenu: [ { title: "Title one", link: "index/titleone.html", icon:"fa fa-caret-down", subMenu: [] }, { title: "Basic", link: "index/basic/basic.html", icon:"fa fa-caret-down", subMenu: [ { title: "Basic Function", link: "index/basic/function.html", icon:"fa fa-caret-down", subMenu: [] }] }] }]; } I have this fiddle if you'd like to see it in action. Does that help?

http://stackoverflow.com/q/24815838
possible better answer: http://stackoverflow.com/a/24815877
score: 1
has comment: http://stackoverflow.com/comment/38524415
type: Question
answer count: 2
has title: how to open modal from angular controller
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24816073
has answer: http://stackoverflow.com/a/24815877
has answer: http://stackoverflow.com/a/24816073
has body: I have an angular controller and want to open a modal in my view. My HTML &lt;div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;span class="sr-only"&gt;Close&lt;/span&gt;&lt;/button&gt; &lt;h4 class="modal-title" id="myModalLabel"&gt;Modal title&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; ... &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt; &lt;button type="button" class="btn btn-primary"&gt;Save changes&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; Settings Controller function SettingsController($scope,WalletManager,Storage){ $scope.pageClass = 'page-settings'; ]; $scope.myModal = function () { var modalInstance = $myModal.open({ }); How can I open from controller ?
favorite count: 0
tagged with: angularjs
tagged with: twitter-bootstrap
upvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/comment/38495148
score: 0
type: AnswerComment
has text: @Steve what does work only for 3 elements? My last strange thing or answer in whole?
type: Comment
comment on: http://stackoverflow.com/a/24799660

http://stackoverflow.com/a/24821802
has body: You might want to check http://www.w3schools.com/tags/canvas_drawimage.asp I'm not sure if you can crop an image to a cricle though (maybe if the image has a transparant background) *edit apperently you can HTML5 Canvas - Fill circle with image
has comment: http://stackoverflow.com/comment/38562659
type: Answer
answers question: http://stackoverflow.com/q/24821367
score: 0

http://stackoverflow.com/q/24772942
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38442144
tagged with: javascript
has answer: http://stackoverflow.com/a/24781617
has comment: http://stackoverflow.com/comment/38442707
tagged with: jquery-plugins
answer count: 2
downvote count: 4
has answer: http://stackoverflow.com/a/24795425
has title: problems comes here after click on target2 the alert is target2 and on click on download alert is target1
tagged with: jquery
has comment: http://stackoverflow.com/comment/38441558
favorite count: 0
has comment: http://stackoverflow.com/comment/38441566
possible better answer: http://stackoverflow.com/a/24795425
accepted answer: http://stackoverflow.com/a/24781617
score: -3
type: AnsweredQuestion
tagged with: contextmenu
has comment: http://stackoverflow.com/comment/38443878
has comment: http://stackoverflow.com/comment/38441596
has comment: http://stackoverflow.com/comment/38441874
has body: On first rigth click I am getting alert as tgid as target1 and after click download alert tgid as target1.problems comes here after click on target2 the alert is target2 and on click on download alert is target1. Custom Right Click using jQuery target1 target2 target3

http://stackoverflow.com/q/24783343
favorite count: 0
tagged with: angularjs
has title: How can I call a function in a NG-repeat
has answer: http://stackoverflow.com/a/24783463
has comment: http://stackoverflow.com/comment/38461304
has comment: http://stackoverflow.com/comment/38461454
has comment: http://stackoverflow.com/comment/38463631
downvote count: 0
type: UnansweredQuestion
has body: I have a little problem, i wish to call a function within ng-repeat and not like this example, the fucntion remove duplicate value, but it doesn't work as i wish, i mean it remove duplicate from the string and not from the loop. This is the HTML code, the "UNIQUE" function is to remove duplicate contents. {{unique(compet.eventCode)}} And this is the "UNIQUE" function code . unique: function(array) { var len = array.length; var out = []; var obj = {}; for (var i = 0; i < len; i++) { obj[array[i]] = 0; } for (var j in obj) { out.push(j); } return out; }, thanks so much for your helps PS : this is a link for a screenshot : hpics.li/d44d002 . the RED cercle is the "compet.eventCode" . the GREEN cercle is the value, and i want to display only once every duplicated value.
has comment: http://stackoverflow.com/comment/38461293
type: Question
has comment: http://stackoverflow.com/comment/38461464
has answer: http://stackoverflow.com/a/24783746
score: 1
has comment: http://stackoverflow.com/comment/38463950
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/38463517
tagged with: javascript

http://stackoverflow.com/comment/38505066
type: AnswerComment
score: 0
has text: it will return `undefined` so KO won't call your handler also the browser action (clicking on the link) won't be executed. But you can change this according to your needs.
type: Comment
comment on: http://stackoverflow.com/a/24806534

http://stackoverflow.com/q/24820627
type: UnansweredQuestion
has title: Javascript Project | Is it possible?
has comment: http://stackoverflow.com/comment/38531835
has comment: http://stackoverflow.com/comment/38531705
has comment: http://stackoverflow.com/comment/38531450
has answer: http://stackoverflow.com/a/24820876
has comment: http://stackoverflow.com/comment/38531456
favorite count: 0
has answer: http://stackoverflow.com/a/24822902
has comment: http://stackoverflow.com/comment/38531477
has comment: http://stackoverflow.com/comment/38531395
has comment: http://stackoverflow.com/comment/38531372
type: Question
has comment: http://stackoverflow.com/comment/38531430
tagged with: http://stackoverflow.com/tag/html
has body: now i have an idea for a project that i would like to work on and i know it is possible with software languages such as c# or c++ However i wanted to know if it would be actually do-able with web languages such as php and javascript: I need to be able plug my phone in to my computer with a usb cable and using php/js i need to detect the phone thats been plugged in and detect some data. Now thats the first idea im not sure is possible. Next i need to record strokes on the phone and macro it to repeat on the plugged phone, in case you dont know what i mean: 1- records prerecorded hand strokes to for example navigate to the setting option on the phone (via touchscreen) then changes a setting. 2- when phone is plugged in, it does the actions (aka keystrokes or touches on the touchscreen) So is this actually possible with php/js? how if it is? Thanks guys/girls, let me know for more info if you need it.
score: -2
tagged with: php
has comment: http://stackoverflow.com/comment/38533031
has comment: http://stackoverflow.com/comment/38531884
answer count: 3
downvote count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/38531369
has comment: http://stackoverflow.com/comment/38531418
has comment: http://stackoverflow.com/comment/38531727
has answer: http://stackoverflow.com/a/24820907
has comment: http://stackoverflow.com/comment/38531558
tagged with: javascript
has comment: http://stackoverflow.com/comment/38531670

http://stackoverflow.com/q/24790602
has title: Set option val based on array
favorite count: 0
has body: I am trying to build a search that uses multiple drop downs. The script for the search uses the values for the first drop down and the second drop down. It works correct for Acura and MDX, but if I choose RLX it still passes MDX to the search as the value. I know I have so somehow set for the value for the appended option to be whatever array is chosen in the second drop down, but I have had no luck. I am new to javascript so for all I know there may be a way easier than this to accomplish my goal. FORM FOR SUBMIT Brand: Acura Chrysler SCRIPT FOR URL STARTING WITH A BASE URL function dosearch() { var sf=document.searchform; var baseUrl = 'http://www.spitzer.com/new-inventory/index.htm?'; location.href = baseUrl.concat('make='+ sf.brands.options[sf.brands.selectedIndex].value + '&&&&' + 'model=' + sf.item.options[sf.brands.selectedIndex].value + '&&&&' ); return false; } SCRIPT FOR DROP DOWNS // JavaScript Document $(document).ready(function(){ Acura=new Array("MDX","RLX","ILX","TLX"); Chrysler=new Array('200','3000','Town&Country'); populateSelect(); $(function() { $('#brands').change(function(){ populateSelect(); }); }); function populateSelect(){ cat=$('#brands').val(); $('#item').html(''); eval(cat).forEach(function(t) { $('#item').append(' '+t+' '); }); } });
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24790786
possible better answer: http://stackoverflow.com/a/24791182
type: Question
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/24790786
tagged with: arrays
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24791182

http://stackoverflow.com/q/24751138
has comment: http://stackoverflow.com/comment/38400816
score: 1
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has title: using d3.json method with Json object
has comment: http://stackoverflow.com/comment/38400973
has body: I am generating an zoomable chart by using d3.js. chart data is being received as json object. how to change the following code to work with JSON object d3.json("mydata.json", function(json) { //TODO: }); instead of file name "msdata.json" I want to use Json object. please help me how to do this.
linked to: http://stackoverflow.com/q/10934853
tagged with: d3.js
has comment: http://stackoverflow.com/comment/38402916
type: UnansweredQuestion
upvote count: 1
linked to: http://stackoverflow.com/q/20834760
duplicate of: http://stackoverflow.com/q/10934853
type: Question
has answer: http://stackoverflow.com/a/24753081

http://stackoverflow.com/tag/xml
tags question: http://stackoverflow.com/q/24769579
tags question: http://stackoverflow.com/q/24857615
tags question: http://stackoverflow.com/q/24805066
tags question: http://stackoverflow.com/q/24808025
type: Tag
tags question: http://stackoverflow.com/q/24839681
tags question: http://stackoverflow.com/q/24863343
tags question: http://stackoverflow.com/q/24879101
tags question: http://stackoverflow.com/q/24869558
tags question: http://stackoverflow.com/q/24824956
tags question: http://stackoverflow.com/q/24906830
tags question: http://stackoverflow.com/q/24886457
tags question: http://stackoverflow.com/q/24787921
tag name: xml
tags question: http://stackoverflow.com/q/24871133
tags question: http://stackoverflow.com/q/24770913
tags question: http://stackoverflow.com/q/24873706
tags question: http://stackoverflow.com/q/24791402
tags question: http://stackoverflow.com/q/24800337
tags question: http://stackoverflow.com/q/24883791
tags question: http://stackoverflow.com/q/24808091
tags question: http://stackoverflow.com/q/24885069
tags question: http://stackoverflow.com/q/24802563
tags question: http://stackoverflow.com/q/24893004
tags question: http://stackoverflow.com/q/24895732
tags question: http://stackoverflow.com/q/24797487
tags question: http://stackoverflow.com/q/24843015

http://stackoverflow.com/a/24783189
has comment: http://stackoverflow.com/comment/38461102
has comment: http://stackoverflow.com/comment/38461273
answers question: http://stackoverflow.com/q/24783099
has comment: http://stackoverflow.com/comment/38461164
type: Answer
has body: Have the function you are calling return a function with the name, passed by argument, in a closure: $('div').click( fn_clik('Mike') ); var fn_clik = function(name){ return function() { alert('Name is:' + name + ' item is:' + item); } } Or have an anonymous function you pass wrap the original function called with the correct parameter: $('div').click(function () { fn_clik('Mike') }); A quick note, in your original code, you were calling the function 'fn_clik' instead of passing it as an object. So your code was evaluating to: $('div').click( undefined ); This is because your original 'fn_clik' has no return value;
accepted answer of: http://stackoverflow.com/q/24783099
score: 4
has comment: http://stackoverflow.com/comment/38461364
upvote count: 4
has comment: http://stackoverflow.com/comment/38461306
has comment: http://stackoverflow.com/comment/38461224
type: AcceptedAnswer
downvote count: 0

angular-ui
tags question: http://stackoverflow.com/q/24786796
tags question: http://stackoverflow.com/q/24891143
tags question: http://stackoverflow.com/q/24818387
type: Tag
tags question: http://stackoverflow.com/q/24775205
tags question: http://stackoverflow.com/q/24880066
tags question: http://stackoverflow.com/q/24905187
tags question: http://stackoverflow.com/q/24829871
tags question: http://stackoverflow.com/q/24891671
tags question: http://stackoverflow.com/q/24866097
tag name: angular-ui
tags question: http://stackoverflow.com/q/24900117

http://stackoverflow.com/a/24857055
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24846249
has comment: http://stackoverflow.com/comment/38638435
type: Answer
score: 1
type: AcceptedAnswer
has body: The parent options will be available on DerivedClass.__super__.options, and constructor runs before anything else, so you can combine objects as you see fit in that method. For example: DerivedClass = BaseClass.extend({ options: { wantToOverride: 'foo' }, events: { 'click': 'onClick' }, constructor: function() { var parentOptions = this.__super__.options, parentEvents = this.__super__.events; this.options = _.extend({}, parentOptions, this.options); this.events = _.extend({}, parentEvents, this.events); } }); If this is going to happen with many classes, you may want to set up a base class with this constructor and have everything inherit from it.
answers question: http://stackoverflow.com/q/24846249
upvote count: 1

http://stackoverflow.com/q/24754235
upvote count: 1
downvote count: 1
tagged with: c#
has body: I am not able to bind dropdown with enum value.In given code,I am getting all enumeration value as object in variable "mode" but its not getting bind in dropdown. Here is my html code of dropdown. &lt;select data-bind="options:modes,value:Mode, optionsText:'Text', optionsValue:'ID', optionCaption:'Select Mode'"&gt;&lt;/select&gt; and the script is as follows:-- var NfsObject = { Name: '', Path: '', Extensions: '', Volume: '', Mode: 0, ClientID: 0 } function Nfs(data) { var mode = JSON.parse('@Html.Raw(Model.ToValues(typeof(NfsModeEnum)))'); var self = this; this.modes = mode; this.clients = ko.observableArray([]); ko.mapping.fromJS(data, NfsObject, self); }
has comment: http://stackoverflow.com/comment/38433864
tagged with: knockout.js
type: Question
has title: Drop down binding with enumeration type in knockout
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38407129
score: 0
has comment: http://stackoverflow.com/comment/38406912
favorite count: 0
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/24820584
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38532494
has comment: http://stackoverflow.com/comment/38532764
has body: You can simplify this a little bit. function searchBox(inputVal) { var regExp = new RegExp(inputVal, 'i'); $('#boxdata').find('tr').removeClass('red').filter(function() { return $(this).find('td').filter(function() { return regExp.test( $(this).text() ); }).length &amp;&amp; $.trim(inputVal).length; }).addClass('red'); } So remove the red class from all &lt;tr&gt;'s first, then filter them, test the text of each &lt;td&gt;, if it matches, return the &lt;tr&gt; and then add the class red again. Here's a fiddle As for changing from a table to div, the jQuery would depend on how you structure your markup, but the principle would remain the same. Here's another fiddle
type: Answer
accepted answer of: http://stackoverflow.com/q/24820288
answers question: http://stackoverflow.com/q/24820288
has comment: http://stackoverflow.com/comment/38532920
has comment: http://stackoverflow.com/comment/38532624

http://stackoverflow.com/q/24881905
accepted answer: http://stackoverflow.com/a/24882369
tagged with: angularjs-scope
has body: I've got an issue with an AngularJS app I'm writing, and I've created a very simplified version of it here: http://plnkr.co/edit/55JlCxVV1SSKfcQgbICb?p=preview My issue is that, when using ng-disabled to cause the form to validate, and subsequently display validation errors, and, obviously, enable/disable the Save button. Save $scope.validate = function() { var valid = true; if (!$scope.foo || $scope.foo.length < 5) { valid = false; messageService.addMessage('ERROR', 'foo', 'foo must be at least 5 characters', 0); } else { messageService.deleteMessage('ERROR', 'foo'); } if (!$scope.bar || $scope.bar < 10) { valid = false; messageService.addMessage('ERROR', 'bar', 'bar must be at least 10', 0); } else { messageService.deleteMessage('ERROR', 'bar'); } if (!$scope.wotsit || $scope.wotsit.length > 15) { valid = false; messageService.addMessage('ERROR', 'wotsit', 'wotsit must be less than 15 characters', 0); } else { messageService.deleteMessage('ERROR', 'wotsit'); } return valid; }; I also have another small question (possibly outside the scope of this question, but I'll ask it anyway!) - in thingController.save() - you'll see I clear all of the currently visible messages (catch all - if this particular form has validated, there will be no messages - but in the real app it makes sense), and then add one confirming the save action, but this seems to be added to the messages object, then instantly removed? Confusing, but most likely my error - if anyone could point me in the right direction, that would be awesome. $scope.save = function() { if ($scope.validate()) { messageService.clearAllMessages(); messageService.addMessage('SUCCESS', 'save', 'Saved some stuff, promise', 0); } }; As a bit of an aside, I realise that all of the validation I'm currently applying could be achieved using out of the box AngularJS validation directives, but the validation in the real app can't be, so the solution would need to continue to use this method of validating. Many thanks in advance :…
score: 0
tagged with: validation
answer count: 1
has title: $rootScope:infdig error in AngularJS when using ng-disabled to validate a collection of elements
tagged with: angularjs
type: AnsweredQuestion
type: Question
tagged with: infinite-loop
tagged with: javascript
has answer: http://stackoverflow.com/a/24882369

http://stackoverflow.com/comment/38704772
score: 0
type: AnswerComment
has text: My edit allows you to cache the data in `myData` - a variable that is global but only to that closure.
type: Comment
comment on: http://stackoverflow.com/a/24909175

http://stackoverflow.com/q/24806487
answer count: 6
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38504779
has body: I want to make some wine. And my function does: function wine(){ growGrapes(); process(grapes); makeWine(); bottle(); } However, Since my functions often consist of $.ajax() request, some other functions get carried out first. I have used the success tool, but it helps for one ajax request only. success:function(result){ //Some Code } What I actually want is a sequence. Literally, grapes get processed before growing them. What is a easiest approach?
has comment: http://stackoverflow.com/comment/38505248
accepted answer: http://stackoverflow.com/a/24806563
has answer: http://stackoverflow.com/a/24806668
has answer: http://stackoverflow.com/a/24807622
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38505684
has answer: http://stackoverflow.com/a/24806633
has answer: http://stackoverflow.com/a/24806702
has answer: http://stackoverflow.com/a/24807045
has answer: http://stackoverflow.com/a/24806563
score: 4
has title: Carry out Javascript/jQuery functions in a sequence
type: Question
upvote count: 4
possible better answer: http://stackoverflow.com/a/24806702
linked to: http://stackoverflow.com/q/16384841
downvote count: 0
has comment: http://stackoverflow.com/comment/38505147
tagged with: javascript

http://stackoverflow.com/comment/38714526
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24853292
has text: (Actually, with predictive technology, keypads are quite usable - otoh, automatic correction can be annoying).
score: 0

http://stackoverflow.com/comment/38440182
comment on: http://stackoverflow.com/a/24771798
has text: are you sure `extVideo-tab1` is an id?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38498843
type: Comment
comment on: http://stackoverflow.com/q/24803259
has text: ReferenceError: events is not defined
score: 0
type: QuestionComment

http://stackoverflow.com/comment/38408301
comment on: http://stackoverflow.com/a/24755237
score: 0
has text: If that didnt help, please do yourself a favor and create a plunkr or jsbin so we can see the problem happening and try to help you from there.
type: Comment
type: AnswerComment

http://stackoverflow.com/a/24782856
downvote count: 0
has comment: http://stackoverflow.com/comment/38541349
answers question: http://stackoverflow.com/q/24782214
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/38532881
has body: There's a few ways you can approach this. The first way, and what might fit in better with your actual question. Generate the PDF server side, then convert it to HTML This is not nearly as difficult as it sounds however, and there are a number of tools out there to do it, such as 'PDF2DOM' ( http://cssbox.sourceforge.net/pdf2dom/ ), which will take an existing PDF representation and create an HTML dom from it, this HTML can then just be injected straight into the document using normal JavaScript techniques. The second way (Especially if your using Java) is Use a browser based plugin that can consume and display a PDF Since your already developing in Java you could develop a Java Applet that can consume the PDF sent to it, and display it in the IFrame as required, you could also extend this Idea to use a Flash based PDF component, or anything else that the browser can run as a Plugin. The Problem your going to have with this approach, is the growing trend of browser manufacturers to embrace HTML5 and move away from allowing 3rd party content in the Browser. Chrome &amp; FF still support some, as does IE11, but as we go forward , especially into the brave new world of tablet computing, many browsers will not allow Plugins to be run, which means in the long term, this might work now, but may not for long. The Third approach is Take advantage of Native Browser Support Both Chrome and Firefox today have built in PDF readers, and can display PDF documents directly in a browser tab just as though it was a regular HTML page. The key here however is "In a TAB", in most cases browsers that can display PDF's will want to try and display them as a full tab resource. It is possible to render PDF's in an IFrame, but the support vary's greatly from browser to browser, with IE8 and below, only displaying IF you have a plugin such as Adobe Acrobat installed. One possible route you could try is to render the content out as an inline object using something like 'PDFObject' ( http://cs…
score: 1

http://stackoverflow.com/q/24815790
has body: I have an alert box that pops up, warning the user that they will be redirected soon. However, redirection only happens after they click OK. I want redirection to happen while the alert box is popped up, not after. Also, there should also be enough time for the user to read the alert in the first place (I allowed 2.5s). Any advice? Code below: setTimeout("redir()", 2500); alert("You are being redirected."); function redir () { window.location = "target.php"; }
type: UnansweredQuestion
tagged with: http-redirect
tagged with: alert
has answer: http://stackoverflow.com/a/24815806
has title: Is it possible to redirect in the middle of an alert box?
type: Question
has answer: http://stackoverflow.com/a/24815835
tagged with: javascript
has answer: http://stackoverflow.com/a/24815813
score: 0
answer count: 3

http://stackoverflow.com/comment/130469619
type: QuestionComment
has text: It's false because `msFullscreenElement` is probably not `null` but `undefined` – if somebody still sees this, use `!=` instead of `!==`.
comment on: http://stackoverflow.com/q/24827399
score: 0
type: Comment

http://stackoverflow.com/a/24842758
has body: If you are using tomcat then you can use default Servlet to serve the resources. web.xml: default /resources/* use c:url to access the resource related the context root. jsp: <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <link rel=stylesheet href="<c:url value='/resources/jquery-ui.css'/>" type="text/css" />
answers question: http://stackoverflow.com/q/24842237
has comment: http://stackoverflow.com/comment/38573384
accepted answer of: http://stackoverflow.com/q/24842237
type: AcceptedAnswer
score: 0
type: Answer

http://stackoverflow.com/q/24900380
has title: How to highlight clicked menu
score: 0
has comment: http://stackoverflow.com/comment/38682789
answer count: 1
tagged with: meteor
accepted answer: http://stackoverflow.com/a/24901518
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38683415
tagged with: css
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/24901518
has body: I am using following code to show vertical navigation. It can collapse and open, i like to change this when user click sub menu, parent menu keep opened and sub menu highlighted.So user know that which page he displaying. I am using Meteor JS and bootstrap 3, I googled it and i think i have to write some javaScript.But i have very little experience in javascript. Home Articles News Report About us Articles News Report Company Articles News Report fiddle
tagged with: javascript

http://stackoverflow.com/a/24799718
answers question: http://stackoverflow.com/q/24799658
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/38492540
downvote count: 0
type: Answer
has body: It returns something, and it's that simple, the docs just state Specifies the value to be returned by a function MDN Documentation function test() { return 'stuff'; } var variabel = test(); // returns "stuff" If a return value is not specified, all functions return undefined by default

http://stackoverflow.com/q/24903870
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has title: AngularJS Clicking on Add button should display a new popup page by hiding the parent page
upvote count: 0
has comment: http://stackoverflow.com/comment/38689646
type: Question
score: -2
tagged with: javascript
tagged with: jquery
downvote count: 2
has answer: http://stackoverflow.com/a/24904603
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I am working on a project which uses AngularJS/Breeze framework using HotTowel Template. I have a requirement where, in a parent.html page I have a button/link as "Add" and on click of this button, I need to display a popup page by hiding the parent page(i.e.parent.html). Add page will have input controls and Save button where user will enter the details in the respective control and on click of Save button data from input controls will be saved to the database table. I am new to this AngularJS style coding, please advise me or provide me a link on how I should implement the display a child popup page by hiding the parent page(i.e.parent.html) as explained above.

http://stackoverflow.com/a/24762604
has comment: http://stackoverflow.com/comment/38422028
score: 0
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/38422463
has comment: http://stackoverflow.com/comment/38422418
has body: It works if I do events[0].participants.push(new_participant); console.log(events); http://jsfiddle.net/9YU2t/ As it has been said in comments, your mistake should come from i variable. Check its initialisation and value when used to insert content into your object. EDIT : As the question has been updated. the variable i is the origin of the issue. Also, in a pure programmatical way, I suggest to do in that order new_event.participants.push(person_1); new_event.participants.push(person_2); .... events.push(new_event);
has comment: http://stackoverflow.com/comment/38422186
answers question: http://stackoverflow.com/q/24762348
has comment: http://stackoverflow.com/comment/38422107
downvote count: 1

http://stackoverflow.com/q/24770767
type: AnsweredQuestion
downvote count: 0
has title: Ember.js: View binding not working
type: Question
has answer: http://stackoverflow.com/a/24770823
upvote count: 2
answer count: 1
tagged with: javascript
tagged with: ember.js
has body: I have the following situation: controller.hbs: Filters {{view App.FilterView title="Company" activeMembersBinding="activeMembers"}} filter.hbs {{#each activeMembers}} {{this}} {{/each}} controller.js App.CompanyController = Ember.Controller.extend({ activeMembers: Embers.A(['a', 'b']) }); Upto this point, everything works fine, but when I try to add a new member in the controller's array, nothing updates in the view: controller.js App.CompanyController = Ember.Controller.extend({ activeMembers: Embers.A(['a', 'b']), actions:{ addMember: function(member){ var members = this.get('activeMembers'); members.push(member); this.set('activeMembers', member); } } });
favorite count: 0
has comment: http://stackoverflow.com/comment/38437538
accepted answer: http://stackoverflow.com/a/24770823
score: 2

http://stackoverflow.com/a/24866412
has comment: http://stackoverflow.com/comment/38619857
answers question: http://stackoverflow.com/q/24866244
has comment: http://stackoverflow.com/comment/38618824
has comment: http://stackoverflow.com/comment/38619211
has comment: http://stackoverflow.com/comment/38619308
score: 0
has comment: http://stackoverflow.com/comment/38619461
has comment: http://stackoverflow.com/comment/38619162
has body: You can do this like that: In your layout.html.twig define global js vars like this: &lt;script type="text/javascript"&gt; var routes = { myroutes:{ route1:"{{ path('my_symfony_route', {}, true) }}", // the true permits to use relative path route1:"{{ path('my_symfony_route2', {}, true) }}" }, }; &lt;/script&gt; Then in yourjsfile.js call global depending on your needs nextButtons.each(function () { $(this).on('click', function () { $("a").prop("href", routes.myroutes.route1); }); }); I hope this will help you!
type: Answer
has comment: http://stackoverflow.com/comment/38619302
has comment: http://stackoverflow.com/comment/38619075
has comment: http://stackoverflow.com/comment/38619690

titanium
tags question: http://stackoverflow.com/q/24757213
type: Tag
tag name: titanium

http://stackoverflow.com/q/24798322
has answer: http://stackoverflow.com/a/24799611
has comment: http://stackoverflow.com/comment/38537085
linked to: http://stackoverflow.com/q/588004
has comment: http://stackoverflow.com/comment/38489782
has comment: http://stackoverflow.com/comment/38491408
type: Question
has comment: http://stackoverflow.com/comment/38490293
answer count: 3
has comment: http://stackoverflow.com/comment/38498925
upvote count: 6
has comment: http://stackoverflow.com/comment/38491095
has comment: http://stackoverflow.com/comment/38536702
has comment: http://stackoverflow.com/comment/38491886
has comment: http://stackoverflow.com/comment/38536921
favorite count: 0
has comment: http://stackoverflow.com/comment/38491807
has comment: http://stackoverflow.com/comment/38514935
has comment: http://stackoverflow.com/comment/38533940
has answer: http://stackoverflow.com/a/24804778
has comment: http://stackoverflow.com/comment/38516525
has comment: http://stackoverflow.com/comment/38489955
tagged with: node.js
has comment: http://stackoverflow.com/comment/38491924
downvote count: 5
type: UnansweredQuestion
score: 1
has title: A safe way to divide two floating point numbers?
linked to: http://stackoverflow.com/q/1458633
has comment: http://stackoverflow.com/comment/38546078
tagged with: floating-point
has body: What is the safest way to divide two IEEE 754 floating point numbers? In my case the language is JavaScript, but I guess this isn't important. The goal is to avoid the normal floating point pitfalls. I've read that one could use a "correction factor" (cf) (e.g. 10 uplifted to some number, for instance 10^10) like so: (a * cf) / (b * cf) But I'm not sure this makes a difference in division? Incidentally, I've already looked at the other floating point posts on Stack Overflow and I've still not found a single post on how to divide two floating point numbers. If the answer is that there is no difference between the solutions for working around floating point issues when adding and when dividing, then just answer that please. Edit: I've been asked in the comments which pitfalls I'm referring to, so I thought I'd just add a quick note here as well for the people who don't read the comments: When adding 0.1 and 0.2, you would expect to get 0.3, but with floating point arithmetic you get 0.30000000000000004 (at least in JavaScript). This is just one example of a common pitfall. The above issue is discussed many times here on Stack Overflow, but I don't know what can happen when dividing and if it differs from the pitfalls found when adding or multiplying. It might be that that there is no risks, in which case that would be a perfectly good answer.
tagged with: ieee-754
has answer: http://stackoverflow.com/a/48439171
tagged with: math
has comment: http://stackoverflow.com/comment/38510677
tagged with: javascript

http://stackoverflow.com/q/24866367
type: UnansweredQuestion
score: 2
has answer: http://stackoverflow.com/a/25031275
has title: Cordova EmailComposer Plugin - callback function is not working
type: Question
downvote count: 0
tagged with: javascript
tagged with: phonegap-plugins
has body: Short description: I develop an Android app using Phonegap 3.5.0 (JavaScript, CSS3 and HTML5) on Windows. The main function of the application is to fill a form and send it by e-mail using smartphone's Gmail client. In detail, a user clicks the Send button in app's main view after the form is filled and he will be prompted to choose e-mail client options. He will pick Gmail and send the pre-composed e-mail. What do I need: I need to know when the email view has been dismissed to navigate the app to another view that will show that e-mail has been successfully sent (if it was). From now I will call it success page. What do I have: I use the Cordova EmailComposer Plugin and its callback option. It is described on the official GitHub page: https://github.com/katzer/cordova-plugin-email-composer The open method supports additional callback to get informed when the view has been dismissed. window.plugin.email.open(properties, function () { console.log('email view dismissed'); }, this); In my app I have this piece of code that triggers the e-mail view. window.plugin.email.open({ to: to, subject: subject, body: body }, function(){ $.mobile.changePage($("#emailSent"), "fade", true, true); //callback function to navigate to the "success" page after the e-mail view has been dismissed. }, this); The problem: The app returns to the same page from where the user pressed the Send button after an e-mail has been sent. There is no redirection to the "success" page. Main question: What am I implementing wrong?
tagged with: android
answer count: 1
favorite count: 0
tagged with: cordova
upvote count: 2

http://stackoverflow.com/q/24900760
upvote count: 0
downvote count: 5
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/24900998
score: -5
has body: If I have already defined a class A, how can I overwrite its definition and define a new class A? Or, can I remove the definition of an existing class? So, I can define it again.
has title: How to redefine a class in Javascript
has comment: http://stackoverflow.com/comment/38683589
has comment: http://stackoverflow.com/comment/38683563
has comment: http://stackoverflow.com/comment/38683712
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/38659276
type: Comment
has text: Yeah, I suspected something like that. Thanks for your support. :)
comment on: http://stackoverflow.com/a/24888039
score: 0
type: AnswerComment

http://stackoverflow.com/a/24876661
accepted answer of: http://stackoverflow.com/q/24876643
has comment: http://stackoverflow.com/comment/38639678
answers question: http://stackoverflow.com/q/24876643
upvote count: 3
has comment: http://stackoverflow.com/comment/38639408
has comment: http://stackoverflow.com/comment/38640360
has comment: http://stackoverflow.com/comment/38639482
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38640522
has comment: http://stackoverflow.com/comment/38639307
score: 3
has comment: http://stackoverflow.com/comment/38638985
has body: To stop bubbling, use event.stopPropagation(). Only use event.preventDefault() to prevent the default action of the event from happening. Ah, now I see your problem. The issue is that when clicking a menu item to open a submenu, since the item is an anchor pointing to #, the document will scroll to top. To avoid that, I suggest getting rid of href="#". Alternatively, you can use preventDefault only if the clicked element was that element, not a descendant: $('.menu-item-has-children').on('click', function(e){ if(this == e.target) e.stopPropagation(); // ... }); Demo
type: Answer
has comment: http://stackoverflow.com/comment/38639015

http://stackoverflow.com/q/24866307
favorite count: 0
tagged with: cross-domain
answer count: 0
downvote count: 0
has body: Having an ugly https url on a shared hosting, I've been trying go around the javascript cross-domain restrictions using a proxy iframe and the postMessage() method. Sending messages from the main page to the child seems to works perfectly at first . The problems arise when I try to answer. The source property of the MessageEvent is undefined, window.parent and window.top are also undefined. Therefore, I have no reference to the parent window and no way to send the result of the request. Any help to solve the issue would be appreciated! Edit: Parent: // Never gets triggered window.addEventListener("message", function(e) { console.log(e); }); var data = "some string"; document.getElementById("proxy_frame") .contentWindow.postMessage(data,"https://proxys-domain/"); Child: window.addEventListener("message", function(e) { // This appears in chrome/ie/firefox console correctly console.log(message); // This triggers : // Uncaught TypeError: Cannot read property 'postMessage' of undefined e.source.postMessage(event.currentTarget, e.origin); }
type: UnansweredQuestion
score: 1
tagged with: postmessage
has comment: http://stackoverflow.com/comment/38623418
has comment: http://stackoverflow.com/comment/38622718
has comment: http://stackoverflow.com/comment/38623881
has comment: http://stackoverflow.com/comment/38618296
has comment: http://stackoverflow.com/comment/38649204
has comment: http://stackoverflow.com/comment/38618989
has comment: http://stackoverflow.com/comment/38622934
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/38625526
tagged with: javascript
has title: Cross-Domain PostMessage communication: parent undefined

http://stackoverflow.com/a/24758431
answers question: http://stackoverflow.com/q/24758361
score: 0
type: Answer
has body: In this case what is the difference between context["test"] = 123; and context = { "test": 123}; The first sets a property of an object, the second replaces the object with a new one

http://stackoverflow.com/comment/38495679
comment on: http://stackoverflow.com/a/24800582
score: 0
has text: Let me explain in a better way. I have and app with 30 input fields. In each field i want a modal with the list of every possible values for that field. but that information comes from a different array with different keys (email,name,phone) for every field and I am trying to make a generic modal to every input field
type: AnswerComment
type: Comment

http://stackoverflow.com/a/24820070
score: 0
has body: You could use .mousmove() $('#priceSliderMin').mousemove(function (){ document.getElementById("range").innerHTML=this.value; //$("#range").html(newValue); }); See demo here
answers question: http://stackoverflow.com/q/24819768
has comment: http://stackoverflow.com/comment/51985294
type: Answer

http://stackoverflow.com/comment/38485013
comment on: http://stackoverflow.com/a/24795078
has text: What if I can't though? what if I already have that value in a variable? how can I escape it if it's a variable not a string?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38564826
comment on: http://stackoverflow.com/q/24838308
type: Comment
type: QuestionComment
has text: Yeah since it didnt work in the secound click method I tried another method still didn't work remember this is just test code not production and I posted the archor and form code
score: 0

http://stackoverflow.com/comment/38593591
score: 0
type: AnswerComment
has text: My bad. You should pull the declaration of `terms` outside this code sample so it can be found in other method calls.
type: Comment
comment on: http://stackoverflow.com/a/24849117

http://stackoverflow.com/q/24781078
has title: Making sprite movement smooth when it's move towards an object
tagged with: javascript
type: UnansweredQuestion
type: Question
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
score: 0
answer count: 2
upvote count: 1
tagged with: sprite
downvote count: 1
has answer: http://stackoverflow.com/a/24781231
has answer: http://stackoverflow.com/a/24782391
has comment: http://stackoverflow.com/comment/38457379
has body: I'm working on a fish sprite animation. Currently when I add a piece of food then the sprite animation will move forward to eat it. But I am not able to make it swim smoothly toward the food. Sometimes the sprite animation will move up and down till it reach the food. Here is how the sprite animation is moving towards the food: Fish.prototype.chaseFood = function(index) { if (this.xPos &gt; foodArray[index].x + foodWidth) { this.speedX = -1 * Math.abs(this.speedX); } else if (this.xPos &lt; foodArray[index].x) { this.speedX = Math.abs(this.speedX); } if (this.yPos &gt; foodArray[index].y + foodHeight) { this.speedY = -1 * Math.abs(this.speedY); } else if (this.yPos &lt; foodArray[index].y) { this.speedY = Math.abs(this.speedY); } }; Is there anyway to make it swim more smoothly towards the food and not moving up and down towards it.
tagged with: canvas

http://stackoverflow.com/comment/38665987
comment on: http://stackoverflow.com/a/24872323
has text: Hmm, I don't quite see what you are doing here. Can you provide more info?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/24909514
has comment: http://stackoverflow.com/comment/38700454
has comment: http://stackoverflow.com/comment/38701082
has comment: http://stackoverflow.com/comment/38699835
score: 0
type: Answer
has body: Hey i have gone through the jsfiddle and updated it please go through it.. $(document).ready(function() { $(".cars-container a[rel!='']").click(function() { var rel = $(this).attr("rel"); $(".cars-container a[data-lightbox='" + rel + "']:first").trigger('click'); }); }); click below jsfiddle link to see the working example:- http://jsfiddle.net/wHJ8E/3/
has comment: http://stackoverflow.com/comment/38701426
answers question: http://stackoverflow.com/q/24908605

http://stackoverflow.com/q/24832372
has answer: http://stackoverflow.com/a/25733814
has title: Use multiple layout in EmberJS
possible better answer: http://stackoverflow.com/a/26666653
tagged with: ember.js
accepted answer: http://stackoverflow.com/a/25733814
type: AnsweredQuestion
has body: I have a web application that needs to use different layout depending where it is. Basically, if I'm inside the page "Profile", I would like to use a specific app layout and a specific page layout. If I'm going to another page "Messages", I would like to use another app layout and another page layout. I need to combine them to render my page. Is there a way to do something like that? profile.js (view) export default Ember.View.extend({ appLayoutName: 'appLayoutType1', layoutName: 'pageLayoutType1', templateName: 'profile' }); messages.js (view) export default Ember.View.extend({ appLayoutName: 'appLayoutType2', layoutName: 'pageLayoutType2', templateName: 'messages' }); forums.js (view) export default Ember.View.extend({ appLayoutName: 'appLayoutType1', layoutName: 'pageLayoutType2', templateName: 'forums' }); Another detail, the route should not impact those changes. I shouldn't add a level in the route of my page to select the right layout. Thanks!
has comment: http://stackoverflow.com/comment/38618364
type: Question
upvote count: 4
answer count: 2
has comment: http://stackoverflow.com/comment/38641284
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/38562655
downvote count: 0
tagged with: ember-app-kit
has comment: http://stackoverflow.com/comment/38660040
has answer: http://stackoverflow.com/a/26666653
favorite count: 0

http://stackoverflow.com/comment/44190664
comment on: http://stackoverflow.com/a/25585778
has text: I'm glad my answer was helpful to quite a few people though I think it's worth pointing out the API has changed in the latest version. So unless you're using the older version, be aware the APIs might be different but the concepts are mostly the same.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38413849
type: Comment
comment on: http://stackoverflow.com/a/24757889
score: 2
type: AnswerComment
has text: No problem. I thought somebody should at least try to give you a decent answer

http://stackoverflow.com/q/24819944
possible better answer: http://stackoverflow.com/a/24827383
tagged with: sharepoint-2010
has answer: http://stackoverflow.com/a/24827383
has title: Javascript - Ajax Request in SharePoint - Avoid to overwrite variable
type: AnsweredQuestion
has body: Actually I have an issue with javascript. I find no solution for this problem yet. Maybe someone of you could give me a hint. I have a created a function, which is called by a button click.in SharePoint 2010. The function should collect all selected / checked documents from a document library and write them into a separate box, I created. To get all selected documents works fine. But in SharePoint I have to load each element individually for details with an asynchronous request. Here comes my problem: If I select more than one document, the variable "item" will be overwritten because of the "for" loop. In my asynchronous request success function, I use now the variable "item" again to get the details of it. So I always get the data of the last item of my selection. Is there a way to avoid this? Thanks for any help. Here is my code: function ApproveDocuments() { var ClientContext = SP.ClientContext.get_current(); var LibraryID = SP.ListOperation.Selection.getSelectedList(); var Library = ClientContext.get_web().get_lists().getById(LibraryID); //Gets the current Library var SelectedDocuments = SP.ListOperation.Selection.getSelectedItems(ClientContext); for (var currentItem in SelectedDocuments) { var item = Library.getItemById(SelectedDocuments[currentItem].id); ClientContext.load(item, 'FileLeafRef'); ClientContext.executeQueryAsync(Function.createDelegate(this, function () { var newElementHtml = '&lt;div style="float:left;padding:3px;width:50px;"&gt;&lt;/div&gt;'; newElementHtml += '&lt;div style="float:left;padding:3px;"&gt;' + item.get_item('FileLeafRef') + '&lt;/div&gt;'; newElementHtml += '&lt;div style="clear:both;"&gt;&lt;/div&gt;'; jQuery("#grol1855InfoDivData").append(newElementHtml); }), Function.createDelegate(this, this.onLoadItemFailure)); }}
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/24829460
tagged with: javascript
tagged with: sharepoint
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/24829460

http://stackoverflow.com/comment/132701418
type: AnswerComment
comment on: http://stackoverflow.com/a/24797425
score: 0
type: Comment
has text: isn't it supposed to be scrollHeight to get the percentage visible ?

http://stackoverflow.com/a/24776228
has comment: http://stackoverflow.com/comment/38448774
score: 0
has comment: http://stackoverflow.com/comment/38448267
has body: I've created a working JSFiddle for you here. Javascript var pictureList = [ ["images/img1.jpg","images/img2.jpg"], ["images/img3.jpg","images/img4.jpg", "images/img5.jpg"], ["images/img6.jpg"] ]; var elem = document.getElementById("animal"); elem.onchange = function(){ var slider = document.getElementById("slider"); slider.innerHTML = ""; var val = elem.options[elem.selectedIndex].value; for (var key in pictureList[val-1]){ var newItem = ' '; slider.innerHTML += newItem; } }; HTML Choose animal animal 1 animal 2 animal 3
answers question: http://stackoverflow.com/q/24775875
type: Answer
has comment: http://stackoverflow.com/comment/38448344

http://stackoverflow.com/a/24751415
has body: A better way is to use regular expressions: function validateInput(evt) { var pattern = /^[\s()+-]*([0-9][\s()+-]*){6,20}$/; var e = window.event || evt; if (pattern.match(e.keycode)) { document.getElementById('mno').value=""; document.getElementById('mno').style.backgoundColor="yellow"; return false; } document.getElementById('mno').style.backgoundColor="white"; return true; } EDIT: You asked for a better way. The better way is to attach keypress event to your text field and perform validation on the whole string instead of validating character by character.
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38401472
downvote count: 0
has comment: http://stackoverflow.com/comment/38402294
has comment: http://stackoverflow.com/comment/38402495
has comment: http://stackoverflow.com/comment/38401361
answers question: http://stackoverflow.com/q/24751058
type: Answer
has comment: http://stackoverflow.com/comment/38405672

http://stackoverflow.com/comment/42992886
type: Comment
has text: Thanks for the explanation. You should give back to the documentation. This is better than the official doc.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/25585778

http://stackoverflow.com/comment/38637461
score: 0
type: AnswerComment
has text: `$(document.getElementById("iframe2").contentWindow.document.getElementById("iframe2button")).click (function () { $("#iframe1").attr("src", url); });` Is what I have :)
comment on: http://stackoverflow.com/a/24873857
type: Comment

http://stackoverflow.com/a/24764435
downvote count: 0
answers question: http://stackoverflow.com/q/24764164
score: 1
has body: This is the solution I found but I'll leave it open to see if anybody else has an idea. What I'm doing is getting the offset of my header then moving the sidebar according to my headers offset left. I do this whenever the document loads or if the user resizes their screen. $(document).ready(function(){ var offset = $('#header').offset(); $('#sidebar').css('left', offset.left+'px'); }); $(window).resize(function(){ var offset = $('#header').offset(); $('#sidebar').css('left', offset.left+'px'); });
accepted answer of: http://stackoverflow.com/q/24764164
upvote count: 1
type: AcceptedAnswer
type: Answer

call
tags question: http://stackoverflow.com/q/24787838
tag name: call
type: Tag

http://stackoverflow.com/a/24793685
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/38546245
upvote count: 1
answers question: http://stackoverflow.com/q/24793563
downvote count: 0
has body: You could use jQuery to hide the element and then show it once something has been clicked. You would need to add styling to the click area, this is just example code of what you could do.

http://stackoverflow.com/q/24779878
type: UnansweredQuestion
tagged with: dojo
answer count: 0
has comment: http://stackoverflow.com/comment/38500782
type: Question
has comment: http://stackoverflow.com/comment/38500868
tagged with: mobile
tagged with: javascript
has comment: http://stackoverflow.com/comment/38502434
score: 0
tagged with: scrollable
has body: I'm developing an application using Dojo Mobile 1.8 and for some unknown reason Horizontal scroll is not working on several devices. On Nokia Lumia 620 scroll is not working at all. On two Nexus 5(4.4.2) devices scroll is working really bad, moving by 1-2 millimeters, regardless of how long or far you scroll. On Nexus 5(L) scroll if working perfectly. On Chrome emulator on Desktop, scroll is working perfectly, though sometimes buttons aren't clickable, but I guess that's because Emulator fails to send click/touch events properly. I've referred to official documentation, but found nothing about why scroll wouldn't work. In some forum, I've found that touch-action:none is causing the problem, but that's not the case either, because touch-action only has inherit and initial options. This is the code that's not working on some devices: My Location ... Full Map
has comment: http://stackoverflow.com/comment/38502831
has title: Horizontal scroll not working in several devices using dojo mobile

http://stackoverflow.com/a/24827021
score: 0
has comment: http://stackoverflow.com/comment/38544416
type: Answer
has body: Just guessing, but maybe the update is doing something wrong. Maybe you could try just updating the single edited item. Try this: Template.hello.events({ 'change .nameChanger': function(evt) { var $tgt = $(evt.target) var entity=Entities.findOne(Session.get('entityId')); var items = entity.items; var tgtName = $tgt.data('demoname'); var newName = $tgt.val(); var found=false; for(var i=0;i&lt;items.length;i++) { var item=items[i]; if(item.name == tgtName) { item.name =newName; found=true; break; } } if(!found) { alert("Cannot find ",tgtName); } else Entities.update({_id: entity._id}, {$set: { 'items.' + i.toString(): item}}); }, }); A bit clunky, but maybe...
answers question: http://stackoverflow.com/q/24826471

http://stackoverflow.com/comment/38655164
comment on: http://stackoverflow.com/q/24884935
has text: I'm not able to understand the exact problem you have. Are you setting all 75 properties at the same time, causing a certain computed property to be calculated 75 times in that very short timespan? If so, using a loop won't fix the problem; [Change observable but don't notify subscribers in knockout.js](http://stackoverflow.com/q/17983118/247702) might be of use.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24893387
has comment: http://stackoverflow.com/comment/38669825
has comment: http://stackoverflow.com/comment/38670628
type: Answer
has body: I have an idea. If you do console.log(Ci.nsIHttpChannel) you see it has a bunch of flags, see img at bottom. So I'm thinking test if it's the main load, meaning its not in a sub frame, but its the whole document of the tab by testing for flag of Ci.nsIHttpChannel.LOAD_INITIAL_DOCUMENT_URI. If its the whole document, its likely from a link, or url bar, or search bar. So try this: function listener(event) { var channel = event.subject.QueryInterface(Ci.nsIHttpChannel); var url = event.subject.URI.spec; if (channel.loadFlags &amp; Ci.nsIHttpChannel.LOAD_INITIAL_DOCUMENT_URI) { //the whole document of the tab is changing if (isToBeRedirected(url)) { // replace url } } } exports.main = function() { events.on("http-on-modify-request", listener); } My other idea, is if you want only url bar changes. Than add an event listener to change of the url bar value. And after change if user hits enter or clicks go, then it register the observer. Then after testing for Ci.nsIHttpChannel.LOAD_INITIAL_DOCUMENT_URI than unregister the observer.
downvote count: 0
has comment: http://stackoverflow.com/comment/38670397
score: 3
accepted answer of: http://stackoverflow.com/q/24886858
answers question: http://stackoverflow.com/q/24886858
upvote count: 3
has comment: http://stackoverflow.com/comment/38671828
has comment: http://stackoverflow.com/comment/38670064
type: AcceptedAnswer

http://stackoverflow.com/q/24832183
favorite count: 0
type: AnsweredQuestion
score: 3
upvote count: 3
accepted answer: http://stackoverflow.com/a/24832486
linked to: http://stackoverflow.com/q/280759
type: Question
tagged with: validation
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: regex
has title: JQuery validate - pattern rule is not working as well as custom regex method
has answer: http://stackoverflow.com/a/24832486
has body: I'm using JQuery Validate plugin to validate if an input contains any spaces or not (No spaces are allowed). I've tried pattern rule from the additional-methods.js file but it doesn't work at all: "fos_user_registration_form[plainPassword][first]": { required: true, minlength: 6, pattern: "/^\S*$/" }, And tried the solution here "fos_user_registration_form[plainPassword][first]": { required: true, minlength: 6, regex: "/^\S*$/" }, Bit still it doesn't fire at all when, for example, I type "this is test".

http://stackoverflow.com/a/24786749
accepted answer of: http://stackoverflow.com/q/24786235
upvote count: 1
has body: Generally I treat any module that has mutable global state like this to be a mistake. Instead, I'd opt for creating an object with these methods and having a way to pass in overrides. // CUSTOM MODULE EXAMPLE // ======================================== var DEFAULT_PREFIX = "Hello "; var DEFAULT_SUFFIX = "!"; var DEFAULT_METHOD = function() { return "world" + DEFAULT_SUFFIX; }; module.exports = function(options){ var method = options.method || DEFAULT_METHOD return { loadModule: function(){ console.log(myVar + method()); } }; }; module.exports.DEFAULT_SUFFIX = DEFAULT_SUFFIX; Then you can use this like this: // MAIN APP EXAMPLE // ======================================== var myCustomModule = require('customModule.js'); var loader = myCustomModule({ method: function() { return "viewer" + myCustomModule.DEFAULT_SUFFIX; } }); loader.loadModule();
score: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24786235

http://stackoverflow.com/comment/38520448
has text: There's no such HTML tag as `<text>`, nor anything like it. You could maybe use an iframe, or just fetch the extra content with AJAX.
type: Comment
comment on: http://stackoverflow.com/q/24814507
score: 4
type: QuestionComment

http://stackoverflow.com/q/24753470
has title: How to place an HTML element over another using CSS
has comment: http://stackoverflow.com/comment/38404997
downvote count: 1
possible better answer: http://stackoverflow.com/a/24754895
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24757485
upvote count: 3
has answer: http://stackoverflow.com/a/24753591
has answer: http://stackoverflow.com/a/24758616
type: Question
tagged with: javascript
tagged with: jquery
has body: I have a slider that I want to place an small icon over it using HTML and CSS, but both are position absolute and the slider is hiding the icon. The CSS code for the icon is this: #nav { position:absolute; left: 49%; top: 89%; } Note that when I remove the slider from the javascript file, it shows the icon as I want but the sliders stop, so how can the icon get placed over the slider
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/24753591
tagged with: css
answer count: 4
favorite count: 0
score: 2
has answer: http://stackoverflow.com/a/24754895

http://stackoverflow.com/q/24784080
possible better answer: http://stackoverflow.com/a/24784730
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/24784481
type: AnsweredQuestion
upvote count: 1
has title: Animation repeats after keyup event
has body: I made a svg, css animation and added some jquery keyboard events. Everytime when I hit the key the animation starts again and again. Is there any way to only play the animation once the page is loaded? also the swipe event doesn't work anymore (i tested it with an image before) jquery: $(document).ready(function(){ $(document).keyup(function(e) { if (e.keyCode === 40) { $(".arrow_down").animate({ top:"+=20px", opacity:"0" }); $(".button").animate({ opacity:"1" }); } if (e.keyCode === 37) { $(".arrow_down").effect("bounce",{times:3}, 500 ); } if (e.keyCode === 39) { $(".arrow_down").effect("bounce",{times:3}, 500 ); } if (e.keyCode === 38) { $(".arrow_down").effect("bounce",{times:3}, 500 ); } }); $(".arrow_down").swipe({ swipeDown:function(){ $(".arrow_down svg").animate({top:"+=5%", opacity:"0"}); $(".button").animate({opacity:"1"}); } }); }); fiddle: http://jsfiddle.net/9KwLW/
type: Question
has answer: http://stackoverflow.com/a/24784730
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24784481

http://stackoverflow.com/q/24901198
has body: i am creating table and populate it into two divs, first div is in small size and second one for large view , other graphs works fine but element not working, its populate the last div. as you can see the code and sample here. $("#sample").empty() $("#fulls").empty() var table = document.createElement('table'); table.className="report"; var first = table.insertRow(0); first.className= "headerTable"; var h1 = first.insertCell(0); var h2 = first.insertCell(1); var h3 = first.insertCell(2); var h4 = first.insertCell(3); var h5 = first.insertCell(4); h1.className= "headerTable"; h2.className= "headerTable"; h3.className= "headerTable"; h4.className= "headerTable"; h5.className= "headerTable"; h1.innerHTML = ("Speed"); h2.innerHTML = ("RPM"); h3.innerHTML =("Acc"); h4.innerHTML = ("Brake"); h5.innerHTML =("Dated"); for (var i = 0;i&lt;5;i++) { var first = table.insertRow((i+1)); first.className= "tableRow"; var h1 = first.insertCell(0); var h2 = first.insertCell(1); var h3 = first.insertCell(2); var h4 = first.insertCell(3); var h5 = first.insertCell(4); h1.innerHTML = i; h2.innerHTML = i; h3.innerHTML = i; h4.innerHTML = i; h5.innerHTML= new Date(); } $("#fulls").html(table); $("#sample").html(table); and i tried with javascript but same result document.getElementById("fulls").innerHTML = table; document.getElementById("sample").innerHTML = table;
score: 1
has answer: http://stackoverflow.com/a/24901259
accepted answer: http://stackoverflow.com/a/24901250
type: Question
has title: insert Element into two Div
tagged with: javascript
has answer: http://stackoverflow.com/a/24901250
answer count: 3
upvote count: 1
possible better answer: http://stackoverflow.com/a/24901260
tagged with: jquery
has answer: http://stackoverflow.com/a/24901260
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/38471260
type: QuestionComment
score: 1
has text: I feel that you are asking an opinion based question, which means it should be flagged and closed, BUT as a note: Either follow company conventions or a format that you easily understand. `getValue` is easy enough, unless you want to overload `value` such that it will get if there is not an arg to set...
comment on: http://stackoverflow.com/q/24788284
type: Comment

http://stackoverflow.com/q/24760214
tagged with: angular-resource
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24760310
has body: I am new to AngularJS and working with $resource. I am writing out log statements to my console and am confused because I see multiple entries. My HTML looks like this: {{brand}} {{myData.brand}} delete And my js looks like this: var app = angular.module('myApp', ['ngResource', 'myAppControllers', 'myAppServices']); var services = angular .module('myAppServices', []) .factory('api', function ($resource) { return $resource('/api/Brand/:id', { id: '@id' } ); }); var controllers = angular .module('myAppControllers', []) .controller('ctrl1', [ '$scope', 'api', function ($scope, api) { $scope.myData = { brandList: [], brand: {}, }; $scope.setBrandList = function () { console.log("setBrandList"); api.query().$promise.then(function (response) { console.log("setBrandList - success"); $scope.myData.brandList = response; }, function (errResponse) { console.log("setBrandList - error"); }); }; $scope.setBrand = function () { console.log("setBrand"); api.get({ id: "minolta" }).$promise.then(function (response) { console.log("setBrand - success"); $scope.myData.brand = response; }, function (errResponse) { console.log("setBrand - error"); }); }; $scope.deleteBrand = function (id) { console.log("deleteBrand (" + id + ")"); api.delete({ id: id }).$promise.then(function (response) { console.log("deleteBrand - success"); $scope.setBrandList(); }, function (errResponse) { console.log("deleteBrand - error"); }); }; $scope.setBrand(); $scope.setBrandList(); } ]); When I am running this simple example, I see three calls / responses to setBrand and setBrandList. (See attached image) Am I simply misunderstanding something? Or am I defining something improperly? My belief would be that setBrand and setBrandList would only be called once each. Thanks in advance.
type: Question
tagged with: javascript
has title: AngularJS - Using $resource -- Why are there so many entries in my console log?
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/24760310
tagged with: angularjs

http://stackoverflow.com/comment/38777394
type: AnswerComment
score: 0
type: Comment
has text: @blazs: V8 itself uses stdlib.
comment on: http://stackoverflow.com/a/24907655

http://stackoverflow.com/comment/39022609
has text: Sorry for the delay in accepting this. I checked for a couple of days and had given up any help on this. Thank you for the explanation
type: AnswerComment
comment on: http://stackoverflow.com/a/24902575
score: 0
type: Comment

http://stackoverflow.com/a/24770929
answers question: http://stackoverflow.com/q/24770887
type: Answer
has body: Iterate over the values in the array, and remove the value with key YYY: var obj = [ { XXX: "2", YYY: "3", ZZZ: "4" }, { XXX: "5", YYY: "6", ZZZ: "7" }, { XXX: "1", YYY: "2", ZZZ: "3" } ]; for (var i = 0; i &lt; obj.length; i++) { delete obj[i].YYY }
has comment: http://stackoverflow.com/comment/38438108
score: 9
downvote count: 0
upvote count: 9

http://stackoverflow.com/comment/38589664
comment on: http://stackoverflow.com/a/24851060
type: AnswerComment
score: 0
type: Comment
has text: While this clearly works in your example, it only manages to scroll faster rather than pause for me. I will continue to play with it. Thanks for the help.

http://stackoverflow.com/comment/38653845
score: 0
type: Comment
type: QuestionComment
has text: do you mean injecting css stylesheet as string using javascript?
comment on: http://stackoverflow.com/q/24885300

http://stackoverflow.com/comment/38663394
score: 0
has text: Interesting, that worked. Weird that it worked fine in every other browser. Thanks!
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24890112

http://stackoverflow.com/q/24800490
has answer: http://stackoverflow.com/a/24800591
tagged with: jquery
tagged with: ajax
type: UnansweredQuestion
has body: I work with Telerik and when I submit changes from my grid I want to check some data with an AJAX call and then, if the data is OK continue the submit. I don't really know how the data is submitted but I get it works like a classic form. Is-it possible to "pause" and "restart" the post ? function onSubmit(e) { // Pause Submit $.ajax( { url: '/MyController/MyAction/', type: 'POST', dataType: 'json', async: false, success: function (check) { if(check) { // Allow Submit } else { alert('error'); // Stop Submit } } }); }
type: Question
has title: Pause then allow or not a post with JQuery
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/comment/39181777
comment on: http://stackoverflow.com/a/25144527
type: Comment
score: 0
type: AnswerComment
has text: of course, you'd have to have a property called hasInstance- that's my variable i'm testing. My controller makes a hasInstance = true on init. Here, i make sure it does what I want it to.

http://stackoverflow.com/comment/38645757
type: QuestionComment
score: 1
has text: What is the count? where you define that?
comment on: http://stackoverflow.com/q/24880673
type: Comment

http://stackoverflow.com/q/24787805
answer count: 0
has comment: http://stackoverflow.com/comment/38471679
tagged with: scroll
type: Question
has comment: http://stackoverflow.com/comment/38470032
tagged with: javascript
has body: I have the following script to scroll a div up and down. I wanted to know if there is a way it can be amended to now go left and right. I did what seemed obvious, which was to change the ele.scrollTop to ele.scrollRight. What would be the correct amendment to the script? JS Fiddle: http://jsfiddle.net/swQ7J/5/ Original (Top/Bottom) Script: &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(function() { var ele = $('#scroll'); var speed = 25, scroll = 5, scrolling; $('#scroll-up').click(function() { // Scroll the element up scrolling = window.setInterval(function() { ele.scrollTop( ele.scrollTop() - scroll ); }, speed); }); $('#scroll-down').click(function() { // Scroll the element down scrolling = window.setInterval(function() { ele.scrollTop( ele.scrollTop() + scroll ); }, speed); }); $('#scroll-up, #scroll-down').bind({ click: function(e) { // Prevent the default click action e.preventDefault(); }, mouseleave: function() { if (scrolling) { window.clearInterval(scrolling); scrolling = false; } } }); }); &lt;/script&gt;
has comment: http://stackoverflow.com/comment/38470911
score: 0
has comment: http://stackoverflow.com/comment/38470587
has title: Scroll Div Left and Right on click with JS
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38471322

http://stackoverflow.com/comment/38577955
type: QuestionComment
has text: "I have the html/css for a full row" ... can you please post that so that we have something to work with?
comment on: http://stackoverflow.com/q/24845339
score: 1
type: Comment

http://stackoverflow.com/comment/38602428
score: 0
type: Comment
type: QuestionComment
has text: instead of jQuery("#header").height(150); try something like jQuery("#header").css('height','150px');
comment on: http://stackoverflow.com/q/24857872

http://stackoverflow.com/comment/38437530
has text: Could you update your question with a longer description / code examples of what you're trying to accomplish? At the moment your question is very vague and makes it very hard to give an answer. Especially useful if you could provide a real world example.
type: Comment
comment on: http://stackoverflow.com/q/24763863
score: 0
type: QuestionComment

http://stackoverflow.com/a/24812278
downvote count: 1
type: Answer
has body: You could define a handlebars helper as follows: Handlebars.registerHelper("getStudentValue", function(val) { if(val === undefined) { return "null"; } return val; }); And the corresponding markup would look like: {{#each students}} {{getStudentValue this.name }} {{getStudentValue this.mark }} {{getStudentValue this.subject }} {{getStudentValue this.school }} {{getStudentValue this.birthday }} {{/each}}
score: 2
accepted answer of: http://stackoverflow.com/q/24812047
upvote count: 3
answers question: http://stackoverflow.com/q/24812047
type: AcceptedAnswer

http://stackoverflow.com/comment/38622702
comment on: http://stackoverflow.com/a/24868397
type: Comment
score: 1
has text: Here the [example](http://www.programming-free.com/2012/09/ajax-with-servlets-using-jquery-and-json.html) and [this](http://www.mysamplecode.com/2011/12/jquery-autocomplete-ajax-json-example.html).
type: AnswerComment

http://stackoverflow.com/comment/38491352
type: Comment
has text: what I need is not covered by the other 2 div, but the extra space, it covers
comment on: http://stackoverflow.com/a/24799033
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38618879
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24829109
has text: @RyanB Check the generated HTML. Does the button has an attribute `disabled="disabled"`? If so, its a css thing.

http://stackoverflow.com/a/24759007
type: AcceptedAnswer
has body: It seems ng-true-value does not accept non-constant expressions. From the docs(v1.3.0): Some attributes used in conjunction with ngModel (such as ngTrueValue or ngFalseValue) will only accept constant expressions. Examples using constant expressions include: &lt;input type="checkbox" ng-model="..." ng-true-value="'truthyValue'"&gt; &lt;input type="checkbox" ng-model="..." ng-false-value="0"&gt; Examples of non-constant expressions include: &lt;input type="checkbox" ng-model="..." ng-true-value="someValue"&gt; &lt;input type="checkbox" ng-model="..." ng-false-value="{foo: someScopeValue}"&gt; An ideal workaround probably would be calling a Controller method on ng-click or ng-change inside which you can analyse all the checkboxes for truthy or non-truthy values.
downvote count: 0
type: Answer
upvote count: 17
has comment: http://stackoverflow.com/comment/38415516
answers question: http://stackoverflow.com/q/24758681
score: 17
accepted answer of: http://stackoverflow.com/q/24758681

http://stackoverflow.com/comment/38727064
type: Comment
comment on: http://stackoverflow.com/a/24907500
score: 0
type: AnswerComment
has text: it means i just have to put all the fields input of the first two tabs into the "data:" part?

http://stackoverflow.com/q/24843827
type: Question
tagged with: javascript
score: 4
accepted answer: http://stackoverflow.com/a/24843969
upvote count: 4
answer count: 1
downvote count: 0
favorite count: 0
has title: How do I put attribution text on background images in reveal.js?
has body: I'm looking at using reveal.js http://lab.hakim.se/reveal-js/ for a series of lectures. I'd like to be able to put attribution text somewhere inconspicuous (bottom right) for any background images on slides. These are set using &lt;section background-data="url(...)"&gt; in the &lt;slides&gt; part of the 'source' HTML. I don't know enough JS / CSS to delve deeply into the reveal.js source code, but it seems like it shouldn't be too hard to do this. I've tried putting a full slide clear image as content in slides and then putting content on top of that, but it seems clunky (extra content that isn't really content) and also it doesn't associate the attribution with the element it really belongs to (the background-data image). Has anybody figured this out previously?
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: reveal.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24843969

http://stackoverflow.com/comment/38644983
type: Comment
has text: well yeah.. i dont have a slightest clue about the second statement :P
comment on: http://stackoverflow.com/a/24879692
score: 0
type: AnswerComment

http://stackoverflow.com/q/24885887
answer count: 2
possible better answer: http://stackoverflow.com/a/24887955
favorite count: 0
has body: I'm using Polymer for my web-app and I'm currently having some issues with page linking. It's the first site I'm making using all ajax/javascript, thus I haven't used the history functions of javascript a lot yet. Anyhow, I have a main menu in the left sidebar. When one of those is pressed, it should change the url of the browser and also put it in the history of the browser. To do so I have the following code: Polymer('my-app', { mainMenu: function(){ this.$.mainPages.selected = this.$.mainMenu.selected; console.log("Pusing state " + this.$.mainMenu.selected); history.pushState(null , "title", this.$.mainMenu.selected); } }); Now the problem is that it gets called twice, so if you click once the pushState is called twice. Needless to say this is not good. I have made a sample code here: click me. In this sample code you can see after pressing a couple of menu-items, first of all the event gets fired two times. I've also noticed when pressing the back-button, updating the page seems to also refire the pushState. So in short, my first concern is that the event of pressing an element from the core-menu, the mainMenu function is called twice. Second concern is that I am repushing states when going back, which I presume should be prevented as well. Updated code: Polymer('my-app', { ready: function(){ var link = document.URL.split("/"); this.$.mainMenu.selected = link[link.length-1]; console.log("ready with link: "+link[link.length-1]); window.onpopstate = function(){ var link = document.URL.split("/"); console.log("Calling onpopstate. New link is: "+link[link.length-1]); this.$.mainMenu.selected = link[link.length-1]; this.$.mainPages.selected = this.$.mainMenu.selected; } }, nav: function(){ this.$.drawerPanel.togglePanel(); }, back: function(){ window.history.back(); }, mainMenu: function(){ console.log("Pusing state " + this.$.mainMenu.selected); this.$.mainPages.selected = this.$.mainMenu.selected; history.pushState(null , "title", this.$.mainMenu.selected); } }
accepted answer: http://stackoverflow.com/a/24918765
has title: Polymer core-menu double event
score: 2
downvote count: 0
has answer: http://stackoverflow.com/a/24918765
has answer: http://stackoverflow.com/a/24887955
type: AnsweredQuestion
tagged with: polymer
tagged with: javascript
tagged with: browser-history
type: Question
upvote count: 2

http://stackoverflow.com/a/24759274
type: Answer
answers question: http://stackoverflow.com/q/24758297
has body: I agree with the comments above that the web service should not be sensitive to the trailing slash in url. But if you really want to turn off the auto stripTrailingSlashes behaviour, you can pass the option like this: this.folder = function(folderKey) { var methods = resource(url, null, { 'create': { method: 'PUT', url: config.domain + folderPath + '\\/' } }, { stripTrailingSlashes: false }); return methods; }; Edit: this feature is available since angular v1.3.0-beta.6 which is still in an unstable state.
has comment: http://stackoverflow.com/comment/38415780
has comment: http://stackoverflow.com/comment/38415970
has comment: http://stackoverflow.com/comment/38418127
score: 0
has comment: http://stackoverflow.com/comment/38415917
has comment: http://stackoverflow.com/comment/38415857

http://stackoverflow.com/comment/38521285
comment on: http://stackoverflow.com/q/24813530
has text: I think you mixed up non-capturing groups and [lookahead/lookbehind](http://www.regular-expressions.info/lookaround.html) (the latter is [not supported in JS](http://stackoverflow.com/questions/3569104/positive-look-behind-in-javascript-regular-expression))
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24909023
has body: This is an unwinnable fight - mostly because there are browser plugins like Greasemonkey which are created exactly for the purpose of changing scripts that are executed on the page. Since JavaScript runs on the client, there is nothing you can do to prevent the chance of the user modifying it, skipping some functions etc. Always revalidate the data and any calculations on the server.
has comment: http://stackoverflow.com/comment/38735453
has comment: http://stackoverflow.com/comment/38699689
has comment: http://stackoverflow.com/comment/38699242
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24908973
answers question: http://stackoverflow.com/q/24908973
has comment: http://stackoverflow.com/comment/38698765
has comment: http://stackoverflow.com/comment/38699445
type: Answer
has comment: http://stackoverflow.com/comment/38699311
score: 2
downvote count: 0

http://stackoverflow.com/comment/38511386
comment on: http://stackoverflow.com/q/24809885
score: 0
type: Comment
type: QuestionComment
has text: The image your using for `.class3` is broken. Do you want to use images or background colors?

http://stackoverflow.com/q/24904503
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has title: How to debug phonegap windows phone 8.1
has answer: http://stackoverflow.com/a/24909785
tagged with: weinre
tagged with: cordova
upvote count: 3
accepted answer: http://stackoverflow.com/a/24909785
has body: I'm new to windows phone development and found that I don't know how to debug a cordova/phonegap app with windows phone emulator. I found out that using weinre (from here) it's possible to debug app, but still haven't found how to connect it with emulator (Using &lt;script src="http://127.0.0.1:8080/client/#anonymus"&gt;&lt;/script&gt; in index.html have not worked) So, I have 2 possible answers to 2 possible questions: 1) How can I debug my cordova/phonegap app for windows phone? 2) If using weinre, how can I make it work so I can debug my app?
type: AnsweredQuestion
score: 3
tagged with: windows-phone-8
type: Question
tagged with: debugging

http://stackoverflow.com/q/24810558
type: Question
has body: My firefox addon uses widget and when I click on it it shows panel. Following is the code for it var Widget = require("widget").Widget; var tabs = require('tabs'); var data = require("sdk/self").data; var panel = require("sdk/panel").Panel({ contentURL: "about:blank", width: 200, height: 480, onHide: function(){ panel.contentURL = data.url("loading.html") } }); exports.main = function() { // Widget documentation: https://addons.mozilla.org/en-US/developers/docs/sdk/latest/modules/sdk/widget.html var widget = new Widget({ id: "MobileView-widget-1", label: "MobileView", tooltip : "Start Mobile View", panel: panel, onClick: function() { panel.contentURL = "https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/tabs#activeTab"; }, contentURL: data.url("mobile.png") }); }; When I click on the widget, it shows the panel above it but when the focus is out, it immediately closes and starts afresh again. How do I make sure, it wont close on loosing focus but I need to click on the widget again to hide it.
tagged with: firefox-addon
score: 1
upvote count: 1
answer count: 1
has title: show Widget in firefox
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24810988
tagged with: firefox
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/24873248
answer count: 1
has answer: http://stackoverflow.com/a/24873294
score: -8
has comment: http://stackoverflow.com/comment/38631818
upvote count: 0
linked to: http://stackoverflow.com/q/1527803
has title: JavaScript randomly choosing 0 or 1
tagged with: javascript
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/1527803
type: Question
downvote count: 8
has body: I am trying to write a couple of statements that chooses either 0 or 1 and I want 0 and 1 to have the equal possibilities I did this chosendirection = Math.floor(Math.random()*2); but the above does not choose 0. It chooses 1 only. Thanks!
favorite count: 0
has comment: http://stackoverflow.com/comment/38631799

http://stackoverflow.com/comment/38620291
type: Comment
score: 0
has text: `title.items.forEach(function() { ...`
type: QuestionComment
comment on: http://stackoverflow.com/q/24867375

http://stackoverflow.com/comment/38523949
type: AnswerComment
has text: Hi Colin! yeah you're right. However, if I wanted to add a feature in my web that will edit my variables in less, will it be updated? even though the build and save is only done in Visual Studio?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24757008

http://stackoverflow.com/a/24872129
accepted answer of: http://stackoverflow.com/q/24867482
type: AcceptedAnswer
has body: It sounds like you haven't installed bower, and as a result of that not installed bootstrap through bower. Install Bower $ npm install -g bower Install bootstrap via bower $ bower install bootstrap You can read more about it their website. And also search for bower packages here. Since you're using angular you might wanna download angular-bootstrap as well. UPDATE What bower provides is a package manager for client-side modules. Similar to npm, with the difference that npm also provides backend-/nodejs-modules. If you're using mean.io your project will be prepared with a file called bower.json and another one called package.json which specifies the dependencies in your project. To install these, start off by getting your node.js dependencies: $ npm install If you want bower to be installed globally, use: $ npm install -g bower Then install your bower dependencies $ bower install And now you should be good to go. You can also add bower manually or if you want to create your mean project from scratch Install Bower $ npm install -g bower Install bootstrap via bower $ bower install bootstrap Save your dependencies If you want to create bower.json to save your dependencies: $ bower init and follow the instructions provided in the console. Now when you install new bower packages you use --save and bower will add the dependency to your bower.json. $ bower install bootstrap --save
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/38643372
score: 10
upvote count: 10
answers question: http://stackoverflow.com/q/24867482

http://stackoverflow.com/comment/38522457
comment on: http://stackoverflow.com/a/24815613
has text: You're welcome :-). I assumed a one-line solution was better than adding classes to each of your images.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/24843865
linked to: http://stackoverflow.com/q/7895560
tagged with: dom
type: Question
has answer: http://stackoverflow.com/a/24843948
has title: Adding custom ( your own ) properties to DOM objects, OK?
answer count: 1
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/3363463
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38575416
favorite count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: properties
tagged with: object
has body: &lt;div id="theDiv"&gt;&lt;/div&gt; document.getElementByid('theDiv').myProperty='myValue'; if('undefined'!==typeof document.getElementById('theDiv').myProperty){ Is it ok and cross browser compatible to give DOM objects custom properties to be used later on? If the properties only need to be set and retrieved via javascript can this be used instead of setAttribute / getAttribute?
has comment: http://stackoverflow.com/comment/38625056
score: 1

event-handling
tag name: event-handling
tags question: http://stackoverflow.com/q/24783269
tags question: http://stackoverflow.com/q/24862187
type: Tag
tags question: http://stackoverflow.com/q/24755799
tags question: http://stackoverflow.com/q/24779124
tags question: http://stackoverflow.com/q/24865563

http://stackoverflow.com/comment/38529063
comment on: http://stackoverflow.com/a/24819191
has text: @Er. Sajal Tiwari can you please explain it what i did wrong.?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38641523
type: AnswerComment
type: Comment
has text: Thanks very much for the help .. I have gone down the route of a wrapper.
comment on: http://stackoverflow.com/a/24839853
score: 0

http://stackoverflow.com/q/24861078
tagged with: dialog
has body: I am using this angular dialog service https://github.com/m-e-conroy/angular-dialog-service which looks better than javascript alert(). I am using the notify dialog. An example (with source code) which I forked from the original can be found below; http://codepen.io/anon/pen/Abizv When you click on the Notify Dialog button, the dialog appears. What I want to do is to press enter key to close the dialog. However, this cannot be done. I have to press Esc key to press the dialog. How can the code be changed to close the dialog by pressing Enter?
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/24905855
score: 0
has title: How to press enter to close this AngularJS dialog notify box?
accepted answer: http://stackoverflow.com/a/24905855
has comment: http://stackoverflow.com/comment/38609242
tagged with: angularjs
type: AnsweredQuestion

http://stackoverflow.com/q/24871254
tagged with: google-analytics
upvote count: 5
has answer: http://stackoverflow.com/a/24876629
type: Question
score: 5
has body: The setup I have implemented an "onclick" method which calls a bit of third party code asynchronously. It provides a callback, and they suggest using a simple function that sets document.location = href to make sure the page only changes after their method has returned. This works fine if you want to open the link in the same tab, but if you want to open in a new tab then one of two things happens: The problems If you middle-clicked, Ctrl+click, Shift+click, or Cmd+click it opens in the same tab after having executed the callback function. If you right-click and select 'Open in new tab' then the onclick code is not called at all. The questions Is it possible to have the callback function return true to the onclick event (in effect, making the entire chain of events synchronous)? Or, can you think of a way to preserve standard browser behavior in Case 1 above? The code https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce: Product Link
has title: How do I honor Open in new tab requests when onclick event executes asynchronous code?
downvote count: 0
tagged with: javascript
tagged with: callback
accepted answer: http://stackoverflow.com/a/24876629
answer count: 1
tagged with: asynchronous
favorite count: 0
type: AnsweredQuestion

http://stackoverflow.com/q/24850351
upvote count: 1
has answer: http://stackoverflow.com/a/24850385
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/38587801
accepted answer: http://stackoverflow.com/a/24850385
answer count: 1
has title: javascript hotkey for button?
has comment: http://stackoverflow.com/comment/38587701
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38588084
has comment: http://stackoverflow.com/comment/38587840
has comment: http://stackoverflow.com/comment/38587643
score: -2
has body: I have searching for a time now but I did not find proper solution. What I am doing: I have two keys post bill and post and print. What I want to do: When I press F7 then post bill(button) should be pressed and when F8 then post and print(button) should be pressed. I have seen accesskey function but it need Alt+key for it and it does not work with F8 and it also have some oprationg system problem(different keys in every oprating system). Is there any JavaScript or jquery function to achive this task. Any advice will be very helpful.
downvote count: 3

http://stackoverflow.com/q/24788216
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38470992
has comment: http://stackoverflow.com/comment/38473950
has comment: http://stackoverflow.com/comment/38474598
answer count: 0
has comment: http://stackoverflow.com/comment/38472231
has title: How to stop autoscroll bottom when scroll top?
type: Question
has comment: http://stackoverflow.com/comment/38474943
has comment: http://stackoverflow.com/comment/38473343
has comment: http://stackoverflow.com/comment/38475614
has comment: http://stackoverflow.com/comment/38475127
tagged with: javascript
tagged with: jquery
has body: I have a problem because I do not understand how I can stop the auto-scroll vertically to bottom. In practice, I would like to lock it while click the scroll bar above to start it and when I'm completely bottom. This is the code jQuery: $(function() { startRefresh(); }); function startRefresh() { start = setTimeout(startRefresh, 1000); $.post('data.php', function(data) { $('.view').html(data); }); scroll(); } function scroll() { $('.view').animate({ scrollTop: $('.view')[0].scrollHeight }, 1500); } scroll(); HTML &lt;div class="view"&gt;&lt;/div&gt;
score: 0
has comment: http://stackoverflow.com/comment/38475009
has comment: http://stackoverflow.com/comment/38498948
has comment: http://stackoverflow.com/comment/38474846
has comment: http://stackoverflow.com/comment/38472837
has comment: http://stackoverflow.com/comment/38473575

http://stackoverflow.com/q/24826568
has title: How to auto adjust text field width
downvote count: 4
favorite count: 0
upvote count: 0
has comment: http://stackoverflow.com/comment/38542891
score: -4
has answer: http://stackoverflow.com/a/24827271
accepted answer: http://stackoverflow.com/a/24827271
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38542765
has comment: http://stackoverflow.com/comment/38542785
type: Question
has body: I'm trying to expand I just can't make it work... any solution? http://jsfiddle.net/ZeL6P/sample here http://jsfiddle.net/9uv2q/ another sample too...
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/38617017
type: Comment
comment on: http://stackoverflow.com/a/24810224
has text: I would love to use this solution but it seems it doesn't work in my case: `{{response = ( currentThing.data.response[0] ) }}` throws "Syntax error, unrecognized expression"
score: 0
type: AnswerComment

http://stackoverflow.com/a/24890056
has comment: http://stackoverflow.com/comment/45196200
upvote count: 5
has comment: http://stackoverflow.com/comment/45072140
has comment: http://stackoverflow.com/comment/38676497
has body: The BLE implementation for the Mac is not complete yet as far as I know. A good place to follow the development of the API is on the Chrome issue tracker. This is a link to the issue related to the Mac one specifically. To see all the bluetooth changes, just search for bluetooth under open issues.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24880860
score: 5
has comment: http://stackoverflow.com/comment/38678775
type: Answer
answers question: http://stackoverflow.com/q/24880860

http://stackoverflow.com/comment/38658369
has text: Sorry, forgot to include the code. Don't come on here all too often to ask questions. I'm using Maxthon. The code also completely erases everything. My guess is it's because it's nested in another child element of the body tag.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24887545
type: QuestionComment

webbrowser-control
type: Tag
tags question: http://stackoverflow.com/q/24900482
tags question: http://stackoverflow.com/q/24857217
tag name: webbrowser-control
tags question: http://stackoverflow.com/q/24888187
tags question: http://stackoverflow.com/q/24905602

http://stackoverflow.com/q/24906644
type: UnansweredQuestion
tagged with: angular-promise
upvote count: 1
has comment: http://stackoverflow.com/comment/38695052
has comment: http://stackoverflow.com/comment/38707120
has comment: http://stackoverflow.com/comment/38707556
has comment: http://stackoverflow.com/comment/38707196
tagged with: unit-testing
type: Question
has answer: http://stackoverflow.com/a/24907445
answer count: 1
downvote count: 0
tagged with: javascript
has body: I tried to mocking angular promises but I got some errors like undefined is not a function evaluating 'spyOn' fileUploadService My controller code is $scope.getUserFiles = function() { fileUploadService.retrieveUserFileNames('') .then(function(data) { $scope.userFiles = data; }); }; service code, I call this method from my controller this.retrieveUserFileNames= function(userId) { var deferred = $q.defer(); $http({ method : "GET", url : "/retrieveExcelSheetNames", params : { "userId" : userId } }).success(function(data) { deferred.resolve(data); }).error(function(data, status) { deferred.reject(data); }); return deferred.promise; }; test controller code beforeEach(function() { inject(function(_fileUploadService_ , _$q_) { spyOn(scope, '$on'); var deferred = _$q_.defer(); fileUploadService = _fileUploadService_; deferred.resolve('resolveData'); spyOn(fileUploadService, 'retrieveUserFileNames').andReturn(deferred.promise); }); }); it('is now a lot easier', function() { scope.getUserFiles(); rootScope.$apply(); expect(scope.userFiles).toBe('resolveData'); }); Thanks
score: 1
linked to: http://stackoverflow.com/q/20555234
has comment: http://stackoverflow.com/comment/38699182
favorite count: 0
tagged with: promise
has title: Mock promises in angularjs
tagged with: angularjs

http://stackoverflow.com/a/24782395
answers question: http://stackoverflow.com/q/24780536
type: Answer
score: 1
upvote count: 1
has body: If you are using http://www.farsiweb.info/jalali/jalali.js, try function printJalali(year, month, day) { var jalali = gregorian_to_jalali([year, month+1, day]); return jalali[0] + "/" + jalali[1] + "/" + jalali[2]; } var today = new Date(); alert(printJalali(today.getFullYear(), today.getMonth(), today.getDate()));
downvote count: 0

twilio
tag name: twilio
tags question: http://stackoverflow.com/q/24874194
type: Tag

http://stackoverflow.com/comment/38667755
type: Comment
has text: I thought about comparing the request url with the tab url, by reading the url of the browser object which we get through the channel of the request, but at the time the http-on-modify-request event fires the uri property hasnt changed yet. (It's still the uri of the website before attempting to change the url)
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24886858

http://stackoverflow.com/comment/38490870
score: 0
type: AnswerComment
type: Comment
has text: I still have to wait a few minutes, before I can accept an answer. I'll do it as soon as I can.
comment on: http://stackoverflow.com/a/24798809

http://stackoverflow.com/a/24871780
answers question: http://stackoverflow.com/q/24841855
type: Answer
downvote count: 0
upvote count: 38
has body: Alternatively, if the method on Child is truly static (not a product of current props, state) you can define it on statics and then access it as you would a static class method. For example: var Child = React.createClass({ statics: { someMethod: function() { return 'bar'; } }, // ... }); console.log(Child.someMethod()) // bar
score: 38
has comment: http://stackoverflow.com/comment/51336241

http://stackoverflow.com/comment/38413222
type: QuestionComment
has text: No :-( There are no errors in the console...
comment on: http://stackoverflow.com/q/24757569
score: 0
type: Comment

http://stackoverflow.com/comment/38644883
has text: I would suggest you simply go with `removeItem`, `removeUndo`, etc, it will make everything easier. As `this` is dynamic, it's hard to keep track of it when you have many nested objects and functions.
score: 5
type: QuestionComment
comment on: http://stackoverflow.com/q/24880249
type: Comment

http://stackoverflow.com/q/24844785
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Using non-standard attributes
accepted answer: http://stackoverflow.com/a/24844820
score: 2
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24844813
favorite count: 0
possible better answer: http://stackoverflow.com/a/24844813
upvote count: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24844820
type: Question
has body: I am having trouble passing around values without using global variables when I am creating html/jquery applications. Quick example 1) Load a table with a class such as "playersTable" 2) Attach a unique ID such as "25" 3) Click on the table row and spawn a row of buttons that will perform actions based on the parent's class and ID; such as query playersTable WHERE row = 25, etc. The issue is that, as I am developing, I need to tie more and more values to the parent element (or any element that already has a class and ID) and I want to avoid adding 20 things to the class I don't know what to do when I need to attach even more data to my elements. I have also made use of the attribute "value" but then I wonder if all browsers support it, if it's bad practice, etc. Does it even work if I just start creating my own attributes? Such as &lt;div id = "2" class = "test" myAttr = "foo"&gt;&lt;/div&gt; Or am I going about this all the wrong way in general?

google-closure-compiler
tags question: http://stackoverflow.com/q/24777024
tags question: http://stackoverflow.com/q/24781091
type: Tag
tag name: google-closure-compiler

http://stackoverflow.com/comment/38422599
score: 0
type: QuestionComment
has text: *Or do people define an object literal as config and then add dynamic keys wherever needed with the []-syntax?* - Thats what I always do.
type: Comment
comment on: http://stackoverflow.com/q/24762831

http://stackoverflow.com/a/24876629
has body: This is a tricky issue that I've had to tackle multiple times in my career. I've taken various approaches, and in this answer I'll try to summarize my latest thinking: Don't prevent default. When you prevent the browser from taking its default action you end up having to recode that stuff yourself, and it gets pretty hairy to manually handle all the possible combinations of user intent and browser/platform variations. It's not worth it. There are some things (like checking which keys are pressed) that can be accounted for, but there are other things (like did the user right click and choose "open in a new tab") that are essentially impossible to detect. Personally, I think it's best to just let the browser do its thing, and figure out another way to accomplish what you're trying to do. Make the ga() function sync. In the sample code you provide, you're trying to send e-commerce and event hits to Google Analytics when the user clicks on a link. The problem is that the ga() call is async, so if the user clicks on a link, the call may or may not finish before the browser loads the new page. One possible solution would be to override how analytics.js is sending the hit to make it sync instead of async. This will allow you to send the hit without having to prevent default on the event and deal with opening the link manually. analytics.js recently introduced Tasks, which allow you to override or modify various built-in behaviors of the library. Here's an example of how you'd override the sendHitTask to implement a sync version: ga('create', 'UA-XXXX-Y', 'auto'); ga(function(tracker) { // Grab a reference to the default sendHitTask function. var originalSendHitTask = tracker.get('sendHitTask'); // Modify the send hit task to be sync in cases where an // external link was clicked. tracker.set('sendHitTask', function(model) { if (wasExternalLinkClicked()) { var xhr = new XMLHttpRequest(); var url = '//www.google-analytics.com/collect?' + model.get('hitPayload'); // Specifyin…
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/24871254
answers question: http://stackoverflow.com/q/24871254
has comment: http://stackoverflow.com/comment/38662074
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/a/24886839
type: Answer
score: 0
has body: You can nest ng-repeats like that, although I'm not sure what you want to achieve following code will repeat through cars, then wheels in cars and display wheels from object B(wheels) that match the car wheel id, hope that makes sense
answers question: http://stackoverflow.com/q/24886619

http://stackoverflow.com/q/24861043
has body: I want to create an IText on my fabricjs canvas. var text = new fabric.IText(textValue, { left: 0, top: 0 , fill: color, fillColor:color,}); Now I want to lock modification in some steps of my script and restore them later, Is it possible?? Sorry for my bad english.
tagged with: javascript
tagged with: fabricjs
score: 0
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/30371958
has title: fabricjs: IText lock modification
type: UnansweredQuestion
type: Question
tagged with: canvas

object-literal
tag name: object-literal
tags question: http://stackoverflow.com/q/24899794
type: Tag

http://stackoverflow.com/comment/38726989
type: Comment
has text: It is milliseconds! You computer needs this time to parse and execute js code.
comment on: http://stackoverflow.com/a/24900503
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38582559
has text: @Marlio if `.refresh` does not provide a way for you to hook on its completion (by accepting a callback or returning a promise) then you can't hook on its completion - simple as that. Promise deferreds don't know by themselves when an async calculation is done.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24847572
score: 1

http://stackoverflow.com/comment/38483426
type: AnswerComment
comment on: http://stackoverflow.com/a/24794603
has text: The second block helped. I realized my mistake and was actually typing the second answer in as it was posted. Thanks.
score: 0
type: Comment

http://stackoverflow.com/a/24785127
has comment: http://stackoverflow.com/comment/38492837
has body: I must admit I'm not sure what the root of the problem is. Yet, change the beginning of line 33 in your template from: {{^.responsable}}(responsable no asignado){{/.responsable}} to: {{^responsable}}(responsable no asignado){{/responsable}} and it will render. http://jsfiddle.net/W3Lus/2/ Edit A pretty minimal example that exhibits the error is: http://jsfiddle.net/W3Lus/9/ Removing any part, even the static , it will render. Doesnt look like you're doing anything wrong, seems to be a bug. Edit I assume binding the select value to {{.responsable}}, when it does not resolve to anything, causes this, as long as there is any option in the select that actually would be bound to the non-existing value. Edit Minimal examples with different buggy results: http://jsfiddle.net/W3Lus/13/ http://jsfiddle.net/W3Lus/12/ One wont render at all, the other wont render a part that it should.
type: Answer
has comment: http://stackoverflow.com/comment/38484109
accepted answer of: http://stackoverflow.com/q/24765465
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24765465
has comment: http://stackoverflow.com/comment/38465688
has comment: http://stackoverflow.com/comment/38519546
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/a/24839337
answers question: http://stackoverflow.com/q/24790300
score: 0
has comment: http://stackoverflow.com/comment/38648551
type: Answer
has comment: http://stackoverflow.com/comment/38635170
has body: Using the Bing Maps JavaScript control that you reference does work in WP8 and 8.1. I put together a cross platform code sample that works on WP, Win8 and Web a while back and made it available here: http://code.msdn.microsoft.com/Cross-Platform-Bing-Maps-e96600d5

http://stackoverflow.com/q/24859458
accepted answer: http://stackoverflow.com/a/24860026
tagged with: firefox
downvote count: 0
tagged with: javascript
has body: Does anyone know the source code of mentioned function? FYI it's the function which implements feature 'save link as..' in Firefox browser.
has title: gContextMenu.saveLink() function in Firefox
tagged with: firefox-addon
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24860026
score: 1
favorite count: 0
type: Question
upvote count: 1
answer count: 1

http://stackoverflow.com/comment/133699778
has text: Thanks, setting coverageReporters: ["json", "lcov", "text"] in jest.config.ts fixed the issue for me.
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27479903

http://stackoverflow.com/a/24873829
downvote count: 0
answers question: http://stackoverflow.com/q/24872273
type: Answer
has body: Multipart middleware was removed in Connect 3.0. Connect recommends either connect-multiparty or connect-busboy. IMHO connect-busboy is better, so here's how to do it: (Of course, run npm install --save connect-busboy) // Main file, stays the same for all the other examples var express = require('express'), busboy = require('connect-busboy'); app.use(busboy({ immediate: true })); // Route file exports.upload = function (req, res) { req.busboy.on('file', function (fieldname, file, filename) { // fieldname will be 'file', file will be... um... the file (in binary encoding), filename will be the file's name }); req.busboy.on('field', function (key, value) { // key will be 'myObj', value will be $scope.userAvatarFile }); }; If you want to save the image to a file, you can do this: exports.upload = function (req, res) { req.busboy.on('file', function (fieldname, file, filename) { // saveTo is the temporary path var saveTo = path.join(os.tmpDir(), path.basename(fieldname)); file.pipe(fs.createWriteStream(saveTo)); // Do stuff with saveTo }); }; However, this is a security risk (saving to the disk, which is why req.files does not exist anymore), so most(?) libraries that work with files (e.g. Cloudinary) provide a WriteStream (or something that looks and feels like one). Here's how it works with Cloudinary: exports.upload = function (req, res) { req.busboy.on('file', function (fieldname, file, filename) { var stream = cloudinary.uploader.upload_stream(function(result) { console.log(result); }); // You should have been able to do file.pipe(stream), but Cloudinary's stream isn't a real WriteStream, but just an object with two functions. Well, the following works too: file.on('data', stream.write); file.on('end', stream.end); }); }; FWIW, I copied your code and tested it and it works just fine. Let me know if you've got any problems. I had the same issue a week ago, so I got to look into it.
score: 1
upvote count: 1

http://stackoverflow.com/comment/38592289
has text: That depends on what you want to return, and what you're expecting to be returned. You could throw an error, return false, null, undefined, empty array, unicorns or sunshine, it doesn't really matter as long it's what you're expecting in the other end of things.
comment on: http://stackoverflow.com/q/24852784
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/24760838
has body: Hello I'm trying to calculate a float value in JS I've my subtotal and I want to apply a discount in that value I did this: $("#desconto").focusout(function(){ var subtotal = $('#subtotal').val(); var desconto = $('#desconto').val(); if(desconto &gt; 0) total = ((subtotal) - (desconto)); else total = subtotal; $('#total').val(total); $('#totaldisabled').val(total); }); but my results are only negative numbers, and I dont know how to fix that, I tried that too parseFloat(desconto.replace(/[^\d\.]/, '') but not works, can someone help me!? thanks!
type: Question
answer count: 2
has title: Money calculation javascript
downvote count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/24761025
has comment: http://stackoverflow.com/comment/38418932
has comment: http://stackoverflow.com/comment/38418930
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24761025
tagged with: jquery
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38419127
has comment: http://stackoverflow.com/comment/38418890
possible better answer: http://stackoverflow.com/a/24765801
favorite count: 0
score: -1
has answer: http://stackoverflow.com/a/24765801

http://stackoverflow.com/a/24901765
answers question: http://stackoverflow.com/q/24900788
upvote count: 1
has body: check this
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/comment/38546710
score: 0
comment on: http://stackoverflow.com/q/24827929
type: QuestionComment
has text: Thanks Samuel, and yes, infact this is the solution I followed but I need to keep getting the frame numbers as the video moves forward. Also I tried without rounding off the total frames but no luck.
type: Comment

http://stackoverflow.com/a/24777151
has comment: http://stackoverflow.com/comment/38453837
type: Answer
answers question: http://stackoverflow.com/q/24777033
has comment: http://stackoverflow.com/comment/38449489
has body: you have ng-model variables in scope: $scope.name $scope.user.username $scope.email you can all of these prefix with user. and then send with ajax $scope.user instead of $scope.userForm or try to send object which is copied by: angular.copy($scope.userForm)
score: 0

partial-views
tags question: http://stackoverflow.com/q/24766273
type: Tag
tag name: partial-views

http://stackoverflow.com/q/24857136
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38601060
type: Question
has body: Okay so this is what I am wanting to do: Switch the class from col-lg-12 to col-lg-6 of the div with an id of info with a slide effect Slide Down the div with an id of project after the above action has completed. Right now, 2 is happening along with 1 and not being delayed. Here is my code: $(document).ready(function(){ $("#project").hide(); $("#phone").blur(function(){ if($("#name").val() &gt; ""){ if($("#business").val() &gt; ""){ if($("#email").val() &gt; ""){ if($("#phone").val() &gt; ""){ $("#info").switchClass("col-lg-12", "col-lg-6", 500); $("#project").slideDown(800).delay( 800 ).fadeIn( 800 ); } } } } }); });
tagged with: javascript
has answer: http://stackoverflow.com/a/24857186
score: 0
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/38601132
has title: Delay javascript action with switch class
accepted answer: http://stackoverflow.com/a/24857186
tagged with: css

http://stackoverflow.com/comment/38601356
score: 0
has text: Thanks! Works as expected.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24857308

http://stackoverflow.com/q/24834125
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
type: UnansweredQuestion
has title: Update directive after adding elements dynamically
favorite count: 0
type: Question
tagged with: angularjs-directive
score: 1
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24834210
tagged with: angularjs
has body: What I want to do: Use directives to create custom elements, and be able to dynamically add those elements into the view at different times. The Problem: When I add custom elements dynamically into the view, the elements appear as html inside the view, but the directive doesn't update the elements like it's supposed to. For Instance: We have a custom element -> . When I include in the raw html, the directive works as expected and fills it with 4 divs, each with a class of 'block'. Like so -> . But if I set the HTML of a div -> as equal to a string inside the controller, and update that string, the directive doesn't act on the tag. Here's the relevant code: Angular Directives: (there's one directive for each element in scp.pieces[] below) app.directive('sqr', function() { return { restrict: 'E', template: tetris.templateString, link: tetris.randColor }; }); Angular Controller: app.controller('levelCtrl', ['$scope', function(scp) { scp.pieces = [' ', ' ', ' ', ' ', ' ', ' ', ' ']; scp.piecesInPlay = ' '; scp.generateNewPiece = function() { var min = 0, max = 6; var randPiece = Math.floor(Math.random() * (max - min + 1)) + min; scp.piecesInPlay += scp.pieces[randPiece]; return scp.pieces[randPiece]; }; // generates a random piece and adds it to the pieces in play scp.generateNewPiece(); }]); HTML:

http://stackoverflow.com/comment/38405979
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/24753657
type: Comment
has text: @florin.prisecariu: refer to this SO it will answer your question ,http://stackoverflow.com/questions/4395780/difference-between-onload-and-ready

http://stackoverflow.com/q/24852598
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/24852808
score: -2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38592266
downvote count: 2
has title: Google Maps: How to remove a marker after a certain time?
type: Question
has comment: http://stackoverflow.com/comment/38591920
has answer: http://stackoverflow.com/a/24852808
tagged with: google-maps-api-3
has body: I add markers on Google Map using the following code function addDynamicMarker(location) { markers.push(new google.maps.Marker({ position: location, map: map, draggable: false, icon: image, animation: google.maps.Animation.DROP })); iterator++; } I have constant stream of data coming in from server and I add it to Map by calling connection.onmessage = function(e) { var parse = JSON.parse(e.data); var coordinates = parse["geo"]["coordinates"]; console.log("coordinates:" + JSON.stringify(coordinates, undefined, 2)); addDynamicMarker(new google.maps.LatLng(coordinates[0], coordinates[1])); }; Problem? - This keeps on creating new points on the map and becomes takes over all of the place - Since new google.maps.LatLng are getting created, they end up taking a lot of memory What I need? I need a way to that when the marker is pushed, that market is deleted after 2 seconds How can I achieve this?
tagged with: google-maps

http://stackoverflow.com/q/24869165
has comment: http://stackoverflow.com/comment/38626757
score: 0
has comment: http://stackoverflow.com/comment/38625912
has comment: http://stackoverflow.com/comment/38625702
has comment: http://stackoverflow.com/comment/38624770
has body: I'm currently using jquery datatable plugin to show a paginated view of data with Search &amp; Sort filters. The server (server1) returns the data in JSON format.The search filter makes an AJAX call to Server1 and it returns the matching sets of data. Pagination does the same. Now I also need to pull additional data from server2 (also returns JSON) and append it to the original datatable data (pulled from server1) while retaining search/sort filters. I originally thought of pulling data from both these sources separately, merging the data and then drawing a datatable that shows the aggregated view. But the amount of data is so huge that a call to pull all data takes a good few minutes. I can change the Servers (Server1 &amp; Sever2) to return focused data (by accepting params such as fromData, toDate, number of records etc.). Limitation: Both servers can't talk to each other unfortunately. Had they been able to communicate, I could've done the aggregation in one backend and make it easy for datatables. So to sum up: Data comes from multiple sources - Server1 &amp; Server2 Cannot pull all data at once Retain Search/Sort filters Is it possible to achieve this with datatables? If not is there an alternative javascript solution that does this (in some form that can be programmatically extended).
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38627610
has comment: http://stackoverflow.com/comment/38626072
tagged with: datatables
has comment: http://stackoverflow.com/comment/38627201
answer count: 0
tagged with: jquery
tagged with: ajax
has title: Datatable with data coming from two different sources
type: Question
has comment: http://stackoverflow.com/comment/38625862
tagged with: datatable
has comment: http://stackoverflow.com/comment/38625787

http://stackoverflow.com/comment/38570788
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24841509
has text: Doing it with JS would just be like if you add an overlay div with a logo on top of your image with CSS (which would be faster and as much non-secure). I think @JaredFarrish 's option is what you need for a safe, on demand (nothing saved) watermarking system.

http://stackoverflow.com/comment/38453377
score: 5
comment on: http://stackoverflow.com/q/24779356
type: Comment
type: QuestionComment
has text: Replace `"www.example.com"` with `'www.example.com'` (single quotes)

http://stackoverflow.com/comment/38619009
comment on: http://stackoverflow.com/q/24863372
score: 0
has text: I need a way to prevent auto panning for shapes that also works with complex shapes like polygons and takes the relative position of mouse into the account, so you can actually move your mouse to the edge and shape will partially go outside the map bounds. Do you have an idea how to do it?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38525444
type: Comment
comment on: http://stackoverflow.com/q/24817267
type: QuestionComment
has text: Welcome to the joys of asynchronous Javascript! First suggestion is to sprinkle console.log() throughout your code.
score: 0

http://stackoverflow.com/comment/38630097
type: Comment
score: 1
has text: AFAIK not in iOS. iOS consider localStorage as temporary @AndrewMcGivery
comment on: http://stackoverflow.com/a/24851397
type: AnswerComment

http://stackoverflow.com/comment/38680348
type: QuestionComment
has text: opening parenthesis exists already, I don't get it
comment on: http://stackoverflow.com/q/24898959
score: 0
type: Comment

http://stackoverflow.com/comment/38439433
has text: Is it name or id for the input tag?
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24771376

http://stackoverflow.com/q/24810292
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/38512186
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I have been working on a problem that needs to adjust an attribute based on the screen width. I thought that I could use media queries, but those are purely advisory for a tags and then I decided that I would use a JavaScript function which I got working and placed in the onclick(). I know that my function is working in jsFiddle but in my application is appears that the change is happening before the AJAX reloads the page so the change in attribute is getting set back so my change is not working because of the page load. I found an ajaxComplete function: $( document ).ajaxComplete(function() { var actual_width=window.innerWidth; alert("width: " + actual_width); if(actual_width < 1281) { var h1=document.getElementById('sigsLink'); alert("Font Size: " + h1.style.font-size); var newFontSize = "35px"; h1.style.height = newFontSize; } }); Here is the HTML: Manage Signatures The CSS: #sigsLink{ font-size: 14px; } Please tell me if I'm using the AJAX correctly because my page doesn't even seem to be calling it. Here is my JSFiddle that doesn't seem to be working either: http://jsfiddle.net/Arandolph01/Lj5yr/3/ What am I missing? EDIT: So Thanks to the suggestion by IndieRok I think I'm getting closer and tried: $(document).ready(function() { var actual_width=window.innerWidth; //alert("width: " + actual_width); if(actual_width < 982) { var newFontSize = "35px"; $('.sigsLink').css({ fontSize:newFontSize }); } }); This gives me a JavaScript error "Uncaught TypeError: undefined is not a function". What am I doing wrong? Thank you.
has comment: http://stackoverflow.com/comment/38512292
tagged with: css
has comment: http://stackoverflow.com/comment/38512365
has answer: http://stackoverflow.com/a/24810723
linked to: http://stackoverflow.com/q/24807832
type: Question
has comment: http://stackoverflow.com/comment/38512213
has comment: http://stackoverflow.com/comment/38512495
tagged with: javascript
has comment: http://stackoverflow.com/comment/38512238
has comment: http://stackoverflow.com/comment/38512144
has comment: http://stackoverflow.com/comment/38512168
has title: Change an attribute after the page loads
score: 0
has comment: http://stackoverflow.com/comment/38512228
has comment: http://stackoverflow.com/comment/38512565

http://stackoverflow.com/comment/38505374
has text: - @Nick, You told that you have seen this error earlier. Could you tell me what was the root cause in your case?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24806160

fancybox-2
tags question: http://stackoverflow.com/q/24828917
tags question: http://stackoverflow.com/q/24842232
tags question: http://stackoverflow.com/q/24763324
type: Tag
tag name: fancybox-2
tags question: http://stackoverflow.com/q/24832481

http://stackoverflow.com/comment/38542494
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24826430
score: 2
has text: did you tried with media query's ?

http://stackoverflow.com/comment/38606444
type: QuestionComment
type: Comment
has text: So you dont want overwrite your styles from javascript. is it right?
comment on: http://stackoverflow.com/q/24859987
score: 0

http://stackoverflow.com/q/24845610
has answer: http://stackoverflow.com/a/32544990
has answer: http://stackoverflow.com/a/24845773
accepted answer: http://stackoverflow.com/a/24845773
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jasmine
has comment: http://stackoverflow.com/comment/38578648
favorite count: 0
has body: I have spent long time trying to solve this problem. Anyone could help me out with this. I am following exactly under this youtube tutorial: http://www.youtube.com/watch?v=3Huh44nsZTw when I finish typing this: describe("Experimentation", function() { var elem; beforeEach(function() { elem = $(' Hello World '); }); it("allows us to search with CSS selectors", function() { expect(elem).toBe('#containers'); // Problem happened here!!!!!!! });}); Output Result: Experimentation allows us to search with CSS selectors Expected { 0 : HTMLNode, length : 1 } to be '#containers'. Error: Expected { 0 : HTMLNode, length : 1 } to be '#containers'. at stack (http://localhost:8888/__jasmine__/jasmine.js:1293:17) at buildExpectationResult (http://localhost:8888/__jasmine__/jasmine.js:1270:14) at Spec.Env.expectationResultFactory (http://localhost:8888/__jasmine__/jasmine.js:484:18) at Spec.addExpectationResult (http://localhost:8888/__jasmine__/jasmine.js:260:46) at Expectation.addExpectationResult (http://localhost:8888/__jasmine__/jasmine.js:442:21) at Expectation.toBe (http://localhost:8888/__jasmine__/jasmine.js:1209:12) at Object.<anonymous> (http://localhost:8888/__spec__/experimentationSpec.js:9:16) at attemptSync (http://localhost:8888/__jasmine__/jasmine.js:1510:12) at QueueRunner.run (http://localhost:8888/__jasmine__/jasmine.js:1498:9) at QueueRunner.execute (http://localhost:8888/__jasmine__/jasmine.js:1485:10)
score: 2
type: AnsweredQuestion
has title: Javascript: Jasmine Error: Expected { 0 : HTMLNode, length : 1 } to be '#containers'
upvote count: 2
type: Question
possible better answer: http://stackoverflow.com/a/32544990

http://stackoverflow.com/a/43836002
score: 1
downvote count: 0
type: Answer
has body: You should not define id on a global scope, because foo might be called multiple times. Try something like this: var that = {'that' : this, 'id': 42}; foo(a.bind(that), b.bind(that), c.bind(that) ); Then all functions a, b, c should be able to read/write via this.id Full example: &lt;html&gt;&lt;body&gt; &lt;div id="log"&gt;&lt;/div&gt; &lt;script&gt; function Go(iCall) { var that = {'that' : this, 'id': -1, 'call' : iCall}; foo(a.bind(that), b.bind(that), c.bind(that) ); } function foo(a,b,c) { window.setTimeout(a,Math.random()*3000); window.setTimeout(b,Math.random()*3000); window.setTimeout(c,Math.random()*3000); } function a(){ if (this.id &lt; 0) this.id = 1; Log("a",this.call,this.id); } function b(){ if (this.id &lt; 0) this.id = 2; Log("b",this.call,this.id); } function c(){ if (this.id &lt; 0) this.id = 3; Log("c",this.call,this.id); } function Log(abc,call,id){ document.getElementById("log").innerHTML += "&lt;br/&gt;"+Array(call).join("___")+" :Go("+call + "): "+abc+"() Id=" + id; } Go(1);Go(2);Go(3); &lt;/script&gt; &lt;/body&gt;&lt;/html&gt; see in action: https://jsfiddle.net/vw35bz3d/
answers question: http://stackoverflow.com/q/24769516
upvote count: 1

http://stackoverflow.com/q/24900797
tagged with: bluetooth
has answer: http://stackoverflow.com/a/24901270
accepted answer: http://stackoverflow.com/a/24985365
tagged with: node.js
favorite count: 0
has body: A simple idea. I would like to show bluetooth devices in range of the computer (using a bluetooth dongle via bluetooth-serial-port NodeJS package) in the web browser served up upon call over AJAX. The issue I am having is that with the following script, I can't continiously scan for devices and serve up web sites at the same time. Could you explain the workflow in this and why/what would be a good direction to rectify the issue? var http = require("http"), url = require("url"), path = require("path"), fs = require("fs"), port = process.argv[2] || 8888, btSerial = new (require('bluetooth-serial-port')).BluetoothSerialPort(); btSerial.inquire(); // Get the devices var devices = []; btSerial.on('found', function(address, name) { if(typeof devices[address] === 'undefined'){ devices.push({'address': address,'name': name}); console.log("Device Found: "+address+" which is named: "+name); } }); // Keep searching btSerial.on('finished', function() { console.log("Done searching"); console.log(devices); //btSerial.inquire(); }); http.createServer(function(request, response) { var uri = url.parse(request.url).pathname, filename = path.join(process.cwd(), uri); if (uri == '/devices') { response.writeHead(200, {"Content-Type": "application/json"}); response.write(JSON.stringify(devices)); response.end(); return; } fs.exists(filename, function(exists) { if(!exists) { response.writeHead(404, {"Content-Type": "text/plain"}); response.write("404 Not Found\n"); response.end(); return; } if (fs.statSync(filename).isDirectory()) filename += 'public/index.html'; fs.readFile(filename, "binary", function(err, file) { if(err) { response.writeHead(500, {"Content-Type": "text/plain"}); response.write(err + "\n"); response.end(); return; } response.writeHead(200); response.write(file, "binary"); response.end(); }); }); }).listen(parseInt(port, 10)); console.log("Static file server running at\n =&gt; http://localhost:" + port + "/\nCTRL + C to shutdown");
has comment: http://stackoverflow.com/comment/38684440
upvote count: 1
tagged with: http
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24985365
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
score: 1
has title: Showing bluetooth devices in range via browser
possible better answer: http://stackoverflow.com/a/24901270

http://stackoverflow.com/comment/43378663
has text: What would a windows user do?
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/24831740

http://stackoverflow.com/comment/38475181
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24790313
has text: @SomeGuy: No. That's what we remove leading zeroes for :-)
type: AnswerComment

http://stackoverflow.com/comment/38515659
has text: Response from `ajax` call , page load ? Please illuminate . Thanks
comment on: http://stackoverflow.com/q/24812067
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24762348
has comment: http://stackoverflow.com/comment/38421898
has comment: http://stackoverflow.com/comment/38422132
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24762997
downvote count: 2
has comment: http://stackoverflow.com/comment/38421695
type: Question
has body: I am developing a web application in this case a front-end where I need to display Facebook events. I define an array called events. Inside each new event I have: id : id of the event. name : name of the event. description : description of the event. start_date : the start date of the event. end_date : the end date of the event. participants : array with participants in the event pictures : array of pictures of the event. places : array of places in the event. var events = []; var new_event = { 'id': event_id, 'name': event_name, 'description': event_description, 'start_date': event_start_date, 'end_date': event_end_date, 'participants' : [], 'pictures' : [], 'places' : [] }; then i create several participants, pictures and places. var new_participant = { 'id': participant_id, 'name': participant_name, 'birthDate': participant_birth_date, 'pictureUrl': participant_photo_url }; Every new participant has the variables on top. and i make the following pushes: events.push(new_event); events[i].participants.push(new_participant); i goes from 0 to events.length - 1. but I get the following error in the browser: Uncaught TypeError: Cannot read property 'participants' of undefined What is the correct way of pushing arrays into javascript elements and how do I access them? When I try to access: events[i].participants[0].name where i is between 0 and events.length-1, I get the same error for the name property. Uncaught TypeError: Cannot read property 'name' of undefined Here is the full code: $(document) .ready( function() { var events = []; $.ajax({ type : "GET", url : "...", dataType : "xml", success : function(xml) { $(xml).find('events').each(function() { var event_id = $(this).find('id').text(); var event_name = $(this).find('name').text(); var event_description = $(this).find('description').text(); var event_start_date = $(this).find('startdate').text(); var event_end_date = $(this).find('enddate').text(); var new_event = { 'id': event_id, 'name': event_name, 'descripti…
answer count: 2
has title: Accessing array inside element
tagged with: arrays
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/38421638
has comment: http://stackoverflow.com/comment/38421650
has comment: http://stackoverflow.com/comment/38421601
has comment: http://stackoverflow.com/comment/38422289
accepted answer: http://stackoverflow.com/a/24762997
has comment: http://stackoverflow.com/comment/38422041
has comment: http://stackoverflow.com/comment/38421782
has comment: http://stackoverflow.com/comment/38422683
has comment: http://stackoverflow.com/comment/38421585
has comment: http://stackoverflow.com/comment/38422567
has comment: http://stackoverflow.com/comment/38422278
linked to: http://stackoverflow.com/q/14220321
favorite count: 0
has comment: http://stackoverflow.com/comment/38422340
has comment: http://stackoverflow.com/comment/38421747
has comment: http://stackoverflow.com/comment/38422503
has comment: http://stackoverflow.com/comment/38421636
has comment: http://stackoverflow.com/comment/38422505
possible better answer: http://stackoverflow.com/a/24762604
has comment: http://stackoverflow.com/comment/38421619
has answer: http://stackoverflow.com/a/24762604
upvote count: 1

http://stackoverflow.com/a/24834762
downvote count: 0
has body: $().removeAttr('style'); works in Safari, Chrome and Firefox (all latest). Not sure on IE, but it certainly should. $(function() { $('img').removeAttr("style"); }); See this jsBin: http://jsbin.com/yokaxo/1/
type: Answer
upvote count: 2
score: 2
answers question: http://stackoverflow.com/q/24834686

http://stackoverflow.com/q/24891983
tagged with: design-patterns
tagged with: structure
tagged with: oop
has body: For a client side JS application, I require creating Quizzes and Surveys. The domain logic for these objects is incredibly similar so I would like them to both inherit from one UserInput object, while they each have very few additional methods each. I'm concerned with the best practice method of doing this. I was thinking right off the top of my head I can just create a UserInput constructor that acts as a prototype, and then dynamically add methods to both Quizzes and Surveys. For instance: function UserInput() {} UserObject.prototype.sharedMethod = function() {} Quiz = new UserInput(); Quiz.sharedMethod() Quiz.quizMethod = function() {} Survey = new UserInput(); Survey.surveyMethod = function() {} Survey.sharedMethod() However I wonder if this is just not plain monkey-patching, and implementing a similar idea to abstract classes in JavaScript would be cleaner. var Quiz = function() { UserInput.apply(this, arguments) } Quiz.prototype = UserInput(); Quiz.prototype.constructor = quiz; Quiz.prototype.quizMethod = function() {} The immediate difference I see is in the first example quiz/survey are objects while in the second quiz is a prototype. Every page has a singleton of these items, so having a method on every instance of quiz (which is only one) does not seem that bad to me. Which is preferred and why? (Or am I missing any better methods of instantiating objects).
has comment: http://stackoverflow.com/comment/38667518
type: Question
has answer: http://stackoverflow.com/a/24898555
tagged with: javascript
tagged with: prototype
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38667274
has comment: http://stackoverflow.com/comment/38667916
type: UnansweredQuestion
has title: Best practice for declaring JavaScript objects with similar properties
has comment: http://stackoverflow.com/comment/38667542

http://stackoverflow.com/q/24794276
linked to: http://stackoverflow.com/q/1606797
score: -1
type: AnsweredQuestion
tagged with: constructor
linked to: http://stackoverflow.com/q/10586673
has comment: http://stackoverflow.com/comment/38482491
upvote count: 2
accepted answer: http://stackoverflow.com/a/24794440
downvote count: 3
type: Question
tagged with: object
has body: Function.prototype.new = function ( ) { // Create a new object that inherits from the // constructor's prototype. var that = Object.create(this.prototype); // Invoke the constructor, binding –this- to // the new object. var other = this.apply(that, arguments); // If its return value isn't an object, // substitute the new object. return (typeof other === 'object' &amp;&amp; other) || that; }); This is an alternate implementation of constructor instantiation from JavaScript: The Good Parts. My question is why is do we need var other = ... Can't we just return the variable that?
has title: An alternate way to view constructor invocation in Javascript
has comment: http://stackoverflow.com/comment/38482669
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/24794440
linked to: http://stackoverflow.com/q/1646698
favorite count: 0
has comment: http://stackoverflow.com/comment/38482574

http://stackoverflow.com/comment/38645965
type: Comment
has text: @David Thomas ... the html in jsfiddle is there only to show the CSS generated image. You are right - at this point it has nothing to do with my application. What I do have is the code I posted here (kn-value, etc.). So the " " and so on for the button-wrap... is not part of my code. I also can't change the html. I can extend my application by adding js or jquery to customize it. I hope I am explaining the situation correctly. Thanks.
score: 0
comment on: http://stackoverflow.com/q/24875933
type: QuestionComment

http://stackoverflow.com/q/24790300
accepted answer: http://stackoverflow.com/a/24839652
linked to: http://stackoverflow.com/q/24061829
tagged with: bing-maps
score: 0
possible better answer: http://stackoverflow.com/a/24827410
has answer: http://stackoverflow.com/a/24827410
tagged with: javascript
has answer: http://stackoverflow.com/a/24839337
answer count: 3
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has title: Map APIs for windows PHONE 8.1 in HTML, CSS, JS
tagged with: windows-phone-8.1
has body: I am aware there is a similar question (Map APIs not working for windows phone in HTML), but I don't have enough reputation to comment so I am having to ask my own question. I have successfully added bing maps to my windows 8.1 store app (HTML, JS, CSS), but when trying to add the reference in visual studio (the maps SDK) to windows phone 8.1 the option isnt available to me. I went through the answer to the question asked previously and in the examples there is a windows store app (fine!), a mobile web app and a C# example. So I tried the mobile web version but just adding this link &lt;script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&amp;mkt=en-gb"&gt;&lt;/script&gt; obviously gives the error that you cant add a remote script as a local one (something along those lines) So I tried just copying the code from the url above and saving locally but that gave me the error about script trying to inject dynamic content. Now I am at a bit of a loose end as to what to try next...any suggestions/links to helpful content will be greatly appreciated! I should mention, I have seen a lot of documentation on adding the maps and that they are included within the windows phone 8.1 sdk so you dont need the bing maps sdk BUT these were mostly xaml, is there a way to access the sdk via js?
type: Question
has answer: http://stackoverflow.com/a/24839652

http://stackoverflow.com/q/24834707
has comment: http://stackoverflow.com/comment/38558303
type: Question
has comment: http://stackoverflow.com/comment/38558247
tagged with: javascript
score: 0
has body: So in my js code, the user is making mosaic images. When they press upload, I create a new object and all is good, my code works perfectly. I then save the id to that object that was just uploaded. If the user presses the upload button again, I want to simply use that same object id and clear out the files that were saved before and use the newest version. All of my saves, updates, and everything appear to be working just fine. When I go to the data browser though, I see the files but when I click, the link is broken. (Which doesn't seem it like it should even be possible). 95% of my code is below, there is some stuff outside of that to generate the mosaic image and to store the id returned. How can I avoid these broken links? var ins_file = new Parse.File("Instructions.png", { base64: img_ins_InBase64 }, "image/png"); var pretty_file = new Parse.File("Pretty.png", { base64: img_pretty_InBase64 }, "image/png"); ins_file.save().then(function () { }, function (error) { console.log("Instruction File couldn't be saved") // The file either could not be read, or could not be saved to Parse. }); pretty_file.save().then(function () { }, function (error) { console.log("Mosaic File couldn't be saved") // The file either could not be read, or could not be saved to Parse. }); var mosaicClass = Parse.Object.extend("Mosaics"); var mosaicObj = new Parse.Object("Mosaics"); var query = new Parse.Query(mosaicClass); query.get(parseId, { success: function (objToUpdate) { // The object was retrieved successfully. SIMPLY UPDATE objToUpdate.set("img_ins", ins_file); objToUpdate.set("img_pretty", pretty_file); objToUpdate.save().then(function () { console.log("Initial Image updated"); var ins_img_url = objToUpdate.get('img_ins').url(); var pretty_img_url = objToUpdate.get('img_pretty').url(); objToUpdate.set("img_ins_url", ins_img_url); objToUpdate.set("img_pretty_url", pretty_img_url); objToUpdate.save(); console.log("Mosaic updated, id was: " + objToUpdate.id); parseId = objToUpdate.id;…
has answer: http://stackoverflow.com/a/24835016
accepted answer: http://stackoverflow.com/a/24835016
answer count: 1
tagged with: parse-platform
has comment: http://stackoverflow.com/comment/38558859
type: AnsweredQuestion
has title: Parse.com Files Not Updating, lead to broken links from data browser

http://stackoverflow.com/a/24808636
downvote count: 0
score: 1
has body: You can use the event argument that’s passed to event listeners instead; it has a method named preventDefault() that stops the default action from being performed. $('#myForm').submit(function (e) { var inputs = $(this).find('input:checked'); inputs.each(function () { var inputId = this.id; if (inputId != undefined && inputId.substring(0, 8) == 'inputName') { var r = confirm("Are you sure you want to continue?"); if (!r) { e.preventDefault(); } } }); });
upvote count: 1
answers question: http://stackoverflow.com/q/24808506
type: Answer

http://stackoverflow.com/q/24765627
tagged with: ajax
linked to: http://stackoverflow.com/q/5724650
has answer: http://stackoverflow.com/a/24765944
linked to: http://stackoverflow.com/q/6291322
linked to: http://stackoverflow.com/q/2138429
answer count: 4
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24765780
upvote count: 1
downvote count: 1
type: Question
tagged with: asp.net-mvc
tagged with: javascript
has title: How "secure" is the ASP .NET Controller
tagged with: webdeploy
tagged with: security
score: 0
has answer: http://stackoverflow.com/a/24765897
possible better answer: http://stackoverflow.com/a/24766669
has body: I am still very new to the concepts and design of ASP .NET's MVC and AJAX and I was wondering how secure the Controller is to unwanted user's when webdeployed. I ask because for fun I made a little admin panel that requires a user name and password. Once input is entered the information is AJAX submitted to a ActionResult method in the Controller that just compares the strings to see if they match, then returns the response back to the AJAX. My question is, how easy is it for someone to get into my Controller and see the hard-coded password? No professional-type person will ever try to break into this, as it is a free site for a university club, but I want to make sure that the average Computer Science student couldn't just "break in" if they happen to "rage" or get mad about something (you never know! haha). Question: Is having a password validation within the Controller "decently" secure on a ASP .NET MVC web-deployed application? Why or why not? Here is the actual code in case the use of it matters for the answer (domain is omitted for privacy) Note: I understand this use of Javascript might be bad, but I am looking for an answer relative to AJAX and Controller security of the password check. View (Admin/) //runs preloadFunc immediately window.onpaint = preloadFunc(); function preloadFunc() { var prompting = prompt("Please enter the password", "****"); if (prompting != null) { $.ajax({ url: "/Admin/magicCheck", type: "POST", data: "magic=" + prompting, success: function (resp) { if (resp.Success) { //continue loading page } else { //wrong password, re-ask preloadFunc(); } }, error: function () { //re-ask preloadFunc(); } }); } else { // Hitting cancel window.stop(); window.location.replace("google.com"); } } Controller (ActionResult Snippet) [HttpPost] public ActionResult magicCheck(string magic) { bool success = false; if (magic == "pass") { success = true; } else { success = false; } return Json(new { Success = success }); } Again I am new to MVC and AJAX, let …
has answer: http://stackoverflow.com/a/24766669
has comment: http://stackoverflow.com/comment/38429379
has answer: http://stackoverflow.com/a/24765780
favorite count: 0

http://stackoverflow.com/a/24835944
answers question: http://stackoverflow.com/q/24835912
type: Answer
downvote count: 0
score: 1
has body: PHP and JavaScript are two separate programming language—you can't just mix them together like that. When you put your jQuery method directly inside of your PHP code (e.g., before '?>', you're telling PHP to run that code—but PHP doesn't know how, since it's in a different language. Instead, try putting your method either outside of PHP's tags (&lt;? ... ?&gt;), or echo out the method, depending on how the rest of your page is set up. And welcome to Stack Overflow!
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24835912
upvote count: 1
has comment: http://stackoverflow.com/comment/38561056

http://stackoverflow.com/comment/38685170
has text: I know f is only created once but is the callback in example 2 created more than once?
score: 0
comment on: http://stackoverflow.com/q/24901595
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38458232
has text: @CaseyFalk Yeah they discontinued it, but you can [still find](https://2ra5-downloads.phpnuke.org/en/c152100/google-chrome-frame#.U8Z8e3WSzQo) it [around](http://google-chrome-frame.en.softonic.com/), and host it for your users yourself
score: 1
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24781626

http://stackoverflow.com/a/24801405
has comment: http://stackoverflow.com/comment/38495814
accepted answer of: http://stackoverflow.com/q/24801304
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38495531
answers question: http://stackoverflow.com/q/24801304
has comment: http://stackoverflow.com/comment/38495583
type: Answer
has comment: http://stackoverflow.com/comment/38495464
upvote count: 1
has comment: http://stackoverflow.com/comment/38495437
has comment: http://stackoverflow.com/comment/38495892
score: 1
has body: This regex should work for you: /^^[a-z](?=[^.]*\.[^.]*$)[a-z0-9.]*[a-z0-9]$/gmi Online Regex Demo

http://stackoverflow.com/a/24769514
has comment: http://stackoverflow.com/comment/38440548
has body: I supouse you have missed a line in your css it should start like this: &lt;style&gt; div { margin:0 auto; ... or just delete these lines margin:0 auto; padding:0; width:200px; text-align:center; }
answers question: http://stackoverflow.com/q/24769070
score: 0
type: Answer

http://stackoverflow.com/q/24864091
score: 2
downvote count: 0
has answer: http://stackoverflow.com/a/24864651
has answer: http://stackoverflow.com/a/24864366
type: Question
has body: My problem is that I don't know how to merge those similar functions, I'm pretty sure there is some way to cut it to one function. 1099 and 1100 is id of game. ajax_query is my function which runs an ajax query with given parameters. $('#away1099').click(function () { if ($( "#home1099" ).hasClass( "table-bets-choosen" )) { ajax_query(1099, 'home', 'remove', 'home', 1); } else if ($( "#away1099" ).hasClass( "table-bets-choosen" )) { ajax_query(1099, 'away', 'remove', 'away'); } else { ajax_query(1099, 'away', 'add', 'away'); } return false; }); $('#home1099').click(function () { if ($( "#away1099" ).hasClass( "table-bets-choosen" )) { ajax_query(1099, 'away', 'remove', 'away', 1); } else if ($( "#home1099" ).hasClass( "table-bets-choosen" )) { ajax_query(1099, 'home', 'remove', 'home'); } else { ajax_query(1099, 'home', 'add', 'home'); } return false; }); $('#away1100').click(function () { if ($( "#home1100" ).hasClass( "table-bets-choosen" )) { ajax_query(1100, 'home', 'remove', 'home', 1); } else if ($( "#away1100" ).hasClass( "table-bets-choosen" )) { ajax_query(1100, 'away', 'remove', 'away'); } else { ajax_query(1100, 'away', 'add', 'away'); } return false; }); $('#home1100').click(function () { if ($( "#away1100" ).hasClass( "table-bets-choosen" )) { ajax_query(1100, 'away', 'remove', 'away', 1); } else if ($( "#home1100" ).hasClass( "table-bets-choosen" )) { ajax_query(1100, 'home', 'remove', 'home'); } else { ajax_query(1100, 'home', 'add', 'home'); } return false; });
tagged with: javascript
has title: How to merge similar js functions?
answer count: 6
has answer: http://stackoverflow.com/a/24864379
tagged with: ajax
upvote count: 2
possible better answer: http://stackoverflow.com/a/24864366
favorite count: 0
has answer: http://stackoverflow.com/a/24864466
has answer: http://stackoverflow.com/a/24864474
accepted answer: http://stackoverflow.com/a/24864474
has answer: http://stackoverflow.com/a/24864404
type: AnsweredQuestion

http://stackoverflow.com/q/24850210
tagged with: android
score: 0
tagged with: webview
tagged with: http://stackoverflow.com/tag/xhtml
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38598002
has title: Android webview load java script function in xhtml
answer count: 0
has body: I use loadUrl function to call a JavaScript function inside my webview: webview.loadUrl("javascript:(function(){ if (window.find) { if(window.getSelection){ window.document.designMode = 'on'; window.document.execCommand('hiliteColor',false,'yellow'); window.document.designMode = 'off'; }}})()"); this for heightlight selected text it is working good with me during load html files to my webview but it did not work when trying to view xhtml files to webview how can i handle this pls?
type: Question
has comment: http://stackoverflow.com/comment/38605520

http://stackoverflow.com/q/24754473
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
favorite count: 0
type: Question
has title: Javascript / Jquery reading text file
has answer: http://stackoverflow.com/a/24754510
upvote count: 2
answer count: 1
has body: I know there is a lot of information about reading data from local file in javascript but I'd like to ensure myself that there is no possibility to just display window to pick file path and read it, everything on the client side. Just YES/NO I need to write a script which generates schedule completely on the client side. Is there any way to do this except copy-paste data into some text area? P.S I clarified my first question
score: 2

http://stackoverflow.com/comment/38464719
type: Comment
comment on: http://stackoverflow.com/a/24784043
type: AnswerComment
has text: It works, on both the ones having alphabetical characters after the requirement, and the ones with numerical characters. Thank you for your help.
score: 0

http://stackoverflow.com/comment/38573609
type: QuestionComment
type: Comment
has text: Why don't you just write (for the entire thing): `var examples = <?php echo json_encode($examples) ?>;` ?
comment on: http://stackoverflow.com/q/24843092
score: 0

http://stackoverflow.com/q/24887183
tagged with: show-hide
tagged with: listview
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24917665
has comment: http://stackoverflow.com/comment/38699448
favorite count: 0
tagged with: gridview
accepted answer: http://stackoverflow.com/a/24917665
type: Question
upvote count: 2
answer count: 1
has comment: http://stackoverflow.com/comment/38700735
has comment: http://stackoverflow.com/comment/38661672
has body: I'm working on a marketplace type website built using a CMS which uses Mootools JS and I'd like to give the user the option to change from a List View of items to a Grid View. My problem is upon loading the screen both List and Grid Views are seen and only one disappears when a button is clicked so this is where I need help. I'd like for the List View to appear on the page loading and the Grid View to appear on the button click I've done tons of research on this and while there's plenty of JQuery answers there's not much at all for Mootools and the only answers I could find suggested using CSS 'display: none' on one of the list elements and that really doesn't work at all. You can see a basic idea of my problem in http://jsfiddle.net/5ctJL/5/ Here is my HTML list grid Grid 1 Grid 2 Grid 3 Grid 4 Grid 5 List 1 List 2 List 3 List 4 List 5 CSS #ulGrid { color: #8A7575; font-weight: bold; padding: 10px; background: #ccc; width: 15%; } #ulList { color: #8A7575; padding: 10px; font-weight: bold; } JS window.addEvent('domready', function () { var myList = new Fx.Slide('ulList'); var myGrid = new Fx.Slide('ulGrid'); $('list').addEvent('click', function (event) { myGrid.hide(); myList.show(); }); $('grid').addEvent('click', function (event) { myGrid.show(); myList.hide(); }); }); Many thanks in advance
has comment: http://stackoverflow.com/comment/38715088
has comment: http://stackoverflow.com/comment/38670203
has comment: http://stackoverflow.com/comment/38692975
tagged with: mootools
has title: list to grid view using mootools
score: 2
has comment: http://stackoverflow.com/comment/38658851
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/38425309
has text: You should have a look at http://www.html5rocks.com/en/tutorials/es6/promises/ to learn how promises work.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/24764292
type: QuestionComment

http://stackoverflow.com/q/24834115
tagged with: javascript
tagged with: jquery
has body: When trying to change the text of an element using a dynamic selector I got Jquery error here is my Jquery code : var idx = ".counter-up,."+json.updates[i].key; var old = parseInt($(idx).text()); I get the error Syntax error, unrecognized expression: .counter-up,. http://jsfiddle.net/toulmek/CPAjC/
accepted answer: http://stackoverflow.com/a/24834604
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/70579
type: AnsweredQuestion
has title: Jquery dynamic selector error
type: Question
has comment: http://stackoverflow.com/comment/38557814
has answer: http://stackoverflow.com/a/24834604
has comment: http://stackoverflow.com/comment/38557537
has comment: http://stackoverflow.com/comment/38557407
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38557648

http://stackoverflow.com/comment/38480664
comment on: http://stackoverflow.com/q/24793321
has text: And where's the code to trigger the click?
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/24791879
has body: I have using dropzone.js in mvc by following this tutorial for uploading images but after uploading the image the thumbnail image still showing and I need it to be removed after every time I upload an image. I have tried to replace the generated HTML after uploading the image using jQuery but it not showing correctly as the first time I need to refresh the page to show correctly but I don't want to do that. $("#ImageUpload").replaceWith('&lt;form action="/Products/SaveUploadedFile" method="post" enctype="multipart/form-data" class="dropzone dz-clickable" id="dropzoneForm"&gt;' +'&lt;div class="fallback"&gt;' +'&lt;input name="file" type="file" multiple /&gt;' +'&lt;input type="submit" value="Upload" /&gt;' +'&lt;/div&gt;');
has answer: http://stackoverflow.com/a/30230740
type: Question
tagged with: asp.net-mvc
tagged with: javascript
has answer: http://stackoverflow.com/a/49259165
accepted answer: http://stackoverflow.com/a/30230740
has answer: http://stackoverflow.com/a/59090009
has answer: http://stackoverflow.com/a/24811431
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: dropzone.js
tagged with: ajax
answer count: 9
has answer: http://stackoverflow.com/a/41931182
upvote count: 25
possible better answer: http://stackoverflow.com/a/43683894
has answer: http://stackoverflow.com/a/44361079
has answer: http://stackoverflow.com/a/43683894
score: 25
has title: Clear dropzone.js thumbnail image after uploading an image
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/36793507
has answer: http://stackoverflow.com/a/45674072

http://stackoverflow.com/comment/38665009
has text: On a serious note though... loads of people answer with JSFiddles, what is so wrong with that (other than it can go down, but so can any website)
type: Comment
comment on: http://stackoverflow.com/a/24889649
score: 0
type: AnswerComment

http://stackoverflow.com/q/24834686
type: Question
has comment: http://stackoverflow.com/comment/38558227
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38558225
has comment: http://stackoverflow.com/comment/38558214
favorite count: 0
upvote count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
has body: I have tried everything to remove the inline style from tags in a page. And nothing has worked. Given rendered html like: How can I remove the attribute from all images in page? I have tried removeAttr as well as code from various SO posts and nothing has worked. EDIT: I tried And: And As well as about 3 or 4 other examples from around the web. When I view source I see: <img alt="" src="../../../../images/Cuffs.jpg" style="width: 620px; height: 395px;" / Checking in Chrome
has answer: http://stackoverflow.com/a/24834762
has answer: http://stackoverflow.com/a/24834747
has comment: http://stackoverflow.com/comment/38558202
has answer: http://stackoverflow.com/a/24834851
accepted answer: http://stackoverflow.com/a/24834851
has title: How to remove inline style from img tag using JQuery?
possible better answer: http://stackoverflow.com/a/24834762
type: AnsweredQuestion
score: 3
downvote count: 0
has answer: http://stackoverflow.com/a/34924238
has comment: http://stackoverflow.com/comment/38558199

http://stackoverflow.com/q/24886619
possible better answer: http://stackoverflow.com/a/24886820
tagged with: javascript
score: 0
answer count: 3
has title: Angularjs - Fetch object in ng-repeat
tagged with: angularjs-ng-repeat
has answer: http://stackoverflow.com/a/24886839
has body: I have 2 separate json objects coming from the server. Json A below is of a Car model object which is fetch when looking at a car. Json B is meta data which is used throughout the whole application when the web page first loads. What I need to do is have a lookup on wheel_id while doing a ng-repeat on wheel_handlers so it returns the wheel object from json B and then I can use this within the view and print the results. I think I need to do something with the ng-repeat but I'm not sure to be honest. A - Car model [{ id: 14, name: "Audi", wheel_handlers: [ { id: 9, wheel_id: 62, arguments: { amount: 10 } } ] }] B - wheel { id: 62, name: "Change Wheel Size", arguments: [ { id: 25, description: "amount" } ] }
tagged with: angularjs
has answer: http://stackoverflow.com/a/24886820
tagged with: http://stackoverflow.com/tag/json
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24887228
accepted answer: http://stackoverflow.com/a/24887228

http://stackoverflow.com/a/46232187
downvote count: 0
answers question: http://stackoverflow.com/q/24803709
type: Answer
score: 2
upvote count: 2
has body: To update this answer, the current convention is: //= require jquery-ui and for css: /* *= require jquery-ui */ for specific modules: //= require jquery-ui/draggable See latest docs here for more configuration options

http://stackoverflow.com/a/24817299
has body: I ended up figuring it out. Here is what I did: spooky.run(function(){ var reviewObj = { reviewCount: reviews.length, reviews: [] } reviews.forEach(function(line){ //turn the string into an array var review = line.split('\n'); }); //add the array elements to the object reviewObj.reviews.push({name: review[0], date: review[1], reviewContent: review[2]}); }); this.echo('about to emit'); this.emit("gotReviews", reviewObj); });
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/24808278
answers question: http://stackoverflow.com/q/24808278

http://stackoverflow.com/comment/38407512
score: 0
type: Comment
has text: Ah, OK. I will do that in the final version for sure because I'll be dealing with a semi-large image, and thanks for the explanation.
comment on: http://stackoverflow.com/a/24754750
type: AnswerComment

http://stackoverflow.com/comment/38504821
type: Comment
type: QuestionComment
has text: You have to at least write your own comparator for your expectation since the default filter will convert anything to string before do a comparison. For example, `{ foo : 1 }` will match `{ foo: -1 }` because "-1" contains "1".
comment on: http://stackoverflow.com/q/24805755
score: 2

http://stackoverflow.com/a/24765970
has body: You can't send javascript values to php the way you describe. You can use ajax to send the javascript value to the server, evaluate it and get a response. Another way is to add a data attribute somewher like this: &lt;div id="somediv" data-value="..." &gt; then retrieve it using jQuery with $('#somediv').attr('data-value') ; or $('#somediv').data('value') ;
answers question: http://stackoverflow.com/q/24765663
type: Answer
upvote count: 1
downvote count: 1
score: 0

http://stackoverflow.com/comment/38409589
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24754336
type: Comment
has text: @LarsKotthoff now my result="Amount":100\n"Amount":200\n i want to show result such that after \n it appears in next line within that tooltip

http://stackoverflow.com/comment/38461212
has text: Can you show your CSS.
comment on: http://stackoverflow.com/q/24783299
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24755952
answer count: 1
has answer: http://stackoverflow.com/a/24757010
favorite count: 0
tagged with: apache-poi
upvote count: 3
type: UnansweredQuestion
score: 3
tagged with: java
type: Question
tagged with: docx4j
has title: How to read word document and get parts of it with all styles using docx4j
has body: I am using docx4j to deal with word document formatting. I have one word document which is divided in number of tables. I want to read all the tables and if I find some keywords then I want to take those contents to another word document with all the formatting. My word document is as follow. Like from above I want to take content which is below Some Title. Here my keyword is Sample Text. So whenever Sample Text gets repeated, content needs to be fetched to new word document. I am using following code. MainDocumentPart mainDocumentPart = null; WordprocessingMLPackage docxFile = WordprocessingMLPackage.load(new File(fileName)); mainDocumentPart = docxFile.getMainDocumentPart(); WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage(); ClassFinder finder = new ClassFinder(Tbl.class); new TraversalUtil(mainDocumentPart.getContent(), finder); Tbl tbl = null; int noTbls = 0; int noRows = 0; int noCells = 0; int noParas = 0; int noTexts = 0; for (Object table : finder.results) { noTbls++; tbl = (Tbl) table; // Get all the Rows in the table List&lt;Object&gt; allRows = DocxUtility.getDocxUtility() .getAllElementFromObject(tbl, Tr.class); for (Object row : allRows) { Tr tr = (Tr) row; noRows++; // Get all the Cells in the Row List&lt;Object&gt; allCells = DocxUtility.getDocxUtility() .getAllElementFromObject(tr, Tc.class); toCell: for (Object cell : allCells) { Tc tc = (Tc) cell; noCells++; // Get all the Paragraph's in the Cell List&lt;Object&gt; allParas = DocxUtility.getDocxUtility() .getAllElementFromObject(tc, P.class); for (Object para : allParas) { P p = (P) para; noParas++; // Get all the Run's in the Paragraph List&lt;Object&gt; allRuns = DocxUtility.getDocxUtility() .getAllElementFromObject(p, R.class); for (Object run : allRuns) { R r = (R) run; // Get the Text in the Run List&lt;Object&gt; allText = DocxUtility.getDocxUtility() .getAllElementFromObject(r, Text.class); for (Object text : allText) { noTexts++; Text txt = (Text) text; } Syste…
tagged with: arrays
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/24762783
answers question: http://stackoverflow.com/q/24762718
type: Answer
has body: You should use the data argument : $('.go').on('click', {myVar:'banana'}, this._init); p._init = function(e){ // use e.data.myVar; // this is the right matching clicked element };
upvote count: 2
has comment: http://stackoverflow.com/comment/38422345
has comment: http://stackoverflow.com/comment/38422294
score: 2
downvote count: 0

http://stackoverflow.com/a/24771819
type: Answer
score: 1
upvote count: 1
has body: You just need to use this.doTask() in a member of Def. E.g: class Abc { doTask() { return 1; } } class Def extends Abc { // How can I access doTask() here? likeThis() { return this.doTask() + 1; } }
downvote count: 0
answers question: http://stackoverflow.com/q/24771743

http://stackoverflow.com/q/24842957
possible better answer: http://stackoverflow.com/a/24843006
accepted answer: http://stackoverflow.com/a/24843100
tagged with: php
has title: javascript: is it possible to target div of another file?
has answer: http://stackoverflow.com/a/24843006
has body: Let me explain the purpose of this. I'm using some CMS and I'm trying to customize it with php scripts of my own that I embedded to the home page with IFRAME. My php script gives back some links which I would like to open outside that IFRAME - as a part of some other CMS block on the homepage. The idea is to target (from my php script) the div of that CMS block which is already showing some data. Is that possible?
has comment: http://stackoverflow.com/comment/38573376
tagged with: javascript
has comment: http://stackoverflow.com/comment/38573395
has comment: http://stackoverflow.com/comment/38573403
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24843128
has answer: http://stackoverflow.com/a/24843100
score: 0
answer count: 3

http://stackoverflow.com/q/24840253
tagged with: node.js
tagged with: http://stackoverflow.com/tag/json
type: Question
has body: I'm using node-webkit to build an app that alerts me every time there is an alarm in my country (we are currently in a war). There is a website that supplies a JSON file that contains info about current alarms. When I try to access that page and check whether there are alarms, the result is a lot of question marks. I can't use that, and when I try to JSON.parse the data it says that it cannot parse question marks. What do I do? url: "http://www.oref.org.il/WarningMessages/alerts.json", checkAlert: function(callback) { request({ uri: this.url, json: true, encoding: 'utf-8' }, function(err, res, json) { if (err) return console.log(err); json = JSON.parse(json); var data = json.data; console.log('just checked. json.data: ' + data); if (data.length != 0) // if array is not empty callback(true); else callback(false); }); } Here's how the file looks like: { "id" : "1405751634717", "title" : "something in hebrew ", "data" : [] } Thanks a lot!
linked to: http://stackoverflow.com/q/10746268
answer count: 2
has answer: http://stackoverflow.com/a/35383328
has answer: http://stackoverflow.com/a/24840342
tagged with: javascript
score: 0
has title: Getting question marks when trying to get data from API
type: UnansweredQuestion

http://stackoverflow.com/a/24825586
answers question: http://stackoverflow.com/q/24825499
has comment: http://stackoverflow.com/comment/110273717
score: 2
has body: You have to be sure that element exist. So var element = document.querySelector('.class-name'); if (element) element.addEventListener('click', function () {});
downvote count: 0
type: Answer
upvote count: 2

http://stackoverflow.com/q/24894450
tagged with: javascript
has comment: http://stackoverflow.com/comment/38671641
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: I have a HTML Table that is populated from a mySQL table as seen below: $sql = "SELECT `ID`,`SaveName`, `CourseNumber`, `FormType`, `POSTString`, `DateModified` FROM `SavedFormsTable` WHERE 1"; $result = mysqli_query($con,$sql); echo " Save File Name Course Number Date Modified Load Old Form "; while($row = mysqli_fetch_array($result)) { echo " "; echo " " . $row['SaveName'] . " "; echo " " . $row['CourseNumber'] . " "; echo " " . $row['DateModified'] . " "; echo ' Load Form! '; echo " "; } echo " "; My problem is on the 4th line from the bottom. in the HTML I am trying to create a button IN THE HTML TABLE that when clicked will call a PHP function. But i have to echo the HTML in order to create the table from the mySQL database. Is there a clever way of to do this??? The PHP function I need to call: function LoadFormPHP($ID){ $con=mysqli_connect("","User636626","EasyPassword","pansyc5_SavedForms"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $sql = sprintf("SELECT `POSTString` FROM `SavedFormsTable` WHERE `ID`=%d",$ID); $result = mysqli_query($con,$sql); $row = mysqli_fetch_array($result); //mysql_close($con); $_POST = unserialize(base64_decode($row["POSTString"])); } The JS function i tried (and failed) to call the PHP function from:
score: 0
has comment: http://stackoverflow.com/comment/38671743
answer count: 2
tagged with: php
has comment: http://stackoverflow.com/comment/38677003
has title: Calling a PHP function in a dynamically created HTML table
tagged with: mysql
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24894550
has answer: http://stackoverflow.com/a/24894529
tagged with: html-table
has comment: http://stackoverflow.com/comment/38671659

http://stackoverflow.com/a/24858918
downvote count: 0
answers question: http://stackoverflow.com/q/24848550
type: Answer
upvote count: 1
has body: Use .barPadding. It takes a number between 0 and 1 and applies d3's bar width allocation instead of the dc.js code, which is obviously buggy. Now we just have to figure out how to deprecate .gap, which defaults to 2.
score: 1
has comment: http://stackoverflow.com/comment/38611080

http://stackoverflow.com/comment/38543296
score: 0
comment on: http://stackoverflow.com/q/24826774
type: Comment
type: QuestionComment
has text: What about the CSS that is affecting this dropdown? What CSS do you see when you right-click inspect element on the dropdown?

http://stackoverflow.com/comment/38426386
comment on: http://stackoverflow.com/a/24762997
type: AnswerComment
score: 0
type: Comment
has text: i have edited my code making the changes you suggested it had the same result.

http://stackoverflow.com/q/24806255
downvote count: 0
has answer: http://stackoverflow.com/a/24807501
score: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/24806727
tagged with: kendo-ui
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/24806727
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24807501
upvote count: 1
tagged with: knockout.js
has title: Knockout Kendo TimePicker disable user text input
type: Question
tagged with: javascript
has body: How to disable user text input in Kendo UI TimePicker using knockout-kendo binding? In my non knockout-kendo project I managed to do it using (jsfiddle example here): $('#timepicker').attr('disabled', 'disabled'); //disable user text input That way the control dropdown is active, users can pick time values, but cannot type into the box, which is exactly what I want. Now I'm working with knockout-kendo binding, and I can't find any option to disable user text input. (jsfiddle knockout-kendo example here). Is there a way to do that?
answer count: 2

http://stackoverflow.com/comment/63176491
type: Comment
has text: This one line change fixed the problem for me.
comment on: http://stackoverflow.com/a/33138958
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38521137
type: QuestionComment
type: Comment
has text: Update: Turns out the createSpan method isn't even being called, as I have inserted document.writes as well as a callback to a popup message in C#, and neither of them appear. I believe the formatting of my C# line is incorrect.
comment on: http://stackoverflow.com/q/24814264
score: 0

http://stackoverflow.com/comment/38558023
comment on: http://stackoverflow.com/a/24833351
type: Comment
type: AnswerComment
has text: thank you both. i "gave" the "answer" to pje 'cause the points will make a bigger difference. Now I need to figure out why `$.parseJSON(data);` is returning null.
score: 0

http://stackoverflow.com/a/24869345
has body: Using Lars Kotthoff's excellent direction, I got it working so I decided to post it for others and my own reference: http://jsfiddle.net/FV4rL/2/ with the following code appended: node.on("mouseover", function (d) { var g = d3.select(this); // The node var div = d3.select("body").append("div") .attr('pointer-events', 'none') .attr("class", "tooltip") .style("opacity", 1) .html("FIRST LINE &lt;br&gt; SECOND LINE") .style("left", (d.x + 50 + "px")) .style("top", (d.y +"px")); });
type: Answer
upvote count: 36
answers question: http://stackoverflow.com/q/24827589
score: 36
downvote count: 0

http://stackoverflow.com/comment/67654010
score: 3
type: AnswerComment
comment on: http://stackoverflow.com/a/24854333
has text: (<ChartInstance> this.chart).destroy();
type: Comment

http://stackoverflow.com/a/24845583
has body: Form elements emit an onsubmit event when the form is submitted (to improve the chances of that happening, actually include a &lt;input type="submit"&gt; button). Replace your current JavaScript with this: $("form").submit(function() { var email = $('#emailinput').val(); var variable = $('#variablesinput').val(); alert(email + variable); }); Preferably, you'd set an id on the specific form you want and use that in the selector. It is not recommended to use a click handler on a submit button instead of the more reliable and semantically appropriate submit event.
score: 5
upvote count: 5
downvote count: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24845557
type: Answer
accepted answer of: http://stackoverflow.com/q/24845557

http://stackoverflow.com/q/24844585
has title: Cut off last characters from html paragraph with JS
downvote count: 0
has body: How to cut off last 20 characters from a normal html paragraph with a classname which contains two words? For instance Last twenty characters have to be chopped off!!! I know there's a slice method in JS https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice but how to implement this onto the website?
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24844792
type: AnsweredQuestion
score: 1
upvote count: 1
possible better answer: http://stackoverflow.com/a/24844615
type: Question
has answer: http://stackoverflow.com/a/24844615
has answer: http://stackoverflow.com/a/24844662
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24844662
answer count: 3

typeahead
type: Tag
tags question: http://stackoverflow.com/q/24882709
tags question: http://stackoverflow.com/q/24789944
tag name: typeahead

d3.js
tags question: http://stackoverflow.com/q/24786795
tags question: http://stackoverflow.com/q/24892849
tags question: http://stackoverflow.com/q/24907231
tags question: http://stackoverflow.com/q/24857126
tags question: http://stackoverflow.com/q/24829634
tags question: http://stackoverflow.com/q/24762150
tags question: http://stackoverflow.com/q/24783276
tags question: http://stackoverflow.com/q/24751138
tags question: http://stackoverflow.com/q/24754336
tags question: http://stackoverflow.com/q/24833450
tags question: http://stackoverflow.com/q/24855630
tags question: http://stackoverflow.com/q/24787174
tags question: http://stackoverflow.com/q/24901057
tags question: http://stackoverflow.com/q/24893606
tags question: http://stackoverflow.com/q/24802227
tags question: http://stackoverflow.com/q/24844355
tags question: http://stackoverflow.com/q/24899223
tags question: http://stackoverflow.com/q/24835497
tags question: http://stackoverflow.com/q/24833640
tags question: http://stackoverflow.com/q/24861107
tags question: http://stackoverflow.com/q/24873331
tags question: http://stackoverflow.com/q/24848550
tags question: http://stackoverflow.com/q/24802534
tags question: http://stackoverflow.com/q/24762358
tags question: http://stackoverflow.com/q/24905713
tags question: http://stackoverflow.com/q/24848470
tags question: http://stackoverflow.com/q/24822414
tags question: http://stackoverflow.com/q/24784225
tags question: http://stackoverflow.com/q/24828529
tags question: http://stackoverflow.com/q/24846957
tags question: http://stackoverflow.com/q/24795404
tags question: http://stackoverflow.com/q/24826932
tags question: http://stackoverflow.com/q/24863873
tags question: http://stackoverflow.com/q/24833787
type: Tag
tags question: http://stackoverflow.com/q/24848100
tags question: http://stackoverflow.com/q/24800375
tags question: http://stackoverflow.com/q/24811850
tags question: http://stackoverflow.com/q/24755321
tags question: http://stackoverflow.com/q/24768819
tags question: http://stackoverflow.com/q/24765058
tags question: http://stackoverflow.com/q/24783004
tags question: http://stackoverflow.com/q/24857881
tags question: http://stackoverflow.com/q/24901753
tags question: http://stackoverflow.com/q/24834293
tags question: http://stackoverflow.com/q/24844877
tags question: http://stackoverflow.com/q/24759368
tags question: http://stackoverflow.com/q/24884915
tags question: http://stackoverflow.com/q/24885517
tags question: http://stackoverflow.com/q/24887244
tags question: http://stackoverflow.com/q/24771648
tags question: http://stackoverflow.com/q/24865994
tags question: http://stackoverflow.com/q/24901162
tags question: http://stackoverflow.com/q/24762370
tags question: http://stackoverflow.com/q/24763498
tags question: http://stackoverflow.com/q/24862496
tags question: http://stackoverflow.com/q/24899588
tags question: http://stackoverflow.com/q/24872260
tags question: http://stackoverflow.com/q/24789896
tags question: http://stackoverflow.com/q/24764880
tags question: http://stackoverflow.com/q/24784302
tags question: http://stackoverflow.com/q/24827865
tags question: http://stackoverflow.com/q/24780213
tag name: d3.js
tags question: http://stackoverflow.com/q/24886919
tags question: http://stackoverflow.com/q/24770045
tags question: http://stackoverflow.com/q/24763177
tags question: http://stackoverflow.com/q/24827589
tags question: http://stackoverflow.com/q/24889820
tags question: http://stackoverflow.com/q/24837575
tags question: http://stackoverflow.com/q/24814264
tags question: http://stackoverflow.com/q/24791496
tags question: http://stackoverflow.com/q/24820665
tags question: http://stackoverflow.com/q/24797044
tags question: http://stackoverflow.com/q/24816240
tags question: http://stackoverflow.com/q/24797131
tags question: http://stackoverflow.com/q/24754239
tags question: http://stackoverflow.com/q/24769578
tags question: http://stackoverflow.com/q/24794967
tags question: http://stackoverflow.com/q/24832630

http://stackoverflow.com/q/24787779
answer count: 1
tagged with: jestjs
has answer: http://stackoverflow.com/a/24788524
accepted answer: http://stackoverflow.com/a/24788524
type: AnsweredQuestion
has title: has no method 'mountComponentIntoNode' with Jest + React
tagged with: unit-testing
type: Question
tagged with: reactjs
has body: Im brand new to React as well as Jest and I thought I had a fairly simple component but I keep getting this error and I dont see any info on it in their issues on GitHub and only one React specific, not Jest, question here. Full error is: TypeError: Object <UserInfo /> has no method 'mountComponentIntoNode' React Code /** @jsx React.DOM */ var React = require('react'); var Router = require('react-nested-router'); var user = require('../lib/stores/user'); /** * UserInfo * * Form for user's personal information. **/ var UserInfo = React.createClass({ handleSubmit: function(event) { event.preventDefault(); user.firstName = this.refs.firstName.getDOMNode().value; user.lastName = this.refs.lastName.getDOMNode().value; user.dateOfBirth = this.refs.dob.getDOMNode().value; user.ssn = this.refs.ssn.getDOMNode().value; Router.transitionTo('/contact-info'); }, render: function() { return ( First Name ... lots of inputs and labels ... ); } }); module.exports = UserInfo; Jest Code /** @jsx React.DOM */ jest.dontMock('../application/views/user-info.jsx'); var React = require('react/addons'); var UserInfo = require('../application/views/user-info.jsx'); var TestUtils = React.addons.TestUtils; describe('UserInfo', function () { it('example test only', function () { var userinfo = '<UserInfo />' TestUtils.renderIntoDocument(userinfo); }); });
tagged with: javascript
score: 0

http://stackoverflow.com/a/24794605
score: 1
has comment: http://stackoverflow.com/comment/38526413
accepted answer of: http://stackoverflow.com/q/24794354
has comment: http://stackoverflow.com/comment/38562868
answers question: http://stackoverflow.com/q/24794354
upvote count: 1
has comment: http://stackoverflow.com/comment/38528583
type: AcceptedAnswer
type: Answer
downvote count: 0
has body: A different approach to this might be to store a "blacklist" of times as an array and query that the current time is not one of those elements. It depends on how granular you need this to be. Hours or half hours may be reasonable, as far out as per minute is not too bad. So to generate the "blacklist" per minute you could do, as JavaScript code but the principles are easy to convert: var start = 22 * 60; var end = 8 * 60; var dnd = [start]; do { start++; if ( start == 1440 ) start = 0; dnd.push( start ); } while ( start != end ); db.user.update({},{ "$set": { "dnd": dnd } },true) Essentially setting the "blacklist" against the user record. Then when you query for say 1:30 in the morning, or the 90th minute you would do: db.user.find({ "dnd": { "$ne": 90 }) And since the "blacklist" contains that value then you do not return the user records where that value would be in the list. But for a time beyond the "dnd" range it would return: db.user.find({ "dnd": { "$ne": 481 }) Clearly you would generally want to exclude the array element when calling up details for the user record, but that is a simple matter of projection.

http://stackoverflow.com/comment/38509902
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24809113
type: AnswerComment
has text: Okay thank you! Am I to assume that raises the limit to 1024 ? also do I need to restart the bash shell?

http://stackoverflow.com/a/27493537
upvote count: 8
accepted answer of: http://stackoverflow.com/q/24769919
type: Answer
score: 8
answers question: http://stackoverflow.com/q/24769919
has body: {{#each users}} Email: {{emails.[0].address}} {{/each}} Don't call users once you're inside your {{#each users}} block .
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/38461969
comment on: http://stackoverflow.com/q/24783092
score: 1
has text: Is this what you want?: http://jsfiddle.net/SEqZG/47/
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24802405
tagged with: slick.js
has comment: http://stackoverflow.com/comment/46260356
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46063505
has body: I have a slick slider on my site and its working. What i need is to add a custom class to each item when the carousel renders. ex: This is one done with owl carousel if you use the following jQuery here: http://codepen.io/OwlFonk/pen/dpjhB jQuery(document).ready(function () { var carousel = jQuery("#owl-demo"); carousel.owlCarousel({ itemsCustom: [[0,5]], navigation : false, autoPlay : 10000, mouseDrag : true, touchDrag : true, pagination : false, rewindNav: true, afterAction: function(el){ //remove class active for ( var i = 0; i &lt; 10; i++ ) { this.$owlItems.removeClass('active' + i) } //add class active for ( var i = 0; i &lt; 10; i++ ) { this.$owlItems.eq(this.currentItem + i).addClass('active' + i) } } }); }); you will be able to see what i need. I cant seem to get it working with Slick. The reason im using Slick and not Owl is because Owl doesnt have infinite scrolling and Owl 2 is too buggy. I would consider using Owl 2 if i can do the same as above but they changed the script so much i cant get it working.
type: Question
tagged with: javascript
tagged with: jquery
has title: How to add custom class to each Slick Carousel item?
score: 0
tagged with: carousel

http://stackoverflow.com/comment/38566277
score: 0
type: AnswerComment
type: Comment
has text: yeah the problem is with that condition but ('!$userid>0') why? EX: id = 365 what is the inverse of 365? error... and the error > 0 ...something is bad
comment on: http://stackoverflow.com/a/24839137

http://stackoverflow.com/comment/38669842
type: AnswerComment
comment on: http://stackoverflow.com/a/24893462
type: Comment
has text: Why would this make a difference? Aren't parameters optional in JavaScript, and if you don't explicitly pass them in, then aren't the values undefined implicitly passed?
score: 0

http://stackoverflow.com/a/24785964
has comment: http://stackoverflow.com/comment/71889577
has body: I think this will work Title Content Title Content if you add the class in to accordion-body collapse it will be open by default.
downvote count: 0
answers question: http://stackoverflow.com/q/24785622
score: 6
type: Answer
upvote count: 6

http://stackoverflow.com/a/24825253
has body: Use the below code to get a callback event, after the new image is loaded var isrc = "http:\\fsomething "; var image = new Image(); image.onload=function(){ //Image load callback } image.src = isrc; $('body').append(image); Use this code in the ajax success function. Show a loading image before the ajax call and hide the loading image in the image load callback function.
answers question: http://stackoverflow.com/q/24825054
score: 0
type: Answer

http://stackoverflow.com/a/24877226
type: Answer
accepted answer of: http://stackoverflow.com/q/24876944
has comment: http://stackoverflow.com/comment/62284598
has comment: http://stackoverflow.com/comment/42041340
downvote count: 1
has comment: http://stackoverflow.com/comment/38714047
answers question: http://stackoverflow.com/q/24876944
has body: Based on your question, you can use ngChange to watch changes of baseValue and trigger the function. HTML &lt;section class="content row" ng-repeat="item in data"&gt; Name: {{item.name}} &lt;br/&gt; BaseValue: &lt;input type="text" ng-model="item.baseValue" ng-change="baseValueChange(item.baseValue)"/&gt; &lt;/section&gt; Controller $scope.baseValueChange = function(baseValue) { console.log("base value change", baseValue); } If you a more sophisticated version which can get oldValue and newValue, you can refer to this plunkr - http://plnkr.co/edit/hqWRG13gzT9H5hxmOIkO?p=preview HTML &lt;section class="content row" ng-repeat="item in data"&gt; Name: {{item.name}} &lt;br/&gt; BaseValue: &lt;input type="text" ng-init="item.oldBaseValue = item.baseValue" ng-model="item.baseValue" ng-change="baseValueChange(item.oldBaseValue, item.baseValue); item.oldBaseValue = item.baseValue"/&gt; &lt;/section&gt; Controller $scope.baseValueChange = function(oldVal, newVal) { console.log("base value change", oldVal, newVal); }
upvote count: 36
has comment: http://stackoverflow.com/comment/38714846
type: AcceptedAnswer
score: 35

http://stackoverflow.com/q/24832924
downvote count: 0
has comment: http://stackoverflow.com/comment/38618644
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38561763
has body: I'm trying to scrape a site that's jQuery based and I'm having trouble with getting the page to load completely before extracting the elements with Selenium. The page has multiple modules, each of which is a different query. I tried using the wait commands I found in the documentation, but it would usually hang the browser after one of the multiple queries load. For reference, my OS is Windows 7, Firefox 30.0, Python 2.7 and Selenium 2.42.1 The commands and results I tried are as follows: Explicit Wait: Browser hangs after loading the first query (Firefox Not Responding) try: element = WebDriverWait(browser, 10).until(EC.presence_of_element_located((By.XPATH, path))) finally: browser.quit() Expected Conditions: Browser hangs after loading the first query (Firefox Not Responding) wait = WebDriverWait(browser, 10) element = wait.until(EC.element_to_be_clickable((By.XPATH,path))) Implicit Wait: Firefox hangs after loading the first query (Firefox Not Responding) browser.implicitly_wait(10) # seconds myDynamicElement = browser.find_element_by_xpath(path) Custom Function: Page loads, but selenium starts scraping before the second query is loaded resulting in an error def wait_for_condition(browser,c): for x in range(1,10): print "Waiting for jquery: " + c x = browser.execute_script("return " + c) if(x): return time.sleep(1) def main(): wait_for_condition(browser,"jQuery.active == 0") #First element to be clicked on to scrape: path="//a[starts-with(@class, 'export db')]" browser.find_element_by_xpath(path).click() The error is: selenium.common.exceptions.NoSuchElementException: Message: u'Unable to locate element: {"method":"xpath","selector":"//a[starts-with(@class, \'export db\')]"}' ; Catching this exception and running wait_for_condition again in the except block causes the browser to stop loading the rest of the queries and hang: wait_for_condition(browser,"jQuery.active == 0") try: path="//a[starts-with(@class, 'export db')]" browser.find_element_by_xpath(path).clic…
has comment: http://stackoverflow.com/comment/38623673
type: UnansweredQuestion
tagged with: python
has comment: http://stackoverflow.com/comment/38634178
answer count: 0
score: 1
tagged with: selenium
upvote count: 1
type: Question
tagged with: javascript
has title: Firefox hang on jQuery based site after loading halfway when automating Selenium using Python
tagged with: firefox

http://stackoverflow.com/comment/38570131
comment on: http://stackoverflow.com/q/24834471
has text: @Chris - even MIT licensed like this one? Quite weird requirement from client :)
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/24861819
score: 0
answer count: 2
tagged with: highcharts
tagged with: jquery
has answer: http://stackoverflow.com/a/24862762
type: AnsweredQuestion
has title: Not able to render/retain graph on button click HighChart
has answer: http://stackoverflow.com/a/24862373
accepted answer: http://stackoverflow.com/a/24862373
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24862762
has body: I am trying to plot a graph on click of a button. In my code below when I click on button 'click me' I am able to see graph displaying on my screen but it quickly disappers from screen. I thing the graph is not being rendered. I am not sure where am I going wrong. I need the graph to persist on my screen. I shall be populating the values for data and categories dynamically once I get this issue solved. I need to call jquery function from javascript function only due to structure of my exisiting code. Can anyone please let me know why the graph is not just persisted or retained on screen. Click me

http://stackoverflow.com/comment/38575367
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24843948
has text: Updated answer but I'm no specialist sorry…
score: 0

http://stackoverflow.com/q/24784686
duplicate of: http://stackoverflow.com/q/6093534
has comment: http://stackoverflow.com/comment/38464059
has comment: http://stackoverflow.com/comment/38464164
linked to: http://stackoverflow.com/q/588004
has comment: http://stackoverflow.com/comment/38465005
type: Question
has comment: http://stackoverflow.com/comment/38464076
tagged with: javascript
tagged with: jquery
has title: Why does opacity of .3 in JQuery sometimes go to .30000000000000004 instead?
has comment: http://stackoverflow.com/comment/38464403
score: 0
has comment: http://stackoverflow.com/comment/38463985
has comment: http://stackoverflow.com/comment/38464025
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/6093534
has body: On my website, I have div layers that if you hover, it changes the opacity from .3 to 1, and when you hover out, it goes to 1 back to .3. The odd thing I'm noticing is that it changes to: &lt;div id="penta1" style="height: 945px; width: 380px; opacity: 0.30000000000000004;"&gt; While some instances it reverts back to: &lt;div id="penta1" style="height: 945px; width: 380px; opacity: 0.3;"&gt; My code is rather awkward, I was kind of dazed and frustrated while trying to get it to work, so don't yell at me in the comments that it is bad. I know it's bad. However, for those of you who are OCD about code optimization and neatness, feel free to organize, and condense to your hearts desire: var contentWidth; var allPenta = '#penta1,#penta2,#penta3,#penta4'; var allButton = '.button1,.button2,.button3,.button4'; var allFullPenta = '#pentafull1,#pentafull2,#pentafull3,#pentafull4' function simplyWidth(wrapper, menu1, content, pentas){ var menu = $(menu1).width(); var wrapperwidth = $(wrapper).width(); var newWidth = wrapperwidth-menu; var widgetWidth = newWidth/4; contentWidth = newWidth; $(content).css("width", newWidth); $(pentas).css("width", widgetWidth); }; var contentHeight function simplyHeight(footer, bottom, wrapper, pentas){ var footheight = $(footer).height(); var bottomalign = $(bottom).height(); var wrapperheight = $(wrapper).height(); var newHeight = footheight + bottomalign; var newnewHeight = wrapperheight - newHeight; contentHeight = newnewHeight; $(pentas).css("height", newnewHeight); }; function simplyDimension(){ $(allFullPenta).css("width", contentWidth); $(allFullPenta).css("height", contentHeight); } var stoppable = true; function simplyHighlight(penta){ $(penta).fadeTo(0,.3) $(penta).mouseenter(function(){ if (stoppable == true) { $(penta).stop(); $(penta).fadeTo(200,1); }; }); $(penta).mouseleave(function(){ if (stoppable == true) { $(penta).stop(); $(penta).fadeTo(300,.3); }; }); } function simplySpan(button, fullpenta){ $(button).click(function(){ …
has comment: http://stackoverflow.com/comment/38463951

http://stackoverflow.com/a/24877753
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24847640
score: 2
upvote count: 2
has body: I ended up altering PeerJS to return a Blob on connection.send. This blob has a size parameter, in bytes. I don't know (yet) if this is exactly the size-on wire, but it seems like a good start. https://developer.mozilla.org/en-US/docs/Web/API/Blob.size

http://stackoverflow.com/q/24759309
has comment: http://stackoverflow.com/comment/38416657
has comment: http://stackoverflow.com/comment/38416942
has answer: http://stackoverflow.com/a/24759971
has comment: http://stackoverflow.com/comment/38416817
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38416458
accepted answer: http://stackoverflow.com/a/24759971
has comment: http://stackoverflow.com/comment/38417003
has comment: http://stackoverflow.com/comment/38416368
downvote count: 3
type: Question
tagged with: jquery-mobile
tagged with: javascript
tagged with: jquery
score: -1
answer count: 1
has comment: http://stackoverflow.com/comment/38416608
favorite count: 0
has body: I have the following HTML: List 1 Menu 1 I am trying to give the fieldset and hiddenset divs the same height in mobile devices when the orientation changes. Script window.addEventListener("resize", function() { $('div.parent').each(function(){ var h = $(this).find('fieldset').height(); $(this).find('hidenset').attr('height',h+'px'); }); but this script is not working properly Thanks & Regards
upvote count: 2
has title: How to make height of two div same dynamically when orientation changes

http://stackoverflow.com/q/24801124
accepted answer: http://stackoverflow.com/a/27163343
has body: I am currently using window.showModalDilog to open a modal pop up window which is not allowing the parent window to do any action. But through Google search, I found that it is not the standard method and various browsers has stopped supporting this function. In fact I am facing this problem in Opera. Opera gives me a Javascript error and stops execution at that point. Nothing can happen after that error. So, I have only one option left and that is window.open. But I want to disable parent window (likewise in showModalDilog). I tried below code to do so: $(window).load(function() { window.opener.document.body.disabled=true; }); $(window).unload(function() { window.opener.document.body.disabled=false; }); But that did not work. I want to open an URL in the pop-up window and then do certain actions after the URL is opened, including submitting a form. My code to open a pop up: window.open("https://www.picpixa.com/wp-content/plugins/create-own-object/plugin-google-drive/index.php", "socialPopupWindow", "location=no,width=600,height=600,scrollbars=yes,top=100,left=700,resizable = no"); It would also help if I could open only one pop-up window on the clicking of multiple buttons. I mean if I click on "btn1" a pop-up named "temp" shall open. But if I click on "btn2" then instead of opening a new pop up "temp" shall reload.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24801245
tagged with: popup
type: Question
upvote count: 9
has comment: http://stackoverflow.com/comment/38496794
has comment: http://stackoverflow.com/comment/38495498
tagged with: javascript
score: 9
has answer: http://stackoverflow.com/a/27163343
answer count: 3
downvote count: 0
has title: How to show a modal pop-up using `window.open`?
tagged with: jquery
favorite count: 0
tagged with: popupwindow
possible better answer: http://stackoverflow.com/a/26356871
has answer: http://stackoverflow.com/a/26356871

http://stackoverflow.com/q/24759763
tagged with: google-maps-api-3
has title: Google Place Autocomplete Address Form with Latitude & Longitude
favorite count: 0
score: 2
answer count: 0
has body: I am using Place Autocomplete Address Form but unfortunately I am not good with Google Map APIs and jQuery. Now I have implemented code in my own HTML and what I tried to add selected place latitude &amp; longitude to text box but don't know something is wrong in my code. I am getting same latitude &amp; longitude every time. I have two more queries that I want to correct in my customized code: If user select any place then add latitude &amp; longitude to text box. Latitude &amp; Longitude getting in text box after few seconds. My modified code is: // [START region_geolocation] // Bias the autocomplete object to the user's geographical location, // as supplied by the browser's 'navigator.geolocation' object. function geolocate() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { var geolocation = new google.maps.LatLng( position.coords.latitude, position.coords.longitude ); var latitude = position.coords.latitude; var longitude = position.coords.longitude; alert(latitude); alert(longitude); document.getElementById("latitude").value = latitude; document.getElementById("longitude").value = longitude; autocomplete.setBounds(new google.maps.LatLngBounds(geolocation,geolocation)); }); } } My JSFiddle: http://jsfiddle.net/vjwsH/ I feel happy if you try to help me. Thanks
upvote count: 2
has comment: http://stackoverflow.com/comment/38423472
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38421523
type: Question
has comment: http://stackoverflow.com/comment/38418561
tagged with: google-maps
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/24763049
has body: I have a utility to augment an object to express the current ajax state as follows: define(['ko'], function (ko) { var ajaxStatus = { success: 2, failure: -1, working: 1, none: 0, }; return { ajaxStatusHelper: init, }; function init(target) { if (target == undefined) throw new Error("Target cannot be undefined."); target.ajaxStatus = ko.observable(ajaxStatus.none); target.indicateSuccess = success.bind(target); target.indicateWorking = working.bind(target); target.indicateFailure = failure.bind(target); target.clearStatus = clear.bind(target); // computed properties target.ajaxSuccess = ko.computed(function () { return this.ajaxStatus() === ajaxStatus.success; }, target); target.ajaxFailure = ko.computed(function () { return this.ajaxStatus() === ajaxStatus.failure; }, target); target.ajaxWorking = ko.computed(function () { return this.ajaxStatus() === ajaxStatus.working; }, target); target.ajaxInactive = ko.computed(function () { return this.ajaxStatus() === ajaxStatus.none; }, target); return target; } // functions function clear() { this.ajaxStatus(ajaxStatus.none); } function success() { this.ajaxStatus(ajaxStatus.success); } function working() { this.ajaxStatus(ajaxStatus.working); } function failure() { this.ajaxStatus(ajaxStatus.failure); } }); This utility might be utilized to extend multiple objects within the same view model object. For instance, I'll typically extend command members which make an async ajax call so that the view can display in icon indicating the result of the call on the command (with a KO binding not shown here). My question is what responsibility do I have for cleaning up these augmented nodes and what mechanism is in place to manage this cleanup. According to Michael Best, The JavaScript garbage collector can only dispose a computed observable once all references to it and its dependencies are dropped. Does this mean that I need to manually dispose these augmented members from the view model when the model is being disposed? Or will K…
tagged with: knockout.js
has title: Disposal function for Knockout dependencies
type: Question
linked to: http://stackoverflow.com/q/14389351
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38478553
has comment: http://stackoverflow.com/comment/38439034
has comment: http://stackoverflow.com/comment/38469964
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38437828
tagged with: memory-management
answer count: 0

http://stackoverflow.com/comment/38715929
comment on: http://stackoverflow.com/a/24894035
type: Comment
has text: Updated the description so people undrestand better now :)
score: 0
type: AnswerComment

http://stackoverflow.com/q/24795145
has answer: http://stackoverflow.com/a/24795216
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/24795470
has answer: http://stackoverflow.com/a/24795470
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24795271
has comment: http://stackoverflow.com/comment/38484148
score: 1
has title: dynamic variable setting <href> into Ajax
has answer: http://stackoverflow.com/a/24795240
upvote count: 1
has body: Hi All i have a quick question about JSON data into href for AJAX I have JSON coming into AJAX example data[i].listingid How do i put that into a href inside the ajax? Below are my codes, it will explain the situation more clearly. Thanks for your time &lt;script&gt; $.ajax({ type: "GET", url: "listing.php", dataType: 'json', success: function (data) { for (var i = 0; i &lt; data.length; i++) { console.log(data) var listingid = data[i].listingid; var myOtherUrl = "SpecificListing.html?Listingid=" + encodeURIComponent(listingid); var html1 = "&lt;div class=two&gt; Listing Address : " + data[i].address + "&lt;a href=myOtherurl&gt;" + data[i].listingid + "Click to view the details" + "&lt;/div&gt;" + "&lt;/a&gt;" $('#display12').append(html1); } } }); &lt;/script&gt;
type: Question
accepted answer: http://stackoverflow.com/a/24795240
tagged with: javascript
tagged with: ajax

http://stackoverflow.com/comment/38532706
type: Comment
score: 0
comment on: http://stackoverflow.com/q/24821208
type: QuestionComment
has text: ok, then what is this injected `$element`?it's jQuery, jQuery lit or angular.element?

http://stackoverflow.com/q/24821338
has title: button.click() does not work under IE11
possible better answer: http://stackoverflow.com/a/24821623
has answer: http://stackoverflow.com/a/24821419
upvote count: 1
type: AnsweredQuestion
tagged with: internet-explorer
score: 1
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/24821623
has body: I have created a jqx menu with the following script: Sign off So I'd like to trigger a click event on the "logOffButton" once the user clicked to the menu item. The code for the button: So once the button click is triggered, it creates an JS alert message and if the user press OK it submits the form. The problem is that while this works fine under Chrome and Firefox, it doesn't work under IE11. The full code can be found here: http://jsfiddle.net/82xhy/1/
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/24821419
favorite count: 0

http://stackoverflow.com/comment/38627219
type: Comment
has text: It's hard to tell without seeing the actual code and knowing which slider you are using. Can you update the questing with a link to the plugin and your full .html file?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24870457

http://stackoverflow.com/q/24763498
has title: D3.js: Using images (with filenames specified in data) as tick values on axis
tagged with: image
score: 36
has comment: http://stackoverflow.com/comment/38423968
has comment: http://stackoverflow.com/comment/38456720
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/51187540
has body: I currently have this data: var dataset = [ { "bank": "Bank 1", "img": "Picture1.png" }, { "bank": "Bank 2", "img": "Picture2.png" }, { "bank": "Bank 3", "img": "Picture3.png" } ]; Complex real-world data, right? Sure. OK, I currently have "bank" as the tick values on my axis with this D3.js code: var w = 1000; var h = 700; var padding = 30; var wpadding = 120; var svg = d3.select("body") .append("svg") .attr("width", w) .attr("height", h+padding); var yScale = d3.scale.ordinal() .domain(dataset.map(function (d) { return d.bank; })) .rangeRoundBands([0, h], 0.55); var yAxis = d3.svg.axis() .scale(yScale) .orient("left"); svg.append("g") .attr("class", "axis") .attr("transform", "translate(" + wpadding + ", 0)") .call(yAxis); Anyway, I'm sure you can see where I'm going with this. I'm now trying to make the tick values on my axis reference the img value in my dataset, rather than just the bank value. At first I thought it was a case of using axis.tickValues([values]) with an anonymous function to reference the img values in my JSON data, but it's not working. Or I'm doing it horribly wrong. Then I thought it was a case of using: var imgs = svg.selectAll("img").data([dataset]); but then my concern with this method is that this won't be properly bound to the axis, like proper tick values; It's like they're just a collection of images which happen to be sitting next to my axis, and sizing/positioning changes I make to my axis I have to separately apply to my collection of images as well. It just doesn't seem as elegant as having proper images-as-tick-values-on-my-axis. Am I doing something horribly wrong? Does anyone need me to provide more info? Thanks again gals &amp; guys! UPDATE: Thanks to @larskotthoff , I've added this: svg.select(".axis").selectAll("text").remove(); var ticks = svg.select(".axis").selectAll(".tick") .data(dataset) .append("svg:image") .attr("xlink:href", function (d) { return d.img ; }) .attr("width", 100) .attr("height", 100); And it (almost) wo…
has comment: http://stackoverflow.com/comment/38462986
favorite count: 0
tagged with: d3.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/49876994
has comment: http://stackoverflow.com/comment/51782839
has comment: http://stackoverflow.com/comment/50655121
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/31954154
has comment: http://stackoverflow.com/comment/38458181
has comment: http://stackoverflow.com/comment/43609890
type: Question
upvote count: 36
tagged with: javascript

http://stackoverflow.com/comment/38572167
has text: You're right. I have corrected it in my answer.
type: AnswerComment
comment on: http://stackoverflow.com/a/24842189
score: 0
type: Comment

http://stackoverflow.com/q/24825460
has body: I created a mobile app using cordova and jQuery mobile as the UI framework. It is working fine, except that the click event on the jQuery mobile buttons does not trigger when clicking on the corners. I see a hover effect (button color change) when clicking at corner, but click event not triggered. Click event is triggered when clicked a little inside from button corner. I am using jQuery mobile 1.4.2. Below is my button (anchor tag with class showOptions and ui-btn) markup and click handler: All Packages Options $('.showOptions').on('click', function() { console.log('button clicked'); return false; }); Is anybody out there also facing same issue? Please help me.
has comment: http://stackoverflow.com/comment/38550107
type: Question
has title: Jquery mobile button click at corner not working
tagged with: jquery-mobile-button
has comment: http://stackoverflow.com/comment/38544606
tagged with: jquery-mobile
has answer: http://stackoverflow.com/a/24825505
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
tagged with: cordova
type: UnansweredQuestion

http://stackoverflow.com/q/24800142
score: 0
has comment: http://stackoverflow.com/comment/38493561
has title: Return a text string if no values found
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/38494549
downvote count: 1
has body: I am displaying a google map if latitude and longitude values for a camera object are found. (These values are fetched with ruby.) I have got it so that if longitude values aren't found the map is not displayed (1st line) but I can't get the text string to appear. function initialize() { if (cameraLong === '') return; var cameraLatlng = new google.maps.LatLng(cameraLong, cameraLat); var mapOptions = { zoom: 8, center: cameraLatlng } var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var marker = new google.maps.Marker({ position: cameraLatlng, map: map, title: 'Camera Location' }); var mapFirstClick = false; $("#nav-tabs").click(function() { mapFirstClick || setTimeout(function() { google.maps.event.trigger(map, 'resize'); mapFirstClick = true; map.setCenter(cameraLatlng); }, 200); }); } google.maps.event.addDomListener(window, 'load', initialize);
has comment: http://stackoverflow.com/comment/38493441
has comment: http://stackoverflow.com/comment/38493111
type: AnsweredQuestion
tagged with: javascript
tagged with: string
type: Question
has answer: http://stackoverflow.com/a/24802163
favorite count: 0
accepted answer: http://stackoverflow.com/a/24802163
tagged with: return-value

http://stackoverflow.com/q/24799297
has body: I am in doubt if the following design pattern would cause a memory leak. I have been using it for some time with success, but I haven't seen this pattern used by others, so I'd like some confirmation if you see something wrong with it. As from next month I have to start working on a large project, and I want to know for sure that I can use this without problems, or if I should use another strategy. controller.js: var Controller = function(options){ }; Controller.prototype.makeView = function(options){ options.controller = this; options.otheroption = options.otheroption; var view = new View(options); }; Controller.prototype.getModel = function(options){ //--- Get model --- var model = new Model(); var promise = model.fetch(); return promise; }); view.js: var View = Backbone.View.extend({ initialize: function(options){ this.controller = options.controller; this.otheroption = options.otheroption; }, getModel: function(){ var promise = this.controller.getModel(); promise.done(_.bind(function(model){ //Do something with the returned model instance }, this)); }; }); Instantiate controller, eg. from the router, or another controller: //--- Instantiate the controller and build the view ---// var controller = new Controller(); controller.makeView(options) To me, this doesn't look like a circular reference, because both the controller and view are declared as a local variable. Yet the instantiated view can access the controller functions, which allows me to isolate the RESTful server interactions via models / collections that the view uses. For me it would seem as if the only reference remaining would be the view that keeps a reference to the controller object. What I do afterwards is clean up the view (I destroy the instance and its references when I don't need it anymore. Your opinion on this pattern is highly appreciated. My purpose is to isolate creation of views / server interactions in separate controller files: if you see holes in my method and have a better way of doi…
possible better answer: http://stackoverflow.com/a/24844333
tagged with: javascript
has answer: http://stackoverflow.com/a/24844333
has answer: http://stackoverflow.com/a/24963376
has answer: http://stackoverflow.com/a/24896131
has title: Circular reference memory leak?
answer count: 3
downvote count: 0
favorite count: 0
tagged with: backbone.js
upvote count: 2
tagged with: memory-leaks
accepted answer: http://stackoverflow.com/a/24896131
score: 2
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/38542308
comment on: http://stackoverflow.com/q/24826313
has text: This simple answer is no. (If I understand your question you are wanting to get content that hasn't even been loaded to the page from the server yet)
type: Comment
score: 1
type: QuestionComment

http://stackoverflow.com/q/24783015
has comment: http://stackoverflow.com/comment/38461638
has title: jQuery.get - how to get text instead of html?
type: Question
has comment: http://stackoverflow.com/comment/38460784
has comment: http://stackoverflow.com/comment/38462800
tagged with: javascript
has comment: http://stackoverflow.com/comment/38462956
score: 0
accepted answer: http://stackoverflow.com/a/24783107
has comment: http://stackoverflow.com/comment/38460693
has comment: http://stackoverflow.com/comment/38460761
has comment: http://stackoverflow.com/comment/38460882
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/38462514
tagged with: ajax
has answer: http://stackoverflow.com/a/24783107
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38460780
has comment: http://stackoverflow.com/comment/38462581
has comment: http://stackoverflow.com/comment/38461821
type: AnsweredQuestion
has body: I have following code to get data from other site: jQuery.ajaxSetup({ crossDomain: true, dataType: "jsonp text" }); jQuery.get(url, function(rawContent) { console.log(rawContent); }); But I got a error: "Syntax error" from jQuery, becouse target site use following doctype: &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; How can I get text by this query instead of html?
has comment: http://stackoverflow.com/comment/38460827
has comment: http://stackoverflow.com/comment/38460874
has comment: http://stackoverflow.com/comment/38460728

http://stackoverflow.com/comment/38666833
score: 0
type: AnswerComment
type: Comment
has text: Thank you kevin. By Description, this library looks quite promising. I will give it a try. :)
comment on: http://stackoverflow.com/a/24876697

http://stackoverflow.com/q/24793051
has answer: http://stackoverflow.com/a/60203486
has answer: http://stackoverflow.com/a/65434997
has answer: http://stackoverflow.com/a/68605175
linked to: http://stackoverflow.com/q/79207830
has answer: http://stackoverflow.com/a/58816115
has comment: http://stackoverflow.com/comment/38480431
has answer: http://stackoverflow.com/a/65065057
has comment: http://stackoverflow.com/comment/38480451
has answer: http://stackoverflow.com/a/24793121
has comment: http://stackoverflow.com/comment/90274165
has comment: http://stackoverflow.com/comment/38480393
tagged with: javascript
has answer: http://stackoverflow.com/a/62659893
has answer: http://stackoverflow.com/a/24793135
has answer: http://stackoverflow.com/a/68700869
has answer: http://stackoverflow.com/a/69544616
has answer: http://stackoverflow.com/a/49895496
score: 13
has comment: http://stackoverflow.com/comment/38480399
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/65323131
has comment: http://stackoverflow.com/comment/38480352
has answer: http://stackoverflow.com/a/69364492
has answer: http://stackoverflow.com/a/57826054
has answer: http://stackoverflow.com/a/53145749
has answer: http://stackoverflow.com/a/24793128
has answer: http://stackoverflow.com/a/60071187
has answer: http://stackoverflow.com/a/53358538
favorite count: 0
has comment: http://stackoverflow.com/comment/38480438
has comment: http://stackoverflow.com/comment/38480251
has answer: http://stackoverflow.com/a/60349696
has answer: http://stackoverflow.com/a/50574198
has answer: http://stackoverflow.com/a/63300459
has comment: http://stackoverflow.com/comment/38480281
has answer: http://stackoverflow.com/a/60654215
type: Question
has answer: http://stackoverflow.com/a/79130447
has title: return the first non repeating character in a string in javascript
has answer: http://stackoverflow.com/a/58235409
has answer: http://stackoverflow.com/a/62289762
has answer: http://stackoverflow.com/a/52877468
has answer: http://stackoverflow.com/a/54851834
has comment: http://stackoverflow.com/comment/38480459
has answer: http://stackoverflow.com/a/79208054
possible better answer: http://stackoverflow.com/a/24793289
answer count: 34
has comment: http://stackoverflow.com/comment/38480639
upvote count: 14
has answer: http://stackoverflow.com/a/69380985
has answer: http://stackoverflow.com/a/74942602
has answer: http://stackoverflow.com/a/24793289
accepted answer: http://stackoverflow.com/a/24793128
has body: So I tried looking for this in the search but the closest I could come is a similar answer in several different languages, I would like to use Javascript to do it. The problem is I have an arbitrary string that I would like to return the first non repeating character. EX: 'aba' -> would return b 'aabcbd' -> would return c. This is what I have so far, just a simple for loop to start. var someString = 'aabcbd'; var firstNonRepeatedCharacter = function(string) { for(var i = 0; i &lt; someString.length; i++){ } }; http://jsfiddle.net/w7F87/ Not sure where to go from here
has answer: http://stackoverflow.com/a/61821214
downvote count: 1
has comment: http://stackoverflow.com/comment/38480182
has comment: http://stackoverflow.com/comment/38480236
has answer: http://stackoverflow.com/a/54512044
has answer: http://stackoverflow.com/a/24793178

http://stackoverflow.com/comment/38602644
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24857520
score: 0
has text: *response data* should be concatenated, not the returned promise.

ajaxcontroltoolkit
tags question: http://stackoverflow.com/q/24863889
tags question: http://stackoverflow.com/q/24889277
tags question: http://stackoverflow.com/q/24810996
tag name: ajaxcontroltoolkit
type: Tag

http://stackoverflow.com/q/24861251
tagged with: ember-data
tagged with: javascript
has comment: http://stackoverflow.com/comment/38688093
has body: I am trying to create an Ember.js app on a domain that has a ton of different sublevel sites. I'm trying to set my rootURL to '/org/new/' like the docs say so that the root URL will be mydomain.com/org/new/. I'm using the following router code: App.Router.reopen({ rootURL: '/org/new/' }); App.Router.map(function() { this.resource('carouselItems', { path: '/' }, function() { // child routes }); }); App.CarouselItemsRoute = Ember.Route.extend({ model: function() { return this.store.find('carouselItem'); } }); However, my app keeps trying to load mydomain.com/carouselItems instead. I have a CarouselItemsController that extends ArrayController and a CarouselItemController that extends ObjectController. Both are used when the user navigates to mydomain.com/org/new/ to generate some items in a Bootstrap carousel.
has comment: http://stackoverflow.com/comment/42126161
has title: Ember.js Won't Accept Root URL
has comment: http://stackoverflow.com/comment/38687846
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/42163371
favorite count: 0
has comment: http://stackoverflow.com/comment/38689242
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38688227
tagged with: ember.js
tagged with: url-routing
has comment: http://stackoverflow.com/comment/38688384
answer count: 0
has comment: http://stackoverflow.com/comment/42134918
upvote count: 1
has comment: http://stackoverflow.com/comment/42321591
type: Question
has comment: http://stackoverflow.com/comment/38688197

http://stackoverflow.com/q/24803456
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24803808
has answer: http://stackoverflow.com/a/24803678
tagged with: css
has body: I have created an animated menu that opens when the users cursor is placed within 20px of the right hand side of their screen. I want to prevent the menu opening if the users cursor moves out of this region within 2 seconds but I'm struggling with the Javascript timeouts. My code looks like this so far: HTML Javascript // Timer variable var timer; function openToolbar() { // Only execute for desktop $('.no-touch').on('mousemove',function(event) { // Toolbar and Window width var tableToolbar = $('.ac-table-toolbar'), winWidth = $(window).width(); // If cursor enters right hand side of the screen start the timer // and execute after 2 seconds if(event.pageX &gt; (winWidth - 20)) { // Timeout timer = setTimeout(function() { // Add active class to toobar and css transition will animate it // to open position tableToolbar.addClass('active').removeClass('notActive'); }, 2000); } // If mouse pointer leaves right hand side of the screen and // still has notActive class cancel the timeout to prevent // the toolbar from opening if(event.pageX &lt; (winWidth - 20) &amp;&amp; tableToolbar.hasClass('notActive')) { clearTimeout(timer); } // Toolbar has active class so we know its visible if(tableToolbar.hasClass('active') &amp;&amp; event.pageX &lt; (winWidth - 220)) { // Clear timeout (if needed?) clearTimeout(timer); // Remove active class and css transition will return it to docked position tableToolbar.removeClass('active').addClass('notActive'); } }); } The animation is handled with CSS transitions that are triggered by the active notActive classes. Please can anyone point me in the right direction. Many thanks in advance.
type: AnsweredQuestion
tagged with: timeout
type: Question
possible better answer: http://stackoverflow.com/a/24804107
has comment: http://stackoverflow.com/comment/38499439
has answer: http://stackoverflow.com/a/24804107
accepted answer: http://stackoverflow.com/a/24803808
has title: Javascript clear timeout on mousemove
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3

http://stackoverflow.com/q/24875603
tagged with: refresh
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/43495024
answer count: 1
has comment: http://stackoverflow.com/comment/38766811
has comment: http://stackoverflow.com/comment/38636386
tagged with: angularjs
has body: Im trying to handle the action of the user before refreshing the page using F5 or the refresh button or what ever so i can call a function that close some process.
has comment: http://stackoverflow.com/comment/38708864
has title: How to handle a before refresh the window with angular
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38707967
has comment: http://stackoverflow.com/comment/38765617
type: Question

http://stackoverflow.com/q/24772164
has comment: http://stackoverflow.com/comment/38440384
has comment: http://stackoverflow.com/comment/38440100
has answer: http://stackoverflow.com/a/24772481
possible better answer: http://stackoverflow.com/a/24772432
has answer: http://stackoverflow.com/a/24772432
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/24772576
has comment: http://stackoverflow.com/comment/38440108
answer count: 4
type: AnsweredQuestion
has body: I have a table.It has 2 td and 5 tr.In one td, it has a text.I want to cover that with Input Tag when I click the button. My leader told me only table name and that td id . And I can't insert onclick event in html inline.. So,How Can I control for that Click? and How can I insert HTML td tag dynamically to cover text? &lt;script type="text/javascript"&gt; function editTd() { var rows = document.getElementById('control'); var input = document.createElement('input'); input.type = "text"; input.name="copytext"; rows.appendChild(input); } window.onload = function(){ document.getElementsByName("submitConfirm").onclick = editTd; }; &lt;/script&gt; That's my prepared Code now. Pls help me
has title: Insert HTML tag dynamically within td to cover text
has comment: http://stackoverflow.com/comment/38440619
type: Question
has comment: http://stackoverflow.com/comment/38440437
tagged with: javascript
has answer: http://stackoverflow.com/a/24772368
accepted answer: http://stackoverflow.com/a/24772368
has comment: http://stackoverflow.com/comment/38440166
has comment: http://stackoverflow.com/comment/38440243
has comment: http://stackoverflow.com/comment/38440194
score: 0

http://stackoverflow.com/comment/38744304
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24909117
has text: Solved by just sending over base64 strings instead of arrayBuffers.
score: 0

http://stackoverflow.com/q/24810820
tagged with: typeerror
answer count: 1
tagged with: undefined
has body: 1. $(document).ready(function(){ 2. $('.fade').slick({ 3. dots: true, 4. infinite: true, 5. speed: 500, 6. fade: true, 7. slide: '&gt; div', 9. cssEase: 'linear' 10. }); 11.}); The code above is from Slick Courseal, I am new to JQuery and JS, the web console (Chrome Developer tools) throw this error at line 2. Uncaught TypeError: undefined is not a function I followed the Directions at http://kenwheeler.github.io/slick/, the fade example and its throwing this same error when I run this script. I copied and pasted the example code, but doesn't get through. I am not sure what I am doing wrong, or why its throwing that error? Did the guy who made slick messed up in his code?
has title: Slick Carousel - Uncaught TypeError: undefined is not a function
has comment: http://stackoverflow.com/comment/38513492
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25276512
has comment: http://stackoverflow.com/comment/38513545
type: Question
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25276512
score: 0

http://stackoverflow.com/q/24812785
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/24813514
answer count: 2
linked to: http://stackoverflow.com/q/18183313
downvote count: 0
score: 7
favorite count: 0
tagged with: ajax
has title: How to load blade or php content into a view via ajax/jquery in laravel?
has body: As the title says, I am trying to dynamically load content in a view using ajax requests. I know this can be done if you are using html elements e.g. ("#div_place").html(&lt;p&gt;...). The problem lies when I would like to load some php/blade objects into a div for instance. Is this possible or is there a different way to go about achieving the result I want.
tagged with: php
tagged with: laravel
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24813499
upvote count: 7

http://stackoverflow.com/q/24750168
has body: I am new to js and I want to draw a chord diagram for a dataset looks like this: From To A B A C A C B C B A C A I have used the below coding but it does not work: d3.csv('data/email1.csv', function (error, data) { var mpr = chordMpr(data); mpr.addValuesToMap('From') .addValuesToMap('To') .setFilter(function (row, a, b) { return (row.From === a.name &amp;&amp; row.To === b.name) || (row.From === b.name &amp;&amp; row.To === a.name); }) .setAccessor(function (recs, a, b) { if (!recs[0]) return 0; return recs.length; }); drawChords(mpr.getMatrix(), mpr.getMap()); }); Can anyone help? Many thanks!!!
has title: Matrix in Chord Diagram
type: UnansweredQuestion
answer count: 0
score: 1
upvote count: 1
tagged with: chord-diagram
type: Question
tagged with: javascript
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/38601925
has text: @FelixKling The code wants a single kiss addition when one person kisses. In short, it wants Justice
type: QuestionComment
comment on: http://stackoverflow.com/q/24857575
type: Comment
score: 0

http://stackoverflow.com/q/24779672
has comment: http://stackoverflow.com/comment/38455237
duplicate of: http://stackoverflow.com/q/912711
upvote count: 5
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38454230
answer count: 1
has answer: http://stackoverflow.com/a/24781219
favorite count: 0
tagged with: backbone.js
score: 5
tagged with: http://stackoverflow.com/tag/html
has body: Inside one of my views, I'd like to load this script: Is it possible to do that?
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/21294
has comment: http://stackoverflow.com/comment/38456639
accepted answer: http://stackoverflow.com/a/24781219
linked to: http://stackoverflow.com/q/912711
duplicate of: http://stackoverflow.com/q/21294
type: Question
has title: How do I load a script dynamically via Backbone?

http://stackoverflow.com/comment/40464148
comment on: http://stackoverflow.com/a/25733814
type: Comment
has text: Could I get some kind of explanatory comment for the downvote?
type: AnswerComment
score: 0

http://stackoverflow.com/q/24889045
has title: Using jQuery .get to show parameters in URL
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/38661277
tagged with: javascript
has body: When using a GET request on a form in regular HTML we get the variables within the URL. Is there a Jquery way to sent variables like this by clicking a button? I have been looking into Jquery .get but i can't get my parameters to show up in the URL. Following does not load the page and add to URL, it just runs the code with specified parameters. $.get( "home.php", { name: "menyo" } ); So i am looking for a way to do this in a clean Jquery way. It is because i have many buttons that do various Jquery things and i do not want to create a form for each one with their own get request while i automated buttons with button classes using custom attributes in the HTML.
tagged with: jquery
has comment: http://stackoverflow.com/comment/38661419
score: 0
has comment: http://stackoverflow.com/comment/38661498
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38661713
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38661897
has comment: http://stackoverflow.com/comment/38661553
has comment: http://stackoverflow.com/comment/38661340
has comment: http://stackoverflow.com/comment/38661139
has answer: http://stackoverflow.com/a/24889162
has comment: http://stackoverflow.com/comment/38661318
has answer: http://stackoverflow.com/a/24889517

http://stackoverflow.com/comment/38446917
comment on: http://stackoverflow.com/q/24775680
has text: A element cannot have a FileList object, and it also does not have a 'change' event
score: 2
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38611732
type: Comment
type: QuestionComment
has text: That'll only work if the `signaturePad` saves its settings in the DOM. Check the `signaturePad` documentation for how to change settings. If all else fails, remove the element, re-add it and reinitialize the `signaturePad`.
score: 0
comment on: http://stackoverflow.com/q/24862932

http://stackoverflow.com/q/24861952
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38616473
upvote count: 1
has comment: http://stackoverflow.com/comment/38610081
downvote count: 1
has body: I am trying to display XML in an HTML page It works like a charm in W3School Try it yourself section, but I want to run it from my local computer, how can i do this?
has title: How to run a script locally
type: Question
has comment: http://stackoverflow.com/comment/38610285
has comment: http://stackoverflow.com/comment/38612237
tagged with: javascript
has comment: http://stackoverflow.com/comment/38618236
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38655737
has comment: http://stackoverflow.com/comment/38610018
has comment: http://stackoverflow.com/comment/38610011
has comment: http://stackoverflow.com/comment/38610175
favorite count: 0

http://stackoverflow.com/comment/38670389
comment on: http://stackoverflow.com/q/24893756
type: Comment
type: QuestionComment
score: 2
has text: Without manipulating code structure, I don't think you can do anything with this behavior.

http://stackoverflow.com/q/24892585
tagged with: javascript
has answer: http://stackoverflow.com/a/24892772
answer count: 2
has answer: http://stackoverflow.com/a/24894951
downvote count: 0
score: 1
favorite count: 0
possible better answer: http://stackoverflow.com/a/24894951
has title: registry.byID set content returns Unable to get property 'set' of undefined or null reference
tagged with: dojo
accepted answer: http://stackoverflow.com/a/24892772
type: AnsweredQuestion
has body: Trying to set the content of content pane with registry.byId, but I'm not able to get the object -- I get the following error: JavaScript runtime error: Unable to get property 'set' of undefined or null reference my code is like this: require(["dojo/parser", "dojo/dom", "dijit/registry", "dojox/layout/ContentPane", "dojo/domReady!"], function (parser, dom, registry) { parser.parse(); registry.byId("Content").set("content", "Test Content");//Content ID is not being found }); TOC Any ideas? Thanks!
upvote count: 1
type: Question

http://stackoverflow.com/q/24791011
type: Question
score: 5
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has title: unable to load phantomjs webpage and system modules in karma
has body: I am trying to setup my phantomjs tests to work though karma, but I am unable to load the phantomjs 'webpage' and 'system' modules though requirejs. here is part of the karma.config.js module.exports = function(config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: '.', // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frameworks: ['requirejs'], // list of files / patterns to load in the browser files: [ '../ext/ext-all.js', 'test/jasmine/jasmine/jasmine.css', 'test/jasmine/jasmine/jasmine.js', 'test/jasmine/jasmine/jasmine-html.js', 'resources/webclientLogin-all.css', 'resources/webclient/webclient.css', 'app/controller/login/main.js', 'app/view/login/FormContainer.js', 'app/view/login/MustChangePasswordForm.js', 'app/view/MainView.js', 'app/Application.js', 'development.js', 'app.js', 'test/phantomjs/loginSuccess.js', ], this is the phantomjs test code: var page = require('webpage').create(), testindex = 0, loadInProgress = false; var clientURL = "http://localhost:7001/client/"; page.onConsoleMessage = function(msg) { console.log(msg); }; page.onLoadStarted = function() { loadInProgress = true; console.log("load started"); }; page.onLoadFinished = function() { loadInProgress = false; console.log("load finished"); }; console.log(''); console.log("loginSuccess test BEGIN"); console.log(''); var steps = [ function() { console.log("Load Page"); page.open(clientURL); }, function() { console.log("Populate Username and Password"); page.evaluate(function() { var usernameField = Ext.ComponentQuery.query('textfield#login-username-textfield')[0]; var passwordField = usernameField.next('textfield#login-password-textfield'); usernameField.setValue('testuser'); passwordField.setValue('testpassword'); }); }, function() { console.log("Fire Submit Button"); page.evaluate(function() { var button = Ext.ComponentQuery.query('#login-button')[0]; button.fireEvent('click', button); }); }, fu…
tagged with: karma-runner
type: UnansweredQuestion
tagged with: phantomjs
upvote count: 5
has answer: http://stackoverflow.com/a/26016686

http://stackoverflow.com/a/24878391
upvote count: 1
score: 1
has body: You can use setTimeout: setTimeout(fullscreen,5000);
downvote count: 0
answers question: http://stackoverflow.com/q/24878297
type: Answer

http://stackoverflow.com/q/24819201
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/24819411
has title: Using resource in controller before its loaded?
tagged with: javascript
score: 0
has body: I'm currently working on an angular application i'll post some sample code here. In My Service i have a method that access a rest api via $resource: function getData() { resource.get({}, function success(data) { return data; }, function error() { console.log('error') }) } Now over in a controller that has been injected with the service i attempt to use the data with some conditions from the previous page that are passed through as a routeParameter as follows: $scope.data = MyResource.getData() $scope.editingObject = angular.copy($scope.data[$routeParams.objIndex]) On my view i would like to bind to $scope.editingObject but since that code executes immediately and the data may not have arrived back from the server i receive the following error: TypeError: Cannot read property '0' of undefined Now i understand that i cannot access the array before the data has arrived back from the server but my question is more about how do i construct this service in such a way that i can access that data? To resolve this issue i have attempted to place a watch on $scope.data and monitor for the data to arrive but it never fires when the data does arrive. i have confirmed this using console.log in a set timeout to check after a few seconds if the data has arrived at which point it has... and the object is updated to reflect this. Could anyone please point me in the right direction regarding services, resources and accessing the data?
has answer: http://stackoverflow.com/a/24819411
answer count: 1
tagged with: angularjs

http://stackoverflow.com/comment/38436511
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/24769267
has text: What exactly is the problem? You have a site under /settings, but what page are you trying to redirect to? What error or what are you expecting vs what are you actually seeing? I just don't understand your problem.

http://stackoverflow.com/a/24884150
has body: You can try this, var today = 1406019110000; // today var yesterday = 1405951867000; // yesterday checkToday(today); checkToday(yesterday); function checkToday(timestamp) { if (moment(timestamp).format('DD/MM/YYYY') == moment(new Date()).format('DD/MM/YYYY')) alert('true'); else alert("false"); } Here is the demo
score: 0
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/24883760
type: Answer

http://stackoverflow.com/q/24788912
tagged with: jquery
favorite count: 0
has title: How to get my jQuery before() call to work?
has comment: http://stackoverflow.com/comment/38518338
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38472258
has comment: http://stackoverflow.com/comment/38472662
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24788988
downvote count: 1
has comment: http://stackoverflow.com/comment/38472243
type: Question
has comment: http://stackoverflow.com/comment/38472255
has comment: http://stackoverflow.com/comment/38511673
has body: I have tried using JavaScript and jQuery with my HTML file, but it is not working properly. Here is my code: &lt;!doctype html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;style type="text/css"&gt; body {white-space: nowrap;} h1 {white-space: nowrap;} &lt;/style&gt; &lt;script src="jquery.js"type="text/javascript"&gt;&lt;/script&gt; &lt;title&gt;SolicitueCotizaciones&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;script&gt; function myFunction() { $("input[type='button'][value='Agregar Pieza']").before("&lt;p&gt;new text&lt;/p&gt;")}; &lt;/script&gt; &lt;br/&gt; Descripcion: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br/&gt; &lt;textarea id="improve" rows="3" cols="20"&gt;&lt;/textarea&gt; &lt;/p&gt; &lt;div class="divider"/&gt; &lt;div style="align-items:left"&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt; &lt;input type="button" value="+Agregar Pieza" onclick="myFunction()"&gt; &lt;/p&gt; &lt;/body&gt; &lt;/html&gt; I have also tried copying code from tutorial websites that work properly but when I run them in my computer, they stop working. Can anyone help me figure out what's happening and what I should do to solve it? EDIT: What I'm trying to achieve is to add the new text above the "+agregar pieza" button and below the text input box labeled "descripcion" once you press the "+agregar pieza" button, but this never happens. I have tried the corrections that were posted in the comments, and I edited the code above to include them. However, as of this edit, it is still not working at all. I would like to use the .before command from jquery to achieve the desired result, but if there is a better way to do this, I would like to know.
has comment: http://stackoverflow.com/comment/38472425
possible better answer: http://stackoverflow.com/a/24789017
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/24789017
accepted answer: http://stackoverflow.com/a/24788988
answer count: 2
upvote count: 0

http://stackoverflow.com/comment/38425957
score: 0
type: Comment
has text: This doesn't really answer the question.
comment on: http://stackoverflow.com/a/24764600
type: AnswerComment

http://stackoverflow.com/comment/38725985
has text: Are you sending the dimension with an event or just setting it prior to `ga('send', 'pageview');`? Can you post the entire code you're using to send the dimension? Is it possible for you to share the site?
score: 0
comment on: http://stackoverflow.com/q/24894455
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24753085
score: 1
upvote count: 1
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24752346
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24752346
has body: Finally, you point me right way - solution (and what I want in beginning) is in this fiddle :) : var container = $('#submit-2').closest('div.container'); var result = $('#result'); container.children(':not(div.container)').find(':input:not([type="submit"])').each(function (k, v) { result.append($('&lt;li/&gt;').text('found: ' + $(v).attr('name'))); }); @billyonecan say right, that inputs are not descendants, so little google points me to another function - .children, that accepts selector as filter, so I am win :) - more in fiddle. And - thank you for help
type: Answer

post
tags question: http://stackoverflow.com/q/24908812
tags question: http://stackoverflow.com/q/24898264
tag name: post
tags question: http://stackoverflow.com/q/24780449
tags question: http://stackoverflow.com/q/24872214
tags question: http://stackoverflow.com/q/24894532
type: Tag
tags question: http://stackoverflow.com/q/24830582
tags question: http://stackoverflow.com/q/24754122
tags question: http://stackoverflow.com/q/24795185
tags question: http://stackoverflow.com/q/24873810
tags question: http://stackoverflow.com/q/24866098
tags question: http://stackoverflow.com/q/24885547
tags question: http://stackoverflow.com/q/24772500
tags question: http://stackoverflow.com/q/24777033
tags question: http://stackoverflow.com/q/24765828

http://stackoverflow.com/comment/38586955
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24836674
has text: @irvgk No, that will not work. `$(this)` doesn't have any context inside `GenerateBill()`, and so will not change the button state.
score: 0

http://stackoverflow.com/q/24795836
type: Question
tagged with: jquery-mobile
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24796068
has title: jQuery Mobile: Open EXTERNAL panel on load
has body: I'm stucked in this: How can I make my external left panel to be open by default. I'm defining the external panel like this: $(document).on('pagebeforecreate', function () { $("#left_sidebar").panel().enhanceWithin(); }); And open it after init: $(document).on('pagebeforeshow', function() { $("#left_sidebar").panel( "open"); }); Actually it opens the sidebar but the page somehow show over it. All is working fine if I define my panel in the page. Any ideas where I am wrong?

http://stackoverflow.com/comment/38494229
score: 0
type: AnswerComment
type: Comment
has text: To apply the styles to a unique ol, you must assign it a unique id or class, for example: and then in jquery use $("ol.myList") to get it, or in case of the first workaround $style = $(' ');
comment on: http://stackoverflow.com/a/24799974

http://stackoverflow.com/a/24776564
score: 1
has comment: http://stackoverflow.com/comment/38448701
upvote count: 1
type: AcceptedAnswer
has body: There is no need to use ViewData when you are returning JSON. You are getting result since ViewData is a dictionary. Use return Json(new { resultInfo = new resultInfo("SUCCESS"), UserInfo = Session["UserInfo"] }); instead of ViewData.Add("resultInfo", new resultInfo("SUCCESS")); ViewData.Add("UserInfo", Session["UserInfo"]); return Json(ViewData);
answers question: http://stackoverflow.com/q/24776509
type: Answer
has comment: http://stackoverflow.com/comment/38448442
accepted answer of: http://stackoverflow.com/q/24776509
downvote count: 0

http://stackoverflow.com/comment/38401429
score: 1
comment on: http://stackoverflow.com/q/24751558
type: Comment
type: QuestionComment
has text: Is this what you want? http://jsfiddle.net/BC4eY/1910/

http://stackoverflow.com/q/24771151
linked to: http://stackoverflow.com/q/5801543
has body: i wrote a simple function like a timer why does this code don't go right is says Uncaught ReferenceError: a is not defined why? function timeee(sec) { document.getElementById("main").innerHTML = sec; --sec; if (sec == -1) { clearInterval(cleartext); } } function timer() { var a = document.getElementById("time").value; var cl = setInterval("timeee(a)", 1000); window.cleartext = cl; }
tagged with: javascript
has answer: http://stackoverflow.com/a/24771205
has answer: http://stackoverflow.com/a/24771212
score: 0
answer count: 3
has title: using function in setinterval javascript error using function
tagged with: setinterval
possible better answer: http://stackoverflow.com/a/24771212
favorite count: 0
linked to: http://stackoverflow.com/q/5786851
accepted answer: http://stackoverflow.com/a/24771205
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24771220
upvote count: 1
downvote count: 1
tagged with: timing
type: Question

http://stackoverflow.com/comment/38676223
score: 0
type: Comment
has text: Does the CSV file initially contain non-ASCII characters? Also, since Excel is Microsoft's software, have you tried manually prepending a UTF-8 BOM to the file?
type: QuestionComment
comment on: http://stackoverflow.com/q/24876222

http://stackoverflow.com/a/24765024
has comment: http://stackoverflow.com/comment/38427606
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/24763671
score: 1
has body: You are not terminating your &lt;a href> statement. After CreateOne should be &lt;/a>
downvote count: 0

http://stackoverflow.com/q/24886690
tagged with: fadein
has body: I have an odd problem with JavaScript: After clicking in a table (to get an ID of the selected row), the loaded url below should be faded out, then it should load the new url with the new ID(s), then a fade-in with the new site and finally scroll to the div, which contains the new url. BUT with this code it doesn't work. 1. It's fading out. 2. It's fading in (with the old url!). 3. It's scrolling to the div-id. 4. It's loading the new url. (sometimes 3 and 4 together) $("#mydivid").fadeOut('slow', function() { $("#mydivid").load("/url.php", { \"id1\": id1, \"id2\": id2 }).fadeIn('slow');}); $(window).scrollTo('#mydivid', {duration:2500} ); I don't think the table is the problem here, that's why I avoid to show the related code. The loaded "url.php" is a big file (but only with HTML-Text and Canvas-Pictures) - could that be the problem?
tagged with: fadeout
upvote count: 1
has title: Bad fadeout/load/fadein/scrollto after clicking in a table to get an ID
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38656630
tagged with: scrollto
answer count: 0
downvote count: 0
tagged with: load
score: 1
has comment: http://stackoverflow.com/comment/38656629
favorite count: 0
type: Question

http://stackoverflow.com/q/24819197
type: Question
has answer: http://stackoverflow.com/a/24819276
has comment: http://stackoverflow.com/comment/38529091
has comment: http://stackoverflow.com/comment/38529062
tagged with: null
has comment: http://stackoverflow.com/comment/38529216
has answer: http://stackoverflow.com/a/24819611
has title: Can I use (undefined || null) to check if my variable is null or undefined?
possible better answer: http://stackoverflow.com/a/24819364
has answer: http://stackoverflow.com/a/24819364
tagged with: javascript
tagged with: undefined
favorite count: 0
has comment: http://stackoverflow.com/comment/38529363
has answer: http://stackoverflow.com/a/24819531
has comment: http://stackoverflow.com/comment/38529102
has comment: http://stackoverflow.com/comment/38529176
answer count: 5
has comment: http://stackoverflow.com/comment/38529346
has body: In my Javascript code I'm checking if a variable is undefined (not the value undefined but the variable not defined) or null. To trim the code I'm using an operator. This is how I do it: if (myVariable === (undefined || null)) { // Do something. } A friend of mine told me once, that I should rather split the checks into: if (myVariable === undefined || myVariable === null) { // Do something. } Is there really any difference between these two approaches? If yes, which one should I use and why?
has comment: http://stackoverflow.com/comment/38529101
accepted answer: http://stackoverflow.com/a/24819531
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38529040
has answer: http://stackoverflow.com/a/24819273
linked to: http://stackoverflow.com/q/5113374
score: 6
has comment: http://stackoverflow.com/comment/38529168
linked to: http://stackoverflow.com/q/4725603
upvote count: 7
downvote count: 1
has comment: http://stackoverflow.com/comment/38529231

http://stackoverflow.com/q/24751674
has comment: http://stackoverflow.com/comment/38401601
has title: Pull information from a web page (after JS has fired), Joomla, PHP, JS
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/38401647
type: Question
has body: I am supposed to create a web service which is capable of pulling dynamic information from a website that has Joomla running the service. Problem is that whenever I try to DOM -request the site, I get either a null DOM object or a stripped down website, without the information I needed. The thing is that the website loads before the JS (that has all the information in it) loads. I am trying to pull the information using php, yet no avail. I'm not that experienced with DOM or pulling information from different CMS's.
tagged with: dom
score: 0
has comment: http://stackoverflow.com/comment/38401687
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38402534

webdeploy
tags question: http://stackoverflow.com/q/24765627
tag name: webdeploy
type: Tag

http://stackoverflow.com/comment/38480988
score: 0
comment on: http://stackoverflow.com/q/24793505
type: Comment
type: QuestionComment
has text: possible duplicate of [invalid html (href target tag)](http://stackoverflow.com/questions/1379585/invalid-html-href-target-tag)

http://stackoverflow.com/comment/38623552
has text: @user3467349, it was doing that becuase I'm an idiot :). I never added the code to revert back to the whole dataset when the user pressed the `ALL` button.
comment on: http://stackoverflow.com/a/24786532
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/24791726
answers question: http://stackoverflow.com/q/24791668
score: 0
type: Answer
has body: "link" should be the class of the elements not the id. If you have more than 1 element with the same id, JavaScript will only find the first one.

http://stackoverflow.com/comment/38397474
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24749327
has text: check the path of hammer.js file... i think its ` `

http://stackoverflow.com/q/24850991
has body: I have a Python based flask web application which shows some SQL information on a html page. This page is semi-realtime, it gets refreshed every 15 minutes with a simple html refresh: &lt;META HTTP-EQUIV="refresh" CONTENT="9000"&gt; This works fine as long as the connection is up, there are no internal code errors. Now I don`t want to have to manually refresh the page once it cannot refresh the page correctly for whatever reason. (connection, internal error). Is it possible to have a webpage that keeps refreshing every fixed period of time regardless on whether the last refresh was succesfull. Currently the html page contains no Javascript or the like, just plain html which is generated by Flask built-in template engine Jinja2. Is it maybe possible to load the webpage completely first than check if it was successful and then refresh?
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/30365631
possible better answer: http://stackoverflow.com/a/30780899
type: Question
has answer: http://stackoverflow.com/a/24851178
accepted answer: http://stackoverflow.com/a/24851178
tagged with: javascript
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/30780899
downvote count: 0
has title: HTML automatically refresh page but check for connection prior
favorite count: 0
has comment: http://stackoverflow.com/comment/38588916
upvote count: 1
tagged with: python

http://stackoverflow.com/comment/38541016
type: QuestionComment
comment on: http://stackoverflow.com/q/24825568
has text: @forgivenson how can it be undefined it is obvious it exists, i even get a value if i try alert(line[1]);
score: 0
type: Comment

http://stackoverflow.com/a/24789352
score: 3
has body: Edited to reflect the comment from @blex, which is correct The correct algorithm for random is: function rand(a,b){ return Math.floor(Math.random()*(b-a)+a); } When retrieving the values from an input, you must do parseInt: var a = parseInt(document.getElementById("from").value); var b = parseInt(document.getElementById("to").value); Of course, you should check the values to make sure they are integers before you use them.
answers question: http://stackoverflow.com/q/24789308
has comment: http://stackoverflow.com/comment/38473592
accepted answer of: http://stackoverflow.com/q/24789308
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/38473179

http://stackoverflow.com/a/24768600
answers question: http://stackoverflow.com/q/24766155
has comment: http://stackoverflow.com/comment/38516768
has comment: http://stackoverflow.com/comment/38471300
has comment: http://stackoverflow.com/comment/38506578
has comment: http://stackoverflow.com/comment/38506683
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38433485
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24766155
has body: Always changing the image width to fill the box width will cause aspect ratio issues, and will distort your pictures. I would recommend doing something like this. var image1 = new Object( ); var sizeArray = getRandSizes( ); image1.width = sizeArray[0]; image1.height = sizeArray[1]; //Repeat for images 2 and 3 var images = [ image1, image2, image3 ]; images = getProportionalSizes( 200, 300, images ); images.forEach( function( image ) { var $img = $("&lt;div&gt;", { class: 'img', width: image.width, height: image.height }).appendTo('.fixed-block') }); function getProportionalSizes(maxWidth, maxHeight, images) { var totalHeight; images.forEach( function( image ) { totalHeight += image.height; }); images.forEach( function( image ) { var ratio = image.height / totalHeight; image.height *= ratio; image.width *= ratio; //This will ensure that images maintain aspect ratio, but that the total height of the 3 images matches the container height. }); return images; } function getRandSizes() { return [getRand(100,200), getRand(100,200)] } function getRand(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } EDIT ------------------------ If having full block width is a requirement, and the distortion of the images is irrelevant, then do this instead. function getProportionalSizes(maxWidth, maxHeight, images) { var totalHeight; images.forEach( function( image ) { totalHeight += image.height; }); images.forEach( function( image ) { var ratio = image.height / totalHeight; image.height *= ratio; image.width = maxWidth //This will keep the individual image height proportional to each other, but stretch the picture in the x-direction to fill the block. }); return images; }
type: Answer
has comment: http://stackoverflow.com/comment/38472558
has comment: http://stackoverflow.com/comment/38506260
score: 1
has comment: http://stackoverflow.com/comment/38442276
has comment: http://stackoverflow.com/comment/38508252
upvote count: 1
has comment: http://stackoverflow.com/comment/38458126
has comment: http://stackoverflow.com/comment/38433548

getelementsbyclassname
tags question: http://stackoverflow.com/q/24878178
type: Tag
tag name: getelementsbyclassname
tags question: http://stackoverflow.com/q/24894290

http://stackoverflow.com/a/24792294
score: 3
has comment: http://stackoverflow.com/comment/38509332
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24791995
has comment: http://stackoverflow.com/comment/38509319
has comment: http://stackoverflow.com/comment/38480292
type: Answer
has body: Use jQuery to load the files dynamically. Use javascript to detect for ontouchstart. &lt;script&gt; if('ontouchstart' in document.documentElement) { $(document.body).load( "sections/blog_widget_mobile.php" ); } else { $(document.body).load( "sections/blog_widget.php" ); } &lt;/script&gt;
accepted answer of: http://stackoverflow.com/q/24791995
upvote count: 3

http://stackoverflow.com/a/44108886
answers question: http://stackoverflow.com/q/24809885
has body: HTML: Noise BG RVB BG dunno BG Color Scheme Switcher Try clicking on one of the colors above to change the colors on this page! CSS: body { background-repeat:repeat; background-position:top-left; } body.class1 { background-image:url('http://www.dca.fee.unicamp.br/~lotufo/Courses/ia-636-1995/alberto/proj5/html/pattern_Id.gif'); color:yellow; } body.class2 { background-image:url('http://upload.wikimedia.org/wikipedia/commons/e/ec/Pattern_square_16.png'); color:red; } body.class3 { background-image:url('http://www.herbactive.com.br/catalog/view/theme/default/image/pattern/pattern-11.png'); color:blue; } a { display:inline-block; width:120px; background:#ffffff; cursor:pointer; margin:2px 0; } body { margin: 3em; padding: 0; font-family: sans-serif; font-size: 18px; line-height: 1.5; } body.gray { background: gray; color: white; } body.white { background: white; color: black; } body.blue { background: blue; color: white; } body.yellow { background: yellow; color: black; } h1 { line-height: 1.25; margin: 2em 0 0; } p { margin: .5em 0; } #switcher { list-style: none; margin: 0; padding: 0; overflow: hidden; } #switcher li { float: left; width: 30px; height: 30px; margin: 0 15px 15px 0; border-radius: 30px; border: 3px solid black; } #grayButton { background: gray; } #whiteButton { background: white; } #blueButton { background: blue; } #yellowButton { background: yellow; } JS: $("#btn1").click(function() { $('body').removeClass(); $('body').addClass('class1'); }); $("#btn2").click(function() { $('body').removeClass(); $('body').addClass('class2'); }); $("#btn3").click(function() { $('body').removeClass(); $('body').addClass('class3'); }); $('#grayButton').click(switchGray); $('#whiteButton').click(switchWhite); $('#blueButton').click(switchBlue); $('#yellowButton').click(switchYellow); function switchGray() { $('body').attr('class', 'gray'); } function switchWhite() { $('body').attr('class', 'white'); } function switchBlue() { $('body').attr('class', 'blue'); } function sw…
type: Answer
has comment: http://stackoverflow.com/comment/75238014
score: 0

http://stackoverflow.com/comment/38522178
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24815372
has text: sorry @jmort253 full text search won't work in your case. There is another technique called http://en.wikipedia.org/wiki/Trie or just index the string you want to search.

http://stackoverflow.com/comment/38529062
comment on: http://stackoverflow.com/q/24819197
score: 0
type: Comment
type: QuestionComment
has text: @WoIIe: "this won't work" -- what "this"? The second will.

http://stackoverflow.com/comment/38693098
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24904633
has text: you can alter your markup like this Username <?php echo form_error('username'); ?>
type: AnswerComment

http://stackoverflow.com/comment/38432740
type: QuestionComment
type: Comment
has text: I changed the type for the form to "button" instead of submit so that the page doesn't reload. Yet the page keeps reloading. I updated the code above.
comment on: http://stackoverflow.com/q/24767799
score: 0

http://stackoverflow.com/q/24761383
upvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/38421005
has comment: http://stackoverflow.com/comment/38421180
has comment: http://stackoverflow.com/comment/38420949
tagged with: javascript
downvote count: 0
has title: Compile template without appending to document with custom scope
favorite count: 0
has comment: http://stackoverflow.com/comment/38421557
has comment: http://stackoverflow.com/comment/38421216
tagged with: angularjs
has body: I need to compile remote template (template.html file) with some values and to get the resulting html without appending it to the page.Can you give me some advice? angular.module('myApp') .directive('myDirective', function($compile) { return { var htmlcontent = angular.element('&lt;div&gt;&lt;/div&gt;'); htmlcontent.load('/template.html'); var tmpl = $compile(htmlcontent); var expectHTML = tmpl({ value: "myValue" }); } }) I need to pass myValue to the template, but I don't want to append it to the scope of myDirective. Also I need the resulting html without appending to the real DOM.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38421332
score: 2
answer count: 0

http://stackoverflow.com/a/24892310
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24891682
has body: Your best option as suggested in the comments is to use radio buttons. The key is to give them all the same name. For example: &lt;form&gt; &lt;input type="radio" name="firstname" id="Fred"&gt; &lt;input type="radio" name="firstname" id="Joe"&gt; &lt;/form&gt; Then, when one of these radio buttons is selected, any other radio button with the same name will be unselected.

http://stackoverflow.com/comment/38609196
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24861522
has text: You forgot to inject the Auth service in your `navCtrl`
score: 0

http://stackoverflow.com/a/24885340
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/24885254
downvote count: 0
has body: this may help you &lt;meta name="HandheldFriendly" content="true" /&gt; &lt;meta name="viewport" content="width=device-width, height=device-height, user-scalable=no" /&gt;

http://stackoverflow.com/q/24808895
duplicate of: http://stackoverflow.com/q/11563638
type: Question
accepted answer: http://stackoverflow.com/a/24809012
has comment: http://stackoverflow.com/comment/38509601
score: 1
has body: I have written a web page in JavaScript that calculates your BMI and it seems to work but when I hit the calculate button an alert box pops up and says "your BMI is NaN". I know NaN stands for not a number. I just want to know why I can't get this to work. BMI Your weight: Your height (in inches): Calculate
has comment: http://stackoverflow.com/comment/38509515
answer count: 2
has answer: http://stackoverflow.com/a/24808944
linked to: http://stackoverflow.com/q/11563638
downvote count: 0
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/24808944
has comment: http://stackoverflow.com/comment/38509621
has comment: http://stackoverflow.com/comment/38509482
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/11613705
has title: Why can't I get this javascript code work?
has answer: http://stackoverflow.com/a/24809012
upvote count: 1

http://stackoverflow.com/q/24872060
has comment: http://stackoverflow.com/comment/38634557
has answer: http://stackoverflow.com/a/24881644
favorite count: 0
accepted answer: http://stackoverflow.com/a/24879798
has comment: http://stackoverflow.com/comment/38629573
has comment: http://stackoverflow.com/comment/38629893
tagged with: php
tagged with: laravel
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38643991
score: 1
has body: I do this in controller $actions = array('' => 'Select Action Name') + Action::lists('name' , 'id'); and then I send the $actions array to the view. In the Javascript: Print select results in: Remove White Space extract map latitude Extract map longitude Select Action Name The array is backwards, as the first option should be the one with Select Action Name but is the last option.
has comment: http://stackoverflow.com/comment/38629842
upvote count: 1
has comment: http://stackoverflow.com/comment/38631037
type: Question
has answer: http://stackoverflow.com/a/24879798
has title: array, which has been sent by laravel, becomes backwards when I used it from javascript
tagged with: javascript
has comment: http://stackoverflow.com/comment/38636195
answer count: 2
has comment: http://stackoverflow.com/comment/38630301
tagged with: laravel-4
has comment: http://stackoverflow.com/comment/38629709
possible better answer: http://stackoverflow.com/a/24881644
downvote count: 0
tagged with: jquery

http://stackoverflow.com/comment/38440587
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24772370
has text: Why wouldn't you set the `background-image: url('Images/buttonUnClicked.png');` in the CSS as the default then only change the one that you need to (i.e. button1)... I'm not 100% sure, but your issues might be the fact that you are reloading background images. you could also try `background-repeat: no-repeat;` to try and reduce unnecessary (non-visible) overhead.
score: 0

http://stackoverflow.com/q/24798060
tagged with: jquery
favorite count: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/24798647
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24798647
has title: How to execute JS code after redirect to page with href link?
tagged with: cordova
upvote count: 1
has answer: http://stackoverflow.com/a/24805170
has answer: http://stackoverflow.com/a/24798280
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38489618
score: 1
accepted answer: http://stackoverflow.com/a/24798280
type: Question
has comment: http://stackoverflow.com/comment/38489381
has body: I have a page with a function like this: $.ajax({ type: "POST", url: "checkLogin.php" }) .done(function( msg ) { alert(msg ); if (msg != "true"){ window.location.replace("index.html"); } }); This function checks if a Session is alive on Server. If not it will redirect to index.html. On first call of this .html it works. But if I go to this page with a href link when the page was loaded before the page isn't executing any JS. How can I call that JS again? When I am open up an other page without loading that page with javascript before and click the href link it works. Something with Cache?
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/24820770
has comment: http://stackoverflow.com/comment/38535847
has body: You have an error in your $.when.apply call - it needs an initial context parameter, typically $ Your code also suffers the common problem of using the loop variable i from inside an asynchronous callback at which point it no longer retains its original value and the results all end up in allData[trains.length + 1] So, instead of trying to accumulate allData[i] in the .done callback you can remove that .done call altogether, and then within the .when().then() callback you can use the arguments array to access the individual results, which will automatically appear in the correct order: $.when.apply($, requests).then(function() { // convert the arguments array, where each argument is in the form // [data, textStatus, jqXHR], into an array of just the data values var allData = [].map.call(arguments, function(arg) { return arg[0]; }); ... }); The initial request loop can also be slightly simplified using Array.prototype.map: var requests = trains.map(function(train) { // no "i" variable needed - use "train" instead of "train[i]" return $.ajax({ ... }); });
accepted answer of: http://stackoverflow.com/q/24800260
score: 2
has comment: http://stackoverflow.com/comment/38535669
downvote count: 0
has comment: http://stackoverflow.com/comment/38534923
answers question: http://stackoverflow.com/q/24800260
has comment: http://stackoverflow.com/comment/38532814
has comment: http://stackoverflow.com/comment/38534669
has comment: http://stackoverflow.com/comment/38531953
upvote count: 2
has comment: http://stackoverflow.com/comment/38534749
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38534582
has comment: http://stackoverflow.com/comment/38533192
has comment: http://stackoverflow.com/comment/38536168
has comment: http://stackoverflow.com/comment/38535263
has comment: http://stackoverflow.com/comment/38534701
type: Answer
has comment: http://stackoverflow.com/comment/38535016

http://stackoverflow.com/comment/38591083
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24835318
has text: @the_rj No problem, I'm glad you found it helpful. If the answer resolved your problem please consider accepting it (using the green tick on the left) to help future users who may have the same problem know what helped you.

http://stackoverflow.com/comment/38484888
type: Comment
has text: @Rim - No,TagName returns the string like SPAN, DIV like this
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24795450

http://stackoverflow.com/comment/38666211
has text: I set the document.domain as same as the parent.
comment on: http://stackoverflow.com/q/24891464
score: 0
type: Comment
type: QuestionComment

treeview
tags question: http://stackoverflow.com/q/24752279
type: Tag
tags question: http://stackoverflow.com/q/24752638
tag name: treeview

http://stackoverflow.com/a/24793121
type: Answer
has body: var firstNonRepeatedCharacter = function(string) { var chars = string.split(''); for (var i = 0; i &lt; string.length; i++) { if (chars.filter(function(j) { return j == string.charAt(i); }).length == 1) return string.charAt(i); } }; So we create an array of all the characters, by splitting on anything. Then, we loop through each character, and we filter the array we created, so we'll get an array of only those characters. If the length is ever 1, we know we have a non-repeated character. Fiddle: http://jsfiddle.net/2FpZF/
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/24793051
downvote count: 0

http://stackoverflow.com/comment/44243930
has text: Just a quick note, my answer is unfortunatly true only for android. For IOS, the plugin just returns 'Image saved' in the msg parameter :(
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24825500
type: AnswerComment

http://stackoverflow.com/comment/38573837
has text: Actually I do not try to sync server and clients time. And at the moment I do not want to take care for various time zones. I'm attempting to do a python function which will return the same as javascript getTime(), as if they were both running on the same machine.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24831158

http://stackoverflow.com/a/24784593
answers question: http://stackoverflow.com/q/24784246
has comment: http://stackoverflow.com/comment/38464222
downvote count: 0
has comment: http://stackoverflow.com/comment/38464487
accepted answer of: http://stackoverflow.com/q/24784246
score: 1
has body: This should probably be closed as a duplicate, but I'll put an answer here because the relationships between all the duplicate questions are often so hard to grasp for JavaScript programmers that haven't understood the fundamental problem. There are two ways to solve this. One way is to change the way that you create the callback. Instead of using an inline anonymous function: feed(urls[j], function(err, articles) { // loop through the list of articles returned // ... you'd create another function that returns the callback. You'd pass that function the URL, and that's what the returned function would use: function makeFeedResultHandler(url) { return function(err, articles) { // loop through the list of articles returned // ... code as before up to this line: if (message.published &gt; url.latestTimestamp) { console.log('update timestamp to be: '+ message.published); url.latestTimestamp = message.published; } // ... etc }; } Then you'd call "feed" like this: feed(urls[j], makeFeedResultHandler(urls[j])); The key difference is that each function passed to "feed" will have its own private copy of the object (well, a copy of the reference to be picky) from the "urls" array, so it won't need to refer to the variable "j" at all. That's the crux of the problem: "j" is shared by all the callbacks in your code. By the time the callbacks are invoked, the value of "j" is equal to the length of the "urls" array, so urls[j] is undefined. The other approach would be to use the .forEach method, available in newer JavaScript implementations. That approach would get rid of "j" altogether: urls.forEach(function(url) { console.log('Original url timestamp is: '+ url.latestTimestamp.toString()); // fetch rss feed for the url: feed(url, function(err, articles) { // loop through the list of articles returned // ... code as previously, substituting "url" for "urls[j]" everywhere }); }); Again, that makes sure that every callback sent to the "feed" function has its own copy of the "urls" el…
upvote count: 1
type: AcceptedAnswer
type: Answer

angular-strap
tag name: angular-strap
tags question: http://stackoverflow.com/q/24786225
type: Tag
tags question: http://stackoverflow.com/q/24759944
tags question: http://stackoverflow.com/q/24789944

http://stackoverflow.com/a/24829859
score: 0
answers question: http://stackoverflow.com/q/24829752
type: Answer
has body: Basically you cannot include PHP scripts via JavaScript since PHP is executed by the server and JavaScript by the client but you can include and "combine" the OUTPUT of single php files via JavaScript using AJAX (I guess that is what you just mean). With Ajax you can load the contents of another webpage (for example div2.php) and do with it whatever you want. So for example you can load your div.php file and place it somewhere in your code. You can find a pretty good tutorial for that on W3Schools. But the code will become more "handsome" if you use JQuerys Ajax functions.

http://stackoverflow.com/q/24890375
has answer: http://stackoverflow.com/a/24890627
has title: Pass JavaScript calculation to form hidden input and the POST it to another page
has answer: http://stackoverflow.com/a/24891198
has answer: http://stackoverflow.com/a/40622895
accepted answer: http://stackoverflow.com/a/40622895
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24891198
linked to: http://stackoverflow.com/q/8664486
type: Question
has body: I have a problem with passing Javascript calculation (distance and travel time from google) to form as hidden input. Using onSubmit so i can use it on the next page). Specifilcy (mi and time_teken). Displaying this values with inner html on the same page there is no problem at all. And all work just fine. As you can see im also passing lon and lat values using similar script (which is not here to make a submited code shorter, Also Work with no problem. But for these valus i use on change method. I tried a lot of different methods but at this point im totaly lost. I will appraciate some help. Thank you very much in advance.
tagged with: javascript
score: 0
answer count: 3
tagged with: google-maps

http://stackoverflow.com/comment/38615077
score: 0
type: Comment
has text: Make the top two lines of pixels scrollable?
type: QuestionComment
comment on: http://stackoverflow.com/q/24864718

http://stackoverflow.com/comment/38555902
has text: You could always do the redirect in javascript after the AJAX returns success.
comment on: http://stackoverflow.com/q/24833358
score: 0
type: QuestionComment
type: Comment

responsive-design
tags question: http://stackoverflow.com/q/24764927
tags question: http://stackoverflow.com/q/24817427
tags question: http://stackoverflow.com/q/24844943
tags question: http://stackoverflow.com/q/24853237
tags question: http://stackoverflow.com/q/24868698
tags question: http://stackoverflow.com/q/24889100
tags question: http://stackoverflow.com/q/24860069
tags question: http://stackoverflow.com/q/24778305
tag name: responsive-design
type: Tag

http://stackoverflow.com/comment/38439516
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24771772
score: 0
has text: @j08691 how do I output the variables as a comment to the page? I dont know how to do that

http://stackoverflow.com/a/24810134
answers question: http://stackoverflow.com/q/24809977
score: 0
type: Answer
has body: I tried a viewing jquery documentation and this seems to work $(".cta-button").click(function() { $(this).closest('div').find(".title").hide(); $(this).closest('div').find(".alternate-input").show(); });

http://stackoverflow.com/a/24874436
score: 3
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38668127
type: Answer
has body: This is a bad practice. A CSS class should have a single definition. Modifying the class conditionally makes your code hard to follow and hard to maintain. The correct way would to be create a separate CSS class for each condition, or modify the DOM directly using Javascript.
upvote count: 3
answers question: http://stackoverflow.com/q/24874310
accepted answer of: http://stackoverflow.com/q/24874310
has comment: http://stackoverflow.com/comment/38666497

http://stackoverflow.com/a/24850643
score: 3
has comment: http://stackoverflow.com/comment/38588487
accepted answer of: http://stackoverflow.com/q/24850460
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38588224
has comment: http://stackoverflow.com/comment/38636445
has comment: http://stackoverflow.com/comment/38588643
type: Answer
has body: Besides that it uses sync I/O (opening the channel with .open instead of .asyncOpen), the NetUtil.asyncCopy operation is still async, meaning the code NetUtil.asyncCopy(istream, ostream, function(aResult) { console.log(aResult); // return 0 }) console.log(FileUtils.getFile("ProfD", ["searchEngines.sqlite"]).exists()); // return false let dbConn = Services.storage.openDatabase(file); will try to open the file before the copy likely finishes! However, file.exists() will be likely true, because you already opened the file for writing. It's just that the file is still blank because the data copy isn't done (or even started) yet. (Actually, it is true, because you're checking searchEngines.sqlite in ProfD and not TmpD, but if you correct that the previous statement would apply). You can only use the file when/after your callback to .asyncCopy is done, e.g. NetUtil.asyncCopy(istream, ostream, function(aResult) { console.log(aResult); console.log(FileUtils.getFile("ProfD", ["searchEngines.sqlite"]).exists()); // return false let dbConn = Services.storage.openDatabase(file); // ... }); PS: You might want to .asyncOpen the channel, then use NetUtil.asyncFetch and pass the resulting stream to .asyncCopy to be truly async for smallish files, since this caches the contents in memory first. For large files you could create a variant of the NetUtil.asyncFetch implementation that feeds the .outputStream end directly to NetUtils.asyncCopy. That is a bit more complicated, so I won't be writing this up in detail until somebody is truly interested in this and ask the corresponding question. Edit, so here is how I'd write it: const data = require('sdk/self').data; Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/NetUtil.jsm"); function copyDataURLToFile(url, file, callback) { NetUtil.asyncFetch(url, function(istream) { var ostream = Cc["@mozilla.org/network/file-output-stream;1"]. createInstance(Ci.nsIFileOutputStream); ostream.init(file, -1, -1, Ci.n…
has comment: http://stackoverflow.com/comment/38588301
has comment: http://stackoverflow.com/comment/38638594
has comment: http://stackoverflow.com/comment/38588605
has comment: http://stackoverflow.com/comment/38588868
upvote count: 3
answers question: http://stackoverflow.com/q/24850460

http://stackoverflow.com/a/24812070
type: AcceptedAnswer
score: 0
answers question: http://stackoverflow.com/q/24806512
type: Answer
accepted answer of: http://stackoverflow.com/q/24806512
has body: I found the answer here : https://stackoverflow.com/a/19593526/1324357 We can go to css with document.styleSheets.

http://stackoverflow.com/a/72489167
score: 0
answers question: http://stackoverflow.com/q/24768795
type: Answer
has comment: http://stackoverflow.com/comment/128055420
has body: Here is the improved code for jquery function visibleHeight: $("#myDiv").visibleHeight(); $.fn.visibleHeight = function() { var elBottom, elTop, scrollBot, scrollTop, visibleBottom, visibleTop, height; scrollTop = $(window).scrollTop(); scrollBot = scrollTop + $(window).height(); elTop = this.offset().top; elBottom = elTop + this.outerHeight(); visibleTop = elTop < scrollTop ? scrollTop : elTop; visibleBottom = elBottom > scrollBot ? scrollBot : elBottom; height = visibleBottom - visibleTop; return height > 0 ? height : 0; }

http://stackoverflow.com/comment/38468191
type: Comment
comment on: http://stackoverflow.com/a/24786532
score: 0
type: AnswerComment
has text: I was hoping there would be a hook for when the view is zoomed in to get the local Y max/min. Any opinion on switching to Highcharts or some other Javascript charting library?

http://stackoverflow.com/comment/38538533
type: QuestionComment
comment on: http://stackoverflow.com/q/24822372
score: 0
type: Comment
has text: @Leeft I want to achieve something like this lines with trianlges on the weathermaps http://3.bp.blogspot.com/-BUyq3EDfyIE/T6Gez5LJ6yI/AAAAAAAABpY/3pivoGsj19A/s1600/Weather+map+1200.JPG

http://stackoverflow.com/comment/38449550
type: Comment
comment on: http://stackoverflow.com/q/24777110
has text: You never use your `content` var, do something like : `var contentanswer = 'Testing this logic that works '+content+' ';`
score: 0
type: QuestionComment

firefox-addon
tags question: http://stackoverflow.com/q/24900197
tags question: http://stackoverflow.com/q/24801706
tags question: http://stackoverflow.com/q/24754177
tags question: http://stackoverflow.com/q/24838577
tags question: http://stackoverflow.com/q/24793031
tags question: http://stackoverflow.com/q/24839445
tags question: http://stackoverflow.com/q/24859458
tags question: http://stackoverflow.com/q/24781015
tags question: http://stackoverflow.com/q/24900655
tags question: http://stackoverflow.com/q/24834817
tags question: http://stackoverflow.com/q/24787132
tags question: http://stackoverflow.com/q/24886858
tags question: http://stackoverflow.com/q/24776180
tags question: http://stackoverflow.com/q/24817347
tags question: http://stackoverflow.com/q/24888767
tags question: http://stackoverflow.com/q/24849385
type: Tag
tags question: http://stackoverflow.com/q/24893165
tags question: http://stackoverflow.com/q/24819258
tags question: http://stackoverflow.com/q/24886404
tags question: http://stackoverflow.com/q/24843453
tags question: http://stackoverflow.com/q/24897764
tags question: http://stackoverflow.com/q/24850709
tags question: http://stackoverflow.com/q/24909117
tags question: http://stackoverflow.com/q/24868227
tags question: http://stackoverflow.com/q/24904111
tag name: firefox-addon
tags question: http://stackoverflow.com/q/24810558
tags question: http://stackoverflow.com/q/24879400
tags question: http://stackoverflow.com/q/24822815
tags question: http://stackoverflow.com/q/24848174
tags question: http://stackoverflow.com/q/24900845
tags question: http://stackoverflow.com/q/24850460

http://stackoverflow.com/q/24857217
has comment: http://stackoverflow.com/comment/38602792
type: UnansweredQuestion
has body: Cant some one give me a better solution to programatically scroll the C# WebBrowser control window. The method what is known to me, is not the best in practice. Now I looking for something else, a solution that allow to do that correctly. The scrolling example used in my project, where I truing to load Facebook page with my photo, where I have a lot of this, take a lot of time > private void AutoScroll_Tick(object sender, EventArgs e) { y++; WebBrowser1.Document.Window.ScrollTo(0,y); if (y &gt; (WebBrowser1.Document.Body.ScrollRectangle.Height)) { y = 0; AutoScroll.Enabled = false; return; } } I know on facebook page at www.facebook.com/"username"/photos - the loading_event is taken by a ajax/js scrips - and I think a solution to emulate this scripts will be a better for me. If someone can explain me for the future, how to interaction with ajax/js scripts - and how to detect these events.
tagged with: facebook
answer count: 0
has title: WebBrowser Control - Scrolling page
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/38602264
tagged with: javascript
tagged with: jquery
score: 0
tagged with: webbrowser-control

http://stackoverflow.com/a/24870496
score: 0
answers question: http://stackoverflow.com/q/24862483
type: Answer
has body: There are some things to check ! jQuery use escape for href ! http://bugs.jquery.com/ticket/11773 olso check documentation of magnificPopup. I'm not sure if preloader: false, is ok. The following function takes care of escaping these characters and places a "#" at the beginning of the string: var myhref = "/app/home"; function jq( myhref ) { return "#" + myhref.value; }

http://stackoverflow.com/a/24826052
downvote count: 0
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/24826003
score: 2
has body: Yes, there are two differences, though in practical terms they're not usually big ones. Your have 3 statements var a=0; ...creates a variable on the variable object for the global execution context, which is the global object, which on browsers is aliased as window (and is a DOM window object rather than just a generic object as it would be on non-browser implementations). The symbol window is, itself, actually a property of the global (window) object that it uses to point to itself. The upshot of all that is: It creates a property on window that you cannot delete. It's also defined before the first line of code runs (see "When var happens" below). Note that on IE8 and earlier, the property created on window is not enumerable (doesn't show up in for..in statements). In IE9, Chrome, Firefox, and Opera, it's enumerable. a=0; ...creates a property on the window object implicitly. As it's a normal property, you can delete it. I'd recommend not doing this, it can be unclear to anyone reading your code later. And interestingly, again on IE8 and earlier, the property created not enumerable (doesn't show up in for..in statements). That's odd, particularly given the below. window.a=0; ...creates a property on the window object explicitly. As it's a normal property, you can delete it. This property is enumerable, on IE8 and earlier, and on every other browser I've tried.
answers question: http://stackoverflow.com/q/24826003
has comment: http://stackoverflow.com/comment/38544662
type: AcceptedAnswer

http://stackoverflow.com/q/24756853
score: 4
upvote count: 4
downvote count: 0
answer count: 1
has body: I started from memory leak investigation in a large java script app which is run as a widget in a browser based on webkit and sfx (java script core engine). After a while I found a source of memory increasing over time. It happened to be $.ajax(..). Okay, I thought, let's try different versions of jquery or use XMLHttpRequest directly - same result. Then I checked it on google chrome and was surprised, because heap profiler showed neither increase of number of js objects nor increase of heap size whereas chrome task manager showed increase of memory and private memory. The code I tested is as follows: var Main = {}; var xhr = new XMLHttpRequest(); function makeRequest() { xhr.timeout = 2000; xhr.ontimeout = function() { xhr.abort(); } xhr.onreadystatechange = function() { if (xhr.readyState != 4) return; }; xhr.open("POST", "", true); //async post request to local server xhr.send("{}"); } Main.onLoad = function() { setInterval(function() { makeRequest(); }, 3000); } So, is this behavior ok? Isn't it a sign of native memory leak? P.S. I use chrome of version 35.0.1916.153 on windows 7 enterprise.
favorite count: 0
has answer: http://stackoverflow.com/a/24808987
type: UnansweredQuestion
tagged with: google-chrome-devtools
type: Question
has title: Interpretation of memory usage in chrome task manager
tagged with: javascript

http://stackoverflow.com/q/24769796
tagged with: javascript
has title: How do I make Nivo slider with fixed height responsive?
tagged with: image
has comment: http://stackoverflow.com/comment/38436690
score: 0
tagged with: jquery
type: UnansweredQuestion
has body: I have an issue which I hope is solvable with CSS rather than modifying the jQuery code itself. I have a nivo slider with fixed height and responsive width. When you make the window smaller the image shrinks to show 100% of the image width. This is fine and I like that feature, but the smaller the window gets the closer the height of the image gets to not fill out the slider. I want nivo-slider to act as it is until the height of the image is the same as the sliders height. Then I want the slider to swap from width: 100%; height: auto; to: height: 100%; width: auto; Is it possible to force the img to fill the slider with just CSS? Do I need to use "media screen" so once the resolution is small enough I swap using that? That requires me to know the height of the images and at which resolution the problem starts?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38435949
tagged with: css
answer count: 0
type: Question

http://stackoverflow.com/comment/38471100
has text: I'm not new to html/css I'm positive that's not effecting it. It's simply that I don't know how to add height using jquery when I show a hidden `div`.
comment on: http://stackoverflow.com/q/24779525
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/24825961
has title: Pattern for reacting to a continuous stream only once
accepted answer: http://stackoverflow.com/a/24826813
has body: When dealing with events that involve X, Y position of the mouse or any time of data that continually gets updated, what pattern is used to react to a particular situation only once in T period? For example if I am listening to a droppable hander through the accept option, the accept function is continually being executed to check the dropability, but how can I only pop my message to the user only once in T period without bombarding my screen with popped messages? $scope.layoutDropOptions = { hoverClass: 'ui-state-highlight', multiple: true, tolerance: 'pointer', accept: function (elem) { var isAField = $(elem).hasClass("field"); var isFromSideBar = $(elem).parent().hasClass("fields"); var onTheSame = $(this).find('#' + $(elem).attr("id")).size() != 0; var alreadyExists = $('.layoutContainer').find('#' + $(elem).attr("id")).size() != 0; if (alreadyExists &amp;&amp; isFromSideBar) { // need to pop only once: //toaster.pop('warning', // UserMessages.formBuilder.duplicateField.title, // UserMessages.formBuilder.duplicateField.body); return false; } return isAField &amp;&amp; !onTheSame ? true : false; } }
tagged with: design-patterns
has comment: http://stackoverflow.com/comment/38543467
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38543178
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/24826813
score: 0
has comment: http://stackoverflow.com/comment/38541705
tagged with: angularjs

http://stackoverflow.com/comment/38657714
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24886280
has text: Worked now. Some plugin was not installed properly i guess. Thanks a lot for help. I have one more doubt regarding storage. How can I store these videos and audio files inside my project folder? Currently It is storing in gallery.
score: 0

http://stackoverflow.com/q/24828385
has comment: http://stackoverflow.com/comment/38546299
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38546689
has title: VLC Web Plugin and jQuery
type: Question
has body: I have wrote an jQuery script for my VLC Plugin, that will hold the link from JSON formated code and past it in the plugin for the rtsp link. But I have a problem. $.ajax({ type: "GET", url: "/api/stream", processData: true, dataType: 'text', cache: false, success: function (data, textStatus, request) { stream = jQuery.parseJSON(data); var vlc = vlcEmb; var link = stream.rtsp; var rtsp = link; vlc.playlist.clear(); vlc.playlist.add(rtsp); vlc.playlist.play(); } }); here the code, Mozilla Firefox Firebug show me: uncaught exception: No such method or arguments mismatch. How can I fix this?
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/38627125
has text: Thanks Chrisg for the answer. Due to some issue I haven't shared all the js files that I am using in common.js. It is a little odd as I am getting timeout for the common.js file(it doesn't happen always). Will update this post when I apply your solution.
comment on: http://stackoverflow.com/a/24864406
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/24803940
has comment: http://stackoverflow.com/comment/38500082
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/24803195
has comment: http://stackoverflow.com/comment/38531083
score: 1
has body: Based on what has been posted, this could be a simple working example, http://jsbin.com/majavubu/1/edit js $(document).ready(function(){ $(window).scroll(function(){ if($(".the-box").isOnScreen()){ if(!animationStarted){ startAnimation(); } }else{ stopAnimation(); } }); }); var animationStarted=false; function startAnimation(){ animationStarted = true; for(var i=0;i&lt;10&amp;&amp;animationStarted;i++){ $(".the-box").animate({"background-color":randomColor()}).delay(500); } } function stopAnimation(){ animationStarted = false; $(".the-box").stop(); $(".the-box").css("background-color","white"); } $.fn.isOnScreen = function(){ var win = $(window); var viewport = { top : win.scrollTop(), left : win.scrollLeft() }; viewport.right = viewport.left + win.width(); viewport.bottom = viewport.top + win.height(); var bounds = this.offset(); bounds.right = bounds.left + this.outerWidth(); bounds.bottom = bounds.top + this.outerHeight(); return (!(viewport.right &lt; bounds.left || viewport.left &gt; bounds.right || viewport.bottom &lt; bounds.top || viewport.top &gt; bounds.bottom)); }; function randomColor(){return '#'+Math.floor(Math.random()*16777215).toString(16);}

http://stackoverflow.com/q/24903145
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38687956
type: UnansweredQuestion
tagged with: frame
downvote count: 2
type: Question
has title: How to call function on unload of frame in body?
score: -2
has body: There are frame in document body tag. When page got refresh frame will be unload automatically. and I want to call a function which should be called when frame unload. I have trigger event while frame unload but I don't know what's problem are going on there. window.frames["147compose"].onunload = function(e) { $("a#147 .closeTab").trigger("click"); } Here a tag is a link on which click event frame will pass data to other page using ajax. and 147compose is an frame id, and 147 is an id of a tag. where it is a link to send data from frame.
has answer: http://stackoverflow.com/a/24903953
upvote count: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/24783272
answers question: http://stackoverflow.com/q/24783155
type: Answer
has comment: http://stackoverflow.com/comment/38461437
downvote count: 1
has comment: http://stackoverflow.com/comment/38461503
has body: Please search before asking a question, a Google search for 'multiple jquery libraries' gives many useful results. Anyway, you can add an extra code to your pages(s) so the jQuery libraries don't conflict with each other: &lt;script&gt; var jq142 = jQuery.noConflict(); &lt;/script&gt; I believe this code must be placed before the first jQuery library is loaded. I advise you not to use two jQuery libraries on one page but if you must to the above answer may help you.
score: -1
upvote count: 0
has comment: http://stackoverflow.com/comment/38462922

http://stackoverflow.com/comment/38478569
score: 0
type: Comment
has text: Ahh, got it, my bad, didn't realize how much they had changed angular 1.2 animations, was using 1.1.4 to demonstrate. See updated answer.
type: AnswerComment
comment on: http://stackoverflow.com/a/24791398

http://stackoverflow.com/q/24859532
possible better answer: http://stackoverflow.com/a/24901031
has answer: http://stackoverflow.com/a/24901031
tagged with: javascript
has comment: http://stackoverflow.com/comment/38607690
score: 0
answer count: 2
has title: Use XMLHttpRequest to read data after a period of time - Chrome Extension
has body: I'm using XMLHttpRequest to read a text file (on local) after a period of time (after 10s). After 10s, XMLHttpRequest retrieves the text file but the content (responseText) does not changed even though I have changed it. Here is my code: var list = []; var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if (xhr.readyState == 4 &amp;&amp; xhr.status == 200) { if (xhr.responseText.length == 0) { undef(); } else { def(); } } } getFile(); function getFile() { list = []; xhr.open("GET", chrome.extension.getURL('text/list.txt'), true); xhr.send(null); } var myVar = setInterval(function(){getFile()}, 10 * 1000); function def() { // do something } function undef() { // do something } I don' know why and how to fix it, please help.
accepted answer: http://stackoverflow.com/a/24902539
tagged with: google-chrome-extension
tagged with: xmlhttprequest
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38613215
has answer: http://stackoverflow.com/a/24902539
has comment: http://stackoverflow.com/comment/38642040
type: Question

http://stackoverflow.com/q/24838782
has comment: http://stackoverflow.com/comment/38565596
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/38565849
downvote count: 1
has comment: http://stackoverflow.com/comment/38565650
type: Question
has title: jQuery Focus() and automatic Keypress()
has comment: http://stackoverflow.com/comment/38565608
has comment: http://stackoverflow.com/comment/38565709
has comment: http://stackoverflow.com/comment/38565683
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38565693
score: 0
has comment: http://stackoverflow.com/comment/38565966
linked to: http://stackoverflow.com/q/1200266
answer count: 1
has answer: http://stackoverflow.com/a/24839015
favorite count: 0
has body: Sorry for being such a beginner but I spent days try to find an answer and now I think your expertise is needed. I try to do something like "If I click on li, then the text written in li is displayed in a search box (ID '#input#) and automatically the request is launched." My script works fine but the request/search IS NOT launched.I blocked at the last step of the process. Thank you very much for your help. HTML Hello world Hello world 2 Javascript, JQuery

http://stackoverflow.com/q/24774548
has title: Regular Expression for removing numbers
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24774637
answer count: 2
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24774640
tagged with: regex
has body: can anyone please tell me how to remove the last numbers before the space using Regular Expression in javascript ABCD 154 =&gt; ABCD ACR 15 =&gt; ACR SA 12S 8945 =&gt; SA 12S
favorite count: 0
score: 2
upvote count: 2
accepted answer: http://stackoverflow.com/a/24774637
has answer: http://stackoverflow.com/a/24774640
type: Question

http://stackoverflow.com/a/24769917
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24769776
answers question: http://stackoverflow.com/q/24769776
has comment: http://stackoverflow.com/comment/38436243
has body: In the example provided: (function(window, undefined){ console.log('Hello World!'); })(window, undefined); the intention is to ensure that window within the IIFE references the global (window) object, and that the identifier undefined has the undefined value. However, both those identifiers may have already been assigned some other value before this code runs, so it misses the point. To achieve the intended outcome with certainty, this can be used to unequivocally reference the global object (i.e. window in a browser) and the undefined value doesn't need to be passed in at all (assuming that this is global code). Consider: (function (window, undefined) { console.log('Hello World!'); })(this); or if you're really paranoid: (function (window) { var undefined = void 0; console.log('Hello World!'); })(this); That code can be placed anywhere in the global context and guarantee that within the IIFE, the identifier window references the global object and undefined has the undefined value.

http://stackoverflow.com/a/36027880
answers question: http://stackoverflow.com/q/24786045
has body: I think using the api function of Date will be better (reference) $(document).ready(function() { // Today's date object. var today = new Date(); today = today.getTime()/1000; // Final date object. var finalDate = new Date(); // Setting year for final date. finalDate.setFullYear(2016); // Setting month for final date. // Month counting starts from 0 i.e. Jan = 0, therefore March = 2. finalDate.setMonth(2); // Setting Day for final date. finalDate.setDate(17); // Setting Hours for final date. finalDate.setHours(12); // Setting Minutes for final date. finalDate.setMinutes(00); // Setting Seconds for final date. finalDate.setSeconds(00); var finalDate = finalDate.getTime()/1000; var diff = finalDate - today; $('div#countdown-clock').FlipClock(diff, { clockFace: 'HourlyCounter', countdown: true }); });
type: Answer
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/q/24787242
answer count: 1
has body: I have two nested javascript objects and onclick events to using them: HTML: onclick="TestObject.go(123);" onclick="TestObject.InnerObject.innerMethod();" ... the second one will always fire after first. go() is initialization. Javascript: var TestObject = { justTest: -2, go: function(justTest) { // is '123' now this.justTest = justTest; }, InnerObject: { innerMethod: function() { // alerts 123. It's ok. alert(TestObject.justTest); $(id).animate({height: '50px'}, 300, function(){ // alerts -2 now! Why? alert(TestObject.justTest); } } }; ... why in animate function the TestObject being recreated?
tagged with: jquery
has comment: http://stackoverflow.com/comment/38469123
favorite count: 0
has answer: http://stackoverflow.com/a/24787328
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38469440
has title: JQuery recreates javascript object from it's method without a request
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/24787328
tagged with: javascript
score: -1
upvote count: 0

http://stackoverflow.com/comment/38479451
has text: Oh okay, so its just a check to see if the browser will support it?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24792651

http://stackoverflow.com/comment/38687430
has text: will it store the image in photo library?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24895476
type: Comment

http://stackoverflow.com/a/24772199
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24765788
answers question: http://stackoverflow.com/q/24765788
type: AcceptedAnswer
downvote count: 0
has body: Your $scope.hide_topmost_items() is called from outside angular ($(window).on('scroll')), so you have to call $scope.$apply() manually after changing any properties in $scope. $scope.hide_topmost_items = function(){ _.each($scope.posts, function(post){ var elem = $('#post_' + post.id); if (elem.position().top + elem.height() + 500 &lt; window.pageYOffset){ post.visible = false; window.scrollTo(0, window.pageYOffset - elem.height()); //elem.hide(); console.log('#post_' + post.id + ' is hidden now') } }); $scope.$apply(); // this is required when called from outside angular }; Hope this help.
type: Answer

http://stackoverflow.com/a/24828850
type: Answer
downvote count: 0
score: 7
accepted answer of: http://stackoverflow.com/q/24828529
has body: The reason that when two values are equal, their corresponding slices have the same color is because you are setting the color based on value: g.append("path") .attr("d", arc) .attr("fill", function(d){return color(d.value);}); Instead, set the color based on the index i of the data (which D3 also passes the callback function in this situation), like this: g.append("path") .attr("d", arc) .attr("fill", function(d, i){return color(i);}); This will give you a pie chart with multiple colors, even if the slices have the same value:
answers question: http://stackoverflow.com/q/24828529
upvote count: 7
type: AcceptedAnswer

http://stackoverflow.com/a/24786840
has comment: http://stackoverflow.com/comment/51799069
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24781352
has body: It looks like bug. I have analyzed code a bit, and I discovered that this issue is caused by generateSummaryData method in feature. In this method you can find this code: if (hasRemote || store.updating || groupInfo.lastGeneration !== group.generation) { record = me.populateRecord(group, groupInfo, remoteData); if (!lockingPartner || (me.view.ownerCt === me.view.ownerCt.ownerLockable.normalGrid)) { groupInfo.lastGeneration = group.generation; } } else { record = me.getAggregateRecord(group); } When grid is firstly rendered first branch is executed for all groups, and after reenabling - second branch. Calling getAggregateRecord instead of populateRecord produces empty summary record. I didn't go any deeper, so for now I can only give you dirty hack to override this (it forces code to enter first branch): store.updating = true; feature.enable(); store.updating = false; JSfiddle: http://jsfiddle.net/P2e7s/6/ After some more digging I've found out that most likely this issue occurs because group.generation is not incremented when populateRecord is called. As a result group.generation always equals to 1, so record is populated only when lastGeneration is empty (first code pass). After re-enabling feature, new groups are created, but they also have generation set to 1. So I've came up with less dirty hack: Ext.define('Ext.override.grid.feature.AbstractSummary', { override: 'Ext.grid.feature.GroupingSummary', populateRecord: function (group, groupInfo, remoteData) { ++group.generation; return this.callParent(arguments); } }); With that override, you can simply enable feature, and it should work. JSFiddle: http://jsfiddle.net/P2e7s/9/
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/38495788
score: 4
answers question: http://stackoverflow.com/q/24781352

http://stackoverflow.com/a/24752626
answers question: http://stackoverflow.com/q/24752557
downvote count: 0
type: Answer
has body: You assigned to myName variable console.log result, not substring. So, line 7 should be: myName = myName.substring(0,2);
upvote count: 1
score: 1

http://stackoverflow.com/comment/38551586
comment on: http://stackoverflow.com/q/24830911
has text: Remember that all browsers are also native applications on the OS, so they have native compiled code that can do a lot more than JavaScript. Presumably they use some native code to open this window. However, it is worth noting that the print window that pops up is, in fact, an HTML page, as you can open a dev tools window (try right-clicking and selecting `Inspect Element`) that is connected directly to that print window (and not to the parent page!). My guess is Chrome just uses HTML as the means to view this window, and it is a special window integrating with native code.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24895207
has comment: http://stackoverflow.com/comment/38673299
score: 0
has comment: http://stackoverflow.com/comment/38673097
type: Answer
answers question: http://stackoverflow.com/q/24895053
has body: For validation it will be easier and better to use HTML5 form attributes pattern and required. For reference, see: http://www.w3schools.com/html/html5_form_attributes.asp And I don't see any code used for displaying data in a div! You first need to post the code in order to get any help for it.

http://stackoverflow.com/a/24902675
answers question: http://stackoverflow.com/q/24902641
upvote count: 4
downvote count: 0
score: 4
type: Answer
has body: You need braces: if (u==x &amp;&amp; x==y) { e[i].style.display = "block"; a[i].style.display = "block"; b[i].style.display = "block"; } Otherwise, the if only attaches to the next statement, e[i].style.display = "block"; The indentation is ignored.

http://stackoverflow.com/q/24757241
possible better answer: http://stackoverflow.com/a/24757888
has answer: http://stackoverflow.com/a/24757888
accepted answer: http://stackoverflow.com/a/24758204
type: Question
type: AnsweredQuestion
tagged with: javascript
score: 0
answer count: 2
has body: A relative URL in a CSS file uses the URL of that CSS file as its base. This is frequently used to specify background images. In Javascript, it's possible to get such relative URLs by parsing the CSS rule for background-image (i.e. string the url part and removing quotation marks). Now for the question: Is there a way to find the absolute URL that the browser will use, if the URL of the CSS file is unknown? In particular, I need to get the natural dimensions of the background images in question. The usual way to do this is to create an Image element, assigning the source URL, waiting for the "load" event and reading the width/height properties. However, this evidently cannot work for relative URLs, if the CSS files are located in a different directory that the HTML document.
has answer: http://stackoverflow.com/a/24758204
has comment: http://stackoverflow.com/comment/38411935
tagged with: css
has title: Getting absolute from relative URLs in CSS files
has comment: http://stackoverflow.com/comment/38412076

http://stackoverflow.com/q/24812161
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38515824
has body: I've parsed a CSS stylesheet into an object. I'm creating an angular ui for editing the CSS properties. I need to expand shorthand properties reliably. Presently, I'm following this algorithm: If the property is expandable: 1. Get a hidden DIV. 2. Apply the property to the DIV. 3. Iterate through each of the properties component parts, gathering a list of new properties. 4. Replace the property with the new properties. Thus, border: 0px solid black; becomes border-top-style: solid; border-top-width: 0px; border-top-color: black; border-right-style: solid; border-right-width: 0px; border-right-color: black; border-bottom-style: solid; border-bottom-width: 0px; border-bottom-color: black; border-left-style: solid; border-left-width: 0px; border-left-color: black; The problem comes with a property like: background: -moz-linear-gradient(left, #f2f5fa 0%,#e7ebf3 100%,#7db9e8 100%); On the most recent version of Chrome, it becomes: background-image: linear-gradient(to right, rgb(242, 245, 250) 0%, rgb(231, 235, 243) 100%, rgb(125, 185, 232) 100%); background-position: ; background-size: initial; background-repeat: initial; background-origin: initial; background-clip: initial; background-attachment: initial; background-color: initial; IE 10 is pretty much the same with regard to background-image, but IE9 does: background-image: none; background-position: 0% 0%; background-size: auto; background-repeat: repeat; background-origin: padding-box; background-clip: border-box; background-attachment: scroll; background-color: rgb(242, 245, 250); In any case, this seems to be a very unreliable method of expanding CSS properties. Does anyone know of another that would work in the browser? Like I said earlier, I already have the CSS parsed. Edit (Description of purpose): We provide a product that, among many other things, allows the user to embed an advanced form-document editor into their site. The look of the editor can be modified by changing a .CSS file that lives on their server…
type: Question
has comment: http://stackoverflow.com/comment/38515703
score: 0
has title: Reliable CSS declaration expansion
has comment: http://stackoverflow.com/comment/38515866
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/24769087
tagged with: css
has comment: http://stackoverflow.com/comment/38515737
tagged with: parsing
has comment: http://stackoverflow.com/comment/38516121
tagged with: angularjs

http://stackoverflow.com/q/24860433
has answer: http://stackoverflow.com/a/24860551
tagged with: google-maps
answer count: 1
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/38607333
has body: I get Uncaught TypeError: Cannot read property 'length' of null when trying to return json data as markers for my Google map. What am I doing wrong because console.log(data); returns my data so I know that's fine. function initialize() { var latitude = -23.92175976307374, longitude = 24.120724868774414, center = new google.maps.LatLng(latitude,longitude), mapOptions = { center: center, zoom: 5, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_branches"), mapOptions); setMarkers(center, map); function setMarkers(center, map) { var json = (function () { var json = null; $.ajax({ 'dataType': "json", 'url': "/data/supplier_branches/", 'success': function (data) { json = data; console.log(data); } }); return json; })(); for (var i = 0, length = json.length; i &lt; length; i++) { var data = json[i], latLng = new google.maps.LatLng(data.lat, data.lng); var marker = new google.maps.Marker({ position: latLng, map: map, title: data.info }); infoBranch(map, marker, data); } } function infoBranch(map, marker, data) { var infoWindow = new google.maps.InfoWindow(); // Attaching a click event to the current marker google.maps.event.addListener(marker, "click", function(e) { infoWindow.setContent(data.title+data.info); infoWindow.open(map, marker); }); // Creating a closure to retain the correct data // Note how I pass the current data in the loop into the closure (marker, data) (function(marker, data) { // Attaching a click event to the current marker google.maps.event.addListener(marker, "click", function(e) { infoWindow.setContent(data.content); infoWindow.open(map, marker); }); })(marker, data); } }; google.maps.event.addDomListener(window, 'load', initialize);
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json
has title: Uncaught TypeError: Cannot read property 'length' of null Google Map Json Data
type: Question
has comment: http://stackoverflow.com/comment/38608600
has comment: http://stackoverflow.com/comment/38620635
has comment: http://stackoverflow.com/comment/38607403
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38650039

http://stackoverflow.com/q/24765784
has answer: http://stackoverflow.com/a/24766014
has title: How to validate Rails form_for is completely filled out on the client side?
has comment: http://stackoverflow.com/comment/38428501
has comment: http://stackoverflow.com/comment/38428883
answer count: 4
favorite count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: ruby-on-rails
score: 2
has answer: http://stackoverflow.com/a/24765928
tagged with: forms
has body: I'm having a really hard time validating that all the form fields in my Rails form_for are completed before the form is allowed to be submitted to the backend. On the back the model checks for the presence of all the attributes, but on the front I need to alert the user if they haven't completed a field. Here's the form: List an item for sale <%= form_for Product.new, :options => {:id => "new_listing"}, :url => {:action => "create"}, :html => {:multipart => true} do |f| %> <%= f.label :name %> <%= f.text_field :name, :id => "name_input", :autofocus => true, :placeholder => "Name yourself" %> <%= f.label :price %> <%= f.number_field :decimal_price, :step => 'any', :placeholder => "Name your price" %> <%= f.label :description %> <%= f.text_area :description, :cols => "50", :rows => "10", :placeholder => "Write a few sentences about the item you're listing. Is it in good condition? Are there any accessories included?" %> <%= f.label "Add a photo (increases your likelihood of selling)" %> <%= f.file_field :photo %> <%= f.label "Category" %> <%= f.collection_select :category_id, Category.all, :id, :name, :prompt => 'Choose a category' %> <%= f.submit "List!" %> <% end %> The problem I've run into is figuring out how to send a false boolean value to the form so that it will stop the form from being sent. Every time I've tried using onSubmit or onclick actions it just submits anyway and ignores the false boolean. Can someone show me how to check the form fields for name_input, price, and description to ensure they're completed and throw and error if they're not?
type: Question
has answer: http://stackoverflow.com/a/29022098
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24766923

http://stackoverflow.com/comment/38573278
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24840188
has text: Sure, the transition is: box-shadow 0.2s linear,background-color 0.2s linear
score: 0

http://stackoverflow.com/q/24785834
score: 0
answer count: 1
tagged with: jquery
has title: Problems with mixpanel and a tags
type: AnsweredQuestion
tagged with: mixpanel
has body: So I have the following line of code Get started But while it goes to the link it never manages to send the event to mixpanel. I've tried a few tests, mainly putting in a different function such as Get started Which works. I've even tried variants such as Get started Which still doesn't work. The only time I've gotten the event to be tracked was when it was JUST the mixpanel call and no page change. Does anyone know why this might be the case? How to fix it?
accepted answer: http://stackoverflow.com/a/25005045
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25005045

apache
tags question: http://stackoverflow.com/q/24856492
tag name: apache
tags question: http://stackoverflow.com/q/24774997
tags question: http://stackoverflow.com/q/24887079
tags question: http://stackoverflow.com/q/24749310
tags question: http://stackoverflow.com/q/24759856
type: Tag
tags question: http://stackoverflow.com/q/24805540

http://stackoverflow.com/comment/38553101
score: 1
comment on: http://stackoverflow.com/q/24826932
type: Comment
type: QuestionComment
has text: Right, but my point was that this is enforced by the parallel coordinates library, and that is why you aren't seeing those two dimensions. [**HERE**](https://github.com/syntagmatic/parallel-coordinates/blob/98a689dff3a26111a1527be0a6e1c969a218920d/src/autoscale.js#L31-L38) is the relevant part of the source code. As you can see, if a column has fewer than two unique values, it is filtered out.

http://stackoverflow.com/q/24813143
favorite count: 0
has title: Values not updating when using functions to assign templates
has comment: http://stackoverflow.com/comment/38517867
type: AnsweredQuestion
downvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/38517844
has answer: http://stackoverflow.com/a/24814459
accepted answer: http://stackoverflow.com/a/24814459
score: 1
has comment: http://stackoverflow.com/comment/38518539
tagged with: knockout.js
has body: I have this HTML and am trying to use it to generate a table with the option to add more rows: Item Cost Amount Add Item I'm using two different templates: and am choosing which one to call based on the results of the dynTemplate function. The knockout that I have powering this is very simple: function ItemAdd(name, icost, iamount) { var self = this; self.item = name; self.cost = ko.observable(icost); self.amount = ko.observable(iamount); } function TestModel() { var self= this; self.items= ko.observableArray([ new ItemAdd("a", 5, 10), new ItemAdd("b", 6, 4) ]); self.addItem= function() { self.items.push(new ItemAdd("", 0, 0)); }; self.dynTemplate= function(init, s) { if(init=== 0 || init=== '') { return 'inpTmp'; } return 'dispTmp'; }; } ko.applyBindings(new TestModel()); The problem that I am running into is that when I enter values into newly created rows, the values in items do not change. They initialize properly, but when I run a function to log the values in items they stay as their defaults. If I use knockout if statements, then everything updates properly. However, using 6 sets of if statements didn't seem very effective so I wanted to see if I could pull it out into a function and then send back the proper template. I'm trying to have inputs there when the value is "" or 0, and then change them to when something is entered. I've tried changing how the data is passed into the template, and I've tried to assign context using with, but to no avail. Calling dynTemplate does not work unless prefixed by $root or $parent. If that is changing the context, is there a way to reset it? Is this a problem of context, and if so, is there a way to assign context with the dynTemplate function? Or are the newly created elements from the template not properly binding? I've searched quite a bit, and have found templates within foreach loops, but have not seen functions being used to apply them. If there is a better way to do this, please let me know. Thank you for the help
upvote count: 1
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/38654411
has text: According to [the docs](https://developers.google.com/maps/documentation/javascript/reference#IconSequence) the `icon` needs to be a Symbol, not an image, so I think you're out of luck
score: 2
comment on: http://stackoverflow.com/q/24884739
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38592578
comment on: http://stackoverflow.com/a/24852762
score: 0
type: AnswerComment
has text: `class` is a restricted word in javascript
type: Comment

http://stackoverflow.com/q/24817601
tagged with: http://stackoverflow.com/tag/html
tagged with: twitter-bootstrap
type: UnansweredQuestion
type: Question
has body: Hi I am new to Bootstrap, wondering how do i put dynamic image tag into modal for display as a lightbox. I tried with image tag referring to variable in Ajax, but it doesnt work. Thanks for your time Javascript code: Modal Html code Close
answer count: 1
has answer: http://stackoverflow.com/a/24818821
tagged with: javascript
has title: How to put dynamic image tag into modal?
score: 0

http://stackoverflow.com/a/24858631
answers question: http://stackoverflow.com/q/24858603
type: Answer
score: 0
has body: Object.prototype.concat is undefined. concat is a method on an array or string. instead use: for (var attrname in b) { a1[attrname] = b[attrname]; }

http://stackoverflow.com/a/24806888
downvote count: 0
has comment: http://stackoverflow.com/comment/38515144
answers question: http://stackoverflow.com/q/24805925
upvote count: 2
has body: If you are using the tv4 library you can do: tv4.addFormat('date-time', function (data) { if (data instaceof Date) return null; else return "not a valid date"; }); and your validation should be: { type: "object", format: "date-time" } This method is mentioned in the question you posted (json schema date-time does not check correctly)
accepted answer of: http://stackoverflow.com/q/24805925
type: AcceptedAnswer
type: Answer
score: 2

http://stackoverflow.com/a/24877334
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/24858730
has body: This really looks like you are asking to modify one document only, but where you are presently looping updates you do not need to do that. Also you are asking for the modified result, which actually belongs to methods like .findOneAndUpdate(), as that form returns the modified document. The .update() form which can be applied to multiple documents and therefore does not return the modified contents in the result: So it really looks like rather than looping, then all you need to do is "re-shape" your input array: var array = ["Tennis","Football"]; array = array.map(function(x) { return { "name": x }; }); // array is now [{ "name": "Tennis" }, { "name": "Football" }] Talent.findOneAndUpdate( { "userName": userName }, { "$addToSet": { "skills": { "$each": array } } }, function(err,doc) { if (err) throw err; // doc contains all array members added console.log( JSON.stringify( doc, undefined, 4) ); callback(); // Your outer callback } ); The $each modifier takes an array argument in the last case, so it is just a matter of re-shaping your input arguments in the original array to match the structure expected when updating the actual document. There are other ways of dealing with performing the looping in series, but it would seem that in this case you do not need it.
accepted answer of: http://stackoverflow.com/q/24858730
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39702543
type: Answer

http://stackoverflow.com/comment/38693584
has text: Do not set inline styles at all. Assign a class name and style that one; e.g. `iframe.classList.add('hidden');` and CSS `.hidden { display: none; }`. This will save you some trouble in the long way.
comment on: http://stackoverflow.com/q/24906279
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/38685859
type: Comment
comment on: http://stackoverflow.com/q/24901903
type: QuestionComment
has text: https://docs.angularjs.org/api/ng/directive/ngModelOptions
score: 0

http://stackoverflow.com/comment/38498880
has text: This doesn't make sense: `with data-1 starts with this and with data-1 starts with that`.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24803312
type: Comment

http://stackoverflow.com/q/24890920
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/24891856
score: 2
has comment: http://stackoverflow.com/comment/38667554
linked to: http://stackoverflow.com/q/6740253
has answer: http://stackoverflow.com/a/50253346
has answer: http://stackoverflow.com/a/24892505
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38665191
has title: Prevent default scroll to element for input
linked to: http://stackoverflow.com/q/487073
tagged with: javascript
type: Question
upvote count: 2
answer count: 3
has body: Can I prevent default scroll top to input when it's focused and not visible? Simple example: &lt;input type="search"&gt; &lt;div style="height: 2000px"&gt;&lt;/div&gt; To see what I mean, go to http://jsfiddle.net/PV5tC/ and: Click on input to make it focused. Scroll down to the end of the page (input is not visible now). Start typing anything.
downvote count: 0
has comment: http://stackoverflow.com/comment/38665096
tagged with: jquery
has comment: http://stackoverflow.com/comment/38665439
favorite count: 0
has comment: http://stackoverflow.com/comment/38665517

permissions
tag name: permissions
type: Tag
tags question: http://stackoverflow.com/q/24875102

http://stackoverflow.com/q/24903062
has body: I am new in Backbone and trying to run following code. But I don't understand somehow. It is not working properly. More clearly when I create collection listenTo doesn't catch the create event. Here is my code var levelIndex=0; var app = {}; $(function(){ $('.datepicker').datepicker({ format: 'dd/mm/yyyy', startDate: '-3d' }); //model app.Level = Backbone.Model.extend({ defaults: { levelIndex:-1 } }); //collection app.Levels= Backbone.Collection.extend({ model: app.Level, url:'#' }); //views app.LevelView = Backbone.View.extend({ events: { 'click .addItems': 'addItems', 'click .clearItems': 'clearItems', 'click .removeLevel':'removeLevel' }, addItems: function () { // add items }, clearItems:function(){ // }, removeLevel:function(){ // }, tagName: 'div', className: 'level active', template: _.template($('#levelTemplate').html()), render: function () { this.$el.html(this.template(this.model.toJSON())); return this; } }); //levels view app.LevelsView = Backbone.View.extend({ events: { 'click .add': 'addLevel' }, addLevel: function( e ) { e.preventDefault(); console.log('inside add level function'); var formData = {}; formData['levelIndex']=levelIndex++; this.collection.create( formData ); console.log('after creating collection'); }, el: '#levels', initialize: function() { this.collection=new app.Levels(new app.Level()); //following line of code doesnt work properly this.listenTo( this.collection, 'create', this.renderLevel ); }, // render levels view by rendering each level in its collection render: function () { this.collection.each(function (item) { this.renderLevel(item); }, this); }, // render a level by creating a LevelView and appending the // element it renders to the levels' element renderLevel: function (item) { var levelView = new app.LevelView({ model: item }); this.$el.append(levelView.render().el); } }); new app.LevelsView(); });
answer count: 1
tagged with: backbone.js
has answer: http://stackoverflow.com/a/24903355
type: AnsweredQuestion
has title: Backbone listenTo doesnt firing
type: Question
accepted answer: http://stackoverflow.com/a/24903355
tagged with: javascript
score: 0

http://stackoverflow.com/comment/38626828
score: 0
has text: @Flynn that may well be the whole problem
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24870704

http://stackoverflow.com/a/25042047
has comment: http://stackoverflow.com/comment/38990664
score: 2
has body: The problem is not that renaming a function is unsafe, the problem is that code which depends on "name" property of a function is unsafe, regardless of the renaming you are considering. Consider that a function object's 'name' property isn't defined in the ecma standard, and that some browsers therefor don't implement it. In JavaScript functions can be nameless, or may have several names, so taking a dependency on a browser-specific name property in code is the problem, not the concept of renaming functions.
downvote count: 0
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/24853292

http://stackoverflow.com/comment/38636816
type: Comment
has text: Thanks for the code to get it to work in Chrome and Firefox! I'm finding it doesn't work in IE11, however. Thanks, also, for the extra information - very helpful!
type: AnswerComment
comment on: http://stackoverflow.com/a/24875705
score: 0

http://stackoverflow.com/a/24777618
has comment: http://stackoverflow.com/comment/38450774
has body: Stuff these as the ajax request options as well: cache: false, contentType: false, mimeType: 'multipart/form-data', processData: false, method: 'POST' contentType, mimeType and processData -options are quite important. processData: false tells jQuery not to screw the data up and send it as is, while contentType: false lets jQuery put the right content type automatically. mimeType might be important as well since you are sending form data, which is multipart because of the image.
score: 0
answers question: http://stackoverflow.com/q/24777570
type: Answer

http://stackoverflow.com/comment/38450623
type: QuestionComment
score: 0
has text: Needs to be parsed so when retireved from db it will appear as user entered it.
comment on: http://stackoverflow.com/q/24777852
type: Comment

http://stackoverflow.com/comment/38541264
has text: BTW, I know the code doesn't match exactly, that is cut and paste from the actual code I was working with, not generic variable names and such. Sorry for being lazy and not changing it to look like my first example.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24825852
type: Comment

http://stackoverflow.com/q/24842252
answer count: 1
favorite count: 0
tagged with: parse-platform
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38599079
has answer: http://stackoverflow.com/a/27365729
score: 11
upvote count: 11
has comment: http://stackoverflow.com/comment/38625200
type: Question
has comment: http://stackoverflow.com/comment/38577938
has comment: http://stackoverflow.com/comment/38594935
has body: I have a very strange problem because some weeks ago, all worked well. But now, I cannot save a object containing a Date. I use the Parse.com backend. I have a very simple class with just one field Date. I do a very simple query : var Day = Parse.Object.extend('Day'); var d = new Day(); var now = new Date(); d.set('dateField', now); d.save(); I get an error : invalid type for key dateField, expected date, but got string if I try to do that : d.set('dateField', {__type:"Date", iso:now.toISOString()} I've got the same problem... I hope somebody can help me, because, I have not any idea... Thanks !
downvote count: 0
has comment: http://stackoverflow.com/comment/56536746
has title: Save a date field to Parse : invalid type for key, expected date, but got string
tagged with: javascript
tagged with: datetime

http://stackoverflow.com/a/24854682
has comment: http://stackoverflow.com/comment/38596331
score: 0
has comment: http://stackoverflow.com/comment/38596506
has comment: http://stackoverflow.com/comment/38596394
answers question: http://stackoverflow.com/q/24854636
type: Answer
has comment: http://stackoverflow.com/comment/38596319
has body: Have you tried doing this: $('#submitbuttonid').click(function() { $.ajax( { url : url, type: "POST", data : data, async: false, complete: function() { return true; } }); }); It's not the prettiest solution, but it should work. Also, you misspelled on (one), and I don't see what the e in function(e) is doing. EDIT Try this $('form').submit(function() { $.ajax( { url : url, type: "POST", data : data, async: false, complete: function() { return true; } }); });

http://stackoverflow.com/comment/38676990
type: Comment
type: QuestionComment
score: 4
comment on: http://stackoverflow.com/q/24897329
has text: when using addEventListener you omit the `on` in the event name

http://stackoverflow.com/comment/38558229
score: 0
has text: How come? In the second edit I made to my original question, people show examples on how to check if images exist on a server. Applying that logic, I could also check if video files existed on the server. The problem is that my conditions are a bit more limiting on what's doable performance -wise and what's not.
comment on: http://stackoverflow.com/a/24834019
type: Comment
type: AnswerComment

http://stackoverflow.com/q/24813863
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38519365
accepted answer: http://stackoverflow.com/a/24815111
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/24814034
tagged with: jquery
has title: show search field when some starts typing on the web page
possible better answer: http://stackoverflow.com/a/24814034
has body: When someone starts typing (number or alphabets), I want a search bar to appear and it should take the alphabets that are being written by the user in it, ie, I want it to automatically focus on the field. So far I have this.. if (window.addEventListener) { var keys = [], listen= /^([0-9]|[a-z])\i$/ ; window.addEventListener("keydown", function(e){ keys.push(e.keyCode); if(keys.match(listen)) { $('#searchBar').fadeIn(); $('#searchBar input').text(keys); $('#searchBar input').focus(); keys = []; } },true); } I want the first character that was typed in to show in the field too. Ty.
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38519511
has answer: http://stackoverflow.com/a/24815111
tagged with: event-listener

thymeleaf
tags question: http://stackoverflow.com/q/24761382
tag name: thymeleaf
type: Tag

http://stackoverflow.com/q/24804194
favorite count: 0
tagged with: rest
has comment: http://stackoverflow.com/comment/38501754
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Download file with http header
has comment: http://stackoverflow.com/comment/38501083
downvote count: 0
has body: I'm looking for dowloading PDF files with html links with HTTP authentication header. It is not possible to fix them without javascript, so I tried this : Html : fileName.pdf Javascript : $("#myLink").on("click", function() { var xhr = new XMLHttpRequest(); xhr.open("GET", myUrl, true); xhr.setRequestHeader("X-Token", authToken); xhr.send(); return false; }); File is downloaded (regards to network analysis) but I don't know how to open it in a new browser tab. I know we don't save files from javascript but I just want to display it. Do you have any idea ? Thanks.
has comment: http://stackoverflow.com/comment/38500555
score: 1
has comment: http://stackoverflow.com/comment/38501412
has comment: http://stackoverflow.com/comment/38500797
type: Question
has comment: http://stackoverflow.com/comment/38501268
has comment: http://stackoverflow.com/comment/38500853
has comment: http://stackoverflow.com/comment/38501051
tagged with: javascript
upvote count: 1
tagged with: http://stackoverflow.com/tag/pdf
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/24805280

http://stackoverflow.com/comment/38493441
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24800142
score: 0
has text: Hi, yea the line `if (cameraLong === '') return;` makes sure the map doesn't load in a random location if no values are found. What I need then is a text string that says no values are found instead of loading nothing!

http://stackoverflow.com/a/24826992
has body: It gets changed to a string because HTML has no concept of what an integer is. Ultimately the selected variables is read from the DOM and handed to angular and so it changes its type. You can force the model to always contain an integer with a directive directive('forceInt', function() { return { require: 'ngModel', link: function(scope, element, attrs, controller) { controller.$parsers.push(function(value) { if (typeof value === 'string') { value = parseInt(value, 10); controller.$setViewValue(value); controller.$render(); } return value; }); } }; }); (plunk) But I see someone already pointed out that there might be better ways to keep track of the ordering. FWIW that directive will at least keep making sure the model is never a string.
upvote count: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/38550142
has comment: http://stackoverflow.com/comment/38547119
score: 5
type: Answer
has comment: http://stackoverflow.com/comment/38545491
has comment: http://stackoverflow.com/comment/38547827
answers question: http://stackoverflow.com/q/24826608

http://stackoverflow.com/comment/38613507
has text: store value: value1... in a variable and then put that variable in `div`
comment on: http://stackoverflow.com/q/24863916
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38623117
comment on: http://stackoverflow.com/a/24836100
score: 0
type: AnswerComment
has text: Popping values off the array is apparently more efficient according to http://stackoverflow.com/questions/1232040/how-to-empty-an-array-in-javascript. Seems counter-intuitive, but the benchmarks substantiate it. From an implementation standpoint, I'm interested in why this is.
type: Comment

http://stackoverflow.com/a/24862199
score: 0
answers question: http://stackoverflow.com/q/24861557
type: Answer
has body: You can globally override the dateFormat on the field object: Ext.override(Ext.data.DataField, { dateFormat: 'time' }); As for the type, no, you can't, you need to specify it.

http://stackoverflow.com/a/24789928
has comment: http://stackoverflow.com/comment/38475474
has comment: http://stackoverflow.com/comment/38475605
has body: I think you are looking for something like the following: var array = []; for(var i=0;i&lt;5;i++){ array.push({"date":"metric"}); } console.log(array); Outputs: [Object, Object, Object, Object, Object] 0: Object date: "metric" 1: Object date: "metric" 2: Object
type: Answer
has comment: http://stackoverflow.com/comment/38476479
upvote count: 1
answers question: http://stackoverflow.com/q/24789801
score: 1
downvote count: 0

http://stackoverflow.com/q/24813690
tagged with: javascript
tagged with: html5-canvas
has comment: http://stackoverflow.com/comment/38518902
linked to: http://stackoverflow.com/q/4683233
tagged with: download
has title: saving dataURL image locally via php
type: UnansweredQuestion
score: 0
tagged with: php
has answer: http://stackoverflow.com/a/24813819
has answer: http://stackoverflow.com/a/24813798
type: Question
has body: I'm making a PNG image file from a dataURL string (thanks to the example from The PHP manual). I'd like this code to open the "Download file" dialog in the browser, so users can save this image locally, but calling the function imagepng() saves the image to my server instead. Am I using the wrong function when calling imagepng()? I'm trying to trigger a download by changing the headers, but it's still saving to the server. &lt;?php $data = 'iVBORw0KGgoAAAANSUhEUgAAABwAAAASCAMAAAB/2U7WAAAABl' . 'BMVEUAAAD///+l2Z/dAAAASUlEQVR4XqWQUQoAIAxC2/0vXZDr' . 'EX4IJTRkb7lobNUStXsB0jIXIAMSsQnWlsV+wULF4Avk9fLq2r' . '8a5HSE35Q3eO2XP1A1wQkZSgETvDtKdQAAAABJRU5ErkJggg=='; $data = base64_decode($data); $im = imagecreatefromstring($data); // set the headers, to trigger a download header('Content-Disposition: attachment; filename="image.png"'); header('Content-Type: image/png'); imagepng($im, 'test_2.png'); imagedestroy($im); ?&gt; Also, I'm calling the PHP via the following JavaScript, (not sure if this is relevant to the results I'm getting) $.ajax({ type: "POST", url: "php/downloadimg.php", dataType: 'text', data: { data : finishedImage.src } })
answer count: 2

http://stackoverflow.com/comment/38645299
type: Comment
comment on: http://stackoverflow.com/a/24860551
has text: Yes the json data returns what I need but its not usin the lat and lng values as co-ordinates. At the line `for (var i = 0, length = json.length; i < length; i++) {` it says Uncaught TypeError: Cannot read property 'length' of null
score: 0
type: AnswerComment

http://stackoverflow.com/q/24809324
has title: Sweet.js expression to string literal
favorite count: 0
has answer: http://stackoverflow.com/a/24898616
type: UnansweredQuestion
tagged with: macros
score: 1
upvote count: 1
type: Question
tagged with: sweet.js
tagged with: javascript
has body: I'm trying to write a macro that will convert tokens to strings. My current macro looks like this: macro stringify { case { $name($token) } =&gt; { letstx $tokenStr = [makeValue(unwrapSyntax(#{$token}), #{here})]; return #{ $tokenStr } } case { $name($token $rest ... ) } =&gt; { return #{ stringify($token) , stringify($rest ...) } } } This works well for turning identifiers into strings, but it fails to turn literals or expressions into strings. Here's my test case and what it compiles into: stringify(a b 7 d e foo 5+9) compiles into: 'a', 'b', 7, 'd', 'e', 'foo', 5, '+', 9; I'd like it to compile into: 'a', 'b', '7', 'd', 'e', 'foo', '5+9'; I assumed I could accomplish this by using the expr pattern class, but when I do, I receive this error: /usr/local/lib/node_modules/sweet.js/lib/sweet.js:99 throw new SyntaxError(syn.printSyntaxError(source$2, err)) ^ SyntaxError: [makeValue] Cannot make value syntax object from: [object Object] at expand$2 (/usr/local/lib/node_modules/sweet.js/lib/sweet.js:99:27) at parse (/usr/local/lib/node_modules/sweet.js/lib/sweet.js:135:29) at Object.compile (/usr/local/lib/node_modules/sweet.js/lib/sweet.js:143:19) at Object.exports.run (/usr/local/lib/node_modules/sweet.js/lib/sjs.js:70:45) at Object.&lt;anonymous&gt; (/usr/local/lib/node_modules/sweet.js/bin/sjs:7:23) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10 Which appears to be caused by the makeValue function being unable to handle an expression. If anyone could provide me with some insight, I would greatly appreciate it.
answer count: 2
has answer: http://stackoverflow.com/a/24854108
downvote count: 0

http://stackoverflow.com/comment/38588439
type: QuestionComment
comment on: http://stackoverflow.com/q/24850356
has text: `$("#<%= Foo.ClientID %>").change();`.. which one is Foo?
score: 0
type: Comment

http://stackoverflow.com/a/24846119
upvote count: 1
score: 1
downvote count: 0
has body: If the goal is that the user cannot change this text then you can do a couple of things: add the text outside of the textarea (above it for instance) Add the text outside of the textarea but place it behind the textarea using css. You can make the textarea transparent so the user can see the text. The problem there would be that the text the user types can fall over the text you placed in the background Put it in a background image of the textarea Place the text inside the textarea ( Hi, my name is ) and use JavaScript to test for what has been typed and change the text if it changes into something that you do not want. There are masking plugins that you can use to do this. The best options would be the first option and the forth. I'd go the first as it is by far the easiest
answers question: http://stackoverflow.com/q/24846041
type: Answer

http://stackoverflow.com/q/24784201
has comment: http://stackoverflow.com/comment/38463072
has body: I am able to use iOS Instruments by Xcode or run the test written in javascript by shell but I have a question about it. Is it possible to run these test on Ubuntu, not being possible to install Xcode on it?
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/2406151
tagged with: instruments
type: Question
has answer: http://stackoverflow.com/a/25036069
tagged with: ios
tagged with: javascript
tagged with: ubuntu
has title: Run iOS UI Automation on Ubuntu
has comment: http://stackoverflow.com/comment/38935640
score: 0
tagged with: xcode
answer count: 1

http://stackoverflow.com/a/24856410
type: Answer
has body: Twitter handle needs to be passed as the part of the text URL parameter. Please refer the below code snippet. &lt;script&gt; var twitterHandle = 'sarbbottam'; function tweetCurrentPage() { window.open('https://twitter.com/share?url='+escape(window.location.href)+'&amp;text='+document.title + ' via @' + twitterHandle, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600'); return false; } &lt;/script&gt;
accepted answer of: http://stackoverflow.com/q/24856221
has comment: http://stackoverflow.com/comment/38645784
answers question: http://stackoverflow.com/q/24856221
upvote count: 4
has comment: http://stackoverflow.com/comment/38645705
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38646350
score: 4
has comment: http://stackoverflow.com/comment/38638385

http://stackoverflow.com/q/24894189
tagged with: twitter-bootstrap
type: Question
tagged with: javascript
has title: Pass an id to link_to_route inside of a bootstrap modal
score: 0
tagged with: modal-dialog
has answer: http://stackoverflow.com/a/24896763
answer count: 1
tagged with: jquery
has body: My goal is that a user has to confirm a delete operation before it's send to the controller. At the moment I'm triggering the modal with this link: id }}">Löschen Inside of this modal i've put a input-field to test if my jquery is working and the id is successfully passed to it. Nein, lieber doch nicht Now i want to pass the id to a link_to_route function or something similar inside this modal, but don't find a way to do this. Something like that: {{ link_to_route('locations.destroy', 'Ja, Standort löschen', array($location->id), array('class' => 'btn btn-danger')) }} Is there a possibilty to do this with the link_to_route function? How do I have to pass the data?
tagged with: laravel
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24896763

http://stackoverflow.com/comment/38476079
comment on: http://stackoverflow.com/a/24790559
type: Comment
has text: If this was the case, the OP would not have said he solved it... same goes for @HaukurHaf as he has also posted a solution.
type: AnswerComment
score: 0

http://stackoverflow.com/a/24869862
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38625612
has comment: http://stackoverflow.com/comment/131447965
upvote count: 5
type: Answer
accepted answer of: http://stackoverflow.com/q/24869761
downvote count: 0
has comment: http://stackoverflow.com/comment/38648452
answers question: http://stackoverflow.com/q/24869761
has comment: http://stackoverflow.com/comment/38625146
has comment: http://stackoverflow.com/comment/38635132
has comment: http://stackoverflow.com/comment/38625281
has body: You would need to clone the node. var toNodeList = function(arrayOfNodes){ var fragment = document.createDocumentFragment(); arrayOfNodes.forEach(function(item){ fragment.appendChild(item.cloneNode()); }); return fragment.childNodes; }; Note pass true to cloneNode to make a deep clone.
has comment: http://stackoverflow.com/comment/38649112
score: 5

http://stackoverflow.com/comment/38595393
comment on: http://stackoverflow.com/q/24854254
score: 0
type: Comment
has text: [inputs, textareas](https://developer.mozilla.org/en-US/docs/Web/API/Input.select) have the select method
type: QuestionComment

http://stackoverflow.com/q/24774280
has title: Unable to delete row from html table using jquery
possible better answer: http://stackoverflow.com/a/24774407
has answer: http://stackoverflow.com/a/24774407
type: Question
type: AnsweredQuestion
has body: I'm using jquery to add new row as well as delete row. The adding part works, but the delete doesn't work at all, and I can't figure out why. It would work the first time, and the rest of the time it just doesn't work. Specifically, the only time it would work is when I click the delete on the first row. HTML ... ... ... ... Add Delete Jquery var i = 1; $("#addRow").click(function(){ $("table tr:last").clone().find("input, select, textarea").each(function(){ $(this).val('').attr({ 'id': function(_,id){ return id+i}, 'name': function(_,name){ return name+i}, 'value':'' }); }).end().appendTo("table"); i++; }); $("#deleteRow").click(function(){ alert("delete clicked") $(this).parent().parent().remove(); }); I've tried changing $(this).parent().parent().remove(); to $(this).closest("tr").remove(); but that doesn't work as well. I've also tried doing it like and declaring a function deleteRow but that hasn't helped either. Would definitely appreciate help or pointers here. Thank you.
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24774346
accepted answer: http://stackoverflow.com/a/24774346

http://stackoverflow.com/q/24891406
type: Question
type: AnsweredQuestion
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25550214
has title: Force date Axis in Kendo Dataviz to have all values
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/38684067
favorite count: 0
tagged with: kendo-ui
tagged with: kendo-dataviz
has body: I'm making a chart using Kendo and have run into a problem. I'm getting a load of data and passing it into the chart, the data has a date and a value, and my js looks like this: chart.kendoChart({ title: { text: "title" }, seriesDefaults: { type: "line" }, dataSource: { data: [] }, series: [{ name: "Value", field: "value" }] categoryAxis: [{ type: "date", field: "date", baseUnit: "months", min: "2013-07-22T00:00:00", max: "2014-07-22T00:00:00" }] }); The problem is that if there is no Data returned (i.e. an empty array as above) I'd still like to see the Month date labels along the bottom, but there is nothing there (there are still default value labels up the y-axis). I have looked at the Kendo documentation and cannot find anything there, nor any similar questions on stackoverflow. Can anyone help? Let me know in comments if there is anything I need to clarify/provide. Thanks.
tagged with: kendo-chart
has answer: http://stackoverflow.com/a/25550214
score: 2
upvote count: 2

http://stackoverflow.com/comment/38491438
type: Comment
comment on: http://stackoverflow.com/a/24798359
has text: @mikethedj4 yes, I saw this problem. Actually you can add something unique to them (`id`, or `data-value`, or whatever else) or take only first or last one. I'll try to do something with this now
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38900333
comment on: http://stackoverflow.com/a/24907455
has text: @Reinmar, that was my one of my colleagues, so nice to meet you :)
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/q/24763671
has answer: http://stackoverflow.com/a/24765024
tagged with: spring
tagged with: spring-mvc
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24763960
possible better answer: http://stackoverflow.com/a/24765024
has body: I need a popup window with login name, password and submit button. I have created a popup window as shown below with javascript. I am able to print alert, but textfiled and submit button doesn't display in the popup window. loginQB = function(){ window.open('about:blank', 'popup', 'width=640,height=580,resizeable,scrollbars'); document.getElementById('myAnchor').outerHTML=document.write("&lt;input type=\"submit\" value=\"Submit\"&gt;"); alert(document.documentElement.innerHTML) } html code: &lt;%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%&gt; &lt;form:form method="POST" action="/asi/mappings" onsubmit="loginQB(); return false;"&gt; UPDATE var win = window.open('about:blank', 'popup', 'width=640,height=580,resizeable,scrollbars'); win.document.write('&lt;form:form id="qblogin" method="POST" action="/asi/mappings"&gt;'); win.document.write('&lt;br&gt;Sign in with mycompany Account or &lt;a href="www.mycompany.com"&gt;CreateOne'); win.document.write('&lt;br&gt;&lt;input type="text" name="userName"&gt;'); win.document.write('&lt;br&gt;&lt;input type="password" name="password"&gt;'); win.document.write('&lt;br&gt;&lt;input type="submit" value="Submit"&gt;'); win.document.write('&lt;/form&gt;'); I am getting Unterminated &lt;form:form tag error. Using spring form tag library as shown above in the html code.
has title: poupup window in javascript and displaying content
has comment: http://stackoverflow.com/comment/38426712
type: Question
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24763960
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38424220
has comment: http://stackoverflow.com/comment/38424263

meteor
tags question: http://stackoverflow.com/q/24830588
tags question: http://stackoverflow.com/q/24896172
tags question: http://stackoverflow.com/q/24888138
tags question: http://stackoverflow.com/q/24862401
tags question: http://stackoverflow.com/q/24879360
tags question: http://stackoverflow.com/q/24784939
tags question: http://stackoverflow.com/q/24805026
tags question: http://stackoverflow.com/q/24810484
tags question: http://stackoverflow.com/q/24793667
tags question: http://stackoverflow.com/q/24829853
tags question: http://stackoverflow.com/q/24813176
tags question: http://stackoverflow.com/q/24800345
tags question: http://stackoverflow.com/q/24816324
tags question: http://stackoverflow.com/q/24826471
tags question: http://stackoverflow.com/q/24869542
tags question: http://stackoverflow.com/q/24839712
tags question: http://stackoverflow.com/q/24767124
tags question: http://stackoverflow.com/q/24853253
tags question: http://stackoverflow.com/q/24778312
tags question: http://stackoverflow.com/q/24805913
tags question: http://stackoverflow.com/q/24765151
tags question: http://stackoverflow.com/q/24800977
tags question: http://stackoverflow.com/q/24900380
type: Tag
tags question: http://stackoverflow.com/q/24771082
tags question: http://stackoverflow.com/q/24794860
tags question: http://stackoverflow.com/q/24821267
tags question: http://stackoverflow.com/q/24877193
tags question: http://stackoverflow.com/q/24873239
tags question: http://stackoverflow.com/q/24811376
tags question: http://stackoverflow.com/q/24868044
tags question: http://stackoverflow.com/q/24811212
tag name: meteor
tags question: http://stackoverflow.com/q/24769919
tags question: http://stackoverflow.com/q/24835925

http://stackoverflow.com/q/24900482
type: Question
accepted answer: http://stackoverflow.com/a/24900674
score: 0
answer count: 1
has body: I'm trying to send parameters to a javascript function embedded in the browser page but with no luck This is the page script: window.loadfile = function(filename){ dump(filename+" loaded"); }; I have tried changing the location to javascript:loadfile() but apparently this does not work anymore.
tagged with: xulrunner
tagged with: javascript
has answer: http://stackoverflow.com/a/24900674
type: AnsweredQuestion
tagged with: webbrowser-control
has title: How to call a function inside a XULRunner browser control?

http://stackoverflow.com/q/24785186
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: gulp
favorite count: 0
upvote count: 6
tagged with: node.js
type: AnsweredQuestion
score: 6
has body: I am using gulp-nodemon config directory includes only one file, server.js. $.nodemon({ script: 'config/server.js', watch: ['config/**/*.js'] }) .on('restart', function () { setTimeout(function () { $.livereload.changed(); }, 1000); }); Output: [gulp] [nodemon] v1.2.1 [gulp] [nodemon] to restart at any time, enter `rs` [gulp] [nodemon] watching: config/**/*.js [gulp] [nodemon] starting `node config/server.js` [gulp] [nodemon] watching 34,325 files - this might cause high cpu usage. To reduce use "--watch". If i include an ignore option it fixes. ignore: [ 'node_modules/**', 'bower_components/**' ] Why does nodemon watch everything even when I tell it to watch only config directory? Also it appears from the output it only watches the config directory [nodemon] watching: config/**/*.js
has title: Nodemon watch option broken
type: Question
accepted answer: http://stackoverflow.com/a/25044034
tagged with: nodemon
has answer: http://stackoverflow.com/a/25044034

http://stackoverflow.com/comment/38481529
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24793660
score: 0
has text: You need to check your console you have errors, when the slideshow trys to keep showing a different one

http://stackoverflow.com/q/24793660
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/24793891
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38481713
type: Question
has body: So off the bat I will admit that I only know the basics of JS. I have done a few courses online and am now looking at code for things I want to do so I can reverse engineer that code, and learn by changing things around. I found some code for a JS slideshow on CodePen and changed some things. Only now it will only show the first image and not cycle, and the buttons to move around fail as well. I copied what I changed in this fiddle The JS code looks like this (I included another snippet in the document in case that is a problem, the fiddle doesn't have it): $(document).ready(function() { /*JQuery for fade in highlighting of links*/ $(".link").hover(function() { $(this).animate({ color:'#fe57a1'}, 100); }, function() { $(this).animate({ color: '#fff'}, 300); }); /*Slide show code*/ var on = true; var myVar = setInterval(function(){ if(on) {slides()}on=true;},3000); function slides(i) { document.getElementsByClassName(".slideImage")[1].style.width="0px"; document.getElementsByClassName(".slideImage")[2].style.width="100%"; var slide = document.getElementsByClassName(".slideImage")[0]; document.getElementById("slide").appendChild(slide); if(i) { on = false; } } function back_slide(i) { document.getElementsByClassName(".slideImage")[1].style.width="0px"; document.getElementsByClassName(".slideImage")[0].style.width="100%"; var slide = document.getElementsByClassName(".slideImage")[4]; var slide2 = document.getElementsByClassName(".slideImage")[0]; document.getElementById("slide").insertBefore(slide,slide2); if(i) { on = false; } } }); The HTML and CSS is in the fiddle, I didn't know if I should include here in the post.
tagged with: javascript
tagged with: jquery
has title: Javascript slideshow only shows first image, buttons don't work
has answer: http://stackoverflow.com/a/24793891
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38481808
has comment: http://stackoverflow.com/comment/38481529
possible better answer: http://stackoverflow.com/a/24794363
has answer: http://stackoverflow.com/a/24794363

http://stackoverflow.com/q/24863630
possible better answer: http://stackoverflow.com/a/24863922
has answer: http://stackoverflow.com/a/24863922
score: 1
type: Question
has title: How to fill an array with a for loop in Javascript?
answer count: 2
tagged with: for-loop
has comment: http://stackoverflow.com/comment/39103044
tagged with: winjs
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/39176526
has answer: http://stackoverflow.com/a/24864000
has comment: http://stackoverflow.com/comment/38613136
has comment: http://stackoverflow.com/comment/38613556
has comment: http://stackoverflow.com/comment/38613096
downvote count: 0
tagged with: windows-8.1
favorite count: 0
has body: I want to create a for loop that will generate a new element for sampleItems based on a fixed number set in a for loop. var list = new WinJS.Binding.List(); var groupedItems = list.createGrouped( function groupKeySelector(item) { return item.group.key; }, function groupDataSelector(item) { return item.group; } ); generateSampleData().forEach(function (item) { list.push(item); }); function generateSampleData() { var sampleGroups = [ { key: "group1", title: "Event1", backgroundImage: "/images/event1.jpg"} ]; var sampleItems = [ { group: sampleGroups[0], title: "Item Title: 1", content: "http://192.168.201.41/Stream" + [i] + ".mp4", backgroundImage: "/images/image1.jpg" } ]; return sampleItems; } I tried to place a for loop within sampleItems but i'm not allowed place the loop there.
upvote count: 1
has comment: http://stackoverflow.com/comment/38613221
accepted answer: http://stackoverflow.com/a/24864000
type: AnsweredQuestion

http://stackoverflow.com/a/24868349
score: 1
has body: There's no float field type by default; that should be number. That's probably why you only get half of your data parsed in your second example.
answers question: http://stackoverflow.com/q/24867026
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/38622621
upvote count: 1

http://stackoverflow.com/a/24775912
upvote count: 4
has body: Try this [reverse order traversal]: var childs = document.getElementById('parent').childNodes; var len = childs.length; if(len --) do { console.log('node: ', childs[len]); } while(len --); OR [in order traversal] var childs = document.getElementById('parent').childNodes; var len = childs.length, i = -1; if(++i &lt; len) do { console.log('node: ', childs[i]); } while(++i &lt; len);
type: Answer
downvote count: 1
score: 3
answers question: http://stackoverflow.com/q/24775725
has comment: http://stackoverflow.com/comment/65365349

http://stackoverflow.com/q/24760490
has body: Inspired by JavaScript Closures I tried to Simulate Local static variables in C# using Func&lt;> Delegate... Here is my code.. public Func&lt;int&gt; Increment() { int num = 0; return new Func&lt;int&gt;(() =&gt; { return ++num; }); } Func&lt;int&gt; inc = Increment(); Console.WriteLine(inc());//Prints 1 Console.WriteLine(inc());//Prints 2 Console.WriteLine(inc());//Prints 3 I am eager to know if there is any other way of simulating local static variable in C#? Thank You.
has comment: http://stackoverflow.com/comment/38419855
has comment: http://stackoverflow.com/comment/38419079
has comment: http://stackoverflow.com/comment/38418691
has comment: http://stackoverflow.com/comment/38419338
has comment: http://stackoverflow.com/comment/38418849
has comment: http://stackoverflow.com/comment/38418197
has comment: http://stackoverflow.com/comment/38418230
has comment: http://stackoverflow.com/comment/38418607
type: Question
has comment: http://stackoverflow.com/comment/38418424
tagged with: c#
has comment: http://stackoverflow.com/comment/38418459
upvote count: 5
tagged with: .net
tagged with: javascript
has comment: http://stackoverflow.com/comment/38418813
score: 4
has comment: http://stackoverflow.com/comment/38419158
has comment: http://stackoverflow.com/comment/38418857
has answer: http://stackoverflow.com/a/24761032
has comment: http://stackoverflow.com/comment/38419609
has comment: http://stackoverflow.com/comment/38419074
has comment: http://stackoverflow.com/comment/38419250
has comment: http://stackoverflow.com/comment/38418588
has comment: http://stackoverflow.com/comment/38419928
has comment: http://stackoverflow.com/comment/38418625
has comment: http://stackoverflow.com/comment/38418648
has comment: http://stackoverflow.com/comment/38419568
answer count: 1
has comment: http://stackoverflow.com/comment/38419553
has comment: http://stackoverflow.com/comment/38418159
linked to: http://stackoverflow.com/q/1049689
favorite count: 0
type: UnansweredQuestion
has title: Local Static variable in C#?
has comment: http://stackoverflow.com/comment/38418264
has comment: http://stackoverflow.com/comment/38418926
downvote count: 1
has comment: http://stackoverflow.com/comment/38419216

http://stackoverflow.com/a/24819069
has comment: http://stackoverflow.com/comment/38528616
has body: You need to create date variables. Note that string format is 'MM/DD/YYYY'. var aStart = new Date('10/20/2013'), aEnd = new Date('10/30/2013'), bStart = new Date('10/21/2013'), bEnd = new Date('10/29/2013'); Now you can compare dates using getTime() method if (aStart.getTime() < aEnd.getTime()) { $('.msgContainer').append(' a-ha '); } http://jsfiddle.net/LafkE/
score: 0
answers question: http://stackoverflow.com/q/24818673
type: Answer

http://stackoverflow.com/q/24893371
tagged with: jsp
tagged with: javascript
tagged with: ajax
score: 0
has title: Include Other option in Ajax cascading drop down using JSP and Javascript
answer count: 1
tagged with: cascadingdropdown
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24894090
type: Question
has body: I have created a cascading drop down menu for my registration page where I am fetching the counries from the database and base don the countries the states would be retrieved. Everything is working good but I am not understanding how to include the OTHER option in the drop down select option in the last of the drop down select. The following is the code I have written for displaying countries in Countries_States.jsp : Country : <% try { MylistDAO dao = new MylistDAO(); ResultSet rs = dao.getCountries(); String ss; %> <% while (rs.next()) { ss = rs.getString(2); %> <option value="<%=ss%>"><%=ss%> <% } %> <% } catch (Exception e) { } %> The following is the code for retrieving list of states based on countries in AJAX :- function showcity(str) { document.getElementById("states").length = 0; 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", "getCity.jsp?q=" + str, true); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var xml = xmlhttp.responseXML; var tags = xml.getElementsByTagName("tr"); for ( var i = 0; i < tags.length; i++) { var combo = document.getElementById("states"); var option = document.createElement("option"); option.text = tags[i].childNodes[0].childNodes[0].nodeValue; option.value = tags[i].childNodes[0].childNodes[0].nodeValue; try { combo.add(option, null); //Standard } catch (error) { combo.add(option); // IE only } } }; xmlhttp.send(); } ALso the following is the getCity.jsp page to retrieve the list of states based on country : <% String names = request.getParameter("q"); out.print(names); try { MylistDAO dao =new MylistDAO(); //GetCity c = new GetCity(); ResultSet rs = dao.getState(names); String xml = " "; while (rs.next()) { xml += " "; xml += " "; xml += rs.getString(1); xml += " "; xml += " "; } xml += " "; out.print(xml); //con.close(); …

http://stackoverflow.com/q/24791978
has answer: http://stackoverflow.com/a/24792167
has title: Onclick function with parent-dependant parameters
accepted answer: http://stackoverflow.com/a/24792167
type: AnsweredQuestion
tagged with: onclick
type: Question
tagged with: javascript
has body: I've got this object : Tr.Competence = function() { var thisCount = //variableNumber; this.name = "comp" + thisCount; var newRow = parentTable.insertRow(-1); var cell1 = newRow.insertCell(0); var element1 = document.createElement('input'); element1.type = "button"; element1.value = "+"; element1.onclick = function() { makeSpecialisation(thisCount, this.name) }; cell1.appendChild(element1); } and this function : function makeSpecialisation(parentCount, parentEl) { window[parentEl + "SpecialisationCount"]++; var specialisationName = parentEl + "Spe" + window[parentEl + "SpecialisationCount"] ; //testing variables with an alert alert( "parentCount=" + parentCount + " &amp; parentEl=" + parentEl + " &amp; specialisationName=" + specialisationName + " comXSpecialisationCount=" + window[parentEl + "SpecialisationCount"] ); } If element1.onclick calls makeSpecialisation(thisCount, this.nom) directly (without anonymous function), then the variables are alright, but I can't use it after it's been evaluated (on each new Tr.Competence instance call). => See : http://jsfiddle.net/hq8U3/2/ If element1.onclick calls makeSpe[...] with anonymous function wrapper, I can call it whenever I want, but variables are either NaN or undefined (or blank on JSFiddle). => See : http://jsfiddle.net/hq8U3/3/ What can I do so that my variables work good &amp; I can call them at onClick event ?
score: 0
tagged with: wrapper
answer count: 1

unit-testing
tags question: http://stackoverflow.com/q/24864952
tags question: http://stackoverflow.com/q/24764320
tags question: http://stackoverflow.com/q/24754512
tags question: http://stackoverflow.com/q/24837571
tags question: http://stackoverflow.com/q/24787779
tags question: http://stackoverflow.com/q/24899282
tags question: http://stackoverflow.com/q/24826682
tags question: http://stackoverflow.com/q/24906644
tags question: http://stackoverflow.com/q/24832685
tags question: http://stackoverflow.com/q/24772377
type: Tag
tags question: http://stackoverflow.com/q/24798549
tag name: unit-testing
tags question: http://stackoverflow.com/q/24866875
tags question: http://stackoverflow.com/q/24904291
tags question: http://stackoverflow.com/q/24790871
tags question: http://stackoverflow.com/q/24887686

http://stackoverflow.com/comment/38407077
has text: Friend, you have only one checkbox in your code. How can you say this line- some of these check-boxes are checked.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24753518
type: QuestionComment

http://stackoverflow.com/q/24812682
has title: Angular UI-Router - Returning rejected promise in resolve is not stopping state transition
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24812772
type: Question
score: 14
has body: I am trying to assure that a user is authenticated before allowing them to transition to specific states. As I understand it (after review other posts), a state transition should not occur if the state's resolve returns a rejected promise and the '$stateChangeError' event should be raised. However this is not what I am experiencing. Stepping throught the following code, I can see that the deferred promise is rejected but the state transition still occurs and '$stateChangeError' is not triggered. In my module's config I have the following state: .state('accounts', { url: '/Accounts', controller: 'AccountsController', templateUrl: 'Scripts/angular/accounts/templates/accounts.tpl.html', resolve: { authenticated: ['$q', 'AccountService', function ($q, accountService) { var deferred = $q.defer(); accountService.userLoggedIn().then(function (loggedIn) { if (loggedIn) { deferred.resolve(); } else { deferred.reject('Not logged in'); &lt;-- This happens } return deferred.promise; }); }] } }) In the same module, in the run function I have: $rootScope.$on('$stateChangeError', function (event, toState, toParams, fromState, fromParams, error) { $log.debug(error); &lt;-- This is never called $state.go('login'); }); What am I missing?
favorite count: 0
upvote count: 14
tagged with: angularjs
answer count: 2
tagged with: angular-ui-router
has answer: http://stackoverflow.com/a/24812772
has answer: http://stackoverflow.com/a/32790545
possible better answer: http://stackoverflow.com/a/32790545

http://stackoverflow.com/comment/38518515
type: QuestionComment
type: Comment
has text: Is there a missing semicolon after j('.fa-calendar').datepicker({ startDate: '-3d' })
comment on: http://stackoverflow.com/q/24813521
score: 0

http://stackoverflow.com/comment/38539600
has text: Does it work with `ng-style`?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24825075
score: 4

http://stackoverflow.com/comment/38458623
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24755352
has text: Then your `index.html` and the file you are **showing us** are different here.

http://stackoverflow.com/a/24864587
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/38614843
has comment: http://stackoverflow.com/comment/50488471
answers question: http://stackoverflow.com/q/24864559
accepted answer of: http://stackoverflow.com/q/24864559
upvote count: 2
type: AcceptedAnswer
has body: You can use: $("#container tbody tr").click(function () { // Remove selectedRow class from any rows having it in this table $('.selectedRow', $(this).parent()).removeClass("selectedRow"); // Add it to the clicked row $(this).addClass("selectedRow"); });

http://stackoverflow.com/comment/38658472
comment on: http://stackoverflow.com/q/24759856
score: 0
type: Comment
type: QuestionComment
has text: Try adding file encoding in your code. for example `image/jpeg` for jpg or jpeg; Logically the data sent/received to/from server encoding of data is always specified.

http://stackoverflow.com/q/24769919
has comment: http://stackoverflow.com/comment/42412139
type: AnsweredQuestion
score: 3
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27493537
type: Question
has comment: http://stackoverflow.com/comment/43418652
tagged with: mongodb
has comment: http://stackoverflow.com/comment/38470258
answer count: 1
downvote count: 0
tagged with: meteor
favorite count: 0
has title: Displaying other user's email address in Meteor.js
has answer: http://stackoverflow.com/a/27493537
has comment: http://stackoverflow.com/comment/38436982
upvote count: 3
has body: Trying to display a view that shows all registered users of the app along with their email addresses. I'm using this pub/sub to pass all user data to the client instead of just the current users data. Meteor.publish("allUsers", function () { return Meteor.users.find(); }); Meteor.subscribe('allUsers'); Here is the for each loop in my template that is supposed to display their emails: {{#each users}} Email: {{users.emails.[0].address}} {{/each}} Here is the javascript that is supposed to loop over all of the current registered users and feed their data to the helper. Template.daysOverview.helpers({ users: function(){ var user = Meteor.users.find(); return user; }, }); The helper correctly loops over the number of current users of the application (eg. if there are 3 users currently registered it will display 3 instances of "Email: " on the template). The problem is that I can't find a way to access the email address of each user and display that next to the corresponding "Email: ". I tested accessing a simpler field like "_id" unsuccessfully as well. I've also tried numerous different combinations of {{users.address}}, {{users[0].address}} to access the email with no luck.

http://stackoverflow.com/a/24827643
has body: The MSFullscreenChange event is fired after an element enters or exits full-screen mode, so you can get the current state. In the example, we check the msFullscreenElement to see if any elements are in full screen. If an element is in full-screen mode, the element is returned, otherwise msFullscreenElement returns null. if (document.requestFullscreen) { document.addEventListener("fullscreenchange", function () { if (document.fullscreenElement != null) { console.info("Went full screen"); } else { console.info("Exited full screen"); } }); } else if (document.msRequestFullscreen) { document.addEventListener("MSFullscreenChange", function () { if (document.msFullscreenElement != null) { console.info("Went full screen"); } else { console.info("Exited full screen"); } }); }
has comment: http://stackoverflow.com/comment/38546394
upvote count: 2
answers question: http://stackoverflow.com/q/24827399
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/q/24822443
has comment: http://stackoverflow.com/comment/38534893
has title: Altering [object].prototype vs. [object]'s nested functions
tagged with: javascript
has answer: http://stackoverflow.com/a/24822669
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/24822655
has comment: http://stackoverflow.com/comment/38535197
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/16063394
tagged with: oop
has answer: http://stackoverflow.com/a/24822585
tagged with: prototypal-inheritance
has comment: http://stackoverflow.com/comment/38534797
has body: This tutorial on prototypical inheritance uses the following code as an example of a Constructable object: var Person = function (name) { this.name = name; }; var tom = new Person('tom'); But then goes on to say that if they want to change the Person object that tom was constructed with, then it should be done by altering Person.prototype: Person.prototype.say = function (words) { alert(this.name + ' says "' + words + '"'); }; But why does the prototype (which is Person) have to be altered? Why not just change Person directly like so: Person.say = function (words) { alert(this.name + ' says "' + words + '"'); }; Is there a difference?
type: Question

http://stackoverflow.com/a/29797653
score: 4
answers question: http://stackoverflow.com/q/24828459
upvote count: 4
has body: pdfMake does not support vector graphics. In this case you need to take the bypass through canvas with fabricJS or canvg, once you've imagery you can place it in pdfMake // Create fabric instance var canvas = new fabric.StaticCanvas( undefined, { width: 500, height: 500, } ); // Load SVG document; add to canvas; fabric.parseSVGDocument(&lt;svg element&gt;,function(objects, options) { var g = fabric.util.groupSVGElements( objects, options ); var data = ""; // ADD ELEMENTS canvas.add( g ); // EXPORT TO DATA URL data = canvas.toDataURL({ format: "jpeg" }); console.log(data); // REVIVER },function(svg,group) { // possiblitiy to filter the svg elements or adapt the fabric object });
downvote count: 0
has comment: http://stackoverflow.com/comment/70933035
type: Answer

http://stackoverflow.com/q/24883352
downvote count: 0
type: Question
has title: jQuery Selector Intersection get meta with property="article:tag" and content="tag"
tagged with: javascript
tagged with: jquery
upvote count: 2
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/24883395
type: UnansweredQuestion
has body: I'd like to check whether an article has a specific tag set in the meta data. Thus I'm looking for the intersection of to jQuery selectors meaning the element what fullfilles both [property="article:tag"] and [content="mytag"]: I tried so far: if( $('[property="article:tag"]').has('[content="mytag"]') ) ... if( $('[property="article:tag"].[content="mytag"]') ) ... Neither is working. However if( $('meta.[property="article:tag"]') ) ... is working. Is there any intelligent jQuery command which can select this out of the box? Thx, I really appreciate your expertise!
score: 2

http://stackoverflow.com/q/24905588
has comment: http://stackoverflow.com/comment/38720098
has answer: http://stackoverflow.com/a/25102055
favorite count: 0
accepted answer: http://stackoverflow.com/a/25102055
has comment: http://stackoverflow.com/comment/38874796
tagged with: extendscript
tagged with: adobe
has body: Using this example code: app.project.item(index).layers.addLight(name, centerPoint) I created the following test code where I add a light to my second scene (composition) in my project to create a shadow: var s2light1 = scene2.layers.addLight("s2light1", [1143,121]); This works perfectly. But I now also want to set the 3rd (Z) value for the centerPoint in Extendscript (as is possible in After Effects). However according to the After Effects CS6 scripting guide it seems you can only set the X and Y values: "The center of the new camera, a floating-point array [x, y]. This is used to set the initial x and y values of the new camera’s Point of Interest property. The z value is set to 0." Is there another approach or work around to set the Z-value for the center point in Extendscript which I can try?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38854910
tagged with: after-effects
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38975766
tagged with: javascript
has title: After Effects Extendscript - changing the centerpoint for addlight
has comment: http://stackoverflow.com/comment/38854549
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/38403315
type: AnswerComment
has text: No need to loop on the datepicker class
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24752068

http://stackoverflow.com/q/24778305
type: Question
has answer: http://stackoverflow.com/a/24780450
has body: I have my Website build with JqueryUI widgets. Now I need to make Website responsive and I was recommended by a friend to use bootstrap for this ,but i read somewhere that using both JqueryUI and Bootstrap together cause some problems or conflicts,so my question is:- Is any conflict occur ,if yes,then what kind of conflicts can occur. Is there any way to avoid conflicts. Any other way I can make my website responsive.
has title: Responsiveness with Jquery Ui and Bootstrap
tagged with: jquery-ui
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24780450
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38452017
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/38451471
has comment: http://stackoverflow.com/comment/38455207
linked to: http://stackoverflow.com/q/23428285
type: AnsweredQuestion
tagged with: responsive-design

http://stackoverflow.com/comment/38499018
type: Comment
type: QuestionComment
has text: one probable cause is, that your inline event handler (that one defined using the attribute `onclick=""`) is overridden through the loading code of CodeMirror. Here you have a perfect example why must not use inline JS at all. Set up your own click handler using `addEventListener()` which can add multiple event handler. See the JSFiddle link in my answer below for a working example without inline JS.
score: 0
comment on: http://stackoverflow.com/q/24803304

http://stackoverflow.com/q/24865411
has answer: http://stackoverflow.com/a/24865543
upvote count: 3
has body: I have the following string: string&gt;string25&gt;string89 &gt; anotherString And I have following regExp: ^[\w\_\-\.\d]+(?:\s*)?(?:\&gt;)+(?:\s*)[\w\_\-\.\d]* And then I want my regExp to be recursive and starts from the first character to the last character. My language is Javascript, but I want to see if my regExp has this capability? or should I use while() condition? I need a solution of regExp itself and if it is not possible, then please give the solution of Javascript while() itself. EDIT: I want to capture this: string&gt;string25 string25&gt;string89 string89 &gt; anotherString
has comment: http://stackoverflow.com/comment/38616888
type: Question
has title: RegExp to be recursive
has comment: http://stackoverflow.com/comment/38616449
tagged with: javascript
linked to: http://stackoverflow.com/q/20939737
has comment: http://stackoverflow.com/comment/38616515
accepted answer: http://stackoverflow.com/a/24865543
has comment: http://stackoverflow.com/comment/38616428
score: 3
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/38616483
favorite count: 0
tagged with: regex
has comment: http://stackoverflow.com/comment/38617036
type: AnsweredQuestion
tagged with: recursion

http://stackoverflow.com/q/24892437
type: Question
downvote count: 0
has title: Clear Form after submit to iframe
tagged with: javascript
has answer: http://stackoverflow.com/a/24892642
favorite count: 0
answer count: 3
has comment: http://stackoverflow.com/comment/38667908
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24892501
linked to: http://stackoverflow.com/q/12483016
possible better answer: http://stackoverflow.com/a/24892563
has answer: http://stackoverflow.com/a/24892563
upvote count: 2
tagged with: iframe
accepted answer: http://stackoverflow.com/a/24892642
has comment: http://stackoverflow.com/comment/38668825
has comment: http://stackoverflow.com/comment/38674032
score: 2
type: AnsweredQuestion
has body: I have form which need to be submited to another domain, like this: And iframe: This work fine, but after submit form it stays filled. So, how to clear (reset) form after submit?
has comment: http://stackoverflow.com/comment/38668185
tagged with: forms
has comment: http://stackoverflow.com/comment/38668453

http://stackoverflow.com/q/24894079
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24894574
type: Question
answer count: 1
has body: I'm basically wanting numerous graphs to load in their components sequentially, but each graph to do this at the same time. Currently it loads in the base ($graphName) at the same time, but the rest of the items are all relative to the next elements loaded in. I'm guessing i need to namespace this but how would i integrate that into this function? $graphName.fadeIn(500, function(){ $graphaxes.each(function(index) { $(this).delay(500*index).fadeIn(800, function(){ $(".circle").each(function(index) { $(this).delay(500*index).fadeIn(800); }); }); }); }); HTML Effectiveness Cost INCENTIVATED RTB AD NETWORK SMS WIFI SOCIAL DIRECT/ PREMIUM VIDEO/ RICH
tagged with: javascript
tagged with: jquery
score: 0
has title: Run separate sets of child sequential fadeIns at the same time

http://stackoverflow.com/q/24803832
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38507198
has comment: http://stackoverflow.com/comment/38502838
has comment: http://stackoverflow.com/comment/38505909
type: Question
has answer: http://stackoverflow.com/a/24808622
accepted answer: http://stackoverflow.com/a/24808622
tagged with: recursion
has comment: http://stackoverflow.com/comment/38503529
has comment: http://stackoverflow.com/comment/38503063
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24808670
score: 0
tagged with: mongodb
has answer: http://stackoverflow.com/a/24808670
has title: Recursive function for parse array of objects in NodeJS
answer count: 2
has body: i have a NodeJS controller like this: var importOrders = function (req, res, next) { var orders = req.body; var processOrder = function (order) { if(i&lt;orders.length-1){ try { if (orders[i].Order.Company === "Mondial") { parseMondial(db, orders[i].Order, processOrder(orders[i++]), log); } } catch (error) { next(error); log.error('orders', 'error Importing', error, order); } } }; var i = 0; processOrder(orders[i]); res.send(orders.length); }; Inside parseMondial i do lot of queries in mongoDB with promises but this queries its relationship between them. This doesnt work because i need to finish process inside parseMondial for do the next object parse, but doesnt wait. I dont have idea how can i do it this..Any help its wellcome.
has comment: http://stackoverflow.com/comment/38502879
tagged with: node.js

http://stackoverflow.com/q/24841071
has title: Javascript rollover with PHP/Twig?
tagged with: javascript
downvote count: 0
has body: This is a continuation of my radio station fansite project question from before. Our small team (3 people) have decided that JSON is not useful for now, but we are still aiming for a table with the rollover effect as seen at http://www.vikingfm.co.uk/on-air/station-schedule/ We've got the essential things done; content researched, pictures, information etc. and our localhost (MAMP) with PHP 5.53 and PDO, so that's one half of the work done; now the second half is finishing the site, which we've mostly done, apart from one page, as I will mention below. This is my current code, which works well enough but isn't very interactive, it just displays the table in plain format as a list of shows which is OK but lacks any interactivity (apart from hyperlinks): Schedule {% for d in data %} {% endfor %} and the PHP code behind it: <?php // include and register Twig auto-loader include 'Twig/Autoloader.php'; Twig_Autoloader::register(); // attempt a connection try { $dbh = new PDO('mysql:dbname=radio;host=localhost', 'test', 'PASSWORD'); } catch (PDOException $e) { echo "Error: Could not connect. " . $e->getMessage(); } // set error mode $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // attempt some queries try { // execute SELECT query // store each row as an object $sql = "SELECT * FROM stationschedule ORDER BY airdate AND expiration LIMIT 0,20"; $sth = $dbh->query($sql); while ($row = $sth->fetchObject()) { $data[] = $row; } // close connection, clean up unset($dbh); // define template directory location $loader = new Twig_Loader_Filesystem('templates'); // initialize Twig environment $twig = new Twig_Environment($loader); // load template $template = $twig->loadTemplate('radio.htm'); // set template variables // render template echo $template->render(array ( 'data' => $data )); } catch (Exception $e) { die ('ERROR: ' . $e->getMessage()); } ?> Now, however, we're looking …
favorite count: 0
type: UnansweredQuestion
tagged with: php
tagged with: pdo
answer count: 0
score: 1
tagged with: mysql
upvote count: 1
type: Question

http://stackoverflow.com/q/24765957
has body: My idea is download chunks a huge file from server. Chunks stored into an IndexedDB. After download all chunks, merge all records into one (as SQL SELECT * FROM XXX ...). Save into disk "saveAs()" or create URL to IndexedDB... (Or any idea?) I do not know how to do step 2. and 3. (Below is an example of storing 10,000 records in the DB and the expected output after step 2. should be SusanSusanSusanSusanSusan...) if (transaction) { transaction.oncomplete = function () { } transaction.onabort = function () { writeToConsoleScreen("transaction aborted."); localDatabase.db.close(); } transaction.ontimeout = function () { writeToConsoleScreen("transaction timeout."); localDatabase.db.close(); } var store = transaction.objectStore(osTableName); if (store) { var req; var customer = {}; // create ten thousand records for (var loop = 0; loop &lt; 10000; loop++) { customer = {}; customer.fname = 'Susan'; req = store.add(customer); req.onsuccess = function (ev) { } req.onerror = function (ev) { writeToConsoleScreen("Failed to add record." + " Error: " + ev.message); } } } }
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: HTML5 IndexedDB - How to merge all records into one
has answer: http://stackoverflow.com/a/33356380
tagged with: chunks
downvote count: 1
type: Question
score: 3
tagged with: indexeddb
tagged with: javascript
tagged with: savefiledialog
upvote count: 4
has comment: http://stackoverflow.com/comment/44310172
answer count: 1

http://stackoverflow.com/a/24852610
downvote count: 0
has comment: http://stackoverflow.com/comment/38626691
has comment: http://stackoverflow.com/comment/38599095
type: AcceptedAnswer
has body: To change the text in a Google Doc, you need to get the individual elements and operate on them. There's a fair bit of work to do, digging into the document, before the Money Shot: paragraphText.toUpperCase(); The following script is part of a document add-on, source available in this gist, in changeCase.js. Code.gs /** * Scan Google doc, applying fountain syntax rules. * Caveat: this is a partial implementation. * * Supported: * Character names ahead of speech. * * Not supported: * Everything else. See http://fountain.io/syntax */ function fountainLite() { // Private helper function; find text length of paragraph function paragraphLen( par ) { return par.asText().getText().length; } var doc = DocumentApp.getActiveDocument(); var paragraphs = doc.getBody().getParagraphs(); var numParagraphs = paragraphs.length; // Scan document for (var i=0; i&lt;numParagraphs; i++) { /* ** Character names are in UPPERCASE. ** Dialogue comes right after Character. */ if (paragraphLen(paragraphs[i]) &gt; 0) { // This paragraph has text. If the preceeding one was blank and the following // one has text, then this paragraph might be a character name. if ((i==0 || paragraphLen(paragraphs[i-1]) == 0) &amp;&amp; (i &lt; numParagraphs &amp;&amp; paragraphLen(paragraphs[i+1]) &gt; 0)) { var paragraphText = paragraphs[i].asText().getText(); // If no power-user overrides, convert Character to UPPERCASE if (paragraphText.charAt(0) != '!' &amp;&amp; paragraphText.charAt(0) != '@') { var convertedText = paragraphText.toUpperCase(); var regexEscaped = paragraphText.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&amp;'); // http://stackoverflow.com/a/3561711/1677912 paragraphs[i].replaceText(regexEscaped, convertedText); } } } } }
has comment: http://stackoverflow.com/comment/38962071
accepted answer of: http://stackoverflow.com/q/24847408
has comment: http://stackoverflow.com/comment/38910390
type: Answer
score: 6
has comment: http://stackoverflow.com/comment/38885079
upvote count: 6
has comment: http://stackoverflow.com/comment/38594249
has comment: http://stackoverflow.com/comment/38961732
has comment: http://stackoverflow.com/comment/38880311
answers question: http://stackoverflow.com/q/24847408

http://stackoverflow.com/q/24755991
has answer: http://stackoverflow.com/a/24756025
type: Question
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/24756221
tagged with: jquery
score: 0
has body: I'm using angular js and javascript in my application.And here , when I click tag it call a method in angular controller ,which has $window.open();.Every time I click it content open in 2 tabs.What is the reason for that? Please help me out. HTML Test Click Angular controller controllers.controller('LogoutCtrl', ['$scope', '$location','$cookieStore','$rootScope','$window', function($scope, $location,$cookieStore,$rootScope ,$window) { $scope.test_home = function () { $window.open('www.yahoo.com'); }; } ]);
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38409580
type: UnansweredQuestion
has title: window.open + Opening content in 2 tabs

http://stackoverflow.com/comment/38458405
type: Comment
comment on: http://stackoverflow.com/q/24776340
has text: Ehh... I did `that = function(){this};` and then `testfun(that)`, it printed `[{}]` :< Temporarly I created variable `var globalVar = {}` to which I assigned `globalVar = this` in constructor. I can use my object like `JavaScript.getCurrent().execute("globalVar.someMethod()")` in my server code. It's not very pretty but it works for now...
score: 0
type: QuestionComment

http://stackoverflow.com/q/24812643
has body: I have a page that loads an iframe (fancybox). I would like to be able to insert an additional CSS file based on a jquery condition. Something like below: if ($(window).width() &gt; 1220) { var lightbox_stylesheet = '&lt;link rel="stylesheet" href="example.css" type="text/css" /&gt;'; $('head').append(lightbox_stylesheet); }; I have tried doing this on document.ready but that did not work. Does anyone know how to get the iframe to load this CSS file?
tagged with: fancybox
tagged with: css
answer count: 0
has comment: http://stackoverflow.com/comment/38574490
tagged with: iframe
type: Question
has comment: http://stackoverflow.com/comment/38518718
linked to: http://stackoverflow.com/q/16241296
tagged with: javascript
score: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/38519570
has title: Add CSS sheet to iframe on load with screen size condition
type: UnansweredQuestion

http://stackoverflow.com/a/24815102
answers question: http://stackoverflow.com/q/24815011
score: 0
type: Answer
has body: In the case of Javascript this should do no harm at all since javascript functions return undefined either way. (you writing return; or not) For PHP I'm not really sure, but I can't imagine any problems right now. But I would think of this as bad practice since indentation helps to see what's going on. If you have many of those checks in one function, maybe you should think about creating more, smaller functions instead of one big function, because this too, helps reading your code.

http://stackoverflow.com/comment/38514966
type: Comment
comment on: http://stackoverflow.com/a/24811727
type: AnswerComment
has text: The issue here is that, no matter where I click, the parent also get clicked, because the sub is contained within the parent. Think about the scenerio of clicking on a link on a page. When you click on the link, you're also clicking on the body.
score: 0

http://stackoverflow.com/comment/38690570
comment on: http://stackoverflow.com/q/24904529
score: 1
has text: Please check, is that query the right collection?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38417764
score: 1
has text: Have you set `<access origin="*"/>` in config.xml?
comment on: http://stackoverflow.com/q/24758847
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38473094
comment on: http://stackoverflow.com/q/24789003
has text: The form is initially populated from a database so I am just stuck on trying to make it update if changes are made.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/38489994
has text: Thanks for that it'll be helpful
type: Comment
comment on: http://stackoverflow.com/a/24797278
type: AnswerComment
score: 0

http://stackoverflow.com/q/24804722
tagged with: mediaelement.js
answer count: 1
has answer: http://stackoverflow.com/a/24808738
has comment: http://stackoverflow.com/comment/38504132
has body: Hi guys I need some help: Im planning on including multiple media players on my site, each with different mp3 tracks that can be played. I've managed to create a custom audio player using Javascript Media elements and the "audio" tag. However, when I try to create a new audio tag, the new player assumes the format of the default browser audio player rather than following the custom player decorators. Here is a link to a screenshot of the problem I'm having: http://www.noodill.com/image/92046214053 What i would like to know is, how do I create multiple instances of a custom audio player, each with their own independent mp3 sources and that can be played at the same time? Here is my HTML markup: Media Player AND HERE IS MY CSS: #PlayerContainer { height: 60px; width: 400px; border:3px dotted red; float: left; margin: 50px; position: relative; border-radius: 10px; } .mejs-controls .mejs-button button { cursor: pointer; display: inline-block; position: absolute; text-indent: -9999px; bottom: 0px; margin-left: 5px; } .mejs-controls .mejs-play button, .mejs-controls .mejs-pause button { width: 20px; height: 20px; bottom: 5px; left: 10px; background: orange; } .mejs-controls .mejs-pause button { background-position: 0 -35px; } /* mute/unmute control */ .mejs-controls .mejs-mute button, .mejs-controls .mejs-unmute button { width: 20px; height: 20px; bottom: 5px; left: 30px; background: red; margin-left: 10px; padding: 0px; } .mejs-controls .mejs-unmute button { background-position: 0 -19px; } /* volume scrubber bar */ .mejs-controls div.mejs-horizontal-volume-slider { position: absolute; bottom: 5px; left: 80px; cursor: pointer; } .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total { width: 120px; height: 11px; background: #212227; -webkit-box-shadow: inset 0px 1px 0px rgba(0,0,0,0.3), 0px 1px 0px rgba(255,255,255,0.25); -moz-box-shadow: inset 0px 1px 0px rgba(0,0,0,0.3), 0px 1px 0px rgba(255,255,255,0.25); box-shadow: inset 0px 1px 0px rgba(0,0,0,0.…
has comment: http://stackoverflow.com/comment/38501602
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38504053
tagged with: audio
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24808738
tagged with: http://stackoverflow.com/tag/mp3
type: Question
has comment: http://stackoverflow.com/comment/38506971
has title: How do i create more than one instance of a custom HTML5 audio player using JavaScript Media Elements?
tagged with: javascript
has comment: http://stackoverflow.com/comment/38504538
score: 0

http://stackoverflow.com/q/24858059
type: Question
has comment: http://stackoverflow.com/comment/38602831
has answer: http://stackoverflow.com/a/24870596
has title: I have a menu and I don't how to use proprely slideToggle, to slideDown and slideUp when i pressed another li from ul?
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38603304
score: 0
has comment: http://stackoverflow.com/comment/38602820
has comment: http://stackoverflow.com/comment/38604253
type: UnansweredQuestion
has body: I have a function for main menu : $('.main-menu-left > li > div').each(function(){ if( $(this).next('.sub-menu').length ){ $(this).on('click', function(e){ e.preventDefault(); $(this).parent('li').find('.sub-menu').slideDown('slow'); }); } }); And a function for slide up menu: $('body').on('click', function(){ if( $('.sub-menu').is(':visible') ){ $('.sub-menu').slideUp(); } }); Browse Blinds Explore+Wooden Blinds(18 collections) Next day no Samples of Verticals Blinds Blackout 96 Samples of Verticals Blinds Pattern 120 Samples of Verticals Blinds Wipeable 30 Samples of Verticals Blinds &explore all Vertical Blinds Explore+Venetians Blinds(20 collections) Roman This is html code, for my menu. It's opening and closing simultaneously. And how can i do to close an li and open other on click ?
has comment: http://stackoverflow.com/comment/38602864

http://stackoverflow.com/comment/38419609
type: QuestionComment
comment on: http://stackoverflow.com/q/24760490
has text: @KoBE The goal here is to *reduce* the scope in which the variable is a valid identifier to as small a scope as possible. That's increasing the scope to a *much* greater scope than it is needed in.
score: 1
type: Comment

http://stackoverflow.com/comment/38406414
type: QuestionComment
score: 2
has text: Maybe you're looking for `data.push()`?
comment on: http://stackoverflow.com/q/24754306
type: Comment

http://stackoverflow.com/q/24749655
tagged with: http://stackoverflow.com/tag/json
score: 0
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/24750317
has title: AngularJS - API call returning [object object]
answer count: 3
has comment: http://stackoverflow.com/comment/38398262
has body: I'm trying to call a list of articles from the NPR API. I have a working URL which returns as JSON. However, somewhere in my controller, I'm getting lost getting the object. When I console.log it to test, it returns as [object Object] and nothing else. My service looks like this: app.factory('nprService', function($resource) { //call npr api return $resource('http://api.npr.org/queryid=61&amp;fields=title,byline,text,image,all&amp;output=JSON... and my controller: app.controller('ArticleListCtrl', function($scope, nprService) { //call the service and store as a variable $scope.article = nprService.get(); }); I've tried using query to get the result, like this, but it's returning a single JSON object so that obviously didn't work. //call the service and store as a variable nprService.query(function(data) { $scope.article = data; }); Any help would be greatly appreciated. Thanks in advance.
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38398038
has answer: http://stackoverflow.com/a/50751117
has answer: http://stackoverflow.com/a/24750042

http://stackoverflow.com/a/24968083
score: 7
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24804109
answers question: http://stackoverflow.com/q/24804109
has comment: http://stackoverflow.com/comment/38814884
downvote count: 0
has comment: http://stackoverflow.com/comment/38812831
has body: use position: sticky; on the hero element https://developer.mozilla.org/en-US/docs/Web/CSS/position#Sticky_positioning can i use while this alone will do the trick in safari, you will still need scroll handling for browsers that don't support sticky positioning.
type: Answer
upvote count: 7

http://stackoverflow.com/q/24804392
answer count: 1
has comment: http://stackoverflow.com/comment/38508750
has title: why am i getting different response to similar ajax request?
has comment: http://stackoverflow.com/comment/38500850
tagged with: php
has comment: http://stackoverflow.com/comment/38502401
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24820331
type: Question
has body: issue resolved, see edit : both the php scripts are returning json_encode()'d 2D arrays, but one response(trains) is received as a multidimensional array and the other(data) as an object, why is this happening? secondly the line console.log(data) was executed after console.log(allData), shouldn't it be the other way round ??, i need to populate allData with responses contained in data. Here is the code : $(document).ready(function() { $("form").submit(function(){ event.preventDefault(); $.ajax({ //type: "POST", url: "./trains_bw_stations.php", dataType: 'json', data: { source: $('input[name*="src"]').val(), destination: $('input[name*="dstn"]').val(), day: $('input[name*="day"]').val(), month: $('input[name*="month"]').val(), cl: $('input[name*="cl"]').val() } }) .done(function(trains) { console.log(trains) var requests = [], allData = {}; for (var i = 0; i &lt; trains.length; i++) { console.log(trains[i][0]); requests.push($.ajax({ url: './availability.php', dataType: 'json', data: { day: $('input[name*="day"]').val(), month: $('input[name*="month"]').val(),lccp_trndtl: trains[i][0] } // success: function(data) { // console.log(data); // allData[''+i] = data; }).done(function(data) { console.log(data); allData[i] = data}) ); } $.when.apply(requests).then(function() { console.log(allData) for (var i in allData) { if (allData.hasOwnProperty(i)) { console.log(i+ " -&gt; " + allData[i]) } } // all requests have completed // allData array now contains the data from all the requests // put your processing logic in here... }); }); }); }); copy pasted console output, it shows line 41 executing before 34 : [Array[15], Array[15], Array[15]] ajaxRequests.js:19 12650NZM KCG NYYNYNYYA ajaxRequests.js:23 12724NDLSHYB NYYYYYYYA ajaxRequests.js:23 12722NZM HYB YYYYYYYYA ajaxRequests.js:23 Object {} ajaxRequests.js:41 Object {0: Array[4], 2: Array[4], 4: Array[4], 6: Array[4], 8: Array[4], 10: Array[4]} ajaxRequests.js:34 Object {0: Array[4], 2: Array[4], 4: Array[4], 6: Array[4], …
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/38530681
has comment: http://stackoverflow.com/comment/38502139
accepted answer: http://stackoverflow.com/a/24820331

http://stackoverflow.com/comment/38481416
type: Comment
type: AnswerComment
has text: Yes, in html5 is valid to add attributes to dom nodes. new_button_element["data-color"] = loop_channel_name; see the example: http://jsfiddle.net/48q9b/1/
score: 0
comment on: http://stackoverflow.com/a/24790475

http://stackoverflow.com/comment/38564912
type: QuestionComment
has text: See my answer. And next time, you can put the output of your php ;)
score: 0
comment on: http://stackoverflow.com/q/24838308
type: Comment

http://stackoverflow.com/comment/38548123
type: QuestionComment
score: 1
has text: @MarcB Absolutely, not expecting anyone to write out the code for me. Just looking to narrow my search. TY
comment on: http://stackoverflow.com/q/24829037
type: Comment

mongodb
tags question: http://stackoverflow.com/q/24867293
tags question: http://stackoverflow.com/q/24906472
tags question: http://stackoverflow.com/q/24779305
tags question: http://stackoverflow.com/q/24906890
tags question: http://stackoverflow.com/q/24793376
tags question: http://stackoverflow.com/q/24881404
tags question: http://stackoverflow.com/q/24875083
tags question: http://stackoverflow.com/q/24829853
tags question: http://stackoverflow.com/q/24904529
tags question: http://stackoverflow.com/q/24868609
tags question: http://stackoverflow.com/q/24858730
tag name: mongodb
tags question: http://stackoverflow.com/q/24805913
tags question: http://stackoverflow.com/q/24835395
tags question: http://stackoverflow.com/q/24848746
tags question: http://stackoverflow.com/q/24853340
tags question: http://stackoverflow.com/q/24846614
tags question: http://stackoverflow.com/q/24855270
tags question: http://stackoverflow.com/q/24798464
tags question: http://stackoverflow.com/q/24794354
type: Tag
tags question: http://stackoverflow.com/q/24847656
tags question: http://stackoverflow.com/q/24846025
tags question: http://stackoverflow.com/q/24803832
tags question: http://stackoverflow.com/q/24901570
tags question: http://stackoverflow.com/q/24808903
tags question: http://stackoverflow.com/q/24806721
tags question: http://stackoverflow.com/q/24792758
tags question: http://stackoverflow.com/q/24846226
tags question: http://stackoverflow.com/q/24877193
tags question: http://stackoverflow.com/q/24771780
tags question: http://stackoverflow.com/q/24811376
tags question: http://stackoverflow.com/q/24889167
tags question: http://stackoverflow.com/q/24773718
tags question: http://stackoverflow.com/q/24810712
tags question: http://stackoverflow.com/q/24815008
tags question: http://stackoverflow.com/q/24820306
tags question: http://stackoverflow.com/q/24856912
tags question: http://stackoverflow.com/q/24847384
tags question: http://stackoverflow.com/q/24769919
tags question: http://stackoverflow.com/q/24823782
tags question: http://stackoverflow.com/q/24798143
tags question: http://stackoverflow.com/q/24903056
tags question: http://stackoverflow.com/q/24796865
tags question: http://stackoverflow.com/q/24876021

http://stackoverflow.com/a/24781345
has comment: http://stackoverflow.com/comment/38458184
upvote count: 2
accepted answer of: http://stackoverflow.com/q/24768624
has body: If you check out these examples you'll see that you need to separately source jquery, and that jconfirm is only defined within its namespace. Thus you need to add two things in your code: &lt;script src="/js/jquery.js"&gt;&lt;/script&gt; &lt;!-- or wherever jquery.js's path is --&gt; ... $.jconfirm('Are you sure ... // note jquery's $. namespace; and the non-capitalized "c" in jconfirm Additionally, the $.jconfirm function call is not expecting strings. It signature is: function(options, callback) And the callback is not executed with any parameters (thus your x will be undefined). It looks like what you wanted was somewhere along the lines of: function careersDelete(career_id) { jQuery.jconfirm({ message: 'Are you sure you want to delete this career?', title: 'Delete Career' }, function () { jQuery.ajax({ url: "ajax_career_delete.php", type: "GET", data: "career_id=" + career_id, success: function (response) { alert('Career deleted'); } }) }); }
has comment: http://stackoverflow.com/comment/38457799
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24768624
downvote count: 0
has comment: http://stackoverflow.com/comment/38458167
type: Answer
score: 2

http://stackoverflow.com/q/24810996
upvote count: 1
type: Question
tagged with: modalpopupextender
tagged with: javascript
tagged with: ajaxcontroltoolkit
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: youtube
has body: In my code I tried pausing the youtube video by using Javascript. I took this question (below) as a reference, and it works great. How to pause a YouTube player when hiding the iframe? The problem is that it is refreshing my website. I'm not exactly sure as to why that is or if there is any sort of workaround... This is my code... I'm using an AjaxModalPopupExtender to hide/show my div. function ShowModalVideo() { var Popup = $find("&lt;%=mpeVideo.ClientID%&gt;"); if (Popup) { Popup.show(); } return false; } function HideModalVideo() { var Popup = $find("&lt;%=mpeVideo.ClientID%&gt;"); if (Popup) { Popup.hide(); var iframe = document.getElementById("youtube"); iframe.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*'); } return false; } I'd really appreciate any help or insight on the matter.
has title: Pause Youtube Video Javascript Refreshes Page
answer count: 0
score: 1

http://stackoverflow.com/q/24760932
linked to: http://stackoverflow.com/q/1533568
has body: I am quite new to both HTML5 and Javascript. I want to set an editable string in Javascript which will hold HTML5 code so it can be edited from Javascipt interface. Then I want to take this string to another HTML5 page and show it as a preview. So that the string edited in Javascript interface will be seen as a result right next to it in a small HTML5 preview screen. How to refer to the string in JS script from HTML5 and use it as if it is a part of HTML5 code? Hope I could explain myself. Thanks in advance.
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/24761097
upvote count: 1
type: Question
tagged with: javascript
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
tagged with: string
has answer: http://stackoverflow.com/a/24761097
favorite count: 0
has title: How to take JS string and show it in HTML5 as preview?

http://stackoverflow.com/comment/38660510
score: 0
type: AnswerComment
has text: Thanks, this helps me a lot.. the other guys are right too, but this is only a little snippet of the whole doc.
comment on: http://stackoverflow.com/a/24888246
type: Comment

http://stackoverflow.com/comment/38468513
type: Comment
has text: That's what `writeable: false` implies: http://jsfiddle.net/SpPyc/
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24786824

http://stackoverflow.com/a/24887639
type: Answer
has body: You can achieve this via JQuery in this DEMO. Don't forget to check the external files I added in the Fiddle, they are mandatory for this kind of operation. This example should show you several kinds of dragging styles, included the one you need that creates a copy of the dragged item. $(function () { $("#draggable").draggable({ helper: "original" }); $("#draggable2").draggable({ opacity: 0.7, helper: "clone" }); $("#draggable3").draggable({ cursor: "move", cursorAt: { top: -12, left: -20 }, helper: function (event) { return $(" I'm a custom helper "); } }); $("#set div").draggable({ stack: "#set div" }); }); EDIT : Yes I changed my answer as it didn't fit your needs, should be ok now.
has comment: http://stackoverflow.com/comment/38658447
has comment: http://stackoverflow.com/comment/40135418
answers question: http://stackoverflow.com/q/24887480
score: 0

http://stackoverflow.com/a/24839444
type: Answer
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/24839418
answers question: http://stackoverflow.com/q/24839418
type: AcceptedAnswer
downvote count: 0
has body: You don't have to parse the obj. It's already an object. remove this line obj = JSON.parse(obj);

http://stackoverflow.com/q/24770526
has comment: http://stackoverflow.com/comment/38437513
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38437541
accepted answer: http://stackoverflow.com/a/24770702
has comment: http://stackoverflow.com/comment/38437375
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38439444
score: 0
has body: For simplification and control, I have my own js templating engine, which works like this: html: &lt;ul id="persons"&gt; &lt;li class="person-template hide"&gt; &lt;span&gt;{name}&lt;/span&gt;, &lt;span class="placemark" data-lat="{latitude}" data-lng="{longitude}"&gt;{location}&lt;/span&gt; &lt;li&gt; &lt;/ul&gt; js: var persons = [ {"name":"hulk", "location": "usa", latitude: -33.4, longitude: -70.5}, {"name":"wolverine", "location": "mexico", latitude: -33.4, longitude: -70.5}, ]; $.each(persons, function(i, person) { var html = $(".person-template").clone().removeClass("person-template").addClass("person").show().outerHtml(); html = html.replaceAll("{name}", person.name); html = html.replaceAll("{latitude}", person.latitude); html = html.replaceAll("{longitude}", person.longitude); html = html.replaceAll("{location}", person.location); }); (replaceAll and outerHtml are two helper functions I've made, they are self-explained by their names) My problem with this is that sometimes I want to select things with jQuery but my template notation interferes, for example: $(".placemark").each(function(i, v) { alert($(v).data("latitude"))); }); Will alert: "{latitude}", "-33.4", "-33.4" Obviously I want to avoid the template value. What is the most clean solution for this? Start using a formal template engine? Skip first in the $.each? (kind of ugly) ...?
answer count: 1
tagged with: template-engine
tagged with: jquery
has comment: http://stackoverflow.com/comment/38437498
has title: Selecting with jquery in my own js templating system/engine
has answer: http://stackoverflow.com/a/24770702

http://stackoverflow.com/a/38479759
upvote count: 15
downvote count: 0
has body: Use https://github.com/jmurphyau/ember-truth-helpers: ember install ember-truth-helpers Then you can say {{#if (or foo bar)}} Depending on your perspective, Kingpin2k's answer is a bit out of date. Previously, the community's understanding was that templates should be largely free of logic. Overtime, our viewpoint has shifted towards putting more declarative logic in templates-- ember-composable-helpers is a great example of this.
type: Answer
answers question: http://stackoverflow.com/q/24810448
score: 15

http://stackoverflow.com/a/63854328
downvote count: 0
has body: The certificate object returned by getPeerCertificate has a raw field holding the DER encoding of the certificate. You can work with this DER encoding directly: const cert_der = req.connection.getPeerCertificate().raw; console.log(cert_der); In general, having the DER encoding should be sufficient. However, if you need the PEM encoding, you can construct it by applying the base64 encoding to the DER encoding: const os = require('os'); function der_to_pem(der) { const header = '-----BEGIN CERTIFICATE-----'; const footer = '-----END CERTIFICATE-----'; return [header, der.toString('base64'), footer].join(os.EOL); } You could then use this helper function to obtain the PEM encoding of the client certificate: const cert_der = req.connection.getPeerCertificate().raw; console.log(der_to_pem(cert_der));
answers question: http://stackoverflow.com/q/24791300
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/comment/38460141
type: AnswerComment
comment on: http://stackoverflow.com/a/24781800
score: 0
type: Comment
has text: Exactly, jqXHR is passed to failure function. But as he is saying he is getting proper response from server. that means jquery ajax is not able to validate it as proper json. if he removes the datatype restriction, for every response with status 200 it will go to success function.

http://stackoverflow.com/q/24766028
has comment: http://stackoverflow.com/comment/38428864
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/38433424
score: 1
has comment: http://stackoverflow.com/comment/38431411
linked to: http://stackoverflow.com/q/24740462
type: Question
has comment: http://stackoverflow.com/comment/38428826
tagged with: javascript
has comment: http://stackoverflow.com/comment/38428550
possible better answer: http://stackoverflow.com/a/24766080
has answer: http://stackoverflow.com/a/24766885
accepted answer: http://stackoverflow.com/a/24766885
answer count: 3
has body: How to add and remove class with the condition of CSS display. For example, I have some Div that can be hidden and shown. I want that, if the div is hidden with the display:none;, then the class of the div is removed. But if the div is shown with the display:block;, I want to add a class to the div. Here is what I have been trying: $(document).ready(function(){ if($('.bigPicture').css('display') == 'block') {$('.bigPicture').find('div').addClass('easyzoom easyzoom--overlay');}; if($('.bigPicture').css('display') == 'none') {$('.bigPicture').find('div').removeClass('easyzoom easyzoom--overlay');} }); EXPLANATION I have multiple slideshows in one pages. Not all of the slideshow is going to be shown in the page, one of them will only show if the link to that slideshow is clicked. It sames like auto hide and show function. If one slideshow is shown, then other slideshows are hidden. Each slideshow has their own thumbnails to control them. The problem is all of the slideshow has no ID and has the same class, while all the slideshow is run with the same script. If the thumbnail in the second slideshow I click, the slideshow doesn't move. And I realize it slides only the first slideshow. SO, the solution is I have to remove the class of the slideshow.
upvote count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/38429276
has comment: http://stackoverflow.com/comment/38428741
has answer: http://stackoverflow.com/a/24767056
favorite count: 0
has comment: http://stackoverflow.com/comment/38428567
has title: Remove class if display = none
has comment: http://stackoverflow.com/comment/38428678
has comment: http://stackoverflow.com/comment/38429263
tagged with: css
has answer: http://stackoverflow.com/a/24766080

http://stackoverflow.com/a/24809122
upvote count: 1
has comment: http://stackoverflow.com/comment/38536158
has body: Variable names can't start with numbers (Correct me if i'm wrong). Which is throwing error Uncaught SyntaxError: Unexpected token ILLEGAL. Also, you're checking whether the value exists or not by comparing to empty string (""), which will not also work, You can check it instead like if(!variable){ //variable does not exist } fixing these seems to solve the issue Doc1 Doc2
score: 1
answers question: http://stackoverflow.com/q/24808928
downvote count: 0
has comment: http://stackoverflow.com/comment/38535535
type: Answer

http://stackoverflow.com/a/24781724
answers question: http://stackoverflow.com/q/24781626
type: Answer
has comment: http://stackoverflow.com/comment/38493259
upvote count: 1
downvote count: 0
score: 1
has body: The problem is that FileReader is not compatible with IE8. See here for a comprehensive list of browser support for this functionality.

http://stackoverflow.com/q/24866244
has answer: http://stackoverflow.com/a/24866412
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/38631105
linked to: http://stackoverflow.com/q/24673560
score: 1
has comment: http://stackoverflow.com/comment/38618849
type: Question
has comment: http://stackoverflow.com/comment/38619147
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/24872682
has title: symfony2 how to access twig path by javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/38618475
has answer: http://stackoverflow.com/a/48637234
tagged with: symfony
answer count: 4
has answer: http://stackoverflow.com/a/30783112
type: UnansweredQuestion
has body: In symfony2, this works fine in the html.twig file: Next but currently, i need to access path('new_message') by javascript. I tried: nextButtons.each(function () { $(this).on('click', function () { $("a").prop("href", "{{ path('new_message') }}"); }); }); But it's not working, does someone can help me on how to access symfony path by javascript?

http://stackoverflow.com/a/24804712
upvote count: 2
answers question: http://stackoverflow.com/q/24804506
accepted answer of: http://stackoverflow.com/q/24804506
has comment: http://stackoverflow.com/comment/38501373
has comment: http://stackoverflow.com/comment/38501600
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38501799
type: Answer
has body: You are trying to navigate up and down the DOM in one command. You need to use closest (or parent - see note) to find the ancestor then find to locate the descendant: JSFiddle: http://jsfiddle.net/24Fpg/2/ $(document).ready(function () { function show_rec() { $('.checkbox').click(function () { $(this).closest('div.field').find('div.discip').toggle(); }); } show_rec(); }); Note: If you know it is an immediate parent, you can use parent instead of closest, however closest is more stable across HTML changes. If the content is ever dynamically loaded, switch to a delegated event handler: $(document).ready(function () { function show_rec() { $(document).on('click', '.checkbox', function () { $(this).closest('div.field').find('div.discip').toggle(); }); } show_rec(); }); This works by listening for events bubbling back to a non-changing ancestor, then applying a jQuery selector to the elements in that event chain, then calling the function for each matching element that caused the event. document is the default fallback if there is nothing closer. Never use 'body' with delegated event handlers as body does not work properly with click events (because of styling). Update: You can simplify to this if show_rec is not called by anything else (which it appears to not be): jQuery(function($){ $(document).on('click', '.checkbox', function () { $(this).closest('div.field').find('div.discip').toggle(); }); });

http://stackoverflow.com/a/26115221
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/24787364
downvote count: 0
has body: This problem is caused by a long-standing bug with the Picker API. For more information, see https://groups.google.com/forum/#!topic/google-picker-api/xaHcET7JYLw. The work-around is to enable multi-select, as described in the docs at https://developers.google.com/picker/docs/reference#Feature. picker.enableFeature(google.picker.Feature.MULTISELECT_ENABLED);

http://stackoverflow.com/a/24866463
downvote count: 0
has comment: http://stackoverflow.com/comment/38734354
answers question: http://stackoverflow.com/q/24866206
type: Answer
accepted answer of: http://stackoverflow.com/q/24866206
score: 1
upvote count: 1
has body: Here's a jsFiddle explaining how to achieve that ;) html &lt;div id="your_flipping_img" class="animate"&gt;&lt;/div&gt; CSS #your_flipping_img{ background-color:red; width:150px; height:150px; } .animate{ -webkit-animation: flicking 2s; /* Chrome, Safari, Opera */ -webkit-animation-iteration-count: infinite; animation: flicking 2s infinity; animation-iteration-count: infinite; } @-webkit-keyframes flicking { 0% {opacity:1} 25% {opacity:0} 50% {opacity:1} 75% {opacity:0} 100% {opacity:1} } /* Standard syntax */ @keyframes flicking { 0% {opacity:1} 25% {opacity:0} 50% {opacity:1} 75% {opacity:0} 100% {opacity:1} } JS $('#your_flipping_img').bind('mouseover', function(){ $('#your_flipping_img').removeClass('animate'); }) $('#your_flipping_img').bind('mouseout', function(){ $('#your_flipping_img').addClass('animate'); })
has comment: http://stackoverflow.com/comment/38734143
has comment: http://stackoverflow.com/comment/38627134
type: AcceptedAnswer

http://stackoverflow.com/a/24836068
type: Answer
has body: there's another good solution might be what you need via PHP , is to use class called PHP Simple HTML DOM Parser this class can copy all source of a websites and you can save it in your server with extension you want also you can modified what you need before you save and this class have a full documentation (You need to be good in PHP5 POO ) this a link for class http://simplehtmldom.sourceforge.net/ and there a good advanced thing you can do it for make your website faster , is use a Cash System so you can download the source from website one time a Day or 1H or 12 Hours , and save it in your host . i hope that will give you what you need .
score: 0
answers question: http://stackoverflow.com/q/24835544

http://stackoverflow.com/q/24783589
tagged with: javascript
tagged with: radio-button
downvote count: 0
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/24783866
has answer: http://stackoverflow.com/a/24783866
type: AnsweredQuestion
score: 3
has title: Input radio ng-model not updated after all
upvote count: 3
has answer: http://stackoverflow.com/a/24784089
type: Question
answer count: 2
has body: I try to solve a puzzle why an ng-model of input[radio] controls is not set as I expect. When a page is loaded all radios are initiated correctly. Clicking on different controls changes the radioVal variable - its value is rendered in the page. The problem is that it looks like it takes place only in a DOM. When I debug the code the $scope.radioVal is always the same ... The isolated scope of modalDialog does not contain the radioVal property. In which scope the radio ng-model is created ? Is it a different instance of it? The working code can be found here on jsfiddle. My html code is: Click me One Two Three The model changes in the DOM as expected: radioVal = but by pressing the Action button you can see that the model has not been modified. Action My angular code: angular.module('common', []) .controller('mainCtrl', ['$scope', function($scope){ $scope.showModal = false; $scope.radioVal = "nothing changes me"; $scope.showModalDlg = function() { $scope.showModal = !$scope.showModal; }; $scope.actionFun = function() { console.log('actionFun ...' + $scope.radioVal); }; }]).directive('modalDialog', function () { return { restrict: 'E', scope: { show: '=', action: '&', }, replace: true, transclude: true, link: function (scope, element, attrs) { scope.hideModal = function () { scope.show = false; scope.$apply(); }; $('a[hide]', element).on('click', function(){ scope.hideModal(); }); $('a[action]', element).on('click', function(){ console.log('There is no radioVal in isolated scope either ... ' + scope.radioVal); scope.action()(); scope.hideModal(); }); }, template: ' ' } }); angular.module('app', ['common'])
accepted answer: http://stackoverflow.com/a/24784089

.net
tags question: http://stackoverflow.com/q/24759089
tag name: .net
tags question: http://stackoverflow.com/q/24789869
type: Tag
tags question: http://stackoverflow.com/q/24797056
tags question: http://stackoverflow.com/q/24875570
tags question: http://stackoverflow.com/q/24760490
tags question: http://stackoverflow.com/q/24770212
tags question: http://stackoverflow.com/q/24892648

http://stackoverflow.com/a/24817924
upvote count: 0
score: -1
answers question: http://stackoverflow.com/q/24817856
downvote count: 1
type: Answer
has body: Mobile devices don't have mouse, so onmousedown and onmouseup probably won't work. Check out touch events instead. That being said, I haven't been able to make touchmove-event to work. Seems like the event is only fired once and touch dragging motion is just ignored.

http://stackoverflow.com/comment/38655485
type: Comment
comment on: http://stackoverflow.com/q/24886174
has text: Is this specifically happening for Category 1 or is it totally random? If there is consistency in how specific elements act, perhaps there is a pattern to discover there.
score: 0
type: QuestionComment

http://stackoverflow.com/q/24864021
type: Question
has comment: http://stackoverflow.com/comment/38614461
tagged with: javascript
upvote count: 3
answer count: 2
possible better answer: http://stackoverflow.com/a/24864570
has answer: http://stackoverflow.com/a/24864570
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38614626
has body: So, I have the following jQuery code: $(function() { var lastElement = false; $("ul li").each(function() { if (!lastElement || lastElement.offset().top == $(this).offset().top) { // add slash $(lastElement).after(' /'); } lastElement = $(this); }) }); Basically it will add slashs after every li element, with the exception that if the li is the last in the line it will not add slash. I tried to use this same function to resize, but when the window is resized, it adds several slashs without removing the other. Here is a fiddle: http://jsfiddle.net/W2ULx/23/ Any idea? Thanks...
has title: Can't get function to work on window resize
has answer: http://stackoverflow.com/a/24864484
accepted answer: http://stackoverflow.com/a/24864484
has comment: http://stackoverflow.com/comment/38614605
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/38613721
downvote count: 0
has comment: http://stackoverflow.com/comment/38613885

http://stackoverflow.com/comment/48518861
has text: Isn't it better to use `$templateRequest` instead of `$http` because it does async template fetching+caching automatically and in Angular-predictable way?
type: Comment
comment on: http://stackoverflow.com/a/24758317
score: 0
type: AnswerComment

http://stackoverflow.com/q/24816547
type: UnansweredQuestion
has title: Load another JS file in JS and stop current
has answer: http://stackoverflow.com/a/50454664
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38524246
has comment: http://stackoverflow.com/comment/38524195
score: 0
has comment: http://stackoverflow.com/comment/38524186
answer count: 1
has body: I was asking myself if there is a way to load a JS file in a JS file and stop the current JS Example; Loading from index.html to Fake.js and Fake.js has a bunch of fake coding, and one line what he actually most do, loading Real.js. This is for to keep my JS file not easy to copy by people who just go to http://example.com/Fake.js
has comment: http://stackoverflow.com/comment/38524206
has comment: http://stackoverflow.com/comment/38524261

http://stackoverflow.com/a/24828724
has comment: http://stackoverflow.com/comment/38547066
answers question: http://stackoverflow.com/q/24827451
score: 0
has body: Based on your stated question (see below) i assume your first click opens/shows a new layer. Does the new element maybe overlap the underlying (your so called outside) element so that it never receives the second click? You could try to colorize the areas to check if something overlaps, or use the debugging tools of your browser. To sum-up, how do I actually close a div when clicking outside?
has comment: http://stackoverflow.com/comment/38548028
type: Answer
has comment: http://stackoverflow.com/comment/38547332

http://stackoverflow.com/q/24869688
type: Question
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
has body: First of all, I'm new to jquery and jQuery UI and how to use it. I downloaded everything I need and moved it to my project folder. However I keep getting the following error because it is looking for a folder in my Downloads folder that I moved to my project folder. I got this error multiple times for all of the images in the folder. How do I fix this? GET http://localhost:#####/Downloads/jquery-ui-1.11.0.custom/jquery-ui-1.11.0.custom/images/ui-bg_highlight-soft_100_eeeeee_1x100.png 404 (Not Found) jquery-1.11.1.js:6128
score: 0
has comment: http://stackoverflow.com/comment/38624924
answer count: 2
has comment: http://stackoverflow.com/comment/38624942
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38625034
has answer: http://stackoverflow.com/a/24869846
has title: jQuery UI How to point broken image links to correct file?
has answer: http://stackoverflow.com/a/24869961

http://stackoverflow.com/a/24799974
upvote count: 1
answers question: http://stackoverflow.com/q/24798728
has comment: http://stackoverflow.com/comment/38493135
has comment: http://stackoverflow.com/comment/38494577
has comment: http://stackoverflow.com/comment/38493989
has comment: http://stackoverflow.com/comment/38494229
type: Answer
has comment: http://stackoverflow.com/comment/38494070
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38493833
has comment: http://stackoverflow.com/comment/38493347
has body: Given that data attribute should be a style, An idea comes to mind, it is to modify a 'style' tag directly in the header to apply :before css, please check the updated Fiddle sample: http://jsfiddle.net/cHhJ5/3/ Javascript: var $style; $(document).ready(function(){ $('.olListPallette').click(function(){ if(!$style){ $style = $(' '); $("head").append($style); }else{ $style.html('ol li:before {'+$(this).attr("data-numberStyle")+' ";} '); } }); }); Hope it helps Edit (Explanation): :before (and others pseudo-selectors like :after) can't be modified directly with jQuery because there aren't part of the DOM. So, a possible workaround may be to modify directly a style tag in header to accomplish the purpose of modify the list style. However, I feel that it's a bit hackish to add a style tag in header and put styles directly in data attribute, I'd rather prefer to use predefinied css classes and assing them through javascript: http://jsfiddle.net/cHhJ5/4/ Html, use a class name as a data attr. value: type1 Css, define classes with desired styles: ol.low li:before { content: counter(count, lower-alpha) ") "; counter-increment: count; } ol.upp li:before { content: counter(count, upper-alpha) ") "; counter-increment: count; } Javascript, just set related class on click: $(document).ready(function(){ $('.olListPallette').click(function(){ $("ol").removeClass(); $("ol").addClass($(this).attr("data-numberStyle")); }); });
has comment: http://stackoverflow.com/comment/38493999
has comment: http://stackoverflow.com/comment/38494156

http://stackoverflow.com/a/24759135
answers question: http://stackoverflow.com/q/24759024
score: 1
has comment: http://stackoverflow.com/comment/38415768
has comment: http://stackoverflow.com/comment/38415855
has comment: http://stackoverflow.com/comment/38415862
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/38416074
downvote count: 1
has comment: http://stackoverflow.com/comment/38415656
has comment: http://stackoverflow.com/comment/38415612
has comment: http://stackoverflow.com/comment/38415845
has body: Assuming abc_xyz is indeed a string you want to match, and isn't just a typo, then your regex is: /abc(?:_[^_]+)?_xyz/ This will match abc, then optionally match a _ followed by greedily matching anything but _s. After this optional part, it will match the ending _xyz. If this is to match an entire string (as opposed to just extracting substrings from a bigger string), then you can just put ^ at the start and $ at the end, like so: /^abc(?:_[^_]+)?_xyz$/ EDIT: Just noticed that JavaScript doesn't support possessive matching, only greedy. Changed ++ to +. EDIT2: The above regexes also assume that your "arbitrary string" does not contain more underscores. They can be expanded to allow more rules. For example, to allow just anything, a truly arbitrary string, try: /abc(?:_.*)?_xyz/ or /^abc(?:_.*)?_xyz$/ But if you want to be really clever, and disallow consecutive underscores, you can do: /abc(?:_[^_]+)*_xyz/ or /^abc(?:_[^_]+)*_xyz$/ And lastly, if you want to "only allow letters or numbers" in your arbitrary strings, just replace [^_] with [a-zA-Z0-9].
has comment: http://stackoverflow.com/comment/38416040
has comment: http://stackoverflow.com/comment/38415821

http://stackoverflow.com/comment/38701358
type: Comment
has text: Yes, it is reading the column values, for each row I have 5 fields. For Each row I want to read each fields value and store it in an array. As of now I got it using $(i).next().next(). but it takes so much time to iterate. Need efficient logic. Thanks in advance
comment on: http://stackoverflow.com/a/24874920
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38670333
type: AnswerComment
comment on: http://stackoverflow.com/a/24890529
score: 0
type: Comment
has text: It will return the full input in the first capture only if you have a `name` that will match the full input. Can you provide some example `stmt`s that are supposed to be looped?

http://stackoverflow.com/comment/38659331
type: Comment
has text: If it Handlebars as I guess then may be you miss `#` in `if` - `{{#if test(1,2)==1}}`
comment on: http://stackoverflow.com/q/24887651
score: 0
type: QuestionComment

http://stackoverflow.com/q/24870704
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38626828
has comment: http://stackoverflow.com/comment/38626756
has answer: http://stackoverflow.com/a/24870895
has title: changing text by viewport size
type: Question
has comment: http://stackoverflow.com/comment/38626800
tagged with: css
has comment: http://stackoverflow.com/comment/38626787
score: 0
has body: Newbie needs direction badly. I have a responsive site with call me buttons. Since a viewer on a desktop machine can't actually press the button to call as a mobile device can, I need the button to state "Call Me" when in mobile viewport and state the phone number when viewed on desktop. I tried the following javascript but firebug reports errors that confuse the situation. Any help with this will be greatly appreciated. var changeText = document.getElementById("changeText"); if (window.innerwidth &gt;= 1024){ changeText.write("215-555-1555"); else changeText.write("Call Me"); }
answer count: 2
has answer: http://stackoverflow.com/a/24870843

http://stackoverflow.com/q/24777906
has title: onclick javascript function inserting value in input tag is not working on windows 8 in internet explorer 10
has body: when i am inserting the value into the input tag by onclick function in javascript, but the value is not inserting in input tag when i am using internet explorer 10 on windows 8, but the values are inserting in input tag when i am using google chrome. This is my html code <body BIHAR BGSRU01 This is the javascript code: i have enabled the javascript in internet explorer 10, onlick function is working alert() function pop is coming, but the values are not inserting. please suggest how to overcome this problem.
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/24777971
accepted answer: http://stackoverflow.com/a/24777971
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/a/62289762
answers question: http://stackoverflow.com/q/24793051
has body: We can keep track of frequency of each character of the string in an object. For example : for "aabcbd" we can store the frequency as { "a":2, "b":2, "c":1, "d":1 } This will take O(n) time. Then we can traverse over this object and find the first character with frequency 1, which will also take O(n) time. So, the time complexity for this approach will be O(n). const firstNonRepeating=(str)=&gt;{ const obj={}; str.split("").forEach(item=&gt;{ obj[item] ? obj[item]++ : obj[item]=1; }); const item = Object.keys(obj).find(key=&gt; obj[key] === 1); return item; } Note: I use ES6 Object.keys method which may not work in older browsers.
downvote count: 0
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/a/24808268
score: 1
type: AcceptedAnswer
has body: You can check the status code of the response. if(_req.statusCode === 200) { //Response okay. } Here's a list of the status codes.
upvote count: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/24808072
downvote count: 0
answers question: http://stackoverflow.com/q/24808072

http://stackoverflow.com/q/24897529
has body: I'm noob, and i recently knew about Ajax, so dont worry if my question seems idiot. I tried to do that, but i had no success, but i will explain what i tried to do: I have one draggble box with some words, and everytime that i drag some elements to a certain place, i want to record this transition into my database. So, i did that in Ajax: UPDATE $(document).ready(function() { $(".event").draggable(); $(".drop").droppable({ drop: function(event, ui) { var id = ui.draggable.attr("id"); var targetid = event.target.id ; $.ajax( { type: 'post', url: "new.php", data : { 'day' : '3' }, success: function( response ) { alert( response ); } }); } }); }); New file: function eventTransition($day){ $day = $_POST['day']; $insert="INSERT INTO events (event_day) VALUES (".$day.")"; mysql_query($insert); } eventTransition($day); I tried to automatically put a value to the day variable.
has answer: http://stackoverflow.com/a/24897925
has answer: http://stackoverflow.com/a/24897606
has comment: http://stackoverflow.com/comment/38677786
has comment: http://stackoverflow.com/comment/38677714
has comment: http://stackoverflow.com/comment/38677661
possible better answer: http://stackoverflow.com/a/24897925
linked to: http://stackoverflow.com/q/60174
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38677427
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/12859942
tagged with: ajax
type: Question
accepted answer: http://stackoverflow.com/a/24897606
has title: Is it possible to call a function using Ajax?
has comment: http://stackoverflow.com/comment/38677454
has comment: http://stackoverflow.com/comment/38677452
score: 0
answer count: 2
tagged with: php

http://stackoverflow.com/q/24878073
has comment: http://stackoverflow.com/comment/38642403
accepted answer: http://stackoverflow.com/a/24879481
has title: Javascript: too much recursion error
has comment: http://stackoverflow.com/comment/38640922
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24878105
has answer: http://stackoverflow.com/a/24878105
linked to: http://stackoverflow.com/q/1335851
type: Question
has comment: http://stackoverflow.com/comment/38640883
answer count: 2
has comment: http://stackoverflow.com/comment/38642267
has comment: http://stackoverflow.com/comment/38640882
has body: I've been working on this project, and I have this array set up that I populate with the following: var myArray = {}; myArray[idNumber] = parentIdNumber; Each member can only have one or no parent, denoted by 0. I have values up to 70 filled out. I'm receiving a value input and need to check if every member of the array is in the 'family line' of input. So I iterate through myArray and call isInFamilyLine(currentObject, 37), where currentObject is in the range 1-70: function isInFamilyLine(idNumber, input) { if (idNumber== input) { isInLine = true; } else { if (myArray[idNumber] == 0) { isInLine = false; } else { isInLine = isInFamilyLine(myArray[idNumber], input); } } return isInLine; } I think the logic is right, but most examples I've seen of too much recursion involved a bug in the code. What's also weird is that the too much recursion error is thrown on this line: if (myArray[idNumber] == 0) { Any ideas?
tagged with: javascript
has answer: http://stackoverflow.com/a/24879481
score: 0

http://stackoverflow.com/q/24858947
tagged with: c#
accepted answer: http://stackoverflow.com/a/24859522
has body: In gridview if user click delete button i want to delete that record so after clicking delete button i want to show confirmation box not alert box and from confirmation box i want to check if user click yes then delete the record else cancel I want how to check if user click yes or no from confirm box HyperLink hypComplaintMasterDelete =HyperLink)e.Row.FindControl("hypComplaintMasterDelete"); hypComplaintMasterDelete.NavigateUrl = string.Format("{0}?control=CommitteeMembersDetails&amp;Mode=De&amp;id={1}", MasterDataHelper.NAVIGATE_Committee, lblCollagecommitteeUsersID.Text); hypComplaintMasterDelete.Attributes.Add("onclick", "return confirm('Are you sure \n You want to delete);");
tagged with: javascript
has comment: http://stackoverflow.com/comment/38604726
score: 0
has answer: http://stackoverflow.com/a/24859522
has comment: http://stackoverflow.com/comment/38604592
answer count: 1
tagged with: asp.net
tagged with: gridview
has title: Delete record using Confirmation box
has comment: http://stackoverflow.com/comment/38604742
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38604991
has comment: http://stackoverflow.com/comment/38604917
linked to: http://stackoverflow.com/q/7836197
type: Question

http://stackoverflow.com/comment/64124082
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24771024
has text: Works for me, i had 'selection' but wanted the hover and selection option. 'both' works perfect!
type: AnswerComment

http://stackoverflow.com/comment/38432534
has text: Thanks for clarifying the scope situation with transclusion runTarm. The transclusion directive looks like a solid way to build this as a reusable component.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24764722

http://stackoverflow.com/q/24846226
has comment: http://stackoverflow.com/comment/38580747
upvote count: 1
tagged with: mongoose
tagged with: javascript
has comment: http://stackoverflow.com/comment/38580995
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38580110
linked to: http://stackoverflow.com/q/21239105
answer count: 0
has comment: http://stackoverflow.com/comment/38581837
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38580829
has body: I am trying to build a checklist app that takes input from a form and then writes it to a collection. The problem is that, when I try to print the input on the same page I took it from, it does not reach the JavaScript in the html. If I console.log(checklist_data);, I see all the data from mongo. How do I get it to the page? routes/index.js: //insert into the db ( works perfectly) var mongoose = require('mongoose'); var checklist_model = mongoose.model('checklist_model'); exports.create = function (req, res) { new checklist_model({ name: req.body.name, comment: req.body.comment }).save(function (err, checklist_model) { res.redirect('/checklist'); }); // query db for all checklist items ( checklist_data has all the data ) exports.checklist = function (req, res) { checklist_model.find(function (err, checklist_data, count) { res.render('checklist', { title: 'checklist', checklist_data: checklist_data }); console.log(checklist_data); }); }; } HTML: //HTML code &lt;script language="javascript" class="lookhere"&gt; checklist_data.forEach( function( checklist_model ){ checklist_model.content }); &lt;/script&gt; app.js: app.get('/', routes.index); app.get('/checklist', routes.checklist); app.post('/create', routes.create);
tagged with: node.js
has title: Unable to pass data to html from mongo/mongoose node.js
downvote count: 0
score: 1
favorite count: 0
type: Question
tagged with: mongodb

http://stackoverflow.com/q/24864947
score: 16
type: AnsweredQuestion
has body: Is there a way to stop react from removing/changing nodes embedded in a react component. For example, I have a react component that acts as a container for a non-react component that manages its DOM on its own. Is there a way to mark such components for reactjs, so that it does not modify its DOM? In my case, I want my react component to be inline-editable by CKeditor, but react always removes/destroys the editor and all the nodes it has added to the DOM, because they were not defined in the react component itself and so it thinks that those elements should not be there. Any ideas?
tagged with: dom
type: Question
tagged with: reactjs
answer count: 2
has answer: http://stackoverflow.com/a/30150763
accepted answer: http://stackoverflow.com/a/24871991
downvote count: 0
upvote count: 16
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/24871991
has title: React - Ignore subnodes
possible better answer: http://stackoverflow.com/a/30150763

http://stackoverflow.com/q/24800337
has comment: http://stackoverflow.com/comment/38495644
tagged with: javascript
has comment: http://stackoverflow.com/comment/38494236
linked to: http://stackoverflow.com/q/11139065
has comment: http://stackoverflow.com/comment/38493736
score: 0
has body: I want to extract the XML from this link http://212.12.182.204:8090/NewsService.svc/LatestNews with JavaScipt, I've done and searched for loads of codes but I think the error is in the link or feed itself, I'm not sure as I'm new to this. Thank you EDITED PART: the code I used from google code playground: Google AJAX Search API Sample Loading...
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/18933217
tagged with: http://stackoverflow.com/tag/xml
has comment: http://stackoverflow.com/comment/38496939
has title: How to extract the XML from this link in JavaScript?
has comment: http://stackoverflow.com/comment/38494670
tagged with: rss
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38493447
has comment: http://stackoverflow.com/comment/38495011
has comment: http://stackoverflow.com/comment/38496492
linked to: http://stackoverflow.com/q/8237923
has comment: http://stackoverflow.com/comment/38494595
answer count: 0
has comment: http://stackoverflow.com/comment/38494474
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38493437
has comment: http://stackoverflow.com/comment/38493525
type: Question

http://stackoverflow.com/comment/38405315
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24753319
score: 0
has text: Please accept the answer that helped you solve your problem, and if it still persists, please comment

firefox-addon-sdk
tags question: http://stackoverflow.com/q/24904111
tags question: http://stackoverflow.com/q/24843453
tags question: http://stackoverflow.com/q/24850709
type: Tag
tags question: http://stackoverflow.com/q/24909117
tags question: http://stackoverflow.com/q/24868227
tag name: firefox-addon-sdk
tags question: http://stackoverflow.com/q/24801706
tags question: http://stackoverflow.com/q/24900845
tags question: http://stackoverflow.com/q/24886858
tags question: http://stackoverflow.com/q/24850460
tags question: http://stackoverflow.com/q/24900197
tags question: http://stackoverflow.com/q/24754177
tags question: http://stackoverflow.com/q/24888767
tags question: http://stackoverflow.com/q/24839445
tags question: http://stackoverflow.com/q/24781015
tags question: http://stackoverflow.com/q/24897764
tags question: http://stackoverflow.com/q/24842698
tags question: http://stackoverflow.com/q/24849385
tags question: http://stackoverflow.com/q/24819258

http://stackoverflow.com/comment/38631436
type: Comment
comment on: http://stackoverflow.com/a/24872574
score: 0
type: AnswerComment
has text: @MaunoV.: i understand my mistake,and i apologise,sorry for that

http://stackoverflow.com/comment/38709008
score: 0
type: AnswerComment
type: Comment
has text: Nope, still doesn't work - updated code snippet above to include what I have on the page.
comment on: http://stackoverflow.com/a/24898770

http://stackoverflow.com/a/24767305
has body: Well, you've got a few things going on here: First, when I run your code I get a reference error because homeTeamOppW is not defined. You have a typo. Second you never actually update ans; it gets passed by value. So it will never be changed from 0. That being said, when I run your code (changing homeTeamOppW to homeTeamoppw) it prints 0 which is what I would expect. If you change the function to return a value as @Mathletics shows and fix the typo, I think it does what you want. Alternatively, you can just directly reassign ans at the end of the function.
answers question: http://stackoverflow.com/q/24767153
score: 0
type: Answer

http://stackoverflow.com/a/24791969
has comment: http://stackoverflow.com/comment/38481728
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/24789997
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24789997
upvote count: 3
type: Answer
has body: You can't inherit them, though it's a timely question - we're actually starting to experiment with something like this. In the meantime, most of those fonts are only available on the OS that they're used on, so you can list them all and rely on normal font-family fallback: Like https://github.com/kalman/chrome-extensions/blob/master/browser-clock/options.html#L8 Maybe not Windows XP, but that's not supported anyway.

http://stackoverflow.com/q/24806751
has title: Dialog popup doesn't work
has comment: http://stackoverflow.com/comment/38505541
type: Question
tagged with: c#
possible better answer: http://stackoverflow.com/a/24807129
tagged with: asp.net-mvc
tagged with: javascript
score: 0
answer count: 3
tagged with: jquery
has body: I'm trying open a view in popup (dialog) after a click on a link, i don't find the problem: Here is my JS code in my view: &lt;script type="text/javascript"&gt; $.ajaxSetup({ cache: false }); $(document).ready(function () { $(".openDialog").on("click", "a", function (e) { e.preventDefault(); $("&lt;div&gt;&lt;/div&gt;") .addClass("dialog") .attr("id", $(this).attr("data-dialog-id")) .appendTo("body") .dialog({ title: $(this).attr("data-dialog-title"), close: function () { $(this).remove();}, modal: true, height: 500, width: 700 }) .load(this.href); }); $(".close").on("click", "a", function (e) { e.preventDefault(); $(this).closest(".dialog").dialog("close"); }); }); &lt;/script&gt; And here is my link in the same view: @Html.ActionLink("Exports", "List", new { id = Model.Orga_Id }, new { @class = "openDialog", data_dialog_id="exportDialog", data_dialog_title="Tous les exports" }) All the code is of this view and the code of the view i'd like to show in the dialog is in the same Controller. When i click on the link, my nav only change the page like a &lt;a href="#"..&gt;&lt;/a&gt; Can you see what is wrong here? Do you need more information?
has answer: http://stackoverflow.com/a/24807142
has answer: http://stackoverflow.com/a/24807129
has answer: http://stackoverflow.com/a/24807011
accepted answer: http://stackoverflow.com/a/24807011
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38505413

http://stackoverflow.com/q/24839383
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/38566641
answer count: 1
accepted answer: http://stackoverflow.com/a/24839512
has answer: http://stackoverflow.com/a/24839512
has body: I am trying to figure out how to select a DOM element by it's Id, where the id is something ugly. Here is an example of an id: &lt;element id='[$something:else#52,$someth:else#51]'&gt; At some point from the back-end I am receiving unknown for me id name and I have to find the DOM element with that ID. I have tryed using jQuery like: $('#' + elementId) //where the elementId is a string from the example above but jQuery returns: Error: Syntax error, unrecognized expression: #[$something:else#52,$someth:else#51] I have also tryed to use the document selector: document.querySelectorAll('#' + elementId) //with the id from above again resulting in error: SyntaxError: Failed to execute 'querySelectorAll' on 'Document': '#[$something:else#52,$someth:else#51]' is not a valid selector. [My Question] Is there a way to force these selectors (or any other suggested by you selector) not to treath the selector argument as expression? Is there a way to make such a selection? Thank you for your time!
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38566575
tagged with: dom
has title: DOM element selection by id with special symbols
type: Question
tagged with: javascript

http://stackoverflow.com/q/24853237
linked to: http://stackoverflow.com/q/1551389
answer count: 2
tagged with: iphone
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38593279
has answer: http://stackoverflow.com/a/24854259
has title: Mouse Scrolling and other button clicks is not working on iPhone
has body: I am working with a website which needs fully responsive for the devices. I am testing it iPhone 5. Mouse wheel scroll and buttons clicks is not working when I am testing with iPhone. But everything is working fine when I am testing with online iPhone simulators. N. B. Actually, I can't post code here. Because, I can't guess what is the problem there.
score: 0
has comment: http://stackoverflow.com/comment/38593206
has answer: http://stackoverflow.com/a/24853319
type: Question
tagged with: responsive-design
tagged with: javascript

http://stackoverflow.com/q/24849644
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/24850545
tagged with: javascript
score: 0
answer count: 1
has title: lastChild.remove() doesn't work on IE
accepted answer: http://stackoverflow.com/a/24850545
has body: I want to dynamically add and remove input files, my code works great on all browsers without Internet Explorer. Can anyone help me to resolve my problem? Here is the Javascript: &lt;script&gt; var counter = 1; var min = 1; var max = 20; function addInput(divName) { if (counter == max) { alert("Max limit!"); } else { var newdiv = document.createElement('div'); newdiv.innerHTML = '&lt;input type="file" name="file[]" id="file"&gt;&lt;br&gt;'; document.getElementById(divName).appendChild(newdiv); document.getElementById("qty").value++; counter++; } } function remInput(divName) { if (counter == min) { alert("Min limit!"); } else { var element = document.getElementById(divName); element.lastChild.remove(); document.getElementById("qty").value--; counter--; } } &lt;/script&gt; And here is the HTML code: &lt;input type="button" value="-" onClick="remInput('plus');"&gt; &lt;input type="text" name="qty" id='qty' size='2' style="text-align: center" disabled value="1"&gt; &lt;input type="button" value="+" onClick="addInput('plus');"&gt; &lt;div id="plus"&gt; &lt;input type="file" name="file[]" id="file"&gt;&lt;br&gt; &lt;/div&gt; Thank you.

http://stackoverflow.com/a/24901259
score: 0
has body: I think you would require something like this var th = document.createElement('th'); var tr = document.createElement('tr'); var tbody = document.createElement('tbody'); var table = document.createElement('table'); table.className = "report"; th.appendChild(img); tr.appendChild(th); tbody.appendChild(tr); table.appendChild(tbody);
type: Answer
answers question: http://stackoverflow.com/q/24901198

http://stackoverflow.com/a/24827383
has body: I have also tried ClientContext.executeQueryAsync in a loop but have never gotten it to work for similar reasons. I've worked around this before by using Ajax to call the SharePoint lists.asmx web service. For example: var targetUrl = "/_vti_bin/lists.asmx"; var listName = "Shared Documents"; for (var currentItem in SelectedDocuments) { var currentItemId = SelectedDocuments[currentItem].id; var soapEnvArray = []; soapEnvArray.push("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); soapEnvArray.push("<soap:Envelope "); soapEnvArray.push("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"); soapEnvArray.push("<soap:Body> " + listName + " "); soapEnvArray.push(" "); soapEnvArray.push(" "); soapEnvArray.push(" "); soapEnvArray.push(" "); soapEnvArray.push(" "); soapEnvArray.push(" " + currentItemId + " "); soapEnvArray.push(" "); soapEnvArray.push(" "); soapEnvArray.push(" "); soapEnvArray.push(" "); soapEnvArray.push(" "); soapEnvArray.push(" 2000 "); soapEnvArray.push("<IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns>"); soapEnvArray.push("<ViewAttributes Scope = \"RecursiveAll\"/>"); soapEnvArray.push(" "); soapEnvArray.push(" </soap:Body></soap:Envelope>"); var soapEnv = soapEnvArray.join(""); $.ajax({ cache: false, url: targetUrl, type: "POST", dataType: "xml", data: soapEnv, contentType: "text/xml; charset=utf-8", beforeSend: function (xhr) { xhr.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/sharepoint/soap/GetListItems"); }, complete: function (msg) { if (msg.status == 200) { var totalTaskCount = $(msg.responseXML).find("z\\:row, row").length; $(msg.responseXML).find("z\\:row, row").each(function () { console.log(currentItemId + ": " + $(this).attr("ows_Title")); }); } else { //Failure var errorCode = $(msg.responseXML).find("errorcode").text(); var errorString = $(msg.responseXML).find("errorstring").text(); if (errorString.length === …
answers question: http://stackoverflow.com/q/24819944
score: 0
type: Answer

http://stackoverflow.com/a/24855171
upvote count: 1
downvote count: 0
has body: Javascript to listen to both elements changeing and then giving you the concatenated string $('#rif, #username').on('change', function () { var str = $('#rif').val() + $('#username').val(); alert(str); }); Demo:http://jsfiddle.net/robschmuecker/rGu4k/
answers question: http://stackoverflow.com/q/24855087
type: Answer
score: 1

http://stackoverflow.com/comment/38468781
type: QuestionComment
has text: possible duplicate of http://stackoverflow.com/questions/3198915/any-ideas-on-how-to-use-google-closure-compiler-to-combine-multiple-javascript-f/13230424
score: 0
comment on: http://stackoverflow.com/q/24781091
type: Comment

http://stackoverflow.com/a/24801318
has comment: http://stackoverflow.com/comment/38495503
has comment: http://stackoverflow.com/comment/38495363
type: Answer
score: 6
answers question: http://stackoverflow.com/q/24801270
has comment: http://stackoverflow.com/comment/38495593
downvote count: 0
has comment: http://stackoverflow.com/comment/38495452
has comment: http://stackoverflow.com/comment/38495726
upvote count: 6
has body: In key = capitaliseFirstLetter(key) alert(key) a string object is passed to the function by value. So it's not changing, and you should reassign the value.

http://stackoverflow.com/comment/38639647
type: QuestionComment
has text: Can you explain your reasoning so that I may improve my future code?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24877371

http://stackoverflow.com/comment/38591376
type: Comment
has text: missing semicolon? should be `var url_to_be_converted = "http://www.google.com/image/sample";`
comment on: http://stackoverflow.com/q/24852288
score: 0
type: QuestionComment

http://stackoverflow.com/q/24787435
accepted answer: http://stackoverflow.com/a/24787503
type: Question
has answer: http://stackoverflow.com/a/24788355
has comment: http://stackoverflow.com/comment/38469914
has body: I am making an app that requires the user to click on a location and then will be directed to the location via Google Maps.The locations are an array of objects. This is what the location files look like. $scope.SiteLocs = [ { "name": "502 Nelson St, Greenville, MS 38701", "visibility": "0", "description": "502 Nelson St, Greenville, MS 38701", "styleUrl": "#waypoint", "Point": { "coordinates": "-91.05636,33.415485,0" } }, { "name": "242 Blackhawk Trace, Galena, IL 61036", "visibility": "0", "description": "242 Blackhawk Trace, Galena, IL 61036", "styleUrl": "#waypoint", "Point": { "coordinates": "-90.319778,42.390862,0" } }, { "name": "3747 Ocean Dr, Vero Beach, FL 32963", "visibility": "0", "description": "3747 Ocean Dr, Vero Beach, FL 32963", "styleUrl": "#waypoint", "Point": { "coordinates": "-80.358248,27.659094,0" } }, ect... I want to add another element to every item in the array. I tried adding it in through the .concat() method but that didn't seem to work. If I wanted to add "carrier": "sprint", to each location how would I do that? I forgot to add this bit of code. It splits and reorders the coordinates in the files. angular.forEach($scope.SiteLocs, function(location) { var clength = location.Point.coordinates.length; if (location.Point.coordinates.substring(clength - 2, clength) === ",0") { location.Point.coordinates = location.Point.coordinates.substring(0, clength - 2).split(","); Lat = location.Point.coordinates[0] Lon = location.Point.coordinates[1] Com = "," location.Point.coordinates = Lon.concat(Com,Lat) }
tagged with: arrays
tagged with: javascript
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/38469968
has title: Adding a property to each object in an array
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/24788004
has answer: http://stackoverflow.com/a/24788004
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24787503

http://stackoverflow.com/a/24767428
type: Answer
answers question: http://stackoverflow.com/q/24767373
accepted answer of: http://stackoverflow.com/q/24767373
score: 0
has body: When you submit a form the current page STOPS EXECUTION, then the server spits out a new page. It's just like navigating away, except you're sending the for data to the server along with the request. Therefore you cannot submit two forms on the same page. You can either: 1) Submit one or both forms using AJAX or 2) Target each form to its own Iframe, and handle the response in the Iframe yourself.
type: AcceptedAnswer

http://stackoverflow.com/comment/62420900
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25606649
has text: This [no longer works](http://stackoverflow.com/questions/9709891/prevent-ios-mobile-safari-from-going-idle-auto-locking-sleeping) mobile safari
type: AnswerComment

http://stackoverflow.com/comment/38481536
comment on: http://stackoverflow.com/q/24792855
has text: The infowindow basically is a simple HTML-div, there will not fire an event when the content has been rendered. There is a `domready`-event for an infowindow(when the content has been attached to the document), but at this time the content hasn't been rendered yet(it fires before the infowindow opens...the content is still hidden at this time).
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24884185
tagged with: jquery
has answer: http://stackoverflow.com/a/24884445
has comment: http://stackoverflow.com/comment/38682738
answer count: 3
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/38651990
accepted answer: http://stackoverflow.com/a/24884368
has title: Decimal checking using Regex in javascript
has answer: http://stackoverflow.com/a/24884296
tagged with: regex
linked to: http://stackoverflow.com/q/308122
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24884296
score: 1
has body: I'm currently working on Regular Expression to check the decimal input in JavaScript. Below are the mock-up test case: HTML: &lt;input type="text" id="checkValue" onkeypress="checkKey(event)"/&gt; JavaScript: function checkKey(event) { if(event.which == '13') { //Enter is pressed var checkVal = $('#checkValue').val().trim(); if(checkVal.match("(\d{1,7}\.\d{1,2})|(\.\d{1,2})|(0)")) { alert("Matched!"); } else { alert("Not matched!"); } } } Supposed I type in "123.456" will return "Not matched!", but it returns "Matched!". The desired result would be: Match type: .01 1 1.01 0 1234567.89 Unmatch type: .012 1.098 123.456 As conclusion, the value input should be in 9 digits at most, with or without decimal. And id with decimal, it only takes 2 places, such as "1234567.89". It's my first time stepping in Regex, so any advice in getting this well? Any help in helping fixing the Regex above would be great :) Edited function checkKey(event) { if(event.which == '13') { //Enter is pressed var checkVal = $('#checkValue').val().trim(); alert(checkVal.match(/^\d{0,7}\.?\d{0,2}|\.\d{0,2}|0$/)); } } Same, the input I typed "123.456", but the alert message I get was "123.45"... Second edit function checkKey(event) { if(event.which == '13') { //Enter is pressed var checkVal = $('#checkValue').val().trim(); alert(checkVal.match(/^\d{0,7}(\.\d{0,2}|\d{0,2})$/g)); } } I've changed from /^\d{0,7}(\.\d{0,2}|\d{0,2})$/g to /^\d{0,7}\.?\d{0,2}$/g , which is simplified :) And it works for numbers, but how if I would like when user key in only "." and is not acceptable? Also, zero as starting is not acceptable as well. Do I need to separate into 2 regex checking?
duplicate of: http://stackoverflow.com/q/308122
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38651849
has answer: http://stackoverflow.com/a/24884368
tagged with: javascript

http://stackoverflow.com/q/24814169
duplicate of: http://stackoverflow.com/q/21145187
has title: Is it possible to put a link within an anchor's title attribute?
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38519845
tagged with: jquery
has comment: http://stackoverflow.com/comment/38520432
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/21145187
has comment: http://stackoverflow.com/comment/38519823
tagged with: css
has comment: http://stackoverflow.com/comment/38519990
answer count: 0
type: UnansweredQuestion
has body: My problem is pretty simple, but I cannot figure out a way to do it. My goal is to make a title attribute of an anchor tag be able to contain a link. I also want to be able to style this title with CSS. One solution for this would be to somehow add an anchor within the title attribute of another anchor, which is not possible as far as I know. Another solution for this (that would work for me) is to be able to put an anchor tag within the "content" styler of my css, so I could make a pseudo 'anchor title' through CSS. As far as I know this is also not possible. Here is a codepen of some code that may clarify: http://codepen.io/anon/pen/miabL Here is the HTML of an example: Sample Anchor Here is the CSS that applies to the example above: a[data-title]:hover:after { content: attr(data-title); background: purple; color: white; margin-left: 0px; } To put some further perspective on the issue, here is a link to the webpage I am trying to apply this to: http://somil.site11.com/programs.html I want a description to appear off to the right upon hover over each link. This description must be able to contain styles/links and must stick around either after you click on the link or if you mouse over to it after hovering over each corresponding link. There has to be multiple descriptions on the same page which is why I chose to use the title attribute as it sticks around upon hover over to it. I suspect this may require javascript or jquery, which is fine, but a CSS/HTML solution is preferable. Thanks in advance.
linked to: http://stackoverflow.com/q/4505093
has comment: http://stackoverflow.com/comment/38521937
type: Question
tagged with: anchor

http://stackoverflow.com/q/24885739
has answer: http://stackoverflow.com/a/24886288
has comment: http://stackoverflow.com/comment/38654826
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38654969
score: 0
answer count: 1
has body: I have a PHP applications I'm forking which contains a lot of inline javascript in the view files. I'm assuming the reason for this is that quite often the inline script contains php variables passed to the view by the controller. I want to be able to remove the javascript from the view files and place them into separate files, yet still be able to parse the php in the files. I have an existing Document class so I added a method renderScript so that I can pass in the needed file: public function renderScript($script) { $this-&gt;scripts[md5($script)] = $this-&gt;script_directory . $script; } Then my intention is to build a controller that can be called that will iterate through any added scripts, parsing the php, then added it to the dom. In my controller: public function index() { $scripts = $this-&gt;document-&gt;getScripts(); $files = ''; foreach ($scripts as $key =&gt; $value): $files .= file_get_contents ($value); endforeach; $data['script'] = $files; header('Content-Type: application/javascript'); return $this-&gt;load-&gt;view('common/javascript', $data); } Then in my view: &lt;script&gt; &lt;?= $script; ?&gt; &lt;/script&gt; I then load the controller into my footer controller: $data['javascript'] = $this-&gt;load-&gt;controller('common/javascript'); This works sort of ... in that it does echo the entire file into the footer of my app, but that's not really what I want. I'd rather be able to simply use a script tag in my footer view to call the controller directly, but this doesn't work since the javascript controller is passed through index.php and is dispatched and the document reset. So ... is there a way I can include these js files, parse the php in them, and then add them to the dom without printing the entire content to the rendered html? I'm sure there's way, I just can't wrap my head around it.
has title: Moving Javascript Out of Template Files
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php

http://stackoverflow.com/comment/47074811
type: Comment
has text: i used this pattern element.mask("9999/99/99");
type: AnswerComment
comment on: http://stackoverflow.com/a/27449523
score: 0

http://stackoverflow.com/comment/38666208
type: QuestionComment
has text: Yes, https://github.com/NUKnightLab/TimelineJS
comment on: http://stackoverflow.com/q/24889182
score: 0
type: Comment

http://stackoverflow.com/comment/38622553
has text: thanks for suggestion but as I commented in the other answers I'm trying to do it in jQuery/JS is there a way to do it?
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24868440

http://stackoverflow.com/a/24907973
score: 4
type: Answer
has body: The problem is CSS specificity, where the id-rule has precedence over the class-rule. You can create a rule with higher precedence by combining both the id and the class values. #menu.slide { width:180px; } Demo: Fiddle
answers question: http://stackoverflow.com/q/24907939
upvote count: 4
downvote count: 0

http://stackoverflow.com/q/24886889
type: Question
has body: I am using bootstrap selectpicker as multiselect in my project. And its working fine.and also I have a on change event to fire url on selecting the selectbox. I want to know on click or change which item is clicked. (which option of select) $('body').on('change','#mSelect',function(e){ var val = $(this).val(); }) this is giving me the array of all the value which is selected. as console.log(val) = ["all","date","blah"] I want to know which item is clicked which is firing the change event. please help
downvote count: 0
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/2276086
duplicate of: http://stackoverflow.com/q/2276086
favorite count: 0
answer count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
upvote count: 1
has title: capturing the clicked option in bootstrap selectpicker
score: 1

http://stackoverflow.com/comment/38409297
type: QuestionComment
comment on: http://stackoverflow.com/q/24751587
score: 0
has text: swtiching image means..just want to show one image for 2 seconds then another image for next 2 seconds...etc.
type: Comment

http://stackoverflow.com/q/24784110
answer count: 3
downvote count: 0
has title: Compare jquery .data() with String always false
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/24784133
has comment: http://stackoverflow.com/comment/38463513
accepted answer: http://stackoverflow.com/a/24784451
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/7261619
has answer: http://stackoverflow.com/a/24784250
upvote count: 3
has comment: http://stackoverflow.com/comment/38463687
has answer: http://stackoverflow.com/a/24784451
type: Question
possible better answer: http://stackoverflow.com/a/24784133
has body: First of all the fiddle: http://jsfiddle.net/6d82Q/1/ In my HTML I have: &lt;div class="myClass" data-status="true"&gt;&lt;/div&gt; &lt;div class="myClass" data-status="false"&gt;&lt;/div&gt; I want to add a CSS-class to a div depending on the status: $('.myClass').each(function() { // compare status if($(this).data('status') == 'true') { $(this).addClass('myTrueClass'); } else { $(this).addClass('myFalseClass'); } }); The Problem is, that always myFalseClass is added. My question is: How can the problem be fixed and why does it occur in the first place?
score: 3
tagged with: javascript

http://stackoverflow.com/q/24899444
type: Question
linked to: http://stackoverflow.com/q/3586933
has comment: http://stackoverflow.com/comment/38844057
tagged with: ios
tagged with: javascript
has body: When testing the following code in Google Chrome version 36.0.1985.49 on an iPhone 5 running iOS 7.0.6, it always alerts BODY even when focused on the input element, but it should alert INPUT. Would there be any way to get the focused element cross-browser without tracking every focus and blur? HTML: &lt;input type="text"&gt; JS: setInterval(function () { alert(document.activeElement.tagName); }, 5000); Fiddle Also, $(':focus') just gives no result for mobile chrome because it probably ignores when document.body is the focused element. Mobile Safari works exactly as it should. Non-Duplicates: how to find activeelement in chrome in jquery or javascript (Doesn't even mention mobile chrome) document.activeElement returns body in Chrome and Safari (Again, doesn't mention mobile chrome and the solution doesn't even work)
has comment: http://stackoverflow.com/comment/38771236
upvote count: 4
linked to: http://stackoverflow.com/q/21235051
linked to: http://stackoverflow.com/q/13642653
score: 3
answer count: 1
has title: activeElement always returns document.body
has answer: http://stackoverflow.com/a/25024356
favorite count: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38771332
has comment: http://stackoverflow.com/comment/38771261
has comment: http://stackoverflow.com/comment/38843621
accepted answer: http://stackoverflow.com/a/25024356
tagged with: google-chrome
downvote count: 1

http://stackoverflow.com/comment/38450343
comment on: http://stackoverflow.com/a/24777694
score: 0
type: AnswerComment
type: Comment
has text: you forgot to draw the OP's attention to the fact that they'd have to `id` the select tag in order your code to work... plus if you have additional comments to make to your answer, edit your answer instead of commenting... (by the way, the downvote is *not* from me)

http://stackoverflow.com/q/24822593
has body: I have the following dropdown box created for the user to select a specific year: <springform:select id="firstYear" path="member.attributes[firstYear].value" value=" " tabindex="3"> Select year: <springform:options id="years" items="${years}"/> </springform:select> However, I want to set so that if a user checks a particular checkbox, this dropdown is cleared and a blank value is saved to the DB. Currently it is saving the first value in the array that is ${years} which is not desirable. Here is the javascript I have tried using to clear it: $("#firstYear option:selected").prop("selected", false); $("#firstYear").selectedIndex=-1; I have also tried setting the value of firstYear to " " but this didn't work either. Any help would be very much appreciated!
score: 1
tagged with: java
type: Question
downvote count: 0
tagged with: jsp
tagged with: javascript
has answer: http://stackoverflow.com/a/24822804
tagged with: http://stackoverflow.com/tag/html
has title: How to reset a select dropdown using springform:options and save null value
answer count: 1
favorite count: 0
upvote count: 1
tagged with: spring
accepted answer: http://stackoverflow.com/a/24822804
type: AnsweredQuestion

http://stackoverflow.com/comment/38654480
has text: can you tell me how will i call "sallers" in newvalue
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/24885536

http://stackoverflow.com/comment/38399670
type: AnswerComment
type: Comment
has text: no I have written also I had tryed library from ajax server but nothing happenned too. and I have $(document).ready(function(){ in the end of JS script
score: 0
comment on: http://stackoverflow.com/a/24750577

http://stackoverflow.com/q/24796079
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24796136
has title: Toggle multiple elements using JavaScript function parameters
type: Question
has answer: http://stackoverflow.com/a/24796141
has answer: http://stackoverflow.com/a/24796145
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/24796393
possible better answer: http://stackoverflow.com/a/24796145
tagged with: http://stackoverflow.com/tag/html
has body: I want to show/hide a div depending on which button is clicked. I tried doing this using parameters of the javascript function but I'm guessing I'm doing it all wrong, so please help. Here's the HTML I have: Content of div1 Content of div2 Toggle div1 Toggle div2 And here's what I've got so far, JS-wise:
has answer: http://stackoverflow.com/a/24796393

http://stackoverflow.com/comment/38670640
has text: I just rolled back my edit to show that I have a byte[][] on the server, that is being represented as you describe
comment on: http://stackoverflow.com/a/24893940
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/24904573
has comment: http://stackoverflow.com/comment/38690862
score: 8
has comment: http://stackoverflow.com/comment/38690799
upvote count: 8
has comment: http://stackoverflow.com/comment/38690926
type: Answer
has body: You can use this regex: /(?=(\d{3}))/g Online Regex Demo Code: var re = /(?=(\d{3}))/g; var str = '12345abc789'; var m; while ((m = re.exec(str)) != null) { console.log(m[1]); } Output: 123 234 345 789
answers question: http://stackoverflow.com/q/24904530
has comment: http://stackoverflow.com/comment/38690877
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24904530
downvote count: 0

http://stackoverflow.com/a/24785319
has comment: http://stackoverflow.com/comment/38604827
has comment: http://stackoverflow.com/comment/38482108
has body: In the particular example that you've provided, both "orange OR banana" and "orange AND banana" would return the same result set. Seem like it's really an OR search with multiple tokens that you're after. Tokenize the query and match against the data set (or something more complex). You could use a custom expression to do the matching you need; something along the lines of data | filter: findMatch(searchInput) And put the function in scope $scope.findMatch = function findMatch(query) { return function (item) { //TODO: comparison logic, return true|false } } View example on Plunker Have a look at Angular doc for further detail on the filter.
has comment: http://stackoverflow.com/comment/38602058
score: 0
has comment: http://stackoverflow.com/comment/38482543
has comment: http://stackoverflow.com/comment/38605367
type: Answer
has comment: http://stackoverflow.com/comment/38473377
answers question: http://stackoverflow.com/q/24782984

http://stackoverflow.com/comment/38655667
type: AnswerComment
type: Comment
has text: It dosent work . If i change the onchange bit in the drop down to valueChange(). only the subtotal changes
comment on: http://stackoverflow.com/a/24877304
score: 0

http://stackoverflow.com/comment/38451239
type: AnswerComment
has text: Any idea why the dates on x-axis of the second graph not being styled like the first one?
type: Comment
comment on: http://stackoverflow.com/a/24773956
score: 0

http://stackoverflow.com/comment/38621590
comment on: http://stackoverflow.com/q/24867731
score: 0
has text: Demos are extremely helpful, though. As you know, it's hard to say much without seeing the larger context. Sometimes you have to write a test to find a bug.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24765354
downvote count: 0
has comment: http://stackoverflow.com/comment/38428315
has comment: http://stackoverflow.com/comment/38427501
has comment: http://stackoverflow.com/comment/38428079
type: Answer
has body: You are not defining a body in the code snippet you posted, more importantly, when the script in the script tag is evaluated, there doesn't exist a body tag (that it knows of) try this: Note: I am not a html/js expert and I hope if I am wrong, someone will correct me. The behavior as a browser opens an html file is that it reads in the file from top to bottom, so when it gets to your script, you ask to select the body tag (and append etc etc) but there is no body tag that it has encountered. So the fix here is to not only add the body tag (so it exists), but also place the script within (or after) the body tag (so the computer is aware of it by the time it is evaluating your script).
has comment: http://stackoverflow.com/comment/38427238
score: 2
has comment: http://stackoverflow.com/comment/38427635
upvote count: 2
answers question: http://stackoverflow.com/q/24765194
has comment: http://stackoverflow.com/comment/38427900
has comment: http://stackoverflow.com/comment/38427777

http://stackoverflow.com/q/24795404
score: 0
has title: d3 text all over the place and not in the right places
answer count: 1
has comment: http://stackoverflow.com/comment/38670236
has comment: http://stackoverflow.com/comment/38509842
accepted answer: http://stackoverflow.com/a/24894813
has body: I'm trying to build a linechart based off of the example at http://bl.ocks.org/mbostock/3884955. I'm not using temperatures but rather value levels from 0-1 that I call sentiments. I'm not using a tsv file either, but rather rendering JSON in real time through an AJAX call where my data object is an array with objects in it: [{date: '20140716', ESPN.com: 0.4, SI.com: 0.5})] There are typically multiple dates in an array and at least 6-7 websites (they're included in every object). The code looks like this: function renderHistoricalData(array) { var data = array; var margin = {top: 20, right: 80, bottom: 30, left: 50}, width = 1200 - margin.left - margin.right, height = 450 - margin.top - margin.bottom; var parseDate = d3.time.format("%Y%m%d").parse; var x = d3.time.scale() .range([0, width]); var y = d3.scale.linear() .range([height, 0]); var color = d3.scale.category10(); var xAxis = d3.svg.axis() .scale(x) .orient("bottom"); var yAxis = d3.svg.axis() .scale(y) .orient("left"); var line = d3.svg.line() .interpolate("basis") .defined(function(d) { return d.y!=0; }) .x(function(d) { return x(d.date); }) .y(function(d) { return y(d.sentiment); }); var svg = d3.select("#historical_chart").append("svg") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom) .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); data.forEach(function(d) { color.domain(d3.keys(data[0]).filter(function(key) { return key !== "date"; })); d.date = parseDate(d.date); var sites = color.domain().map(function(name) { return { name: name, values: data.map(function(d) { return {date: d.date, sentiment: +d[name]}; }) }; }); x.domain(d3.extent(data, function(d) { return d.date; })); y.domain([ d3.min(sites, function(c) { return d3.min(c.values, function(v) { return v.sentiment; }); }), d3.max(sites, function(c) { return d3.max(c.values, function(v) { return v.sentiment; }); }) ]); svg.append("g") .attr("class", "x axis")…
tagged with: d3.js
has comment: http://stackoverflow.com/comment/38511702
has comment: http://stackoverflow.com/comment/38509812
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38671139
has comment: http://stackoverflow.com/comment/38490872
has comment: http://stackoverflow.com/comment/38632194
has comment: http://stackoverflow.com/comment/38509044
has comment: http://stackoverflow.com/comment/38670990
has comment: http://stackoverflow.com/comment/38665952
type: Question
has comment: http://stackoverflow.com/comment/38663416
has comment: http://stackoverflow.com/comment/38508481
has comment: http://stackoverflow.com/comment/38510423
has comment: http://stackoverflow.com/comment/38633503
has answer: http://stackoverflow.com/a/24894813
has comment: http://stackoverflow.com/comment/38510200
tagged with: javascript
has comment: http://stackoverflow.com/comment/38510488

http://stackoverflow.com/a/24754224
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/24754107
downvote count: 0
score: 1
has body: You are passing the return value of this.animate(bottom) to setTimeout. The animate function doesn't have a return statement, so it returns undefined. The effects of the function happen immediately (because you are calling it) and then setTimeout does nothing. Pass a function to setTimeout instead. var self = this; var callback = function () { self.animate(bottom); }; setTimeout(callback, 20);

http://stackoverflow.com/comment/38422192
type: Comment
has text: The question states that this method has already been used and something using ng-option is desired (if possible.)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24762145

http://stackoverflow.com/comment/38480821
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24793408
has text: You need to call `slidShow()`
score: 0

http://stackoverflow.com/comment/38538331
type: Comment
type: QuestionComment
has text: Woudlnt a simple `npm install` have been enough? I´m not sure right now if yeoman already installs all dependencies, but i dont think so. But if generator-karma was not within the package.json before, then its a fault of the used generator...
score: 0
comment on: http://stackoverflow.com/q/24819781

http://stackoverflow.com/a/46587564
upvote count: 18
has body: ChartJS 2.6 supports data reference replacement (see Note in update(config) documentation). So when you have your Chart, you could basically just do this: myChart.data.labels = ['1am', '2am', '3am', '4am']; myChart.data.datasets[0].data = [0, 12, 35, 36]; myChart.update(); It doesn't do the animation you'd get from adding points, but existing points on the graph will be animated.
downvote count: 0
score: 18
answers question: http://stackoverflow.com/q/24785713
type: Answer

http://stackoverflow.com/comment/38528180
comment on: http://stackoverflow.com/a/24818716
type: Comment
type: AnswerComment
has text: Can you explain the usage of `as` and `for`?
score: 0

http://stackoverflow.com/comment/38464343
comment on: http://stackoverflow.com/q/24784225
score: 0
type: Comment
type: QuestionComment
has text: You can specify your own colours or colour scale.

http://stackoverflow.com/a/40138485
downvote count: 0
score: 21
answers question: http://stackoverflow.com/q/24758817
has comment: http://stackoverflow.com/comment/80377174
upvote count: 21
has body: I found that var number = 49.9712; number.toLocaleString( { minimumFractionDigits: 4 }) gave the result of "49.971" In order to actually get the 4 decimal place digits, I did this: number.toLocaleString(undefined, { minimumFractionDigits: 4 }) Also filling in a country code worked: number.toLocaleString('en-US', { minimumFractionDigits: 4 }) In both cases I got 49.9712 for the answer.
type: Answer

http://stackoverflow.com/a/61428331
type: Answer
has body: Simple edit for 2020: This worked for me. Change the chart to global by making it window owned (Change the declaration from var myChart to window myChart) Check whether the chart variable is already initialized as Chart, if so, destroy it and create a new one, even you can create another one on the same name. Below is the code: if(window.myChart instanceof Chart) { window.myChart.destroy(); } var ctx = document.getElementById('myChart').getContext("2d"); Hope it works!
upvote count: 4
downvote count: 0
score: 4
answers question: http://stackoverflow.com/q/24815851

http://stackoverflow.com/comment/38474256
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24773674
has text: @user3814247, localStorage (rather than sessionStorage) may do what you want. The code is long but can be found here: https://developer.mozilla.org/en/docs/Web/Guide/API/DOM/Storage#localStorage
score: 0

http://stackoverflow.com/comment/38548316
has text: Is `.execute()` asynchronous? If so, you should pass the flag to the callback, not try to use it in a global variable. `.bind()` will allow you to pass additional arguments beyond what `.execute()` would normally send to it.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24828537
score: 0

http://stackoverflow.com/comment/38557670
type: QuestionComment
has text: Yes I would be very happy with that! I'm not sure how to get there from the array of three objects I am starting with.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24833900

http://stackoverflow.com/comment/38521753
score: 1
type: AnswerComment
has text: @Anon512 I tried again with the exact same code, and it still works for me. Be sure to put your javascript at the end of your HTML, between ` ` tags and before the ` ` tag. If your ` ` tags are in the head or before the HTML has been rendered, the JS code will not be able to find the menu elements. If you really want to put your Javascript in the ` `, you can see this question: http://stackoverflow.com/questions/11936816/call-a-function-after-complete-page-load
type: Comment
comment on: http://stackoverflow.com/a/24811368

http://stackoverflow.com/a/24809091
type: Answer
downvote count: 0
score: 1
has body: Soon after I posted this question, I came across this link Dynamically created ahref click event not working in firefox or safari? which has the answer.
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24809025
answers question: http://stackoverflow.com/q/24809025
upvote count: 1

http://stackoverflow.com/comment/38663691
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24888533
has text: I cant change my JSON object because it is coming from the URL, and my updated my script file with this $(document).ready(function () { var data = "https://www.*************"; $.each(data.list, function (i, list) { console.log(list.productName); var option = ' ' + list.productName + ' '; $(option).appendTo('#product_details'); }); }); still no results is this script correct?

http://stackoverflow.com/comment/38454313
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24779525
has text: It's `SASS`but I think the problem is merely in jquery I need something to add height to the outer `div` when I show the `display:none;` one.
score: 0

http://stackoverflow.com/a/24771019
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/24770887
type: Answer
has comment: http://stackoverflow.com/comment/38438193
has body: JSON is text, so if you really do have text like: var s = '[{XXX:"2",YYY:"3",ZZZ:"4"},{XXX:"5",YYY:"6",ZZZ:"7"},{XXX:"1",YYY:"2",ZZZ:"3"}]'; then you can remove the YYYs using string replace, something like: s.replace(/YYY[^,}]+,/g,''); // [{XXX:"2",ZZZ:"4"},{XXX:"5",ZZZ:"7"},{XXX:"1",ZZZ:"3"}] You may need to account for YYY at the start or end of the string too. If you have an object that is created by an object literal, then use one of the other answers.
score: 1

http://stackoverflow.com/q/24794976
has comment: http://stackoverflow.com/comment/38483764
favorite count: 0
type: UnansweredQuestion
tagged with: datepicker
has comment: http://stackoverflow.com/comment/38483675
downvote count: 1
type: Question
has body: I know that if we need to display the Date picker in HTML page we have to use Javascript. If the Javascript is disabled in the web browser how can i display the date picker. Can you help me to solve this problem..? Thanks in advance.
has comment: http://stackoverflow.com/comment/38484737
score: -1
has answer: http://stackoverflow.com/a/24795073
has title: Javascript Datepicker issue in browser
upvote count: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/24882903
answers question: http://stackoverflow.com/q/24881840
has comment: http://stackoverflow.com/comment/38702111
has comment: http://stackoverflow.com/comment/38701281
has comment: http://stackoverflow.com/comment/38701988
has comment: http://stackoverflow.com/comment/38700919
score: 0
type: Answer
has body: Your dataObj model needs to match your PaymentModel e.g: If PaymentModel looks like this: public class PaymentModel { var int Id{get; set;} var string Description{get; set;} } Then your javascript should look something like this: // create an object that represents PaymentModel var dataObj = {Id: $('myId').val(), Description: $('#MyDescription').val()}; $.ajax({ url: url, type: "POST", data: JSON.stringify(dataObj)
has comment: http://stackoverflow.com/comment/38702331
has comment: http://stackoverflow.com/comment/38703228

http://stackoverflow.com/comment/38591803
has text: Why did you suggest using `localStorage`? I think it isn't neccessary for this case and might polute the storage with no reason.
comment on: http://stackoverflow.com/a/24852507
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/24815225
score: 1
answers question: http://stackoverflow.com/q/24815126
upvote count: 1
has body: Problem is in the selector creation. You are using the index of the for loop, not the array element that matches that index. Also redundant to loop over every checkbox on each pass of the loop of new array This should work for(var i = 1; i &lt; itemArr.length; i++) { $(".cb[rel="+ itemArr[i] +"]").prop('checked', true); }
has comment: http://stackoverflow.com/comment/38548771
has comment: http://stackoverflow.com/comment/38549606
downvote count: 0
has comment: http://stackoverflow.com/comment/38547399
type: Answer
has comment: http://stackoverflow.com/comment/38549851

http://stackoverflow.com/comment/38607664
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24860293
score: 0
has text: @SauliusAntanavicius: see my answer and the jsFiddle that goes with it (http://jsfiddle.net/KooiInc/PZKZ9/). You *can* stringify it.

http://stackoverflow.com/a/24789725
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38478292
accepted answer of: http://stackoverflow.com/q/24789111
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38478772
answers question: http://stackoverflow.com/q/24789111
type: Answer
downvote count: 0
has body: I make the assumption that you could use jQuery: <input type="hidden" name="date" id="date" value="<?php echo date;?>" /> Type And then this is a simple Javascript function that submits the form, and depending on what you choose, the date is changed in the form before it is submitted: function buildLink(date) { $('#date').val(date); $('form').submit(); }

http://stackoverflow.com/q/24750384
has comment: http://stackoverflow.com/comment/38403962
has body: I'm having some trouble implementing viewport marker management with the google maps API. The documentation I'm following can be found here: https://developers.google.com/maps/articles/toomanymarkers#viewportmarkermanagement The section I'm working with is titled "Viewport Marker Management." I can follow the code up until this point: function showMarkers() { var bounds = map.getBounds(); // Call you server with ajax passing it the bounds // In the ajax callback delete the current markers and add new markers } I have no idea what code I need to use to accomplish the instructions on the commented out lines. I'm currently pulling marker information from a mySQL database if that matters. I'm not sure if I'm missing something or if the google documentation just ins't comprehensive enough. Any help in appreciated!
favorite count: 0
has answer: http://stackoverflow.com/a/24786129
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38446821
score: 2
upvote count: 3
has title: Google maps api ajax viewport marker management
downvote count: 1
has comment: http://stackoverflow.com/comment/38433408
type: Question
tagged with: google-maps
tagged with: javascript
tagged with: ajax
tagged with: google-maps-api-3
answer count: 1

http://stackoverflow.com/comment/38573511
type: Comment
score: 2
comment on: http://stackoverflow.com/q/24843015
type: QuestionComment
has text: ps, also since you use jquery: `.attr("name")` DOC: http://api.jquery.com/attr/

http://stackoverflow.com/a/24767076
downvote count: 0
answers question: http://stackoverflow.com/q/24767014
has comment: http://stackoverflow.com/comment/38430703
has body: You are overwriting the field's name: :name =&gt; "cc_name" That's the reason why it is sent outside of the array. Try removing the :name assigning: &lt;%= f.text_field :cc_name, class: "input-lg" %&gt; and &lt;%= f.text_field :ship_name, class: "input-lg" %&gt;
accepted answer of: http://stackoverflow.com/q/24767014
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38431347
has comment: http://stackoverflow.com/comment/38430737
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/38430609
has comment: http://stackoverflow.com/comment/38431320

http://stackoverflow.com/q/24815131
linked to: http://stackoverflow.com/q/15025979
has body: My issue is that href retains scroll position, but I would like to have my links go to the top of the page; my current solution doesn't feel very DRY. HTML: &lt;a href="" ng-click="goToPage()"&gt;&lt;/a&gt; JS: app.controller("SomeController", function(..., $location) { //this ends up being repeated in many controllers $scope.goToPage = function() { $location.path('/some/page'); window.scrollTo(0,0); } }); Is there a way to make a directive like this? &lt;a href="" ng-link="'some/page'"&gt; Now there should be no function explicitly defined in the controllers themselves. According to this: Can I make a function available in every controller in angular? An alternative solution is that I can put a function inside $rootScope, and use it like this: HTML: &lt;a href="" ng-click="goToPage('some/page')"&gt;&lt;/a&gt; JS: app.run( function(..., $location) { $rootScope.goToPage = function(url) { $location.path(url); window.scrollTo(0,0); } }); now I don't need to repeat the function inside each controller, but I thought this is a good place to avoid the $rootScope and learn about making directives (services?) if possible. Thanks!
upvote count: 1
type: AnsweredQuestion
score: 1
has title: Standard way to link and scroll to top in Angular?
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/24815206
accepted answer: http://stackoverflow.com/a/24815206
tagged with: angularjs

http://stackoverflow.com/comment/38516450
has text: Is there no Javascript technique? I only just started it and I thought this was a simple starter!
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24812521

http://stackoverflow.com/comment/38589179
type: AnswerComment
comment on: http://stackoverflow.com/a/24845020
type: Comment
has text: Thanks! `Blob.slice` did the trick. I even do not need to manually abort file loading that way.
score: 0

http://stackoverflow.com/a/24938565
has body: I got this problem resolved by finding, and checking out the Tic Tac Toe example which uses Google+ Sign-in method, to connect to the app's Google Cloud EndPoint, and then as the example shows, call a method that requires authorization. The documentation, using the Tic Tac Toe example threw me off, as it was using "plain OAuth", compared to the Tic Tac Toe example in Github, which was probably updated to use Google+ signin. Anyway, I found it pretty smooth and simple actually. When the Google+ Sign-in callback executes with a successful authentication, you can now load your api and go from there. For example, function signinCallback(authResult) { if (authResult['status']['signed_in']) { // Update the app to reflect a signed in user // Hide the sign-in button now that the user is authorized, for example: document.getElementById('signinButton').setAttribute('style', 'display: none'); // we are now authenticated at this point, and we can load our // Google Cloud Endpoints gapi.client.load(apiName, apiVersion, apiCallback, apiRoot); } else { // Update the app to reflect a signed out user // Possible error values: // "user_signed_out" - User is signed-out // "access_denied" - User denied access to your app // "immediate_failed" - Could not automatically log in the user console.log('Sign-in state: ' + authResult['error']); } } After that, when my Google Cloud EndPoint API method gets called, it now receives a user object instead of being null as before. /** * This inserts a new Payload object. * * @param payload The object to be added. * @return The object to be added. */ @ApiMethod(name = "insertPayload") public MapPackage insertPayload(Payload payload, User user) throws OAuthRequestException { // Implement this function LOG.info("Calling insertPayload method"); if (user == null) { LOG.warning("User is null!"); } else { //YEHEEY!!!! LOG.warning("User ID:" + user.getUserId()); LOG.warning("User AuthDomain:" + user.getAuthDomain()); LOG.warning("User nickname:" +user.getNi…
accepted answer of: http://stackoverflow.com/q/24904239
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/24904239
score: 1

http://stackoverflow.com/comment/38479216
has text: @WilfredoP, Please see my jsFiddle
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24792387

http://stackoverflow.com/q/24801304
upvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/24801378
tagged with: regex
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24801385
downvote count: 0
has answer: http://stackoverflow.com/a/24801385
score: 1
has answer: http://stackoverflow.com/a/24801405
accepted answer: http://stackoverflow.com/a/24801405
type: Question
has body: Need your help in modifying the below regex I have. Requirement Should match the given string with Alpharumeric and a dot(.). Note that dot (.) is mandatory and it should not comes in the first or at last. Numeric is not mandatory. Valid Inputs abc.xyz abc123.xyz123 a.1 Invalid Values .abc.xyz 123.123 abcd a1.s.d.3.4 asd123. a2....b2 Note: First character should be a alphabet and only single dot should appear. My regex (not working for all the scenario) /^[A-Za-z][A-Za-z0-9\.]*$/ Thanks for any inputs. Thanks to all the users who have provided the answers. Unfortunately I have to make only one as 'Accepted'.
tagged with: javascript
answer count: 3
has title: Regex - Validate Alpharumeric with dot (mandatory)

http://stackoverflow.com/q/24818188
has title: How to consume Json Data in Jquery Ajax
tagged with: paypal
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38527067
has answer: http://stackoverflow.com/a/24818446
has answer: http://stackoverflow.com/a/24821486
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
type: Question
has body: I have a URL, which gives response on browser: https://api.sandbox.paypal.com/retail/merchant/v1/locations It gives: { "errorCode": 600031, "message": "Missing access token", "developerMessage": "You must provide an access token when calling this API. It can be passed as either a header of the form \"Authorization: Bearer \" or as a query parameter called access_token.", "errorType": "oauth/missing_access_token", "correlationId": "4de95cd8aa090" } I tried this: $.ajax({ url: "https://api.sandbox.paypal.com/retail/merchant/v1/locations", dataType: 'json', type: 'POST', success: function (data) { console.log(data); alert("success", data); }, error: function (data) { alert("fail", data); console.log(data); alert("Sorry..Please try again later"); }, }); But I am not getting the same response as I am getting on browser. I am getting error. Please check here http://jsfiddle.net/ajitksharma/wehGy/ However while debugging on Browser console I got the error: XMLHttpRequest cannot load https://api.sandbox.paypal.com/retail/merchant/v1/locations. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
tagged with: javascript
tagged with: jquery
tagged with: ajax
accepted answer: http://stackoverflow.com/a/24818446
score: 0
linked to: http://stackoverflow.com/q/3839966
answer count: 3
has answer: http://stackoverflow.com/a/24818339
favorite count: 0
possible better answer: http://stackoverflow.com/a/24818339
has comment: http://stackoverflow.com/comment/38527097
has comment: http://stackoverflow.com/comment/38527212

http://stackoverflow.com/q/24898796
has answer: http://stackoverflow.com/a/24899344
has comment: http://stackoverflow.com/comment/38680149
type: AnsweredQuestion
score: 0
possible better answer: http://stackoverflow.com/a/25718155
type: Question
has comment: http://stackoverflow.com/comment/38680263
has comment: http://stackoverflow.com/comment/38679959
has answer: http://stackoverflow.com/a/25718155
answer count: 2
tagged with: google-maps
accepted answer: http://stackoverflow.com/a/24899344
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38680011
linked to: http://stackoverflow.com/q/14757583
has title: Using fancyBox inside InfoBubble.js with Google Maps API
has body: I can't seem to get fancyBox to load inside the InfoBubble (i.e., my info window). I have a button inside the InfoBubble, which when clicked, should display an image using fancyBox. I have come across previous questions here and few others, but none of those solutions worked for me. The way I have it set up is as follows. In index.html: In map.js: infoBubble = new InfoBubble({ maxWidth: 200, content: ' ', position: new google.maps.LatLng(-34.397, 150.644) }); google.maps.event.addListener(marker, 'click', function() { infoBubble.open(map, marker); By referencing the CSS class .dialog, shouldn't it work because the script is already there in the index.html page? It doesn't work. Instead I am just redirected to the image in a new page.
favorite count: 0
upvote count: 1
downvote count: 1

http://stackoverflow.com/comment/38554681
has text: Are you referring the the checkbox you have the `ngModel` bound to? You want it to be checked if the value of `permission.show` is true, or do you have other elements that are dependant on the model's value? Perhaps you could post some more code so I can get a better view of what you are tring to achieve.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/24832365
type: Comment

http://stackoverflow.com/q/24852669
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/38592151
has comment: http://stackoverflow.com/comment/38592215
answer count: 1
has title: Updating JS Array in angular $scope
has comment: http://stackoverflow.com/comment/38592977
has answer: http://stackoverflow.com/a/24852924
has comment: http://stackoverflow.com/comment/38592503
favorite count: 0
has comment: http://stackoverflow.com/comment/38592427
has comment: http://stackoverflow.com/comment/38592276
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38592383
downvote count: 1
has body: I am trying to update array inside $scope. For eaxample $scope.data = [{detail:{name: "...", cred:"...."}, date:"current date"},...]; $scope.update = function(){ $scope.data[0].date = "new date"; } But the value is not updating. Am I doing something wrong?
score: -1
has comment: http://stackoverflow.com/comment/38592093
type: Question
upvote count: 0

stream
tags question: http://stackoverflow.com/q/24771780
tags question: http://stackoverflow.com/q/24812386
tags question: http://stackoverflow.com/q/24898337
type: Tag
tag name: stream
tags question: http://stackoverflow.com/q/24807797

http://stackoverflow.com/q/24826774
has comment: http://stackoverflow.com/comment/38546287
has comment: http://stackoverflow.com/comment/38543378
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/38543579
has comment: http://stackoverflow.com/comment/38543570
downvote count: 1
has comment: http://stackoverflow.com/comment/38546522
type: Question
has comment: http://stackoverflow.com/comment/38543931
has body: I am trying to stop this drop down box from changing size whenever it has an option in it that is longer than the set 200px width of the dropdown box. The options are just being loaded by a json file - the issue can be seen below in images: The list loads a selection of game names, when the list loads if there is an option that isn't longer than the dropdown menu it is fine and is the correct width as shown by the red line: http://postimg.org/image/dxx0u0wup/ But as soon as it has an option in it that is longer than the dropdown it results in this : (The red line indicates the end of a window but it is currently transparent so the form you see is simply a div centred in a window) http://postimg.org/image/kbtf1xs1d/full/ you can see the css I used, firstly I tried setting different widths but none of them changed anything then I thought it could be something to do with overflow but that didn't work either HTML for the dropdown Games: then the JS that fills it function loadGames() { console.log("Getting games list"); $.getJSON("games.json", function (games) { console.log(games); var gamesSelect = document.getElementById("gamesSelect"); for (var i = 0; i < games.array.length; i++) { var opt = games.array[i]; var el = document.createElement("option"); el.textContent = opt; el.value = opt; el.width = "200"; gamesSelect.appendChild(el); } }); } some people are saying its a duplicate, it is but only because the answers did not work for me - it is the same sort of issue but none were working so I made this
has comment: http://stackoverflow.com/comment/38543347
has comment: http://stackoverflow.com/comment/38543296
linked to: http://stackoverflow.com/q/1702186
has answer: http://stackoverflow.com/a/24828165
has comment: http://stackoverflow.com/comment/38543316
has comment: http://stackoverflow.com/comment/38543125
has comment: http://stackoverflow.com/comment/38543846
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38543792
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38543226
tagged with: css
has comment: http://stackoverflow.com/comment/38543319
has title: CSS stop dropdown option changing size?
has comment: http://stackoverflow.com/comment/38543840
has comment: http://stackoverflow.com/comment/38543255
tagged with: overflow

http://stackoverflow.com/a/24937758
type: Answer
answers question: http://stackoverflow.com/q/24824456
has body: linemanjs is using grunt tasks for the minification, to avoid this you can simply check the application config and comment it if you don't want it to happen. FYI - I was not aware of grunt tasks at the time of question.
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24824456

http://stackoverflow.com/q/24888949
accepted answer: http://stackoverflow.com/a/24889179
linked to: http://stackoverflow.com/q/17613151
has comment: http://stackoverflow.com/comment/38661327
tagged with: asp.net-mvc-4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24889179
has comment: http://stackoverflow.com/comment/38661334
has comment: http://stackoverflow.com/comment/38661833
has title: Array is not passed to the controller from view MVC
type: Question
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/38662473
has comment: http://stackoverflow.com/comment/38661714
linked to: http://stackoverflow.com/q/5497093
tagged with: javascript
has body: In my model I have these properties, public string[] SelectedIDs {get; set;} public int BookId {get;set;} public int LanguageId {get;set;} In my view I have the following, @Html.HiddenFor(model =&gt; model.SelectedIDs ) @Html.HiddenFor(model =&gt; model.BookId ) @Html.HiddenFor(model =&gt; model.LanguageId ) Using a JavaScript array (SelectedItemIds) I am updating the SelectedIDs, $a("#SelectedIDs").val(SelectedItemIds.join()); alert($a("#SelectedIDs").val()); The alert successfully returning comma separated values. If I do a post to my action no problem, I am getting the SelectedIDs as comma seperated. However my requirement was to populate the view in a dialog, However while passing I am always getting SelectedIDs as null. I tried with two of the following methods. Method 1: My action is: public ActionResult MyMethod1(MyModel model) { } And I used the action link as @Html.ActionLink("My Book", "MyMethod1", "BookOrder", new { @id = "SubmitBooks", @class = "subBook", data_dialog_id = "AddBookDialog", data_dialog_title = "Add Books", data_dialog_width = 800, data_dialog_height = 550 }) In this method I successfully get model.BookID as well as model.LanguageId, but model.SelectedIDs was null. Method 2: My action is: public ActionResult MyMethod2(string[] selectedItems, int bookId, int langId) { } And I used the action link as @Html.ActionLink("My Book", "MyMethod2", "BookOrder", new { @selectedItems= Model.SelectedIDs , @bookId= Model.BookId, @langId = Model.LanguageId }, new { @id = "SubmitBooks", @class = "subBook", data_dialog_id = "AddBookDialog", data_dialog_title = "Add Books", data_dialog_width = 800, data_dialog_height = 550 }) Here too I got both bookid and langId but no selectedItems, which is null.
score: 0
has comment: http://stackoverflow.com/comment/38661439
has comment: http://stackoverflow.com/comment/38661085
answer count: 1

http://stackoverflow.com/a/24819126
has comment: http://stackoverflow.com/comment/38529490
has comment: http://stackoverflow.com/comment/38529762
has body: U want to make this? http://jsfiddle.net/BuaC3/ .wrapper{padding:0} .content{width:100%;} .item{background:blue; margin:0 5px 5px;float:right; color:white; padding:30px; width:100px; list-style:none; display:inline-block;top:0; }
has comment: http://stackoverflow.com/comment/38528724
score: 0
answers question: http://stackoverflow.com/q/24818889
type: Answer

http://stackoverflow.com/q/24866059
tagged with: javascript
has comment: http://stackoverflow.com/comment/38646869
downvote count: 0
tagged with: templates
favorite count: 0
has body: In my application we are templating handlebars from client side(we are not templating from server side).So till now we used maintaining all templated inside of the html file using script tag like in the following way. &lt;script id="selectdropdownTpl_mobile" type="text/x-handlebars-template"&gt; &lt;option value="{{optValue}}" label="{{name}}"&gt;{{name}}&lt;/option&gt; &lt;/script&gt; Whenever I want template, I am just compiling and appending compiled result to dom just like following way var alertCompilation= Handlebars.compile(document.getElementById("selectdropdownTpl_mobile").innerHTML) alertCompilation({"optValue":"test","name":"firstApp}); Working fine,but what we are thinking to separate all handlebar templates into another file.so it's easy to maintain html file. Regarding this,I thinking to move all the templates into .js file inside of the file just creating global variable,it is object in the following way. //fileName test.js var templates={ "selectdropdownTpl_mobile":"template code" } whenever I want, I can access template code like in the following way. var alertCompilation= Handlebars.compile(templates["selectdropdownTpl_mobile"]); alertCompilation({"optValue":"test","name":"firstApp}); This way also working fine,What I want to know is this good way or not.If it is not good way How shell do this. I heard about .hbs file, basically it contains pre-compiler template.It's usefull If I template from server side but in my case templating happening in client side itself. can anyone suggest me,which way is better.
type: UnansweredQuestion
tagged with: handlebars.js
has title: How many ways are there to maintain handlebars template in client side
answer count: 0
score: 1
tagged with: client-side-templating
upvote count: 1
type: Question

http://stackoverflow.com/comment/38498285
comment on: http://stackoverflow.com/a/24802730
has text: and what if I use keyboard to access it. I'm amazed at how many `click` answers there are
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/24867509
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: Because there is no fixed file format for Javascript, or its headers, what you want is (practically) impossible in a generic app. You can however of course attempt the same thing by hand. On a *nix machine (including Macs) you have the very powerful find command, which allows you to scan for specific files and performing actions on them. For example: find -name "*.js" -exec head {} \; This will find all JS files in a directory tree, and run the head command on them, which dumps by default the first 10 lines of the file. This should in general show more than enough license information. Now to find out which JS files are actually included you can use wget with the recursive flag. This also circumvents the common CMS problem, because it retrieves the site as the browser sees it, not how it is internally organized. You can mirror a site to a local folder with: wget -r http://www.mydomain.tld/ Don't do this on Stack Overflow, you'll blow up your machine. But on a reasonably sized site, combining these 2 commands are the closest you're gonna get to your intended result without writing hundreds of lines of code. Using system(...) you can also execute both these commands from within PHP, allowing you to execute them remotely on a *nix server if needed.
answers question: http://stackoverflow.com/q/24825630

http://stackoverflow.com/q/24906036
has body: I'm wondering is there any way to change valueSuffix of tooltip after chart is rendered? I'm trying to do switch from metric units to imperial, so I need to change data, yAxis label and tooltip valueSuffix. It was simple for first two, but I didn't find anything about third, neither in docs (like yAxis update(..)), neither in google. Tried this: $('#sp_chart').highcharts().tooltip.options.valueSuffix = 'aaaa'; in console.log($('#sp_chart').highcharts().tooltip.options.valueSuffix) it looks good, but didn't works when tooltip shows.
downvote count: 0
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/24906850
has title: How to change tooltip valueSuffix after chart is rendered?
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: highcharts
has answer: http://stackoverflow.com/a/24906850
tagged with: javascript

http://stackoverflow.com/comment/38412700
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24757384
has text: Thanks, this is exactly what I was looking for. It looks like the source for the download page has no inputs, so I'll have to play around with the example you gave to figure out how to make the request, but this is a great starting point!

http://stackoverflow.com/comment/38629670
type: QuestionComment
comment on: http://stackoverflow.com/q/24871690
score: 0
has text: Are you sure performance would be so bad with three.js? Have you tried it? I think if you are targeting modern phones that you could probably get acceptable results.
type: Comment

http://stackoverflow.com/q/24793990
has answer: http://stackoverflow.com/a/24794144
tagged with: css
has body: i don't really know how to insert the src information of a html tag into the css3 content tag. for example: get &lt;video id="video" width="100%" height="100%" controls&gt; &lt;source src="63f01c0300d2848a.webm" type="video/webm"&gt; &lt;p&gt; Your browser doesn't support WebM video.&lt;/p&gt; &lt;/video&gt; and insert it in &lt;style type="text/css"&gt; #videoname:after{content:"";} &lt;/style&gt; i know how to start, but i have not enought knowledge about js.. function notEmpty(){ var srcname = document.getElementById("video").src; if(srcname.value != "") else ??insert ("no video selected")?? } Thank you for helping me!
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38481954
type: Question
has comment: http://stackoverflow.com/comment/38482005
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24794144
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: get src information and insert it in css3 content - tag with javascript

http://stackoverflow.com/q/24860962
tagged with: http://stackoverflow.com/tag/html
tagged with: css
upvote count: 0
type: UnansweredQuestion
type: Question
score: -2
has title: How Can I display Images for a page like Vagabond do?
has answer: http://stackoverflow.com/a/24861002
tagged with: javascript
has answer: http://stackoverflow.com/a/24861084
answer count: 2
downvote count: 2
has body: I have created a page: http://demo.infotyke.com/uffshop/home/ Now I want to display images in background for MEN and WOMEN just like http://vagabond.com/ Please help.
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/40544512
type: AnswerComment
has text: Thank you kindly, this helps solve my problem...I guess I over complicated the whole thing.
comment on: http://stackoverflow.com/a/24845464
type: Comment
score: 0

http://stackoverflow.com/q/24870445
tagged with: ember-data
tagged with: javascript
tagged with: routes
score: 0
has title: understanding emberjs model initialisation and dependency
answer count: 1
has answer: http://stackoverflow.com/a/24871414
tagged with: ember.js
type: AnsweredQuestion
tagged with: models
has body: I'm getting ember right now... means awesome and awful times both while learning and trying... Anyway I really hope someone can help understanding this: My route-map is like that: App.Router.map(function() { this.resource("login"); this.resource("institute", { path: '/institute/:institute.id/' }, function(){ this.resource("all-cases", function(){ }); }); }); In my loginRoute, I load the model institutes with findAll which results in a array of institutes, thats why the controller is a ArrayController. Once the authentication was successful or verified I load the models via store from the API. They are being displayed by the view and I use them to trigger the action selectInsitute and transition to all-cases. App.LoginRoute = Ember.Route.extend({ // login controller owns the institutes model: function(){ return this.store.findAll('institute'); }, actions: { // this hook is called if authentication fails sessionAuthenticationFailed: function(message) { [...] }, // this hook is called once the login was successfull sessionAuthenticationSucceeded: function(){ this.controller.sessionAuthenticationSucceeded(); } } }); App.LoginController = Ember.ArrayController.extend(SimpleAuth.LoginControllerMixin,{ authenticator: 'authenticator:custom', // authentication is done, now change some UI and load some models sessionAuthenticationSucceeded: function (){ [...] this.set('content', this.store.findAll('institute')); }, actions : { selectInsitute : function(institute) { this.transitionToRoute('all-cases.index', institute); } } }); My all-cases Route looks like this. EDIT:I put the model definition as proposed by Steve H. . Does the need actually do anything? It doesn't feel like it helps at all. App.AllCasesRoute = Ember.Route.extend(SimpleAuth.AuthenticatedRouteMixin, { model: function(params, transition, queryParams){ var instModel = this.modelFor('institute'); console.debug(instModel); var cases = instModel.get('cases'); console.debug(cases); return cases; } }); App.AllCasesCon…
accepted answer: http://stackoverflow.com/a/24871414
type: Question

http://stackoverflow.com/comment/38616282
type: AnswerComment
comment on: http://stackoverflow.com/a/24863289
score: 0
type: Comment
has text: You need to check your rails server console to know the reason of 404 and for $, you need to include jquery file in your application.js

http://stackoverflow.com/comment/38612376
score: 0
type: Comment
has text: Thanks, but still it only works when I set `AutoPostBack="true"` for my `radLinePanel` and `radCreditPanel` controls
comment on: http://stackoverflow.com/a/24863188
type: AnswerComment

http://stackoverflow.com/comment/38444223
type: Comment
comment on: http://stackoverflow.com/a/24772982
score: 0
has text: @Sweetz:But how? Can you please show me how to append?
type: AnswerComment

http://stackoverflow.com/q/24857451
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/38601791
has title: freewall using ajax to append content and show [object Object]
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/38601673
has comment: http://stackoverflow.com/comment/38601644
has comment: http://stackoverflow.com/comment/38601598
has comment: http://stackoverflow.com/comment/38601626
has answer: http://stackoverflow.com/a/24857520
has body: I have a problem (noted above) with my code: $(function() { var wall = new freewall("#freewall"); wall.reset({ selector: '.brick', animate: true, cellW: 160, cellH: 160, delay: 50, onResize: function() { wall.fitWidth(); } }); wall.fitWidth(); var content = $.ajax({ url:"contents/home.html", type: "GET", dataType:"json" }); var temp = '&lt;div class="brick {size}"&gt;' + '&lt;div class="covers"&gt;' + content + '&lt;/div&gt;' + '&lt;/div&gt;'; var size = "size33 size32 size31 size23 size22 size21 size13 size12 size11".split(" "); $(".add-more").click(function() { var html = ""; for (var i = 0; i &lt; 5; ++i) { html += temp.replace('{size}', size[size.length * Math.random() &lt;&lt; 0]) /*.replace('{color}', colour[colour.length * Math.random() &lt;&lt; 0])*/; } wall.appendBlock(html); }); }); I tried to load the ajax content but it shows [object Object]. Can anyone help?
has comment: http://stackoverflow.com/comment/38601779

http://stackoverflow.com/comment/38695976
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24906871
type: Comment
has text: agree with you, but I put "var is" as a global variable while i was debugging, and I forgot it there lol

http://stackoverflow.com/q/24839405
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
tagged with: php
type: AnsweredQuestion
upvote count: 2
downvote count: 2
has answer: http://stackoverflow.com/a/24839518
has body: I've searched a lot for this but the answers that I find doesn't work but I think that the problem is mine. JavaScript: $.ajax({ type: 'POST', url: url, data: data, dataType: 'json', success: function(response) { if(response.status == true) { alert('ok'); } else { alert('error'); } }, error: function(xhr, desc, err) { console.log(xhr); console.log("Details: " + desc + "\nError:" + err); } }); PHP if(User::addFavLater($id, $user, 'favs')) { $result = array("status" =&gt; true); } else { $result = array("status" =&gt; false); } header('Content-type: application/json'); echo json_encode($result); So, this is an excerpt of code that I have and I think can you realising. I want PHP to send a JSON response into JavaScript but this is not happening and JavaScript gives me this error: parsererror / SyntaxError: Unexpected token &lt; I'm using the 2.1.1 version of JQuery. P.S.: Sorry for my english.
type: Question
has title: parsererror / SyntaxError: Unexpected token <
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/24839518

http://stackoverflow.com/comment/38611457
type: QuestionComment
has text: Why exactly would you want to spy on providers? And could you show the code that you have succeeded in spying on module?
comment on: http://stackoverflow.com/q/24832685
score: 1
type: Comment

http://stackoverflow.com/comment/38448298
type: Comment
has text: Thanks for your fast answer, but as I said to @zey it still doesn't work. The js script stops working at the point I try to do it like this. Is it because I create the ASPxComboBox hardcoded?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24776280

http://stackoverflow.com/comment/38476005
comment on: http://stackoverflow.com/q/24789981
has text: Can I ask why you're putting a `setTimeout` to start with? Are you trying to wait for the dom to be ready? A better method would be `$(document).ready(function()...);`
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38539687
score: 0
type: Comment
has text: The question you reference was "just for practice" they said. Calling a service every second, per user, is a really bad idea. Maybe signal-R for comms server=>client instead?
type: QuestionComment
comment on: http://stackoverflow.com/q/24825055

http://stackoverflow.com/comment/38401160
type: Comment
comment on: http://stackoverflow.com/a/24750981
has text: Pattern points to the files in my app not to the test files. I did try what you suggested however no luck. I was thinking maybe there is another option for setting the test file location?
type: AnswerComment
score: 0

http://stackoverflow.com/q/24835471
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
tagged with: php
has body: When you press the link text it is supposed to give you an random string from a file, which it does on first click. But second click nothing happens, I need to refresh page before execute it again.. Code: function randomName() { $names = file('layout/sub/names.txt', FILE_IGNORE_NEW_LINES); $array = array_rand($names); return $names[array_rand($names)]; } Pick random name
has answer: http://stackoverflow.com/a/24835695
type: Question
has title: Random string picker only execute once per page load
answer count: 1
has comment: http://stackoverflow.com/comment/38559760
tagged with: javascript

http://stackoverflow.com/comment/38464222
score: 0
has text: I might be wrong and it's a little off-topic, but if `feed` is [this modul](https://www.npmjs.org/package/feed-read), then first param should be string (url), which is not `urls[j]`, but `urls[j].url`? It has nothing to do with the problem itself, Im just curious.
type: Comment
comment on: http://stackoverflow.com/a/24784593
type: AnswerComment

http://stackoverflow.com/comment/38663840
comment on: http://stackoverflow.com/a/24872237
score: 0
has text: The reason your account is locked (I'm guessing) is because 3 different people have voted to close the question. Up and down votes are part of the process! I don't have any power or inclination to lock your account. You said *i just answered the question* when your question was *When I run this script it gives me an myupdatedproddate is undefined error. Why am I getting this error?* and then told people to `upvote` and `accept` as the answer which is not correct no matter how it makes you feel!
type: AnswerComment
type: Comment

http://stackoverflow.com/a/24803310
score: 1
has body: You could use document.querySelectorAll and class expression to get all ids starting with (^) _login + ending in ($) facebook for this. Try: document.querySelectorAll('[id^="_login"][id$="facebook"]') Fiddle
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/24802773
downvote count: 0

google-oauth
type: Tag
tags question: http://stackoverflow.com/q/24833948
tag name: google-oauth

http://stackoverflow.com/comment/38642323
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24878887
type: Comment
has text: GR8. It is working. Thanks... I searched all over google but didnt get soln. For removing item I just have to do len-1.

http://stackoverflow.com/comment/38692528
type: QuestionComment
has text: @KemalFadillah, do you mean create a directive for `input` that is restricted to an element?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24905669

http://stackoverflow.com/comment/38430864
type: AnswerComment
has text: Thanks! Very weird with that w3 url, but OK.
type: Comment
comment on: http://stackoverflow.com/a/24767190
score: 0

http://stackoverflow.com/comment/38460971
comment on: http://stackoverflow.com/q/24777282
score: 0
type: Comment
has text: @user3821280 Try to use `$scope` instead of `this`. Try to see if it works without using the alias `fiche`. Try to remove the `type="submit"`. And as a side question: Should the redirection involve the server?
type: QuestionComment

http://stackoverflow.com/a/24814421
type: Answer
has body: If the function returns the value passed in, then there's really no point - the value of the external variable "obj" cannot be changed by the function in any case. It's not exactly correct to say that anything in JavaScript is "passed by reference". Object "values" are always references, and parameter passing is no exception. JavaScript is a strictly pass-by-value language; it's just that values that happen to be references to objects are, well, references to objects. So what you say in the opening of your question is correct: a copy of the reference to the object is passed into the function. The topic of parameter passing is one that's simple but complicated, and complicated not the least by the fact that the word "reference" appears in the technical "language theory" term "pass-by-reference". Now, in a situation where your function might, for some reason, decide that it needs to create a new object, then returning an object might make sense.
has comment: http://stackoverflow.com/comment/38520300
score: 3
has comment: http://stackoverflow.com/comment/38533333
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24814404
answers question: http://stackoverflow.com/q/24814404
upvote count: 3
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38520242
has comment: http://stackoverflow.com/comment/38521486
has comment: http://stackoverflow.com/comment/38520875

http://stackoverflow.com/a/24876129
answers question: http://stackoverflow.com/q/24876074
has body: you can use css or jquery or google to find out what to use. Heres a tutorial I found after a quick google. Its a good idea to do a bit of reseach before asking questions on here. http://www.paulund.co.uk/how-to-create-an-animated-scroll-to-top-with-jquery
score: 0
type: Answer

http://stackoverflow.com/q/24789061
has answer: http://stackoverflow.com/a/24789182
has comment: http://stackoverflow.com/comment/38472566
has title: Why is my JQuery AJAX function not working properly?
tagged with: php
accepted answer: http://stackoverflow.com/a/24789242
type: AnsweredQuestion
score: 0
type: Question
has comment: http://stackoverflow.com/comment/38472768
has comment: http://stackoverflow.com/comment/38472883
has answer: http://stackoverflow.com/a/24789274
tagged with: javascript
has body: Trying to insert a car image from one of my databases into my webpage get_new_car_pictures: $make = $_REQUEST['make']; $model = $_REQUEST['model']; $query = "SELECT * FROM database_new WHERE make = $make AND model = $model"; $car = $db-&gt;get_row($query); $img = $car['img_url']; echo "&lt;img src=".$img." /&gt;"; ajax function: function insertImageAJAX(){ return $.ajax({ type: 'GET', url: '/ajax/get_new_car_pictures.php', data: "model=" + params.model + "&amp;make=" + params.make, success: function(data){ $("#car-image".html(data)); } } }); car-image is the div where I want the image to appear I have tried to follow Ajax tutuorials online but for whatever reason, this is not working...
has comment: http://stackoverflow.com/comment/38475259
linked to: http://stackoverflow.com/q/377644
has comment: http://stackoverflow.com/comment/38473001
has comment: http://stackoverflow.com/comment/38472771
has comment: http://stackoverflow.com/comment/38472680
has comment: http://stackoverflow.com/comment/38472877
has comment: http://stackoverflow.com/comment/38472652
answer count: 3
possible better answer: http://stackoverflow.com/a/24789274
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/24789242

http://stackoverflow.com/a/24871081
has comment: http://stackoverflow.com/comment/38627483
score: 0
has body: There is no 'automagic' way of doing this, you'll just have to brute force it with a setInterval and place the letters in the element one at a time.
type: Answer
answers question: http://stackoverflow.com/q/24870804

http://stackoverflow.com/comment/38643444
comment on: http://stackoverflow.com/a/24879457
score: 0
type: AnswerComment
has text: Sorry I forgot to change that back before posting (I was experimenting with fixes and missed this). Even with consistent (e) usage the page still redirects. Anything else you see that may be getting in the way?
type: Comment

http://stackoverflow.com/comment/38674322
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24895652
has text: This is as expected. Object keys are considered unordered. Therefore any sequence is considered valid. If you want to retain sequence you must use an array, not an object. If you can't convince whoever sent you the json response to change this then there is nothing you can do.

http://stackoverflow.com/comment/38410283
comment on: http://stackoverflow.com/q/24756399
score: 0
type: Comment
type: QuestionComment
has text: The only real way to do that is to change the href in the anchors to not use hashes.

http://stackoverflow.com/comment/38397963
type: Comment
type: QuestionComment
score: 1
has text: And where is problem? Just make `var totalBidUnits` global (write `var totalBidUnits = 0;` before `$(statusData).each`) and use it after that
comment on: http://stackoverflow.com/q/24749619

http://stackoverflow.com/comment/38423134
type: QuestionComment
has text: It might be easier to use a timeout before fading in.
score: 0
comment on: http://stackoverflow.com/q/24761614
type: Comment

http://stackoverflow.com/comment/38507123
has text: @user3379926 I guess I just don't understand what you are doing exactly ;) I was assuming you just want to auto-save on every keypress? (which is quite often actually...). And save it only once each keypress, not every x (milli)seconds after a keypress? Because now, on each press, you are starting a new thread, which keeps on firing until you say it should stop... So imagine what would happen if someone hits a key once, then walks away to read the newspaper or whatever...
score: 0
comment on: http://stackoverflow.com/q/24807258
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24834452
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24830022
answers question: http://stackoverflow.com/q/24830022
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/38559310
has body: As you've noticed in your comment above, when the shadow dom isn't provided natively then elements that you get with query selectors are wrapped in order to polyfill the encapsulation of the shadow dom. These wrapped elements don't expose everything on the wrapped objects. In order to work in browsers both with and without a native shadow dom implementation, try this: var movieElement = unwrap(document.getElementById(FLASH_OBJECT_ELEMENT_ID)); movieElement[functionName]();
score: 1

http://stackoverflow.com/comment/38420049
comment on: http://stackoverflow.com/q/24761344
type: Comment
type: QuestionComment
score: 1
has text: [I've managed to get it working](http://jsfiddle.net/57fXb/3/). Are you calling the script after the DOM has loaded?

http://stackoverflow.com/q/24807760
type: UnansweredQuestion
has body: I want the following action a href= url(:event, :destroy, event: allocation.id, company_id: company.id) title="Delete This Event" ==t 'actions.delete' to be done only after I agree to it on a confirmation box. I want to embed in this href the javascript code: 'javascript:onClick=window.confirm("Are you SURE you want to Delete this Event?")' I am using Slim. Thanks.
tagged with: slim-lang
type: Question
tagged with: javascript
score: 0
has title: How to embed javascript confirmation box in Slim href?
has answer: http://stackoverflow.com/a/25264054
answer count: 1

http://stackoverflow.com/q/24861207
downvote count: 1
type: Question
score: 1
tagged with: matplotlib
has body: I am looking to build a graphical frontend for some python functionality. Since I am very proficient in HTML/CSS/JS I decided I might check this out as a possibility. The main idea is to make it easier to explore data/variables, I am thinking of a datagrid for example. I was also thinking of creating a GUI for things such as plotting with matplotlib (ie: Choose variable for X axis, choose variable for Y axis, pick a color from a dropdown, ...) in order to cut out some of the tediousness in exploring data with several variables. I would then probably use something like Node-webkit to make a desktop application out of it if possible (and if not, just keep it as a browser project, perhaps). Essentially what it would boil down to is kind of creating an IDE for python, specialized for data exploration/plotting and perhaps data manipulation. An example I found for a web-based python console is repl.it However I have spent a fair amount of time looking for viable ways to go about this, since sending and receiving data from the python interpreter wouldn't be too hard, but it might get a bit harder for exploring variables or plotting data. So the question is: Are there any projects or libraries out there to facilitate this kind of functionality, or which provide a good starting point for interacting with Python through JavaScript? Are there any pointers you guys can give me to make the experience for users as seamless as possible? Thanks!
upvote count: 2
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: python
tagged with: css
answer count: 0
type: UnansweredQuestion
has title: Wrapping Python console/plotting in HTML/CSS/JS
has comment: http://stackoverflow.com/comment/38610953

http://stackoverflow.com/q/24812919
tagged with: css
upvote count: 2
has title: Attach Horizontal Scrollbar to bottom of window if scrollable div is taller than window
has answer: http://stackoverflow.com/a/24818445
accepted answer: http://stackoverflow.com/a/24818445
score: 2
type: AnsweredQuestion
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I have a div that is taller than the window but is contained within a certain width. This causes the div to get a horizontal scrollbar at the very bottom. The problem with this is it makes it hard for users to scroll left and right within the div. I would like to know if it is possible to attach a scrollbar to the bottom of the screen until the user scrolls down to the bottom of the div. To give you an idea of what I would like to accomplish. Codrops created a nice table that once you scroll past the table header it attaches its self to the top of the screen. Here is the demo of that http://tympanus.net/Tutorials/StickyTableHeaders/. I want to do this but with a scrollbar attaching to the bottom of the screen. I am sorry I can't provide things I have tried, because I don't even know where to start when trying to accomplish this.
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/72497997
score: 0
type: AnswerComment
has text: Can the error be generated when the URL path is not correct ?
comment on: http://stackoverflow.com/a/42687417
type: Comment

http://stackoverflow.com/comment/38412067
has text: When I try your suggestion it is the same.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24755892
type: AnswerComment

http://stackoverflow.com/comment/38627159
comment on: http://stackoverflow.com/q/24870925
type: Comment
has text: Please provide a **complete** example. We can't really do much with *pieces* of code, especially since this seems to be a code organization problem.
type: QuestionComment
score: 4

http://stackoverflow.com/comment/38472736
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24788012
has text: Under the "changes" column, are there only two possibilities (engineering/correction)? or are there more?
score: 0

http://stackoverflow.com/comment/38474279
has text: no, I tried that, but it doesnt seem to make a difference
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24787309

http://stackoverflow.com/a/24820745
has comment: http://stackoverflow.com/comment/38531532
has body: var columns = [ { "styles": "width:22%;" }, { "styles": "width:13%;" }, { "styles": "width:13%;" }, { "styles": "width:13%;" }, { "styles": "width:13%;" }, { "styles": "width:13%;" }, { "styles": "width:13%;" } ]; // add a elements to array for (i = 0; i &lt; 10; i++) { var width = '12'; // whatever width you want for each element. columns.push( '{ "styles": "width:' + width + '%;" }' ); }
upvote count: 1
has comment: http://stackoverflow.com/comment/38531501
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24820592
has comment: http://stackoverflow.com/comment/38532266
has comment: http://stackoverflow.com/comment/38532131
type: Answer

http://stackoverflow.com/q/24836259
downvote count: 0
accepted answer: http://stackoverflow.com/a/24836313
favorite count: 0
has answer: http://stackoverflow.com/a/24836316
type: Question
score: 5
tagged with: javascript-objects
possible better answer: http://stackoverflow.com/a/24836316
has answer: http://stackoverflow.com/a/24836326
has body: The revision of the MDN guide on working with objects from July 15th, 2014, states: If an object is created with an object initializer in a top-level script, JavaScript interprets the object each time it evaluates an expression containing the object literal. However, in the snippet below, when objLit2.val2 is evaluated, it does not use the last value set which should be 10 and 100; it instead uses 1000 which was the value declared when objLit2 is defined. Why is it so? var i = 1000; function iPlus3() { alert("iPlus3"); return i + 3; } var objLit2 = { val: iPlus3, val2: i = i + 1 }; function setValue() { i = 10; console.log("objLit2Val1", objLit2.val(), objLit2.val2); // Outputs 13 1001 and not 13 11 i = 100; console.log("objLit2Val2", objLit2.val(), objLit2.val2); // Outputs 103 1001 and not 103 101 // If `val` is interpreted at the time of the call, why is `val2` not also interpreted on each call? } setValue();
linked to: http://stackoverflow.com/q/3200211
has answer: http://stackoverflow.com/a/24836595
has answer: http://stackoverflow.com/a/24836313
tagged with: function
upvote count: 5
tagged with: javascript
has title: Why is an expression in an object initializer not re-evaluated each time the property is read?
answer count: 4
type: AnsweredQuestion

coffeescript
tags question: http://stackoverflow.com/q/24844046
tags question: http://stackoverflow.com/q/24870261
tags question: http://stackoverflow.com/q/24875875
tags question: http://stackoverflow.com/q/24874199
tags question: http://stackoverflow.com/q/24803164
tags question: http://stackoverflow.com/q/24795544
tags question: http://stackoverflow.com/q/24851404
tags question: http://stackoverflow.com/q/24871301
tags question: http://stackoverflow.com/q/24810775
tags question: http://stackoverflow.com/q/24851889
type: Tag
tags question: http://stackoverflow.com/q/24829288
tag name: coffeescript
tags question: http://stackoverflow.com/q/24781114
tags question: http://stackoverflow.com/q/24864486
tags question: http://stackoverflow.com/q/24906359
tags question: http://stackoverflow.com/q/24846957
tags question: http://stackoverflow.com/q/24892640
tags question: http://stackoverflow.com/q/24857908
tags question: http://stackoverflow.com/q/24815220
tags question: http://stackoverflow.com/q/24873750
tags question: http://stackoverflow.com/q/24784443
tags question: http://stackoverflow.com/q/24793277
tags question: http://stackoverflow.com/q/24814222
tags question: http://stackoverflow.com/q/24836658
tags question: http://stackoverflow.com/q/24897829
tags question: http://stackoverflow.com/q/24860277
tags question: http://stackoverflow.com/q/24838688
tags question: http://stackoverflow.com/q/24901516
tags question: http://stackoverflow.com/q/24809960
tags question: http://stackoverflow.com/q/24857223
tags question: http://stackoverflow.com/q/24866684
tags question: http://stackoverflow.com/q/24888138
tags question: http://stackoverflow.com/q/24789045
tags question: http://stackoverflow.com/q/24814209
tags question: http://stackoverflow.com/q/24762831

http://stackoverflow.com/comment/38724532
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24909070
has text: You could also use something like `aID.push.apply(aID, grid.store.getValues(selectedItem, 'id'));` if you want to add all values in the store to the array you're `POST`ing. See http://stackoverflow.com/questions/1374126/how-to-append-an-array-to-an-existing-javascript-array.
score: 0

http://stackoverflow.com/comment/74996983
comment on: http://stackoverflow.com/a/24957873
type: Comment
score: 0
has text: Okay, I see now that I must exchange the Authorization Code for the Refresh Token and Access Token. Is there a Gmail Javascript API procedure that can be used to return the Authorization Code itself?
type: AnswerComment

http://stackoverflow.com/q/24784380
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/38463600
has body: I have a HTML form with ID hello and i have ajax like this jQuery(document).ready(function($) { $("#hello").submit(function(){ var $form = $(this); var serializedData = $form.serialize(); request = $.ajax({ url: "/blog/ajaxphp/registration_check.php", type: "post", data: {formData:serializedData}, datetype: "JSON" }); request.done(function (response, textStatus, jqXHR){ console.log("hellosss"); if(jQuery.parseJSON(response).success==undefined){ $form.unbind('submit').submit(); }else{ return false; } }); request.fail(function (jqXHR, textStatus, errorThrown){ console.log("error"); }); return false; }); }); But Submit button is not working . i mean it is working if i pressit two times .. It logs this Uncaught TypeError: object is not a function in this line $form.unbind('submit').submit(); Question : How do i make form enable submit when jQuery.parseJSON(response).success==undefined is true otherwise disable form to submit . How do i disable ajax button while ajax process is being performed.
has comment: http://stackoverflow.com/comment/38463453
type: UnansweredQuestion
has title: About Form , Ajax
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/24784466
type: Question
has comment: http://stackoverflow.com/comment/38464559
has comment: http://stackoverflow.com/comment/38464457
tagged with: forms
has comment: http://stackoverflow.com/comment/38465596
score: 0
has comment: http://stackoverflow.com/comment/38463464
answer count: 1

http://stackoverflow.com/a/24803502
upvote count: 3
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24803164
has body: CoffeeScript is putting the delete_quote function inside a function closure, and is therefore not part of the global context on the page. The function in the onclick handler is being invoked in the global context. In this regard, CoffeeScript needs a little extra help. I'm very familiar with JavaScript, a beginner at CoffeeScript, so the following code might not work but should give you the basic idea. You'll have to define the function as part of the window object: window.delete_quote = (element) -&gt; alert 'Hi' Edit: You might also try: this.delete_quote = (element) -&gt; alert 'Hi' This other StackOverflow question might be helpful as well: CoffeeScript: coffee -w name-of-file.coffee complains: “window is not defined” -- though the question has more to do with running CoffeeScript compiled JavaScript in Node and the browser, but it touches on how to define "global" variables and functions.
type: Answer
accepted answer of: http://stackoverflow.com/q/24803164
score: 3

http://stackoverflow.com/a/24831819
answers question: http://stackoverflow.com/q/24797813
score: 2
downvote count: 0
type: Answer
upvote count: 2
has body: In Qt5, most of the WebView functionality became part of the undocumented (and unsupported) QtWebKit.experimental. The most comprehensive explanation of these features I've found is this blog post. Before proceeding, a word of caution: the experimental features can -- and will -- change in future versions. Because of this you will see a warning in the console when running the sample code. Here's a full example that posts the entire HTML to the console. It should be fairly trivial to change this to only dump part of the page, to send the HTML elsewhere, etc. import QtQuick 2.2 import QtWebKit 3.0 import QtWebKit.experimental 1.0 Rectangle { width: 800 height: 600 WebView { url: "http://stackoverflow.com/" anchors.fill: parent // Enable communication between QML and WebKit experimental.preferences.navigatorQtObjectEnabled: true; // When the document loads, post the outerHTML back to the QML layer. onLoadingChanged: { if (loadRequest.status === WebView.LoadSucceededStatus) { experimental.evaluateJavaScript( "navigator.qt.postMessage(document.documentElement.outerHTML)"); } } // When we get the message, dump the string data to the console. experimental.onMessageReceived: { console.log(message.data); } } } To summarize, here's what this code is doing: Loads Stack Overflow's home page into a WebView instance When the page is fully loaded, it asks WebView to evaluate Javascript that reads the outerHTML property of the document and posts this as a message back to QML When the message is received, it dumps that HTML to the console

http://stackoverflow.com/a/24837908
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/38572265
has comment: http://stackoverflow.com/comment/38570385
answers question: http://stackoverflow.com/q/24837443
has comment: http://stackoverflow.com/comment/38697685
score: 1
accepted answer of: http://stackoverflow.com/q/24837443
has body: If you want to show the values to the user as he is filling in the form, you'll need JavaScript. At least I don't know any other client side technique to do this. Your real big problem here is to persist the data to database. You can't rely to the client that the proper values are going to be saved in the database. For this purpose you could overwrite the save method of the model. This is a simple example: def save(self, *args, **kwargs): self.iva = self.importe_sin_iva * 0.21 self.importe_Total = self.iva + self.importe_sin_iva super(Factura, self).save(*args, **kwargs) In the form you can use the event 'onchange' to update the appropriate fields on the fly. The framework jQuery is ideal for this. Your function could look like this: $('#importe_sin_iva').change(function() { var importe_sin_iva = $(#importe_sin_iva).val() var iva = importe_sin_iva * 0.21 $('#iva').val(iva) var total = importe_sin_iva + iva $('#total').val(total) }); This is also a simple example, where the input fields for importe_sin_iva, iva and importe_Total have the IDs importe_sin_iva, iva and total respectively. The fields iva and total shouldn't be persisted to the database. You can't rely on client side techniques for validation of the values. You still have to learn how to use jQuery, how to bind it to your HTML, etc. I hope these simple examples can point you the way.
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/24861133
accepted answer: http://stackoverflow.com/a/25012286
has answer: http://stackoverflow.com/a/25008244
has title: WinJS Virtualized Data Source + nested asynchronous requests
type: Question
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25008244
has comment: http://stackoverflow.com/comment/38867813
has body: Hi i'm relatively new to JavaScript and i'm working on a winjs app project where i want to use the Bing image search data source example in my project to virtualize the datasource of a listview. My problem is understanding how the asynchronous functions work together and how to implement an async xhr request within the existing one. Currently i'm using a synchronous request but i would like to change that into a asynchronous one. This is my data adapter: (function () { var xxxDataAdapter = WinJS.Class.define( function (devkey, query, delay) { this._minPageSize = 2; this._maxPageSize = 5; this._maxCount = 50; this._devkey = devkey; this._query = query; this._delay = 0; }, { getCount: function () { var that = this; var requestStr = 'http://xxx/' + that._query; return WinJS.xhr({ url: requestStr, type: "GET", /*user: "foo", password: that._devkey,*/ }).then( function (request) { var obj = JSON.parse(request.responseText); if (typeof obj.error === "undefined") { var count = obj.length; if (count === 0) { console.log("The search returned 0 results.", "sample", "error"); } return count; } else { console.log("Error fetching results from API", "sample", "error"); return 0; } }, function (request) { if (request &amp;&amp; request.name === "Canceled") { return WinJS.Promise.wrapError(request); } else { if (request.status === 401) { console.log(request.statusText, "sample", "error"); } else { console.log("Error fetching data from the service. " + request.responseText, "sample", "error"); } return 0; } }); }, itemsFromIndex: function (requestIndex, countBefore, countAfter) { var that = this; if (requestIndex &gt;= that._maxCount) { return WinJS.Promise.wrapError(new WinJS.ErrorFromName(WinJS.UI.FetchError.doesNotExist)); } var fetchSize, fetchIndex; if (countBefore &gt; countAfter) { //Limit the overlap countAfter = Math.min(countAfter, 0); //Bound the request size based on the minimum and maximum sizes var fetchBefore = Math.max(Math.min(countBefore, that._maxPageSize - (count…
answer count: 2
tagged with: winjs
tagged with: javascript
has answer: http://stackoverflow.com/a/25012286
score: 0
has comment: http://stackoverflow.com/comment/38861101
tagged with: asynchronous

http://stackoverflow.com/comment/38681244
score: 0
type: AnswerComment
type: Comment
has text: Breaking code up into smaller chunks is normally good practice.
comment on: http://stackoverflow.com/a/24899085

http://stackoverflow.com/comment/38576176
type: QuestionComment
has text: Thanks for your answer, tested but issue still appears. - amended the example
comment on: http://stackoverflow.com/q/24844385
score: 0
type: Comment

http://stackoverflow.com/q/24880242
upvote count: 2
tagged with: rest
linked to: http://stackoverflow.com/q/5778245
answer count: 1
favorite count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/4602212
has title: REST API Node.js, organization
tagged with: node.js
score: 2
has answer: http://stackoverflow.com/a/24881527
downvote count: 0
has body: I m actually developping a REST API using Node.js and Express 4.0 and I wanted to clarify something. The service is actually working, but in a single javascript file, and I m looking for a good way to cut it into multiples parts. I was thinking about MVC, but with the actual route system, what is the controller ? Is it the declaration function of the route ? How can I separate the different route into multiple files ? (like user_routes, billing_routes) etc... I know how to export module etc... but having app = express() in multiple file seems to not work (different instanciation) And where to start to the listen the part ? These are beginner questions, but please, but explicit :-) Thanks for advance
type: Question
tagged with: javascript

events
tags question: http://stackoverflow.com/q/24860873
tags question: http://stackoverflow.com/q/24895567
tags question: http://stackoverflow.com/q/24870263
tags question: http://stackoverflow.com/q/24788678
tags question: http://stackoverflow.com/q/24816691
tags question: http://stackoverflow.com/q/24801982
tags question: http://stackoverflow.com/q/24804302
tags question: http://stackoverflow.com/q/24795372
tags question: http://stackoverflow.com/q/24756302
tags question: http://stackoverflow.com/q/24766072
tags question: http://stackoverflow.com/q/24759792
tags question: http://stackoverflow.com/q/24758194
tags question: http://stackoverflow.com/q/24863326
tags question: http://stackoverflow.com/q/24837487
tags question: http://stackoverflow.com/q/24892831
tags question: http://stackoverflow.com/q/24869925
tag name: events
tags question: http://stackoverflow.com/q/24787301
tags question: http://stackoverflow.com/q/24797730
tags question: http://stackoverflow.com/q/24876428
tags question: http://stackoverflow.com/q/24842637
type: Tag
tags question: http://stackoverflow.com/q/24763923
tags question: http://stackoverflow.com/q/24763485
tags question: http://stackoverflow.com/q/24833704

http://stackoverflow.com/comment/38653268
has text: there isn't any. I have removed it
type: AnswerComment
comment on: http://stackoverflow.com/a/24884704
score: 0
type: Comment

http://stackoverflow.com/q/24843104
tagged with: ajax
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38573796
tagged with: python
has comment: http://stackoverflow.com/comment/38573647
has comment: http://stackoverflow.com/comment/38573920
has title: Iteration through ajax data is working time to time
has answer: http://stackoverflow.com/a/24843418
has body: I wrote small calculator on python, using flask framework. I created forms in template, in which I gather specific data with Javascript and using .getJSON, I achieve working ajax. Here's code. (Using jQuery as well) $(document).ready(function() { $(function() { $('.btn#population').bind('click', function() {//Only one button. $( ".faction" ).each(function(x) {//Loops through many forms, which all are class .faction var totals = [];//For late r use. Store gathered data. $.getJSON('/_population', {//Parse data to python. faction: $(this).attr('id'), houses: $(this).find('input[name="houses"]').val(), level: $(this).find(':radio:checked').val(), space: $(this).find('.space').prop( "checked" ), senate: $(this).find('.senate').prop( "checked" ) }, function(data) {//Receive data. give it to next functions. $.merge(totals, data.result); /*$.each(data, function(i, item){ item.forEach(function(number){ //console.log(number); totals.push(number); }); }); This is commented, due experiments.*/ }); console.log(totals); $(this).find('input[name="total"]').each(function(i,val) {//Search for fields in forms, wich will store resoults. (Doesn't used for data gathering in this global function.) $(this).val();//Here I'll itter througt totals and change values of inputs. }); }); return false; }); }); }); Forms are consisted of various inputs, but it's not important. /_population route has python script, which returns basic json array, consisting only numbers, usually, 3 or 4, like [0,0,0,0] or [120,140,300]. My aim is to put each of item of an returned array and put it in input fields in template. As you can see in code, it loops through many forms, and returned array items will goes to some of them. For now, I'm stuck at point, where console shows me very weird behaviour, sometimes it makes proper arrays, sometimes not. Here's the example of Firefox console output. Array [ ] functions.js:23 Array [ ] functions.js:23 Array [ ] functions.js:23 Array [ 40, 120, 300, 0 ] functions.js:23 Ar…
type: Question
has answer: http://stackoverflow.com/a/24843551
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38573755
tagged with: flask

http://stackoverflow.com/q/24810712
accepted answer: http://stackoverflow.com/a/24811651
has answer: http://stackoverflow.com/a/26843386
upvote count: 7
has title: Specifying Mongo Query Parameters From Client Controller (MEAN.JS)
type: AnsweredQuestion
score: 7
has answer: http://stackoverflow.com/a/24811651
type: Question
tagged with: mongodb
answer count: 2
has body: I am building an application using MongoDB, Angular, Express, and Node (MEAN stack). I used the MEAN.JS generator to scaffold my application. I will use the articles module as a reference. Suppose I have 7000 records in my articles collection, and each record has a date associated with it. It is inefficient to load all 7000 records into memory every time I load the page to view the records in a table and I am seeing terrible performance losses because of it. For this reason, I would only like to load records with a date in the range of (1 Month Ago) to (1 Year From Now) and display them in the table. I can currently do this with the following: In my articles.client.controller.js: $scope.find = function() { $articles = Articles.query(); }; ...and in my articles.server.controller.js: var now = new Date(); var aYearFromNow = new Date(now.getTime() + 86400000*365); //add a year var aMonthAgo = new Date(now.getTime() - 86400000*30); //subtract roughly a month exports.list = function(req, res) { Article.find().where('date').lt(aYearFromNow).gt(aMonthAgo).sort('-created').populate('user', 'displayName').exec(function(err, articles) { if (err) { return res.send(400, { message: getErrorMessage(err) }); } else { res.jsonp(articles); } }); }; The problem is that this is not a dynamic way of doing things. In other words, I want the user to be able to specify how far back and how far forward they want to see. How can I bind to variables (e.g. 'aYearFromNow' and 'aMonthAgo') in my client view that will change the query parameters in my server controller?
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: express
tagged with: meanjs
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/26843386

http://stackoverflow.com/comment/39144940
type: Comment
has text: That's impossible with image maps. But you could fake it like this: http://jsfiddle.net/me2loveit2/X4mPW/11/
comment on: http://stackoverflow.com/a/25123452
type: AnswerComment
score: 0

http://stackoverflow.com/q/24870804
score: 1
type: Question
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38627259
has comment: http://stackoverflow.com/comment/38626896
possible better answer: http://stackoverflow.com/a/24870867
has body: I am working on a CSS animation type thing and need to display text in a textbox in HTML as if someone is typing it in but no one is actually putting in any text input. I have this so far: My hope is display the "Text in the textbox" value character by character as if a user is typing it in, with some time between each character. So my question is anyone know of a way to do timing and appending lists in js? Thanks!
answer count: 3
has comment: http://stackoverflow.com/comment/38627086
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
has answer: http://stackoverflow.com/a/24871198
accepted answer: http://stackoverflow.com/a/24871198
has title: How to display text in a textbox character by character?
upvote count: 1
has answer: http://stackoverflow.com/a/24871081
has comment: http://stackoverflow.com/comment/38627202
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24870867
has comment: http://stackoverflow.com/comment/38627033

http://stackoverflow.com/comment/122053572
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24793128
type: Comment
has text: This solution, although it works, it's too inefficient. The time complexity for this solution is N-squared, because that `string.indexOf(c)` will have to go to the end of the string, each time, to see if it finds the char. Given a string like this: "abcdeffedcba", .indexOf("a", 2) will go from the start of the string to the end of the end of the string. The same for each character (potentially). A better solution is to create a character/integer map or cache. Itereate the string once to create the map and then once again to look for the char that has a value of 1.

http://stackoverflow.com/q/24778484
possible better answer: http://stackoverflow.com/a/24778552
has answer: http://stackoverflow.com/a/24778551
score: 0
answer count: 5
has comment: http://stackoverflow.com/comment/38451796
has title: What will be the value of variable thisconnection and HOW?
has answer: http://stackoverflow.com/a/24778552
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24778579
accepted answer: http://stackoverflow.com/a/24778579
has answer: http://stackoverflow.com/a/24778716
has body: var connections = {key: 1234} var thisconnection = connections["key"] || {status:"new"};` In the above code, the variable thisconnection is subjected to the Logical operator '||' When I simply type the following code in the console, thisconnection takes the value of the connections["key"] in any case.
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38451793
has answer: http://stackoverflow.com/a/24778898

http://stackoverflow.com/q/24784413
has answer: http://stackoverflow.com/a/25004459
accepted answer: http://stackoverflow.com/a/25004459
score: 0
tagged with: three.js
has body: I've been researching and playing with examples of particle clouds in Three.js. Most use shape geometries to define a field of particles, or parameters for distributing them randomly throughout the field of view. What I would like to do is create a particle cloud in which each particle has a relative proximity to an invisible vector path. For example, if I defined a lightly curved vector path, all the particles might float within a consistent radius along that invisible and then maybe taper toward the ends to form a hotdog-shaped cloud of particles. So, I know how to create particles and I know how to create vector paths, how do I link these two things together? Thanks!
tagged with: graphics
type: AnsweredQuestion
tagged with: particle-system
has title: How to define a cloud of particles relative to a vector path with Three.js?
type: Question
tagged with: vector
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/38440868
type: Comment
comment on: http://stackoverflow.com/q/24772508
score: 0
has text: thanks but the same thing happens.
type: QuestionComment

http://stackoverflow.com/comment/38653375
type: QuestionComment
comment on: http://stackoverflow.com/q/24798143
has text: I want to display the timestamp value along with remaining fields in the collection. Could you please help on that? I want output as _id, field1, field2, <timestamp calculated from _id field>.
score: 0
type: Comment

http://stackoverflow.com/q/24847650
type: UnansweredQuestion
has title: Duplicate (Immitate) OpenCart Confirm Delete
has body: I want to duplicate the OpenCart's jQuery to confirm action. This is the javascript: &lt;script type="text/javascript"&gt; //----------------------------------------- // Confirm Actions (delete, uninstall) //----------------------------------------- $(document).ready(function(){ // Confirm Delete $('#form').submit(function(){ if ($(this).attr('action').indexOf('delete',1) != -1) { if (!confirm('&lt;?php echo $text_confirm; ?&gt;')) { return false; } } }); }); &lt;/script&gt; The HTML is: &lt;a onclick="$('form').attr('action', '&lt;?php echo $delete; ?&gt;'); $('form').submit();" class="button"&gt;&lt;?php echo $button_delete; ?&gt;&lt;/a&gt; My button is: &lt;a onclick="$('form').attr('action', '&lt;?php echo $process_carts_action; ?&gt;'); $('form').submit();" class="button"&gt;&lt;?php echo "Process Carts" ?&gt;&lt;/a&gt; Is this the line that references the button and how? if ($(this).attr('action').indexOf('delete',1) != -1)
type: Question
tagged with: button
tagged with: javascript
tagged with: jquery
tagged with: opencart
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/24851371

http://stackoverflow.com/comment/38672099
comment on: http://stackoverflow.com/q/24892790
type: Comment
has text: in which file? You must be seeing the file name there right? Can you please let us know that?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/38484326
has text: Are the key events added to document element?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24795306

http://stackoverflow.com/q/24827399
has title: How to detect fullscreen using document.msFullscreenElement !== null (with javascript)
tagged with: fullscreen
tagged with: internet-explorer-11
score: 1
upvote count: 1
type: Question
has body: Using 'document.msFullscreenElement !== null', as per the answer given in here: I am trying to detect if a page is in Fullscreen mode in IE11: Detect Fullscreen Detect Fullscreen in IE11 However, the outcome of the alert is false whether or not the browser is in fullscreen. Presumably I misunderstand how this meant to be applied?
downvote count: 0
linked to: http://stackoverflow.com/q/20520140
tagged with: javascript
answer count: 1
has answer: http://stackoverflow.com/a/24827643
favorite count: 0
has comment: http://stackoverflow.com/comment/130469619
type: UnansweredQuestion

http://stackoverflow.com/comment/38607143
type: QuestionComment
comment on: http://stackoverflow.com/q/24854737
has text: Do you need both the option of custom window as well as Kendo grid Edit pop-up. If not then you can use your custom window as Editor pop-up by just adding editable window template as your custom window template name.
score: 0
type: Comment

http://stackoverflow.com/a/24865288
answers question: http://stackoverflow.com/q/24864571
type: Answer
score: 0
has body: Yes, fadeIn is probably the reason since it changes heights of the elements. You could avoid this by applying fadeIn animations for the divs that are above the selected section before you manipulate the scrollTop.

http://stackoverflow.com/q/24865265
tagged with: javascript
upvote count: 2
answer count: 1
tagged with: jquery
has title: how to do SVN http-request checkin/commit within html
favorite count: 0
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
downvote count: 0
type: Question
has answer: http://stackoverflow.com/a/24956847
has body: i've got a problem i want to use a website to do a checkin and checkout on my svn server. i already got everthing to the point where i can do a checkout using jQuery. my remaining problem is with the handling of the MERGE process. within the MERGE svn transmits a chunked response. but my console just reports Bad Request. wireshark told m that the Transfer-Encoding is chunked. but i couldn't set it to chunked. if i set the contentType to chunked the body is chunked not the transfere-encoding. and jquery.ajax() doesn't provide something as Transfer-Encoding. trying to put it into the headers didn't work as well...it didn't even show this header my checkin code: $.ajax({ type: "OPTIONS", url: baseURL, contentType: "text/xml", data: '<?xml version="1.0" encoding="utf-8" ?><D:options xmlns:D="DAV:"><D:activity-collection-set></D:activity-collection-set></D:options>', success: function(data1, status, jqxhr){ $.ajax({ type: "POST", url: baseURL + "/!svn/me", contentType: "application/vnd.svn-skel", data: "(create-txn-with-props (svn:txn-user-agent 40 SVN/1.8.9(i686-pc-linux-gnu) serf/1.3.4 svn:log function svn:txn-client-compat-version 5 1.8.9))", success: function(data2, status, jqxhr){ rev = jqxhr.getResponseHeader('SVN-Txn-Name'); newdata = new XMLSerializer().serializeToString(xmlString["context"]); hashResult = calcMD5(newdata); $.ajax({ type: "PUT", url: baseURL + "/!svn/txr/" + rev + file + ".xml", headers: {"X-SVN-Version-Name": latestRev, "X-SVN-Base-Fulltext-MD5":hashBase, "X-SVN-Result-Fulltext-MD5": hashResult}, contentType: "text/xml", data: newdata, success: function(data3, status, jqxhr){ chunked1 = '<?xml version="1.0" encoding="utf-8"?><D:merge xmlns:D="DAV:"><D:source><D:href>/svn/check/!svn/txn/' + rev + '</D:href></D:source><D:no-auto-merge></D:no-auto-merge><D:no-checkout></D:no-checkout><D:prop><D:checked-in></D:checked-in><D:version-name></D:version-name><D:resourcetype></D:resourcetype><D:creationdate></D:creationdate><D:creator-displayname>'; chunk…
accepted answer: http://stackoverflow.com/a/24956847
tagged with: svn

http://stackoverflow.com/a/24865079
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24864844
type: Answer
answers question: http://stackoverflow.com/q/24864844
has comment: http://stackoverflow.com/comment/38617697
has comment: http://stackoverflow.com/comment/38617946
has body: You can't have the same property 'b' more than once. Change the answer to be an array: questions.push({ q: "Rate your custard making skills from 1-5.", a: "1", b: "2", c: "3", answer: ["a", "b"], scores: [1, 2] }); Change next function to fill the answers array: function next() { var aa = document.getElementById('aa'); var ab = document.getElementById('ab'); var ac = document.getElementById('ac'); var ans = []; // &lt;-- here if (i == 0) loadNext(); else { if (aa.checked) ans.push("a"); // &lt;-- here if (ab.checked) ans.push("b"); // &lt;-- here if (ac.checked) ans.push("c"); // &lt;-- here if (ans.length &gt; 0) { // &lt;-- here answers.push(ans); loadNext(); } else alert("Please Select an answer."); } }; Change the verification function to compare question-answers arrays: function endQuiz() { var score = 0; var correct; for (var j = 1; j &lt; questions.length; j++) { correct = answers[j].length == questions[j].answer.length; if(correct) { for(var an=0;an&lt;questions[j].length;an++) { if (answers[j][an] != questions[j].answer[an]){ correct = false; break; } } } if(correct) { score++; } } score *= 2; alert("You Scored: " + score); }; Edit: If I understand correctly, you want to set a score for each possible choice separately. If that's the case, you can, for example, do the following: Add a scores array to the question object which maps a score for a choice, here a=1, b=2: questions.push({ q: "Rate your custard making skills from 1-5.", a: "1", b: "2", c: "3", answer: ["a", "b"], scores: [1, 2] }); Change the verification function to add scores depending on the choices: function endQuiz() { var score = 0; for (var j = 0; j &lt; questions.length; j++) { for(var an=0;an&lt;questions[j].answer.length;an++) { var ansIndex = answers[j].indexOf(questions[j].answer[an]); if(ansIndex &gt; -1) { score += questions[j].scores[an]; } } } score *= 2; alert("You Scored: " + score); }; Demo: JSFiddle

http://stackoverflow.com/q/24885957
tagged with: javascript
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/38655226
accepted answer: http://stackoverflow.com/a/24886073
has comment: http://stackoverflow.com/comment/38655146
has answer: http://stackoverflow.com/a/24886147
has title: & character breaks received json by php
tagged with: php
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24886147
has answer: http://stackoverflow.com/a/24886073
type: Question
answer count: 2
has body: I have an array with more objects. If one object contains &amp; character, every object after the &amp; is not received by php. What might be the problem? THIS IS THE AJAX xmlhttp.open("POST", "get.php"); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlhttp.send('data='+JSON.stringify(x)); THIS IS THE PHP $json = $_POST['data']; echo $json; When entered a&amp;b I got [[{"x":x,"y":"x","z":"z"}],[{"w":a

http://stackoverflow.com/q/24750169
has answer: http://stackoverflow.com/a/40815117
linked to: http://stackoverflow.com/q/33214717
has comment: http://stackoverflow.com/comment/68242621
type: Question
has answer: http://stackoverflow.com/a/45764039
has comment: http://stackoverflow.com/comment/68279240
possible better answer: http://stackoverflow.com/a/40815117
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24750373
has body: I have been searching all over for how to do this - I am trying to redirect after a DELETE request is made - here is the code I am using WITHOUT THE REDIRECT: exports.remove = function(req, res) { var postId = req.params.id; Post.remove({ _id: postId }, function(err) { if (!err) { console.log('notification!'); res.send(200); } else { console.log('error in the remove function'); res.send(400); } }); }; remove gets called when an item (a post) is deleted. Everything works fine (I had to use res.send(200) to get it to not hang on the delete request) - but now I am having trouble redirecting. If I use res.redirect('/forum') inside the remove function, like this: exports.remove = function(req, res) { var postId = req.params.id; Post.remove({ _id: postId }, function(err) { if (!err) { console.log('notification!'); res.send(200); } else { console.log('error in the remove function'); res.send(400); } res.redirect('/forum'); }); }; It registers the redirect as a DELETE request that is trying to delete /forum, like this: DELETE http://localhost:9000/forum 404 Not Found 4ms All I am trying to do is refresh the page so that the list of posts is updated after the delete. Can anyone help?
tagged with: express
has comment: http://stackoverflow.com/comment/68215698
answer count: 3
tagged with: http-delete
has comment: http://stackoverflow.com/comment/68200497
favorite count: 0
has comment: http://stackoverflow.com/comment/68253789
tagged with: http-redirect
upvote count: 21
tagged with: request
has answer: http://stackoverflow.com/a/24750373
type: AnsweredQuestion
score: 21
has comment: http://stackoverflow.com/comment/68385924
has title: ExpressJS - res.redirect after DELETE request

http://stackoverflow.com/a/59947208
upvote count: 1
has body: var dropDown = new Select({ name: "select2", id: "projectDropDown", onChange: function (value) { //console.log("project Id: ", this.get("value")) reScopeProjectContext(value,satpcontext); }, store: projectStore, labelAttr: "name", value: projectInContext, }).placeAt(win.body()).startup();
has comment: http://stackoverflow.com/comment/106015027
type: Answer
answers question: http://stackoverflow.com/q/24763177
downvote count: 0
score: 1

http://stackoverflow.com/q/24793277
score: 1
has answer: http://stackoverflow.com/a/24811494
accepted answer: http://stackoverflow.com/a/24811494
tagged with: coffeescript
type: Question
tagged with: javascript
tagged with: jquery
upvote count: 1
has body: I'm scaling a div.parent by n% using transform : scale( 0.25 ). The width of div.parent is quite large and exceeds the viewport bounds. This container div has n children, each with a relative offset position, which I'm getting via jQuery like ( approximation ) parent = $ '.parent' child = $ '.child' posLeft = child.position().left I'm then moving the div.parent container using the value posLeft. parent.css transform : "translate3d( #{posLeft}px, 0, 0 )" I would like to expand the function that handles the above animation by allowing it to continue to move div.parent accurately ( as related to the child items posLeft ) when it's scaled down. Here's an image to help illuminate the problem.
has title: Javascript : accurate CSS TranslateX ( position ) taking Transform Scale into account
answer count: 1
favorite count: 0
tagged with: css
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/a/24884667
accepted answer of: http://stackoverflow.com/q/24884486
has comment: http://stackoverflow.com/comment/38674837
answers question: http://stackoverflow.com/q/24884486
has comment: http://stackoverflow.com/comment/38674500
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38691198
upvote count: 3
has comment: http://stackoverflow.com/comment/38674342
has comment: http://stackoverflow.com/comment/38652754
has comment: http://stackoverflow.com/comment/38654450
type: Answer
has body: This : var course = $('.departments').text; should be: var course = $('.departments').text(); // missed the braces As you are using jquery mobile in it so you can use pagecontainershow to check for the page show in here i think this has to be something like this: $(function(){ $( ":mobile-pagecontainer" ).on( "pagecontainershow", function( event, ui ) { if(window.location.href.indexOf('#department') !== -1){ loadCourse(); } }); }); ON JSBIN HERE As per your latest comment: This is getting me everything. All of the text of what is inside the html You need to get the text and pass that in the function: $(function(){ var txt; // declare var outside $('a').on('click', function(){ // bind a click event on clicked anchors txt = this.textContent; // get the text content }); $( ":mobile-pagecontainer" ).on( "pagecontainershow", function( event, ui ) { if(window.location.href.indexOf('#department') !== -1){ loadCourse(txt); // pass it here } }); }); Updated JSBIN
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/38652884
has comment: http://stackoverflow.com/comment/38654867

http://stackoverflow.com/a/24841686
downvote count: 1
has comment: http://stackoverflow.com/comment/38571070
has comment: http://stackoverflow.com/comment/38570995
answers question: http://stackoverflow.com/q/24841600
has body: The only DOM elements that have a value property are form fields ( , , ). You don't have any in your example, so you can't use value to get them. Similarly, you can't access an element with a class name by using container.theClass, so document.form[0].mark1 won't give you the ... cell in your table in your form. To access elements, the main tools are: querySelector - Find the first element matching a CSS selector in a container querySelectorAll - Find all elements matching a CSS selector in a container document.getElementById - Find the one element with the given id value To get the text (not value) within non-form cells, you can use innerHTML (which gives you HTML markup, but in your case, that's just the text of the numbers). Then we parse that text to get numbers. In your example, then, we can find the elements we care about using document.querySelector(".mark1") and similar. function calculate(){ var mark1 = document.querySelector(".mark1"); var mark2 = document.querySelector(".mark2"); var mark3 = document.querySelector(".mark3"); var total = document.querySelector(".total"); var sum = parseInt(mark1.innerHTML, 10) + parseInt(mark2.innerHTML, 10) + parseInt(mark3.innerHTML, 10); total.innerHTML = String(sum); } Note that this assumes that you will only ever want to use the first (only) cells. If you had multiple form/tables and wanted to work within each of them, you'd want to do it slightly differently, perhaps by passing the form element into the function: function calculate(form){ var mark1 = form.querySelector(".mark1"); var mark2 = form.querySelector(".mark2"); var mark3 = form.querySelector(".mark3"); var total = form.querySelector(".total"); var sum = parseInt(mark1.innerHTML, 10) + parseInt(mark2.innerHTML, 10) + parseInt(mark3.innerHTML, 10); total.innerHTML = String(sum); } Note how I used form.querySelector rather than document.querySelector. This finds the first matching element, but only looking within the form. So if we had three forms, we could d…
has comment: http://stackoverflow.com/comment/38571152
type: Answer
score: 1
upvote count: 2
has comment: http://stackoverflow.com/comment/38571034

http://stackoverflow.com/q/24850977
has comment: http://stackoverflow.com/comment/38588753
tagged with: javascript
has body: Okay I know the answer to an all in one data cleaning strategy do not do it. My question is: Are there any standard actions that should be taken to secure form data right off the bat? Asides from doing my own form validation (ie Email, phone, etc). As of currently this is in relation to a WebApp (HTML, PHP and MYSQL) but I would not say this should be limited to that I want to know best practices. From what I have read the only time anything should be done is when in as a data cleansing step is before a particular action is taken with that data (ie before storing in my database use mysql_real_escape_string). EDIT: Asides from SQL injection what are other malicious attacks that can occure from not cleaning data?
score: -1
linked to: http://stackoverflow.com/q/12859942
answer count: 2
linked to: http://stackoverflow.com/q/60174
favorite count: 0
has title: Form data best practices
tagged with: php
has answer: http://stackoverflow.com/a/24851217
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24851217
downvote count: 2
tagged with: mysql
upvote count: 1
possible better answer: http://stackoverflow.com/a/24851141
linked to: http://stackoverflow.com/q/737385
type: Question
has answer: http://stackoverflow.com/a/24851141

if-statement
tags question: http://stackoverflow.com/q/24857132
tags question: http://stackoverflow.com/q/24805119
tag name: if-statement
type: Tag
tags question: http://stackoverflow.com/q/24843849
tags question: http://stackoverflow.com/q/24793810
tags question: http://stackoverflow.com/q/24902641
tags question: http://stackoverflow.com/q/24815011
tags question: http://stackoverflow.com/q/24761221
tags question: http://stackoverflow.com/q/24759270
tags question: http://stackoverflow.com/q/24827385
tags question: http://stackoverflow.com/q/24850204
tags question: http://stackoverflow.com/q/24869398
tags question: http://stackoverflow.com/q/24784973
tags question: http://stackoverflow.com/q/24870157
tags question: http://stackoverflow.com/q/24870066
tags question: http://stackoverflow.com/q/24813497
tags question: http://stackoverflow.com/q/24754567

http://stackoverflow.com/comment/38503526
type: Comment
comment on: http://stackoverflow.com/q/24805647
has text: @Matt: That's not working. jQuery is forcing `this` to refer to `#file-form`.
type: QuestionComment
score: 0

http://stackoverflow.com/comment/38600704
has text: Making a method generic and testing for certain types at runtime are two separate concerns. "Just trust" doesn't always fit.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24856895
type: Comment

http://stackoverflow.com/comment/38485277
type: AnswerComment
has text: JqueryUI updated the answer
type: Comment
comment on: http://stackoverflow.com/a/24795837
score: 0

http://stackoverflow.com/q/24770559
type: UnansweredQuestion
type: Question
has body: So im making a html5 / js RTS game. The game can be ran fullscreen. The problem now is, players with dual screen will have their cursor go out of the canvas and jump over to the 2nd screen when they move it too far. Is there a good way, to prevent that ? I know, there is this, but this seems to hide the cursor, which is obv not what i want in an RTS game. Ofc i could draw my own cursor, but the problem with this is, the cursor drawn then will depend on the framerate, which can sometimes go a bit down and so or so it will feel a lot less smooth than the "normal" cursor. So, is there a way to lock the cursor in an element without hiding it and still be moveable but just stop at the border ?
score: 1
has comment: http://stackoverflow.com/comment/38437739
tagged with: cursor
tagged with: canvas
has answer: http://stackoverflow.com/a/24772511
has comment: http://stackoverflow.com/comment/38437604
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/38437688
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: HTML5 / JS: have the cursor locked in a canvas element
downvote count: 0

http://stackoverflow.com/comment/38759973
has text: Makes sense. Would that be relevant in this case, where `newMComparisonArray.save` happens within `mComparisonQuery.find`, rather than after it as you mentioned?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24902319
type: AnswerComment

http://stackoverflow.com/comment/38648430
comment on: http://stackoverflow.com/a/24869976
score: 0
type: AnswerComment
has text: Hello IvyLynx.....thank you very much for the response.....I'm using your code, but I have a doubt for the last part of code, because I always receive an error on stream variable (that is always undefined)
type: Comment

http://stackoverflow.com/a/24792772
downvote count: 0
score: 1
type: Answer
has comment: http://stackoverflow.com/comment/38479773
has comment: http://stackoverflow.com/comment/38479740
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24792387
has body: Change your function to: function hide_category($var) { var $category = (typeof $var == 'string') ? $var : $(this).data("target"); $("#" + $category).hide(250, function() { $("[data-action=close][data-target=" + $category + "]").attr("data-visible", "0"); }); } Here: http://jsfiddle.net/RmeSJ/2/
answers question: http://stackoverflow.com/q/24792387
type: AcceptedAnswer

http://stackoverflow.com/comment/38530443
type: AnswerComment
comment on: http://stackoverflow.com/a/24819764
type: Comment
has text: Thank you for your answer, but I think its a bit messed ? or may be I understood wrongly, can bring example if it possible ?
score: 0

http://stackoverflow.com/a/24878937
upvote count: 2
type: Answer
has body: Use textContent instead of innerText http://jsbin.com/doyuciyi/1/edit
score: 2
downvote count: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24878892
answers question: http://stackoverflow.com/q/24878892

http://stackoverflow.com/q/24784845
score: 1
tagged with: javascript
type: Question
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has body: Im trying to do a deep copy of a Javascript object using Jquery.extend but I don't it being copied... Here is a simple example: $(document).ready(function(){ console.log('Hi') var obj1 = [{'name':'bob','age':'20'},{'name':'Tom','age':'20'}]; jQuery.extend(obj2,obj1) console.log('Hi') }) JSFiddle I dont see the second debug stmt printed in the console.log
has answer: http://stackoverflow.com/a/24784937
upvote count: 1
accepted answer: http://stackoverflow.com/a/24784937
type: AnsweredQuestion
has title: Copying a Javascript object

http://stackoverflow.com/q/24816514
possible better answer: http://stackoverflow.com/a/24816566
accepted answer: http://stackoverflow.com/a/24816694
type: Question
has comment: http://stackoverflow.com/comment/38524217
has comment: http://stackoverflow.com/comment/38524172
has comment: http://stackoverflow.com/comment/38524151
tagged with: php
has comment: http://stackoverflow.com/comment/38524250
score: 0
has comment: http://stackoverflow.com/comment/38524306
has answer: http://stackoverflow.com/a/24816626
has comment: http://stackoverflow.com/comment/38524135
has answer: http://stackoverflow.com/a/24816694
has answer: http://stackoverflow.com/a/24816572
has body: I already doing research in here. Many people say ajax is better. But I want to ask something first because I never use ajax. I want to delete some row in database if I push yes on the windows.confirm using javascipt. My HTML button Del My Javascript function My delete method in Storage class class Storage { public function delete($condition) { // Delete from database with condition } } Do I must use ajax to call PHP method?
tagged with: database
tagged with: javascript
has answer: http://stackoverflow.com/a/24816566
has comment: http://stackoverflow.com/comment/38524265
tagged with: ajax
has title: How to call php method in javascript?
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38524125

http://stackoverflow.com/comment/38474672
score: 0
type: Comment
has text: Yes the controller is only needed for the templates. How do I "add it as a controller in the directive"? For instance center-view.html uses SearchResultsController as I've shown. What specifically do I need to add to the centerView directive to make it aware of that controller?
type: AnswerComment
comment on: http://stackoverflow.com/a/24789838

http://stackoverflow.com/a/24784245
has body: this and variable scope are separate concepts. Variable scope refers to which variables can be accessed from where within your application. Just because you wrote var foo somewhere doesn't mean that you can access it from everywhere throughout your codebase. In Javascript each function introduces a new scope, and scopes nest in a way that inner functions have access to the scope of outer functions, but not vice versa. this on the other hand is simply a "magic" reference to the "current" object. Maybe it's helpful to explain this idea in the context of other, classical languages first: class Foo { protected $bar; public function baz() { echo $this-&gt;bar; } } In PHP the magic keyword $this refers to the current object instance. Each time you call new Foo, a new instance of this class is created. Every time you call $foo-&gt;baz(), the same function is executed, though with $this set to the appropriate object instance so each object instance can access its own data. In Python this is actually a lot more explicit: class Foo: def baz(self): print self.bar Python does not have a magic keyword to refer to the current object instance. Instead, every method call on an object gets the current object passed explicitly as its first argument. This is typically named self. If Python seems too alien to you, the above in PHP syntax would be: class Foo { public function baz($this) { echo $this-&gt;bar; } } Technically the functions in those classes do not really "belong" to any "class". They're just functions. You just need some way for those functions to be able to refer to a polymorphic object in order for them to be instance methods. Take for example: function baz($obj) { echo $obj-&gt;baz; } That's essentially exactly the same as what the class method does above, with the difference being that $obj is explicitly injected instead of $this being magically "there". Javascript has the same thing, except that this is available in every function (not just "class" functions) and that…
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/24783466
has comment: http://stackoverflow.com/comment/38512227
has comment: http://stackoverflow.com/comment/38511391
upvote count: 3
type: Answer

http://stackoverflow.com/comment/38687600
score: 0
has text: By "cant get it to work" i mean its all brokey. I'm working on a jsfiddle to better visualize my issue. Basically if that line is working properly, it will switch a few containers to "display: block;". The containers aren't showing therefore, "its brokey".
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24902641

http://stackoverflow.com/q/24858246
score: 0
answer count: 3
has body: Is there a reason that this code: var verb = ""; function printPage (input) { $("div").append(input + "&lt;br&gt;"); } $( "#submit" ).click(function() { verb = $('#enter').val(); printPage(verb); }); printPage(verb); only results in #enter (a form)'s value being logged once in the click event (while the last printPage prints the original empty string), while this code: var verb = ""; function printPage (input) { $("div").append(input + "&lt;br&gt;"); } function buttonClick() { verb = "verb!"; printPage(verb); } buttonClick(); printPage(verb); prints verb twice, as the function has successfully changed the verb variable value? Sorry if I haven't explained my problem well enough, I'll elaborate more if needed.
has comment: http://stackoverflow.com/comment/38603217
has comment: http://stackoverflow.com/comment/38624632
has answer: http://stackoverflow.com/a/24858279
has answer: http://stackoverflow.com/a/24858519
possible better answer: http://stackoverflow.com/a/24858279
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38603208
has comment: http://stackoverflow.com/comment/38603225
type: Question
accepted answer: http://stackoverflow.com/a/24858519
has comment: http://stackoverflow.com/comment/38603249
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24858308
has title: jQuery function does not change global variable while regular javascript functions do

http://stackoverflow.com/q/24878191
duplicate of: http://stackoverflow.com/q/3115360
duplicate of: http://stackoverflow.com/q/805107
has answer: http://stackoverflow.com/a/24878220
type: AnsweredQuestion
has title: Can arguments have line breaks in JavaScript?
accepted answer: http://stackoverflow.com/a/24878220
type: Question
tagged with: javascript
score: 0
linked to: http://stackoverflow.com/q/3115360
has body: I have a elementary question. Suppose I'm using jQuery inserting the following: foo bar Can I only write it inline like the this: $("#foo bar").append(" foo bar ") , or can I somehow keep the line break and indentation of the original code?
linked to: http://stackoverflow.com/q/805107
has comment: http://stackoverflow.com/comment/38641112
answer count: 1
has comment: http://stackoverflow.com/comment/38641189
tagged with: jquery

http://stackoverflow.com/a/24906163
downvote count: 0
has comment: http://stackoverflow.com/comment/38695368
type: Answer
has body: My solution using Array.map(). var temp = ["a","b","c","d","e","f"]; var newchart = chart.map(function (obj) { var objValKeys = obj.values.map(function (objVal) { return objVal[0]; }); return { key: obj.key, values: temp.map(function (thisval) { var index = objValKeys.indexOf(thisval); var actlVal = (index+1) ? obj.values[index][1] : 0; return [thisval, actlVal]; }) }; }); Check it on my JSFiddle
score: 1
has comment: http://stackoverflow.com/comment/38696048
upvote count: 1
answers question: http://stackoverflow.com/q/24899780

http://stackoverflow.com/comment/38513319
has text: @tramp i know, i was wondering if there might be a way to get rid of it on the 'all' option using javascript perhaps?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24810489
score: 0

http://stackoverflow.com/comment/38454361
type: Comment
comment on: http://stackoverflow.com/a/24779772
score: 0
has text: I have no access to remote server. This header setted to only one value for security policy.
type: AnswerComment

http://stackoverflow.com/a/33033949
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24900232
upvote count: 1
has body: How about this comments.js var express = require('express'); var router = express.Router(); router.get('/:pid/comments', function(req,res){ res.send('all comments for post id: ' + req.params.pid); }); module.exports = router; posts.js var express = require('express'); var router = express.Router(); router.get('/', function(req,res){ res.send('show all posts'); }); router.get('/:pid', function(req,res){ res.send('show post with id: ' + req.params.pid); }); module.exports = router; finally app.js var routes = require('./routes/index'); var users = require('./routes/users'); var comments = require('./routes/comments'); var posts = require('./routes/posts'); app.use('/posts', comments); app.use('/posts', posts); Points to note: In comments.js, I use '/:pid/comments' as the path to match, so that the post id is available there. In app.js, I pass the comments routes first to the app and the posts routes after that, so that the comment routes are matched first Both comments and posts have the root path '/posts' Sorry for the brevity. I just find this self-explanatory. If anything is confusing, please ask in the comments.

http://stackoverflow.com/q/24830942
has answer: http://stackoverflow.com/a/24831022
tagged with: function
downvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/24830958
favorite count: 0
answer count: 5
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/45258345
has body: E.g.: $(".element").fadeOut().delay(500).fadeIn(); Why can I run multiple functions on a single jQuery object and when can I use this feature? Is there any tutorial/documentation on this?
accepted answer: http://stackoverflow.com/a/24830958
has answer: http://stackoverflow.com/a/24831039
type: Question
has title: Why can I run multiple functions on one line on a single jQuery object?
possible better answer: http://stackoverflow.com/a/24831164
has answer: http://stackoverflow.com/a/24831164
tagged with: javascript
score: 15
upvote count: 15

http://stackoverflow.com/comment/38615457
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24863329
has text: You were using `redirectTo` to indicate the HTML file. `redirectTo` is used to redirect to a route. You should use `otherwise({templateUrl: '404.html'})` instead.
type: AnswerComment

http://stackoverflow.com/q/24788284
has comment: http://stackoverflow.com/comment/91198339
tagged with: naming-conventions
downvote count: 0
tagged with: javascript
has title: Javascript Naming Convention: value() vs getValue()
linked to: http://stackoverflow.com/q/921133
has body: Imagine a simple object: function createObj(someValue) { return { someFunction: function () { return someValue; } }; }; It basically does: var obj = createObj("something"); var result = obj.someFunction(); // "something" Now, someFunction refers to a function that returns a value. What should be the correct naming convention used in javascript for the someFunction function? Should it be named as what it does? Or its ok to name it with the name of the object that it returns? I mean, should I name it value(), or should I name it getValue()? Why? Thanks in advance.
has answer: http://stackoverflow.com/a/24788372
favorite count: 0
has answer: http://stackoverflow.com/a/24788420
has comment: http://stackoverflow.com/comment/38472810
upvote count: 2
accepted answer: http://stackoverflow.com/a/24788491
answer count: 4
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38471260
has comment: http://stackoverflow.com/comment/38472634
has answer: http://stackoverflow.com/a/24788432
possible better answer: http://stackoverflow.com/a/24788372
has answer: http://stackoverflow.com/a/24788491
type: Question

http://stackoverflow.com/q/24796465
has comment: http://stackoverflow.com/comment/38487253
type: Question
has comment: http://stackoverflow.com/comment/38486532
tagged with: javascript
has title: Hidden content running into footer
has answer: http://stackoverflow.com/a/24796761
score: 0
answer count: 3
tagged with: zurb-foundation
tagged with: jquery
has comment: http://stackoverflow.com/comment/38486358
has body: I have a problem when showing my display:none; hidden content with jquery show/hide. When I show the hidden content it runs into my footer because my position:relative; parent .wrapper doesn't know the height of the position:absolute; child #learninfo #promoteinfo``#networkinfo #performinfo. When the screen display is bigger (like normal window size for macbook pro) it's no problem but the smaller the screen the more text runs into my footer and even below if text runs past . The code I'm using is (I do use some foundation + SASS) HTML LEARN | PROMOTE | NETWORK | PERFORM CSS .wrapper { position: relative; padding-bottom: 50px; } #learninfo,#promoteinfo,#networkinfo,#performinfo { display: none; position: absolute; color: #fcb702; width: 100%; } #learn:hover,#promote:hover,#network:hover,#perform:hover { color: $primary-color; } footer { color: #fff; padding: 10px 0; margin-top: rem-calc(100px); text-align: left; } jQuerY // Learn information display $("#learn").hover(function (e) { //This funciton defines what happens on mouse-in or ho $("#learninfo").show(); }, function (e) { //This function defines what happens on mouse-out or when the hover is over. $("#learninfo").hide(); }); // Promote information display $("#promote").hover(function (e) { //This funciton defines what happens on mouse-in or ho $("#promoteinfo").show(); }, function (e) { //This function defines what happens on mouse-out or when the hover is over. $("#promoteinfo").hide(); }); // Network information display $("#network").hover(function (e) { //This funciton defines what happens on mouse-in or ho $("#networkinfo").show(); }, function (e) { //This function defines what happens on mouse-out or when the hover is over. $("#networkinfo").hide(); }); // Perform information display $("#perform").hover(function (e) { //This funciton defines what happens on mouse-in or ho $("#performinfo").show(); }, function (e) { //This function defines what happens on mouse-out or when the hover is over. $("#performinfo…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38487584
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/24797516
has answer: http://stackoverflow.com/a/24797007

http://stackoverflow.com/a/24774067
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24773971
upvote count: 1
score: 1
has body: var date = new Date(); // Date you want, here I got the current date and time date.setDate(date.getDate()-1); getDate() will give you the date, then reduce it by 1 and using setDate() you can replace date again.

http://stackoverflow.com/q/24791191
has answer: http://stackoverflow.com/a/24791287
has body: I can't figure out why my function "validate()" is coming up as undefined. Then my JS comes in and tries to validate the input with a Regex match. But it is undefined. function validate() { var loanNumber = document.querySelector('#loanNumber'); match = loanNumber.test(\d{3}-\d{1,8}); # 3 digits followed by a hyphen followed by 1 to 8 digits if (! match) { alert("Invalid Loan Number: " loanNumber); return false; } return true; }
score: 0
possible better answer: http://stackoverflow.com/a/24791383
has comment: http://stackoverflow.com/comment/38477329
has answer: http://stackoverflow.com/a/24791383
type: Question
has comment: http://stackoverflow.com/comment/38476924
has comment: http://stackoverflow.com/comment/38476752
tagged with: javascript
has comment: http://stackoverflow.com/comment/38476757
accepted answer: http://stackoverflow.com/a/24791287
has comment: http://stackoverflow.com/comment/38476884
has title: HTML and Javascript, function is not defined
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38476793
has comment: http://stackoverflow.com/comment/38476777
has comment: http://stackoverflow.com/comment/38476810
has comment: http://stackoverflow.com/comment/38476754
has comment: http://stackoverflow.com/comment/38476825
type: AnsweredQuestion

http://stackoverflow.com/comment/96483133
has text: This answer is the same as [the main answer](https://stackoverflow.com/a/24837700/2074077), basically stole it from the solution provider for points. Not cool imo.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24872585

http://stackoverflow.com/q/24868730
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24869077
score: 0
possible better answer: http://stackoverflow.com/a/24869077
has comment: http://stackoverflow.com/comment/38623409
accepted answer: http://stackoverflow.com/a/24869204
tagged with: php
has body: so I have this function validateDate('.date') which basically puts a date mask over any input fields which have date as a class. There is a php and javascript file for each page. How can I implement this function once rather than in each separate page .js file? The validation function is in a separate .js file called validations.js. Also, I tried calling the function in my main file (under $(document).ready).
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38623143
has title: applying a function once to all fields of the same class in different files
type: Question
answer count: 2
tagged with: function
has answer: http://stackoverflow.com/a/24869204

http://stackoverflow.com/comment/38679316
has text: Thanks for your help. However, still nothing. I replicated your code by setting server to `<?php if (isset($_SERVER['HTTP_ORIGIN'])) header("Access-Control-Allow-Origin: " . $_SERVER['HTTP_ORIGIN'] . ""); echo "CORS LOL"; ?>` and created an .htaccess in that folder with the code `Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type" Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"` it seems like right now the headers are showing up
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24897723

http://stackoverflow.com/a/24807814
score: 1
has body: There seems to be a misunderstanding. GraphHopper is a routing engine which is able to process OSM data. Likewise the OSM Truck QA Map is just using OSM data, too (especially the maxheight tag, the OSM wiki has more information about this map). If GraphHopper doesn't support the maxheight tag yet then all you have to do is add it to GraphHopper. There is absolutely no need to extract it from the QA map because it is already contained in the data used by GraphHopper. You just need to tell GraphHopper to additionally check this tag when calculating its route the same way it already checks lots of other routing tags (like maxspeed, access and so on).
upvote count: 1
answers question: http://stackoverflow.com/q/24805312
downvote count: 0
has comment: http://stackoverflow.com/comment/38533592
type: Answer

shiny
tags question: http://stackoverflow.com/q/24881931
tag name: shiny
tags question: http://stackoverflow.com/q/24759335
tags question: http://stackoverflow.com/q/24826046
type: Tag

http://stackoverflow.com/comment/38459227
type: Comment
comment on: http://stackoverflow.com/a/24781552
has text: Hi Dave, just want to say thank you for your help. I really appreciate it. Cheers!!
score: 0
type: AnswerComment

http://stackoverflow.com/a/24855023
has body: Modern engines will use true arrays behind the scenes even if you use Array if they think they can, falling back on property map "arrays" if you do something that makes them think they can't use a true array. Also note that as radsoc points out, var buffer = new ArrayBuffer(0x10000) then var Uint32 = new Uint32Array(buffer) produces a Uint32 array whose size is 0x4000 (0x10000 / 4), not 0x10000, because the value you give ArrayBuffer is in bytes, but of course there are four bytes per Uint32Array entry. All of the below uses new Uint32Array(0x10000) instead (and always did, even prior to this edit) to compare apples with apples. So let's start there, with new Uint32Array(0x10000): http://jsperf.com/array-access-speed-2/11 (sadly, JSPerf has lost this test and its results, and is now offline entirely) That suggests that because you're filling the array in a simple, predictable way, a modern engine continues to use a true array (with the performance benefits thereof) under the covers rather than shifting over. We see basically the same performance for both. The difference in speed could relate to type conversion taking the Uint32 value and assigning it to sum as a number (though I'm surprised if that type conversion isn't deferred...). Add some chaos, though: var Uint32 = new Uint32Array(0x10000); var arr = []; for (var i = 0x10000 - 1; i &gt;= 0; --i) { Uint32[Math.random() * 0x10000 | 0] = (Math.random() * 0x100000000) | 0; arr[Math.random() * 0x10000 | 0] = (Math.random() * 0x100000000) | 0; } var sum = 0; ...so that the engine has to fall back on old-fashioned property map "arrays," and you see that typed arrays markedly outperform the old-fashioned kind: http://jsperf.com/array-access-speed-2/3 (sadly, JSPerf has lost this test and its results) Clever, these JavaScript engine engineers... The specific thing you do with the non-array nature of the Array array matters, though; consider: var Uint32 = new Uint32Array(0x10000); var arr = []; arr.foo = "bar"; // &lt;==…
upvote count: 59
downvote count: 1
score: 58
answers question: http://stackoverflow.com/q/24853686
has comment: http://stackoverflow.com/comment/80901970
has comment: http://stackoverflow.com/comment/38598273
type: Answer

http://stackoverflow.com/comment/38515255
type: AnswerComment
comment on: http://stackoverflow.com/a/24804061
has text: vote up for attaching the event handler on the markup
type: Comment
score: 0

http://stackoverflow.com/q/24835802
has comment: http://stackoverflow.com/comment/38560514
has comment: http://stackoverflow.com/comment/38560591
type: Question
has comment: http://stackoverflow.com/comment/38560405
tagged with: javascript
has body: I'm experiencing problems with the image positioning of my website. I've set it up to be in the correct spot in relation the background and my monitor size. However I tested it on screenfly today the result was different. My goal is to get the images to automatically move across the screen to fit a the needs of a bigger display if needed. So in summary what I am after is some code to make my images re-position for larger displays automatically. The website url is www.mustownit.com The website I used to see my website on a larger display is Screen Fly {{content_for_header}} Untitled Document {{content_for_body}} {{content_for_layout}}
accepted answer: http://stackoverflow.com/a/24835923
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/38560376
tagged with: css
has comment: http://stackoverflow.com/comment/38560493
has title: Images don't move according to monitor display
has comment: http://stackoverflow.com/comment/38560331
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24835923

http://stackoverflow.com/comment/38545494
comment on: http://stackoverflow.com/q/24827589
score: 0
type: Comment
has text: See e.g. http://www.d3noob.org/2013/01/adding-tooltips-to-d3js-graph.html
type: QuestionComment

http://stackoverflow.com/q/24828502
has comment: http://stackoverflow.com/comment/38547123
tagged with: javascript
tagged with: jquery
has title: Ajax not function
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/38547378
has comment: http://stackoverflow.com/comment/38546743
has body: I am trying to post the success function from an AJAX to release the validate function. It is working correctly because it is hitting my own API and I can see it is hitting the URL and the server is outputting a HTTP 200. But I need my AJAX function to run in the same page and validate with alert. Script var $form = $('#formDiaDosPais'); var dados = {}; dados.Nome = $form.find("input[name='Nome']").val(); dados.Email = $form.find("input[name='Email']").val(); dados.Genero = genero; dados.Origem = $form.find("input[name='Origem']").val(); $.ajax({ type: "POST", url: 'http://www.website.com.br/api/cadastroNewsletter', data: dados, }).done(function () { alert('E-mail cadastrado'); }).fail(function (XMLHttpRequest, textStatus, errorThrown) { alert('E-mail já está cadastrado'); }) HTML Homem Mulher Li e aceito os Termos
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24830136
accepted answer: http://stackoverflow.com/a/24830136
has comment: http://stackoverflow.com/comment/38547739
downvote count: 2
has comment: http://stackoverflow.com/comment/38546904
type: Question
score: -2
has comment: http://stackoverflow.com/comment/38547565
has comment: http://stackoverflow.com/comment/38550022
has comment: http://stackoverflow.com/comment/38547027
has comment: http://stackoverflow.com/comment/38547708
has comment: http://stackoverflow.com/comment/38547247
has comment: http://stackoverflow.com/comment/38546974
tagged with: validation
upvote count: 0
has comment: http://stackoverflow.com/comment/38546873
answer count: 1

http://stackoverflow.com/comment/39375746
has text: I'm sorry I forgot how I made it work-not-work, as far as I remember I deleted everything because it was always asking to authenticate and not really working. Next time I'll have to deal with Yammer I'll post here updates! Thanks for asking and sorry for not being helpful
comment on: http://stackoverflow.com/q/24884267
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38441854
comment on: http://stackoverflow.com/q/24772545
has text: ok - after some pointers - I guess this thread is the possible solution for this question. http://stackoverflow.com/questions/8021436/turning-live-into-on-in-jquery - still if some one can port that .live function statement, it would help - thanks
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24907277
type: Answer
has body: You can try this: Give the table an id Append html response to the table by using $('#tableid').html(responsedata);
has comment: http://stackoverflow.com/comment/38695592
answers question: http://stackoverflow.com/q/24907139
score: 0
has comment: http://stackoverflow.com/comment/38695973

http://stackoverflow.com/comment/38407444
type: Comment
has text: [It usually does, especially so for proto-versions](http://en.wikipedia.org/wiki/KISS_principle)
comment on: http://stackoverflow.com/a/24754393
score: 0
type: AnswerComment

http://stackoverflow.com/a/24793557
has comment: http://stackoverflow.com/comment/38483493
has comment: http://stackoverflow.com/comment/38484584
has comment: http://stackoverflow.com/comment/38481697
type: Answer
has comment: http://stackoverflow.com/comment/38484993
has comment: http://stackoverflow.com/comment/38481528
score: 4
has body: The World Wide Web Consortium lists target as a permitted attribute for forms and anchor tags, and they are the international standards organization for the web: http://w3.org/TR/html-markup/form.html#form
has comment: http://stackoverflow.com/comment/38481400
has comment: http://stackoverflow.com/comment/38481357
has comment: http://stackoverflow.com/comment/38481429
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/38481315
has comment: http://stackoverflow.com/comment/38481349
answers question: http://stackoverflow.com/q/24793505

http://stackoverflow.com/comment/38453644
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24779391
has text: I`m extremely sorry, I forgot to add it to this snippet. But with the body tag, it still doesn`t work.

http://stackoverflow.com/q/24781963
has answer: http://stackoverflow.com/a/24782557
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38458673
has comment: http://stackoverflow.com/comment/38459267
accepted answer: http://stackoverflow.com/a/24782557
has title: Passing additional value to Controller method - Razor/MVC 5
has body: Hello I am having some trouble figuring out how to pass an additional value to my Controller's Delete method. I have a form with a Delete button (auto-generated MVC). @using (Html.BeginForm()) { @Html.AntiForgeryToken() Admin } But I want to send along an additional value, this value would be the result of getCookie("username"); I have tried making another input and calling it. The problem is that this always shows "null" within my Controller method. The method is // GET: /Admin/Delete/5 public ActionResult Delete(int? id, string userid) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } User user = db.Users.Find(id); if (user == null) { return HttpNotFound(); } return View(user); } and // POST: /Admin/Delete/5 [HttpPost, ActionName("Delete")] [ValidateAntiForgeryToken] public ActionResult DeleteConfirmed(int id, string userid) { User user = db.Users.Find(id); db.Users.Remove(user); db.SaveChanges(); var time = new DateTime(); string text = time + ": User " + user.name + " was deleted."; System.IO.File.AppendAllText(pathway, text + Environment.NewLine); return RedirectToAction("Index"); } All I want is to have the value of getCookie('username'); passed on to a method as userID. Any help appreciated!
tagged with: razor
type: AnsweredQuestion
tagged with: asp.net-mvc
type: Question
tagged with: asp.net-mvc-5
answer count: 1

http://stackoverflow.com/q/24864079
has answer: http://stackoverflow.com/a/24868649
has comment: http://stackoverflow.com/comment/38621925
tagged with: validation
has comment: http://stackoverflow.com/comment/38642745
tagged with: spam
has title: Prevent Hyperlink on ASP text box validation
type: Question
score: 0
answer count: 1
has body: I am trying to stop spammers submitting Hyperlinks on a text box for a form. The form asks the user to input their Full Name, Email Address, Telephone Number and then there is a box for them to enter a message. The Email Address and Telephone Number prevent hyperlinks because the validation specifies that the Phone can only consist of numbers, and the Email must contain an @. Is there a way using Javascript combined with ASP that I can stop a form being submitted if it contains (http) or (www). I tried the following without success &lt;script type="text/javascript"&gt; function Validate(x, y) { str = (document.getElementById('Messagetxt')).value; if (str.match(/(http)(www)([\&lt;])([^\&gt;]{1,})*([\&gt;])/i) == null) { y.IsValid = true; } else { y.IsValid = false; } } &lt;/script&gt; Which is linked to a Custom Validator for the text box. When ever I enter http, www, or html tags &lt; &gt;, which I am trying to prevent, the form submits but presents an error page.
tagged with: asp-classic
has comment: http://stackoverflow.com/comment/38620088
has comment: http://stackoverflow.com/comment/38619730
tagged with: hyperlink
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/a/24876397
answers question: http://stackoverflow.com/q/24867741
score: 12
has body: Each time you reference app-globals in a custom component, a new instance of app-globals is created. But each of these instances can share a number of properties (think "static" vars in Java or "class" vars in ObjC / Swift). The Script within app-globals element (or indeed any Polymer element) runs only once - think of it as running when the component definition is loaded. But the Polymer function within that script declares a configuration object, with properties and lifecycle event-handlers, that will be created separately for each instance. The app-globals script in the document you reference (copied below UPDATE: this version is modified as described later) uses an anonymous closure (a function that is run immediately), containing both the shared variables and the Polymer function declaring the config object which in turn references the shared variables. So each instance of that config object - and in turn each instance of app-globals - will reference the same set of shared variables. &lt;polymer-element name="app-globals"&gt; &lt;script&gt; (function() { var data = { firstName: 'John', lastName: 'Smith' } Polymer('app-globals', { ready: function() { this.data = data; } }); })(); &lt;/script&gt; &lt;/polymer-element&gt; If one custom component instance changes a value on its app-globals instance (or they are changed internally, as the results of an AJAX call in your case) all other component instances with a reference to app-globals will see the changed value. UPDATE: The original, as copied from: http://www.polymer-project.org/docs/polymer/polymer.html#global had a deficiency, as described by @zreptil, if you change the data values, the new values are NOT available to all other instances - because the instance variables are just copies of the referenced strings. By using an object with data properties, as in the edited version above, and only ever reading from and assigning to the data properties of that object rather than overwriting the object itself, changed…
upvote count: 12
has comment: http://stackoverflow.com/comment/50312825
has comment: http://stackoverflow.com/comment/40520221
type: Answer
has comment: http://stackoverflow.com/comment/39928964
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24867741
type: AcceptedAnswer

http://stackoverflow.com/a/24839716
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24839627
has body: var JSON = { "status": { "statusCode": 200,"title": " needs", "classname": "NeedController" }, "needs": { "Needs": [{"needTitle": "Need a book","needDescription": "story book","fromCustomer": "abc","needDate": "2014-05-15T12:57:13Z","needID": 23, "referrals":{"referrals":[{"referredBy":"xyz","referredOn":"2013-11-19T06:56:18Z‌​","rererralId":3,"referralStatus":"declined","needId":3}]}}]}}; alert(JSON.needs.Needs[0].referrals.referrals.length); As per the above JSON, this is how you find the length.
has comment: http://stackoverflow.com/comment/38567614

http://stackoverflow.com/comment/38605359
score: 0
comment on: http://stackoverflow.com/q/24859334
has text: @VolodymyrBilyachat: Because I want to send it like an object to my backend, not an Array.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24820529
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I'm using this slide-in effect from CSS-tricks. It partly uses the visible plugin, and the animation is done via CSS. http://css-tricks.com/slide-in-as-you-scroll-down-boxes/ It works when the CSS is loading in-page within style tags, but when I load it from an external stylesheet it doesn't. I've checked that the stylesheet is loading and it is. I'm wanting to load it externally to keep my CSS in one file. I've tried getting this to work in both HTML and wordpress, but get the same result. I use HTML5 Reset files. Thanks, Tim. I've tried using: @import url("slidein.css"); within style tags but that didn't work. In Wordpress I load the javascript within an external file, ie. &lt;script src="&lt;?php echo get_template_directory_uri(); ?&gt;/js/index.js"&gt;&lt;/script&gt; within HTML: &lt;script src="js/index.js"&gt;&lt;/script&gt; The CSS in Wordpress: &lt;link rel="stylesheet" href="&lt;?php echo get_template_directory_uri(); ?&gt;/slidein.css" /&gt; and HTML: &lt;link rel="stylesheet" type="text/css "href="assets/css/slidein.css" /&gt; The javascript within index.js: $.fn.offScreen = function(distance){ var $t = $(this), $w = $(window), viewTop = $w.scrollTop(), viewBottom = viewTop + $w.height(), _top = $t.offset().top - distance, _bottom = $t.offset().top + $t.height() + distance; return { top: _bottom &lt;= viewTop, bottom: _top &gt;= viewBottom } }; var win = $(window); var allMods = $(".module"); allMods.each(function(i, el) { var el = $(el); if (!el.offScreen(150).bottom) { el.addClass("already-visible"); } }); win.on("scroll resize",function(event) { allMods.each(function(i, el) { var el = $(el); if (!el.offScreen(150).top &amp;&amp; !el.offScreen(150).bottom) { el.removeClass("already-visible off-screen-top off-screen-bottom"); el.addClass("come-in"); } else { if(el.offScreen(150).top) { el.addClass("off-screen-top"); } else { el.addClass("off-screen-bottom"); } } });//allMods.each() });//win.scroll() win.trigger("scroll"); The CSS: * { -moz-box-sizing: bo…
type: UnansweredQuestion
tagged with: css
tagged with: wordpress
type: Question
has title: CSS loading within in-page style tags, but not from external stylesheet
has answer: http://stackoverflow.com/a/24820811
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/24774887
tagged with: server-side
has title: Access select box value from server aspnet
type: UnansweredQuestion
has body: I am trying to get the value of a client side select box in the server side of an aspx. For example, In a button_click, I would like to make a connection to a database depending on the value of a select box of client side.
has answer: http://stackoverflow.com/a/24775537
type: Question
answer count: 1
tagged with: javascript
tagged with: asp.net
score: 0
tagged with: client-side

http://stackoverflow.com/a/24849154
type: Answer
accepted answer of: http://stackoverflow.com/q/24835704
answers question: http://stackoverflow.com/q/24835704
score: 1
has body: However, when it comes to passing a method, such as toUpperCase, I get the error message: "TypeError: undefined is not a function" Well, you're not passing a "method". See @elclarns' answer for how to pass a bound function. What you are passing is a property name, which is a string - and when functionOrKey is the string 'toUpperCase' it does not have an apply method. You will need to check the type of that parameter, and act accordingly. When it's a string, you will want to use return value[key].apply(value, args); in the map callback. Btw, your args parameter shouldn't be an array, but should be built from the dynamic arguments object. If you want to "cheat" (or see the full solution), have a look at the annotated source code of Underscore.
has comment: http://stackoverflow.com/comment/38635540
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38637273

http://stackoverflow.com/q/24875520
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24875674
upvote count: 8
tagged with: http://stackoverflow.com/tag/html
tagged with: utf-8
favorite count: 0
score: 8
has body: randomly getting this issue come up in my web console of firefox (is the js tab) Its only just appeared and cant link it to any changes i have made. The full error is: The page was reloaded, because the character encoding declaration of the HTML document was not found when prescanning the first 1024 bytes of the file. The encoding declaration needs to be moved to be within the first 1024 bytes of the file. Or this one: The character encoding declaration of the HTML document was not found when prescanning the first 1024 bytes of the file. When viewed in a differently-configured browser, this page will reload automatically. The encoding declaration needs to be moved to be within the first 1024 bytes of the file. The issue points to this line: &lt;meta http-equiv="Content-Type" content="text/html" charset="UTF-8" /&gt; To me, that meta tag is okay? Any help as i think it is conflicting and causing issues with other things. Craig
possible better answer: http://stackoverflow.com/a/67964591
tagged with: meta
has answer: http://stackoverflow.com/a/67964591
type: AnsweredQuestion
has title: The character encoding declaration of the HTML document was not found
tagged with: character-encoding
has answer: http://stackoverflow.com/a/24875674
type: Question
answer count: 2
downvote count: 0

http://stackoverflow.com/q/24768748
accepted answer: http://stackoverflow.com/a/24768941
has answer: http://stackoverflow.com/a/24768789
upvote count: 1
downvote count: 1
type: AnsweredQuestion
tagged with: toggle
type: Question
possible better answer: http://stackoverflow.com/a/24768789
has body: How to code a js that would replace the text inside a tag? I have a dropdown mobile menu using this javascript: toggle.js $(function () { var $window = $(window), $nav = $('nav'), $button = $('button'); $button.on('click', function () { $nav.slideToggle(); }); $window.on('resize', function () { if ($window.width() > 320) { $nav.show(); } }); }); Here is the section of HTML Select Destinations Philadelphia United States of America Philippines Long Destinations Names Some Destination Australia I need "Select Destinations" to be replaced by whatever the selected button from the dropdown. ex. If i select "Los Angeles", it should replace "Select destinations" to " Los Angeles". I tried dropdown list but it looks different from differenct devices. can anyone share some info? thanks in advance.
tagged with: javascript
tagged with: drop-down-menu
has answer: http://stackoverflow.com/a/24768894
has title: How to code a js that would replace the text inside a tag?
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/24768788
has answer: http://stackoverflow.com/a/24768941

http://stackoverflow.com/comment/38672705
has text: Everything is good and working you just need to add `onclick="warp()"` to the img tag, and just so that people get to know that the image is clickable you will have to add `style="cursor:pointer;"` also to the img tag.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24868012
type: Comment

http://stackoverflow.com/q/24845468
downvote count: 0
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24845483
score: 2
has body: I have code like this: var i = 5; function x() { console.log(i); } i = 6; x();//6 (this is really simpified, but the problem remains). I know that this is how it is intended to work. Is there some way to permanenty "write" variable to function, so when I do x(), I will get 5 (the original value) and not 6 (new value, assigned after function was defined)?
type: Question
tagged with: javascript
has title: JavaScript - Immediately write variables to function
answer count: 1

http://stackoverflow.com/a/24814671
has body: Check "onblur", this is called when a Object was selected/active and then deselected. Example in HTML &lt;div onBlur="disable()"&gt;
type: Answer
score: 0
answers question: http://stackoverflow.com/q/24814611

http://stackoverflow.com/comment/38494181
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/24800811
has text: From the [manual](https://docs.angularjs.org/api/ng/service/$http): *By default, Angular applies these transformations: ... If the data property of the request configuration object contains an object, serialize it into JSON format.* So no, jquery is neither needed or recommended.

http://stackoverflow.com/a/24814146
type: Answer
score: 1
upvote count: 1
has body: Since ng-repeat creates a child scope for each item you can leverage that within a directive. The parent scope of the directive will be the child scope created by ng-repeat and therefore isolated from other repeaters Move your choose and sho out of main controller and put them into directive scope. &lt;div editable&gt; &lt;a ng-click="choose()"&gt;&lt;/a&gt; &lt;input type="text" ng-model="item.desc" ng-show="!sho" /&gt; &lt;span ng-show="sho"&gt;{{item.type}}&lt;/span&gt; &lt;/div&gt; app.directive('editable', function () { return function (scope, elem, attrs) { scope.sho = true; scope.choose = function () { scope.sho = !scope.sho; } } }); This is the simplest version possible without going to isolated scope within the directive and without considering factors like more than one of these editables in a row. For more insulated feature rich version would consider using a more robust directive like x-editable
answers question: http://stackoverflow.com/q/24813881
downvote count: 0

http://stackoverflow.com/q/24868226
accepted answer: http://stackoverflow.com/a/24869361
has answer: http://stackoverflow.com/a/31481424
has comment: http://stackoverflow.com/comment/38622300
favorite count: 0
has title: How do you mute an embedded Youtube player?
has answer: http://stackoverflow.com/a/24868516
has comment: http://stackoverflow.com/comment/46593851
tagged with: youtube-api
tagged with: youtube
answer count: 4
upvote count: 23
linked to: http://stackoverflow.com/q/8869372
type: AnsweredQuestion
has body: I'm experimenting with the Youtube player but I can't get it to mute by default. function onPlayerReady() { player.playVideo(); // Mute?! player.mute(); player.setVolume(0); } How do I mute it from the start? Fiddle Update: JavaScript Player API is deprecated. Use iframe Embeds instead.
has answer: http://stackoverflow.com/a/24869361
has comment: http://stackoverflow.com/comment/38623028
downvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/29473171
has answer: http://stackoverflow.com/a/29473171
tagged with: javascript
has comment: http://stackoverflow.com/comment/38622818
score: 22

heap-memory
tag name: heap-memory
tags question: http://stackoverflow.com/q/24782074
type: Tag

http://stackoverflow.com/a/24879355
has body: The syntax for the browsers option can be found in the main Autoprefixer documentation. The relevant bits are: Firefox &gt;= 20 is Firefox version 20 or newer. And: Browsers names (case insensitive): ... Explorer or ie for Internet Explorer. Hence, in order to target IE9 and newer, use: options: { browsers: ['ie &gt;= 9'] },
type: Answer
accepted answer of: http://stackoverflow.com/q/24878864
answers question: http://stackoverflow.com/q/24878864
score: 7
upvote count: 7
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/57787152
score: 0
type: Comment
has text: How can we see web/javascript errors? I can't find any place to see that.
type: AnswerComment
comment on: http://stackoverflow.com/a/29020891

http://stackoverflow.com/comment/38574595
has text: Put all spans in one line. Browser interprets each newline as space.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24843252

http://stackoverflow.com/q/24889498
has comment: http://stackoverflow.com/comment/38662117
accepted answer: http://stackoverflow.com/a/24889569
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has title: JavaScript - Keep trailing zeroes
has comment: http://stackoverflow.com/comment/38662146
upvote count: 29
tagged with: parsing
score: 29
has answer: http://stackoverflow.com/a/24889569
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/2433122
has body: I want to parse a string and I used parseFloat(), but it removes all the trailing zeroes. How to prevent this - I need to parse the string exactly - if I have 2.5000, I need exactly the same result as a floating-point number - 2.5000.
duplicate of: http://stackoverflow.com/q/2433122
type: Question
tagged with: trailing

http://stackoverflow.com/q/24766416
has body: I am adding these two google.maps.event.addListener events google.maps.event.addListener(markerAcademicCenter, "mouseover", function (e) { markerIconAcademicCenter.url = 'MapIcons/Circle32.png' }); google.maps.event.addListener(markerAcademicCenter, "mouseout", function (e) { markerIconAcademicCenter.url = 'MapIcons/Circle64.png' }); below this marker that already has a click event. google.maps.event.addListener(markerAcademicCenter, "click", function (e) { $(".campusMapInfoPanel &gt; div").appendTo($(".InfoStorageDiv")); $(".InfoPanelAcademicCenter").appendTo($(".campusMapInfoPanel")); this.setZIndex(google.maps.Marker.MAX_ZINDEX + 1); setZoomWhenMarkerClicked(); CampusMap.setCenter(markerAcademicCenter.getPosition()); }); The markerIconAcademicCenter.url is already set to Circle64 above these events. I expect the page to load with the larger circle — 64x64 — the switch back and forth as I hover and leave the marker area. I'm having two problems with this Nothing happens when I mouseover the marker, but it does happen when I click. On the initial click after the page loads, the map zooms and centers on the building and the marker image resizes. If I click on the building again, nothing else happens, but: if I click on a menu link that triggers the click event, function buildingFocus(markerName) {google.maps.event.trigger(markerName, "click");} that function resets the icon as if it were the mouseout event. To test this unexpected behavior further, I commented out each event one at a time. To clarify that something was actually happening, I first changed the initial image to clear.png. When I took out the mouseover event, the image did not change when I clicked either the building event or the menu link as my first click after the page loaded. Before I removed the mouseover event, clicking on the menu as my second click after page load changed the icon to the mouseout image, but now clicking on the building causes this. When I took out the mouseout event, clicking o…
has comment: http://stackoverflow.com/comment/38430201
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24767646
score: 1
upvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/24766746
has comment: http://stackoverflow.com/comment/38430006
tagged with: javascript
tagged with: jquery
tagged with: google-maps-api-3
accepted answer: http://stackoverflow.com/a/24767427
answer count: 3
has title: Google maps listener event acts like a click even though it is a mouseover
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/24767427
has answer: http://stackoverflow.com/a/24766746

http://stackoverflow.com/comment/38441821
type: AnswerComment
type: Comment
has text: :You didn't got my point friend. I don't want to show the current date as default date. I want to show the "Select" value as by defalut for all the three dropdowns.
comment on: http://stackoverflow.com/a/24772982
score: 0

http://stackoverflow.com/a/27356910
score: 1
upvote count: 1
has body: If there is only one tween you can use this createjs.Tween.removeAllTweens();
answers question: http://stackoverflow.com/q/24882150
downvote count: 0
type: Answer

http://stackoverflow.com/a/24857474
answers question: http://stackoverflow.com/q/24857325
has comment: http://stackoverflow.com/comment/38602142
has comment: http://stackoverflow.com/comment/38602546
type: Answer
has comment: http://stackoverflow.com/comment/38602306
score: 0
has comment: http://stackoverflow.com/comment/38602189
has comment: http://stackoverflow.com/comment/38602376
has body: If I have comprehended the question well, then you are trying to read the cookies set by the response header. If so, you can access the cookies using document.cookie. document.cookie will return '; ' (semi colon followed by space) delimited string for all the cookies. For example, if example.com has set the following cookies a='123' b='456' c='789' document.cookie will return a=1234; b=456; c=789 Then, you and split the value of document.cookie with split('; ') to get the array of cookies ['a=1234', 'b=456', 'c=789'] Let's consider the following code var cookies = document.cookie.split('; '); cookies.forEach(function(cookie){ var cookie = cookie.split('='); // print them to console console.log('key : ' + cookie[0] + ' value : ' + cookie[1]); // or use as per the need });

http://stackoverflow.com/q/24808928
has comment: http://stackoverflow.com/comment/38509689
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24809122
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I am unable to use local storage for javascript. This is my first time trying local storage. I have two seperate HTML docs each with their own set of javascript code. Doc 1 Javascript: Doc 1 Html New Contact Address Book Contacts </body Doc 2 JavaScript Doc 2 HTML Back Create a Contact Name: Done The Doc 2 is meant to store the name given by the user and pass it to the Local Storage. Doc 1 is then supposed to display the names that have been stored in the local storage. Whenever I try to use this, after clicking the done button on doc 2 the page just refreshes and when I go back to doc 1 no names are added. I am using the Android SDK for the coding. I have tried using local storage for a hello world document so I know that it works for SDK.
has title: javascript Local Storage not working
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38509584
has comment: http://stackoverflow.com/comment/38509526

http://stackoverflow.com/a/24902065
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/38694385
downvote count: 0
has body: I left you a response for how to do this using forge here: https://github.com/digitalbazaar/forge/issues/150 var pkey = 'some base64-encoded private key'; var pkeyDer = forge.util.decode64(pkey); var pkeyAsn1 = forge.asn1.fromDer(pkeyDer); var privateKey = forge.pki.privateKeyFromAsn1(pkeyAsn1); // above could be simplified if pkey is stored in standard PEM format, then just do this: // var pkey = 'some private key in pem format'; // var privateKey = forge.pki.privateKeyFromPem(pkey); var payload = 'some string payload'; var md = forge.md.sha1.create(); md.update(payload, 'utf8'); var signature = privateKey.sign(md); var signature64 = forge.util.encode64(signature); // signature64 is now a base64-encoded RSA signature on a SHA-1 digest // using PKCS#1v1.5 padding... see the examples for other padding options if necessary
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24893292
score: 4
answers question: http://stackoverflow.com/q/24893292

http://stackoverflow.com/comment/38546855
comment on: http://stackoverflow.com/a/24828474
score: 0
type: AnswerComment
type: Comment
has text: hey grep, thanks for your quick response. okay, also i have to use the "addEventListener("load")" method to check if the upload its ready? bye paD

http://stackoverflow.com/comment/38660793
comment on: http://stackoverflow.com/q/24888826
has text: `if (model && 'properties' in model && 'foo' in model.properties && 'bar' in model.properties.foo && model.properties.foo.bar)`
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24767492
has body: You can update location.href value for redirecting to new page.
answers question: http://stackoverflow.com/q/24767341
score: 0
type: Answer

http://stackoverflow.com/q/24879023
tagged with: google-chrome
downvote count: 1
has body: I am developing google chrome extension, that is using xmlhttprequest to use web services exposed by my web server. But if server is offline or i-net is disconnected I am not getting right "status" number. In both the cases "status" is 0 (ZERO). Where as chrome is showing ERR_CONNECTION_REFUSED in case my web server is off line and ERR_INTERNET_DISCONNECTED in case of i-net is disconnected. Is there any way that I can get these error messages in my extension? that I can display to user. Thank you.
type: AnsweredQuestion
has title: how to know communication error in google chrome extension
has comment: http://stackoverflow.com/comment/38642620
has answer: http://stackoverflow.com/a/24900950
type: Question
answer count: 1
tagged with: javascript
favorite count: 0
score: 0
tagged with: google-chrome-extension
accepted answer: http://stackoverflow.com/a/24900950
upvote count: 1

http://stackoverflow.com/a/24905121
has comment: http://stackoverflow.com/comment/38691838
upvote count: 4
downvote count: 0
score: 4
type: Answer
has body: Everything you sent to client is anyhow visible by client. There is no way to absolutely hide it from him. All you can do is .zip or encode data on server and unzip or decode it on client. But even in this case all decoding mechanisms will be available to user and if he wishes and has some skills, he can decode it and access all data you send him. UPD: Ok, you want to uglify your data so client couldn't see it simple way. You need to somehow encode data on server, send it encoded to the client, and decode on client so you could use it. Checkout lz-string - it's js library that can archive / unarchive json strings, converting them to binary format, so data becomes unreadable. And it's pretty fast (I haven't noticed any delays encoding/decoding 2Mb strings - I use it to compress data and store it in localStorage). It's as easy as LZString.compress(JSON.stringify(data)) to compress json and JSON.parse(LZString.decompress(data)) to decompress. Only thing you need in addition - to find a server-side library that uses exactly this format. If you use NodeJS at your server, you can take lz-string itself. Otherwise, quick googling gave me solution for php - I think it's pretty possible to find solutions for other languages..
answers question: http://stackoverflow.com/q/24904952

http://stackoverflow.com/comment/38658156
has text: Hi thanks for your suggestion but I am looking to edit an <image> within an , not a <circle> or anything like that. Or rather I want to know if it is possible. e.g. http://jsfiddle.net/ZMX7H/1/
comment on: http://stackoverflow.com/q/24886919
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38666969
comment on: http://stackoverflow.com/a/24892007
score: 0
type: AnswerComment
has text: No problem moving away from jQuery. It just appeared that you were using it on line 5.
type: Comment

http://stackoverflow.com/q/24906388
has comment: http://stackoverflow.com/comment/38693877
type: Question
has title: Select with link parameters only
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24906805
has body: I am trying to get a dropdown with links but I don't want to use the link filename in the url just the parameters. Here's the code: Choose an item item1 item2 If I use: item1 it will work but: How do I get it to work with it...like this: item1 ?
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38693791
has answer: http://stackoverflow.com/a/24906805
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24906617
accepted answer: http://stackoverflow.com/a/24906617
has comment: http://stackoverflow.com/comment/38693797

http://stackoverflow.com/q/24817703
type: Question
upvote count: 2
answer count: 8
has answer: http://stackoverflow.com/a/24817795
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/24817954
has answer: http://stackoverflow.com/a/24817838
has body: I have a variable called totalScore: totalScore = ' Total Score: ' + parseInt(parseFloat(scorePrompt) + parseFloat(scorePrompt2) + parseFloat(scorePrompt3) + parseFloat(scorePrompt4) + parseFloat(scorePrompt5) + ' '); I need to pass the number stored inside totalScore to a textbox. I have not found a way to pass a variable to an html element, sorry if I am missing something very obvious I am new to javascript.
linked to: http://stackoverflow.com/q/7609130
has answer: http://stackoverflow.com/a/24817725
accepted answer: http://stackoverflow.com/a/24817725
has answer: http://stackoverflow.com/a/24817740
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24817720
has comment: http://stackoverflow.com/comment/38526129
has answer: http://stackoverflow.com/a/24817750
downvote count: 3
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24817838
has answer: http://stackoverflow.com/a/24817852
has comment: http://stackoverflow.com/comment/38526245
duplicate of: http://stackoverflow.com/q/7609130
score: -1
has title: Passing Javascript variable into textbox

http://stackoverflow.com/q/24803863
score: 0
has body: This is based off of my previous question: How can I get this code to continuously loop through the items? Now I want to have numbers corresponding to each slide and have them clickable so you can go to that slide. Here's a link to my jsfiddle on what I have tried: http://jsfiddle.net/allisonc/xu9ym/ HTML: Design tips Javascript: xmlstr = " To add a photo to your project,drag the photo from the list to the opening. You can position your photo in the opening by dragging... ...and you can also edit the photo by double-clicking on it! " xml = $.parseXML(xmlstr) var items = 0; var control = ''; var tips = $('item', xml).get().map(function(item){ items++; if(items==1) control = control + ''+items+''; else control = control + ''+items+''; return $(item).text(); }); console.log(tips); $('#design-tips-controls').html(control); var currentIndex = 0; function looper() { if(currentIndex>=tips.length) { currentIndex = 0; } $('#design-tips-content').html(tips[currentIndex]) currentIndex++; } looper(); setInterval(looper, 5000); $('#design-tips-controls a').on('click', function() { $('#design-tips-content').html(tips[$(this).attr('rel')]); });
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24803995
has comment: http://stackoverflow.com/comment/38500409
type: Question
has comment: http://stackoverflow.com/comment/38500194
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/24781387
has title: How can I add clickable numbers to my slides?

http://stackoverflow.com/q/24870637
tagged with: javascript
has comment: http://stackoverflow.com/comment/38626684
answer count: 1
has answer: http://stackoverflow.com/a/24871832
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/38627427
type: AnsweredQuestion
score: 1
upvote count: 1
has title: Google Chart: Pass raw data
type: Question
has body: I have a raw data table in the Google Chart example: var data = google.visualization.arrayToDataTable([ ['Time', 'Dollar', 'BTC'], ['-4h', 1000, 400], //this should go to -24h, so I would use a loop ['-3h', 1170, 460], ['-2h', 660, 1120], ['-1h', 1030, 540] ]); Also, I got two arrays: var dollar = [2000,3000,4000]; //They both will contain 24 values var btc = [100,200,300] How do I pass the arrays to the google function?
tagged with: google-visualization
tagged with: arrays
accepted answer: http://stackoverflow.com/a/24871832

http://stackoverflow.com/q/24906122
tagged with: storage
type: UnansweredQuestion
score: 0
has answer: http://stackoverflow.com/a/24908387
type: Question
tagged with: c#
tagged with: mobile
tagged with: cloud
has body: I am developping a mobile app using Unity3D framework which is a C#/Javscript 3D engine, working on desktop and mobile plateform. I need to recover the content of an XLS file on a cloud-based storage (Dropbox or GoogleDrive), then process it on the mobile plateform to transform it into a local SQLite database. The mobile app will regulary check for modification on the remote xls file, and push it locally if needed to process it. The framework I use (Unity3D) allow me to work with both C# and Javascript technologies. What would be the best strategy to implement such a fonctionnality. I'm totally newbie with web API, and I've seen in Dropbox documentation that there is several possibilities to interact with a cloud folder. Is there a possiblity to fetch the content of an xls document into the mobile device memory (with writing to its local drive)? What would be the easiest/more elegant way to achieve it? Thanx in advance
has title: Best strategy for XLS content sync from the cloud into an iOS or Android app memory
tagged with: javascript
answer count: 1

http://stackoverflow.com/comment/38517731
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24812462
has text: @AlexC, as you can see, most of the errors are due to Bootstrap, which I haven't messed around with. There are some errors at the bottom about "being assigned a //# sourceMappingURL"
score: 0

http://stackoverflow.com/comment/38662925
type: QuestionComment
has text: i don't need to get response i just need to send request.
comment on: http://stackoverflow.com/q/24889905
score: 0
type: Comment

http://stackoverflow.com/a/41764663
has body: Just copy below code in your angularJs Project it will work fine Contact Us! Username is required. Enter a valid email. Phone Number is required. Subject is required. Enter a Message. Send
answers question: http://stackoverflow.com/q/24827995
score: 0
type: Answer

http://stackoverflow.com/a/24878260
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/38641301
has comment: http://stackoverflow.com/comment/38669704
downvote count: 0
has comment: http://stackoverflow.com/comment/38641593
has comment: http://stackoverflow.com/comment/38641901
has body: Well, besides the tons of syntax and spelling errors and not placing CSS colors in quotes (you should really use the browser console and JSHint on jsfiddle), your problem has to do with the fact that your handlers aren't applied properly. You need to use addEventHandler to make sure the event handlers are attached after your javascript is parsed. If you had checked the console, you'd have seen that they are undefined at load time, hence nothing runs. Instead of: &lt;script&gt; window.onload = style_byClass_RED_Long; &lt;/script&gt; do window.addEventListener('onload', style_byClass_RED_Long); and put that in your javascript. However, that might not work in a fiddle, so just call your functions at the bottom of your javascript and it should produce your results. For all practical purposes, it should be the same thing as using onload. here's your fiddle fixed: http://jsfiddle.net/HeCj7/9/ also, getElementsByClassName returns an array of elements, not a single one. You'll need to enumerate the elements and change each one separately. In your code, i simply changed it so that it refers to the first element only, which means your second &lt;p&gt; with that class will remain unstyled.
answers question: http://stackoverflow.com/q/24878178
score: 1
accepted answer of: http://stackoverflow.com/q/24878178
type: AcceptedAnswer

http://stackoverflow.com/a/29317885
upvote count: 1
answers question: http://stackoverflow.com/q/24788349
score: 1
downvote count: 0
type: Answer
has body: I think I found what is the problem with bookmarklets in IE11. I just added a bookmarklet in IE11 and it wasn't working so I started googling and found this page. Then I found bookmarklets at Microsoft's own website where they actually recommend to use it and it works. Then I decided to check if the syntax is correct and this where I found a problem. For some reason IE cuts part of long bookmarklets when it adds it to the toolbar by draggin-dropping. My bookmarklet that I was tried to add was several brackets short of original and because of that the syntax was incorrect. I then copy-pasted full code manually and it started working.

http://stackoverflow.com/q/24749566
type: AnsweredQuestion
tagged with: audio
has body: Im trying to create an audio preview page on my webpage where each audio element has its own progress bar. Im having trouble however, getting each audio element to target only its progress bar. I am pretty new to this, so I hope this isn't too much a straight forward dumb question, but I'd really appreciate the help, Thanks in advance. This is the html for each song preview. SONG NAME HERE SONG NAME HERE and this is the JS $(document).ready(function() { var myAudio = document.getElementById("player"); //play stop button etc. $(document).on('click', '.soundPlay', function(e) { var target = this; $(this).hide(); $(this).next("a").show(); myAudio.src = target.parentNode.getAttribute('data-src'); myAudio.play(); e.preventDefault(); }); $(document).on('click', '.soundStop', function(e) { var target = this; $(this).hide(); $(this).prev("a").show(); $('audio').each(function(){ this.pause(); this.currentTime = 0; }); e.preventDefault(); }); //end of play stop button //seekbar $('#player').on('timeupdate', function() { $('.seekbar').attr("value", this.currentTime / this.duration); }); //end seek bar //auto switch button on stop var audio = document.getElementById('player'); audio.addEventListener('ended', stopAudio); function stopAudio() { audio.stop; $('.soundPlay').show('slow'); $('.soundStop').hide('fast'); $('.seekbar').attr(this.currentTime = 0); } }); I just cant seem to figure out how to target only the progress tag in each respective div. Is there anyway I can do this without a million different progress IDs and overly repetitive JS code? ( because there's gonna be like 100 of those song previews on a page ) Thanks in advance!
score: 1
has answer: http://stackoverflow.com/a/24749820
has comment: http://stackoverflow.com/comment/38398054
type: Question
upvote count: 2
answer count: 1
downvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: progress-bar
has comment: http://stackoverflow.com/comment/38397954
tagged with: progress
accepted answer: http://stackoverflow.com/a/24749820
has comment: http://stackoverflow.com/comment/38398298
has title: How do I target this specific progress tag?

http://stackoverflow.com/q/24809786
has comment: http://stackoverflow.com/comment/38513124
has comment: http://stackoverflow.com/comment/38512784
type: Question
has title: Different ways of extending classes in node.js
linked to: http://stackoverflow.com/q/23807805
has body: Extending prototypical classes in node.js or javascript in general. (js newb) I was looking at the source-code of expressjs and saw this: var mixin = require('utils-merge'); .... mixin(app, proto); mixin(app, EventEmitter.prototype); Utils-merge seems like an external module. What are the difference of above and just doing something like: var util = require('util'); .... util.inherit(app, proto); util.inherit(app, EventEmitter); And is this still trying to extend properties? I'm kind-a lost here: app.request = { __proto__: req, app: app }; // what is the equivalent for this in util? app.response = { __proto__: res, app: app }; If so, will that still work even if util.inherit is used? app.request = util.inherit(app, req) Or something like that? jshint says __proto__ is depricated. Additionally I also saw this? var res = module.exports = { __proto__: http.ServerResponse.prototype }; Could this be? var res = module.exports = util.inherits...??
linked to: http://stackoverflow.com/q/24869267
accepted answer: http://stackoverflow.com/a/24811424
upvote count: 4
answer count: 2
has comment: http://stackoverflow.com/comment/38513022
has comment: http://stackoverflow.com/comment/38513133
linked to: http://stackoverflow.com/q/23626625
downvote count: 0
tagged with: javascript
score: 4
favorite count: 0
has answer: http://stackoverflow.com/a/24810169
possible better answer: http://stackoverflow.com/a/24810169
tagged with: node.js
has comment: http://stackoverflow.com/comment/38513011
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24811424

http://stackoverflow.com/q/24858250
linked to: http://stackoverflow.com/q/19070527
favorite count: 0
tagged with: foursquare
tagged with: http://stackoverflow.com/tag/html
score: 2
answer count: 0
has comment: http://stackoverflow.com/comment/38604351
upvote count: 2
type: UnansweredQuestion
tagged with: php
type: Question
has title: Foursquare - Less number of menus are displayed in venues 'Good Stuff Diner' in API Explorer
has comment: http://stackoverflow.com/comment/38604379
has body: We have searched the venues 'Good Stuff Diner' in foursquare website and it displayed the venues 'Good Stuff Diner'. FYI, Please see the url: https://foursquare.com/v/good-stuff-diner/4a1b592ef964a520ee7a1fe3 From the above url, we have clicked the link 'View Menu' to visit all the menus for the venues 'Good Stuff Diner'. Please see all the menus from this url: https://foursquare.com/v/good-stuff-diner/4a1b592ef964a520ee7a1fe3/menu for the venues 'Good Stuff Diner'. By using the above search we have got the venue id 4a1b592ef964a520ee7a1fe3. Displaying less number of menus for the venues 'Good Stuff Diner' in API Explorer: We have used the endpoints venues/VENUE_ID/menu to get the menus for the venues 'Good stuff diner'(4a1b592ef964a520ee7a1fe3) in API Explorer window but we didn't get more number of menus as it is in the manual search. Can anyone please assist our request why the menus results are very less in api explorer for the above endpoints and give us the steps to do for some other way to get 'all menus' as it is shown in manual search. Thanks, Bargavi
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/38441424
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24765446
has text: Please see **Update3**
score: 0

http://stackoverflow.com/comment/38498996
type: QuestionComment
type: Comment
has text: What is the try/catch supposed to achieve ?
comment on: http://stackoverflow.com/q/24803494
score: 0

http://stackoverflow.com/q/24846521
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/24846539
answer count: 1
downvote count: 3
has body: I'm having some trouble getting JavaScript code to fire for select HTML tables on a page. The idea is to have all tables with the class stripe_table be styled by a few JavaScript functions. The JavaScript fires with this in the HTML: &lt;body onload=searchPage()&gt; The searchPage function looks for all elements with the stripe_table class and passes them to some styling functions. function searchPage() { var table = document.getElementsByClassName('stripe_table'); //Pass the table nodelist to the styling functions. styleTable(table); hoverColorChange(table); } Currently it's only styling one table out of the two on the page. The styleTable function is below: The hoverColorChange function is below:
tagged with: javascript
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38580196
has title: JavaScript not firing on multiple class elements
favorite count: 0
score: -1
has comment: http://stackoverflow.com/comment/38580312

http://stackoverflow.com/comment/38461822
type: Comment
type: AnswerComment
has text: @JoaoEvangelista Besides this, I also have tried add this line: `jsp_dispatcher.setMultipartConfig(new MultipartConfigElement("/tmp", 1024*1024*5, 1024*1024*5*5, 1024*1024));` to my WebAppInitializer, but still got the same error when I redeploy the application.
score: 0
comment on: http://stackoverflow.com/a/24780173

http://stackoverflow.com/comment/38772943
type: AnswerComment
comment on: http://stackoverflow.com/a/24921262
type: Comment
has text: Sorry, pretty new to this. I think I added the rest of the HTML (at least that is all that shows up with the Safari's inspector). If not, how do I find the button-id?
score: 0

http://stackoverflow.com/q/24879497
has comment: http://stackoverflow.com/comment/38643527
accepted answer: http://stackoverflow.com/a/24904968
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/38643563
upvote count: 2
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38643456
tagged with: carousel
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/24904968
has body: Having an issue using Slick carousel, am trying to use the fade effect but for some reason the images just all appear listed vertically in a column. http://jsfiddle.net/Q4srX/6/ I was able to get the auto play effect working (along with the other sliders) as described on the website (http://kenwheeler.github.io/slick/) but as soon as I tried fade I got the result listed above. Any ideas or help resolving this? javascript {% block javascripts %} {% javascripts 'bundles/symfony/js/slick.min.js' %} {% endjavascripts %} {# Slick Carousel #} {% endblock %} html {% block carousel %} {% endblock %}
has comment: http://stackoverflow.com/comment/38643610
type: Question
has comment: http://stackoverflow.com/comment/38643824
tagged with: javascript
tagged with: jquery
has title: Slick carousel - fade effect not working

http://stackoverflow.com/comment/38646564
type: QuestionComment
comment on: http://stackoverflow.com/q/24880999
score: 0
has text: Why you split `inputID[i]` by `'-'`?
type: Comment

http://stackoverflow.com/q/24822203
answer count: 2
has title: can anyone tell me how this syntax is called and what it does?
has comment: http://stackoverflow.com/comment/38534357
has comment: http://stackoverflow.com/comment/38534379
favorite count: 0
accepted answer: http://stackoverflow.com/a/24822457
upvote count: 4
duplicate of: http://stackoverflow.com/q/12878612
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24822457
has body: I was reading through Ionic's source and stumbled on this part here. fromTemplateUrl: function(url, options, _) { var cb; //Deprecated: allow a callback as second parameter. Now we return a promise. if (angular.isFunction(options)) { cb = options; options = _; } return $ionicTemplateLoader.load(url).then(function(templateString) { var modal = createModal(templateString, options || {}); cb &amp;&amp; cb(modal); return modal; }); } What's the syntax in line 10 , "cb &amp;&amp; cb(modal);" , called and what does it do? The conditional &amp;&amp; is confusing me
downvote count: 0
linked to: http://stackoverflow.com/q/12878612
type: Question
possible better answer: http://stackoverflow.com/a/24822448
has answer: http://stackoverflow.com/a/24822448
has comment: http://stackoverflow.com/comment/38534372
tagged with: javascript
score: 4

http://stackoverflow.com/comment/38502421
comment on: http://stackoverflow.com/q/24805196
score: 0
type: Comment
has text: Why don't you use ng-model with checkbox and radio?
type: QuestionComment

http://stackoverflow.com/comment/38507866
type: QuestionComment
comment on: http://stackoverflow.com/q/24807581
score: 0
has text: It makes a lot of sense because of the things that are missing. But if so, I could open the app with Firefox if I chose it as the default browser. And I tried that just right now, and it looks the same... I will continue investigating...
type: Comment

http://stackoverflow.com/q/24886906
has body: I am trying to display a time in the current named timezone using moment timezone. The time is stored in the database in UTC as 2014-07-22 11:11:06. Whatever I try I cannot display the time as 12:11 even though the named timezone is Europe/London. var timestamp = 1406023866000; // converted from database stored as UTC 2014-07-22 11:11:06 var zone = tz.name(); // Europe/London var utc = moment(timestamp); // create a moment from the timestamp var time = utc.tz(zone); // _d: Date {Tue Jul 22 2014 12:11:06 GMT+0100 (GMT Standard Time)} // _f: undefined // _i: 1406023866000 formatted = time.format('h:mma'); // 11:11am - should be 12.11pm because of BST
tagged with: date
type: Question
score: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38656917
has title: Moment.JS display formatted time from named timezone
tagged with: momentjs
has answer: http://stackoverflow.com/a/24887250
has comment: http://stackoverflow.com/comment/38657000
accepted answer: http://stackoverflow.com/a/24887250
type: AnsweredQuestion

http://stackoverflow.com/comment/38452223
has text: Could you please add explanation to why this is good solution to the problem.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24778042

http://stackoverflow.com/q/24859104
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: jquery
tagged with: chaining
favorite count: 0
accepted answer: http://stackoverflow.com/a/24859128
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: Here is my html A B C A B C A B C JS: Im getting product_percentage value correctly, but not able to get product_name value.
answer count: 2
upvote count: 1
has title: jquery chaining not working in my html with each function
has answer: http://stackoverflow.com/a/24859128
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24859121
has answer: http://stackoverflow.com/a/24859121

http://stackoverflow.com/q/24823508
type: Question
has body: Hi I'm working on a function that is sorting my JSON object by the lowest price. This is how the structure looks like { "successful": true, "products": [ { "id": "47", "name": "HP LP3065", "price": "$119.50", "description": "", "special": false, "rating": 0 }, { "id": "43", "name": "MacBook", "price": "$589.50", "description": "", "thumb": "data/demo/macbook_1.jpg", "special": false, "rating": 0 } ] } And this is how my current sorting function looks like data.products.sort(function(a, b){ if (a.price.substr(1, a.price.length) === b.price.substr(1, b.price.length)) { if (a.price.substr(1, a.price.length) &gt; b.price.substr(1, b.price.length)) { return b; } return a; } }); The current function i have done is not work, so do you guys have any suggestions?
has comment: http://stackoverflow.com/comment/38537220
has answer: http://stackoverflow.com/a/24823760
tagged with: javascript
tagged with: sorting
has title: Javascript: Sorting JSON object by lowest price
has comment: http://stackoverflow.com/comment/38538679
has comment: http://stackoverflow.com/comment/38539048
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38538813
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38536743
has comment: http://stackoverflow.com/comment/38536768
upvote count: 2
tagged with: http://stackoverflow.com/tag/json
downvote count: 2
has comment: http://stackoverflow.com/comment/38536782
has comment: http://stackoverflow.com/comment/38536839
has answer: http://stackoverflow.com/a/24823636

http://stackoverflow.com/comment/38628107
comment on: http://stackoverflow.com/a/24859911
has text: If putting `required` trigger html5 validation, that means that Parsley is not loaded or that js is broken. Please look your console to see what happens.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/24771334
has comment: http://stackoverflow.com/comment/38439529
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38439189
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/24771277
has body: You should be able to utilize the various options available in the dateFormat options. Full reference is available on the jQueryUI website - http://jqueryui.com/datepicker/#date-formats and the API site - http://api.jqueryui.com/datepicker/#option-dateFormat The format of D M dd yy should give you what you want. Sample code: $( ".selector" ).datepicker({ dateFormat: "D M dd yy" });
has comment: http://stackoverflow.com/comment/38439423
answers question: http://stackoverflow.com/q/24771277

http://stackoverflow.com/comment/38480754
type: Comment
comment on: http://stackoverflow.com/a/24791182
type: AnswerComment
score: 0
has text: Thank you for your reply. Most of the script I found in other Stack Overflow questions and slowly pieced them together bit by bit to accomplish what I had so far. I will note what terms to use going on though!

http://stackoverflow.com/a/24844333
type: Answer
answers question: http://stackoverflow.com/q/24799297
has body: What controller doing is here looks like a utility to me. Could have been easily managed by a global level singleton. I see some issues in first glance. Code repetition, assuming you would creating separate Controller for different types of Models and Views, makeView and getModel code needs to be repeated for each controller. If you extending from a BaseController, then you need to pass View and Model Class to getModel and makeView functions. How do you handle a use-case where you have to use same model in different Views? makeView and getModel is designed assuming for each makeView there would be a getModel call, in assumed order I would rather write a utility function which can create and deploy views for me. var deployView = function(view, config){ //do the view rendering view.render(); view.$el.appendTo(config.el); } var createView = function(config) { var view; var viewType = 'model'; if (config.collection || config.Collection) { viewType = 'collection'; } if (viewType === 'model') { if (config.Model) { config.model = new config.Model(config.modelAttributes); //fetch if needed } } else { if (config.Collection) { config.collection = new config.Collection(config.items); //fetch if needed } } var filteredConfig = _.omit(config, 'Collection', 'Model', 'View'); view = new config.View(filteredConfig); deployView(view, filteredConfig) }
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/38576981
upvote count: 3

http://stackoverflow.com/a/24787236
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24787008
upvote count: 2
answers question: http://stackoverflow.com/q/24787008
type: Answer
score: 2
has body: The .replaceChild method accepts the replacement as the first argument and the child to be replaced as the second. You have them reversed, which is causing the error. Furthermore, if the intent is to swap, you'll need to hold a reference to the original position of y, since once you move it, it'll be forgotten. This will work for most cases: var yPar = y.parentNode, ySib = y.nextSibling; x.parentNode.replaceChild(y, x); yPar.insertBefore(x, ySib); Keep in mind, that there's an additional issue to consider. It won't be an issue as long as the two nodes have different parents, but if the share a parent, and are adjacent to each other, and the cached nextSibling is the same as x, then it'll have no effect. So you'll need to test for this if that may be a possibility, and handle that special case.
type: AcceptedAnswer

http://stackoverflow.com/comment/38654450
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24884667
has text: @USER3760741 just updated the answer with a jsbin link you can check these.
score: 0

http://stackoverflow.com/a/24795863
answers question: http://stackoverflow.com/q/24794860
upvote count: 1
type: Answer
has body: I am no expert on Meteor.js but I am an addict. I believe it can be achieved by using a Client only Meteor.Collection http://docs.meteor.com/#meteor_collection Here are some similar questions on stackoverflow: Client-side-only reactivity with Meteor? How to sort a client-side-only (local) Meteor Collection and then using Meteor Methods: http://docs.meteor.com/#methods_header https://stackoverflow.com/a/13145432/1147242 to do all the CRUD to your sailsjs API. Here is a video from Eventedmind on Local Collections : https://eventedmind.com/classes/how-to/meteor-how-to-publish-to-a-client-only-collection And on Meteor.Methods: https://eventedmind.com/feed/meteor-methods Hopefully it will help.
downvote count: 0
score: 1

http://stackoverflow.com/q/24875855
answer count: 2
tagged with: jquery
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has title: Disable certain javascript code only to mobile devices
has answer: http://stackoverflow.com/a/24876006
has body: I have a javascript code to rotate several divs using the .fadeOut .fadeIn functions and I have those same divs float on the sidebar so the position stays fixed while you scroll. This works perfectly when the window is larger than 980px but starts to overlap when on mobile devices. I was wondering if someone would be able to help me out with a code to have the the scroll function not run when the window is less than 980px. Below is the script i am using to fix the sidebar while scrolling. $(function(){ var stickyRibbonTop = $('.rotate').offset().top; $(window).scroll(function(){ if( $(window).scrollTop() &gt; stickyRibbonTop ) { $('.rotate').css({position: 'fixed', top: '0px'}); } else { $('.rotate').css({position: 'relative'}); } }); }); The test site is am using is beta.badsentinel.com. Please check and shrink the window size to get a better idea of what i am talking about. The sidebar will start to overlap. thanks in advance.
score: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/24875888
tagged with: javascript
has comment: http://stackoverflow.com/comment/38636675

http://stackoverflow.com/a/24918765
downvote count: 0
answers question: http://stackoverflow.com/q/24885887
upvote count: 2
type: AcceptedAnswer
has body: You are much better off using data-binding. The idea here is to make your element model-driven, an model-view-presenter (MVP) pattern. The model is made up of properties in your element, the view is described by the template, and the presenter is in your script. Data-binding allows us to loosely couple the view from the logic. Let's decide the current page will be controlled by a property called page. Then we can set up our UI to be driven by the page property: &lt;core-menu selected="{{page}}" valueattr="id"&gt; ... &lt;/core-menu&gt; &lt;core-animated-pages class="main" selected="{{page}}" valueattr="id" transitions="slide-from-right"&gt; This is good because we have decoupled the UI from the code. The code never talks directly to the core-animated-pages or the core-menu (notice I removed the ids). We don't listen to any events. This way we can change the UI at will without having to modify the script. Now, we want the page to be initially selected by the URL, so we'll initialize it that way, or default to 'home'. We also want to synchronize page to back events, so we'll listen to `onpopstate'. ready: function() { // scrape the initial page off the window location this.page = location.hash.slice(1) || 'home'; // listen for 'back' events addEventListener('popstate', this.popstate.bind(this)); }, popstate: function(event) { // comes here whether we went 'back' from code or UI this.poppedPage = this.page = event.state; } We keep track of poppedPage so we can differentiate back and forward. We only want to push a new state when we go forward. Now we need the page to be reflected in the history, so we need to push state when the page changes. As above, the one caveat is that we need to only push the state if we are going forward. pageChanged: function() { // if the selected page changes, push a state (unless we are going backward) if (this.poppedPage !== this.page) { history.pushState(this.page, "Title", '#' + this.page); } } Here it is all put together: http://jsbin.c…
has comment: http://stackoverflow.com/comment/38719706
type: Answer
has comment: http://stackoverflow.com/comment/38718800
has comment: http://stackoverflow.com/comment/38727405
accepted answer of: http://stackoverflow.com/q/24885887
score: 2

http://stackoverflow.com/q/24795372
type: Question
linked to: http://stackoverflow.com/q/203198
upvote count: 0
has comment: http://stackoverflow.com/comment/38484536
tagged with: javascript
tagged with: jquery
has body: This may be a duplicate question but i can't solve this problem. navbar.php: Create New User and in my main php file i enclude navbar.php as follow. <?php $this->load->view("includes/headTag"); ?> <?php $this->load->view("includes/dashboard_navbar.php"); ?> <?php $this->load->view("includes/sub_dashboard.php"); ?> <?php $this->load->view("includes/main_dashboard.php"); ?> <?php $this->load->view($path); ?> <?php $this->load->view("includes/footerScripts.php");?> now using a test.js file i change the value of $path and load a new file. The problem is jquery events are not registered to file contents and html elments added dynamically. I know about $("parent-selecter").on("event","child-selecter",callback(){}); but here i'm totally confused what to do. Should i use something like $("body").on("event","child-selecter",callback(){}); or? Any help is appreciated
favorite count: 0
has answer: http://stackoverflow.com/a/24795401
has comment: http://stackoverflow.com/comment/38484445
tagged with: events
has comment: http://stackoverflow.com/comment/38484494
answer count: 4
has title: jquery event not registered to dynamically added elements
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24795400
has comment: http://stackoverflow.com/comment/38484395
has comment: http://stackoverflow.com/comment/38484605
duplicate of: http://stackoverflow.com/q/203198
has answer: http://stackoverflow.com/a/24795397
downvote count: 1
has answer: http://stackoverflow.com/a/24795411
score: -1

http://stackoverflow.com/comment/38620484
comment on: http://stackoverflow.com/a/24867256
has text: what you need in separate file? can you plz explain in detail?
type: AnswerComment
score: 0
type: Comment

moovweb
tags question: http://stackoverflow.com/q/24902069
type: Tag
tag name: moovweb

http://stackoverflow.com/q/24819528
tagged with: javascript
has title: Alternative for checking module before using `>>`?
has body: In- Java , C# , Javascript : AFAIU - the &gt;&gt; is a shift right operand which can deal also with signed numbers : There is no problem with : 12&gt;&gt;2 --&gt; 3 And also for signed number : -12&gt;&gt;2 --&gt; -3 But when the decimal result is not an integer , the result are differnt: 10&gt;&gt;2 --&gt; 2 Whereas -10&gt;&gt;2 --&gt; -3 I'm fully aware why it is happening (via Two's complement ) , but : Question : Does it mean that when I use the fastest division ever &gt;&gt; - I must check that : 10%4 is not zero ? Am I missing something here ?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24819774
score: 0
has comment: http://stackoverflow.com/comment/38550383
type: Question
tagged with: c#
tagged with: java
tagged with: bitwise-operators
has comment: http://stackoverflow.com/comment/38531627
linked to: http://stackoverflow.com/q/6357038
has answer: http://stackoverflow.com/a/24819774
answer count: 1

http://stackoverflow.com/comment/38463950
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24783343
has text: This is a screen shot of what i want and what i have. The RED cercle is the "compet.eventCode" . The GREEN cercle is what it s displayed, and i want to remove the duplicate content this is the link of the screen : http://hpics.li/d44d002
score: 0

http://stackoverflow.com/comment/38438607
has text: Your function either needs to return those variables, so other JS code can use them, or do the setting inside the function, which can be found in the other answer I linked.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24771264
type: QuestionComment

http://stackoverflow.com/comment/38418625
score: 0
has text: In what way? I don't understand how the code snippet you posted makes `num` "act like a static variable".
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24760490

http://stackoverflow.com/comment/38520336
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24814217
has text: Cool yea. I guess I was looking more for a solution like this: http://plnkr.co/edit/dVuD7eZ6gYtAYckqT3D9?p=preview (forked your example)

http://stackoverflow.com/comment/38436558
has text: Thanks guys.. I tried doing the following but I kept getting the file not found message..I am not sure why.. $("ul").append(' '+''+mydata.results[i].url+''+ ' ');
comment on: http://stackoverflow.com/q/24770101
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38470955
comment on: http://stackoverflow.com/q/24787132
type: Comment
type: QuestionComment
has text: Thanks a lot. Changing the event to mouseup solved the problem.
score: 1

http://stackoverflow.com/a/24753997
has comment: http://stackoverflow.com/comment/38410590
has comment: http://stackoverflow.com/comment/38411791
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24753815
has comment: http://stackoverflow.com/comment/38410785
has body: Try this: $(function(){ $("#tabs li a").click(function(){ $(".newscontainer").hide(); var myDiv = $(this).attr("href"); $(myDiv).show(); }); }); Using JavaScript: add onclick event to your anchor tag like below: Alumni JSFIDDLE DEMO-jQuery JSFIDDLE DEMO-JavaScript
has comment: http://stackoverflow.com/comment/38410727
type: Answer
answers question: http://stackoverflow.com/q/24753815
upvote count: 1
score: 1

http://stackoverflow.com/comment/38443554
type: Comment
has text: try creating a fiddle for better results
type: QuestionComment
comment on: http://stackoverflow.com/q/24773577
score: 0

http://stackoverflow.com/a/24849976
upvote count: 2
type: Answer
score: 1
downvote count: 1
answers question: http://stackoverflow.com/q/24849649
has body: Don't create non-standard expando attributes. HTML 5 introduces the data-* attribute set which is designed for adding custom data to HTML elements. &lt;input type="button" value="test btn" data-asd="something"&gt; You can then access them through the dataset property. var button = document.querySelector('input'); alert(button.dataset.asd); If you want to support old browsers, you can use getAttribute: var button = document.querySelector('input'); alert(button.getAttribute('data-asd')); Or a library with a compatibility routine, such as jQuery: var button = $('input'); alert(button.data('asd'));

http://stackoverflow.com/comment/38560930
type: Comment
type: QuestionComment
has text: Although Adam's solution is probably the way to go, if you need to change the dimensions on demand, bootstrap emits an event you can hook onto. See line 117 for the name and event object it passes. https://github.com/twbs/bootstrap/blob/master/js/carousel.js
comment on: http://stackoverflow.com/q/24836022
score: 0

http://stackoverflow.com/comment/38589886
has text: no change sadly shouldn`t it be `.find(' ')`? If you have the time you could check it out via teamviewer?
comment on: http://stackoverflow.com/a/24851178
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/24873676
tagged with: ajax
has comment: http://stackoverflow.com/comment/38633565
score: 0
type: UnansweredQuestion
has body: I have searched high and low, found some great solutions....but for some reason they do not work for me. Basically on a div hover event I want to draw a polyline based on the coordinates geo coded and retrieved by database. Now, the console appears to display the array elements fine, but I do think this is the problems I can't find. I think I am passing an incorrectly constructed array to create a LatLng object. So here is my map: wgmpmap = new google.maps.Map(document.getElementById("wgmpmap"), mapOptions); Here is my function: function highlightRoute(zip,locationId){ jQuery.ajax({ type: "GET", url: "goGetRoute.php?location_id=" + locationId + "&amp;zip=" +zip, dataType: "text", //expect html to be returned success: function(response){ var drivePathCoords = []; var tmpCoords = response.split("|"); for (i = 0; i &lt; tmpCoords.length; i++) { var tmpLatLng = tmpCoords[i].split(","); drivePathCoords.push(new google.maps.LatLng(tmpLatLng[0], tmpLatLng[1])); } console.log(drivePathCoords.toString()); var drivePath = new google.maps.Polyline({ path: drivePathCoords, geodesic: true, strokeColor: '#008457', strokeOpacity: 1.0, strokeWeight: 2 }); drivePath.setMap(wgmpmap); }//end success function }); //end ajax call } Here is the PHP script that AJAX sends a request to (only interested in the first route): /////First geocode given zipcode $tmpZip = json_decode(file_get_contents("https://maps.googleapis.com/maps/api/geocode/json?address=$_GET[zip]")); $tmpZipLat = $tmpZip-&gt;results[0]-&gt;geometry-&gt;location-&gt;lat; $tmpZipLng = $tmpZip-&gt;results[0]-&gt;geometry-&gt;location-&gt;lng; $fromLatLng = "$tmpZipLat,$tmpZipLng"; $dbhost = 'localhost'; $dbuser = 'user'; $dbpass = 'pass'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die('Error connecting to mysql'); mysql_select_db("myDB",$conn); $locMatchesQuery = mysql_query("SELECT location_latitude, location_longitude FROM wp_map_locations WHERE location_id = '$_GET[location_id]'"); if(mysql_num_rows($locMatchesQue…
tagged with: php
tagged with: maps
has comment: http://stackoverflow.com/comment/38633225
has comment: http://stackoverflow.com/comment/38632786
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/38633275
tagged with: javascript
has title: Build array of coordinates with Google Maps API V3
has comment: http://stackoverflow.com/comment/38633761
has comment: http://stackoverflow.com/comment/38632942

http://stackoverflow.com/comment/38608142
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24859083
has text: App History is getting manages with places getting mapped with PlaceHistoryMapper and it is getting binded. The main problem is to create history with Pagination as it doesn't have valuechanger rather it is working on nextPage, previousPage, lastpage, etc....

http://stackoverflow.com/a/24802774
answers question: http://stackoverflow.com/q/24802645
type: AcceptedAnswer
score: 0
has body: change the success parameter of the request to use the xmlParser function (forgot () ): var requestOptions = { type: "GET", //The method url: "Course_Valute_02-07-2014.xml", //It is reference on xml file dataType: "xml", //The type of data crossDomain: true, //Allow to do the cross-domain request success: xmlParser(data) //Calling function };
type: Answer
accepted answer of: http://stackoverflow.com/q/24802645

http://stackoverflow.com/a/24892788
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24892640
answers question: http://stackoverflow.com/q/24892640
has body: Your newurl probably needs a http:// or https:// in front of it. Or you can grab the protocol from the current location: newurl = window.location.protocol + '//' + serverused + '/sites/' + node.id + '/edit' You can also use string interpolation in Coffeescript (requires double quotes): newurl = "#{window.location.protocol}//#{serverused}/sites/#{node.id}/edit"
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/38668683
score: 1
upvote count: 1

http://stackoverflow.com/q/24909114
has comment: http://stackoverflow.com/comment/38698850
accepted answer: http://stackoverflow.com/a/24911133
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/121573536
answer count: 3
has title: Why are non-ASCII characters displayed as weird symbols?
linked to: http://stackoverflow.com/q/11141136
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38701893
has comment: http://stackoverflow.com/comment/74018648
has body: I have two cases here: My database contains a lot of information which I want to fetch to the page. Some of this information is name which contain non-ASCII characters like Uwe Rülke - Old solution which works well: I fetch the data from the database and populate the page directly from a VB while loop. In this case all the chars are displaying correctly Uwe Rülke. - New solution which doesn't work properly: The VB While loop doesn't throw the data directly to the page, rather in a JavaScript strings (to enhance performance by not calling the database each now and then). But when I used the information stored in the JavaScript variables, I got something like this: Uwe R�lke. In both cases, the page's encoding is: Where did I go wrong? This is the code used to fetch (from the database) and then save to JavaScript strings. I'm using AJAX LOAD from a page called ISEquery to build a specific request and query it from the database. It is used to either fetch data as an Excel file or as plain HTML. At this point the characters are well represented. Then the magic happens, and the characters get mis-represented. I checked it in the exctractFields function: $(" ").load("ISEquery.asp?isExcel=0&" + info, function(){ // Extracting the fields into an array var rows = ""; var options = ""; $(this).children().each(function(index){ var fieldsArray = exctractFields($(this).html()); rows += createISELine(fieldsArray); options += createISELine_ComboBox(fieldsArray); }); });
upvote count: 3
tagged with: non-ascii-characters
has comment: http://stackoverflow.com/comment/38699086
has comment: http://stackoverflow.com/comment/38700638
possible better answer: http://stackoverflow.com/a/24909427
has answer: http://stackoverflow.com/a/24909427
has comment: http://stackoverflow.com/comment/38699148
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/38701838
has answer: http://stackoverflow.com/a/24909277
has answer: http://stackoverflow.com/a/24911133
type: Question
linked to: http://stackoverflow.com/q/330331

http://stackoverflow.com/a/24842317
has body: Not sure if you saw bradstewart's response in IRC, just in case, here it is again: Web.Inbox.get('task_entries') This accessor fires an AJAX request, but it's asynchronous. It doesn't return the value you're looking for because that value is still being loaded from the server. As Brad pointed out, the accessor returns the Batman.Request object, not the value from the server. What you could do is make the accessor return a Batman.Set, then also use the accessor to fire a Batman.Request which will load records into that Set. When the set is updated, your view will be updated too. For example: @classAccessor 'task_entries', -&gt; @_entries = new Batman.Set new Batman.Request url: "/inbox" method: "GET" success: (data) =&gt; records = Web.TaskEntry.createMultipleFromJSON(data) @_entries.add(records...) # if you're on master branch, you could use `@_entries.addArray(records)` return @_entries This will cause the accessor to return a Set, which is empty at first, but the Set will be populated by the Batman.Request and your view will be updated. (oops, cross-posted from gist)
has comment: http://stackoverflow.com/comment/38577330
type: Answer
answers question: http://stackoverflow.com/q/24836658
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24836658

http://stackoverflow.com/comment/38438608
has text: no problem, appreciate it. glad you found a solution.
type: Comment
comment on: http://stackoverflow.com/a/24770936
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38487251
has text: Also, please don't mix PHP terminology with javascript. It confuses people who you want to help you answer this. The `id` attribute does not belong to any array at all. It belongs to an object. So the "attribute of the same array" phrase makes zero sense to people who work with javascript a lot.
comment on: http://stackoverflow.com/q/24796333
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24798902
accepted answer: http://stackoverflow.com/a/25364946
type: Question
answer count: 2
score: 5
downvote count: 0
tagged with: javascript
has body: In the Prestashop backend I activated the webservice and I created an authentication key. Testing in browser works well but now I want to access the webservice via JavaScript in a Cordova application. The response I am getting is 401 (Unauthorized). I'm performing this ajax call (using AngularJS): $http.get('http://AUTHENTICATION_KEY@url.com/api/employees/2', {}) How do I have to send the authentication key? I've been searching on the Internet but I did not found anything interesting that solves my problem.
has answer: http://stackoverflow.com/a/25364946
favorite count: 0
tagged with: cordova
tagged with: web-services
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24816120
has title: Access Prestashop webservice from JavaScript
tagged with: prestashop
upvote count: 5
has answer: http://stackoverflow.com/a/24816120

http://stackoverflow.com/comment/38403957
comment on: http://stackoverflow.com/q/24752825
score: 0
has text: @Barmar G im tired... that IS a misspelling... ill just go to sleep now.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38545395
has text: @BeaverusIV no it's not the latest in fact I think they are on 7.1 something
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24815220

http://stackoverflow.com/q/24836384
answer count: 3
has answer: http://stackoverflow.com/a/24996837
has comment: http://stackoverflow.com/comment/38626206
has title: Download External Resource - Rename File
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38807849
tagged with: php
score: 11
linked to: http://stackoverflow.com/q/3499597
upvote count: 11
has answer: http://stackoverflow.com/a/24983432
has comment: http://stackoverflow.com/comment/38806940
has comment: http://stackoverflow.com/comment/38626031
has comment: http://stackoverflow.com/comment/38798216
has comment: http://stackoverflow.com/comment/38626385
has comment: http://stackoverflow.com/comment/38816012
linked to: http://stackoverflow.com/q/17694807
has comment: http://stackoverflow.com/comment/38627591
has comment: http://stackoverflow.com/comment/38625806
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38625988
has comment: http://stackoverflow.com/comment/38626317
has comment: http://stackoverflow.com/comment/38625900
has answer: http://stackoverflow.com/a/24982716
has comment: http://stackoverflow.com/comment/38786582
has body: I have a site where users are prompted to download files from external resources. Since the external file names are hashed and the user downloads multiple files, it's very hard for users to know which file they download reaches what resource they requested. For instance, the file name of fdae442dafe42.zip could be production-resources.zip. I'm looking for ways to have it so the browser will download the file as a different name. Below are some of my ideas and why they won't work, but you may be able to find a workaround. Just a note, I don't have any control over the external resource. I won't be able to make changes to the headers or anything else. My service is a website that mostly targets Desktop Users. Android and iOS solutions won't be that beneficial. Download Attribute This method was working for a while in Google Chrome and Firefox, but then they started to follow the W3 HTML5 spec. The external resource requires to send the header of Content-Disposition in which Google Chrome and Firefox didn't check before. PHP Proxy Download I know that I could have a PHP script make a request to the external resource and then deliver it to the end user while changing the headers and name to fit my needs. The issue is the site has high traffic and each user downloads about 1-2GB of data. My servers are not able to handle this type of traffic and upgrading the server will probably be too costly. Rename Files with External Application I was considering using an external application (Possibly a Chrome / Firefox Extension) that will rename the files after they finish downloading. But considering a large enough of my audience are one time visitors, asking them to download an application or extension is very unlikely. Flash or Java Embedded Solutions I am considering using a Java or Flash embedded file that will handle the file downloads, but I don't know enough about either platform. From what I can tell, Flash doesn't have much control over the user's file system, so this co…
has comment: http://stackoverflow.com/comment/38812195

http://stackoverflow.com/comment/38479135
comment on: http://stackoverflow.com/q/24789225
has text: Adobe makes a damn good creative suite but ExtendScript and the associated toolkit feel like it was developed by a summer intern and then never looked at again lol
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38459895
comment on: http://stackoverflow.com/q/24781913
score: 0
type: QuestionComment
type: Comment
has text: Thanks for the link also dileep, i'll take a look :)

http://stackoverflow.com/comment/38655885
has text: No there is no other global variables pag1 & pag2.. I try to fix it by changing name of these variables and it still sends the same data every time.
comment on: http://stackoverflow.com/q/24877926
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/35832896
has body: I'm very late to the party, but since element.lastChild.nextSibling === null, the following seems like the most straightforward option to me: for(var child=element.firstChild; child!==null; child=child.nextSibling) { console.log(child); }
upvote count: 43
score: 42
has comment: http://stackoverflow.com/comment/110626520
has comment: http://stackoverflow.com/comment/65365247
type: Answer
answers question: http://stackoverflow.com/q/24775725
downvote count: 1

http://stackoverflow.com/q/24767241
has comment: http://stackoverflow.com/comment/38431463
has answer: http://stackoverflow.com/a/24767494
type: UnansweredQuestion
tagged with: wordpress
type: Question
has comment: http://stackoverflow.com/comment/38432866
tagged with: pagination
has comment: http://stackoverflow.com/comment/38432047
answer count: 2
has comment: http://stackoverflow.com/comment/38431881
tagged with: google-maps
has body: This is my first post on Stack Overflow. Sorry in advance if I do not follow the "rules". Thank you for letting me know. The context is the following: I am coding a webpage geolocalising people from an association and display their positions on a google map within a wordpress framework. When I click on their marker I display an info window with their info. On the map, I can filter/search the people with a form (for example look only at the people named Paul). So far all this working. My problem is the following: When I do a search I would like to display the results underneath the map. As I can have quite a few results (let's say typically around 100) , I'ld like to display them with some pagination. Basically I'ld love to do something like this http://tympanus.net/jPaginate/ ... but I am having some hard time implementing it :( And now the code ! I start by creating the div to host the pagination menu Result Then I load the related libraries <script src="<?php echo bloginfo('template_url'); ?>/js/jquery-1.3.2.js" type="text/javascript"> <script src="<?php echo bloginfo('template_url'); ?>/js/jquery.paginate.js" type="text/javascript"> Finally I write the pagination code in itself Nevertheless when I do so, I don't have the pagination menu and the console is returning me TypeError: $jaer(...).on is not a function within the .js file ... According to mister Google it seems like this might be due to a definition conflict of the $ symbol. But this issue should be avoided by using the jQuery(function ($) { } isn't??
has answer: http://stackoverflow.com/a/24873083
tagged with: javascript
has title: Pagination issue with wordpress
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/38431628

http://stackoverflow.com/q/24806545
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/3818193
score: 10
has body: We are using AngularJS to set filters. Basically we have a start date and end date and frequency. When the frequency is set to week, we simply want to add 1 week to the start date, when the frequency is set to daily, we want to add 1 day to the start date. Basically something like :- var date = new date(); date.addDays(2); date.addMonths(2); date.addYears(2);
tagged with: javascript
has comment: http://stackoverflow.com/comment/38505379
has comment: http://stackoverflow.com/comment/38505420
has answer: http://stackoverflow.com/a/24806885
accepted answer: http://stackoverflow.com/a/24806885
linked to: http://stackoverflow.com/q/3818193
answer count: 1
has title: AngularJS how to add days / months / years to a date
has comment: http://stackoverflow.com/comment/38505572
favorite count: 0
upvote count: 14
tagged with: angularjs
has comment: http://stackoverflow.com/comment/39088431
downvote count: 4
has comment: http://stackoverflow.com/comment/38754143
linked to: http://stackoverflow.com/q/17987647
has comment: http://stackoverflow.com/comment/38541571
type: Question

http://stackoverflow.com/q/24826608
accepted answer: http://stackoverflow.com/a/24829261
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38543463
has answer: http://stackoverflow.com/a/38284245
has title: AngularJS: ng-model switching int to string
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38543176
tagged with: angularjs-ng-options
upvote count: 10
has answer: http://stackoverflow.com/a/24829261
type: Question
has comment: http://stackoverflow.com/comment/38545175
tagged with: angular-ngmodel
score: 10
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24826992
has body: I'm currently working on an app in Angular. So far, everything has been going -quite- well. I'm really, really new to angular and am amazed that it took so long for the first real roadblock. Situation: I have an array of objects each with an order. category.items = [{id: 1, order: 1, type: {}, ...}, {id: 54, order: 2, type: {}, ...}, {id: 3, order: 3, type: {}, ...}] The user needs to be able to rearrange these items. The new order must be set to the object property 'order'. In html these objects are rendered like so: In the header-div I have an inputfield, type select. {{$index + 1}} The code for changeItemOrder: $scope.changeItemOrder = function(old_order, new_order, item_index) { new_order = parseInt(new_order); if (old_order != new_order) { var upper = Math.max(old_order, new_order); var lower = Math.min(old_order, new_order); angular.forEach($scope.category.items, function(item, key) { if (item_index != key) { if (new_order < old_order) { if (item_index >= new_order && (key + 1) >= lower && (key + 1) <= upper) { item.order = (parseInt(item.order) + 1); } } else if (new_order > old_order) { if (item_index <= old_order && (key + 1) <= upper && (key + 1) >= lower) { item.order = (parseInt(item.order) - 1); } } } else { item.order = parseInt(new_order); } }); $scope.reorderItems(); } }; (ReorderItems just call angular sorting with a default sorting mechanism comparing the orders and returning -1, 1 or 0.) Here is where I discovered/spotted/pinpointed one of the breaking bugs in one of the possible solutions for this problem. Here I noticed that my INT is converted to string somehow, as on render an option is added to the dropdown with value 'string:2'. I've tried ng-options, in all possible ways, but even those led to problems. The way I did ng-options was by doing item.order as item.order in ... and so on, that just made the order switch around until somehow all items had the same order. Trying different grouping methods or trackbys just gave different bugs, like …
has answer: http://stackoverflow.com/a/24826992
has comment: http://stackoverflow.com/comment/38543329
answer count: 3
has comment: http://stackoverflow.com/comment/38543709
tagged with: ng-options
downvote count: 0

http://stackoverflow.com/q/24867439
has body: I have a set of tabs which all have a directive in them: All these 3 directives have been defined similarly like this: angular.module('myApp') .directive('newSubscriber', function () { return { restrict: 'E', scope: {}, replace: true, templateUrl: 'scripts/newsubscriber/newsubscriber.html', controller: 'newsubscriberCtrl' }; }); //... and so on I am (probably wrongly) under the impression that because I have set scope: {} for all the directives, they should now have completely isolated scopes and leave each other alone. But that is not the case and bindings from the first directive's controller manage to stop values in the second or third controller from being binded for example in newsubscriberCtrl I have: app.controller('newsubscriberCtrl', ["$scope", "$routeParams", "UserMessages", "FormProvider", function ($scope, $routeParams, UserMessages, FormProvider) { $scope.formId = $routeParams.formId; var newSubscriberForm = new FormProvider.Form($scope); angular.extend($scope, newSubscriberForm); $scope.title = UserMessages.exampleText.genericPageTitle; $scope.description = UserMessages.exampleText.genericPageDescription; $scope.validationMessages = { contactNotSaved: UserMessages.validationMessages.contactNotSaved, contactCreatedOk: UserMessages.validationMessages.contactCreatedOk, contactNotCreated: UserMessages.validationMessages.contactNotCreated, requiredField: UserMessages.validationMessages.requiredField, passwordMismatch: UserMessages.validationMessages.passwordMismatch, isOpen: false } }]); which is overriding the similar object in existingSubscriber controller: app.controller('existingsubscriberCtrl', ["$scope", "$routeParams", "UserMessages", "FormProvider", function ($scope, $routeParams, UserMessages, FormProvider) { $scope.formId = $routeParams.formId; var existingSubscriberForm = new FormProvider.Form($scope); angular.extend($scope, existingSubscriberForm); $scope.title = UserMessages.exampleText.genericPageTitle; $scope.description = UserMessages.exampl…
downvote count: 0
possible better answer: http://stackoverflow.com/a/24869108
favorite count: 0
has answer: http://stackoverflow.com/a/24869108
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/24871389
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/38622769
tagged with: javascript
has title: One controller's scope blocks other scopes in Angularjs
tagged with: angularjs-scope
has answer: http://stackoverflow.com/a/24871389
answer count: 2

http://stackoverflow.com/q/24767373
answer count: 1
has title: Submitting two forms with one button click in ASP .Net MVC
accepted answer: http://stackoverflow.com/a/24767428
tagged with: razor
has body: I have two forms in two different Views in my MVC web application: First form in first view, its a dropdownlist and it's id is "ddlform": @model BTSWeb.Models.DropDownModel @using (Html.BeginForm("Index", "Home", FormMethod.Post, new { id = "ddlform" })) { @Html.DropDownListFor(x => x.SelectedStateId, Enum.GetNames(typeof(BTSWeb.Models.States)).Select(e => new SelectListItem { Text = e, Value = ((int)Enum.Parse(typeof(BTSWeb.Models.States), e)).ToString()}),new { style = "width: 60px;font-size:105%;border-radius: 6.5px 6.5px 6.5px 6.5px;padding-left:5px"}) } Form in my second view with id "serverform" and two text boxes: @model BTSWeb.Models.DropDownModel @using (Html.BeginForm("Index", "Home", FormMethod.Post, new { id="serverform"})) { Type the name of the server you want to use. @Html.TextBoxFor(x => x.server1) If you wish you compare the results from two servers. Type the name of second server: @Html.TextBoxFor(x => x.server2) } A button to submit these two forms in the second view bound to a JS function: Finally the JS function, also in the second view: The problem is only ddl form is being submitted and not the other form.
type: AnsweredQuestion
type: Question
tagged with: asp.net-mvc
has answer: http://stackoverflow.com/a/24767428
tagged with: javascript
tagged with: forms
score: 0

http://stackoverflow.com/comment/38421216
has text: No, I don't, it's just dynamically generated iframe where I put some html and then print it.
score: 0
comment on: http://stackoverflow.com/q/24761383
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39304849
type: Comment
comment on: http://stackoverflow.com/q/24856089
score: 0
has text: @JonathanLonowski if you made your comment into an answer, i'd accept it, since it answers the question and it is what i needed to know.
type: QuestionComment

http://stackoverflow.com/comment/38652411
has text: @user3825694 $.ajax lets you issue JSONP calls. Please have a look at the documentation.
comment on: http://stackoverflow.com/q/24884416
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38636455
comment on: http://stackoverflow.com/q/24875501
type: Comment
type: QuestionComment
has text: I'll get to looking at that as well. This code is approximately 9 yrs old, I'm trying to get it functional for current time. Thanks for the pointer!
score: 0

http://stackoverflow.com/a/24763822
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38470793
type: Answer
accepted answer of: http://stackoverflow.com/q/24762370
score: 1
upvote count: 1
has body: You should use foreignObject element to insert HTML into SVG. Like so: var icons = svg.selectAll('foreignObject').data(data); icons.enter().append("foreignObject") .attr("class", function(d) { return "icon-" + d.value + "-right"; }) .append("xhtml:body") .append("xhtml:span"); Also you can use text element to add icons to the SVG: var icons = svg.selectAll('text').data(data); icons.enter().append("text") .html("&amp;#xf00d") // utf-8 character for the icon
answers question: http://stackoverflow.com/q/24762370
has comment: http://stackoverflow.com/comment/38470221

http://stackoverflow.com/a/24761473
type: Answer
has comment: http://stackoverflow.com/comment/41267149
has comment: http://stackoverflow.com/comment/41234486
score: 0
answers question: http://stackoverflow.com/q/24759884
has body: Maybe try creating chat object and assign the model to the view like this? http://jsfiddle.net/e9vJH/ var app = angular.module('emotionApp',[]); app.controller('EmotionCtrl',function($scope) { $scope.chat = 'Chat message'; $scope.insertEmotion = function(emotion) { $scope.chat = $scope.chat + emotion; }; }); Insert

http://stackoverflow.com/a/24809274
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38573104
has comment: http://stackoverflow.com/comment/38541211
type: Answer
answers question: http://stackoverflow.com/q/24809068
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24809068
has body: Remove the .length, as null has no length var countMQ = css.match(patt1); and check for truthy, not 0 if (countMQ) { return true; } else { return false; } or even null, if you wan't to be more specific if (countMQ === null) { or simpler function checkMediaQueries() { return cssText.match(/@media/gi) ? true : false; } FIDDLE
has comment: http://stackoverflow.com/comment/38572317
has comment: http://stackoverflow.com/comment/38539577
has comment: http://stackoverflow.com/comment/38572687

http://stackoverflow.com/q/24908638
downvote count: 0
tagged with: jquery
favorite count: 0
has title: How to change the 'src' attribute using Jquery
has body: I am trying to remove the src attribute from an embed tag of youtube video player in a slider . It works fine in Fire Fox but do not work in chrome and in IE the video itself is not showing . here is the fiddle . and the script that I am trying to use is here Script $(document).on('click', '.transparent-btns_nav', function (event) { video = $('.transparent-btns1_on').find('object').length; if ($('#video1').parents('li').hasClass('transparent-btns1_on')) { $('object').find('#video1').attr("src", "http://www.youtube.com/v/PLOUfmig96M?version=3&amp;enablejsapi=1&amp;hl=es_ES&amp;rel=0&amp;color1=0x2b405b&amp;color2=0x6b8ab6&amp;fs=1&amp;border=1&amp;autoplay=1"); } else { $('object').find('#video1').attr("src", ""); } }); Edit 1 I think this issue can only be resolved by writing the whole tag using clone . I read in this-->Link got it from one of the StackAnswers
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38697966
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/38697883
upvote count: 1
has comment: http://stackoverflow.com/comment/38698016
tagged with: youtube-api
linked to: http://stackoverflow.com/q/6646413
type: Question
tagged with: javascript

http://stackoverflow.com/a/24909147
has comment: http://stackoverflow.com/comment/38699177
has comment: http://stackoverflow.com/comment/38700629
type: Answer
has comment: http://stackoverflow.com/comment/38700125
upvote count: 1
has body: The reason why setTimeout seems to fire infinity, is that it actually fires as many times as there is e.g. new elements added to the DOM. So basically, it assigns 3 setTimeout calls if 3 divs are added to the DOM. The reason being, that you are doing it inside mutations.forEach(function(mutation) { ... } loop. Therefore, the solution is to remove the loop and only assign one setTimeout call at higher level which will fire when the DOM changes: // create an observer instance var observer = new MutationObserver(function(mutations) { // fired when a mutation occurs timer = setTimeout(function () { console.log("executed"); // my_procedure(); }, 500); }); Below is the full example, it should display "executed" once (after 3 second) to console when the DOM is actually changed, even though we add 3 new divs. js fiddle example The code: // select the target node var target = document.body, timer; // create an observer instance var observer = new MutationObserver(function(mutations) { // fired when a mutation occurs timer = setTimeout(function () { console.log("executed"); // my_procedure(); }, 500); }); // configuration of the observer: var config = { attributes: true, childList: true, characterData: true }; // pass in the target node, as well as the observer options observer.observe(target, config); // Testing our observer setTimeout(function() { document.body.innerHTML = " lol 1 "; document.body.innerHTML += " lol 2 "; document.body.innerHTML += " lol 3 "; }, 3000); /* Comment out if you want to add more divs.. setTimeout(function() { document.body.innerHTML += " lol 4 "; document.body.innerHTML += " lol 5 "; document.body.innerHTML += " lol 6 "; }, 5000); */ Cheers.
score: 1
answers question: http://stackoverflow.com/q/24908354
has comment: http://stackoverflow.com/comment/38699252
downvote count: 0

http://stackoverflow.com/comment/38689581
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24902686
has text: I can't access the raw codes and add a model to the div because I'm using Adobe's Dynamic tag management to retrieve the searched word. So the only way I can access the div value at this point is $('#searchKeyword').html() but it always returns {{searchKeyword}}
type: AnswerComment

http://stackoverflow.com/q/24867303
tagged with: kcfinder
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/25241497
accepted answer: http://stackoverflow.com/a/25241497
type: Question
tagged with: javascript
upvote count: 1
answer count: 1
has body: The title says it all really, the way it works at the moment it will open as a popup in a new window, the problem I've found with this is that if you already have the window open and click the button to open up the popup, nothing will happen. This means that people could potentially have the window open without realising, and get frustrated at clicking the button and having nothing happen. Hope that makes sense, but the only way I can think to counter this would be to open KCFinder in a lightbox on the page, any ideas if this is possible?
favorite count: 0
has title: Is there a way to open KCFinder in a lightbox, not through window.open?

http://stackoverflow.com/comment/40438110
has text: I'm sure you can find out with some debugging :) Good luck.
comment on: http://stackoverflow.com/a/24830812
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38627177
has text: This is probably a very bad idea. the code should be putting the data in the POST body, not in a query string.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24870959
type: AnswerComment

http://stackoverflow.com/q/24767014
score: 0
answer count: 1
tagged with: ruby
has body: Ruby on Rails 4.1 The form is placing the parameters into an array when POST is done. I am making a script to auto fill the billing address the same as the shipping address. When the script runs it is assigning the values as html values. How do you put these values into the payment array being sent? The log where cc_name and ship_name are outside the payment array, I want them inside: Parameters: {"utf8"=>"✓", "authenticity_token"=>"x", "cc_name"=>"Bobby", "payment"=>{"telephone"=>"555", "email"=>"drfernandez1@yahoo.com", "address1"=>"641 W Rt 66", "address2"=>"", "city"=>"Glendora", "state"=>"CA", "postal_code"=>"91740", "country"=>"USA", "cc_type"=>"Visa", "cc_number"=>"5555555588884444", "ccv"=>"321", "expires_on(1i)"=>"2014", "expires_on(2i)"=>"9", "expires_on(3i)"=>"1", "ship_address1"=>"641 W Route 66", "ship_address2"=>"", "ship_city"=>"Glendora", "ship_state"=>"c", "ship_postal_code"=>"91740", "ship_country"=>"u", "card_holder_auth"=>"1", "charge_auth"=>"1", "name_auth"=>"David Duke", "date_auth"=>"7"}, "billingtoo"=>"on", "ship_name"=>"Bobby", "commit"=>"Send Payment"} The form (minus clutter): <%= form_for @payment do |f| %> <%= render 'shared/payment_error_messages' %> Fill in all blank areas with payment information: Applicant Information <%= f.label :cc_name, "Name as it appears on credit card:" %> <%= f.text_field :cc_name, class: "input-lg", :name => "cc_name" %> <%#= @payment.errors.get(:cc_name) %> <%= f.label :telephone, "Telephone Number:" %> <%= f.text_field :telephone, class: "input-lg" %> ... Shipping Address is the same as the Billing Address Please Note: This cannot be a P.O box address <%= f.label :ship_name, "Name:" %> <%= f.text_field :ship_name, class: "input-lg", :name => "ship_name" %> <%= f.label :ship_address1, "Address 1:" %> <%= f.text_field :ship_address1, class: "input-lg" %> ... <%= f.submit "Send Payment", class: "btn btn-lg btn-primary", id: "commit" %> <% end %> <%= link_to 'Back', session[:last_page] %>
type: AnsweredQuestion
has title: Put html param into Rails array parameter
has answer: http://stackoverflow.com/a/24767076
accepted answer: http://stackoverflow.com/a/24767076
tagged with: ruby-on-rails
type: Question
tagged with: javascript

http://stackoverflow.com/q/24766155
has title: Proportional resize images in a fixed block
type: AnsweredQuestion
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/24788082
tagged with: algorithm
tagged with: javascript
has body: I have 3 random images and one fixed block (200x300px). Please, help me to write an algoritm, I need to change image size proportionally to get into fixed block. Images width must be equal of block width http://jsfiddle.net/U8AAu/2/ var images = [ getRandSizes(), getRandSizes(), getRandSizes() ]; var sizes = getProportionalSizes(200, 300, images); $.each(sizes, function(i, size){ var $img = $("&lt;div&gt;", { class: 'img', width: size[0], height: size[1] }).appendTo('.fixed-block') }); // todo: function getProportionalSizes(maxWidth, maxHeight, sizes){ return sizes; } function getRandSizes(){ return [getRand(100,200), getRand(100,200)] } function getRand(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }
accepted answer: http://stackoverflow.com/a/24768600
score: 0
answer count: 2
favorite count: 0
has answer: http://stackoverflow.com/a/24768600
possible better answer: http://stackoverflow.com/a/24788082

http://stackoverflow.com/a/24806029
answers question: http://stackoverflow.com/q/24805921
score: 0
has body: Please check out this link When you know how to add multiple recipients, just concatenate the string with addresses or add simple javascript with checkboxes
type: Answer

http://stackoverflow.com/q/24907322
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38695532
tagged with: zooming
tagged with: http://stackoverflow.com/tag/html
answer count: 1
score: 10
favorite count: 0
type: UnansweredQuestion
has title: Zoom and pan HTML5 canvas - library
has body: I'm trying to implement zooming and panning a canvas which contains a picture. I found this example http://phrogz.net/tmp/canvas_zoom_to_cursor.html, but the transformations are applied on the picture withing the canvas, not on the canvas itself. I don't understand the code completely, so I didn't manage to customize it for my needs. Can someone help me with that? Or, if you could recommend me some good library suitable for my needs, that would be great. Thanks.
has answer: http://stackoverflow.com/a/24915297
upvote count: 10
type: Question
tagged with: canvas
has comment: http://stackoverflow.com/comment/38695685
downvote count: 0

http://stackoverflow.com/a/24876287
has comment: http://stackoverflow.com/comment/38637602
type: Answer
answers question: http://stackoverflow.com/q/24876256
has body: Even shorter glitch = problems !== 99; Here's a more lyrical version: if (problems.length === 99 &amp;&amp; problems.indexOf("glitch")=== -1){ return "HOVA"; }
upvote count: 2
downvote count: 1
has comment: http://stackoverflow.com/comment/38637579
has comment: http://stackoverflow.com/comment/38637960
score: 1

http://stackoverflow.com/a/24935053
answers question: http://stackoverflow.com/q/24756136
type: Answer
score: 0
has body: The reason of bug is that I use fastclick in my application. I found open and not closed bug here : I found next solution: we should add class 'needsclick' dynamically to google maps div childs: $( document ).on( 'touchstart', '.map', function ( event ) { event.target.classList.add( 'needsclick' ); $( document ).one( 'touchend', function () { event.target.classList.remove( 'needsclick' ); } ); } ); After it all works correctly. Full stack of discussion here.

http://stackoverflow.com/q/24809885
answer count: 2
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/38511386
favorite count: 0
has comment: http://stackoverflow.com/comment/38511318
tagged with: colors
has comment: http://stackoverflow.com/comment/38511324
has body: I'm trying to create a switch/button/link that directly changes the color theme/colors/color palette on the website. For example, let's say when it's night you would prefer having a dark background, or when it's daylight you'd prefer a bright background. It's kinda like the Dark Theme and White Theme in most iPhone Apps. There's also that "switching-thing" on most porn websites, so people won't see their reflection on their computer screen when they.. well you know. I found solutions on here, but they don't work when a background-color has already been set up in CSS. I've tried everything. http://jsfiddle.net/Eqdfs/ Here's the code I'm using but it's not working : HTML black white grey CSS JavaScript I'm new to JavaScript and jQuery so explain yourself a bit please. Thank you for your time! Here's a screenshot of what's happening for further help : https://i.sstatic.net/UDkYf.png EDIT: I found the solution. In order to work, I had to load the jQuery 1.7.2 in the head tag, like this :
has answer: http://stackoverflow.com/a/44108886
has title: Create a switch that changes the color palette of the website
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38512337
tagged with: css
has comment: http://stackoverflow.com/comment/38511332
has comment: http://stackoverflow.com/comment/38511936
has comment: http://stackoverflow.com/comment/38513091
has comment: http://stackoverflow.com/comment/38512099
type: UnansweredQuestion
score: 1
has answer: http://stackoverflow.com/a/24810077
has comment: http://stackoverflow.com/comment/38512964
upvote count: 1
type: Question
tagged with: javascript

http://stackoverflow.com/comment/38655131
type: QuestionComment
comment on: http://stackoverflow.com/q/24886012
score: 2
has text: you have an invalid html -> `tr` can't have `div` as a child.. change it to ` 222222 Hello, Again! ` then `$('#holder').html($(this).children('div').html());`
type: Comment

http://stackoverflow.com/comment/38514462
score: 0
type: Comment
has text: I'm using the Selenium IDE Firefox Plugin to create the HTML script. How / Where would I include the use of the getAtribute?
type: QuestionComment
comment on: http://stackoverflow.com/q/24811190

http://stackoverflow.com/comment/38696896
score: 2
type: Comment
type: QuestionComment
has text: Why not just read the [documentation](http://mrrio.github.io/jsPDF/doc/symbols/jsPDF.html), it's pretty straigh forward, and make sure you have your console open and check for errors.
comment on: http://stackoverflow.com/q/24908067

http://stackoverflow.com/comment/38542685
score: 0
type: Comment
has text: There is a small anchor on the side of the frame that you can grab and move around (highlited with a red box): [IMAGE 1 WIDE FRAME](http://i60.tinypic.com/11grf3a.jpg) / [IMAGE 2 SMALL FRAME](http://i62.tinypic.com/2zgzrpd.jpg)
comment on: http://stackoverflow.com/a/24810723
type: AnswerComment

http://stackoverflow.com/q/24821478
type: AnsweredQuestion
has body: I'm currently trying to build a quick dropdown prototype with jQuery and I'm probably at the limit of my jQuery knowledge so I was hoping for some help in solving my problem. What I'm aiming to achieve: when the user hovers over a link, a dropdown animates down, when the user clicks another link, the next dropdown animates over the top and so on. Here's the HTML: Call Chat Send a message Call now Online chat Send us a message CSS: * { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .wrapper { max-width: 1200px; margin: 0 auto; } .dropdowns { overflow: hidden; } ul { list-style: none; margin: 0; padding: 0; } li { display: inline; } .call a { background: #f1f1f1; } .chat a { background: #e1e1e1; } .message a { background: #f1f1f1; } a { display: block; width: 33.333%; height: 50px; line-height: 50px; text-align: center; float: left; } .call-panel { height: 300px; background: darkgrey; display: none; } .chat-panel { height: 300px; background: darkgrey; display: none; } .message-panel { height: 300px; background: darkgrey; display: none; } h1 { margin: 0; padding: 0; } JS: $( ".call a" ).click(function() { toggleSlides( ".call-panel" ); }); $( ".chat a" ).click(function() { toggleSlides( ".chat-panel" ); }); $( ".message a" ).click(function() { toggleSlides( ".message-panel" ); }); function toggleSlides(slide){ $(".slide").slideUp ( "slow", function(){ $(slide).slideDown( "slow" ); } ); } I've set up a quick fiddle here of what I have currently, but as you'll see it's not quite working how I intended, I'm getting animations coming up rather than down, some crazy repeat animations, all sorts - any help would be great! Link: http://jsfiddle.net/2zwjZ/
accepted answer: http://stackoverflow.com/a/24821803
type: Question
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/24821803
has title: jQuery dropdown advice
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/38534633

http://stackoverflow.com/q/24781532
upvote count: 1
has answer: http://stackoverflow.com/a/24781934
has title: How do I define a function?
has comment: http://stackoverflow.com/comment/38458576
accepted answer: http://stackoverflow.com/a/24781934
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24781643
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24781643
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: I'm using a gup function in my html file: HTML Select a port to view its ICD details JavaScript var nodeLabel = gup('nodeLabel'); console.log("printing nodeLabel"+nodeLabel); This throws an error: gup not defined. How should I go about defining this function?
linked to: http://stackoverflow.com/q/336859
score: -1
answer count: 2
downvote count: 2

http://stackoverflow.com/comment/38449725
type: QuestionComment
type: Comment
has text: How do you get the `data`? If it is comming from the server as a response for ajax request just set `dataType` to be `json`
comment on: http://stackoverflow.com/q/24777197
score: 0

http://stackoverflow.com/q/24756392
type: UnansweredQuestion
tagged with: node.js
score: 0
has title: Using node/express/jade, how to serve one of two javascript files, based on whether or not the first exists?
has answer: http://stackoverflow.com/a/24759319
type: Question
tagged with: javascript
tagged with: express
has body: New to web app development. My problem: I've set grunt up to minify/uglify javascript. That's great and all, but I'd like the server to: see if the minified javascript exists. If it does, serve it. If not, serve the source javascript. I have a working implementation right now that, inside the routing, checks if the minified file exists. If it does, it serves index.jade, which has layout.jade embedded in it. It not, it serves index_fallback.jade, which has layout_fallback.jade embedded in it. Routing logic: /* GET home page. */ router.get('/', function(req, res) { if(fs.existsSync(path.join(__dirname + '/../public/' + '/dist/javascripts/global.js'))) { res.render('index', { title: 'Express' }); } else { console.log('WARNING!!! Did not find minified global.js file. Using full file.'); console.log('Run `grunt` to construct minified .js files.'); res.render('index_fallback', { title: 'Express' }); } }); Is there a more elegant way to do this? Maintaining twice as many files with only a line of difference each does not seem like a smart way to do this. Can I pass a variable to jade and do conditionals in the jade templates? Should I do any logic in the router at all? The source is available at here. Thank you so much. EDIT: Solved elegantly. See routes/index.js and views/layout.jade from this commit.
tagged with: pug
answer count: 1
tagged with: web-frameworks

http://stackoverflow.com/comment/38600589
comment on: http://stackoverflow.com/q/24856880
type: QuestionComment
type: Comment
has text: It shouldn't matter, but it also shouldn't happen in your build process. It also shouldn't make much of a worthwhile difference.
score: 0

http://stackoverflow.com/comment/38500238
type: Comment
type: QuestionComment
has text: even after adding third item it shows only 1 item that is manually added in the json at the top. rest whatever we add later is now shown.
comment on: http://stackoverflow.com/q/24800732
score: 0

http://stackoverflow.com/q/24880589
tagged with: css
tagged with: fade
has answer: http://stackoverflow.com/a/24880675
has answer: http://stackoverflow.com/a/24880670
type: Question
linked to: http://stackoverflow.com/q/5104053
tagged with: javascript
has answer: http://stackoverflow.com/a/24880709
score: 0
has body: Trying to do a simple fade in using the opacity property of an h1 element. I'm learning javascript, so would like to try this using plain javascript (yes, I know it is much easier using jQuery). Pasting only relevant snippets: ... Welcome to the world! ... Help is much appreciated! Thanks! jsFIDDLE
has title: Fade in using plain javascript
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38645683
has comment: http://stackoverflow.com/comment/38645687
type: UnansweredQuestion

http://stackoverflow.com/comment/38545229
type: QuestionComment
has text: One clever way to do it: http://stackoverflow.com/questions/17387435/javascript-sort-array-of-objects-by-a-boolean-property
score: 0
comment on: http://stackoverflow.com/q/24827821
type: Comment

http://stackoverflow.com/q/24836619
tagged with: jquery
tagged with: ajax
linked to: http://stackoverflow.com/q/22318119
accepted answer: http://stackoverflow.com/a/24840172
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24837288
has answer: http://stackoverflow.com/a/24837288
score: 0
has comment: http://stackoverflow.com/comment/38562639
type: Question
tagged with: jsonp
tagged with: firefox
has title: Firefox jquery ajax JSONP call not working
tagged with: javascript
has body: I'm trying to get a JSONP $.ajax request working. It works fine in Chrome and IE but it is failing in Firefox v30. When it fails it doesn't given any error - at least Firebug doesn't show any errors, it just never calls the callback function. This is a basic demo site (http://andysylvester.com/files/reader/) will work with Chrome and IE but not Firefox. The nytRiver.js JSON call actually returns a javascript function call to onGetRiverStream see the documentation here: http://riverjs.org/#structureOfRiverjs Minimal River.js Feed Reader Minimal River.js Feed Reader Wating for feeds to load....
has answer: http://stackoverflow.com/a/24840172
answer count: 2

http://stackoverflow.com/a/24879451
type: Answer
has body: That should get you started :-) If you were focussing your question, we could point you to a smaller list. That is is also by no mean exhaustive, but should have the usual suspects. Recording / Serverless open source - git - www: RecordRTC MCU/SFU open source - git - www: lynckia/licode open source - git - www: meetecho (janus) open source - git - www: kurento open source - git - www: jitsi (meetme) open source - src - www meedoze open source - git - www: media soup open source - git - www: Pion acquired by cisco www: acano proprietary - docs - www pexip proprietary - src - www openClove (pivoted) proprietary - git - www tokbox (openbox) Signaling holla (used by twelephone) openPeer (hookflash) API / SDK twilio (audio only) requestec (product: saypage) plivo Tokbox QuickBlox openClove tropo (audio only) weemo voximplant (audio only?) Priologic (easyRTC, tawk.com, proPhone) Dialogic bistri Apidaze CafeX hookflash Apizee (apiRTC) &amp;yet (simpleRTC) RTCMultiConnection (muazkhan, demo) crocodileRTC - the company has been bought/absorbed three times over. I don't know what is the status of this library, you might want to contact peter dunkley for update. peerjs (data channel) rtc.io webrtc.io (no changes for almost a year) webrtc-data.io (stripped down, data only version of webrtc.io) Product webrtc-enterprise.com (uses SkywayJS) talky.io (uses simpleRTC) tawk (uses easyRTC) rtccopy (uses webrtc-data.io) twelephone Tutorials http://www.html5rocks.com/en/tutorials/webrtc/basics/ http://www.html5rocks.com/en/tutorials/webrtc/infrastructure/ http://www.html5rocks.com/en/tutorials/webrtc/datachannels/ https://developer.mozilla.org/en-US/docs/Web/Guide/API/WebRTC/Peer-to-peer_communications_with_WebRTC https://bitbucket.org/webrtc/codelab
downvote count: 1
score: 27
answers question: http://stackoverflow.com/q/24857637
has comment: http://stackoverflow.com/comment/101175462
accepted answer of: http://stackoverflow.com/q/24857637
type: AcceptedAnswer
upvote count: 28

http://stackoverflow.com/comment/38437330
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24770508
has text: that isn't what the code shown will do. I suggest you make a demo in jsfiddle.net
type: Comment

http://stackoverflow.com/q/24858786
has answer: http://stackoverflow.com/a/24874043
tagged with: shadow-dom
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/24874043
score: 2
type: AnsweredQuestion
upvote count: 2
has answer: http://stackoverflow.com/a/24988029
type: Question
tagged with: polymer
has body: I trying to rearrange layouts when device screen is resized, so i do this: if(screenOrientation == SCREEN_ORIENTATION_LANDSCAPE) { document.querySelector("html /deep/ [landscape-horizontal]").removeAttribute('vertical'); document.querySelector("html /deep/ [landscape-horizontal]").setAttribute('horizontal', ''); } This is working in the desktop machine correctly, but in mobile (both android phone, tablet and iOS simulator) i got this error: "Uncaught SyntaxError: Failed to execute 'webkitMatchesSelector' on 'Element': 'html /deep/ [landscape-horizontal]' is not a valid selector.", source: bower_components/platform/platform.js (0) Any ideas? Thanks!
tagged with: javascript
has answer: http://stackoverflow.com/a/24876084
answer count: 3
tagged with: css-selectors
has title: polymer /deep/ selector is not working in mobile devices
accepted answer: http://stackoverflow.com/a/24988029
downvote count: 0
favorite count: 0

http://stackoverflow.com/q/24891682
tagged with: extjs4
has comment: http://stackoverflow.com/comment/38713745
has comment: http://stackoverflow.com/comment/38666742
answer count: 1
has answer: http://stackoverflow.com/a/24892310
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38667529
has title: Only one checked checkbox allowed in a grid
has comment: http://stackoverflow.com/comment/38668476
type: Question
linked to: http://stackoverflow.com/q/9542961
tagged with: javascript
linked to: http://stackoverflow.com/q/9539284
has body: Is it possible to have a CheckboxColumn in a grid panel that can be checked on only one row at a time ? I've tried Googling what I'm looking for and I'm not finding much. Do I need to do something at the store level and at the grid level ? I'm halfway through coding a logic that does it using the checkchange event, but I wondered if I'm writing useless code :) Thank you.
has comment: http://stackoverflow.com/comment/38666590
score: 0

http://stackoverflow.com/comment/38657271
type: AnswerComment
score: 0
type: Comment
has text: I have updated in now this edit includes what you suggest me to do as well
comment on: http://stackoverflow.com/a/24885447

http://stackoverflow.com/comment/38569845
has text: IMO, doing XSLT on the client is not ideal. It can be done, but it's more stable, predictable and compatible to transform your data on the server.
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/24840268

http://stackoverflow.com/q/24881372
tagged with: qunit
has body: I have set up my test environment as described here with QunitJS + PhantomJS + GruntJS: http://jordankasper.com/blog/2013/04/automated-javascript-tests-using-grunt-phantomjs-and-qunit/ Everything works fine, but I have the problem that, my Grunt Task finishes without errors, although errors are found. This is crucial for my build process. Due to the Test results the build either fails or succeeds. But in my case the build always succeeds. Any Ideas why grunt doesn't exit with failure when errors found? qunit Task of the grunt file: module.exports = { services: { options: { urls: [ 'http://localhost:8000/tests/services.html' ], timeout: 20000, force: true } }, gui: { options: { urls: [ 'http://localhost:8000/tests/gui.html' ], timeout: 20000, force: true } } }; Output: Please consider that I cant upload more info due to confidental issues.
linked to: http://stackoverflow.com/q/24928672
tagged with: phantomjs
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38648665
type: Question
has comment: http://stackoverflow.com/comment/38650902
tagged with: javascript
tagged with: gruntjs
has comment: http://stackoverflow.com/comment/38691744
score: 0
has answer: http://stackoverflow.com/a/24920971
tagged with: automated-tests
answer count: 1
accepted answer: http://stackoverflow.com/a/24920971
has title: Tests result as successful, although errors are found during Tests
has comment: http://stackoverflow.com/comment/38656759

http://stackoverflow.com/comment/38462666
comment on: http://stackoverflow.com/q/24780768
type: QuestionComment
has text: thanks buddy works correctly but i need to modify this to fix with my code thanks
score: 0
type: Comment

http://stackoverflow.com/q/24814656
tagged with: http://stackoverflow.com/tag/html
score: 2
tagged with: video
tagged with: html5-audio
upvote count: 2
linked to: http://stackoverflow.com/q/13043816
type: Question
has answer: http://stackoverflow.com/a/76437252
has comment: http://stackoverflow.com/comment/38522344
has title: Way to seek HTML5 video when seekable.length = 0?
tagged with: javascript
tagged with: html5-video
downvote count: 0
answer count: 1
has body: When an HTML5 video/audio element is served from a source that does not support byte range requests, currently (in the latest versions of Chrome and Firefox at least) the associated media element to the tag seems to have an empty seekable TimeRanges object. This is slightly confusing, as it does not have an empty buffered TimeRanges object: there is data buffered but it is not seekable. Attempting to set currentTime to a value in the buffered range fails silently: the currentTime does not change and no error is thrown. This is counter to most sources I've read, which suggest that buffered TimeRanges will always be included in seekable TimeRanges. This is how I'd imagine things would work, since if the data is buffered locally there's no reason not to be able to seek inside of it. I can not find a way to seek inside such a video at all, even to reset the current play time to 0. Is there something I'm missing, or is this functionality just currently broken? Is it dependent on some aspect of the video type?
favorite count: 0
has comment: http://stackoverflow.com/comment/38523954
type: UnansweredQuestion

http://stackoverflow.com/a/24866700
type: Answer
answers question: http://stackoverflow.com/q/24861013
score: 0
has body: I have managed to resolve this using the simple method of onerror Here is the full code :) function populate(pText) { var tex = ''; for(var n=0; n &lt; pText.length; n++) { //console.log(pText[n]); tex += '&lt;span id="s' + n + '"&gt;&lt;audio id="a' + n + '" src="https://ssl.gstatic.com/dictionary/static/sounds/de/0/' + pText[n] +'.mp3" onerror="mediaerro(' + n + ',&amp;quot;' + pText[n] +'&amp;quot;)" type=audio/mpeg"&gt;&lt;/audio&gt;' + pText[n] + ' &lt;/span&gt;'; } $('[name=p1Text]').html(tex); } $(document).on("click", "span", function() { $(this).find('audio')[0].play(); }); mediaerro = function(id, word) { console.log(word); switch(word) { case "Rocko": $('#a' + id).attr('src', 'http://domain.com/books/book1/words/rocko.mp3'); break; case "Caroline": $('#a' + id).attr('src', 'http://domain.com/books/book1/words/caroline.mp3'); break; case "Benji": $('#a' + id).attr('src', 'http://domain.com/books/book1/words/benji.mp3'); break; } }; Using the dynamic audio id and managed to create a function based on an error, which replaces the broken link with a new one where the new recording is. Works a treat!

http://stackoverflow.com/comment/38472686
type: AnswerComment
has text: Thanks you got what I required.+3
comment on: http://stackoverflow.com/a/24757389
type: Comment
score: 0

http://stackoverflow.com/a/24790441
type: Answer
has body: loop_channel_name is initialized as a global variable because you didn't use the var keyword. Try var loop_channel_name instead of just loop_channel_name. When you initialize loop_channel_name on the first iteration of the for loop you are creating it as a global variable and on subsequent iterations you are just updating that instead of creating a new reference. By referring to loop_channel_name in the alert you are referencing the global variable which was updated to black on the last iteration of the loop, hence it always alerting black. Example &lt;div id="channels_buttons_container"&gt; &lt;/div&gt; &lt;script&gt; channels_array = ["red", "green", "black"]; for(var i = 0; i &lt; channels_array.length; i++) { var loop_channel_name = channels_array[i]; var new_button_element = document.createElement("span"); new_button_element.id = 'channel_button_'+loop_channel_name; new_button_element.innerHTML = '&lt;br&gt;BLA BLA'; document.getElementById('channels_buttons_container').appendChild(new_button_element); document.getElementById('channel_button_'+loop_channel_name).onmouseover = function(){ alert('Rollover '+loop_channel_name); /*You could also do*/ alert('Rollover '+ channels_array[i]); } // } &lt;/script&gt;
has comment: http://stackoverflow.com/comment/38476469
score: 0
answers question: http://stackoverflow.com/q/24790225

http://stackoverflow.com/a/24882581
answers question: http://stackoverflow.com/q/24881055
upvote count: 1
has body: VISIT MY PAGE WWW....... (USER CLICKS) KOBOM! 100 pages printed. It should not be possible because it would otherwise be a security issue(this case; spam). Your code involves I/O-communcation and this goes via the browser(everything goes through the browser but here they take control from your code). You are actually doing it right, but the browser you have chosen have decided to popup a dialog box and wait for the user to accept the print command. Well,the browser designer wants a good user experience for their users and in this way they prevent potential spam. Javascript knows it and thats why there is no parameters for this in the printer function. You still want to do it? try to find an add-on or a tweak for your current browser to allow such bypasses. Create your own application(could be a browser). Issue with this approach? You dont want to ask other users to install or configure such things; Too much for the average user and your intent was to make things easier.
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/a/24888900
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/24888741
answers question: http://stackoverflow.com/q/24888741
score: 4
upvote count: 4
has body: Nothing weird about it, they're different characters that look the same. If you convert them to hex: í = 69 cc 81 í = c3 ad So, just replace one of them with the other. Why would you be using characters like that in the first place?
type: AcceptedAnswer

http://stackoverflow.com/a/24766230
score: 0
has body: The backbone docs describe few ways how can you get response from server after calling save() function. For example: You need to specify error and success callbacks: var model = new App.Models.Post(); model.set({title: 'some title', content: 'some content'}); var options = { success: function(model, response){ console.log('success handler'); model.set({id: response.id}); }, error: function(model, xhr){ console.log('error handler'); } }; Specify wait option to wait response from server before set model attributes: options.wait = true; Need to call save function with specified options: if (model.isValid()) { model.save({}, options); }
type: Answer
accepted answer of: http://stackoverflow.com/q/24762927
answers question: http://stackoverflow.com/q/24762927
type: AcceptedAnswer

http://stackoverflow.com/comment/38616659
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24865453
type: Comment
has text: Ill amend my question because the way the forms are validated might not work with your suggestion

http://stackoverflow.com/comment/38684614
type: QuestionComment
comment on: http://stackoverflow.com/q/24901057
score: 0
has text: @FelixKling It does indeed.. Maybe just not in a fiddle? Give it a shot in your browser.
type: Comment

http://stackoverflow.com/q/24894060
has comment: http://stackoverflow.com/comment/38670774
has answer: http://stackoverflow.com/a/24894166
has comment: http://stackoverflow.com/comment/38670916
tagged with: javascript
score: -1
has title: Jquery .hide not working on window load
has answer: http://stackoverflow.com/a/24894132
answer count: 3
upvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38670855
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38672354
linked to: http://stackoverflow.com/q/4584373
has body: This is driving me insane. At some point everything seemed to be working fine but suddenly everything stopped working and I have no idea why. I have a set of divs with a class for which I want to hide everything but the first four divs. content 1 content 2 content 3 content 4 content 5 And I have the following in the head of the doc Why doesn't this work? I have to say the the ".item" divs load dynamically based on a variable that is set on the URL. Something like mydoamin.com/myitems/?zicode=10005 So the items displayed come from an external database and loaded in the page. My assumption was that $(window).load waits for all those items to exist in the document. Am I wrong? and in that case, how can I make sure to execute a function only after everything is really loaded?
has answer: http://stackoverflow.com/a/24894117
tagged with: hide
downvote count: 1
type: Question

http://stackoverflow.com/comment/38467302
has text: @ Barmar: Until/unless the OP confirms that they're using jQuery (as opposed to just having seen `slideToggle` when browsing around), it's inappropriate to add the `jquery` tag.
comment on: http://stackoverflow.com/q/24786246
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/comment/38528967
has text: `data: {txt_topic_name : topic_name ,txt_detail : detail, submission: $('input[name="submission"]').val()}` Then in your success function, check for the value `data`: `if(data == 'Sucess') $('#results').html("submitted succesfully"); else $('#results').html("error");`
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24819101

http://stackoverflow.com/q/24841808
has comment: http://stackoverflow.com/comment/38572492
has title: Three.js How to check when animation is end?
has answer: http://stackoverflow.com/a/24853734
score: 0
has body: If I write something like this: function renderuj(){ scene.renderer.setClearColor(0xeeeeee, 1); ob1.animation.update(0.5); ob2.animation.update(0.5); scene.renderer.render(scene.scene, scene.camera); animationFram = requestAnimationFrame(renderuj); } the animation working in loop. But I want to play only once and no more. How to do that inside the .js file where is 3D animation/object we can see this animation" : [{"name":"test1","fps":24,"length":10 and I try add to my code something like this if(temp &lt; 10) temp++; else cancelRequestAnimFrame(animationFram ); but I have only half of animation
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: three.js
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript

http://stackoverflow.com/a/24817149
has comment: http://stackoverflow.com/comment/38525298
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38525323
has comment: http://stackoverflow.com/comment/38525317
has body: The problem is the variable declaration for self, since you haven't used var to declare it is created in the global context. So var self = this; also you are setting the data using key test.tabs, but is reading it using key simple.tabs $(this).closest(".tabs").data("test.tabs").testdrive(); Demo: Fiddle Also I think you can use self.$element.find(" &gt; .nav &gt; li &gt; a").click(function (e) {}); to register the click handler
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24817093
answers question: http://stackoverflow.com/q/24817093
type: Answer

http://stackoverflow.com/a/24795746
upvote count: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/24791670
answers question: http://stackoverflow.com/q/24791670
has body: addHandle which was placed in the entity does not exist. Replace by setHandler, invoke this event using request, Eg. # entities App.reqres.setHandler "header: entities", -&gt; API.getHeaders() # controller links = App.reqres.request links "header: entities" The setHandler function, has responsibility in adding your event trigger along with the callback and context, take a look at the source code from the marionette. I did a sample in the latest version from the marionette. I'm using the Wreqr to exchange events with the API of the entity, for more details see in this project.

http://stackoverflow.com/comment/38618346
has text: I added the stationId and lastPingedAsString to the original post, the lastPinged itself returns a variable datetime formatted like so "Date(234505628374550-0400)"
type: AnswerComment
comment on: http://stackoverflow.com/a/24831445
score: 0
type: Comment

http://stackoverflow.com/a/24877239
downvote count: 0
answers question: http://stackoverflow.com/q/24875567
type: Answer
upvote count: 1
score: 1
has body: Actually, this post might be the same issue you have: Google Apps Script Find function caller id Maybe you could create a separate click handler for every button: var editButton = app.createButton("edit"+ i).setId("editButton"+i).addClickHandler(editProjectsHandler+i).setTag(i); Then every button would have it's own handler. That way, whatever handler was triggered would be directly correlated to the button. With HTML you could use this.id as the argument in the function call, but I don't know if that is possible with the UI Service.
has comment: http://stackoverflow.com/comment/38658178

http://stackoverflow.com/comment/38549843
score: 0
comment on: http://stackoverflow.com/q/24830042
type: Comment
type: QuestionComment
has text: can use the "ajaxComplete" event handler. Maybe it's not ready yet, since it's returned from an ajax call. Also, instead of .load() couldn't you wrap it in a $(function(){ }); check this link for the load api http://api.jquery.com/load/

http://stackoverflow.com/q/24903952
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: ember.js
has body: i have a problem getting Ember into an existing website-template. Some visual effects of the website are javascript-based and have to be initialized. The static html-version of the web-design uses the a script-tag with the following code jQuery(document).ready(function() { Main.init(); }); In case loading the website direct to a route (e.g. call localhost:9000/#/content/web) the visual-effects do not work. If i load the page to its root (where i don't have defined content to be shown by ember yet) everything is okay (even if i click on a link-to /content/web, the content is shown correctly). Cause the init-script is placed at the pages end, i guess the content which is shown through ember-logic prevent its execution. Does anyone know how to place such init-sequences the right way with ember?
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38690409
linked to: http://stackoverflow.com/q/39402054
type: Question
score: 2
has title: ember where to put jquery ready-function?
has answer: http://stackoverflow.com/a/24912317
answer count: 1

http://stackoverflow.com/comment/38582200
comment on: http://stackoverflow.com/a/24805326
type: AnswerComment
score: 0
type: Comment
has text: i try to add color with `chart.colors()` but it doesn't work. can you please give an example. thanks. i'm update my code that for my trying.

http://stackoverflow.com/q/24836573
accepted answer: http://stackoverflow.com/a/24836615
favorite count: 0
has body: I'm currently working on a script that loads content when either you trigger it (by clicking a link), or you scroll to the bottom of the page. I'm doing this for fun, but it is slowly turning into a nightmare... The triggered part works correctly, while the "scroll to the bottom" part sometimes works and sometimes doesn't. It will sometimes load a post twice, and sometimes repeat the sets of posts (I'm loading 5 at a time) and not display the next set, my guess is that it is because it loads content so fast, that: The queries get all mixed up (AJAX calls/mysql queries/Responses...?) or... There's some kind of problem with the DOM (I guess this is the correct way of calling this...) or... It is the cause of another glitch that I can't currently think of because of my basic knowledge... The problem arises when you keep the scroll bar down, and so it loads the content very fast, it is especially a problem with Firefox, since if you are already at the bottom and refresh the page, it will load indefinitely until there are no more posts, and again, it does it really fast. I've tried different approaches, all day... and I can't find a solution. First, I tried setting a flag, so that when each AJAX call finishes, it increases a certain variable by the number of posts loaded, and will only execute the call again if the number has been increased, and it must do so orderly (which in my head meant succesful AJAX call). This didn't work. Then I tried setting a timeout, for the AJAX call, and then for the function that contains that call, and then for the function that executes the function in the first place (scrolling to the bottom), this kind of worked, but with the drawback of it not doing anything for that timeout (and thus, not even displaying the "loading" html) and with the situation happening fewer times, but still happening. I also tried setting the timeout in the $.ajax() function, which I think is a different kind of timeout, because it did not do what I desired... Fi…
downvote count: 0
has answer: http://stackoverflow.com/a/24836615
has title: Incorrect AJAX data loading with "infinite" scrolling
tagged with: php
type: AnsweredQuestion
score: 1
type: Question
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/38561782

http://stackoverflow.com/a/24892397
answers question: http://stackoverflow.com/q/24892315
has comment: http://stackoverflow.com/comment/38668145
has comment: http://stackoverflow.com/comment/38668322
downvote count: 0
has comment: http://stackoverflow.com/comment/38668300
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/38668038
upvote count: 2
has body: Just use jquery.parents(). It is somewhat similar to find() except it searches all parents. Something like this might be close to what you are looking for: $(this).parents('li').each(function() { $(this).children('input').prop('checked', true); }); See http://api.jquery.com/parents/ for more information. EDIT: Alright, here is a solution that works: http://jsfiddle.net/3y3Pb/12/ EDIT2: And a more streamlined solution here: http://jsfiddle.net/3y3Pb/14/

http://stackoverflow.com/q/24906865
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38696316
type: Question
has body: When I click on the image which appears when hovered over a text, that element will be moved to another UL. I need the same image option as which is on the 1st list to delete it. I dont know how to add it dynamically. Can anyone help please? Thanks in advance. Image link is: https://www.signaturecontrolsystems.com/Support/SmallRedX.gif Example List 1 List 2 Apple Orange Avacado Banana Mango
possible better answer: http://stackoverflow.com/a/24908036
has answer: http://stackoverflow.com/a/24908013
tagged with: jquery-ui
accepted answer: http://stackoverflow.com/a/24908013
tagged with: jquery-ui-selectable
tagged with: javascript
has title: Add image while adding elements to a unordered list from another UL dynamically
answer count: 2
upvote count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/24908036
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion

http://stackoverflow.com/q/24791300
type: UnansweredQuestion
has title: How do I access the raw (or full) X509 Certificate in a Node.js web app
tagged with: x509certificate
tagged with: node.js
score: 2
upvote count: 2
tagged with: x509
type: Question
has answer: http://stackoverflow.com/a/63854328
tagged with: ssl
has body: Given a simple Node.js app: var https = require('https'); var fs = require('fs'); var options = { key: fs.readFileSync('mykey.pem'), cert: fs.readFileSync('mycert.pem') }; https.createServer(options, function (req, res) { console.log(req.connection.getPeerCertificate()); res.writeHead(200); res.end("hello world\n"); }).listen(8000); Results in output to the console with a representation of the certificate, not the original (PEM) format. Are there other methods available to access the original?
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/38653028
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24884701
score: 0
has text: oh how do I fix it. I have not used .then before but I want meta1() to be called after meta is called and one of the options has been selected to pass the parameter

http://stackoverflow.com/comment/38710141
comment on: http://stackoverflow.com/a/24874083
type: AnswerComment
has text: @ahruss I actually didn't think of that. I suppose you could overcome the duplicate element problem by setting `holder[arr2[i]]` to `false`. This means if an element in `holder` is either `false` or `undefined`, it will return false. As for the objects, I suppose you could compare them, similar to how I merged an array of objects in [this answer](http://stackoverflow.com/a/24847271/2476755).
score: 0
type: Comment

http://stackoverflow.com/a/24965522
answers question: http://stackoverflow.com/q/24869267
has comment: http://stackoverflow.com/comment/38806652
score: -1
has body: There's nothing inherently wrong with this approach: app.use(function(req, res) { req.mymethod = function()... }); The middleware runs in the order it's defined, so as long as that appears before your other middleware and routes, you have assurance that it'll be there. Personally, if it was a static function that wasn't doing anything fancy, I'd store it in a separate module, require() it where I need it, and leave it at that. But if, for some reason, you need request-specific variables in there, it might be handy to do it as you suggested. For example, creating a closure: app.use(function(req, res, next) { // Keep a reference to `someVar` in a closure req.makeMessage = (function(someVar) { return function () { res.json({hello : someVar}); }; })(/* put the var here */); next(); }); app.get('/hello', function(req, res) { req.makeMessage(); }); A contrived, rather useless example, but it could be useful in some cases.
has comment: http://stackoverflow.com/comment/38806641
downvote count: 1
upvote count: 0
type: Answer

http://stackoverflow.com/comment/87175932
comment on: http://stackoverflow.com/a/24778426
type: Comment
has text: besides ShowPageAction, there is now SetIcon, since Chrome v39
score: 0
type: AnswerComment

http://stackoverflow.com/a/24808987
upvote count: 2
score: 2
has comment: http://stackoverflow.com/comment/38619151
has comment: http://stackoverflow.com/comment/38644891
downvote count: 0
answers question: http://stackoverflow.com/q/24756853
has comment: http://stackoverflow.com/comment/38601614
has body: According to the spec, the xhr isn't automatically GC'd. 4.2 Garbage collection An XMLHttpRequest object must not be garbage collected if its state is OPENED and the send() flag is set, its state is HEADERS_RECEIVED, or its state is LOADING and it has one or more event listeners registered whose type is one of readystatechange, progress, abort, error, load, timeout, and loadend. If an XMLHttpRequest object is garbage collected while its connection is still open, the user agent must terminate the request. This article has a good explanation of this problem and similar ones. The usual fix is to clear references to the host object in the callbacks via xhr = null after xhr.send(). I say usual fix because you aren't allocating more xhr objects or doing anything with the results in this example. As you said, the heap isn't changing and it doesn't look like you have a leak. Using chrome task manager alone can't tell you if you have a leak. I found this article as a helpful tutorial on how to use chrome's devtools to diagnose memory leaks. You will need to trigger GC manually and verify the memory doesn't keep growing. If you find you do indeed have a memory leak, you can use devtools to figure out which objects are are not part of the retaining path, but still in memory (more information about how to do this in that article).
type: Answer
has comment: http://stackoverflow.com/comment/38601678

http://stackoverflow.com/comment/38579171
type: Comment
type: QuestionComment
has text: what do you expect to get from the element? Stop and explain your problem from a higher level...so far very little is making sense
score: 0
comment on: http://stackoverflow.com/q/24845835

http://stackoverflow.com/a/24817725
upvote count: 4
has comment: http://stackoverflow.com/comment/38527853
type: AcceptedAnswer
downvote count: 0
has body: Try this: document.getElementById('txtScore').value = totalScore;
type: Answer
answers question: http://stackoverflow.com/q/24817703
accepted answer of: http://stackoverflow.com/q/24817703
has comment: http://stackoverflow.com/comment/38526143
score: 4

http://stackoverflow.com/a/25454192
type: Answer
has body: If you have an endpoint that return a paginate/sort result you could use this AngularJS component to render in a table your data http://zizzamia.com/ng-tasty/#TableServerSide
score: 0
answers question: http://stackoverflow.com/q/24866854

http://stackoverflow.com/comment/38541613
score: 0
comment on: http://stackoverflow.com/q/24825880
type: QuestionComment
has text: Your `select` output doesnt match what you have for `ng-options`
type: Comment

http://stackoverflow.com/comment/38530515
type: Comment
type: QuestionComment
has text: Which browser do you use? The json is valid so it must be something about the js code. When using jslint, it would beef about the parseInt missing the radix -> `parseInt(foo, 10);` Maybe your browser is very picky on this topic too.
comment on: http://stackoverflow.com/q/24819523
score: 0

http://stackoverflow.com/q/24758194
tagged with: api
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: click
favorite count: 0
accepted answer: http://stackoverflow.com/a/24801546
tagged with: http://stackoverflow.com/tag/html
tagged with: events
upvote count: 1
type: AnsweredQuestion
has body: I am very new to Javascript, and have only very limited experience with HTML as well. I am trying to incorporate the Google API 3 into a Delphi application, but I'm running into issues with the Javascript. The basic functionality I require is to click on the Google Map, and return the coordinates to the Delphi application for use elsewhere. I can open the google map, and even register the click event to place a marker and zoom the screen (thanks to some really good advice from this forum). But when I try to retrieve the coordinates, my system returns an error message "Object doesn't support property or method 'getLatitude'. I have also tried this with function RetrieveCoords(event) { var lat = event.latlng.lat(); var lng = event.latlng.lng(); var alt = event.getaltitude(); placeMarker(event.latLng, map) } I haven't yet implemented the part where I retrieve the values from Delphi, but there is a good example here(), and that will require the Javascript to function properly. Can someone please help? I'm using the following html code in a Delphi XE5 (VCL) application with a TWebbrowser.
has title: Error in Javascript when returning coordinates from Google Earth API
score: 1
has answer: http://stackoverflow.com/a/24801546
type: Question

youtube-javascript-api
type: Tag
tags question: http://stackoverflow.com/q/24841758
tag name: youtube-javascript-api

http://stackoverflow.com/comment/38530160
score: 0
has text: can you show, what you tried till now, put it in jsfiddle.
comment on: http://stackoverflow.com/q/24819921
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24753685
tagged with: javascript
has body: I'm having the following problem with my code below: when 'productSearchResult' is populated via AJAX, the contents are not included when the form is submitted using the 'Add' button. UPDATE 1: Strangely it is working, but only the first time productSearchQuery is populated. Any subsequent populations of productSearchQuery run into the problem above. HTML: Add HTML loaded via AJAX into productSearchResult: JS: UPDATE 2: OK, first off I want to apologise for not including this code in my original post, I honestly didn't suspect it could be the cause. I've fixed my code after rolling back the JS which is returned with the radio buttons. I can't understand why the new JS causes the problem above, whereas the old JS does not. Here's the old JS that works fine: $('tr.product input[type=radio]').hide(); $('tr.product').mouseover(function() { $(this).addClass('blueHover'); }).mouseout(function() { $(this).removeClass('blueHover'); }); $('tr.product').click(function(event) { $('tr.product').removeClass('blueChecked'); $(this).closest('tr').addClass('blueChecked'); if (event.target.type !== 'radio') { $(':radio', this).attr('checked', true); } }); Here's the new JS that causes the problems above: $('tr.product input[type=radio]').hide(); $(document).on({ mouseenter: function () { $('td', $(this).parent()).addClass('blueHover'); }, mouseleave: function () { $('td', $(this).parent()).removeClass('blueHover'); }, click: function (event) { $('tr.product').removeClass('blueChecked'); $(this).closest('tr').addClass('blueChecked'); if (event.target.type !== 'radio') { $(':radio', $(this).parent().parent()).attr('checked', false); $(':radio', $(this).parent()).attr('checked', true); } } }, 'tr.product td');
score: 0
answer count: 2
tagged with: jquery
has answer: http://stackoverflow.com/a/24754936
has comment: http://stackoverflow.com/comment/38405459
tagged with: ajax
has comment: http://stackoverflow.com/comment/38406861
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38407022
type: Question
has comment: http://stackoverflow.com/comment/38406135
has answer: http://stackoverflow.com/a/24753935
has title: Form doesn't submit form data populated via AJAX
has comment: http://stackoverflow.com/comment/38407082
has comment: http://stackoverflow.com/comment/38410360

http://stackoverflow.com/comment/38433854
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24768379
score: 0
has text: I didn't mean the `Object.create` call (which is not the solution anyway, as the properties of `Foo` are irrelevant to scope). I meant your `bar` function, which *on every invocation* creates its own set of `location`, `callback` and `ref` variables.

http://stackoverflow.com/comment/39367632
comment on: http://stackoverflow.com/q/24771088
type: QuestionComment
type: Comment
has text: You can add spacingRight and disable crop (by setting it as false), and overflow as justify.
score: 0

http://stackoverflow.com/comment/38473809
has text: The `offset().top` of my `div` hasn't a fixed value, so, everytime the page is rendered, the `.offset().top` could have a different value
type: Comment
score: 0
comment on: http://stackoverflow.com/a/24789571
type: AnswerComment

http://stackoverflow.com/q/24798531
linked to: http://stackoverflow.com/q/1085801
tagged with: javascript
score: -1
has body: I have a form which calculates a dynamic quote on the fly depending on options, and one of these options is two drop downs like this: Need a venue? Avoid the red tape and book a marquee What package would you like to order? Bronze Silver Gold How many people will be attending? 0 50 100 150 200 250 In the javascript I have a calculate total function which runs other functions and adds together a returned value from the function. The function for the Marquee section is below function calculateMarquee(){ var theForm = document.forms["cakeform"]; var guests = theForm.elements["guests"].value; var marqueePackage = theForm.elements["marquee_package"].value; var marqueePrice = 0; if (marqueePackage = "Bronze"){ if (guests = 0){ marqueePrice = 0; } if (guests = 50){ marqueePrice = 650; } if (guests = 100){ marqueePrice = 950; } if (guests = 150){ marqueePrice = 1400; } if (guests = 200){ marqueePrice = 1850; } if (guests = 250){ marqueePrice = 2400; } } else if (marqueePackage = "Silver"){ if (guests = 0){ marqueePrice = 0; } if (guests = 50){ marqueePrice = 1100; } if (guests = 100){ marqueePrice = 2150; } if (guests = 150){ marqueePrice = 2550; } if (guests = 200){ marqueePrice = 4100; } if (guests = 250){ marqueePrice = 5100; } } else { //gold if (guests = 0){ marqueePrice = 0; } if (guests = 50){ marqueePrice = 1900; } if (guests = 100){ marqueePrice = 2800; } if (guests = 150){ marqueePrice = 3200; } if (guests = 200){ marqueePrice = 4750; } if (guests = 250){ marqueePrice = 5750; } } return marqueePrice; } The problem is.... right now this function just returns the price of 2400 and will not change at all and I don't know why?
has answer: http://stackoverflow.com/a/24798914
answer count: 2
has answer: http://stackoverflow.com/a/24798726
favorite count: 0
has comment: http://stackoverflow.com/comment/38490394
has comment: http://stackoverflow.com/comment/38490374
type: UnansweredQuestion
has title: Javascript form just ain't playing ball
has comment: http://stackoverflow.com/comment/38617849
has comment: http://stackoverflow.com/comment/38568686
downvote count: 1
has comment: http://stackoverflow.com/comment/38490450
type: Question
upvote count: 0

http://stackoverflow.com/comment/38598139
type: QuestionComment
has text: Why do you need the div to disappear? If it's purely for grouping, doesn't it not affect the display? Also, could you post your HTML/CSS in a jsFiddle?
comment on: http://stackoverflow.com/q/24855559
score: 0
type: Comment

http://stackoverflow.com/a/24834623
accepted answer of: http://stackoverflow.com/q/24834595
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38558283
has comment: http://stackoverflow.com/comment/38558549
type: Answer
answers question: http://stackoverflow.com/q/24834595
has body: Yes - visibility is a CSS rule name, not an HTML attribute. htmlElement.style.visibility = 'hidden'; Bear in mind, though, that, unless you have good reason to use visibility (and there are some), you'd normally hide elements via display (= 'none') rather than via visibility. Also, you're assuming that your function will find an element. If it doesn't, your code will error. Best to check this first: function hide_article() { var htmlElements = document.getElementsByTagName("article"); if (htmlElements.length) { //&lt;-- check before continuing htmlElements[0].style.visibility = "hidden"; console.log("hid element"); } };
upvote count: 7
score: 7
has comment: http://stackoverflow.com/comment/38565970

http://stackoverflow.com/a/24845740
accepted answer of: http://stackoverflow.com/q/24836165
answers question: http://stackoverflow.com/q/24836165
type: AcceptedAnswer
has body: Unfortunately, it seems like this is caused by a bug in WebKit-based browsers (see this answer). I tried Safari, Chrome, and Firefox, and the issue only appeared on Chrome and Firefox. Unfortunately, there is not much you can do besides not adding styles, waiting for a fix, or removing the extra HTML. If you would like to remove the extra HTML, you may find Working around Chrome's contenteditable span bug helpful. Note: This was copied from my comment.
score: 0
type: Answer

http://stackoverflow.com/q/24830281
tagged with: fancytree
score: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25379772
type: Question
has title: Fancytree: Remove nodes without children
has body: I want to remove selected nodes and move all children to it's place. I use code: ref = $('#tree').fancytree("getTree"), searchIDs = ref.getSelectedNodes(); searchIDs.forEach(function(node){ $children = node.children; if ($children!==null)node.parent.addChildren($children,node.getNextSibling()); node.remove(); }); Where #tree is div with ul\li. If Nodes > 1 I have error "Uncaught TypeError: Cannot call method 'addChildren' of null " and only one node is removed.
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/38695008
comment on: http://stackoverflow.com/q/24906603
score: 0
has text: each (css or jquery)...
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24877947
type: Answer
score: 4
upvote count: 4
downvote count: 0
has body: The $cond operator is a ternary operator that evaluates a conditional expression to true/false and returns either the second or third arguments respectively depending on the evaluation. Your field in this case is either boolean true/false, so there is no need to test with another operator. You implement this inside the $sum: BlogPost.aggregate( [ { "$group": { "_id": null, "total_count": { "$sum": 1 }, "draft_count": { "$sum": { "$cond": [ "$draft", 1, 0 ] } } } ], function(err,results) { } ); Passing in null to the _id value of group means that you are not "grouping" on any specific document key but are grouping all of the documents in the collection.
answers question: http://stackoverflow.com/q/24875083
has comment: http://stackoverflow.com/comment/38679473
has comment: http://stackoverflow.com/comment/39060710
has comment: http://stackoverflow.com/comment/39057462

http://stackoverflow.com/comment/38560072
type: QuestionComment
has text: @Pogrindis didnt add any packages that werent already with the seed...
score: 0
comment on: http://stackoverflow.com/q/24835395
type: Comment

http://stackoverflow.com/a/24759974
downvote count: 0
has body: Consider moving the document.getElementById portion into the insertEmotion() function. Call like this insertEmotion('chat-msg') where insertEmotion takes the element name as its parameter.
score: 1
has comment: http://stackoverflow.com/comment/38419298
upvote count: 1
answers question: http://stackoverflow.com/q/24759884
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24759884
type: Answer

http://stackoverflow.com/comment/38777493
type: Comment
has text: @Nobita Ofcourse. I couldn't agree more.
type: QuestionComment
comment on: http://stackoverflow.com/q/24890124
score: 0

http://stackoverflow.com/q/24810121
has body: Please while helping, don't use 'angular-directive'. You can help me through jquery, pure javascript or angular Add Row click Please refere to http://jsfiddle.net/micronyks/ZwwH7/3/ fiddle, automatically you will come to know what i want as i've put appropriate msgs. Fiddle will tell you everything please open up that fiddle right now to help me. Now My .js file function ctrl($scope) { alert('as page loads, I want these two Dropdows as they come (no change)') $scope.roles=[{ roleId:1, roleName:"Admin"},{roleId:2,roleName:"guest"}]; $scope.persons = [{contactId: 1,roleId:1,personName: "Joy"}, {contactId: 2,roleId:1,personName: "Jack"}, {contactId: 3,roleId:1,personName: "Jonh"}, {contactId: 4,roleId:2,personName: "Gereth"}]; $scope.loadPersons=function(id) { $scope.personList=[]; angular.forEach($scope.persons,function(person) { if(person.roleId==id) { $scope.personList.push(person); } }) }; $scope.addRow=function() { alert('as I click this button, I want same dropdowns with pre-loaded data dynamically in next line and so on'); } $scope.click=function(data) { console.log(data.roleId); console.log(data.contactId); } }
has answer: http://stackoverflow.com/a/24826939
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38543423
score: 0
accepted answer: http://stackoverflow.com/a/24826939
tagged with: angularjs
has title: Bind Dynamic Dropdowns with ng-Options with pre-loaded data
has comment: http://stackoverflow.com/comment/38514416
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38523667
type: Question

http://stackoverflow.com/a/24775703
score: 2
has body: Hoping that you have Node.js installed in your system, you can use this command to install Sails: sudo npm -g install sails To verify you SailsJS installation use this command: sails -v You can follow this helpful tutorial on this: How to install Sails.js
answers question: http://stackoverflow.com/q/24775604
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/24775604

http://stackoverflow.com/a/24834604
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/24834115
has body: Your id cannot have spaces in it. It doesn't work like class where you can specify multiple values, the element can only have one id. See this link: What are valid values for the id attribute in HTML?
answers question: http://stackoverflow.com/q/24834115
has comment: http://stackoverflow.com/comment/38558464

http://stackoverflow.com/comment/38656876
type: AnswerComment
has text: you guys should become friends
comment on: http://stackoverflow.com/a/24885357
type: Comment
score: 1

http://stackoverflow.com/comment/38531594
type: Comment
comment on: http://stackoverflow.com/a/24820608
type: AnswerComment
has text: yes it's possible with a timeout :) I'll update in a sec :) and it seems like 1.7 and up should do ;)
score: 0

http://stackoverflow.com/a/29490550
has comment: http://stackoverflow.com/comment/57721541
type: Answer
downvote count: 2
upvote count: 1
has body: you need to add on the client this code: Meteor._reload.onMigrate(function() { return [false]; }); How can I disable live reload in meteor?
score: -1
answers question: http://stackoverflow.com/q/24778312

http://stackoverflow.com/comment/38549111
comment on: http://stackoverflow.com/a/24829591
has text: @majidarif Data parsing can take a few milliseconds in some cases, but imagine a client just sent you 100MB of data to parse. Now its probably taking a few tenths of a second. Now imagine you're getting 10GBs of data. Now we're talking a few seconds. Now imagine there are 100 clients all sending you MBs or GBs of data, etc. All of a sudden parsing is taking up enough time to noticeably affect your ability to respond to clients. This may not be directly relevant to your use-case, but it's something to consider. (cont)
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/40971887
has text: `I haven't done web design for iOS` - if you're doing web design, you do it for every platform. Because the web is on every platform.
type: AnswerComment
type: Comment
score: 8
comment on: http://stackoverflow.com/a/24889258

http://stackoverflow.com/comment/38432089
type: Comment
type: QuestionComment
has text: Try, `$("#checkBox").css("display", "block");` and `$("#thankYou").css("display", "block");`
comment on: http://stackoverflow.com/q/24767799
score: 0

http://stackoverflow.com/comment/91846428
has text: One other thing to check. If you have a long-running init sequence on a complex form, and you want to set some SELECT box default value, you may want to set a $watch on an isReady flag that you implement and then call $timeout(function(){ $scope.$apply( function(){ viewmodel.Value = desiredValue;} ) } , 0) because you may be changing the viewmodel value at a time that is not picked up by Angular's digest cycle.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24788936

http://stackoverflow.com/comment/38443669
has text: @nightgaunt I did try your code, but it doesn't refresh the div. I appreciate all who are trying to help me out. Thanks to all you guys in Advance.
score: 0
comment on: http://stackoverflow.com/q/24773497
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38624085
comment on: http://stackoverflow.com/q/24869277
score: 0
has text: what plugin you're using for datepicker?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24779419
has body: function Picker() { this.status = [0, 0, 0]; this.progress = Picker.status[0]; } var picker = new Picker(); picker.progress = 2; Now if I check the information held by progress and status[0] they will be different. How can I make these a reference instead of copies? Many thanks
has comment: http://stackoverflow.com/comment/38453409
linked to: http://stackoverflow.com/q/122102
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/38453550
has comment: http://stackoverflow.com/comment/38453425
upvote count: 1
accepted answer: http://stackoverflow.com/a/24779538
type: Question
has title: Assigning a variable value : Reference it instead of copying it
tagged with: javascript
tagged with: variables
has answer: http://stackoverflow.com/a/24779538
has comment: http://stackoverflow.com/comment/38453471
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/38453626
favorite count: 0

http://stackoverflow.com/comment/38628278
score: 0
comment on: http://stackoverflow.com/a/24866137
type: Comment
type: AnswerComment
has text: Yeah, there are probably better ways to handle this, but this is just one example of a reusable service.

http://stackoverflow.com/a/24863119
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/24862285
has body: Try and use some other constant value for the button: http://jsfiddle.net/5xbp5/ $(document).ready(function () { function togglesidebar(flag) { if (flag == -1) { $('#xs-menu').toggleClass('show hide'); $('#lg-menu').toggleClass('show hide'); } else if (flag == 1) { $('#xs-menu').addClass('show').removeClass('hide'); $('#lg-menu').addClass('hide').removeClass('show'); } else { $('#xs-menu').addClass('hide').removeClass('show'); $('#lg-menu').addClass('show').removeClass('hide'); } } $('#collapse').click(function(){ togglesidebar(-1); }); $(window).resize(function () { windowsize = $(window).width(); if (windowsize &lt; 768) { togglesidebar(1); } else { togglesidebar(0); } }); }); Your function call $('#collapse').click(togglesidebar); without arguments does not seem to call togglesidebar(flag)
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/24862285
type: AcceptedAnswer

http://stackoverflow.com/a/24883705
downvote count: 0
score: 1
has body: The answer was much simpler that I thought. I placed the solution below for anybody that need an equivalent solution :) : $unlink_button.addEventListener( 'click', function(event) { // Get the element with ID wpf-remove-element-now var link = document.getElementById("wpf-remove-element-now"); // By this code you replace the link outeHTML (the link itself) with // the link innerHTML (anything inside the link) link.outerHTML = link.innerHTML; } ); Here you can find the running solution : JSFiddle Note: The inspiration for this solution found in the web page.
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24882712
type: Answer
answers question: http://stackoverflow.com/q/24882712

http://stackoverflow.com/comment/38605484
has text: That don't work, because the code that you provided, only assign a new value to the object. The code are not "pushing" new values the object.
comment on: http://stackoverflow.com/a/24859426
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38709653
comment on: http://stackoverflow.com/q/24832094
score: 0
type: Comment
type: QuestionComment
has text: @Sergio sorry, I haven't tested it yet, let me try later today and will let you know how it went. But yeah, I just want to check the corresponding checkbox on the bottom when I click on the options on the dropdown. Thanks

http://stackoverflow.com/comment/38695498
comment on: http://stackoverflow.com/a/24905763
score: 0
type: AnswerComment
type: Comment
has text: 'node --version' does not work, but it works well: 'nodejs -version' after 'npm install csscomb -g' - displaying the error 'npm ERR! 404 'ccscomb' is not in the npm registry. npm ERR! 404 You should bug the author to publish it npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, or http url, or git url. npm ERR! System Linux 3.13.0-29-generic npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "ccscomb" "-g" npm ERR! cwd /var/www/markup/www/TripleDry.pro npm ERR! node -v v0.10.25 npm ERR! npm -v 1.3.10 npm ERR! code E404'

http://stackoverflow.com/q/24843849
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/24844159
has answer: http://stackoverflow.com/a/24844002
has title: Why does the variable replace not evaluate to 13168375?
has body: var counts = [ "TION 13168375", "IONT 11234972", "THER 10218035", "THAT 8980536"]; var replace = 0 var scored = 0 var qgram = "" function score(ciphertext) { qgram = ciphertext for (var a=0;a&lt;counts.length;a++){ console.log(counts[a].substring(0,4)) if(counts[a].substring(0,4)==qgram){ console.log("t") replace = parseInt(counts[a].replace(/[^1-9]/g),""); scored+=Math.log(replace/4600000000)*Math.LOG10E } } } score("TION") When I run the code the "t" shows up indicating that the if statement works but the variable replace is NaN, why is this?
has answer: http://stackoverflow.com/a/24844159
tagged with: regex
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24844002
type: Question
tagged with: for-loop
tagged with: if-statement
tagged with: javascript

http://stackoverflow.com/comment/38695052
has text: I use Sinon to mock promises, it simplifies the mocking creation process for me, take a look at: http://stackoverflow.com/questions/20555234/how-does-one-stub-promise-with-sinon
score: 0
comment on: http://stackoverflow.com/q/24906644
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/52402984
has text: Ty! Just to add, line breaks `(\n)` work as well, any other secrets? :)
comment on: http://stackoverflow.com/a/24828158
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38567427
type: AnswerComment
has text: that worked, but i still don't understand it, could you please explain it to me?
type: Comment
comment on: http://stackoverflow.com/a/24839829
score: 0

http://stackoverflow.com/a/25024356
upvote count: 3
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38939369
type: Answer
has comment: http://stackoverflow.com/comment/38944165
has comment: http://stackoverflow.com/comment/38939079
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24899444
answers question: http://stackoverflow.com/q/24899444
score: 3
has comment: http://stackoverflow.com/comment/38944271
has body: JSfiddle was blocking the input element on mobile chrome with another element above it, so it was never actually focused. It just looked focused.

http://stackoverflow.com/comment/38845017
score: 0
type: AnswerComment
has text: Thanks for your improvisation. I have since made a few adjustments to create the ContextMenu below the mouse cursor instead of outside the div. However, I ran into a few problems with the zIndex of the ContextMenu. See this [fiddle](http://jsfiddle.net/c2Ay2/8/). It appears that JCrop does not recognise onRelease any more when the zIndex of ContextMenu is greater than that of JCrop.
comment on: http://stackoverflow.com/a/24893305
type: Comment

http://stackoverflow.com/comment/38447503
has text: CORS needs to be enabled on the server. You might have to write some proxy for this API.
score: 3
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24776062

drilldown
tags question: http://stackoverflow.com/q/24798431
tags question: http://stackoverflow.com/q/24887796
tags question: http://stackoverflow.com/q/24772832
type: Tag
tag name: drilldown

http://stackoverflow.com/comment/38626544
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24870494
has text: Do you mean that your problem is that the page is continually increasing in size as you scroll to the bottom? I'm guessing that's not your intent; you simply want the page to be as high as the content?
score: 0

http://stackoverflow.com/comment/38537957
comment on: http://stackoverflow.com/q/24824059
score: 0
has text: What do you want to remove?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38798640
comment on: http://stackoverflow.com/a/24844838
type: Comment
score: 1
has text: Please note: `var path = Services.io.newURI(aFileURL, null, null).QueryInterface(Ci.nsIFileURL).file.path;` results in error (since file doesn't exist) ... it should be: `var file = Services.io.newURI(aFileURL, null, null).QueryInterface(Ci.nsIFileURL).file.path;` ... the value of `file` is now the `path`. it is the same with the next one too ;)
type: AnswerComment

http://stackoverflow.com/comment/38794447
type: AnswerComment
comment on: http://stackoverflow.com/a/24932294
has text: no, it can not replace dynamic urls...also, it will not even look for `ng-src` attribute at all (only `src` attributes would be processed)
type: Comment
score: 0

http://stackoverflow.com/a/24844101
upvote count: 7
has comment: http://stackoverflow.com/comment/38575682
score: 7
has body: 1- Why does the check for string fails when the string is empty using the string2.charAt? The following expression evaluates to false because the first condition fails: var string2 = ""; if (string2 &amp;&amp; string2.charAt) { console.log("doesn't output"); } That second line is basically equivalent to: if (false &amp;&amp; true) { console.log("doesn't output"); } So for example: if (string2) { console.log("this doesn't output since string2 == false"); } if (string2.charAt) { console.log('this outputs'); } 2- Why does the instanceof check fail? This fails because, in javascript, string can be literals or objects. For example: var myString = new String("asdf"); myString instanceof String; // true However: var myLiteralString = "asdf"; myLiteralString instanceof String; // false You can reliably tell if it's a string by checking both the type and the instanceof: str instanceof String || typeof str === "string";
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24844039

http://stackoverflow.com/comment/38531409
has text: Overflow hidden: http://stackoverflow.com/questions/11301841/how-to-scroll-within-an-overflow-hidden-div-to-a-certain-currently-invisible-ele
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24819096
type: Comment

http://stackoverflow.com/a/24780613
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24780542
upvote count: 1
has body: This should work: var listsWithMoreChildren = $('ul').filter(function( index ) { return $(this).children().length &gt; 2; }); listsWithMoreChildren.css('background-color', '#ff0'); For more information on the filter function, please read the documentation. http://api.jquery.com/filter/
type: Answer

http://stackoverflow.com/a/24846034
score: 1
has body: Try this: $('.person img').click(function() { $('.active').removeClass('active'); $(this).addClass('active'); $('html,body').animate({scrollTop: $(this).offset().top},'slow'); var index = $('.person img').index(this); $('.people p:visible').fadeOut('fast','linear').promise().done(function() { $('.people p:eq('+index+')').fadeIn('fast','linear'); }); }); Explanation: scrollTop() - position of scrollbar for element (window/div/anything scrollable). $("#element").offset().top - position of element relative to page. JSFiddle Demo Note: Also, added float:left; in .people p to keep the text on the left.
downvote count: 0
answers question: http://stackoverflow.com/q/24845971
type: Answer
has comment: http://stackoverflow.com/comment/38579334
upvote count: 1

http://stackoverflow.com/comment/38518307
comment on: http://stackoverflow.com/a/24813063
score: 0
type: Comment
type: AnswerComment
has text: I like the way it is described here: http://learn.jquery.com/ - you may start at the first chapter and later take a look at the events: http://learn.jquery.com/events/event-basics/ - it's just adding a active css class (.addClass) to the container you clicked on and if you click on the second or third tab remove it again (.removeClass) - hope this helps. M

http://stackoverflow.com/q/24834595
favorite count: 0
has answer: http://stackoverflow.com/a/24834624
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/24834624
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24834623
downvote count: 0
type: Question
score: 3
has answer: http://stackoverflow.com/a/24834623
has body: JavaScript: function hide_article() { var htmlElement = document.getElementsByTagName("article")[0]; htmlElement.setAttribute("visibility", "hidden"); console.log("hiding"); }; HTML: &lt;div id="right-hand-side"&gt; &lt;img src="resources/Logo.png" onmouseover="hide_article()" onclick="hide_article()"/&gt; &lt;/div&gt; This function is being called but the article is not being hidden. Any idea why? Cheers.
upvote count: 3
answer count: 2
has title: hide html element using javascript
tagged with: javascript

http://stackoverflow.com/comment/38440586
type: QuestionComment
comment on: http://stackoverflow.com/q/24771788
score: 0
type: Comment
has text: Better you take others' advice and switch to javascript. Unless you want to hide the way you are generating random card. JavaScript code is open to world.

http://stackoverflow.com/a/25008015
has body: I think the fastest way to do this witout even using the concat function : function repeatSimple(element, times) { var result = []; for(var i=0;i&lt;times;i++) result.push(element); return result; } And if you don't want to use the push function , you can assign the value directly to the item on the array like this function repeatSimple(element, times) { var result = Array(times); for(var i=0;i&lt;times;i++) result[i] = element; return result; } Another clever way to do this is to join an array and split it like this function repeatSimple(element, times) { (result = Array(times).join("," + element).split(',')).shift() return result; } But this last function returns an array of strings, you have to convert every element to the type you need, but anyway, these functions may help you
answers question: http://stackoverflow.com/q/24843241
score: 0
type: Answer

http://stackoverflow.com/a/24991466
score: 0
has comment: http://stackoverflow.com/comment/38954879
has body: &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt; Try adding this meta tag and check in IE
type: Answer
answers question: http://stackoverflow.com/q/24903016

http://stackoverflow.com/a/24887415
upvote count: 1
answers question: http://stackoverflow.com/q/24887271
score: 1
downvote count: 0
type: Answer
has body: I suggest you a refactor of your code in this way. Call server side function only if the user wants to save data. function Confirm() { if (confirm("Do you want to save data?")) { $.ajax({ url: 'your method url', type: "POST", //other parameters }).done(function( msg ) { alert( "Data Saved: " + msg ); }); } else { //other code } } I think that Thread.Sleep for this purpose is unuseful

http://stackoverflow.com/q/24779986
has comment: http://stackoverflow.com/comment/38454797
downvote count: 0
answer count: 1
has body: iv'e made a shopping cart in jquery (not a real one, it's just for practicing. i know it's not secure) and i made the products to be draggable, which gives you the option to drag them from the catalog to the shopping cart. my problem is that i am trying to add a total section that will give me the total price of every product iv'e dragged into the shopping cart. iv'e tried the following code, but it did'nt work. thank you for your time. Product 1 price: 400 Product 2 price: 200 Product 3 price: 900 Product 4 price: 152.30 shopping cart total: 0 also i'm including the jsfiddle - http://jsfiddle.net/kshayk/QbNtX/
has answer: http://stackoverflow.com/a/24780376
favorite count: 0
has comment: http://stackoverflow.com/comment/38454940
upvote count: 2
has comment: http://stackoverflow.com/comment/38455788
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24780376
type: Question
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
has title: can't figure out how to add a "total price" section to my shoping cart in jquery
score: 2
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/24777458
has title: HTML overflow-x set focus
type: AnsweredQuestion
has body: Currently, I have an overflow-x:scroll div, and I'd like to focus on "category_5" by default when page loading finishes. By default, user needs to scroll to "category_5" and click "category_5". Is it possible to focus on "category_5" when the first time loading finishes? Thanks in advance. Eric
type: Question
has answer: http://stackoverflow.com/a/24777671
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24777671
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: overflow
score: 0

http://stackoverflow.com/comment/47617901
has text: 1. Some UI5 control also has [setValueStateText()](https://openui5.hana.ondemand.com/#docs/api/symbols/sap.m.InputBase.html#getValueStateText) 2. Use [Data Types](https://openui5.hana.ondemand.com/#docs/guide/0eac123bf7da42bb957cca46047e6556.html) plus [Handling Wrong User Input](https://openui5.hana.ondemand.com/#docs/guide/c75861e33942410d9ac77322763db203.html) seems the built-in way of input handling, but I cannot see more benefit than custom error hanndling function.
comment on: http://stackoverflow.com/a/24798612
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/24869886
accepted answer of: http://stackoverflow.com/q/24868945
has comment: http://stackoverflow.com/comment/38662921
score: 0
answers question: http://stackoverflow.com/q/24868945
has comment: http://stackoverflow.com/comment/38663338
has body: $( "#datepicker" ).datepicker({ onClose: function(dateText){ x = dateText; alert("x = " + x); $("li.title&gt;span").eq(0).html(x); } });
type: Answer
has comment: http://stackoverflow.com/comment/38647883
has comment: http://stackoverflow.com/comment/38625827
has comment: http://stackoverflow.com/comment/38664678
has comment: http://stackoverflow.com/comment/38665801
type: AcceptedAnswer

http://stackoverflow.com/comment/38675172
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24896177
has text: can you share some piece of code if you have handy?

http://stackoverflow.com/q/24896443
tagged with: node.js
has answer: http://stackoverflow.com/a/24896729
type: AnsweredQuestion
score: 1
tagged with: livereload
upvote count: 1
type: Question
tagged with: javascript
answer count: 1
downvote count: 0
tagged with: gulp
has title: I can't get livereload to work when using node.js and gulp
favorite count: 0
has body: My gulpfile is as follows: var gulp = require('gulp'), connect = require('gulp-connect'), sass = require('gulp-ruby-sass'), autoprefixer = require('gulp-autoprefixer'), minifycss = require('gulp-minify-css'), jshint = require('gulp-jshint'), uglify = require('gulp-uglify'), imagemin = require('gulp-imagemin'), rename = require('gulp-rename'), clean = require('gulp-clean'), concat = require('gulp-concat'), notify = require('gulp-notify'), cache = require('gulp-cache'), livereload = require('gulp-livereload'); gulp.task('styles', function() { return gulp.src('main.scss') .pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.$ .pipe(gulp.dest('css')) .pipe(rename({suffix: '.min'})) .pipe(minifycss()) .pipe(gulp.dest('css')); }); gulp.task('default', function() { gulp.start('styles'); gulp.start('server'); gulp.start('watch'); }); gulp.task('server', function() { connect.server({ livereload:true }); }); gulp.task('indexChange',function(){ console.log('index has changed'); connect.reload(); } ); gulp.task('watch', function() { gulp.watch('index.html', ['indexChange']); }); when I change my index.html file the 'indexChange' task runs and the console outputs 'index has changed', however connect.reload() does nothing. I've check the liverload port and the connect server port so I know both are running. But I can't figure out what code I'm missing to get livereload to work. What am I doing wrong?
accepted answer: http://stackoverflow.com/a/24896729

http://stackoverflow.com/a/24751882
score: 0
has body: The simplest way, that will work on any browser and won't rely on any library is to loop through all the labels on the page, look for the text in them, and paint them red. var labels = document.getElementsByTagName('label'); for (i = 0; i &lt; labels.length; i++) { if (labels[i].innerHTML.indexOf('Not Recommended') !== -1) { labels[i].style.color = 'red'; } } Example Although using a class is the correct course of action. These labels have something in common, they are all not recommended. In fact a better course of action can be seen in this example, where the Not Recommended is added on its own with CSS.
has comment: http://stackoverflow.com/comment/38402017
type: Answer
answers question: http://stackoverflow.com/q/24751667
accepted answer of: http://stackoverflow.com/q/24751667
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38402062

http://stackoverflow.com/comment/38468730
comment on: http://stackoverflow.com/q/24787035
type: Comment
has text: @mga do you get any error on console? Did you check the view source to see if this code is changed in any way?
type: QuestionComment
score: 0

http://stackoverflow.com/q/24797056
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24811660
has comment: http://stackoverflow.com/comment/38487507
has comment: http://stackoverflow.com/comment/38599196
has comment: http://stackoverflow.com/comment/38488264
has comment: http://stackoverflow.com/comment/38496697
has answer: http://stackoverflow.com/a/24797649
type: Question
has title: Jquery UI Datepicker refresh issue
answer count: 2
tagged with: jquery-ui
tagged with: asp.net-mvc
tagged with: .net
tagged with: javascript
tagged with: jquery
score: 0
has body: I have used jquery ui datepicker in my application. It is working fine for the first time, but failing to refresh the page after navigating to another page.Datepicker not working when i come to the datepicker page. @model FloorPlanner.Models.AuditViewModel Start Date End Date @*@Scripts.Render("~/bundles/jqueryui") *@ I have tried destroying the datepicker in document ready function also tried refresh in the same, nothing working, it is working only if i do the entire application refresh by pressing F5. I have included the js,css files in bundle config. Thanks

http://stackoverflow.com/comment/38558227
score: 1
has text: You don't show your JS, but possibly you're running outside of a document ready handler, i.e. before the elements are ready.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24834686

http://stackoverflow.com/comment/38540779
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24825493
has text: Can you provide the relevant code to reproduce the issue such the html,css or a minimal demo such as [JSFiddle](http://jsfiddle.net)?

http://stackoverflow.com/comment/90881642
type: Comment
comment on: http://stackoverflow.com/a/24811163
has text: Reason is incorrect usage of `==` operator, which coerces `undefined`, `null` and empty string all to falsy, thus invalidating your checks for `undefined`. See also https://stackoverflow.com/q/10560362/1594449.
score: 0
type: AnswerComment

http://stackoverflow.com/a/24807129
score: 0
has body: Change your code as like below, $(".openDialog").on("click", function (e) { e.preventDefault(); $("&lt;div&gt;&lt;/div&gt;") .addClass("dialog") .attr("id", $(this).attr("data-dialog-id")) .appendTo("body") .dialog({ title: $(this).attr("data-dialog-title"), close: function () { $(this).remove();}, modal: true, height: 500, width: 700 }) .load(this.href); });
type: Answer
answers question: http://stackoverflow.com/q/24806751

http://stackoverflow.com/comment/38566284
comment on: http://stackoverflow.com/a/24838847
has text: hi @ederpsampaio, if `l[0]` evaluated to the **string** `"user"` for instance, then `l[0][0]` would evaluate to the string `"u"`.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/24806162
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/24805629
answers question: http://stackoverflow.com/q/24805629
has body: http://jsbin.com/renabuvu/2/edit Because the values are being mirrored to the textarea and not applied, clone will only apply the textarea to it's set values not what's being mirrored/reflected upon it. I had to add it as a string and then it worked perfectly. $(".val-nester").append($(" ") .append(" x ") .append(" "+ $(".inputval").val() +" ") .append(" "+ $("#asc #testcode:first-of-type").val() +" ") .append($(".valz2add .inputval:first-of-type").clone()) .append($(".cssvalz .pad:first-of-type").clone()) .append($(".cssvalz .bg:first-of-type").clone()) .append($(".cssvalz .boxshadow:first-of-type").clone()) );
score: 0

http://stackoverflow.com/q/24869545
tagged with: http://stackoverflow.com/tag/html
tagged with: php
tagged with: css
has comment: http://stackoverflow.com/comment/38624592
has comment: http://stackoverflow.com/comment/38624576
has answer: http://stackoverflow.com/a/24870192
type: Question
has body: New to stack overflow and web development -- Background: I am populating a div with an unknown and constantly changing amount of data (text) that I retrieve from a server using PHP. I want the text to be readable and be a constant size so I've figured about 5-7 lines can be put inside the div. Some days there might be more data than the div can fit inside and it will overflow the page. Instead of overflowing the div I'm wondering if there is a way to recognize that the div has overflowed and I want it to lets say pause for 10 seconds, then replace the current div to a new div with the rest of the information. I'm picturing a "fade out" to the new div, sort of like a slideshow. Any suggestions or help would be appreciated. Here is a snippet of the static, non-transitioning div I have so far: &lt;div class = "content-box subtext"&gt; &lt;?php foreach($sprintHash as $name =&gt; $value) { echo "$name =&gt;"; foreach($value as $ticket) { echo "$ticket | "; } echo "&lt;br&gt;"; } ?&gt; &lt;/div&gt; Tried looking into CSS3 transitions, still not sure how to detect when an overflow has occurred.
tagged with: javascript
has title: element transitions using javascript
score: 0
answer count: 1
type: UnansweredQuestion

php
tags question: http://stackoverflow.com/q/24761578
tags question: http://stackoverflow.com/q/24862607
tags question: http://stackoverflow.com/q/24766950
tags question: http://stackoverflow.com/q/24835471
tags question: http://stackoverflow.com/q/24805540
tags question: http://stackoverflow.com/q/24818987
tags question: http://stackoverflow.com/q/24890044
tags question: http://stackoverflow.com/q/24800863
tags question: http://stackoverflow.com/q/24752190
tags question: http://stackoverflow.com/q/24847343
tags question: http://stackoverflow.com/q/24886385
tags question: http://stackoverflow.com/q/24779356
tags question: http://stackoverflow.com/q/24837991
tags question: http://stackoverflow.com/q/24800968
tags question: http://stackoverflow.com/q/24862657
tags question: http://stackoverflow.com/q/24877158
tags question: http://stackoverflow.com/q/24759268
tags question: http://stackoverflow.com/q/24885957
tags question: http://stackoverflow.com/q/24787966
tags question: http://stackoverflow.com/q/24867216
tags question: http://stackoverflow.com/q/24908812
tags question: http://stackoverflow.com/q/24813577
tags question: http://stackoverflow.com/q/24764130
tags question: http://stackoverflow.com/q/24758131
tags question: http://stackoverflow.com/q/24842358
tags question: http://stackoverflow.com/q/24839145
tags question: http://stackoverflow.com/q/24905036
tags question: http://stackoverflow.com/q/24755215
tags question: http://stackoverflow.com/q/24835160
tags question: http://stackoverflow.com/q/24750275
tags question: http://stackoverflow.com/q/24835544
tags question: http://stackoverflow.com/q/24838976
tags question: http://stackoverflow.com/q/24834445
tags question: http://stackoverflow.com/q/24849564
tags question: http://stackoverflow.com/q/24895685
tags question: http://stackoverflow.com/q/24841571
tags question: http://stackoverflow.com/q/24849724
tags question: http://stackoverflow.com/q/24897380
tags question: http://stackoverflow.com/q/24796877
tags question: http://stackoverflow.com/q/24755479
tags question: http://stackoverflow.com/q/24764274
tags question: http://stackoverflow.com/q/24777265
tags question: http://stackoverflow.com/q/24819907
tags question: http://stackoverflow.com/q/24841071
tags question: http://stackoverflow.com/q/24797709
tags question: http://stackoverflow.com/q/24897529
tags question: http://stackoverflow.com/q/24846548
tags question: http://stackoverflow.com/q/24819854
tags question: http://stackoverflow.com/q/24789111
tags question: http://stackoverflow.com/q/24817497
tags question: http://stackoverflow.com/q/24843599
tags question: http://stackoverflow.com/q/24854265
tags question: http://stackoverflow.com/q/24883654
tags question: http://stackoverflow.com/q/24852549
tags question: http://stackoverflow.com/q/24827744
tags question: http://stackoverflow.com/q/24806260
tags question: http://stackoverflow.com/q/24815011
tags question: http://stackoverflow.com/q/24873509
tags question: http://stackoverflow.com/q/24771997
tags question: http://stackoverflow.com/q/24888035
tags question: http://stackoverflow.com/q/24893804
tags question: http://stackoverflow.com/q/24842957
tags question: http://stackoverflow.com/q/24751532
tags question: http://stackoverflow.com/q/24899364
tags question: http://stackoverflow.com/q/24839009
tags question: http://stackoverflow.com/q/24885739
tags question: http://stackoverflow.com/q/24757734
tags question: http://stackoverflow.com/q/24755512
tags question: http://stackoverflow.com/q/24837172
tags question: http://stackoverflow.com/q/24853621
tags question: http://stackoverflow.com/q/24763068
tags question: http://stackoverflow.com/q/24858250
tags question: http://stackoverflow.com/q/24805740
tags question: http://stackoverflow.com/q/24813690
tags question: http://stackoverflow.com/q/24802099
tags question: http://stackoverflow.com/q/24890990
tags question: http://stackoverflow.com/q/24859552
tags question: http://stackoverflow.com/q/24855186
tags question: http://stackoverflow.com/q/24828415
tags question: http://stackoverflow.com/q/24799987

http://stackoverflow.com/comment/38695171
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24906819
has text: ..in fact i've tried this solution with 2 apps that are indipendent, and yes maybe the communication could be with localstorage... but i was thinking maybe there is some solution browser dipendent; so i consider that the only "smart" solution that i can think for the moment... still searching....

http://stackoverflow.com/q/24856476
has comment: http://stackoverflow.com/comment/38600073
has comment: http://stackoverflow.com/comment/38600031
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38599984
tagged with: css
downvote count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38599922
has comment: http://stackoverflow.com/comment/38600130
has comment: http://stackoverflow.com/comment/38599939
has comment: http://stackoverflow.com/comment/38599901
has title: How to add lines to elemtents
has comment: http://stackoverflow.com/comment/38599930
type: Question
has comment: http://stackoverflow.com/comment/38599869
score: -2
has comment: http://stackoverflow.com/comment/38599860
has answer: http://stackoverflow.com/a/24856535
upvote count: 2
accepted answer: http://stackoverflow.com/a/24856535
has body: I am trying to create a tree-view or something like that.My problem is that I don't have any ideea in how to drag a line like this: this is the code I have: el1 el1.1 el1.1.1 el1.2 el2 and so on. Is it possible to do what I want with css? I am search for 4 hours and I didn't find anything. PS: i'm not good at all at css. Also, another question: is this possible with js to create a treeview? just simple js, not complicate plugins or stuff like that.
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38599906

http://stackoverflow.com/a/24782527
score: 1
answers question: http://stackoverflow.com/q/24777242
type: Answer
upvote count: 1
downvote count: 0
has body: This onClick handler works for me. onclick="setTimeout(function(){window.location.href='test.html'},100)" You can put it in your anchor tag that calls your servlet and the encapsulated anonymous function can call any other function you like. 'test.html' could be a page that says "Your file is being prepared and will download shortly. The content type of the response on the servlet should match the file type you are pushing so that the browser knows to download the file rather than try to open it.

http://stackoverflow.com/a/24886932
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24886852
has body: No it doesn't As a programmer you shouldn't think about micro-tweaks like this. Let the compiler / garbage collector handle that. Our main focus as a programmer should be 'easy to understand' code that 'does what it should'. After you have finished writing your code. You can have a lookt at performance if it is an issue. If so, test, test, test and test

http://stackoverflow.com/comment/38525228
comment on: http://stackoverflow.com/q/24817109
has text: where you want to hover and what you want to show/hide
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24894454
has body: I managed to get jQuery UI autocomplete to work. However since I use it in many input fields I wanted to make it more generic so I don't have to replicate it. So instead of the following code: $(function() { var cache = {}; $("#searchGuyInput").autocomplete({ minLength: 2, source: function(request, response) { // Getting a JSON array to populate the list var term = request.term; if (term in cache) { response(cache[ term ]); return; } $.getJSON("c_select_guy.php", {request: term}, function(data, status, xhr) { cache[ term ] = data; response(data); }); }, select: function(event, ui) { // What happens once I have selected a name from the list if (ui.item){ createInputField(ui.item.Name + " " + ui.item.Surname,ui.item.guyID); } } }) .data( "ui-autocomplete" )._renderItem = function( ul, item ) { // Here I can format the JSON array to display the rows in the list return formatted; }; function createInputField(message, guyID) { // creates a new div for the selected element }; }); I tried to use: function autocomp(inputID) { //CHANGED var cache = {}; $(inputID).autocomplete({ //CHANGED minLength: 2, source: function(request, response) { // Getting a JSON array to populate the list var term = request.term; if (term in cache) { response(cache[ term ]); return; } $.getJSON("c_select_guy.php", {request: term}, function(data, status, xhr) { cache[ term ] = data; response(data); }); }, select: function(event, ui) { // What happens once I have selected a name from the list if (ui.item){ createInputField(ui.item.Name + " " + ui.item.Surname,ui.item.guyID); } } }) .data( "ui-autocomplete" )._renderItem = function( ul, item ) { // Here I can format the JSON array to display the rows in the list return formatted; }; function createInputField(message, guyID) { // creates a new div for the selected element }; } autocomp("#searchGuyInput"); //CHANGED I highlighted the 3 changes with //CHANGED comments for you. However now even though the autocomplete returns me a nice populated list of …
has title: jQuery UI input autocomplete without anonymous function
answer count: 1
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/4340744
has answer: http://stackoverflow.com/a/24952808
has comment: http://stackoverflow.com/comment/38671674
type: Question
tagged with: autocomplete
accepted answer: http://stackoverflow.com/a/24952808
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/a/24888876
score: 5
answers question: http://stackoverflow.com/q/24888753
accepted answer of: http://stackoverflow.com/q/24888753
type: AcceptedAnswer
upvote count: 5
type: Answer
downvote count: 0
has body: Putting (someValue) after a function expression will immediately call that function. foo = function (i){ ... }(i); will give you the same result as: bar = function (i){ ... }; foo = bar(i); By having a locally scoped variable i inside that function (defined via function (i)), the value is captured (closed over) and won't change when the other i (the one in scope outside the function) changes (which it will every time you go around the loop). I'd generally use a different name for the variable inside the closure. Duplicate variable names can be confusing. nodes[i].onclick = function(closed_over_i){ return function (e){ alert(closed_over_i); }; }(i);

http://stackoverflow.com/q/24883448
tagged with: url
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/24883516
has body: Sometimes because of cache I add # in my url, like this: http://www.example.com/#lang=3201954253 What I need is to check if there is #lang in url and remove it if present.
has answer: http://stackoverflow.com/a/24883530
answer count: 4
has answer: http://stackoverflow.com/a/24883498
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24883573
has title: How to check in # in url?
type: Question

http://stackoverflow.com/comment/39229166
type: Comment
has text: Splendid! I'm glad it worked for you. I thought you got a bit harshly treated with the downvotes and the 'closed as too broad' - your question made sense to me - I do similar things fairly often (ie, build tables of contents out of my DIVs and H1 etc structures - recent example here: http://simonlikesmaps.appspot.com/#view=HelpView/tab=tab-here
comment on: http://stackoverflow.com/a/24874976
type: AnswerComment
score: 0

http://stackoverflow.com/a/53145749
has body: I came accross this while facing similar problem. Let me add my 2 lines. What I did is a similar to the Guffa's answer. But using both indexOf method and lastIndexOf. My mehod: function nonRepeated(str) { for(let i = 0; i &lt; str.length; i++) { let j = str.charAt(i) if (str.indexOf(j) == str.lastIndexOf(j)) { return j; } } return null; } nonRepeated("aabcbd"); //c Simply, indexOf() gets first occurrence of a character &amp; lastIndexOf() gets the last occurrence. So when the first occurrence is also == the last occurence, it means there's just one the character.
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/24793051
type: Answer
score: 2

http://stackoverflow.com/a/24857017
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38642231
answers question: http://stackoverflow.com/q/24856787
has comment: http://stackoverflow.com/comment/38628404
has comment: http://stackoverflow.com/comment/38646341
accepted answer of: http://stackoverflow.com/q/24856787
type: Answer
has comment: http://stackoverflow.com/comment/38602361
has comment: http://stackoverflow.com/comment/38628472
has comment: http://stackoverflow.com/comment/38602071
has body: This answer to a similar question suggests listening for an input event. Try using that along with change and keyup event. Also you should use .prop() instead of .attr() to set the disabled state of the button: $(function () { $(":text").on('keyup input change', check_submit).each(check_submit); }); function check_submit() { var $this = $(this); $(":submit").prop("disabled", function(){ return !$this.val().length; }); } Demo fiddle
has comment: http://stackoverflow.com/comment/38602615

http://stackoverflow.com/comment/38445262
has text: I got TypeError: dom.byId is not a function
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24774402

http://stackoverflow.com/comment/38539798
comment on: http://stackoverflow.com/a/24821688
type: AnswerComment
score: 0
has text: Is it possible to add one comma to the last value. Like `Chrysanthemum.jpg, Desert.jpg, Hydrangeas.jpg, Jellyfish.jpg,`
type: Comment

http://stackoverflow.com/q/24835867
tagged with: google-maps-markers
answer count: 1
has body: I've looked at similar questions and can't quite figure this out, though I think I'm close. The goal is to have a form which allows address input, and upon submit button click the address should be added as a marker on the already loaded map. I've got garbled sample code all over the place, but here is what I've been working with(refactored from a Laravel 4 view): Submit Can anyone help me step through this? I'm trying to do something more complicated, but being able to: Add markers via address submit through a form/button click. Reset the map with a reset button to clear all the overlays. Would be an awesome step forward. Thank you
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24836161
type: Question
tagged with: google-maps
has comment: http://stackoverflow.com/comment/38560483
has title: Using Google Maps to make multiple markers on address input and button click
tagged with: javascript
tagged with: jquery
tagged with: google-maps-api-3
score: 0

http://stackoverflow.com/q/24852584
has comment: http://stackoverflow.com/comment/38593740
has comment: http://stackoverflow.com/comment/38637421
has comment: http://stackoverflow.com/comment/38647222
has title: Not receiving ajax events from Devise login form on Rails 4
score: 0
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/24946755
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/24613684
tagged with: devise
has comment: http://stackoverflow.com/comment/38637527
type: Question
linked to: http://stackoverflow.com/q/24468146
linked to: http://stackoverflow.com/q/1127697
answer count: 2
has comment: http://stackoverflow.com/comment/38624340
possible better answer: http://stackoverflow.com/a/24852730
accepted answer: http://stackoverflow.com/a/24946755
tagged with: javascript
has comment: http://stackoverflow.com/comment/38598390
has body: I'm having trouble with receiving the various classes of ajax events related to the sign in form from Devise in Rails 4. Here's the standard Devise sign in form that I modified with the remote attribute to submit via ajax: &lt;%= form_for(resource, as: resource_name, url: session_path(resource_name), remote: true, format: :json) do |f| %&gt; &lt;div class="form-group"&gt; &lt;%= f.label :email%&gt;&lt;br /&gt; &lt;%= f.email_field :email, autofocus: true, class: 'form-control' %&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;%= f.label :password %&gt;&lt;br /&gt; &lt;%= f.password_field :password, autocomplete: "off", class: 'form-control' %&gt; &lt;/div&gt; &lt;% if devise_mapping.rememberable? -%&gt; &lt;div class="checkbox"&gt; &lt;%= f.check_box :remember_me %&gt; &lt;%= f.label :remember_me %&gt; &lt;/div&gt; &lt;% end -%&gt; &lt;div&gt; &lt;%= f.submit "Sign in", id: 'sign-in', class: 'btn btn-primary pull-right' %&gt; &lt;/div&gt; &lt;% end %&gt; I'm binding to the ajax events using jQuery like so: $(document).ready(function() { $('#new_user').ajaxComplete(function(event, xhr, settings) { console.log('completed'); }); }); It looks like the event gets registered, and I even re-registered it in the Chrome javascript console after the page had loaded. All appears to have been set up correctly, but when I submit the form, and get a response from the server, the event isn't fired. Any thoughts on what I've done incorrectly? UPDATE: In fact, I can't get ajax events on any rails forms with a remote: true attribute set. It doesn't seem to have anything to do with Devise. Here's some info about versions of seemingly relevant stuff: jquery-rails (3.1.1) rails (4.1.1)
tagged with: jquery
has answer: http://stackoverflow.com/a/24852730
tagged with: ajax

http://stackoverflow.com/a/24819096
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/38531409
answers question: http://stackoverflow.com/q/24818292
has body: Auto Slide HTML: 123 123 123 123 jQuery: (function () { var numDivs = $('.inline-wrapper').children().length; //Count children ELements var counter = 1; function slide(time, counter) { var $currentDiv = $('.inline-wrapper .inline-blocks:nth-child(' + counter + ')'); //get next element var position = $currentDiv.position(); //get position of next element if (numDivs > 1) { $('html,body').animate({ scrollLeft: position.left }, time / 2); //Animate to next element } }; $('.inline-blocks').on('click', function () { counter = counter + 1; slide(2000, counter); }); })(); DEMO
accepted answer of: http://stackoverflow.com/q/24818292
has comment: http://stackoverflow.com/comment/38532322
has comment: http://stackoverflow.com/comment/38532821
has comment: http://stackoverflow.com/comment/38531351
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38531283
type: Answer
has comment: http://stackoverflow.com/comment/38537484

http://stackoverflow.com/comment/62284598
comment on: http://stackoverflow.com/a/24877226
type: Comment
has text: I dont think this is a good answer as it will only be triggered on updates from the input control and not from code
score: 0
type: AnswerComment

http://stackoverflow.com/a/24852769
upvote count: 1
answers question: http://stackoverflow.com/q/24852728
has comment: http://stackoverflow.com/comment/38592352
has comment: http://stackoverflow.com/comment/38592396
downvote count: 0
has comment: http://stackoverflow.com/comment/38592256
type: Answer
has comment: http://stackoverflow.com/comment/38592186
has body: Just select by class names. Array.prototype.forEach.call(document.querySelectorAll(".one"), function(el) { el.classList.add("whateverClass"); }); Instead of a for loop, this uses the prototype method forEach with the call method to turn the NodeList into an array list, adding the class to each element with the class "one" DEMO
score: 1

http://stackoverflow.com/q/24897963
favorite count: 0
tagged with: actionscript-3
has comment: http://stackoverflow.com/comment/38708851
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/38707903
score: 1
upvote count: 1
type: Question
has title: Syncing javascript with AS3 netstream
has body: We are trying to get super accurate timings in an flv video in relation to javascript. For example, we are using javascript to display an element in a canvas on the screen, and we need to pinpoint the exact frame that the image occurs in on the netstream/flv. We are publishing the netstream to a wowza media server, and doing no transcoding. Theoretically (at least in my limited knowledge), using ns.send to send a message down the line to Wowza is appending into the same flv file and I can see it there. However, we are seeing that the inserted message is ~100ms off of when we actually sent it. Does anyone have any experience in doing something like this? A potential solution would be to append an all black frame into the actual video frame, but I can't seem to find any information on how to manipulate a netstream during publish.
tagged with: javascript
tagged with: wowza
tagged with: flv
downvote count: 0
has comment: http://stackoverflow.com/comment/38681345
tagged with: netstream
has comment: http://stackoverflow.com/comment/38681670

http://stackoverflow.com/q/24825248
answer count: 2
tagged with: jquery
has body: Following is the structure of my layout. The code for it is posted in the end of this question. What I want is that The wrapper div entire-page height should not exceed the height of the browser window without the scroll bar. I do not want a scroll-bar in the parent window. The left-div and right-div height should be equal to the height of their parent div. Their parent div should fit the height of its parent div and so on, until the effect to be seen is that the left-div and the right-div have spanned all the space available to them "heightwise" The left-div and the right-div should be such that if their contents increase their height, a scroll-bar should show, but if the contents are smaller than their height, it should not show any trace of scroll-bar. I have searched about it a lot and tried various things but nothing helped me get the exact desired effect. So how can I go about it? PROBLEMATIC LAYOUT : WHAT I WANT : CODE : I am the information bar... A , concluded that city dwellers are on average more generous than residents of rural areas.A survey of charitable giving in the state found that the average dollarnt contributed by residents of rural areas. The survey’s creators, an urban-promotion group known as Live in the City, concluded that city dwellers are on average more generous than residents of rural areas. by residents of rural areas. The survey’s creators, an urban-promotion group known as Live in the City, concluded that city dwellers are on average more generous thidents of urban areas to programs for the homeless was $15 greater than the amount contributed by residents of rural areas. The survey’s creators, an urban-promotion group known as Live in the City, concluded that city dwellers are on average more generous than residents of rural areas. The header and footer will be included from an external file. EDIT:- This is strange. Following is the result of writing an html file and compiling it from netbeans. While in jsfiddle (http://jsfiddle.net/U…
has title: How to expand the height of child div's to fit parent div, in a hierarchy?
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/38540219
has comment: http://stackoverflow.com/comment/38540433
type: Question
has answer: http://stackoverflow.com/a/24825523
has answer: http://stackoverflow.com/a/24825400
tagged with: javascript
score: 0

http://stackoverflow.com/comment/38404758
score: 0
type: Comment
has text: OK. One word: **AWESOME**. Thanks a lot, my friend! :-)
comment on: http://stackoverflow.com/a/24753068
type: AnswerComment

http://stackoverflow.com/a/64508534
answers question: http://stackoverflow.com/q/24785713
type: Answer
has body: When creating the chart object you need to save the instance in a variable. var currentChart = new Chart(ctx, ...); And before loading new data, you need to destroy it: currentChart.destroy();
score: 0

http://stackoverflow.com/comment/38582850
comment on: http://stackoverflow.com/q/24847846
score: 0
type: Comment
type: QuestionComment
has text: Please upload some html for reference

http://stackoverflow.com/q/24757767
has answer: http://stackoverflow.com/a/24758345
has title: How to set a value in a drop-down list
has body: I'm facing a problem with setting a value in a drop-down list. The following is the code for my drop-down: Here is the object: [Object, Object] 0: Object id: "GBP" name: "GBP" symbol: "GBP" __proto__: Object 1: Object id: "dollar" name: "Dollar" symbol: "$" __proto__: Object length: 2 __proto__: Array[0] It's setting 0, 1, 2 as the value instead of id. I've looked at other questions but haven't been able to make any of the solutions work. What am I doing wrong?
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/24758829
has answer: http://stackoverflow.com/a/24759746
tagged with: angularjs
answer count: 5
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24757953
has answer: http://stackoverflow.com/a/24757920

http://stackoverflow.com/q/24903189
tagged with: ajax
has answer: http://stackoverflow.com/a/24903208
has title: Javascript: use string as object key
favorite count: 0
linked to: http://stackoverflow.com/q/11508463
has comment: http://stackoverflow.com/comment/38688092
tagged with: angularjs
type: UnansweredQuestion
downvote count: 2
score: 1
upvote count: 3
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38688014
type: Question
duplicate of: http://stackoverflow.com/q/11508463
has body: If I have: var myKey = "This_is_my_key" var myObj = {"This_is_my_key" : true} How do I access myObj at myKey?
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/24800324
tagged with: google-maps
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: google-maps-api-3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24800585
score: 0
type: UnansweredQuestion
type: Question
has body: I am implementing Google maps collaborator, where other users view port is represented as rectangle. If any of the users view port changes, the rectangle position gets updated. Now i want to implement if the users view port is not on my view port, I need to create a head(black circle) representing users current view port direction. I currently have the Bounds(LatLng) position of the other users view port. In order to draw the heads, I need to calculate the angle of the current users position. You can refer the below image to get what i am trying to say. If the users view port is inside my view port, I can draw a head on the rectangle. But if the users view port changes, I need to calculate the distance and angle to the draw the head(black circle) relative to the users view port. Can you suggest me some ideas to get it done. If you have already done something related to this, Please share your ideas.
has title: To calculate the relative positioning of other users view port in Google maps
has comment: http://stackoverflow.com/comment/38493765

http://stackoverflow.com/comment/38511898
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24803276
has text: What does your response look like, What's the error-message you get in console? see my jsFiddle (I've edited my answer). Is your response.images undefined? Maybe "http://" is already contained in your responses URLs?

http://stackoverflow.com/comment/38509795
comment on: http://stackoverflow.com/a/24807168
has text: \r\n seems to be the problem. I change the format of .txt file to *://*.domain1.com/*;*://*.domain2.com/*;*://*.domain3.com/* and list = xhr.responseText.split(";"); and it works, Thank you a lot.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38503519
has text: 1. Extend your createButton-function: function createButton(n,adi) {} 2. Extend your php-echo: createButton(<?php echo($i).",".echo($adi); ?>); Not very familiar with php, maybe you need to reference $adi correctly
type: AnswerComment
comment on: http://stackoverflow.com/a/24805550
score: 0
type: Comment

universal-analytics
tag name: universal-analytics
type: Tag
tags question: http://stackoverflow.com/q/24894455

http://stackoverflow.com/q/24813530
upvote count: 1
has answer: http://stackoverflow.com/a/24813595
has comment: http://stackoverflow.com/comment/38521285
linked to: http://stackoverflow.com/q/3569104
type: Question
has body: How can I make a regex that would extract the the contents of the first square brackets in the following? Block[first_name][value] returns the string first_name. Block[last_name][value] returns the string last_name. What I've tried: This was my current regex: http://regex101.com/r/jW0hY1/1 /(?:Block\[).*(?:\[value])/ I figured first I'd have a non-capturing match for Block[. Then I would capture all the content until ][value] began. Instead this seems to return the entire string.
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38518575
has title: Regex to match contents of a string preceded by particular string and ended with a particular string
answer count: 3
accepted answer: http://stackoverflow.com/a/24813595
favorite count: 0
has comment: http://stackoverflow.com/comment/38518519
possible better answer: http://stackoverflow.com/a/24813597
has answer: http://stackoverflow.com/a/24813597
tagged with: regex
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38518545
score: 1
has answer: http://stackoverflow.com/a/24813654

http://stackoverflow.com/a/24828335
score: 0
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/24827864
has body: To use such a value like an array in more than one controller, you can use a simple value service or if it is a constant use the constant service. For example you can do: angular.module('myApp').value('myArray', ['one', 'two']); or if a constant: angular.module('myApp').constant('myArray', ['one', 'two']); which you can use as a dependency in other controllers or services like app.controller('MyController', function($scope, myArray) {});
accepted answer of: http://stackoverflow.com/q/24827864
has comment: http://stackoverflow.com/comment/38548455

http://stackoverflow.com/a/24807373
accepted answer of: http://stackoverflow.com/q/24807324
upvote count: 5
downvote count: 0
answers question: http://stackoverflow.com/q/24807324
type: AcceptedAnswer
score: 5
type: Answer
has comment: http://stackoverflow.com/comment/38512358
has body: dt = dt_read.value will be a string, assuming it's coming from a form element. Use: dt = parseFloat(dt_read.value)

http://stackoverflow.com/comment/38468559
score: 3
comment on: http://stackoverflow.com/q/24787075
type: QuestionComment
type: Comment
has text: Add your HTML markup... or make a JSfiddle and reduce this code to where you think error is...

http://stackoverflow.com/q/24887824
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38715904
tagged with: github
answer count: 0
type: UnansweredQuestion
has title: Github gh-pages file path error
has body: I'm new to using github and I've set up a demo page for my repo using gh-pages. It seems to work except one of my files references one of the other files and its subsequently looking for the wrong path. My file structure is index.html /dist/easyPrint.css /dist/easyPrint.js The easyPrint.js file references easyPrint.css . The current code works fine when I work locally (eg it looks for the css file in the dist folder and finds it). But when I view it on GH it looks for the css file in the root folder and fails... Any tips as to what I've done wrong? Thanks, Rowan PS the repo can be seen at https://github.com/rowanwins/leaflet-easyPrint , the error can be seen on the demo page (it wont find the css file)
type: Question
has comment: http://stackoverflow.com/comment/38704148
has comment: http://stackoverflow.com/comment/38659701
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38728289

http://stackoverflow.com/q/24907501
tagged with: javascript
score: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/52385399
answer count: 0
type: UnansweredQuestion
type: Question
tagged with: safari
has title: Play gif on visibility
tagged with: http://stackoverflow.com/tag/gif
upvote count: 4
has body: I have a gif on my page, initially is hidden with opacity : 0 and visibility : hidden (I can't use display:none here for others reasons). &lt;img src="xxx.gif" style="opacity: 1; visibility: visible;"&gt; I display gif on click $("#image").click(function(){$("#imageZ").css({"opacity":"1", "visibility":"visible"});});' This code works. It display images. But I've a strange problem with no-repeat gif. On Chrome, it's ok, when gif display, it launch and I see what I want. On Safari it doesn't work, I see anything. I think gif is already read and don't relaunch when visibility : visible. It worked when I used display:block instead of visibility:visible. Visibility add it on DOM and works on Chrome so I don't understand why it doesn't works on Safari. Do you know this problem and have you an idea to patch it ? Thanks.
downvote count: 0

http://stackoverflow.com/comment/38564780
type: Comment
has text: hello.. can you tell me how i have to make this condition.. Basically if the label ( text) of the radio option has (0) then i want to hide it... Hope you could help me here.. thankx
comment on: http://stackoverflow.com/a/24838364
score: 0
type: AnswerComment

http://stackoverflow.com/q/24873647
has title: String concatenation bad order with DOM variable
has body: The context is the following: I am coding a webpage geolocalising people from an association and display their positions on a google map within a wordpress framework. When I click on their marker I display an info window with their info. On the map, I can filter/search the people with a form (for example look only at the people named Paul). So far all this working. My problem is the following: When I do a search I would like to display the results underneath the map. As I can have quite a few results (let's say typically around 100) , I'ld like to display them with some pagination. I manage to use the paginator when I hardcode some dummy text. Nevertheless I can't manage to paginate the results of the searches. If I do Paul John Richard George This is working but if I try to dynamically write the html of "content" reading the attribute name of my markers like this: var pag_res = ""; document.getElementById('content').innerHTML = ""; for (mark_cnt = 0; mark_cnt < markers.length; mark_cnt++){ pag_res += " " + markers[mark_cnt].desc + " "; } document.getElementById('content').innerHTML = pag_res; This is not working and if I look into at document.getElementById('content').innerHTML in the console the description of the marker is written after the closure of the tbody. I have something like: Paul John Anyone would have any idea where the issue stems from??
score: 0
tagged with: concatenation
tagged with: google-maps
answer count: 1
accepted answer: http://stackoverflow.com/a/24874535
tagged with: string
type: AnsweredQuestion
tagged with: dom
has answer: http://stackoverflow.com/a/24874535
type: Question
tagged with: javascript

http://stackoverflow.com/comment/38621160
type: AnswerComment
comment on: http://stackoverflow.com/a/24867253
score: 0
type: Comment
has text: That's true. As long as the original code he posted isn't altered beyond one of our two solutions, OP won't have to worry about setting it, though. An example of this code with the steps defined next to the tickPixelInterval member (with the added bonus of only having to be set once for all graphs) can be seen at http://jsfiddle.net/W6mRh/1/

http://stackoverflow.com/q/24756903
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24757318
favorite count: 0
tagged with: promise
has title: Bluebird.js custom Error catch function, does not apply on the first promise?
score: 6
tagged with: error-handling
upvote count: 6
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42965045
tagged with: bluebird
has answer: http://stackoverflow.com/a/24757318
has body: I'm trying to use the custom error handlers of Bluebird.js. In the example bellow the catch-all handler is called, not the MyCustomError handler, but when I moved the rejection into the then function (and resolved the firstPromise...), the MyCustomError handler is called. Why is that? got something wrong? Thanks. var Promise = require('bluebird'), debug = require('debug')('main'); firstPromise() .then(function (value) { debug(value); }) .catch(MyCustomError, function (err) { debug('from MyCustomError catch: ' + err.message); }) .catch(function (err) { debug('From catch all: ' + err.message); }); /* * Promise returning function. * */ function firstPromise() { return new Promise(function (resolve, reject) { reject(new MyCustomError('error from firstPromise')); }); } /* * Custom Error * */ function MyCustomError(message) { this.message = message; this.name = "MyCustomError"; Error.captureStackTrace(this, MyCustomError); } MyCustomError.prototype = Object.create(Error.prototype); MyCustomError.prototype.constructor = MyCustomError;

http://stackoverflow.com/comment/38476331
has text: Firefox and IE have returned floating point values for getBBox for as long as they've supported SVG.
score: 0
comment on: http://stackoverflow.com/q/24787085
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38554159
score: 0
comment on: http://stackoverflow.com/q/24831630
type: Comment
type: QuestionComment
has text: So basically you don't want to validate the range, right? Why are you using the `min` and `max` attributes, then?

http://stackoverflow.com/q/24775114
has comment: http://stackoverflow.com/comment/38445911
favorite count: 0
has body: We have an SVG graph whith nodes defined as following: <g id="node37" class="node"> sac <polygon fill="none" stroke="black" points="692.5,-952 692.5,-1004 765.5,-1004 765.5,-952 692.5,-952"/> sac <polyline fill="none" stroke="black" points="692.5,-978 765.5,-978 "/> sacsip.o </g> I would want to be able to add onclick element that knows what text that element that was clicked has, i.e. "saccsip.o". We have tried something like but it will only return the element, not the text itself. If the element were HTML we could have retrieved the information, but with SVG we have not succeded. Is it possible? Is there any other way?
accepted answer: http://stackoverflow.com/a/24775204
answer count: 3
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/24775183
has answer: http://stackoverflow.com/a/24775183
tagged with: dot
tagged with: http://stackoverflow.com/tag/svg
has title: Retrieving information from SVG object
downvote count: 0
has answer: http://stackoverflow.com/a/24775204
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38446292
has answer: http://stackoverflow.com/a/24775309
score: 1
type: Question
has comment: http://stackoverflow.com/comment/38446794
upvote count: 1
tagged with: javascript

http://stackoverflow.com/comment/38684475
has text: no error. i din't change button type to button because it will not go to controller. you said add preventdefault OR change type to button. right?
type: AnswerComment
comment on: http://stackoverflow.com/a/24901035
score: 0
type: Comment

http://stackoverflow.com/q/24822379
tagged with: javascript
favorite count: 0
has title: Social Interaction with google analytics
tagged with: facebook
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24932111
upvote count: 1
tagged with: php
downvote count: 1
accepted answer: http://stackoverflow.com/a/24932111
type: Question
tagged with: google-analytics
tagged with: twitter
has body: I found this code for Facebook interaction using GA which creates its own button: <fb:like></fb:like> Rather than creating its own button, I want to use social interaction with GA for my custom Facebook link. How can I do this.? Also can I use the same thing for twitter ? Twitter link :
score: 0
possible better answer: http://stackoverflow.com/a/24830028
answer count: 2
has answer: http://stackoverflow.com/a/24830028

http://stackoverflow.com/q/24849491
has comment: http://stackoverflow.com/comment/38585930
has body: I am trying to do this: $('form#jatak a.BigYellowtwo').click(function() { $('#undertekst').fadeOut('slow'); }); on this: please be aware that #undertekst is visible at this moment I try to click on BigYellowtwo. Jeg er skarp! Ved at tykke JA TAK, vil du modtage en mail med mere information. I have no idea why its not working, i have tried several things, but with no output at all. And it seems like my experience stops me here....
type: Question
has comment: http://stackoverflow.com/comment/38585967
upvote count: 0
score: -2
tagged with: javascript
tagged with: jquery
has title: Javascript doesnt react
has comment: http://stackoverflow.com/comment/38585951
answer count: 3
has answer: http://stackoverflow.com/a/24849543
has answer: http://stackoverflow.com/a/24849544
has comment: http://stackoverflow.com/comment/38585929
favorite count: 0
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/38585910
has answer: http://stackoverflow.com/a/24849569
has comment: http://stackoverflow.com/comment/38585993

http://stackoverflow.com/q/24866509
tagged with: javascript
has title: My html code isn't calling the javascript function
has comment: http://stackoverflow.com/comment/38618847
score: 0
has comment: http://stackoverflow.com/comment/38618732
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/38618822
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38618781
type: Question
has body: I'm using a submit button for a form and the javascript should tell me if any field is empty.. But despite using the onclick attribute , nothing's happening.. There's ablock of PHP code which refuses to store the data. I'm a beginner to PHP and Javascript so any ideas? &lt;script language="javascript"&gt; function valid() { var a=document.form2.i1.value; var b=document.form2.pas.value; var c=document.form2.pas1.value; var d=document.form2.n1.value; var e=document.form2.a1.value; var f=document.form2.r1.value; var g=document.form2.pin1.value; var h=document.form2.phno1.value; var i=document.form2.u1.value; var j=document.form2.email1.value; if(a!="y") { alert("Please accept the terms and conditions before registering."); return false; } else if(d=="") { alert("Name required."); return false; } else if(e=="") { alert("Age required."); return false; } else if(e&lt;18) { alert("You have to be atleast 18 to register."); return false; } else if(f="") { alert("Gender required."); return false; } else if(g=="" || isNan(g)) { alert("Valid pincode required."); return false; } else if(h==""|| isNan(h)) { alert("Valid phone number required."); return false; } else if(i=="") { alert("Username required."); return false; } else if(j=="") { alert("Email required."); return false; } else if(b=="" || c=="") { alert("Password required."); return false; } else if(b!=c) { alert("Please make sure the passwords are identical."); return false; } return true; } &lt;/script&gt; This is the statement I used to call it: &lt;div id="apDiv3"&gt;&lt;input name="reg1" type="submit" id="login-submit" value="Register" onclick="return valid()"/&gt;&lt;/div&gt; This is the PHP code I used to create the form: &lt;?php if(isset($_POST['reg1'])) { $name=$_POST['n1']; $age=$_POST['a1']; $gen=$_POST['r1']; $phno=$_POST['phno1']; $email=$_POST['email1']; $pin=$_POST['pin1']; $user=$_POST['u1']; $pas=$_POST['pass']; $pas1=$_POST['pass1']; $i=$_POST['i1']; $connection=mysqli_connect("localhost","root",""); if…
has comment: http://stackoverflow.com/comment/38618910
has comment: http://stackoverflow.com/comment/38618730
has answer: http://stackoverflow.com/a/24868155
accepted answer: http://stackoverflow.com/a/24868155

http://stackoverflow.com/comment/38457553
type: QuestionComment
has text: Explain as what you tried till.. if possible pls post fiddle
comment on: http://stackoverflow.com/q/24781442
score: 0
type: Comment

http://stackoverflow.com/q/24875875
tagged with: dropbox
has answer: http://stackoverflow.com/a/24877495
downvote count: 0
linked to: http://stackoverflow.com/q/20601104
tagged with: javascript
answer count: 1
favorite count: 0
has title: How can I get the content details of a revised text file using Dropbox Core API?
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/17923609
upvote count: 1
tagged with: diff
score: 1
has body: I need my node.js app to fetch the net revised portion of a single text file, using dropbox-js library. I think I searched the Core API documentation quite thoroughly but I couldn't find the reference I wanted and already checked the following posts. How to get the revision of an item with Dropbox API How can I store the files in my server after picking the files from dropbox with the dropbox Chooser What I am expecting is the actual text content difference between the current revision and the one previously made. I guess I could just listen for changes using the /longpoll_delta endpoint and manually check for differences using readFile, but I would like to know if there's a much simpler way to achieve this. Update: I just realized I can harness the rev or versionTag param when using readFile however it's still fetching the whole text file not the revised content. Here's my code: module.exports.getFile = (callback) -&gt; options = {} options.rev = '1942a704479aca' client.readFile 'todo.txt', options, (err, data) -&gt; if err throw err callback data
tagged with: coffeescript
type: Question
tagged with: api

http://stackoverflow.com/q/24756399
has body: I need to hide the fragment identifiers from the url after clicking of div at same page. This is my js code: $(document).ready(function(){ $('a[href^="#"]').on('click',function (e) { e.preventDefault(); var target = this.hash, $target = $(target); alert(target); $('html, body').stop().animate({ 'scrollTop': $target.offset().top }, 900, 'swing', function () { window.location.hash = target; }); }); }); the url is something like this http://www.example.com#about but i want to be like this http://www.example.com I tried of changing the $target.offset and also return false; at the end of click function but they did not work.
has comment: http://stackoverflow.com/comment/38410778
has comment: http://stackoverflow.com/comment/38410315
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24756657
type: Question
has comment: http://stackoverflow.com/comment/38410283
tagged with: javascript
score: 0
has title: Hide fragment identifiers from the url
accepted answer: http://stackoverflow.com/a/24756657
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/38410595
has comment: http://stackoverflow.com/comment/38410356

http://stackoverflow.com/comment/38678233
type: Comment
has text: There is no such concept in JavaScript or with DOM elements in browsers. You can create an element and with your own code copy property values into it.
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/24897940

http://stackoverflow.com/comment/38501602
comment on: http://stackoverflow.com/q/24804722
score: 0
type: Comment
type: QuestionComment
has text: why are you having 2 Divs with the same ID? the ID is suppose to be unique. ALSO: when you create a new tag, do you apply a new instace of `mediaelementplayer` ? It seems that you might be having issues with the it because the selectors are wrong? Change them to classes maybe?

http://stackoverflow.com/a/24849248
type: Answer
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/24805874
has comment: http://stackoverflow.com/comment/38585646
has comment: http://stackoverflow.com/comment/38595101
score: 0
has comment: http://stackoverflow.com/comment/38585920
has body: You can try this way: HTML Part: &lt;input type="file" name="file" onchange="angular.element(this).scope().uploadFile(this.files)"/&gt; Angular part: $scope.uploadFile = function(files) { var fd = new FormData(); fd.append("file", files[0]); $http.post(uploadUrl, fd, { withCredentials: true, headers: {'Content-Type': undefined }, transformRequest: angular.identity }).success( /*COOOOOOLLL*/ ).error( /*Use the force Luke!*/ ); }; OR if you want to add some progress bar you can try this with multiple file upload: &lt;div ng-controller="FileUploadCtrl"&gt; &lt;input type="file" ng-file-select="onFileSelect($files)" multiple&gt; &lt;/div&gt; angular.module('myApp', ['angularFileUpload']); var FileUploadCtrl = [ '$scope', '$upload', function($scope, $upload) { $scope.onFileSelect = function($files) { for (var i = 0; i &lt; $files.length; i++) { var file = $files[i]; $scope.upload = $upload.upload({ url: 'server/upload/url', data: {uploadObject: $scope.myModelObj}, file: file, }).progress(function(evt) { console.log('percent: ' + parseInt(100.0 * evt.loaded / evt.total)); }).success(function(data, status, headers, config) { console.log(data); }); } }; }];
has comment: http://stackoverflow.com/comment/38841414

http://stackoverflow.com/comment/38565132
type: AnswerComment
score: 0
type: Comment
has text: Oh I just realized how dumb I was, lol. But if I had noticed, I wouldn't have known to use function in settimeout, so I guess there's good in bad after all x)
comment on: http://stackoverflow.com/a/24838023

http://stackoverflow.com/a/24863546
downvote count: 0
score: 1
has body: If you just want to match the strings, for instance rgba(255,0,0,0.4), without parsing the values, just use: arrayOfMatches = yourString.match(/rgba\([^)]+\)/g);
type: Answer
answers question: http://stackoverflow.com/q/24863223
upvote count: 1

http://stackoverflow.com/comment/38502129
has text: @user3421202 not getting any fiddle.
type: Comment
comment on: http://stackoverflow.com/a/24803800
score: 0
type: AnswerComment

http://stackoverflow.com/q/24768166
has title: How to yield twice to different functions in JavaScript?
type: Question
tagged with: ecmascript-6
tagged with: ecmascript-harmony
upvote count: 1
tagged with: javascript
has body: So my code is of the "let's use Generators to avoid Callback Hell" variety. I'm trying to have an accessor function wrap a generator that handles opening IndexedDB. I need to have the generator yield to the "callback", and then yield to the accessor function so the accessor function can return the created object which originated in the generator. Maybe this is a brainfart, but I'm kinda lost as to how to do this without polling on a boolean (such as idb_ready = false; and wait for idb_ready to be true before starting the while(gen.next()) business). Code: accessor = function() { var gen = function* () { var ret = {}; var request = indexedDB.open("blah", 1, "description"); request.onupgradeneeded = resume; var event = yield; ret.db_instance = event.target.result; yield ret; }; function resume(val) { gen.next(val); } gen.next(); // start the generator // HERE is where I need to wait for the second yield } Is there a way to do this without polling? Thanks!
has comment: http://stackoverflow.com/comment/39713583
favorite count: 0
tagged with: generator
answer count: 0
linked to: http://stackoverflow.com/q/23551418
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38433403
downvote count: 0
score: 1
tagged with: indexeddb

http://stackoverflow.com/q/24899282
has answer: http://stackoverflow.com/a/25604987
has comment: http://stackoverflow.com/comment/38681366
has comment: http://stackoverflow.com/comment/38681260
linked to: http://stackoverflow.com/q/18385842
answer count: 2
has body: Hi I have a pretty complex app that I have been writing Karma unit tests for. I have a lot of tests that were written and running sucessfully but then I changed a few things in the app and now I am getting tons of errors. Been staring at it for hours and can't figure it out. Error I get: TypeError: 'undefined' is not a function (evaluating 'angular.element(window).width()') at /Users/Desktop/app/scripts/app.js:9 at invoke (/Users/Desktop/app/bower_components/angular/angular.js:3869) at /Users/Desktop/app/bower_components/angular/angular.js:3715 My config file looks like this // Karma configuration // http://karma-runner.github.io/0.10/config/configuration-file.html module.exports = function(config) { config.set({ // base path, that will be used to resolve files and exclude basePath: '', // testing framework to use (jasmine/mocha/qunit/...) frameworks: ['jasmine'], // list of files / patterns to load in the browser files: [ 'app/bower_components/angular/angular.js', 'app/bower_components/angular-mocks/angular-mocks.js', 'app/bower_components/angular-resource/angular-resource.js', 'app/bower_components/angular-cookies/angular-cookies.js', 'app/bower_components/angular-sanitize/angular-sanitize.js', 'app/bower_components/angular-route/angular-route.js', 'app/bower_components/angular-bootstrap/*.js', 'app/bower_components/angular-ui-date/src/date.js', 'app/bower_components/angular-ui-sortable/*.js', 'app/bower_components/angular-ui-router/src/*.js', 'app/bower_components/d3/*.js', 'app/bower_components/nvd3/*.js', 'app/bower_components/angularjs-nvd3-directives/src/directives/*.js', 'app/bower_components/jquery/dist/*.js', 'app/bower_components/ng-grid/*.js', 'app/bower_components/ng-grid/build/*.js', 'app/bower_components/ng-grid/plugins/*.js', 'app/scripts/app.js', 'app/bower_components/angular', 'app/scripts/*.js', 'app/scripts/**/*.js', 'app/scripts/***/**/*.js', 'test/client/spec/**/*.js' ], // list of files / patterns to exclude exclude: [ 'app/bower_components/*/…
has title: TypeError: 'undefined' is not a function (evaluating 'angular.element(window).width()')
tagged with: javascript
has comment: http://stackoverflow.com/comment/38710670
has comment: http://stackoverflow.com/comment/38681164
tagged with: karma-jasmine
score: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/25051384
has comment: http://stackoverflow.com/comment/38685698
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38680900
tagged with: unit-testing
type: Question

http://stackoverflow.com/a/24869846
score: 1
has body: Presuming your project folder is (for example): C:\Projects\ You needed to move jQuery &amp; jQuery UI into it. So your folder/file structure should have: c:\Projects\ js\ jquery-xxxx.js jquery-ui-xxxxx.js css\ jquery-ui-xxxx.css images\ ((all images for jQuery UI here)) Basically, your jquery UI css is going to have a heap of css lines like this: background: #a6a6a6 url(images/ui-bg_dots-small_65_a6a6a6_2x2.png) 50% 50% repeat; This means that wherever you have saved your jqUI css file, should also have an "images" folder which contains the images for the JQUI css!
upvote count: 1
answers question: http://stackoverflow.com/q/24869688
type: Answer
downvote count: 0

http://stackoverflow.com/q/24895383
tagged with: parse-platform
has comment: http://stackoverflow.com/comment/38677251
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38673644
has answer: http://stackoverflow.com/a/24902319
type: Question
has body: I'm trying to follow Parse's documentation/examples for running a query within a background job. What I want to do is query through all Users in the database, and run a query on matchCenterItems associated with each User. When I run this job, it logs status.success, however it doesn't go past console.log('about to start the matchCenterItem query');. query.find().then(function(results) never runs, giving me the impression that I'm either structuring the matchCenterItem query incorrectly, or not querying through each User the proper way. I've only posted the relevant code snippet in order to keep things concise, but I'll gladly post the entire code of the background job if needed. Parse.Cloud.job("MatchCenterBackground", function(request, status) { //Parse.Cloud.useMasterKey(); console.log('background task started'); //defines which parse class to iterate through //Query through all users var usersQuery = new Parse.Query(Parse.User); //For every user, do the following: usersQuery.each(function(user) { //query through all their matchCenterItems var matchCenterItem = Parse.Object.extend("matchCenterItem"); var query = new Parse.Query(matchCenterItem); // promise and searchterm arrays to be filled var promises = []; var searchTerms = []; //setting the limit of items at 10 for now query.limit(10); console.log('about to start the matchCenterItem query'); query.find().then(function(results) { console.log('matchCenterItem query results:' + results); if (results.length &gt; 0){ //code cut off here
answer count: 1
tagged with: javascript
has title: Parse background job not correctly querying all Users
score: 0
accepted answer: http://stackoverflow.com/a/24902319
has comment: http://stackoverflow.com/comment/38676017

http://stackoverflow.com/comment/38538789
type: Comment
has text: Well, what can I say. You are trying to majke user execute a program in his PC. I think it is triggering some security lock.
type: QuestionComment
comment on: http://stackoverflow.com/q/24804451
score: 0

http://stackoverflow.com/comment/38639713
has text: What about `onClick` for the "download" link itself?
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/24877377

http://stackoverflow.com/comment/38470741
type: Comment
has text: @Ashok your draggable is connected to a sortable that is a draggable too. You were calling droppable twice because of this. Now in your receive function you are managing drag event too.
type: AnswerComment
comment on: http://stackoverflow.com/a/24762551
score: 0

vote
type: Tag
tag name: vote
tags question: http://stackoverflow.com/q/24816324

http://stackoverflow.com/comment/38481300
type: Comment
comment on: http://stackoverflow.com/a/24793404
has text: For instance look at the output of this [JavaScript demo](http://js.do/code/40985).
score: 0
type: AnswerComment

http://stackoverflow.com/q/24902280
score: 1
has answer: http://stackoverflow.com/a/29837782
favorite count: 0
tagged with: kendo-ui
type: Question
tagged with: razor
tagged with: kendo-asp.net-mvc
has title: Can't select data of Kendo Multiselect using Tab key press
has body: I am able to select Data listed into Kendo Multiselect by pressing 'Enter' button or by selecting it using 'Mouse click'. But can't select it by pressing 'TAB' key
upvote count: 1
answer count: 1
tagged with: asp.net-mvc
tagged with: javascript
type: UnansweredQuestion
downvote count: 0

http://stackoverflow.com/comment/63362806
has text: alternatively, setting draggable: true also works, but then your marker is draggable
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24849675

http://stackoverflow.com/comment/38519406
comment on: http://stackoverflow.com/q/24813782
has text: I mean you'd call your `getSize()` and pass it the image. `getSize(image)`.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24854295
downvote count: 0
type: Answer
upvote count: 3
has body: Just because you click on a div, it doesn't mean it gets keyboard focus. And if it doesn't get keyboard focus (as it is not editable), it can't lose it and thus can't blur. An alternative approach could be the following: Upon clicking on any .cell element, remove the selected class from every element that has it and then add it to the clicked element. E.g.: .directive('cell', function cellDirective($window) { return { restrict: 'C', link: function cellPostLink(scope, elem, attrs) { elem.on('click', onClick); scope.$on('$destroy', onDestroy); function onClick() { Array.prototype.forEach.call( $window.document.querySelectorAll('.selected'), function (el) { angular.element(el).removeClass('selected'); }); elem.addClass('selected'); } function onDestroy() { elem.off('click', onClick); }); } }; }); See, also, this short demo. NOTES: Depending on the browsers you are supporting and on whether you are using jQuery or not the code above might need modifications. An alternative approach would be to register a click-listener on the document and remove the selected class from any element if the clicked element was a .cell. In that case, you need to take care to only register the listener once and not for every instance of .cell. It is a good practise to always clean-up your listeners upon scope's destruction, in order to prevent memory leaks. You can use scope.$on('$destroy', callback) to remove any event listeners registered on elements.
score: 3
answers question: http://stackoverflow.com/q/24854032
accepted answer of: http://stackoverflow.com/q/24854032
has comment: http://stackoverflow.com/comment/38595501
type: AcceptedAnswer

http://stackoverflow.com/a/24782018
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24781888
has body: Should try this method : var myarray=["t14", "t53", "t1"] myarray.sort(); myarray.reverse(); var final = myarray.slice(0,10); //SHOULD GIVE YOU // ["t53", "t14", "t1"] Then you can extract the ten first value. UPDATE --> JSFiddle
upvote count: 1
score: 1

http://stackoverflow.com/q/24749638
score: 1
type: Question
tagged with: javascript
tagged with: jquery
has body: I am using two flexsliders on same page but in different events. Both flexsliders works fine. But second slider has some jerk for first time when the click event triggers. $('#slider').flexslider({ animation: "slide", easing: "swing", direction: "horizontal", controlNav: true, asNavFor: '#slider2', directionNav: true }); $('.HowItWorks').click(function(){ $('#slider2').flexslider({ animation: "slide", easing: "swing", direction: "horizontal", controlNav: true, directionNav: true , sync: "#slider" }); })
has comment: http://stackoverflow.com/comment/38401155
has comment: http://stackoverflow.com/comment/38401140
tagged with: flexslider
has comment: http://stackoverflow.com/comment/38399873
downvote count: 0
has comment: http://stackoverflow.com/comment/38398764
has title: How to use multiple flexslider in different events
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/38399908
answer count: 0

http://stackoverflow.com/a/24877834
score: 0
answers question: http://stackoverflow.com/q/24874465
has comment: http://stackoverflow.com/comment/38663557
type: Answer
upvote count: 1
has body: Your Javascript hides the other popovers just fine... but you forgot to open the new one! var options = { selector: '[data-toggle=popover]' }; $(".container").popover(options); $("[data-toggle=popover]").click(function() { $("[data-toggle=popover]").not(this).popover('hide'); $("[data-toggle=popover]").this.popover('show'); }); Disclosure: I actually don't know what I'm doing, but when I checked the Bootstrap documentation and ran this in Bootply it appears to create the behavior you are looking for. Bootply
downvote count: 1
has comment: http://stackoverflow.com/comment/38641465

http://stackoverflow.com/q/24812010
has comment: http://stackoverflow.com/comment/38516139
has title: CSS menu formatting issue
has answer: http://stackoverflow.com/a/24812197
tagged with: css
has comment: http://stackoverflow.com/comment/38516289
has comment: http://stackoverflow.com/comment/38516236
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24814304
has body: I am trying to design menu like the one show in figure below This is a responsive menu and should look like the one when on smaller screens. I am facing few issue right now. - I have to add a border between two menus as show in figure below and keep the submenu about 40px down from the base line of main menu. When I add bottom margin to ul li the sub menu show but disappears when I try to take pointer over it. I want sub menu to show in center of parent menu even if wifth of sub menu is more the width of parent menu, I tried this but failed to make it perfect. Responsive version /*Menu*/ .nav-center { text-align:center; } .menu-link { display: none; float: right; text-decoration: none; padding: 19px 10px; } .menu { max-width: 60em; -webkit-transition: all 0.3s ease-out; -moz-transition: all 0.3s ease-out; -ms-transition: all 0.3s ease-out; -o-transition: all 0.3s ease-out; transition: all 0.3s ease-out; } .menu ul { padding: 0px; margin: 0px; list-style: none; position: relative; display: inline-table; } .menu &gt; li &gt; ul.sub-menu { min-width: 10em; padding: 4px 0; background-color: #f4f4f4; border: 1px solid #CCC; border: 1px solid rgba(0, 0, 0, 0.2); -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); -webkit-background-clip: padding-box; -moz-background-clip: padding; background-clip: padding-box; } .menu ul:after { content: ""; clear: both; display: block; } .menu ul li { padding: 0px; border-right:1px solid #053A7D; } .menu &gt; ul &gt; li { display: inline-block; } .menu ul li a { display: block; text-decoration: none; color: #053A7D; font-size: .9em; } .menu ul li &gt; a { padding: 5px 20px; } .menu ul ul { display: none; position: absolute; top:100%; min-width: 160px; border-top: 2px solid #053A7D; /*background-color: #f4f4f4; border: 1px solid rgba(0, 0, 0, 0.2); -webkit-box-shadow: 0 5px 10px…
possible better answer: http://stackoverflow.com/a/24812197
upvote count: 1
downvote count: 1
accepted answer: http://stackoverflow.com/a/24814304
type: Question
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
tagged with: menu
favorite count: 0

http://stackoverflow.com/comment/38611552
comment on: http://stackoverflow.com/q/24862822
has text: What do you mean ? Inside that If () {} I want to disable the text to be inserted on textarea
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24894672
type: Answer
has comment: http://stackoverflow.com/comment/38673029
answers question: http://stackoverflow.com/q/24894452
score: 0
has body: You must add jquery before the slider responsiveslides.min.js.

http://stackoverflow.com/comment/38500618
score: 0
has text: @Saptal Thanks for your help, im new to javascript, this worked for me - but i have a small problem, now when user save his type for example he saved as company - if he refresh the page then the vat number is not showing, he need to select individual then select company again for it to show, is there any way to keep the vat number showing if the page refresh and the selection was company. Thanks alot for the help
comment on: http://stackoverflow.com/q/24803816
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24779267
answer count: 1
has answer: http://stackoverflow.com/a/24787774
has body: What I need: when charts are loaded data is loaded in charts. Problem I'm facing: Charts are loading but data is not loading. I'm using sencha docs as Reference Guide. I just want load data in charts link: http://postimg.org/image/ydbac2soh/ This is the output link that I'm getting url: http://postimg.org/image/5whlpe6wj/ This is code of line charts: Ext.require('Ext.chart.*'); Ext.require(['Ext.layout.container.Fit', 'Ext.window.MessageBox']); Ext.define('Employee',{ extend:'Ext.data.Model', fields:['name','yearOfExperience'] }); var store=Ext.create('Ext.data.Store',{ model:'Employee', data:[ { name:'sam', yearOfExperience:12 }, { name:'ram', yearOfExperience:7 }, { name:'kim', yearOfExperience:16 }, { name:'john', yearOfExperience:21 }, { name:'Mary', yearOfExperience:13 } ] }); Ext.onReady(function () { Ext.Msg.alert("hello","all set"); Ext.create('Ext.chart.Chart', { width:500, height:300, animate:true, shadow:store, store:store, renderTo:Ext.getBody(), legend: { position:'right' }, insertPadding:25, theme:'Base:gradients', axes:[ { title:'years Of Experience', type:'Numeric', position:'left', fields:['yearOfExperience'], minimum:0, maximum:30 }, { title: 'Employee', type: 'Category', position:'bottom', fields:['name'] } ], series:[ { type:"line", xFields: "name", yField :"yearOfExerince" } ] }); }); I have used dummy data t load in charts in ext js. Charts are loaded perfectly but data is not loaded in charts please help where i have done wrong. I have tried with dummy data in charts but no data is loading. Here is the output link: http://postimg.org/image/5whlpe6wj/.
tagged with: javascript
type: UnansweredQuestion
tagged with: extjs
type: Question
score: 0
has title: NO Data Is Loaded IN Charts Using Sencha Ext Js
has comment: http://stackoverflow.com/comment/38460331
has comment: http://stackoverflow.com/comment/38453941

http://stackoverflow.com/q/24901738
type: Question
tagged with: jsdoc3
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24968654
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: jsdoc
has title: jQuery plugin documentation with JSDoc
upvote count: 6
type: AnsweredQuestion
score: 6
has answer: http://stackoverflow.com/a/24968654
has body: I'm wondering how to documenting jQuery plugin by using JSDoc? My code is: /** * The default configurations of comments * @typedef {Object} CommentConfig ... */ /** * Show comments * @method comments * @version 1.0.1 * @param {CommentConfig} options Configuration of comment */ $.fn.comments = function (options) { // .. } I want @method is $.fn.comments but it doesn't work.

identifier
tag name: identifier
type: Tag
tags question: http://stackoverflow.com/q/24903438

http://stackoverflow.com/a/24803358
upvote count: 2
score: 2
answers question: http://stackoverflow.com/q/24803230
downvote count: 0
has body: Try this: as.controller('Test', function($scope, $http, $rootScope, testFactory) { $http.get($rootScope.appUrl + '/nao/test/test') .success(function(data, status, headers, config) { $scope.test = data.data; }); $scope.form = {}; $scope.submitForm = function(isValid) { if(isValid) { /*testFactory.testFactoryMethod(function($http) { $scope.test = data; });*/ $http.post($rootScope.appUrl + '/nao/test', $scope.form) .success(function(data, status, headers, config) { console.log(data); $scope.test = $scope.test || []; $scope.test.push($scope.form); }).error(function(data, status) { }); } }; });
type: Answer

http://stackoverflow.com/q/24858730
has answer: http://stackoverflow.com/a/24877334
accepted answer: http://stackoverflow.com/a/24877334
possible better answer: http://stackoverflow.com/a/24867160
has comment: http://stackoverflow.com/comment/38613087
tagged with: node.js
type: AnsweredQuestion
has body: My mongoose schema is skills : [ { name : {type : String}, count : {type :Number, default:0} } ] and i am firing the update query using for loop as i want to update array of documents and my query is for(var i=0;i&lt;array.length;i++){ Talent.update({userName : userName}, {$addToSet: {skills :{$each: [{name : array[i]}]}}},callback); } here callback gets return for every update query is fired. i want to make callback with database result only once when for loop gets completed. What should i do?
type: Question
has title: how to deal with callback function of nodejs in for loop?
has answer: http://stackoverflow.com/a/24867160
has comment: http://stackoverflow.com/comment/38604493
tagged with: mongodb
answer count: 2
tagged with: mongoose
tagged with: javascript
score: 0

http://stackoverflow.com/comment/38560696
has text: I don't think this is really a programming question
type: QuestionComment
type: Comment
score: 2
comment on: http://stackoverflow.com/q/24836053

http://stackoverflow.com/comment/38681328
has text: Yeah. I just first need to make it work in my code (which is a bit more complex than in the question code. that was just to isolate the issue itself), then tweak it. Why can't I accept two answers.. ;)
comment on: http://stackoverflow.com/a/24899085
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/24811719
has title: How to count total height of all li?
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
has body: I have a menu in the footer of my page, it's content comes from database. html: Foo Lorem ipsum Lorem ipsum dolor sit amet, consectetur adipisicing... Lorem js so far: $('footer .submenu').each(function(i){ $('footer .submenu:eq('+i+') a:first').click(function(e){ e.preventDefault(); elem = $('footer .submenu:eq('+i+') li').length; alert(elem); }); }); What I'm trying to do is, when I click in the first <a />, it returns me the total number of . As the are dynamically inserted, i don't know their height and I cant figure out a solution to that. Can someone help me? jsfiddle: http://jsfiddle.net/GwM5Q/2/ EDIT --- I forgot to mention that the height of the is 0 and have css overflow:hidden. I updated the jsfiddle link, now it have CSS. I'm trying to get the height to do an animation on click using .animate(). I only don't know how to get the height.
score: 0
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/38514972
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24812201
has answer: http://stackoverflow.com/a/24811851
has comment: http://stackoverflow.com/comment/38515253

google-apps-script
tags question: http://stackoverflow.com/q/24811354
tags question: http://stackoverflow.com/q/24896802
tags question: http://stackoverflow.com/q/24833926
tags question: http://stackoverflow.com/q/24841877
tags question: http://stackoverflow.com/q/24850457
tags question: http://stackoverflow.com/q/24805727
type: Tag
tag name: google-apps-script
tags question: http://stackoverflow.com/q/24845915
tags question: http://stackoverflow.com/q/24770913
tags question: http://stackoverflow.com/q/24868346
tags question: http://stackoverflow.com/q/24894648
tags question: http://stackoverflow.com/q/24773177
tags question: http://stackoverflow.com/q/24875567
tags question: http://stackoverflow.com/q/24847408
tags question: http://stackoverflow.com/q/24788048
tags question: http://stackoverflow.com/q/24834162
tags question: http://stackoverflow.com/q/24870324
tags question: http://stackoverflow.com/q/24811853
tags question: http://stackoverflow.com/q/24843720
tags question: http://stackoverflow.com/q/24832174
tags question: http://stackoverflow.com/q/24766170
tags question: http://stackoverflow.com/q/24843241
tags question: http://stackoverflow.com/q/24767721
tags question: http://stackoverflow.com/q/24846417

http://stackoverflow.com/comment/38695392
type: Comment
comment on: http://stackoverflow.com/a/24907200
has text: I'm still getting this `throw new TypeError('Router.use() requires callback function');^TypeError: Router.use() requires callback function at Function.use (.\node_modules\express \lib\router\index.js:416:11)`
type: AnswerComment
score: 0

http://stackoverflow.com/q/24763993
tagged with: javascript
has comment: http://stackoverflow.com/comment/38425270
has comment: http://stackoverflow.com/comment/38424906
score: 0
has title: Get current index array while loop
has body: I want to get current index array while loop. heres my code. HTML &lt;input class="btn" value="Car"&gt;&lt;br&gt; &lt;input class="btn" value="Motorcycle"&gt; Javascript var btn= document.getElementsByClassName('btn'); for(i=0; i &lt; btn.length; i++){ btn[i].addEventListener('click', function(v){ var index = btn[i]; document.write(index); }, false); } When i clicked a button the result is undefined instead 0 or 1.
has comment: http://stackoverflow.com/comment/38424584
has comment: http://stackoverflow.com/comment/38424626
duplicate of: http://stackoverflow.com/q/750486
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38424714
has comment: http://stackoverflow.com/comment/38424970
linked to: http://stackoverflow.com/q/750486
answer count: 0
has comment: http://stackoverflow.com/comment/38424778
has comment: http://stackoverflow.com/comment/38424621
type: Question
has comment: http://stackoverflow.com/comment/38424607
has comment: http://stackoverflow.com/comment/38425241
has comment: http://stackoverflow.com/comment/38425036
has comment: http://stackoverflow.com/comment/38424900

http://stackoverflow.com/a/24757953
type: Answer
answers question: http://stackoverflow.com/q/24757767
has body: Its setting the object Ordinal it seems. can you debug and edit in {obj.id} inside ng-options="obj.id as obj.symbol for obj in config.currencies"> to get it right.
score: 0

http://stackoverflow.com/a/24855412
answers question: http://stackoverflow.com/q/24855391
type: Answer
score: 3
upvote count: 3
has body: &lt;$php and $? are not PHP tags, &lt;?php and ?&gt; are. Use the folowing. &lt;?php if(isset($_POST['name'])){ $name = $_POST['name']; echo $name; } echo 'hello'; ?&gt;
downvote count: 0

http://stackoverflow.com/comment/38601923
comment on: http://stackoverflow.com/a/24857585
has text: Warning: Cannot modify header information - headers already sent by (output started at /hermes/redirect.php:92) in /hermes/redirect.php on line 95
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/51801586
score: 0
has text: I don't know how to use it my example?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24754122

http://stackoverflow.com/a/24788807
type: AcceptedAnswer
has body: var $empty = jQuery(".field-items").filter(function() { return !$.trim(this.innerHTML); }); if ($empty.length) { $empty.parent().parent().parent().parent().parent().parent().hide(); $('#survey-monkey-title').hide(); } I'd also like to give Brian Giaz his propers for utilizing .add() below: $empty.parent().parent().parent().parent().parent().parent().add('#survey-monkey-title').hide();
type: Answer
answers question: http://stackoverflow.com/q/24788748
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/24788748
has comment: http://stackoverflow.com/comment/38476782
has comment: http://stackoverflow.com/comment/38475771
upvote count: 1

http://stackoverflow.com/q/24764712
tagged with: javascript
score: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38449468
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38448752
has comment: http://stackoverflow.com/comment/38448806
has body: I wrote a directive that essentially should set a variable of the global scope to a certain value, if the mouse is clicked on it and return to the default value, once the mouse is released. I got it to work but as I am just starting with angular I really try to do things proper and avoid even starting with bad programming habits. There's also some DOM manipulation happening in the directive but I simplified it to the basic functionality of changing the value. This is the HTML: And this is the (simplified) directive: app.directive("myDirective", function () { return { scope: { model: "=ngModel", index: "@myDirective" }, template: " click ", link: function(scope, elm, attrs) { scope.mousedown = function () { scope.model = scope.index; angular.element(document).one("mouseup", function () { // react even if dragged out of element bounds scope.$apply(function () { scope.model = -1; }); }); }; } }; }); It is working as expected but I am unsure if it is the best and most correct way of achieving this. My Questions are: For this purpose - did I chose the correct approach? Is it okay, that I defined the mousedown method in the link function or should I define a seperate controler for the directive using the "controller" option? Is there a way to achieve the same thing (i.e. with just one parameter to the directive)? (I read one should avoid using scope.$parent.$index). General comments / advice? Thank you for your time!
has title: AngularJS: How to properly set/unset a variable with a directive repeated using ng-repeat?
type: Question
has answer: http://stackoverflow.com/a/24777609
answer count: 1

http://stackoverflow.com/q/24897479
has answer: http://stackoverflow.com/a/24897597
score: 1
has body: As shown in the demo, the maxValue is set to 2017, but the chart goes all the way to 2020. How can I make the chart actually stop at 2017? It's taking up a bit too much space on my page so I want to optimize it See demo fiddle hAxis options look like this: hAxis: { 'format':'####', maxValue: 2017, minValue: 2009 }
type: Question
answer count: 2
tagged with: google-visualization
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/24897620
has title: My bubble chart extends well past the maxValue, and below the minValue
favorite count: 0
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/q/24790485
possible better answer: http://stackoverflow.com/a/24790518
downvote count: 1
has comment: http://stackoverflow.com/comment/38475490
has answer: http://stackoverflow.com/a/24790518
type: AnsweredQuestion
score: 2
upvote count: 3
has answer: http://stackoverflow.com/a/24790728
has title: Convert a range of numbers to portion of 100
type: Question
has answer: http://stackoverflow.com/a/24790760
has answer: http://stackoverflow.com/a/24790554
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24790554
answer count: 4
favorite count: 0
has body: I have a list of numbers (any length) ranging from 0 - 100, including duplicates. I need convert those numbers to portions of 100. For example: [25, 50] becomes [33.333, 66.666] [25, 50, 50] becomes [20, 40, 40] What algorithm would work best for this?

http://stackoverflow.com/q/24793810
accepted answer: http://stackoverflow.com/a/24793904
has comment: http://stackoverflow.com/comment/38481717
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/11914076
type: Question
tagged with: alert
tagged with: if-statement
score: 0
has answer: http://stackoverflow.com/a/24793904
answer count: 2
possible better answer: http://stackoverflow.com/a/24793902
tagged with: function
has comment: http://stackoverflow.com/comment/38481689
has answer: http://stackoverflow.com/a/24793902
tagged with: javascript
has body: So I have been working on this for a couple of days and as a newbie, I think the answer will really help my understanding of JavaScript. I have a page that contains a form -- when a user submits the form a new window opens with form variables embedded within text in new window. It works fine. The problem I am having is I want to add an alert to the new window if the user onClick types in NY || New York || NJ || New Jersey. I tested my if function (I left out the else after doing some research since else is really do nothing. The way I want it to work is if someone types one of those four variables, a new window opens with the alert. If they don't type in one of those variables, only the new window opens. I prepared a truncated test code which I'll put below. I know there are better ways to do this then the code I have written, and I bet there are probably easier ways with libraries, jquery, etc., but I would love for someone to show me how to add the askForHelp function so it will open the alert in the new window with code I have written. Again, that's b/c this is my knowledge base at this point, and it would help me see how to really write a statement. Thanks in advance for any help offered. test State: Zip:
has title: Javascript - adding alert from if else function to new window on onclick

http://stackoverflow.com/comment/38679718
type: Comment
has text: @user3127658 It's the id of the input element.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24898671

http://stackoverflow.com/q/24789872
type: Question
has comment: http://stackoverflow.com/comment/38474718
tagged with: javascript
tagged with: jquery
has title: jQuery with image carousel execute on click over image. Why?
tagged with: ajax
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/59822475
has body: I'm trying write a javascript to execute same steps after user click over a image get your id, username and password. After it, send to my script php where will executes my local script. But I don't know whats wrong, but even a click a some img get your id, fill the form my php script calls the back-end script the same times of the images clicked. Some could me explain what i need to do o whats wrong? Javascript /*--------------------------------------------------*/ /* BACKEND SCRIPT */ /*--------------------------------------------------*/ $('#loginform').hide(); $('#limpar').click(function hideOrder() { $('#resultado').hide(); }); $('img').click(function getIdImage(event) { id_image = (this.id); alert(id_image); // Form Login $('#loginform').show().submit(function formInfo() { login = $('#login').val(); senha = $('#senha').val(); $("#status").show().html("&lt;img src='images/ajax-loader.gif' alt='Consultando ...' /&gt;"); $.post( 'contact_form/validateUser.php', { target:id_image, username: login, password: senha }, function getDataBack(data) { if (data.error) { $('#retorno').html(data.error); $('#status').hide(); } else { $('#retorno').html(data); $('#imagem').attr('src', '/Onepage/screenshots/' + login + '.png'); $('#resultado').show(); $('#status').hide(); } }, 'json'); return false; login = $('#login').val(""); senha = $('#senha').val(""); id_image = val(""); }); }); PHP: &lt;?php // Informations passes from form $username = $_POST['username']; $password = $_POST['password']; $target = $_POST['target']; $retorno = array(); // Execute $run = "/usr/local/run/parser"; $script = "/var/run/back/$target"; // Check if POST is not null if ( ($username == "") &amp;&amp; ($password == "") ) { $retorno['error'] = "Os campos email e senha sÃ£o obrigatÃ³rios."; echo json_encode($retorno); return false; } // Execute to via asynchronous process try { exec("{$run} {$script} {$username} {$password} 2&gt;&amp;1", $output); } catch (Exception $e) { $retorno['error'] = "NÃ£o foi …
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38511864
tagged with: ajaxform

http://stackoverflow.com/q/24839881
tagged with: angularjs
type: UnansweredQuestion
has title: How to intercept Angularjs resource's action after resources are instantiated
has body: I have some resources with actions. I need to intercept the actions' response after resources are instantiated. i wish to attach to the response-resource (or response-resource-array) some meta data taken from the http-response-header.. I tried - action's tranformRespose function but it's too early .. that's for the raw response string manipulation - action's interceptorsobject but that's too early too, on response data i have the parsed resp string as a simple js-hash/js-array, and if i attach an object for meta-data it is not propagated to the returning resource-instance.. the last one is quite obvious, because the returning resource-instance/resource-instance-array from resource's action is immediatly empty-returned and then lazyly populated.. Any idea to achieve what i need in some way, avoiding big hacks?
type: Question
has answer: http://stackoverflow.com/a/24839941
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/a/24886210
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24886165
answers question: http://stackoverflow.com/q/24886165
type: Answer
score: 7
has comment: http://stackoverflow.com/comment/38693569
upvote count: 7
has body: Don't pass anything rather than the this reference and do, HTML &lt;input type="button" onclick="getMethod(this)"/&gt; JS function getMethod(elem){ alert($(elem).closest('table').attr('id')); } In the above function we have used .closest() to grab the parent table. and we have used .attr('id') to retrieve its id. DEMO
type: AcceptedAnswer

http://stackoverflow.com/comment/38399994
type: Comment
type: QuestionComment
has text: I have, and it works - but I have the exact same code open in another tab and it straight out doesn't work. Bizzare x_X Thankyou?? I don't know whats up
score: 0
comment on: http://stackoverflow.com/q/24750766

http://stackoverflow.com/a/24767287
has comment: http://stackoverflow.com/comment/38431033
score: 0
has comment: http://stackoverflow.com/comment/38431576
has comment: http://stackoverflow.com/comment/38432889
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38432304
has comment: http://stackoverflow.com/comment/38433070
has body: Try mysqli_query also make sure you are connected to your database and then do this: if (mysqli_query($con, "INSERT... ")){ ... //code here } Good Luck!
has comment: http://stackoverflow.com/comment/38432168
accepted answer of: http://stackoverflow.com/q/24766950
has comment: http://stackoverflow.com/comment/38432963
answers question: http://stackoverflow.com/q/24766950
type: Answer

http://stackoverflow.com/a/24878088
answers question: http://stackoverflow.com/q/24878044
has body: var floatingButton1 = document.getElementById('floatingButton1'); var i1 = document.createElement("img"); i1.src = "Images/whitesquare.png"; i1.type = "image"; The above code is not required in the second time. var i1 already holds the reference to the image appended. Just use floatingButton1.removeChild(i1);
accepted answer of: http://stackoverflow.com/q/24878044
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/38640971
upvote count: 1
has comment: http://stackoverflow.com/comment/38641212
has comment: http://stackoverflow.com/comment/38640991
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/38668617
score: 2
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24892809
has text: This is the most concise solution that functions entirely correctly.

http://stackoverflow.com/a/24908236
type: AcceptedAnswer
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24908117
score: 1
answers question: http://stackoverflow.com/q/24908117
downvote count: 0
has body: Your JavaScript: {usd:1, gbp:0.59, bdt:77.5} represents an object, not an array. So it doesn't have a length property. To count the number of properties in your object very quickly, you can do: var a = {usd:1,gbp:0.59,bdt:77.5} var b = Object.keys(a).length b will now be set to 3.

http://stackoverflow.com/comment/45658658
type: Comment
type: QuestionComment
has text: I have tried to update the question with whatever is possible.
comment on: http://stackoverflow.com/q/24871838
score: 0

http://stackoverflow.com/q/24882985
type: AnsweredQuestion
tagged with: object
has comment: http://stackoverflow.com/comment/38650888
has comment: http://stackoverflow.com/comment/38649942
tagged with: javascript
score: 17
type: Question
answer count: 2
has title: Array of Objects vs Nested Object?
linked to: http://stackoverflow.com/q/31469441
tagged with: arrays
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/24883142
has comment: http://stackoverflow.com/comment/38650149
has body: I have a very basic programing question that i hoped you can shed a light on. I am working a lot of objects right now and i was wondering if it is better to search for content inside an array of objects or inside a nested object? For eg, i can store the same data sample in the following two ways: data1 = [ { "id":1, "key1: "value1", "key2:"value2"}, { "id":2, "key1: "value1", "key2:"value2"}, { "id":3, "key1: "value1", "key2:"value2"}, { "id":4, "key1: "value1", "key2:"value2"}, ..... ] and data2 = { "id_1": { "key1: "value1", "key2:"value2"}, "id_2": { "key1: "value1", "key2:"value2"}, "id_3": { "key1: "value1", "key2:"value2"}, "id_4": { "key1: "value1", "key2:"value2"}, ..... } Now the requirement is to get a certain property from a child object. And all we know is the id (and not the index) associated with it. If i were to use the array method, i will have to use loops and array filters to access any content/value in the individual objects. This method seems rather cumbersome to be and iterating through each child object feels very inefficient to me. Yet whenever i see similar data samples being implemented by experienced programmers, they all seem to using arrays a lot. If I were to use the nested object method, all i have to do is call data2.id_2.key2 to get that specific value. Which is the recommended way of doing things? I will be playing with rather large datasets and so, option will have better performance?
has comment: http://stackoverflow.com/comment/38649957
accepted answer: http://stackoverflow.com/a/24883142
possible better answer: http://stackoverflow.com/a/24883381
has comment: http://stackoverflow.com/comment/38649791
has answer: http://stackoverflow.com/a/24883381
upvote count: 17
has comment: http://stackoverflow.com/comment/38649833

http://stackoverflow.com/comment/38419475
type: AnswerComment
type: Comment
has text: Tried that and it removed the error but the input is Executing : c:\program files\Microsoft SQL Server\100\Tools\Binn\sqlcmd -b -S sasqld01 -U sraoper -P **** -d model -i C:\Serena\ReleaseAutomationAgent\core\var\work\ABS_SQL\sqlserve_abs_sq00045.sql and it does not pick up the \ using the \\
comment on: http://stackoverflow.com/a/24759685
score: 0

http://stackoverflow.com/q/24785201
has body: Is it possible with SequelizeJs to define model for mulitple connections. I mean I want to use several MySQL user to query my database. Here is an example of what I want. Let's start with the connection definition var user1 = new Sequelize('database', 'user1', 'pwd1', { host: "my.server.tld", port: 12345 }) var user2 = new Sequelize('database', 'user2', 'pwd2', { host: "my.server.tld", port: 12345 }) But now if I have a dynamic number of user I can store each connection in an array var user = []; for(var myUser in myUsers) { user.push( new Sequelize('database', myUser.username, myUser.pwd, { host: "my.server.tld", port: 12345 }) ) } Then what, if I want to declare my models I have to make a loop on each connection to declare my models for each connection ?? There is no way to declare my model not linked to my connection, then specify which connection to use when I query my database ?
type: AnsweredQuestion
has title: Use different mysql user in Sequelizejs
tagged with: mysql
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/24797278
accepted answer: http://stackoverflow.com/a/24797278
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25028401
score: 0
tagged with: sequelize.js
has answer: http://stackoverflow.com/a/25028401
tagged with: node.js

http://stackoverflow.com/comment/38445920
has text: it keeps loop first song not to the next. by the way you know how to repack array to array again from loop? i want to save it in var a = [btn[i].getAttribute('name')]; so when i document.write(a[3]); i will return the 4rd value.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24767686
type: Comment

http://stackoverflow.com/comment/38681339
comment on: http://stackoverflow.com/a/24880300
score: 0
type: AnswerComment
type: Comment
has text: it looks great however i tried many times but not worked. are you sure codes are correct? there are some spelling mistakes but even i corrected them it didnt work. maybe it conflicted with another javascipt. or i did something wrong. no idea...

http://stackoverflow.com/comment/38615684
has text: You are a bug finder!
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24863372
score: 0

http://stackoverflow.com/comment/38658918
type: QuestionComment
comment on: http://stackoverflow.com/q/24887079
type: Comment
score: 0
has text: The file process is ABSOLUTELY still running when the page is refreshed to send a second request. There is no (reasonable) way of killing a PHP process on the server, when the client refreshes the script.

http://stackoverflow.com/q/24764704
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has body: I have started to use web workers in some of my applications, and as you all know, 99% of the time you try to use something new, you use it wrong. So naturally I looked up its documentation and I came across an interesting passage regarding thread safety: The Worker interface spawns real OS-level threads, and concurrency can cause interesting effects in your code if you aren't careful. However, in the case of web workers, the carefully controlled communication points with other threads means that it's actually very hard to cause concurrency problems. There's no access to non-thread safe components or the DOM and you have to pass specific data in and out of a thread through serialized objects. So you have to work really hard to cause problems in your code Has anyone been able to cause concurrency problems using web workers? So far my attempts at breaking the web worker implementation in Firefox and Chrome has failed.
has answer: http://stackoverflow.com/a/30828445
score: 2
tagged with: concurrency
type: Question
has title: Web Worker Concurrency Exception
tagged with: javascript
tagged with: web-worker
answer count: 1
downvote count: 0

http://stackoverflow.com/a/24783228
upvote count: 4
downvote count: 0
has body: If you write "func(...)" you call your function, you must to juste write function name. Without argument Like this : $('div').click(fn_clik); With argument If you want get argument, use anonymous function like this : $('div').click(function () { fn_clik('Mike') }); See this and event variables. The this variable return element node, and event return click event. $("body").click(function (event) { if (this == $("body")[0]) { alert("self"); } }); Demo
answers question: http://stackoverflow.com/q/24783099
score: 4
type: Answer

http://stackoverflow.com/a/24842885
downvote count: 0
has comment: http://stackoverflow.com/comment/38595906
has comment: http://stackoverflow.com/comment/38596261
has comment: http://stackoverflow.com/comment/38667927
has comment: http://stackoverflow.com/comment/38947336
has comment: http://stackoverflow.com/comment/38593395
has comment: http://stackoverflow.com/comment/38673107
has body: I think you need to put utf8_decode() for every return values originating from search.php This seems to works $results[] = array(utf8_decode($key), $value); Yes, it works but using utf8_decode() will break a string if it's not encoded in UTF-8 and contains chars not defined in ISO 8859 charset. After doing some test it appears autocomplete_format() does not set the correct encoding before echoing array values. Json_encode() in the other hand will escape UTF-8 by default, unless you put JSON_UNESCAPED_UNICODE (PHP 5.4+ only) as argument (but proper JSON parser shouldn't have a problem with unicode escape characters). Anyway it appears explicitly setting the encoding managed to fix the problem, at least in my limited testing. &lt;?php include 'data.php'; include 'data.php'; function autocomplete_format($results) { foreach ($results as $result) { echo $result[0] . '|' . $result[1] . "\n"; } } if (isset($_GET['q'])) { $q = strtolower($_GET['q']); if ($q) { foreach ($data as $key =&gt; $value) { if (strpos(strtolower($key), $q) !== false) { $results[] = array($key, $value); } } } } $output = 'autocomplete'; if (isset($_GET['output'])) { $output = strtolower($_GET['output']); } //set proper MIME and encoding before echoing the return value if ($output === 'json') { header('Content-Type: application/json; charset=utf-8'); echo json_encode($results, JSON_UNESCAPED_UNICODE); } else { header('Content-Type: text/plain; charset=utf-8'); echo autocomplete_format($results); ... As for question #2 This can be done with jQuery-autocomplete you're already using. Say we have two input boxes, #ac1 for city name (the autocompletized input) and #num1 to hold the numeric value: &lt;form&gt; &lt;input type="text" id="ac1"&gt; &lt;input type="text" id="num1"&gt; &lt;/form&gt; Then you need to add onItemSelect option to #ac1 autocomplete definition inside the &lt;head&gt; $(function() { $("#ac1").autocomplete('search.php', { selectFirst: true } //when autocomplete entry is selected.. {onIte…
type: Answer
has comment: http://stackoverflow.com/comment/38814475
accepted answer of: http://stackoverflow.com/q/24842752
has comment: http://stackoverflow.com/comment/38594462
has comment: http://stackoverflow.com/comment/40787240
has comment: http://stackoverflow.com/comment/38722527
upvote count: 2
answers question: http://stackoverflow.com/q/24842752
has comment: http://stackoverflow.com/comment/38595595
has comment: http://stackoverflow.com/comment/38717254
has comment: http://stackoverflow.com/comment/38597188
has comment: http://stackoverflow.com/comment/38612592
has comment: http://stackoverflow.com/comment/38690854
has comment: http://stackoverflow.com/comment/38993436
has comment: http://stackoverflow.com/comment/38593192
has comment: http://stackoverflow.com/comment/38915772
has comment: http://stackoverflow.com/comment/38759741
has comment: http://stackoverflow.com/comment/38840929
has comment: http://stackoverflow.com/comment/38597044
has comment: http://stackoverflow.com/comment/38597057
score: 2
type: AcceptedAnswer

http://stackoverflow.com/comment/38613889
type: Comment
score: 1
comment on: http://stackoverflow.com/a/24864025
has text: @LLawliet it is necessary, because `map` returns an `array`
type: AnswerComment

http://stackoverflow.com/comment/38572415
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24842379
has text: If you want this to keep looping "after the range", why not just remove the `i < 30` check?
score: 0

http://stackoverflow.com/q/24793062
has answer: http://stackoverflow.com/a/31028719
downvote count: 0
has answer: http://stackoverflow.com/a/24799540
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
tagged with: fullpage.js
has body: I am trying to use fullpage.js for two different sections on one website. Basically, when a slide is clicked on, it reveals a child wrapper div underneath with its own sections to vertically scroll through before the main section continues on. Here is my code that I am working with. I'm trying to load it in through ajax but I'm wondering if there is an easier way I am overlooking. $("#wrapper").fullpage({ verticalCentered: true, resize : true, anchors: ['section1', 'section2', 'section3', 'about'], //menu:'#menu', customScroll:true, onLeave: function(index, nextIndex, direction){ //console.log(index+'|'+nextIndex+'|'+direction); if (direction == 'down'){ $('.section:nth-child('+index+')').animate({'top':'0%'},0) $('.section:nth-child('+nextIndex+')').animate({'top':'100%'},0).animate({'top':'0%'},500); } else { $('.section:nth-child('+nextIndex+')').animate({'top':'0%'},0); $('.section:nth-child('+index+')').animate({'top':'0%'},0).animate({'top':'100%'},500).animate({'top':'500%'},0); } } }); and then the code that removes it and adds a new wrapper: $(".sub_section").click(function() { $("#wrapper").fullpage.destroy('all'); if (sub_section_open == false) { $("#left_border").animate({"borderLeftWidth" : "0px"}, 300); $("#right_border").animate({"borderRightWidth" : "0px"}, 300); $("#top_border").animate({"borderTopWidth" : "0px"}, 300, function() { $("#left_border").hide(); $("#right_border").hide(); $("#top_border").hide(); }); $(".sub_section .letters").slideUp("slow", function(){ $(".sub_section .content").css({'z-index': 1}); }); sub_section_open = true; $(".btn_sub_section_close").show(); $( "#wrapper" ).load( "section1.html" ); $("#section1").fullpage({ verticalCentered: true, resize : true, anchors: ['ssection1', 'ssection2', 'ssection3', 'ssection4'], menu:'#menu' }); } }); Any ideas? Thanks!
upvote count: 3
type: UnansweredQuestion
has title: multiple instances of fullpage.js
score: 3
type: Question
answer count: 2

http://stackoverflow.com/a/24811744
type: Answer
accepted answer of: http://stackoverflow.com/q/24811207
answers question: http://stackoverflow.com/q/24811207
type: AcceptedAnswer
score: 0
has body: The plugin lacks documentation badly, still we can manage to get the options by inspecting source code, which are self-explanatory. First we need to make an array to store events and after we set it in events_array option, here is the Javascript code for the example you sent with events data and how to set in the calendar object: var events_array = new Array({ startDate: new Date(2011, 07, 20, 15, 50), endDate: new Date(2012, 00, 10), title: "Event 1", description: "Description 1", priority: 2, // 1 = Low, 2 = Medium, 3 = Urgent frecuency: 1 // 1 = Daily, 2 = Weekly, 3 = Monthly, 4 = Yearly }, { startDate: new Date(2011, 07, 20, 9, 50), title: "Event 3", description: "Description 3", priority: 3, frecuency: 3 }); $(".selector").dp_calendar({ events_array: events_array }); In other words, having a database with the events saved from user input data, you only need to loop through records adding items to this array or retrieve all in JSON format.

http://stackoverflow.com/comment/38438297
type: Comment
has text: @Derek朕會功夫 Ok then i think i was wrong in my original question, because i need the value of `id` to be unique and non-shared between the instances of `c` callback.
score: 0
comment on: http://stackoverflow.com/q/24769516
type: QuestionComment

http://stackoverflow.com/a/24909175
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24909006
has body: Don't try to set myData as a global variable - it won't work because getJSON is asynchronous. Either use a promise: function test() { return $.getJSON('notebook-json-data.php'); } $.when(test()).then(function (data) { console.log(data); }); Or a callback: function test(callback) { $.getJSON('notebook-json-data.php', function (data) { callback(data); }); } test(function (data) { console.log(data); }); Edit Since you want to use the data in other areas of your code, use a closure to create an environment where your variables don't leak out into the global space. For example, with the callback: (function () { var myData; function test(callback) { $.getJSON('notebook-json-data.php', function (data) { callback(data); }); } test(function (data) { myData = data; autoPopulate('field', 'id'); }); function autoPopulate(field, id) { console.log(myData); } }); myData is cached as a global variable specific to that closure. Note the other functions will only be able to use that variable once the callback has completed.
answers question: http://stackoverflow.com/q/24909006
type: Answer
has comment: http://stackoverflow.com/comment/38704131
has comment: http://stackoverflow.com/comment/38699019
has comment: http://stackoverflow.com/comment/38704772
score: 16
upvote count: 16
has comment: http://stackoverflow.com/comment/38704419

http://stackoverflow.com/comment/38616083
type: Comment
comment on: http://stackoverflow.com/a/24865020
type: AnswerComment
has text: Took a fast look over both of them. Will say that "datatables" looks more like it suites my needs except that i would like not to show the table of all the content. Do you think its possible to have a blank page just with an search box then when you hit "search" you will be "redirected" to the results? instead of watching all of them? :)
score: 0

http://stackoverflow.com/comment/38518337
has text: this 4 keys: { } ~ |
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24813388
type: Comment

http://stackoverflow.com/a/24894246
has comment: http://stackoverflow.com/comment/38671107
type: Answer
has body: Why you not using simple CSS property hover Like this #registerbutton:hover{color:yellow;}
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/24894136
has comment: http://stackoverflow.com/comment/38671181
downvote count: 0

http://stackoverflow.com/q/24840890
type: Question
tagged with: javascript
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has title: Imprecise window scrolling loop (JS)
has body: In order to make an animated scrolling, I have made a loop that increments ++ the current browser's screen position to reach the value of the offset height of an element in the dom. The problem is that the scrolling seems visually move much further than the increment value. However, an indicator expression shows me the correct value well. function windowScroll(j) { var actualScrollY; var newScrollY; actualScrollY = window.pageYOffset; newScrollY = document.getElementById(j).offsetTop; var i = setInterval ( function() { actualScrollY++; window.scrollBy(0, actualScrollY); document.getElementById('indicator').textContent = newScrollY-actualScrollY; if ( actualScrollY &gt; newScrollY ) { clearInterval(i); } }, 25); }
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/38569478
tagged with: scroll
upvote count: 1
has comment: http://stackoverflow.com/comment/38569360

http://stackoverflow.com/q/24823264
score: 1
type: Question
has answer: http://stackoverflow.com/a/24823426
answer count: 2
duplicate of: http://stackoverflow.com/q/10242695
downvote count: 0
tagged with: javascript
has body: I am trying to print a document using print method of javascript. Now i want to set number of copies to print(by default it will print 1 copy).i want to set the number of copies to two(2 copies). Is it possible to do it from js code.We can set by printer settings,but it will print for all the copies.I need it for specific document to print 2 copies. My code is : $scope.printPDF = function (id) { window.frames["doc1"].focus(); window.frames["doc1"].print(); window.frames["doc2"].focus(); window.frames["doc2"].print(); window.frames["doc3"].focus(); window.frames["doc3"].print(); }; Now i want to print doc2("only doc2") as 2 copies.remaining should be default 1 copy. Thanks in advance.
tagged with: printing
has answer: http://stackoverflow.com/a/24823443
linked to: http://stackoverflow.com/q/10242695
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has title: How to set the number of copies to print from javascript

http://stackoverflow.com/comment/107440902
has text: Changed since when? You probably want to use the `--watch` setting for this.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/54173575

http://stackoverflow.com/a/24770823
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/24770767
has body: You need to use pushObject instead of push, it's essentially a setter that Ember can observe and react to an array change. members.pushObject(member);
accepted answer of: http://stackoverflow.com/q/24770767
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/38539664
score: 2
has text: I so wanted to put a comment here that just said "42". Can you share, other than a link, what you have tried? Using `setInterval()` you can always use `clearInterval()` to stop a named interval.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24825055

http://stackoverflow.com/comment/38731311
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24858293
has text: I just noticed that when I switch back to the pen tool after the eraser clears the canvas nothing gets drawn anymore.

http://stackoverflow.com/comment/38572384
has text: @jfriend00 I was just using the Math.random as an example, but I like the idea of wrapping stuff in a `setTimeout(fn,0)` to force asynchonity.
comment on: http://stackoverflow.com/q/24835556
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38557925
comment on: http://stackoverflow.com/q/24834324
has text: @TravisJ I think the intuitive v counter-intuitiveness is certainly up for debate, but without a real-world context for where it's being applied there's no point. I'll look into parallax. Thanks.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24858200
downvote count: 1
type: AnsweredQuestion
has title: Ng-src not working for locally stored image
accepted answer: http://stackoverflow.com/a/24858326
has comment: http://stackoverflow.com/comment/38603681
type: Question
has comment: http://stackoverflow.com/comment/38603168
score: 5
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
upvote count: 6
has answer: http://stackoverflow.com/a/24858326
tagged with: angularjs
has body: I'm trying something in angularjs. This is the controller I made: function ImagesController($scope){ $scope.count = 0; $scope.imags = [ { image1: 'images/levels/level1/sky.jpg', image2: 'images/levels/level1/rain.jpg', image3: 'images/levels/level1/sky.jpg' }, { image1: 'images/levels/level2/x.jpg', image2: 'images/levels/level2/y.jpg', image3: 'images/levels/level2/z.jpg' } ]; } And this is the HTML linking to this controller: &lt;div ng-controller="ImagesController"&gt; Random Writing &lt;img ng-src="$scope.imags[0].image1"&gt; &lt;/div&gt; I don't know why the image that I'm trying to display is not working. I have added ng-app to the tag already so that can't be the issue.

http://stackoverflow.com/a/24781237
accepted answer of: http://stackoverflow.com/q/24778623
type: Answer
has body: As my research currently stands, this is just the way ng-repeat (and Angular, really) works: it reuses previous DOM elements (along with all their attributes). Editing DOM outside of Angular is not supported. Sometimes you can bypass this condition, but sometimes not... Update: in this particular case the problem was that I used track by $index in my repeat, removing that will cure the DOM mismatch. However, this is still a messy solution, only advised if you don't want to edit that element anymore, and also includes performance penalties.
answers question: http://stackoverflow.com/q/24778623
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/38410575
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24756357
has text: Yes I think you're right, I'm working too much with .NET and its reflection framework, where you have PropertyInfos which will tell you what the declaring type is. But those cannot be retrieved from a simple variable value either, I mixed up "variables" and "variable infos". Thanks.

http://stackoverflow.com/comment/38697832
has text: @VKM there is a tag of `nodejs` so I told you that, but in HTML you can say `\n` or `\r\n` according to your OS.
type: Comment
comment on: http://stackoverflow.com/a/24908124
score: 0
type: AnswerComment

http://stackoverflow.com/a/24869561
has body: In div .item you have .row and you have 4 .col-md-3 divs you delete the other 3 and leave just one and give it a class .col-md-12. Try with that Is this what you want? http://jsfiddle.net/bGwXd/1/ Product label Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 12,99 € Wishlist Product label Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 12,99 € Wishlist Product label Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 12,99 € Wishlist Product label Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 12,99 € Wishlist Product label Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 12,99 € Wishlist Product label Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 12,99 € Wishlist Product label Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 12,99 € Wishlist Product label Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 12,99 € Wishlist Product label Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 12,99 € Wishlist
answers question: http://stackoverflow.com/q/24844037
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/38687509
downvote count: 0
score: 1

http://stackoverflow.com/comment/38599089
comment on: http://stackoverflow.com/a/24839853
type: Comment
has text: Thanks for the feedback, very clarifying :) From your reply it sounds like I should be going down the route of ko.utils.extend(). I'm going to look into that now.
score: 0
type: AnswerComment

http://stackoverflow.com/a/24786512
type: AcceptedAnswer
type: Answer
score: 0
accepted answer of: http://stackoverflow.com/q/24786511
answers question: http://stackoverflow.com/q/24786511
has body: The way that I found in the end that works is simply to have the DOMSubtreeModified "manually" update the value: $(document).on('DOMSubtreeModified', 'details.playlist-details', function(e) { var list = ko.dataFor(this); list.open(this.getAttribute('open')); }); (Somehow, this does not cause the looping that more-complex constructs I tried had caused.)

http://stackoverflow.com/comment/38543176
has text: Keeping track of order this way is really not necessary. In angular, the model is the source of truth. You already have the array of data - when you insert/remove items within the array, you are implicitly re-ordering the model.
comment on: http://stackoverflow.com/q/24826608
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38527545
type: QuestionComment
score: 0
has text: Look at this answer http://stackoverflow.com/questions/13382516/getting-scroll-bar-width-using-javascript/22510143#22510143
comment on: http://stackoverflow.com/q/24797160
type: Comment

http://stackoverflow.com/comment/38483865
type: Comment
comment on: http://stackoverflow.com/a/24795078
type: AnswerComment
has text: This worked great! Would you mind explaining this a bit more? Mainly the \b~? section?
score: 0

http://stackoverflow.com/comment/38693442
comment on: http://stackoverflow.com/a/24905822
has text: @user3825129 Change your javascript code, instead of `.innerHTML` to `.value`.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38469415
comment on: http://stackoverflow.com/a/24787431
has text: @user2070057: It is a low quality post. Regardless if it might answer the question, it is of low quality and usefulness. That's what the downvote is signifying.
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/a/24848972
answers question: http://stackoverflow.com/q/24848887
upvote count: 1
has comment: http://stackoverflow.com/comment/38585082
score: 1
has comment: http://stackoverflow.com/comment/38585360
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/24848887
has body: In a minimal-changes spirit, here's what you do: Change your id values to classes, names, or anything else that's allowed to repeat. Change your button's onclick to look like this: &lt;button onclick='editParam(this)'&gt; ...which will pass that specific button element into the editParam function. Then in editParam, you can do something like this (see in-code comments): function editParam(button) { var tr, pcode, pdesc, pval; // Find the row containing these inputs tr = button.parentNode; while (tr &amp;&amp; tr.nodeName.toUpperCase() !== "TR" &amp;&amp; tr.nodeName.toUpperCase() !== "BODY") { tr = tr.parentNode; } if (!tr || tr.nodeName.toUpperCase() !== "TR") { return; // Something went wrong } // Get the inputs for this row -- in this code, I'm using classes, // but just change the CSS selector if you use names instead, for // instance `pcode = tr.querySelector("input[name=pcode]");` pcode = tr.querySelector(".pcode"); pdesc = tr.querySelector(".pdesc"); pval = tr.querySelector(".pval"); // Use them... }

http://stackoverflow.com/comment/38531690
has text: if something is saved into DB, use php to pre-select a option from the and also use php to pre-fill the input with the saved vat
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24804061

http://stackoverflow.com/q/24880182
has body: I should suppose to flatten a object, to do this I use this function: var flatter = function(ob){ var f = {}; for(var i in ob) { if(typeof ob[i] == 'object') { var newOb = flatter(ob[i]); for(var x in newOb) { f[i+'.'+x] = newOb[x]; } }else{ f[i] = ob[i]; } } return f; } works fine. I am getting proper result to applying this object: var ob = { "address" : { "details" : { "first" : "siva", "last" : "sankara", "mam":["mam1","mam2"] } } }; the result is : reslut : Object {address.details.first: "siva", address.details.last: "sankara", address.details.mam.0: "mam1", address.details.mam.1: "mam2"} But I am not able to understand the result how i am getting. I understand that, this is oriented with recursion and closure scope - But seaching google I am not get any clear tutorial or article. Any one help me to understand this my step by step please? Here is the live demo Thanks In advance!
has title: Not able to understand ` recursion and closure scope` on this flattening object
has answer: http://stackoverflow.com/a/24880309
tagged with: recursion
tagged with: object
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24880309
accepted answer: http://stackoverflow.com/a/24880601
type: Question
answer count: 2
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/24880601

http://stackoverflow.com/comment/38615187
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24864694
has text: Where are your events being declared?
score: 0

http://stackoverflow.com/comment/53205513
has text: @user1655734 The answer was not wrong, but it did not point out any pitfalls or edge cases. I have expanded the answer now to give greater detail.
comment on: http://stackoverflow.com/a/24813338
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38619436
type: Comment
type: AnswerComment
has text: @North. Yes, but the overengineering is to answer the original post about the module pattern. I'll add a comment about that.
comment on: http://stackoverflow.com/a/24864763
score: 0

http://stackoverflow.com/comment/38641282
type: Comment
type: QuestionComment
has text: Yes, it's all inside a $(document).ready
comment on: http://stackoverflow.com/q/24878285
score: 0

http://stackoverflow.com/comment/38510337
has text: Works like magic! although I don't understand much of the new code
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24809295

http://stackoverflow.com/comment/38681975
type: AnswerComment
comment on: http://stackoverflow.com/a/24899762
type: Comment
has text: Then use html parser.
score: 0

http://stackoverflow.com/comment/38420304
type: QuestionComment
has text: This question is either a duplicate of [Why does jQuery or a DOM method such as getElementById not find the element?](http://stackoverflow.com/q/14028959/218196) or [jsFiddle: no connection between html and js? Can't call simple function from button?](http://stackoverflow.com/q/14499783/218196) (or both)
score: 0
comment on: http://stackoverflow.com/q/24761344
type: Comment

http://stackoverflow.com/q/24861435
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has title: ajax: extract json object from array of json
type: Question
score: 0
has answer: http://stackoverflow.com/a/24861548
has answer: http://stackoverflow.com/a/24861487
has answer: http://stackoverflow.com/a/24861512
accepted answer: http://stackoverflow.com/a/24861487
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38609096
tagged with: ajax
has comment: http://stackoverflow.com/comment/38609042
has comment: http://stackoverflow.com/comment/38609025
answer count: 3
tagged with: php
has body: JSON (inside array from api): [{"id":"001", "name":"john", "age":"40"}, {"id":"002", "name":"jane", "age":"30"}] Ajax: $.ajax({ url: 'interface_API.php', dataType: 'json', success: function(data) { for(var i in data){ var row = data[i]; var id = row[0]; var name = row[1]; var age = row[2]; $('#output').append("&lt;tr width='50%'&gt;&lt;td&gt;"+id+"&lt;/td&gt;&lt;td&gt;"+name+"&lt;/td&gt;&lt;td&gt;"+age+"&lt;/td&gt;&lt;/tr&gt;"); } } }); The API uses this to construct: if(mysqli_num_rows($output)){ while($row = mysqli_fetch_assoc($output)){ $json[] = $row; } } However my Output is 'undefined' repeated for each .append How do i extract each json object from the array &amp; append to the page?
possible better answer: http://stackoverflow.com/a/24861512

ruby-on-rails-4
type: Tag
tags question: http://stackoverflow.com/q/24853024
tags question: http://stackoverflow.com/q/24836006
tags question: http://stackoverflow.com/q/24879598
tags question: http://stackoverflow.com/q/24873314
tags question: http://stackoverflow.com/q/24898152
tags question: http://stackoverflow.com/q/24844986
tags question: http://stackoverflow.com/q/24815428
tag name: ruby-on-rails-4

http://stackoverflow.com/q/24867176
answer count: 3
favorite count: 0
has answer: http://stackoverflow.com/a/24867465
score: 6
downvote count: 1
tagged with: phantomjs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24867291
has comment: http://stackoverflow.com/comment/38620767
accepted answer: http://stackoverflow.com/a/24867465
has body: I am trying out phantomJS for the first time and i have successfully extracted som data from a site, but when i try to write some content to a file i get the error: ReferenceError: Can't find variable: fs Here is my script var page = require('webpage').create(); var fs = require('fs'); page.onConsoleMessage = function(msg) { console.log(msg); }; page.open("http://www.pinterest.com/search/pins/?q=motorbike", function(status) { if (status === "success") { page.includeJs("http://code.jquery.com/jquery-latest.js", function() { page.evaluate(function() { var imgs = { title: [], href: [], ext: [], src: [], alt: [] }; $('a.pinImageWrapper').each(function() { imgs.title.push($(this).attr('title')); imgs.href.push($(this).attr('href')); var ext = $(this).children('.pinDomain').html(); imgs.ext.push(ext); var img = $(this).children('.fadeContainer').children('img.pinImg'); imgs.src.push(img.attr('src')); imgs.alt.push(img.attr('alt')); }); if (imgs.title.length &gt;= 1) { for (var i = 0; i &lt; imgs.title.length; i++) { console.log(imgs.title[i]); console.log(imgs.href[i]); console.log(imgs.ext[i]); console.log(imgs.src[i]); console.log(imgs.alt[i]); } } else { console.log('No pins found'); } fs.write('foo.txt', 'bar'); }); phantom.exit(); }); } }); What am i missing out here? Edit: Of the response on this question i learned why i couldnt reach the data inside the evalute, and how i could access it. var page = require('webpage').create(); var fs = require('fs'); page.onConsoleMessage = function(msg) { console.log(msg); }; openPinPage('motorbike'); function openPinPage(keyword) { page.open("http://www.pinterest.com/search/pins/?q=" + keyword, function(status) { if (status === "success") { page.includeJs("http://code.jquery.com/jquery-latest.js", function() { getImgsData(); }); } }); } function getImgsData() { var data = page.evaluate(function() { var imgs = { title: [], href: [], ext: [], src: [], alt: [] }; $('a.pinImageWrapper').each(function() { imgs.title.push($(this).attr…
upvote count: 7
type: Question
possible better answer: http://stackoverflow.com/a/24867291
has title: PhantomJS Issue writing to file fs. Can't find variable: fs
tagged with: javascript
has answer: http://stackoverflow.com/a/24867390

http://stackoverflow.com/q/24807635
tagged with: delegates
upvote count: 1
has body: I was troubleshooting an issue I was having with some $(".foo").click(function(){...you get the point...}); events no longer working when I loaded content through .load(). I found something that got me through the issue here: jQuery, how to rebind html-elements after .load() One of the comments there suggested delegation was being used incorrectly, and mentioned the "OP concept of delegation". I'd like to understand the problem with delegation a little better instead of just plowing through the fix and moving on. Can someone explain or point to reference articles that explain the concepts of delegation in javascript and what the "OP concept of delegation is"? Google wasn't very helpful. EDIT: OP as "Original Poster" totally makes sense after you guys pointed that out, hard to see how I missed that now. So with that out of the way, still looking for a good reference for delegation in javascript.
linked to: http://stackoverflow.com/q/1687296
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38509522
favorite count: 0
type: AnsweredQuestion
downvote count: 0
score: 1
linked to: http://stackoverflow.com/q/16001638
type: Question
has title: What is the "OP concept of delegation" and how does it compare to other delegation concepts?
has comment: http://stackoverflow.com/comment/38507122
has answer: http://stackoverflow.com/a/24807978
accepted answer: http://stackoverflow.com/a/24807978

http://stackoverflow.com/q/24842036
score: 1
possible better answer: http://stackoverflow.com/a/24843392
upvote count: 1
has answer: http://stackoverflow.com/a/24843392
type: Question
tagged with: c#
has answer: http://stackoverflow.com/a/24851612
has title: How to get asp:Table cell values using Javascript?
has body: In my aspx file, I define an asp:table like below. I want to get its cell contents using Javascript. How can I do that? test.aspx &lt;asp:Table ID="tableID" runat="server"&gt; &lt;asp:TableRow&gt; &lt;asp:TableCell&gt; &lt;asp:Label runat="server"&gt;&lt;/asp:Label&gt; &lt;/asp:TableCell&gt; &lt;asp:TableCell&gt; &lt;asp:TextBox runat="server"&gt;&lt;/asp:TextBox&gt; &lt;/asp:TableCell&gt; &lt;/asp:TableRow&gt; &lt;asp:TableRow&gt; &lt;asp:TableCell&gt; &lt;asp:Label runat="server"&gt;&lt;/asp:Label&gt; &lt;/asp:TableCell&gt; &lt;asp:TableCell&gt; &lt;asp:TextBox runat="server"&gt;&lt;/asp:TextBox&gt; &lt;/asp:TableCell&gt; &lt;/asp:TableRow&gt; &lt;/asp:Table&gt; Javascript part in test.aspx &lt;script type="text/javascript"&gt; function GetCellContents() { var table = document.getElementById('&lt;%=tableID.ClientID %&gt;'); //HERE I WANT TO GET CELL CONTENTS AS ARRAY OF STRING } &lt;/script&gt;
tagged with: javascript
has comment: http://stackoverflow.com/comment/38590153
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/38571851
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/38571940
accepted answer: http://stackoverflow.com/a/24851612
type: AnsweredQuestion

http://stackoverflow.com/comment/38591907
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/24852288
has text: @tillz: semicolons are optional in JavaScript, though their omission can cause unexpected problems sometimes.

http://stackoverflow.com/q/24836760
has comment: http://stackoverflow.com/comment/38562538
accepted answer: http://stackoverflow.com/a/24837228
possible better answer: http://stackoverflow.com/a/64110372
has answer: http://stackoverflow.com/a/64110372
has body: I have following script in my page to highlight a map. &lt;script&gt; function highlight(list,win,lose) { var WinParty = win; var LoseParty = lose; var jsVariable = list; var area = document.getElementsByTagName('area') var ary=[] for (var zxc0=0;zxc0&lt;area.length;zxc0++){ ary.push(area); } var isfound = false; for(var i = 0; i &lt; area.length; i++) { isfound = false; for(var j = 0; j &lt; jsVariable.length; j++) { if (area[i].getAttribute('title').trim() == jsVariable[j].trim()) { isfound = true; $(area[i]).each(function ()//get all areas { $(this).addClass("victory"); }); } } if(!isfound) { $(area[i]).each(function ()//get all areas { $(this).addClass("lose"); }); } } $(function () { var data = {}; $('.map').maphilight(); data.alwaysOn = true; data.fillColor = WinParty; $('.victory').data('maphilight', data).trigger('alwaysOn.maphilight'); var data = {}; $('.map').maphilight(); data.alwaysOn = true; data.fillColor = LoseParty; $('.lose').data('maphilight', data).trigger('alwaysOn.maphilight'); }); } &lt;/script&gt; I am calling this script from Code Behind (VB.Net) as follows Dim Serializer = New System.Web.Script.Serialization.JavaScriptSerializer() Dim List = Serializer.Serialize(Values) WinPartyColor = Hex(Color.Blue.ToArgb()).Substring(2) LosePartyColor = Hex(Color.Red.ToArgb()).Substring(2) Dim Script As String = String.Format("highlight({0},{1},{2});", List, WinPartyColor, LosePartyColor) ScriptManager.RegisterStartupScript(ElectionResultUpdatePanel, ElectionResultUpdatePanel.GetType(), "HighLighting", Script, True) When i'm running above code in Chrome i'm getting error as Uncaught SyntaxError: Unexpected identifier but when i run same code in IE, getting error as SCRIPT1007: Expected ']'. My guess is about List argument, which is array in Javascript. Please help me out.
has comment: http://stackoverflow.com/comment/38562391
tagged with: vb.net
type: AnsweredQuestion
has title: Uncaught SyntaxError: Unexpected identifier IN Chrome
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/24837228
tagged with: function
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/38562514

http://stackoverflow.com/comment/38607819
comment on: http://stackoverflow.com/a/24860657
has text: umm actually I want to achieve this using javascript only... thanks for your response though :)
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/24764488
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
tagged with: css
type: AnsweredQuestion
has title: I want to close an open menu li onclick of the child element
score: 1
upvote count: 1
has body: My jQuery code works, but I want to close the child ul only if I click on it (the child ul); right now it is closing when I click the parent li as well. How can I fix this behavior? http://jsfiddle.net/c4k5w/2/ $(document).ready(function(){ $("ul&gt;li").click(function(){ var lk=$(this).text(); var w=$("ul li:contains('"+lk+"')").width(); $("ul li").removeClass("h"); $("ul li:contains('"+lk+"')").addClass("h"); if(w&gt;200){var a=1;$("ul li").removeClass("h");}else{var a=0;} if(a==1){ $("ul li:contains('"+lk+"') ul").hide(function(){ $("ul li:contains('"+lk+"')").animate({width:"200px"},"fast"); }); }else{ $("ul li ul").hide(); $("ul&gt;li").animate({width:"200px"},"fast"); $("ul li:contains('"+lk+"')").animate({width:"1200px"},"fast",function(){ $("ul li:contains('"+lk+"')&gt;ul").slideDown(); }); } }); });
type: Question
has answer: http://stackoverflow.com/a/24764720
accepted answer: http://stackoverflow.com/a/24764720
downvote count: 0

http://stackoverflow.com/q/24874636
score: 0
answer count: 1
tagged with: javascript
has title: window.oper, window.addEventListener, window.attachEvent in conditional statement
has answer: http://stackoverflow.com/a/24887278
tagged with: client-side
type: UnansweredQuestion
type: Question
tagged with: dom
has body: I'm having a hard time figuring out what those lines do. I'm following the tutorial below. My guess is that window.oper is mistyped and would be window.open. Open, addEventListener and attachEvent as far as I know are functions or methods not properties. Although I use Javascript a lot, I know very little. if (window.oper || (!window.addEventListener &amp;&amp; !window.attachEvent)) { return false; } http://www.script-tutorials.com/custom-scrollbars-cross-browser-solution/ .

http://stackoverflow.com/comment/38578325
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24842710
type: AnswerComment
has text: Take 2: Christian, you were totally right! What I was missing is the binding of the Template to the _lat & _lon objects - which was also pointed out by Slava Kim (meteor google group). It's totally working now.

http://stackoverflow.com/comment/38588992
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24851074
type: Comment
has text: Why are you using a GET request? GET requests have a length limit (which may or may not be the problem here), and don't semantically match up with "saving" something. Use a POST request and see if the same problem still happens

http://stackoverflow.com/q/24749467
has answer: http://stackoverflow.com/a/24754298
type: UnansweredQuestion
tagged with: maps
has body: I'm trying to draw a line on a Leaflet map given a position in WGS84 coordinates, a length, and a direction angle in degrees. Here is my JavaScript code: var map = L.map('map').setView([49.41611,2.06806], 15); L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png').addTo(map); var lat = 49.41611; var lng = 2.06806; var deg = 220; var len = 0.3; deg = (deg / 360) * (Math.PI * 2); L.polyline([ [lat, lng], [lat + len * Math.cos(deg), lng + len * Math.sin(deg)] ]).addTo(map); The problem is that when I change the "len" variable to something else, the visible direction of the line changes. With "len = 0.3": With "len = 100": Is there some problem with my calculation method? With floating point? How can I solve that?
has title: Why does the direction of this line changes when I make it longer?
tagged with: leaflet
tagged with: math
type: Question
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38397817

http://stackoverflow.com/q/24815220
has answer: http://stackoverflow.com/a/24876782
has comment: http://stackoverflow.com/comment/38544812
has comment: http://stackoverflow.com/comment/38567507
tagged with: handlebars.js
has comment: http://stackoverflow.com/comment/38545395
has title: Handlebars template not rendering info on iOS7 Safari
has comment: http://stackoverflow.com/comment/38545702
has comment: http://stackoverflow.com/comment/38564164
has comment: http://stackoverflow.com/comment/38548381
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38545468
has comment: http://stackoverflow.com/comment/38526254
has comment: http://stackoverflow.com/comment/38548396
has comment: http://stackoverflow.com/comment/38544791
tagged with: coffeescript
has comment: http://stackoverflow.com/comment/38545070
has comment: http://stackoverflow.com/comment/38544983
type: Question
accepted answer: http://stackoverflow.com/a/24876782
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38545044
has comment: http://stackoverflow.com/comment/38548434
score: 0
has comment: http://stackoverflow.com/comment/38544660
has comment: http://stackoverflow.com/comment/38597323
has comment: http://stackoverflow.com/comment/38544838
has body: I am currently in charge of an Backbone/Handlebars/Coffeescript site; m.bachcare.co.nz The site seems to be going well except for a bug on iOS7 not showing some property rates in the availability tab on a certain month. The data is not corrupt, and logs seem to show it being parsed from JSON correctly. No other errors. That is on Bachwood in September: http://m.bachcare.co.nz/property/2988 The code for the Calendar in Handlebars is: {{log month}} {{#calendarDays month currentAvailability currentRates specials selectedDates.start selectedDates.end calendarEnd minDate type}} {{#if isStartOfWeek}} {{/if}} {{log rate}} <div class=" avail-calendar-date {{#if currentRates.length}} {{#if_eq rate compare=0}}{{#if isInMonth}}avail-calendar-date-no-rate {{/if}}{{/if_eq}} {{#if isSpecial}}avail-calendar-date-special {{/if}} {{/if}} {{#if currentAvailability.length}} {{#unless isInPast}}{{#if isInMonth}}{{#if isAvailable}}avail-calendar-date-available {{else}}avail-calendar-date-unavailable {{/if}}{{/if}}{{/unless}} {{/if}} {{#if isDisabled}}avail-calendar-date-disabled {{/if}} {{#if isSelected}}avail-calendar-date-selected {{/if}} {{#if isToday}}avail-calendar-date-today {{/if}} {{#if isInPast}}avail-calendar-date-past {{/if}} {{#if isInFuture}}avail-calendar-date-future {{/if}} {{#unless isInMonth}}avail-calendar-date-skirt {{/unless}}" data-date="{{formatDate date 'YYYY-MM-DD'}}"> {{#if isInMonth}} {{#if isToday}} Today {{else}} {{formatDate date 'D'}} {{/if}} {{/if}} {{#if isInMonth}} {{#if rate}}{{#unless_eq rate compare=0}} ${{rate}} {{/unless_eq}} {{else}} {{#if_eq type compare="checkout"}} {{#if isCheckIn}} checkin {{/if}} {{/if_eq}} {{#if_eq type compare="checkout"}} {{#if isCheckOut}} checkout {{/if}} {{/if_eq}} {{/if}} {{/if}} {{#if isEndOfWeek}} {{/if}} {{/calendarDays}} I will post any other code requested.
has comment: http://stackoverflow.com/comment/38535769
has comment: http://stackoverflow.com/comment/38544477
has comment: http://stackoverflow.com/comment/38561281
has comment: http://stackoverflow.com/comment/38544497
tagged with: backbone.js

http://stackoverflow.com/a/24907664
has body: your chrome.tabs.query is executed on very session start, and sending message in that moment...you need to wrap it in some event like chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { if (tab.url == "http://www.myurl.com") { chrome.tabs.sendMessage(tab.id, {greeting: "hello"}, function(response) { console.log("Response"); }); } }); and actually you don't need tabs.querry...you got ID from chrome.tabs.onUpdated listener to send msg
score: 0
answers question: http://stackoverflow.com/q/24902443
type: Answer

http://stackoverflow.com/comment/38644634
has text: @ Chips_100,@ David,thank you both.Using typeof get a function returned,so getNodeById is really a method of tree store.Where I was wrong was ,server side haven't pass the node info to the client due to json format error,so this.getNodeById("1") really get undefined node,then get("name") incur error .It seemed error message is not quite accurate at the point where it occurs.
comment on: http://stackoverflow.com/q/24879624
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38503165
score: 0
comment on: http://stackoverflow.com/q/24771941
has text: No. It would help if you could provide a complete example.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/42121188
score: 2
type: AnswerComment
has text: The question was how to get Code coverage for Jest. That Istanbul and Jest don't work together might be true, but that doesn't answer the question.
type: Comment
comment on: http://stackoverflow.com/a/26770102

http://stackoverflow.com/q/24827165
has title: Is there way to throw an exception from an expression besides using functions?
has comment: http://stackoverflow.com/comment/38544833
tagged with: expression
has comment: http://stackoverflow.com/comment/38544318
has comment: http://stackoverflow.com/comment/38544565
linked to: http://stackoverflow.com/q/9370606
type: Question
answer count: 2
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/34288175
has comment: http://stackoverflow.com/comment/38543943
score: 0
has body: Is there a way to explicitly throw an exception from an expression in JavaScript besides placing that throw a function wrapper? throw is a statement, statements don't produce values, thus they cannot be used in expressions which operate on values and always produce a value. It's quite obvious that any statement can be put to a function and a function call can be used from the expression. Is there a way to avoid wrapping the throw statement to a function and throw from the expression directly? UPDATE: Some people say it's not quite clear what I am asking about. Consider a hypothetical example (not for real), this is something I wish worked, but it doesn't: var one = value != null ? value * value : (throw new Error('The value has not been provided')); var two = value != 0 ? 1 / value : (throw new Error('The result cannot be evaluated because the value is zero which would give a division by zero problem.));
tagged with: statements
has answer: http://stackoverflow.com/a/24827601
has comment: http://stackoverflow.com/comment/38544244
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38544017
upvote count: 1
has comment: http://stackoverflow.com/comment/38543972
downvote count: 1

http://stackoverflow.com/comment/38443337
type: QuestionComment
score: 0
has text: See if this post solves your problem:http://stackoverflow.com/questions/8295394/dynamically-change-the-src-of-a-script-tag
comment on: http://stackoverflow.com/q/24773877
type: Comment

http://stackoverflow.com/comment/38527489
has text: First of all, thank you for taking the time to answer my question. Although I am not looking for how to animate the pictures inside of the canvas, I am merely looking for a way to make the canvas work like it is now. Could you give me any insight in that?
score: 1
comment on: http://stackoverflow.com/a/24807425
type: AnswerComment
type: Comment

http://stackoverflow.com/q/24811645
tagged with: google-api-nodejs-client
score: 6
has answer: http://stackoverflow.com/a/34298192
upvote count: 6
answer count: 4
tagged with: node.js
has comment: http://stackoverflow.com/comment/38544679
has body: Can you rename files in Google Cloud Storage? I am letting users upload photos, but I want to give them the ability to edit the photo, at least by changing the name they uploaded it with. I am using Javascript through Node.js. Thanks!
tagged with: google-cloud-storage
has comment: http://stackoverflow.com/comment/38517502
has answer: http://stackoverflow.com/a/75179499
type: Question
has title: renaming files in Google Cloud Storage?
tagged with: javascript
has answer: http://stackoverflow.com/a/75179781
has answer: http://stackoverflow.com/a/24812020
tagged with: google-cloud-platform
downvote count: 0
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/24865961
has answer: http://stackoverflow.com/a/24934956
has title: WinForm : How to load rad autocomplete textbox from database with text and value in a block
type: Question
tagged with: c#
tagged with: java
tagged with: javascript
score: 0
has body: I have a code like this: public void LoadDiseaes() { da.OpenConnection(); Disease disease = new Disease(da); txtDisease.AutoCompleteDataSource = disease.GetAll(); txtDisease.AutoCompleteDisplayMember ="DiseaseName"; txtDisease.AutoCompleteValueMember ="ID"; } Initially, I have used above code to bind autocomplete textbox(txtDisease) with its Datasource. `````````````````````````````````````````````````````````````````````````````````````` Then, after I selected particular disease and saved the record. This work fine. My question is that when I want update that record I want to populate my AutoComplete(txtDisease) with the Disease from the Database with its Text and Value in a block which I have selected during saving the record but it gives me only a text and not value in background.
answer count: 1
tagged with: jquery
tagged with: asp.net
type: UnansweredQuestion

http://stackoverflow.com/q/24837711
type: Question
type: AnsweredQuestion
score: 1
has body: I have a form whose value get stored in the database on click of submit button. Also there are 4 fields whose data is to be displayed into the struts2-jquery-grid. I first used a temporary table to save values and display those values in the grid. But this approach isn't correct as the values remain in the table even if the user doesn't click on submit. So is there a way to temporary store the data of 4 fields into the array and display in the grid and then when user submits the data the values from the array(grid) are stored into the database.
answer count: 1
downvote count: 0
tagged with: jsp
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: struts2
tagged with: actioncontext
has answer: http://stackoverflow.com/a/24837864
linked to: http://stackoverflow.com/q/24783219
has comment: http://stackoverflow.com/comment/38565418
has comment: http://stackoverflow.com/comment/38563620
has title: How to add data in JavaScript and bind it to jQuery grid
linked to: http://stackoverflow.com/q/17251730
upvote count: 1
accepted answer: http://stackoverflow.com/a/24837864

http://stackoverflow.com/comment/38494686
score: 3
type: AnswerComment
type: Comment
has text: then it would select "123Special Text!!!abcd" as well, if it is implemented in one of the h4s!
comment on: http://stackoverflow.com/a/24801098

http://stackoverflow.com/comment/38680676
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/24899230
has text: Are you working in the browser, in nodejs, or some other environment? My initial thought is just to read it in from a file rather than as a string literal, but the details of how to do that vary depending on the environment you're in.

http://stackoverflow.com/comment/38635911
type: Comment
comment on: http://stackoverflow.com/q/24875414
score: 2
type: QuestionComment
has text: Seems like you want it to fire a separate onclick handler that checks the number of items, and if there is only one, calls addActivityItem.

http://stackoverflow.com/q/24896696
tagged with: css
answer count: 4
has comment: http://stackoverflow.com/comment/38675801
has answer: http://stackoverflow.com/a/24896721
has answer: http://stackoverflow.com/a/24896796
upvote count: 1
downvote count: 1
type: Question
has title: How do you hide the first element in the first table?
has answer: http://stackoverflow.com/a/24896821
has answer: http://stackoverflow.com/a/73166419
score: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has body: I know that to hide the first element in a table is simply do (':first-child') but is there a way to specify that only the first element of the first TABLE needs to be removed? In my situation the first element of every table is being hidden and I need to fix this.

http://stackoverflow.com/q/24829135
type: Question
tagged with: javascript
tagged with: groovy
tagged with: abstract-syntax-tree
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has title: Abstract Syntax Tree generator for javascript, but available in groovy?
score: 2
answer count: 0
upvote count: 2
has body: I was using the esprima AST generator for javascript and using node.js. It works great! Now I need to process the resultant json and would really like to use groovy - I have used groovy for this very successfully in the past. I could use two passes (first use node to create the json files and then use a groovy script to process them). However, given the large number of files I will be processing it is preferable to me to use groovy entirely. Does anyone know if a AST generator for javascript is available in either Java or groovy? Google searches were fruitless for me - way too many hits! [Afterthought: If node.js is callable from groovy, then I would need a really good set of directions on how that might be made to work!]

http://stackoverflow.com/q/24857544
linked to: http://stackoverflow.com/q/8817394
has answer: http://stackoverflow.com/a/24857693
has title: retrieving the value of object using strings
score: 1
has answer: http://stackoverflow.com/a/24857712
upvote count: 1
type: Question
tagged with: object
has body: Here I am in a situation where I have to work only with strings, and because of this I also have to retrieve the value of an object from strings, in short: to retrieve the value from an object we write: someObject.property1.name // for say but in my case i want to retrieve value from an object using string, i.e 'someObject.property1.name' // for say since I was not so confident that I could do this, so I preferred tho search on internet and the most suitable solution which I got was #1 Object.byString = function(o, s) { s = s.replace(/\[(\w+)\]/g, '.$1'); // convert indexes to properties s = s.replace(/^\./, ''); // strip a leading dot var a = s.split('.'); while (a.length) { var n = a.shift(); if (n in o) { o = o[n]; } else { return; } } return o; } from here #2 var deep_value = function(obj, path){ for (var i=0, path=path.split('.'), len=path.length; i&lt;len; i++){ obj = obj[path[i]]; }; return obj; }; from here but as I said they are the most suitable example because they all are taking one extra parameter i.e. obj, O and so on... which is creating trouble for me, so I tried to improve the above code in search 2 because it is compact, and that results in failure. That code is: var obj = { foo: { bar: 'baz' } }; var deep_value = function(path){ var obj = path.split('.'); obj = obj[0]; for (var i=0, path=path.split('.'), len=path.length; i&lt;len; i++){ obj = obj[path[i+1]]; }; return obj; }; alert(deep_value('obj.foo.bar')); (I edited in his code for just an experiment). the above code does not need obj which is a perfect code - if it worked - and don't see any mistake, then why this code is not working, what is the correct code? JSFIDDLE thanks in advance
linked to: http://stackoverflow.com/q/6491463
tagged with: javascript
has comment: http://stackoverflow.com/comment/38601956
accepted answer: http://stackoverflow.com/a/24857693
answer count: 2
downvote count: 0
tagged with: string
favorite count: 0
has comment: http://stackoverflow.com/comment/38601887
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24857712

http://stackoverflow.com/a/24908861
has body: I suggest: Pass that list with the jquery.post() function and save it in the SESSION array. Open a new tab with the same file/address/URL with the window.open() function. Retrieve saved data from the SESSION array. This seems straightforward and clean to me.
type: AcceptedAnswer
downvote count: 1
has comment: http://stackoverflow.com/comment/125279882
upvote count: 18
type: Answer
answers question: http://stackoverflow.com/q/24908686
has comment: http://stackoverflow.com/comment/38698303
accepted answer of: http://stackoverflow.com/q/24908686
score: 17

http://stackoverflow.com/comment/124197188
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24790932
has text: how to enable light debug to see which direction it has??
score: 1

http://stackoverflow.com/a/24846409
downvote count: 0
answers question: http://stackoverflow.com/q/24844061
type: Answer
score: 1
upvote count: 1
has body: Okay, didn't catch this before but it's module.exports not exports.module That should fix it. Also, I don't believe your file references need a / before them.
accepted answer of: http://stackoverflow.com/q/24844061
type: AcceptedAnswer

http://stackoverflow.com/comment/38540415
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24825113
score: 0
has text: @dystroy does IE8 indexOf not supports indexOf()?

http://stackoverflow.com/q/24846089
has answer: http://stackoverflow.com/a/24846110
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
answer count: 5
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24846166
tagged with: css
has body: Given this code: There are 4 rows to type. However, how would you apply CSS to disable another row when a user presses enter or when the text overflows to the 5th row?
score: 2
type: Question
has answer: http://stackoverflow.com/a/24846137
has title: How do you restrict the number of rows in a ?
has answer: http://stackoverflow.com/a/24846156
tagged with: javascript
has answer: http://stackoverflow.com/a/24849597
upvote count: 2

http://stackoverflow.com/comment/38516605
score: 0
has text: i think "spacing between the ` `" implies that line height is not the issue - changing line height would change the height of every line *inside* the ` `
comment on: http://stackoverflow.com/a/24812595
type: Comment
type: AnswerComment

http://stackoverflow.com/a/24791377
type: Answer
has comment: http://stackoverflow.com/comment/38505856
has body: Rather than a while loop that fires off a ton of requests with no guaranteed finishing order or even finishing - wait until they finish, increment your counter, and if needed - call again: ajax(0); function ajax(i) { $.get("counter.html").done(function(data2) { var $html = $("&lt;div&gt;").html(data2); var str = json.affiliates[i]; $html.find("#coupon").html(str.affiliate_name); $html.find("#coupon_id").html(str.affiliate_id); $(".col-sm-4").append($html); if (i &lt; n) ajax(++i) }); }
answers question: http://stackoverflow.com/q/24791310
score: 0

http://stackoverflow.com/q/24849540
tagged with: angularjs
type: UnansweredQuestion
has title: Angular list/detail view
has body: I'm fairly new to Angular and I'm wondering how to go about creating a list/detail view using Angular routes as what I currently have doesn't seem to be working. The app has a list of 'projects' and when you click on a project you see a detailed view of that selected project, standard stuff. I've got this working using ng-switch but ideally I want to use seperate routes for the list/detail views. I've read that for this I'm going to need to use a factory method but I'm having difficulty passing the selected data between the routes. Here's what I have: app.factory('Project', [ function ($rootScope) { var _selectedProject = {}; _selectedProject.project = {}; return _selectedProject; }]); app.controller('GalleryController', ['$scope', function ($scope, _selectedProject) { $scope.sharedProject = _selectedProject || {}; $scope.selectProject = function (proj) { _selectedProject.project = proj; }; $scope.$watch('sharedProject', function (proj) { $scope.chosenProject = proj; }) }]); I'm actually getting cannot set property 'property' of undefined which is inside $scope.selectedProject.
has comment: http://stackoverflow.com/comment/38586156
has answer: http://stackoverflow.com/a/24849870
has answer: http://stackoverflow.com/a/24850323
tagged with: angularjs-scope
type: Question
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/38586444
has comment: http://stackoverflow.com/comment/38586557
score: 0

http://stackoverflow.com/comment/69805155
comment on: http://stackoverflow.com/q/24791713
score: 0
type: QuestionComment
type: Comment
has text: I totally disagree with closing this question. OPs question is clear. If you don't understand the question it's because you don't want to understand the question, as it is clear what the OP wants. And the answers did not have to be full code, could have just as well be logic to send the OP in the correct direction. Giving code is the answerers choice. "too many possible answers"... ? really? Please UPVOTE this question, it deserves it!!... IMHO

http://stackoverflow.com/q/24790358
tagged with: php
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24790415
has answer: http://stackoverflow.com/a/24790413
accepted answer: http://stackoverflow.com/a/24790413
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/24790444
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/24790415
answer count: 3
has comment: http://stackoverflow.com/comment/38475199
tagged with: jquery
has comment: http://stackoverflow.com/comment/38475226
favorite count: 0
has body: what is the error here : .done(function(data) { var json = JSON.parse( data ); if(json['status'] === "success"){ //some processing } else { alert( "error 2" ); } }) I got the error message on: var json JSON.parse('('+data+')') data is returned from a php script : /*...............*/ $sql-&gt;execute(); $i = 0; while($result = $sql-&gt;fetch(PDO::FETCH_ASSOC){ $response["affiliates"][i]["affiliate_name"] = $result["coupon_name"]; $response["affiliates"][i]["affiliate_id"] = $result["coupon_id"]; $i++; } $response["status"] = "success"; echo json_encode($response);
has title: JSON error : SyntaxError: JSON.parse: unexpected character at line 2 column 1 of the JSON data

http://stackoverflow.com/comment/38463471
comment on: http://stackoverflow.com/a/24784292
score: 0
type: AnswerComment
has text: @Alexander : check the updated answer.. u got it now?
type: Comment

http://stackoverflow.com/comment/38608398
type: Comment
type: QuestionComment
has text: Because he doesn´t want to support IE users maybe?
comment on: http://stackoverflow.com/q/24861073
score: 0

http://stackoverflow.com/comment/38441129
comment on: http://stackoverflow.com/a/24761284
type: AnswerComment
score: 0
type: Comment
has text: This method works, but it opens the text in a new page as document.write automatically utilises document.open, is it possible to write the text in the same page?

http://stackoverflow.com/comment/38566821
type: AnswerComment
score: 0
type: Comment
has text: the ajax call should return a response object, a property of which will be the response data.
comment on: http://stackoverflow.com/a/24839371

http://stackoverflow.com/comment/38618795
comment on: http://stackoverflow.com/q/24866448
score: 0
type: Comment
type: QuestionComment
has text: i mean `attachments` parameter arrive to the function equal null @epascarello

http://stackoverflow.com/comment/38502885
type: Comment
type: QuestionComment
has text: @KunalB.: it seems so, given the OP's pseudo-code.
comment on: http://stackoverflow.com/q/24805250
score: 0

http://stackoverflow.com/comment/38510435
type: Comment
comment on: http://stackoverflow.com/a/24808616
has text: The window doesn't close when the timer ends
score: 0
type: AnswerComment

http://stackoverflow.com/q/24772208
has comment: http://stackoverflow.com/comment/38440812
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/38440281
has comment: http://stackoverflow.com/comment/38440381
has answer: http://stackoverflow.com/a/31174891
has comment: http://stackoverflow.com/comment/38441064
downvote count: 0
tagged with: webrtc
tagged with: javascript
score: 1
has answer: http://stackoverflow.com/a/24772829
has comment: http://stackoverflow.com/comment/38440883
favorite count: 0
has comment: http://stackoverflow.com/comment/38442407
has comment: http://stackoverflow.com/comment/38440675
possible better answer: http://stackoverflow.com/a/31174891
has body: I am studying tutorial of codelab at https://bitbucket.org/webrtc/codelab/src/50a47bb092483fd7ca27998a365dff434919bf89?at=master I've never used node.js before and wondering what this means under the "Running The Examples" section. I've installed node.js and installed which was straightforward but when I type: node server.js and I get node: Command not found. I am at below directory.and under that step6 directory, there is server.js exist. xxxx@xxxx:/Users/xxxx/webrtc-codelab-50a47bb09248/complete/step6&gt; could anyone help with how node.js works? Below is what i get when i type /usr/local/bin/node server.js under the same directory.. module.js:340 throw err; ^ Error: Cannot find module 'node-static' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.&lt;anonymous&gt; (/Users/danielle/webrtc-codelab-50a47bb09248/complete/step6/server.js:1:76) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) This is what I got when I did npm install -g node-static npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/node-static' npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/node-static'] npm ERR! errno: 3, npm ERR! code: 'EACCES', npm ERR! path: '/usr/local/lib/node_modules/node-static', npm ERR! fstream_type: 'Directory', npm ERR! fstream_path: '/usr/local/lib/node_modules/node-static', npm ERR! fstream_class: 'DirWriter', npm ERR! fstream_stack: npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23', npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53', npm ERR! 'Object.oncomplete (fs.js:107:15)' ] } npm ERR! npm ERR! Please try running this command again as root/Administrator. npm ERR! System Darwin 13.3.0 npm ERR!…
has comment: http://stackoverflow.com/comment/38440775
has comment: http://stackoverflow.com/comment/38440265
tagged with: node.js
has comment: http://stackoverflow.com/comment/38440302
has comment: http://stackoverflow.com/comment/38440252
has comment: http://stackoverflow.com/comment/38440602
accepted answer: http://stackoverflow.com/a/24772829
has comment: http://stackoverflow.com/comment/38441271
has title: how do I execute "node server.js" in codelab?
upvote count: 1
has comment: http://stackoverflow.com/comment/38442986
has comment: http://stackoverflow.com/comment/38440839
has comment: http://stackoverflow.com/comment/38440592
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38441286
has comment: http://stackoverflow.com/comment/38440827
has comment: http://stackoverflow.com/comment/38446769
has comment: http://stackoverflow.com/comment/38440223

http://stackoverflow.com/a/24842030
downvote count: 0
score: 1
upvote count: 1
has body: &lt;script&gt; var index = 0; function creatediv() { ++index; document.getElementById("buttonone").innerHTML="CREATE ANOTHER DIV"; var newdiv = document.createElement("span"); newdiv.setAttribute("id","newdiv" + index); var text = document.createTextNode(Math.floor(Math.random()*100)+1); newdiv.appendChild(text); newdiv.style.color="white"; newdiv.style.width="100px"; newdiv.style.backgroundColor="green"; document.body.appendChild(newdiv); } function removedivider() { document.body.removeChild(document.getElementById("newdiv" + index)); --index; } &lt;/script&gt; Should work, I didn't test.
type: Answer
answers question: http://stackoverflow.com/q/24841973

http://stackoverflow.com/comment/38498635
type: Comment
type: QuestionComment
has text: Its better if you can create jsbin for it.
comment on: http://stackoverflow.com/q/24803185
score: 0

http://stackoverflow.com/comment/49578066
has text: That solution does not work for IE<11, because `pointer-events` is not supported.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/26890673
type: Comment

http://stackoverflow.com/a/25179586
type: Answer
has comment: http://stackoverflow.com/comment/39245042
has comment: http://stackoverflow.com/comment/39234595
answers question: http://stackoverflow.com/q/24852946
score: 4
upvote count: 4
downvote count: 0
has body: So, you're saying that you have 35year of data on daily basis. For me it's &lt; 13k of points. And then you have chart, for example 600px wide. That means you have 20points on 1pixel. And you saying that aggregation is bad, because user need to see true data. Let me ask, how user will see that points, when will have 20 of them in 1px? Maybe I'm getting old, but I won't be able to see that points really good, just some 'fat path'. Compare these examples: http://jsfiddle.net/Fusher/4ytzuv7o/1/ Just disabled dataGrouping in a second example: dataGrouping: { enabled: false } When you zoom-in in a first example, you will get true data anyway. If you really can't use dataGrouping, then how about another solution? Disable navigator and 'All' button, to user will be able to zoom only at specified ranges, like this: http://jsfiddle.net/Fusher/4ytzuv7o/3/ $('#container').highcharts('StockChart', { rangeSelector: { inputEnabled: false, buttons: [{ type: 'month', count: 1, text: '1m' }, { type: 'month', count: 3, text: '3m' }, { type: 'month', count: 6, text: '6m' }, { type: 'ytd', text: 'YTD' }, { type: 'year', count: 1, text: '1y' }], selected: 0 }, navigator: { enabled: false }, series: [{ name: 'AAPL', data: data, dataGrouping: { enabled: false } }] });

http://stackoverflow.com/comment/38660076
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24888456
score: 2
has text: nope, it's not remotely clear...

http://stackoverflow.com/comment/38640977
comment on: http://stackoverflow.com/q/24864698
has text: @svidgen : I have tested this point by hitting a ajax target with a sleep of 6 secs. As mentioned 2,3,4 triggered continuously after 6 secs. Here is [a demo fiddle](http://jsfiddle.net/2nWCq/).
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24825164
has comment: http://stackoverflow.com/comment/38540453
has comment: http://stackoverflow.com/comment/38540795
accepted answer of: http://stackoverflow.com/q/24824635
has comment: http://stackoverflow.com/comment/38541060
answers question: http://stackoverflow.com/q/24824635
score: 0
type: AcceptedAnswer
has body: The first effect is called Parallax Scrolling. Here you have a jquery plugin, for example: http://stephband.info/jparallax/ For the Fade On Scroll effect, you can also use jquery. Here you got an example: http://jsfiddle.net/z7E9u/1/ The html code for this Fade On Scroll: Fading The javascript code for this Fade On Scroll: var fadeStart=100 // 100px scroll or less will equiv to 1 opacity ,fadeUntil=200 // 200px scroll or more will equiv to 0 opacity ,fading = $('#fading') ; $(window).bind('scroll', function(){ var offset = $(document).scrollTop() ,opacity=0 ; if( offset<=fadeStart ){ opacity=1; }else if( offset<=fadeUntil ){ opacity=1-offset/fadeUntil; } fading.css('opacity',opacity).html(opacity); }); Updated JSFiddle: http://jsfiddle.net/CqrJV/
type: Answer

http://stackoverflow.com/comment/38584075
has text: if they weren't when I put them into the head they wouldn't load...
comment on: http://stackoverflow.com/q/24848533
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24841168
has comment: http://stackoverflow.com/comment/38570004
has comment: http://stackoverflow.com/comment/38571276
type: Question
has comment: http://stackoverflow.com/comment/38571462
tagged with: python
tagged with: regex
has answer: http://stackoverflow.com/a/24841358
has comment: http://stackoverflow.com/comment/38570513
linked to: http://stackoverflow.com/q/280712
has title: how to match other languages words with regex
score: 0
answer count: 2
tagged with: perl
tagged with: javascript
has body: Replace words in a Greek given text, for example with English words. Here an example: var str= "Ενώ Gallant δεν λειτουργεί στην προσπάθεια να χτίσει πια μηχανές αποκωδικοποίησης, οι άλλοι." function findword(){ word = new RegExp("\\b(προσπάθεια)\\b","gi") var sust = str.replace(word,'effort'); } It should return: "Ενώ Gallant δεν λειτουργεί στην effort να χτίσει πια μηχανές αποκωδικοποίησης, οι άλλοι. Trying to do it in JavaScript I failed, but I have read that this is not possible since this language does not handle Unicode characters other than English. The only possibility I found is xregexp, but it seems that only would work to detect character classes and not individual words. ¿Is really impossible to make it work in JavaScript? The Python 3 Documentation states that this language can handle unicode characters, but in this case it seems that it's necessary to write characters with the unicode code... With which languaje would it be possible to replace words in the simplest way as I wrote in the code? Python, Java, Perl ...?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24842226
tagged with: unicode

http://stackoverflow.com/a/24794966
type: Answer
has comment: http://stackoverflow.com/comment/38483720
has comment: http://stackoverflow.com/comment/38484515
has comment: http://stackoverflow.com/comment/38484112
has comment: http://stackoverflow.com/comment/38484436
has comment: http://stackoverflow.com/comment/38484005
score: 2
downvote count: 0
has body: Use Prop in Jquery to disable the option.If you use attr You cant enable and disable option one more time $("#mySelect1").prop("disabled", true); $("#mySelect").change(function () { $("#mySelect1").prop("disabled", (this.value == '01')); $("#mySelect1").find("option:eq(1)").prop("disabled", (this.value == 'Any other Country')); }); DEMO NEW UPDATED DEMO
upvote count: 2
has comment: http://stackoverflow.com/comment/38483862
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24794875
answers question: http://stackoverflow.com/q/24794875

http://stackoverflow.com/a/24835279
has body: Use attr() to change the src $("#profileImage").attr('src', result.user_image); attr() API docs This assumes that the &lt;img&gt; tag shown already exists
accepted answer of: http://stackoverflow.com/q/24835267
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24835267
type: Answer

http://stackoverflow.com/comment/38437752
has text: Your answer is exactly the same as Justin's
type: Comment
comment on: http://stackoverflow.com/a/24770936
type: AnswerComment
score: 0

http://stackoverflow.com/q/24843508
favorite count: 0
has answer: http://stackoverflow.com/a/24843558
answer count: 3
has title: FileReader error: The object is already busy reading Blobs
tagged with: http://stackoverflow.com/tag/html
upvote count: 25
has body: I'm making a drag-and-drop file upload system for photo gallery uploads. This is my source code handling dropped files. This one works multiple files if I drop them one by one it works but when I drop more than one at the same time this error occures: Uncaught InvalidStateError: Failed to execute 'readAsDataURL' on 'FileReader': The object is already busy reading Blobs. function handleFiles(files) { var reader = new FileReader(); var formdata = new FormData(); $.each(files, function(i, j) { $("td.photos span.status").html("Processing file: "+j.name); formdata.append('file', j); $.ajax({ url: "uploadalbum.php", type: "POST", dataType: "json", data: formdata, processData: false, contentType: false, success: uploadfinished }); reader.onload = handleReaderLoad; reader.readAsDataURL(j); }); } Any ideas?
possible better answer: http://stackoverflow.com/a/31256331
accepted answer: http://stackoverflow.com/a/24843558
has answer: http://stackoverflow.com/a/68864611
score: 25
has answer: http://stackoverflow.com/a/31256331
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/88429702
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/24758284
has title: How to change camelCase to slug-case (or kabob-case) via regex in JavaScript
downvote count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38413893
has answer: http://stackoverflow.com/a/24758444
has answer: http://stackoverflow.com/a/24758335
accepted answer: http://stackoverflow.com/a/24758444
has body: For some reason, this answer I found for (supposedly) how to do it in php just gives me the wrong matches. It seems to add the dash, but also replace the capital letter with a copy of the remainder of the string, so I want "abcZxc" to turn into "abc-zxc", but instead it turns it into "abd-zxczxc" This, plus a bunch of other variations, is what I've tried, but can't get it to work. filterGroup = aNiceString; console.log(filterGroup.replace(/[A-Z]+/g, "-1$'")) Thanks
has comment: http://stackoverflow.com/comment/38414041
upvote count: 8
type: Question
has answer: http://stackoverflow.com/a/71464886
linked to: http://stackoverflow.com/q/22849950
possible better answer: http://stackoverflow.com/a/24758335
tagged with: javascript
tagged with: string
score: 4
favorite count: 0
answer count: 3
has comment: http://stackoverflow.com/comment/38413896
tagged with: regex

http://stackoverflow.com/comment/38470079
type: AnswerComment
has text: Are you trying to modify SiteLocs after it has already been filled with all the prior information? Also, did you have a question about the forEach that you just posted?
type: Comment
comment on: http://stackoverflow.com/a/24787503
score: 0

http://stackoverflow.com/q/24803230
has comment: http://stackoverflow.com/comment/38498537
type: AnsweredQuestion
has title: Push values to array AngularJS
possible better answer: http://stackoverflow.com/a/24803358
downvote count: 0
has answer: http://stackoverflow.com/a/43250405
has answer: http://stackoverflow.com/a/24803271
type: Question
has comment: http://stackoverflow.com/comment/38498490
score: 5
has body: Im trying to push a data value to an array in AngularJS, with .push();, but I always get this error message: Error: $scope.test.push is not a function Here is my HTML: Testar Sträcka Tid {{info.stracka}} {{info.tid}} Sträcka(m): Fel sträcka Tid: För kort För långt Lägg till And here is my controller: as.controller('Test', function($scope, $http, $rootScope, testFactory) { $http.get($rootScope.appUrl + '/nao/test/test') .success(function(data, status, headers, config) { $scope.test = data.data; }); $scope.form = {}; $scope.submitForm = function(isValid) { if(isValid) { /*testFactory.testFactoryMethod(function($http) { $scope.test = data; });*/ $http.post($rootScope.appUrl + '/nao/test', $scope.form) .success(function(data, status, headers, config) { console.log(data); $scope.test.push($scope.form); }).error(function(data, status) { }); } }; }); Can anyone help me and explain why I get this message?
tagged with: javascript
tagged with: syntax-error
answer count: 3
favorite count: 0
upvote count: 5
tagged with: angularjs
has answer: http://stackoverflow.com/a/24803358
has comment: http://stackoverflow.com/comment/38500899
accepted answer: http://stackoverflow.com/a/24803271

http://stackoverflow.com/q/24836303
tagged with: javascript
tagged with: odata
score: 0
has answer: http://stackoverflow.com/a/24836992
has title: Compare ISO date without time stamp in javascript
answer count: 1
tagged with: jquery
has body: I am querying data using OData, url looks like http://myurl.com/api/Customer?$filter=ResDate eq DateTime'2014-03-15T12:01:55.123'. I'm getting date/time from jquery.datepicker instead of the static date and using moment.js to convert from DD-MM-YYYY to YYYY-MM-DDTHH:mm:ss in order to pass it to web service. function convertDateToISOdate(date){ var newDate = moment(date,'DD-MM-YYYY').format('YYYY-MM-DDTHH:mm:ss'); return newDate; } Date returns from the function, is 2014-03-15T00:00:00. Problem : 2014-03-15T12:01:55.123 is not equal to 2014-03-15T00:00:00, so there's no record selected. What I want is , just to compare the date , not include time stamp. Note : I can not change the format date/time at server side(Web service) because it's not belongs to me. Any idea is much appreciated.
type: UnansweredQuestion
tagged with: momentjs
type: Question

http://stackoverflow.com/q/24836697
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24836720
has body: I want to add values entered by user in a text box and print via a variable named "sum". The values entered are given to same variable i.e. first time value of x is 4, next time user enters the value of x =5; then sum should be 4+5=9 But the output is 45 ,i.e it keeps on printing values next to each other. Is there any way , I can print my desired output. My code is attached with this. ' It's Cricket Time - Score as many runs as possible Enter Your Number Your Score: Copyright © rooparshkalia productions '
downvote count: 1
has answer: http://stackoverflow.com/a/24836722
tagged with: javascript
score: -1
type: Question
upvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/24836726
favorite count: 0
answer count: 3
has title: Sum in HTML,jQuery anf Javascript

http://stackoverflow.com/q/24840330
score: 0
accepted answer: http://stackoverflow.com/a/24840389
answer count: 1
has answer: http://stackoverflow.com/a/24840389
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38568316
has comment: http://stackoverflow.com/comment/38568376
tagged with: mysql
has body: I'm just now started to learn Node and Express, I have some probelm with the routes in express. I want a well modular code for routing. I want to query some data from mysql database: Here is my app.js(it is on "public_html" directory): var path = require('path'); var express = require('express'); var routes = require('./routes'); var app = express(); var staticPath = path.resolve(__dirname, './'); app.use(express.static(staticPath)); routes.init(app); module.exports = app; app.listen(3000, function() { console.log('Server is listening on port: 3000'); }); Next file: "public_html/routes/index.js": exports.init = function(app){ //electronics routes app.use('/laptop', require('./laptop')); }; "public_html/routes/laptop/index.js": var router = require('express').Router(); router.get('/laptop', require('./modules/laptop')); module.exports = router; "public_html/routes/laptop/modules/laptop.js": var mysql = require('mysql'); var connection = mysql.createConnection( { host : 'localhost', user : 'admin', password : 'xxxxxxx', database : 'database', } ); module.exports = function(req, res){ connection.connect(); var queryString = 'SELECT * FROM laptop'; connection.query(queryString, function(err, rows, fields) { if (err) throw err; res.writeHead(200, { 'Content-Type': 'application/json'}); res.end(JSON.stringify(rows)); }); connection.end(); }; I want to keep this modularity even if its look like a bit over complicated, in the future I will need it. So the problem is it's just doesn't working, I think its just a stupid error somewhere, but I don't find it and on the internet there is only simple route examples so I cant use them in this case.
type: Question
has title: Express js routing and mysql query not working
has comment: http://stackoverflow.com/comment/38568379
tagged with: javascript
tagged with: express

http://stackoverflow.com/comment/38696487
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24907693
type: Comment
has text: possible duplicate of [element.firstChild is returning '<TextNode ...' instead of an Object in FF](http://stackoverflow.com/questions/2299807/element-firstchild-is-returning-textnode-instead-of-an-object-in-ff)

http://stackoverflow.com/comment/38559903
type: Comment
score: 1
has text: Will do! just waiting for the timer to end
type: AnswerComment
comment on: http://stackoverflow.com/a/24835502

http://stackoverflow.com/comment/38557470
has text: use absolute path in your css, js, images files rather than a relative one. Which means you have to make sure path of these files start either with `http://` or a slash `/`.
type: QuestionComment
comment on: http://stackoverflow.com/q/24833999
score: 1
type: Comment

http://stackoverflow.com/comment/38463600
type: Comment
comment on: http://stackoverflow.com/q/24784380
has text: @InternetJones Yeah thanks but when i put return false at end i need to press submit for 2 times anyreason why?? and how it can be prevented ?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/38476368
comment on: http://stackoverflow.com/q/24790842
score: 0
has text: window.top.document.title does not work either....i mean when i run document.title = "test" in a normal html file it just changes the tab title but if im doing this in a colorbox frame the command does not change the tab title anymore.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24902480
answers question: http://stackoverflow.com/q/24902361
score: 4
has body: if you are getting that alert then this will work function form_submit() { var item_name = $("input#id_item").val(); var cost = $("input#id_cost").val(); var wp = $("input#id_wp").val(); var rp = $("input#id_rp").val(); var dataString = 'item_name='+ item_name + '&amp;cost=' + cost + '&amp;wp=' + wp+ '&amp;rp=' + rp; $.ajax({ type: "post", url: "newAdd.php", data:dataString, success: function(msg){ alert('success'); } }); }
downvote count: 0
type: Answer
upvote count: 4

http://stackoverflow.com/q/24872086
linked to: http://stackoverflow.com/q/6456381
answer count: 2
upvote count: 1
linked to: http://stackoverflow.com/q/6394812
has answer: http://stackoverflow.com/a/24872106
tagged with: javascript
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/24872426
accepted answer: http://stackoverflow.com/a/24872426
possible better answer: http://stackoverflow.com/a/24872106
favorite count: 0
has comment: http://stackoverflow.com/comment/38629697
has comment: http://stackoverflow.com/comment/38630116
downvote count: 0
has comment: http://stackoverflow.com/comment/38630099
has body: I have event mouseenter link with get ajax request, I want to get selector $(this) of link and get attribute. I'm use context of setting ajax for AJAX callback. jQuery(document).ready(function($) { var request; $('a[rel="bookmark"]').mouseenter(function() { // other stuff request = $.ajax({ dataType: "JSON", url: '<?php echo admin_url("admin-ajax.php"); ?>', data: {"action": "our_ajax_function", "id": dataId}, context: $(this).parent().get(0), success: function(data){ // other stuff var gettitle = $(this).attr('data-title').replace('Permanent Link to ',''); } }) }); But I get this error Uncaught TypeError: Cannot read property 'replace' of undefined I have event mouseenter link with get ajax request, I want to get selector $(this) of link and get attribute. I'm use context of setting ajax for AJAX callback. jQuery(document).ready(function($) { var request; $('a[rel="bookmark"]').mouseenter(function() { // other stuff request = $.ajax({ dataType: "JSON", url: '<?php echo admin_url("admin-ajax.php"); ?>', data: {"action": "our_ajax_function", "id": dataId}, context: $(this).parent().get(0), success: function(data){ // other stuff var gettitle = $(this).attr('data-title').replace('Permanent Link to ',''); } }) }); But I get this error Uncaught TypeError: Cannot read property 'replace' of undefined HTML Area no Kishi Aria the Scarlet Ammo ( Hidan No Aria )
type: Question
type: AnsweredQuestion
has title: Using selectors and $(this) in Jquery Ajax
score: 1
has comment: http://stackoverflow.com/comment/38629580

http://stackoverflow.com/q/24751036
has title: jwplayer: using seek(), onTime() and stop() to play part of the video
upvote count: 1
type: Question
tagged with: javascript
has body: I am using latest JW Player cloud hosted version. I need to seek the video to start from certain position and stop at certain position using seek(), onTime() and stop(). jwplayer().onReady(function() { jwplayer().seek(300).onTime(function(event) { if(event.position&gt;330) { jwplayer().stop(); } }); }); The video starts and stops with the above command, but if the user clicks on play button again, it starts from beginning instead of the time specified in seek(). I have advertisement associated with this video. Any help! Thanks
accepted answer: http://stackoverflow.com/a/24751533
tagged with: jwplayer
tagged with: jwplayer6
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/24751533
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/38415040
comment on: http://stackoverflow.com/q/24758417
score: 0
type: Comment
type: QuestionComment
has text: added a fiddle for you

http://stackoverflow.com/comment/38468063
comment on: http://stackoverflow.com/q/24786577
has text: Hard to tell without seeing the code around it... Does `event.target` really reference the player? Is `videoIds` a well-formed array? Check by displaying them with _console.log_.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/24833272
tagged with: javascript
has comment: http://stackoverflow.com/comment/38556029
score: 0
has comment: http://stackoverflow.com/comment/38556391
answer count: 1
tagged with: jquery
tagged with: ajax
type: UnansweredQuestion
has body: $("#textjawatan" + noid).autocomplete({ source: function( request, response ) { $.ajax({ url: "pendaftar_table.php", dataType: "json", data: { term : "pe" } , success: function( data ) { response( data ); } }); }, minLength: 2, select: function(event, ui) { $("input#jawatan" + noid).val(ui.item.no); } }); when i use data: { term : "pe" } its work, but when i use data: { term : "pe", id : "jawatan" } its doesnt work, what is the problem ?
has comment: http://stackoverflow.com/comment/38555881
has title: JQuery Autocomplete - multiple data post not working
type: Question
has answer: http://stackoverflow.com/a/24833899
tagged with: autocomplete
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/q/24813320
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38518214
score: 1
has answer: http://stackoverflow.com/a/24813561
has comment: http://stackoverflow.com/comment/38518140
upvote count: 1
type: Question
has body: Given is a file with JavaScript-Code. For example: 1 + 1; 3 + 3; I want to receive the value of the last expression (which is 6 in this case). This could be achieved via node --print "1 + 1; 3 + 3;" But I cannot pass the code as a string because the code can contain quotes which conflict with the quotes around the code (e.g. node -p "1 + 1; aFunction("string")"). Unfortunately, node's --print parameter cannot deal with files. Another approach would be to modify the source file. I could use the eval-Function which has the desired behaviour that eval("1 + 1; 3 + 3") returns 6. Unfortunately, I run into the same conflicts with the quotes. I hope I could make my point clear. I'm looking forward to your answers.
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24813561
answer count: 1
downvote count: 0
has title: Get result of last statement in JavaScript Code
favorite count: 0

http://stackoverflow.com/q/24796021
type: Question
downvote count: 4
upvote count: 0
has answer: http://stackoverflow.com/a/24796118
tagged with: javascript
has title: Clean URL with .htaccess
has comment: http://stackoverflow.com/comment/38485688
has comment: http://stackoverflow.com/comment/38485638
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
type: UnansweredQuestion
score: -4
tagged with: php
has comment: http://stackoverflow.com/comment/38485569
has body: I have an html page in which there are several DIVs and in each DIVs,I am loading different php files with $("#ID").load() function. Here I was just wondering if I can create a clean URLs with .htaccess (or any other methods) for each of these DIV loads. I tried googling a lot but got no luck

http://stackoverflow.com/comment/38510465
comment on: http://stackoverflow.com/q/24781551
type: QuestionComment
type: Comment
has text: @jgillich This is true, but I've dealt with the exact same thing as OP before, and it's a nasty one to deal with. The white pixel is usually an indication that an ad was injected, but removed by adblock (some combo of the two causes the pixel).
score: 0

http://stackoverflow.com/q/24871336
favorite count: 0
has body: I'm working on building a Paranoid Pirate in node.js. Starting with some python code: poller = zmq.Poller() liveness = HEARTBEAT_LIVENESS interval = INTERVAL_INIT heartbeat_at = time.time() + HEARTBEAT_INTERVAL worker = worker_socket(context, poller) cycles = 0 while True: socks = dict(poller.poll(HEARTBEAT_INTERVAL * 1000)) # Handle worker activity on backend if socks.get(worker) == zmq.POLLIN: # Get message # - 3-part envelope + content -&gt; request # - 1-part HEARTBEAT -&gt; heartbeat frames = worker.recv_multipart() The Go sample code also uses a Poller. The problem that I'm running into is that zeromq.node doesn't seem to use Pollers. Is the solution in node to just use a callback on message? how should I handle the POLLIN state?
tagged with: python
has comment: http://stackoverflow.com/comment/38628337
tagged with: node.js
has answer: http://stackoverflow.com/a/24889875
type: AnsweredQuestion
upvote count: 2
type: Question
tagged with: zeromq
accepted answer: http://stackoverflow.com/a/24889875
has comment: http://stackoverflow.com/comment/38628608
has title: how should I handle polling in ZMQ in node.js?
score: 2
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/24827864
type: Question
has comment: http://stackoverflow.com/comment/38545595
tagged with: object
has answer: http://stackoverflow.com/a/24828335
has comment: http://stackoverflow.com/comment/38545548
has title: Insert array-values to object angularjs
answer count: 2
has comment: http://stackoverflow.com/comment/38545518
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/24828110
score: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/24828335
has body: I have an array with values. I want to insert this values, into an object in angular. How is this insertion made? Is it possible to "transform" an array with values, to an object with the same values?
has comment: http://stackoverflow.com/comment/38545415
possible better answer: http://stackoverflow.com/a/24828110
type: AnsweredQuestion

http://stackoverflow.com/comment/38427978
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24765598
has text: The html code is identical to code I use with a scanner applet and works fine. I did do this though, just to be sure and it gave me the same message. It appears the functions in the Java code are not visible to the outside world, but I thought that's what "public" did. I'm open to other thoughts though :). Yeah, I know I'll need to recode for html5, but that's going to be a rewrite of lots of code on a legacy system.

http://stackoverflow.com/a/24854062
has comment: http://stackoverflow.com/comment/38596483
type: Answer
answers question: http://stackoverflow.com/q/24853897
upvote count: 1
downvote count: 1
score: 0
has body: You can also set up another outlet that can be used to display the "result". You can read more about using outlets in the Ember.js Guides at http://emberjs.com/guides/routing/rendering-a-template/

http://stackoverflow.com/comment/38595070
has text: Doesn't matter imho. Both are correct. More a matter of preference than anything else.
type: QuestionComment
comment on: http://stackoverflow.com/q/24854165
type: Comment
score: 1

http://stackoverflow.com/comment/38480281
has text: Are you familiar with map objects in JavaScript? Such as: `var charMap = {}; charMap['a'] = 0; charMap['b'] = 1;`? You could iterate through the input string, adding every char into a charMap: http://jsfiddle.net/w7F87/14/
comment on: http://stackoverflow.com/q/24793051
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38940721
comment on: http://stackoverflow.com/a/25035689
score: 0
type: AnswerComment
has text: Yeah, I think I'll try that. Meanwhile, +1!
type: Comment

http://stackoverflow.com/comment/54704177
type: Comment
comment on: http://stackoverflow.com/a/24884339
type: AnswerComment
score: 0
has text: What if we clone the moment object and set startOf and check? @Ben

web-essentials
tags question: http://stackoverflow.com/q/24752871
tag name: web-essentials
type: Tag
tags question: http://stackoverflow.com/q/24832169

http://stackoverflow.com/q/24780681
type: Question
has answer: http://stackoverflow.com/a/24782887
accepted answer: http://stackoverflow.com/a/24782887
tagged with: javascript
score: 0
upvote count: 1
answer count: 1
favorite count: 0
tagged with: wamp-protocol
tagged with: autobahn
tagged with: python
has body: just started to use autobahn. I already did some examples and now I am trying to make my own server and client based on the tutorials. I will use the autobahn for python for the server and the javascript library on the client side. At the moment I am struggling with the problem that I can only call procedures from the client to the server but not vice versa and I can only publish events from client side. If I try to call the procedure I get following error Failure: autobahn.wamp.exception.ApplicationError: ApplicationError('wamp.error.no_such_procedure', args = ("no procedure 'com.myapp.add2client' registered",), kwargs = {}) So it seems the application is not registered, but on the client side it look like it does as I get an precedure id. Procedure registered: 4026531820798724 Can anyone point me in the right direction, please? Client side &lt;script&gt; var connection = new autobahn.Connection({ url: 'ws://raspberrypi.local:8080', realm: 'realm1' }); connection.onopen = function (session) { // 1) subscribe to a topic function onevent(args) { console.log("Event:", args[0]); } session.subscribe('com.myapp.hellofromserver', onevent); // 2) publish an event session.publish('com.myapp.hellofromclient', ['Hello, world!']); // 3) register a procedure for remoting function add2(args) { console.log("procedure called, result:", res); return args[0] + args[1]; } session.register('com.myapp.add2client', add2).then( function (registration) { console.log("Procedure registered:", registration.id); }, function (error) { console.log("Registration failed:", error); } ); // 4) call a remote procedure session.call('com.myapp.add2server', [10, 10]).then( function (res) { console.log("Result:", res); } ); }; connection.open(); &lt;/script&gt; Server side # Imports import sys from twisted.python import log from twisted.internet import reactor from twisted.internet.defer import inlineCallbacks from twisted.internet.endpoints import serverFromString from autobahn.wamp import router, type…
type: AnsweredQuestion
has title: Call procedure registered in javascript from python server Autobahn, Wamp
downvote count: 1

http://stackoverflow.com/q/24773718
answer count: 1
tagged with: javascript
has title: How to store an array from a form in mongodb
tagged with: node.js
has answer: http://stackoverflow.com/a/24774715
has body: I have a form some thing like Class Name Grade I want to store this in my mongodb database. I am using a schema like var SchoolSchema = new mongoose.Schema({ classroom: [{ Name: { type: String, required: true }, grade: { type: Number, default: 1 } }] }); Please suggest me how I can save the data from form in this database .
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24774715
type: Question
score: 0
tagged with: mongodb
tagged with: pug

http://stackoverflow.com/a/24874944
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/24874516
type: Answer
answers question: http://stackoverflow.com/q/24874516
has comment: http://stackoverflow.com/comment/38635880
has comment: http://stackoverflow.com/comment/38635320
has comment: http://stackoverflow.com/comment/38635396
has comment: http://stackoverflow.com/comment/38638242
has body: Your function works fine if you pass a proper string to it, See JSFiddle to play with it. try to output the email variable to the console or alert it to see the value: console.log(email); or alert(email); as the first line of your function. Empty strings will always return false from your method.

http://stackoverflow.com/a/24813195
type: Answer
has body: Here's the solution I came up with. It's pretty ghetto (admittedly I don't have a great understanding of streams) but it looks like it's working. Still interested in finding a nicer way. var outstream = through2.obj(); var interceptor = function(){ return through2.obj(function(obj, enc, cb) { outstream.push(obj); cb() }); } bundler.on('update', function() { rebundle().pipe(interceptor()); }); rebundle().pipe(interceptor()); return outstream;
answers question: http://stackoverflow.com/q/24812386
score: 0

http://stackoverflow.com/q/24827821
has body: I've got an array of objects with names, like so: myArray = [ {name : 'foo'}, {name : 'bar'}, {name : 'Foo'} ] I want to sort these object alphanumerically by name, and was using the following sort function to do so: myArray.sort(function(a,b){ return a.name &gt; b.name; }); This seems to work, but I can't find anything in the spec with regards to how sort is supposed to function when the comparison function returns booleans. This DOESN'T seem to follow the requirement that if a &gt; b returns something greater than zero, a &lt; b returns something less than zero, and a === b returns something equal to zero. What I'm wondering is, will using a function that returns a boolean work consistently for sorting across browsers?
has answer: http://stackoverflow.com/a/24828278
has comment: http://stackoverflow.com/comment/38545229
has answer: http://stackoverflow.com/a/24828155
upvote count: 1
type: AnsweredQuestion
has title: Sorting objects with booleans
score: 1
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/17387435
accepted answer: http://stackoverflow.com/a/24828155
tagged with: arrays
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/51165
has comment: http://stackoverflow.com/comment/38545251
favorite count: 0
possible better answer: http://stackoverflow.com/a/24828278

http://stackoverflow.com/a/24871834
has body: I would suggest, override Backbone.Views remove method. With regular stopListening, abort ajax calls, also set a flag like this.removed=true. In your render function check for removed flag, if present don't render. If click has been done very quickly, you may need to check it before making any calls.
answers question: http://stackoverflow.com/q/24867323
score: 1
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/38646284
upvote count: 1

http://stackoverflow.com/a/24868141
score: 1
upvote count: 1
downvote count: 0
type: Answer
has body: To use the script, add the code in the .getScript callback to your JavaScript for the page. Any code that depends on the script you are injecting should be included or called from inside the .getScript callback. In the code you pasted, the console.log statements run after the injected script loads. Here's an example of using $.getScript to load the Underscore.js library and log the version of Underscore to the console: var condition=true; var pathToScript='http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js'; if(condition){ // load script from the server $.getScript( pathToScript, function( data, textStatus, jqxhr ) { console.log(_.VERSION); }); }; JSFiddle: http://jsfiddle.net/WA4f4/2/ I slightly modified your code so it would work in JSFiddle and to demonstrate that the code inside the callback to getScript can access variables from the injected script.
answers question: http://stackoverflow.com/q/24867517

http://stackoverflow.com/comment/38516339
comment on: http://stackoverflow.com/a/24812334
score: 0
type: Comment
has text: The controls are scattered all over the playback area. Thanks for the suggestion, but it won't work for me.
type: AnswerComment

http://stackoverflow.com/q/24808140
has title: Set onclick event in loop while creating elements
has comment: http://stackoverflow.com/comment/38508564
has body: I don't want to use jQuery, or any other 3rd party library! Not working proof of concept: &lt;div id="Wrapper"&gt;&lt;/div&gt; &lt;script&gt; function Build() { for (var i = 0 ; i &lt; 10 ; i++) { var elem = document.createElement("div"); elem.setAttribute("onclick", "OnClickEvent(" + i + ")"); elem.textContent = "Hi"; document.getElementById("Wrapper").appendChild(elem); } } function OnClickEvent(elementNum) { alert("Hi! I am " + elementNum); } Build(); &lt;/script&gt; fiddle: http://jsfiddle.net/qyzrQ/ In real life: I'm dynamically creating a table based on ajax callback, each row contains an image button and another table. This image button should be able to hide or show corresponding inner table.
has answer: http://stackoverflow.com/a/24811499
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38508606
score: 0
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/q/24898755
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24962705
downvote count: 0
score: 1
favorite count: 0
tagged with: cordova
has comment: http://stackoverflow.com/comment/38685009
has title: phonegap/cordova onDeviceReady() not firing android 4.1.2
type: Question
answer count: 2
tagged with: android
has answer: http://stackoverflow.com/a/24899100
has comment: http://stackoverflow.com/comment/38679895
has body: I am at my wits end here. I am using Adobe Build and PhoneGap Version 3.5.0 and Cordova 3.4.0. No matter what I do, my onDeviceReady() event does not fire on my android device, either as an APK or in the PhoneGap developer app. Here is my config.xml: <?xml version='1.0' encoding='utf-8'?> xxxx xxxx OUR Walmart <preference name="permissions" value="none" /> <preference name="phonegap-version" value="3.5.0" /> <preference name="orientation" value="default" /> <preference name="target-device" value="universal" /> <preference name="fullscreen" value="true" /> <preference name="webviewbounce" value="false" /> <preference name="prerendered-icon" value="true" /> <preference name="stay-in-webview" value="false" /> <!--<preference name="ios-statusbarstyle" value="black-translucent" />--> <preference name="detect-data-types" value="true" /> <preference name="exit-on-suspend" value="false" /> <!--<preference name="show-splash-screen-spinner" value="true" /> <preference name="auto-hide-splash-screen" value="true" />--> <preference name="disable-cursor" value="false" /> <preference name="android-minSdkVersion" value="7" /> <preference name="android-installLocation" value="auto" /> <gap:plugin name="com.phonegap.plugin.statusbar" /> <gap:plugin name="org.apache.cordova.battery-status" /> <gap:plugin name="org.apache.cordova.camera" /> <gap:plugin name="org.apache.cordova.media-capture" /> <gap:plugin name="org.apache.cordova.console" /> <gap:plugin name="org.apache.cordova.contacts" /> <gap:plugin name="org.apache.cordova.device" /> <gap:plugin name="org.apache.cordova.device-motion" /> <gap:plugin name="org.apache.cordova.device-orientation" /> <gap:plugin name="org.apache.cordova.dialogs" /> <gap:plugin name="org.apache.cordova.file" /> <gap:plugin name="org.apache.cordova.file-transfer" /> <gap:plugin name="org.apache.cordova.geolocation" /> <gap:plugin name="org.apache.cordova.globalization" /> <gap:plugin name="org.apache.cordova.inappbrowser" /> <gap:plugin name="org.apache…
upvote count: 1

http://stackoverflow.com/q/24780816
has comment: http://stackoverflow.com/comment/38456471
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38456619
answer count: 3
has comment: http://stackoverflow.com/comment/38456399
accepted answer: http://stackoverflow.com/a/24781187
has answer: http://stackoverflow.com/a/24781043
has comment: http://stackoverflow.com/comment/38456206
favorite count: 0
tagged with: angularjs
upvote count: 2
has body: I'm not sure what I'm missing here but I'm trying to update a value inside an array, and then have this reflected in the repeater. Do I need to make a copy or something before applying the update in order for Angular to show the changes? ---sample json "lists": [ { "name": "one", "enabled": true }, { "name": "two", "enabled": false } ] !-- code setTimeout(function(){ $scope.$apply(function(){ $scope.lists[1].enabled = true; }); },1); !--- html &lt;span data-ng-repeat="list in lists | filter: {enabled: true}"&gt;&lt;/span&gt;
has answer: http://stackoverflow.com/a/24781187
has comment: http://stackoverflow.com/comment/38456648
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24781597
has title: Angularjs ng-repeat not updating after array update
possible better answer: http://stackoverflow.com/a/24781043
type: Question

http://stackoverflow.com/q/24843157
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I have implemented AddThis plugin in my website, however, when I resize the browser's width and before it hits the @meduim screen style the more layer get displayed in a wrong floating position. I snapped this css from their out of the box implementation element.style { z-index: 1000000; position: absolute; visibility: visible; top: 681px; left: 753px; display: none; } #at15s.atm { background: none!important; padding: 0!important; width: 160px!important; } I do reference this js file provided by them, and it takes care of the css I guess. What css should I share with you guys to get familiar with this problem so you may give me suggestions for the floating problem?
has comment: http://stackoverflow.com/comment/39195593
has answer: http://stackoverflow.com/a/25758559
score: 0
type: UnansweredQuestion
has title: Fix 'AddThis' plugin 'more layer' floating
tagged with: addthis
type: Question
has comment: http://stackoverflow.com/comment/39373443
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/24821386
has comment: http://stackoverflow.com/comment/38533009
upvote count: 2
has body: ng-repeat is rendered during the render phase (when the $watch handlers are being executed). During the compile and link phases, you only have access to the template. That is the reason you're only seeing one element. To hook into the after-render phase, you can use $timeout: app.controller('AppScreenController', function($scope, $timeout) { var _collapseErrorData = function () { $timeout(function() { var elems = $element.find( '.app-item' ); // Should return array of ng-repeated elements! }); } });
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/24821208

http://stackoverflow.com/comment/38617281
type: Comment
comment on: http://stackoverflow.com/a/24865543
has text: I love his solution; I appreciate if you explain it so both me and future visitors make use of it.
type: AnswerComment
score: 0

http://stackoverflow.com/q/24904537
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/24904796
answer count: 4
has body: I am using jQuery mobile. What i am trying to do is that when a user clicks the element it transfers him to the linked page and then displays an alert which contains the text of the list element that he clicked. Unforunately, my implementation here is only displaying an empty alert box Hello World Bye Bye
has title: Need to get text value of an element in jQuery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24904729
type: Question
has answer: http://stackoverflow.com/a/24904710
has answer: http://stackoverflow.com/a/24904708

http://stackoverflow.com/comment/38641583
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/24878488
has text: https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history

http://stackoverflow.com/comment/38683715
comment on: http://stackoverflow.com/q/24882732
type: QuestionComment
has text: why do you have a list in a scrolling view?
score: 0
type: Comment

http://stackoverflow.com/q/24886404
has answer: http://stackoverflow.com/a/24906266
upvote count: 1
has title: How to toggle Firefox responsive design view resolution through code
type: Question
accepted answer: http://stackoverflow.com/a/24906266
has comment: http://stackoverflow.com/comment/38655862
tagged with: javascript
answer count: 2
tagged with: firefox-addon
tagged with: firefox
downvote count: 0
tagged with: jquery
favorite count: 0
has body: I am switching on the firefox responsive design view from my xul based addon with the following code. var mytmp = {}; Cu.import("resource://gre/modules/Services.jsm"); Services.prefs.setCharPref("devtools.responsiveUI.presets", JSON.stringify([{name:'tmp1', key: "234x899", width:300,height:300}])); Cu.import("resource:///modules/devtools/responsivedesign.jsm", mytmp); var win = window.bridge.myWindow; mytmp.ResponsiveUIManager.toggle(win, win.gBrowser.tabContainer.childNodes[0]); Following is the code which toggles the resolution this.menulist.addEventListener("select", this.bound_presetSelected, true); /** * When a preset is selected, apply it. */ presetSelected: function RUI_presetSelected() { if (this.menulist.selectedItem.getAttribute("ispreset") === "true") { this.selectedItem = this.menulist.selectedItem; this.rotateValue = false; let selectedPreset = this.menuitems.get(this.selectedItem); this.loadPreset(selectedPreset); this.currentPresetKey = selectedPreset.key; this.saveCurrentPreset(); // Update the buttons hidden status according to the new selected preset if (selectedPreset == this.customPreset) { this.addbutton.hidden = false; this.removebutton.hidden = true; } else { this.addbutton.hidden = true; this.removebutton.hidden = false; } } }, I tried to access the menulist and do a event trigger myself but couldn't access it. How do I select the dropdown?
possible better answer: http://stackoverflow.com/a/24889992
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24889992
score: 1

http://stackoverflow.com/q/24862025
has body: I want to close a page from kiosk pages. I tried to add a button and onclick, a self.close() function fires but it didn't work. I tried as well hacky workaround proposed by Brock Adams in: window.close and self.close do not close the window in Chrome But it only turn the screen white and do not close the page. Any suggestions would be greatly appreciated.
favorite count: 0
has title: How can I close a Chrome Kiosk page in JavaScript
downvote count: 0
answer count: 0
type: UnansweredQuestion
tagged with: google-chrome
type: Question
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/38760234
linked to: http://stackoverflow.com/q/19761241
tagged with: javascript

http://stackoverflow.com/q/24804876
upvote count: 1
accepted answer: http://stackoverflow.com/a/24806111
type: AnsweredQuestion
has body: Is it valid to instead of doing this function Animal(name, numLegs) { this.name = name; this.numLegs = numLegs; } Animal.prototype.sayName = function() { console.log("Hi my name is " + this.name); }; function Penguin(name) { this.name = name; this.numLegs = 2; } Penguin.prototype = new Animal(); var penguin = new Penguin("Tux"); penguin.sayName(); do that? function Animal(name, numLegs) { this.name = name; this.numLegs = numLegs; } Animal.prototype.sayName = function() { console.log("Hi my name is " + this.name); }; function Penguin(name) { return new Animal(name, 2); } Penguin.prototype = new Animal(); var penguin = new Penguin("Tux"); penguin.sayName(); I find the second version more elegant and hoped both version were equivalent in their results, but for the second one codeacademy tells me Oops, try again. Make sure to create a new Penguin instance called penguin! while the first one is accepted.
tagged with: prototypal-inheritance
score: 1
type: Question
has answer: http://stackoverflow.com/a/24805567
has answer: http://stackoverflow.com/a/24805638
tagged with: javascript
has title: call parent ctor from ctor of inheriting class
answer count: 3
has answer: http://stackoverflow.com/a/24806111
possible better answer: http://stackoverflow.com/a/24805638
downvote count: 0
favorite count: 0

http://stackoverflow.com/q/24751875
has body: I am basically learning node.js and i am not much into advance JS concepts. var fs = require('fs'); fs.stat('/etc/passwd', function(err, stats) { if (err) { throw err;} console.log(stats); }); For the above node.js code there is an anonymous callback function, my question is how the argument values err and stats are filled up means how they get their values so that we can use them in callback function.
tagged with: node.js
has answer: http://stackoverflow.com/a/24752047
type: AnsweredQuestion
has title: How a callback function in javascript receives it's arguments values
linked to: http://stackoverflow.com/q/34624634
score: 1
upvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38401946
accepted answer: http://stackoverflow.com/a/24752047
has comment: http://stackoverflow.com/comment/137948075
downvote count: 0
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/38402214

http://stackoverflow.com/comment/38536529
type: Comment
has text: Thanks to everyone. As it turns out, I had a function called function clear(name) Apparently you can't call a fucntion 'clear' because once I changed that (to 'remoteText) it worked!
type: AnswerComment
comment on: http://stackoverflow.com/a/24811433
score: 0

http://stackoverflow.com/comment/38409147
type: Comment
has text: @JoshKirkpatrick Do you really have an array of objects, where each object just has one property with a different key? Or is there one object whose keys are `ZW01001`, `ZW01004`, and so on? The second way would be a much better way to do it.
comment on: http://stackoverflow.com/a/24755720
score: 0
type: AnswerComment

http://stackoverflow.com/q/24781626
has answer: http://stackoverflow.com/a/24781724
answer count: 3
has comment: http://stackoverflow.com/comment/38457907
has title: Javascript FileReader on IE8
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38458232
has answer: http://stackoverflow.com/a/24781942
tagged with: internet-explorer
has body: I have this javascript function which shows a preview after user picked an image. My problem is that it's not working on IE and I do not figure out why. No error, but input.files is null. The JavaScript function showimagepreview(input, previewId) { if (input.files &amp;&amp; input.files[0]) { var filerdr = new FileReader(); filerdr.onload = function (e) { $('#' + previewId).attr('src', e.target.result); } filerdr.readAsDataURL(input.files[0]); } } this is my HTML code &lt;div class="photo" id="photo-1"&gt; &lt;input type="file" class="upload-file" name="Photos[1]" onchange="showimagepreview(this, 'photosPreview1')" /&gt; &lt;img id="photosPreview1" class="PhotoPreview" /&gt; &lt;/div&gt;
has comment: http://stackoverflow.com/comment/38458163
score: 1
downvote count: 1
type: Question
linked to: http://stackoverflow.com/q/12140105
has answer: http://stackoverflow.com/a/24781819
has comment: http://stackoverflow.com/comment/38458052
tagged with: javascript

http://stackoverflow.com/comment/38969619
score: 0
type: QuestionComment
has text: Adding my suggestion as an answer
type: Comment
comment on: http://stackoverflow.com/q/24885431

http://stackoverflow.com/a/24857422
downvote count: 0
has comment: http://stackoverflow.com/comment/38601538
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/24857383
has body: Should be inside loop: var list = document.getElementsByClassName("mycontent"); for (var i = 0; i &lt; list.length; i++) { list[i].setAttribute("id", "custom-id-" + i); list[i].id = 'custom-id-' + i; list[i].style.width = widthx + 'px'; }

http://stackoverflow.com/q/24806733
tagged with: jquery
has comment: http://stackoverflow.com/comment/38506571
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: jQuery - unbind and bind again
tagged with: css
has comment: http://stackoverflow.com/comment/38505574
has comment: http://stackoverflow.com/comment/38506684
answer count: 0
has comment: http://stackoverflow.com/comment/38531869
type: Question
has comment: http://stackoverflow.com/comment/38506454
tagged with: javascript
has body: hi I tried to show the div (blue one) on mouseenter but only then, when ul has class hidden. I have done it but how i dont know how can i bind again function which will show the blue div on mouseenter .. To test it hover on the white li, then click the violet button and try to hover white li again - in the last step should show blue li but ii wont :( this is my fiddle fiddle $(document).ready(function(e){ $('li').each( function() { var elem_number = $(this).index(); $(this).html(elem_number + 1); }); $('.left-panel-toggle').on('click', function () { if($('ul').hasClass('hidden')) { $('ul').animate({width:'150px'}, 200).addClass('visible').removeClass('hidden'); $('li').animate({height:'100px',width:'150px'}, 200); $('li').unbind("mouseenter"); } else { $('ul').animate({width:'35px'}, 200).addClass('hidden').removeClass('visible'); $('li').animate({height:'30px', width:'30px'}, 200); } }); $( "li" ).bind('mouseenter',function(e) { if($('ul').attr('class') == 'hidden') { $('.tooltip').show().animate({'left':'36px','opacity':'1'},100); var tooltip_height = $('.tooltip').height(); var tooltip_width = $('.tooltip').width(); var viewHeightY = $(window).height(); var li_position = $(this).position(); var li_height = $(this).height(); var li_width = $(this).width(); var tooltip_position = $('.tooltip').position(); var tt = tooltip_position.top + tooltip_height if(li_position.top &lt; tooltip_height/2) { $('.tooltip').css({'top':li_position.top - li_position.top, 'left':li_position.left + li_width + 15}); } if(li_position.top &gt; tooltip_height/2) { $('.tooltip').css({'top':li_position.top - tooltip_height/2, 'left':li_position.left + li_width + 15}); } if((viewHeightY - li_position.top) &lt; tooltip_height/2) { $('.tooltip').css({'top':li_position.top -((li_position.top + tooltip_height)-viewHeightY), 'left':li_position.left + li_width + 15}); } } // $('img.x').attr('src', $(this.img).val('src')); e.preventDefault(); }); $( "ul" ).bind('mouseleave', function() { $('.toolti…
score: 0

http://stackoverflow.com/q/24776509
tagged with: ajax
tagged with: asp.net-mvc-4
has answer: http://stackoverflow.com/a/24776564
accepted answer: http://stackoverflow.com/a/24776564
type: AnsweredQuestion
has title: MVC4 ajax call and return data properly
possible better answer: http://stackoverflow.com/a/24776681
type: Question
has answer: http://stackoverflow.com/a/24776681
tagged with: asp.net-mvc
score: 0
answer count: 2
tagged with: javascript
tagged with: jquery
has body: I invoke an action in a controller using ajax like below. $.ajax({ type: "POST", url: "getUserInfo.json", data: "", success: function (data) { if (data.resultInfo.result != "SUCCESS") { alert("error"); return; } setUserInfo(data.userInfo); //alert(data.resultInfo.result); //alert(data.resultInfo.message); settingMenu(); //historyBackProc(); //histroyback catch }, error: function (data) { alert(data.resultInfo.message); } }); And what it ends up calling is this action. public ActionResult getUserInfo() { if ( Session["UserInfo"] != null ) { ViewData.Add("resultInfo", new resultInfo("SUCCESS")); ViewData.Add("UserInfo", Session["UserInfo"]); return Json(ViewData); } else { return RedirectToAction("index.mon"); } } and back to the ajax success callback, the data isn't what I want it to be. What I want is, data - "resultInfo" : object - "UserInfo" : object But it ended up having just objects, not keys. data - object[0] - Key : "resultInfo" - Value : object - object[1] - Key : "UserInfo" - Value : object To achieve this, how to manipulate the return object in the action? I need to do this to run this web application with the absolutely same javascript in both JAVA and .NET environment.

http://stackoverflow.com/comment/38650849
comment on: http://stackoverflow.com/a/24870415
type: Comment
has text: When i try to use it console.log(e) returns me: MouseEvent {dataTransfer: null, toElement: input#fio_dojo.dijitReset.dijitInputInner,... When i try to use e.append("") it says me: Uncaught TypeError: undefined is not a function main.html:84 (anonymous function)
score: 0
type: AnswerComment

http://stackoverflow.com/q/24894288
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/38671500
linked to: http://stackoverflow.com/q/9713058
has comment: http://stackoverflow.com/comment/38671983
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/24887079
has comment: http://stackoverflow.com/comment/38671878
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/38672784
has comment: http://stackoverflow.com/comment/38672480
has body: I'm currently sending POST requests to a PHP file of mine via a button with the following function: function buttonFunction() { $.post("http://ipaddress/core/file.php",{username:username, password:pword, coins:coins}, function(data) { // Stuff }); } However, I recently found out that if the file process/PHP script is still running (trying to obtain the resulting data/response), and the user refreshes the page, the PHP process would still be running on the server. Also, if the user then decided to click the button again (after refreshing), there would be TWO PHP proccesses running from the same user on the server (that is, if the first one was still running): Javascript Abort POST Request on Retry/Refresh (HIGH CPU Usage) However, I came across sending POST data with XMLHttpRequest with Javascript: Send POST data using XMLHttpRequest So let's say I send my POST request this way, would it be safe to say when the user refreshes/closes out of the page, the PHP execution ends? function buttonFunction() { var http = new XMLHttpRequest(); var url = "get_data.php"; var params = "lorem=ipsum&amp;name=binny"; http.open("POST", url, true); //Send the proper header information along with the request http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.setRequestHeader("Content-length", params.length); http.setRequestHeader("Connection", "close"); http.onreadystatechange = function() {//Call a function when the state changes. if(http.readyState == 4 &amp;&amp; http.status == 200) { alert(http.responseText); } } http.send(params); } However, if this also does not work, how can I fix this issue (multiple scripts running in the background from the same user)? Whether that fix be in the PHP file or in the JavaScript itself, any help would be appreciated. Edit 1: Possible Solution? What if I use XMLHttpRequest and abort the request before the page unloads? window.onbeforeunload = function(event) { http.abort(); };
has comment: http://stackoverflow.com/comment/38671429
has title: Safe Way to Send POST Request via Javascript
has comment: http://stackoverflow.com/comment/38671376
type: UnansweredQuestion
tagged with: xmlhttprequest
tagged with: php
has comment: http://stackoverflow.com/comment/38671651

http://stackoverflow.com/comment/38656587
has text: @user2024300 but you still want to call it in time loop ? if yes please follow rules from second comment
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24886063

http://stackoverflow.com/q/24879811
tagged with: twitter-bootstrap
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24941709
has comment: http://stackoverflow.com/comment/38644299
has body: I am coding a contact page in bootstrap 3.0 and the problem is that when i enter some values in the contact form , and try selecting the entered values , either with my mouse or by pressing CTRL + SHIFT + Left arrow key , nothing selects . i don't know why . can somebody help me out with this ? thank you . below is the code for my contact form. Name Email Address Phone Number Message Send Message Reset
has comment: http://stackoverflow.com/comment/38655669
has title: HTML Page selection
type: Question
has comment: http://stackoverflow.com/comment/38652156
tagged with: javascript
has comment: http://stackoverflow.com/comment/38644017
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38644340

http://stackoverflow.com/a/24877397
has body: jsonlint error comes from you not enclosing your keys in quotes. This will work properly but jsonlint doesn't like it. You can see this from the FAQ here: http://jsonlint.com/# Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[' You probably have an extra comma at the end of your list. Something like: [ "a", "b", ] You also may have not enclosed your collection keys in quotes. Proper format for a collection is: { "key": "value" }
downvote count: 0
answers question: http://stackoverflow.com/q/24877236
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/102766036
score: 2
comment on: http://stackoverflow.com/a/58193150
has text: No. The answer to the question is "It does that because that's how it is specified" and possibly "It was designed like that because…". Your post, in contrast, only states "I heavily disagree with how it works and consider it as a bad design" (to put it lightly).
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38555818
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24833175
has text: the thing you are showing doesn't seem to be a proper JSON value also, how man
score: 0

c#
tags question: http://stackoverflow.com/q/24838326
tags question: http://stackoverflow.com/q/24863854
tags question: http://stackoverflow.com/q/24888521
tags question: http://stackoverflow.com/q/24862633
tags question: http://stackoverflow.com/q/24752669
tags question: http://stackoverflow.com/q/24785475
tags question: http://stackoverflow.com/q/24858947
tags question: http://stackoverflow.com/q/24878012
tags question: http://stackoverflow.com/q/24840249
tags question: http://stackoverflow.com/q/24870799
tags question: http://stackoverflow.com/q/24890613
tags question: http://stackoverflow.com/q/24812067
tags question: http://stackoverflow.com/q/24859035
tags question: http://stackoverflow.com/q/24760490
tags question: http://stackoverflow.com/q/24869277
tags question: http://stackoverflow.com/q/24865961
tags question: http://stackoverflow.com/q/24814264
tag name: c#
tags question: http://stackoverflow.com/q/24832316
tags question: http://stackoverflow.com/q/24857217
tags question: http://stackoverflow.com/q/24875570
tags question: http://stackoverflow.com/q/24789663
tags question: http://stackoverflow.com/q/24859396
tags question: http://stackoverflow.com/q/24750939
tags question: http://stackoverflow.com/q/24906122
tags question: http://stackoverflow.com/q/24759089
tags question: http://stackoverflow.com/q/24840577
tags question: http://stackoverflow.com/q/24796526
tags question: http://stackoverflow.com/q/24817055
tags question: http://stackoverflow.com/q/24817538
tags question: http://stackoverflow.com/q/24768300
tags question: http://stackoverflow.com/q/24863254
tags question: http://stackoverflow.com/q/24821467
tags question: http://stackoverflow.com/q/24884171
tags question: http://stackoverflow.com/q/24842036
tags question: http://stackoverflow.com/q/24768390
tags question: http://stackoverflow.com/q/24779249
tags question: http://stackoverflow.com/q/24861756
tags question: http://stackoverflow.com/q/24821649
tags question: http://stackoverflow.com/q/24813295
tags question: http://stackoverflow.com/q/24891262
tags question: http://stackoverflow.com/q/24853038
tags question: http://stackoverflow.com/q/24761163
tags question: http://stackoverflow.com/q/24780915
tags question: http://stackoverflow.com/q/24891303
tags question: http://stackoverflow.com/q/24773350
tags question: http://stackoverflow.com/q/24765655
tags question: http://stackoverflow.com/q/24850356
tags question: http://stackoverflow.com/q/24860090
tags question: http://stackoverflow.com/q/24856178
tags question: http://stackoverflow.com/q/24802109
tags question: http://stackoverflow.com/q/24776033
tags question: http://stackoverflow.com/q/24797445
tags question: http://stackoverflow.com/q/24806751
tags question: http://stackoverflow.com/q/24822145
tags question: http://stackoverflow.com/q/24789869
tags question: http://stackoverflow.com/q/24905602
tags question: http://stackoverflow.com/q/24757473
tags question: http://stackoverflow.com/q/24808303
tags question: http://stackoverflow.com/q/24797197
tags question: http://stackoverflow.com/q/24894857
tags question: http://stackoverflow.com/q/24859490
tags question: http://stackoverflow.com/q/24884319
type: Tag
tags question: http://stackoverflow.com/q/24819099
tags question: http://stackoverflow.com/q/24889255
tags question: http://stackoverflow.com/q/24874402
tags question: http://stackoverflow.com/q/24786746
tags question: http://stackoverflow.com/q/24827256
tags question: http://stackoverflow.com/q/24887271
tags question: http://stackoverflow.com/q/24819528
tags question: http://stackoverflow.com/q/24902542
tags question: http://stackoverflow.com/q/24875598
tags question: http://stackoverflow.com/q/24798953
tags question: http://stackoverflow.com/q/24754235
tags question: http://stackoverflow.com/q/24893719
tags question: http://stackoverflow.com/q/24808884
tags question: http://stackoverflow.com/q/24873722
tags question: http://stackoverflow.com/q/24801655
tags question: http://stackoverflow.com/q/24881115

http://stackoverflow.com/comment/38629206
has text: Sorry, that was a bug...Its fixed now! The app really wasn't 100% ready yet...I just opened it up for you to see it. It will let you see the page now and you can see the .js code and the css content. Its pretty basic css. I'm not sure exactly what the problem would be with css. I'm not even getting consistent behavior on the infinite height. It seems to happen when I log in with one Facebook account but when I use a different one, it doesn't happen. It doesn't work in either case though. (Sorry, its taking so long)
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24870680

http://stackoverflow.com/comment/38680796
comment on: http://stackoverflow.com/a/24898826
has text: Correct, if you were running it locally your URI would be `http://localhost/test.html` and the `//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js` would correctly become `http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js`.
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/comment/38556257
score: 0
comment on: http://stackoverflow.com/q/24833175
type: Comment
type: QuestionComment
has text: I'm not sure if we're on the same line already... to display each item individually in your filteringselect, you need an array of objects, not an array of strings nor an array of a single object. Is that what you want?

http://stackoverflow.com/q/24868047
has title: Changing jQuery Countdown
has comment: http://stackoverflow.com/comment/38621747
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/24868128
score: 0
answer count: 1
tagged with: jquery
tagged with: countdown
has comment: http://stackoverflow.com/comment/38621929
has body: I have this code and i'm trying to amend it to this. Ive attached a JSFiddle This is the Code part that I want to change. $(document).ready(function() { $('#counter').countdown({ timestamp : (new Date()).getTime() + 51*24*60*60*1000 }); }); To this: $(document).ready(function() { $('#counter').countDown({ timestamp : (new Date()).getTime() + { 'day': 1, 'month': 5, 'year': 2020, 'hour': 09, 'min': 0, 'sec': 0, 'utc': true }, omitWeeks: true }); }); })(jQuery); I been scratching my head for awhile on how to do it it returns the grey blocks which I want but the jQuery numbers keep flashing and disappear They do not countdown. Any help would be much appreciated.
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/q/24777570
has body: I have the following problem: I have a web page that show 2 images, when user selects one of these pictures, a javascript function must take this picture and send it to another server (with standard multipart post) I have only url of image, so first I download it via javascript, then I try to send it to server, follow my code function sendImgFromUrl(url){ var xhr = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.responseType = 'blob'; xhr.onload = function(e) { if (this.status == 200) { var reader = new FileReader(); reader.onloadend = function(){ var file = event.target.result; var resReq = new FormData(); resReq.append("service_name",service_name); resReq.append("file",file); $.ajax({ url: "myurl", data: resReq, type: 'POST', processData: false, contentType: false, async: false, complete : function(response){ console.log(response); } }); } reader.readAsBinaryString(this.response); } }; xhr.send(); } What I obtain is a call with an Object instead of (image)File -----------------------------201521280032720 Content-Disposition: form-data; name="file" [object FileReader] -----------------------------201521280032720
score: 0
tagged with: file
possible better answer: http://stackoverflow.com/a/24777618
tagged with: javascript
has answer: http://stackoverflow.com/a/24777618
tagged with: jquery
has answer: http://stackoverflow.com/a/24781956
type: AnsweredQuestion
has title: Upload file from url via javascript
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/24781956

http://stackoverflow.com/q/24832160
has answer: http://stackoverflow.com/a/24832276
tagged with: combobox
has title: Reload page after user clicks on combobox (with some rules)
answer count: 4
has answer: http://stackoverflow.com/a/24832403
type: Question
has body: I'm new in javascript and need I to reload the current page after user clicks on the options of combobox, but I have some rules. The two comboboxes: 0 1 2 3 Rules: user clicks on "0" in the first combobox, reload to comboA=0. user clicks on "1" in the first combobox, replaces "0" to "1" and reload to comboA=1 user clicks on "2" in the second combobox, concatenate and reload to comboA=1 & comboB=2 user clicks on "3" in the second combobox, replaces "2" to "3" and reload to comboA=1 comboB=3 The steps above need to be done in sequence. How the functions "Refresh" and "Refresh2" should be? Thanks.
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24832322
linked to: http://stackoverflow.com/q/7077770
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24832340

http://stackoverflow.com/comment/38449343
comment on: http://stackoverflow.com/q/24777110
type: Comment
type: QuestionComment
has text: (selections[i] === 'TelevisionInternet')
score: 3

http://stackoverflow.com/q/24902061
linked to: http://stackoverflow.com/q/49365663
has answer: http://stackoverflow.com/a/24902234
has comment: http://stackoverflow.com/comment/38687630
has comment: http://stackoverflow.com/comment/38686867
has comment: http://stackoverflow.com/comment/38686651
score: 51
has answer: http://stackoverflow.com/a/73409249
has answer: http://stackoverflow.com/a/26698403
has comment: http://stackoverflow.com/comment/38686765
has comment: http://stackoverflow.com/comment/38686110
has comment: http://stackoverflow.com/comment/38686147
has answer: http://stackoverflow.com/a/41664997
type: Question
linked to: http://stackoverflow.com/q/32540948
has comment: http://stackoverflow.com/comment/38686611
downvote count: 0
has answer: http://stackoverflow.com/a/45717189
tagged with: javascript
has comment: http://stackoverflow.com/comment/38686062
has answer: http://stackoverflow.com/a/54667225
has body: The closest I got to something close to Python's __repr__ is this: function User(name, password){ this.name = name; this.password = password; } User.prototype.toString = function(){ return this.name; }; var user = new User('example', 'password'); console.log(user.toString()) // but user.name would be even shorter Is there a way to represent an object as a string by default? Or am I going to have to just use object.variable to get the results I want?
has answer: http://stackoverflow.com/a/24902235
linked to: http://stackoverflow.com/q/6352484
has answer: http://stackoverflow.com/a/32866283
upvote count: 51
has title: Is there a __repr__ equivalent for JavaScript?
has answer: http://stackoverflow.com/a/52393193
tagged with: node.js
favorite count: 0
answer count: 9
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/51436073

http://stackoverflow.com/q/24817317
tagged with: css
has comment: http://stackoverflow.com/comment/38526986
answer count: 0
has body: http://oxfordhigh.oxfordschools.org/ this is the site that im working on and im having a problem with the header. It bounces whenever i scroll it down. This bug only occurs in IE and Chrome but in mozilla it seems fine(as i've checked on my end). this is the javascript that i've added on the site for the fixed header: &lt;script type="text/javascript"&gt; $(window).scroll(function () { if ($(this).scrollTop() &gt; 0 &amp;&amp; $(window).width() &gt; 1000) { $('#main').css("marginTop", "220px"); $('.breadcrumb-wrapper').addClass("bread-fix-to-top"); $('#header').addClass("fix-to-top"); } else { $('#main').css("marginTop", "0"); $('.breadcrumb-wrapper').removeClass("bread-fix-to-top"); $('#header').removeClass("fix-to-top"); } }); &lt;/script&gt; Any idea on how to fix this kind of issue?
has comment: http://stackoverflow.com/comment/38525645
tagged with: bounce
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38525654
has comment: http://stackoverflow.com/comment/38526961
type: Question
has title: How to remove the bounce on the header?
has comment: http://stackoverflow.com/comment/38526235
has comment: http://stackoverflow.com/comment/38525904
tagged with: fixed
has comment: http://stackoverflow.com/comment/38526854
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38525926

http://stackoverflow.com/a/24895258
has comment: http://stackoverflow.com/comment/38673341
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
score: 2
has body: $('input[name="firstName"]"]').focus(function() { $(".update-change").removeAttr('disabled'); }).blur(function() { if ($(this).val() == '') { $(".update-change").attr('disabled', 'disabled'); } });
accepted answer of: http://stackoverflow.com/q/24895109
answers question: http://stackoverflow.com/q/24895109

http://stackoverflow.com/comment/38642307
type: AnswerComment
has text: @user3707261 well even so, it seems like our interpretation would produce the exact result you get. Are you sure your input is indeed what you think it is? I noticed you mentioned that `myArray` is an associative array - are you perhaps passing strings instead of numbers for the indexes, or vice versa? What's the type of `CurrentObject`?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24878105

http://stackoverflow.com/a/24873735
has comment: http://stackoverflow.com/comment/38633193
has comment: http://stackoverflow.com/comment/38632904
has comment: http://stackoverflow.com/comment/38633668
answers question: http://stackoverflow.com/q/24871301
has body: Your close method in Otalvaro.Views.Home is overriding the base close method, which means that every time you close that home view, you're not actually removing the view and, further, you're cloning the element: @$el = @$el.clone(); It could be that the closeTwitterWidget would help with some of that by removing the iframe, but I don't see where that's being called. Try changing the close method in your home view to just @remove() and see how it goes. Also, is the Twitter widget definitely loading inside the element for your home view?
has comment: http://stackoverflow.com/comment/38633829
score: 0
has comment: http://stackoverflow.com/comment/38633263
type: Answer

http://stackoverflow.com/comment/38593556
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24853362
has text: Could you post one example of `console.log(r);`

http://stackoverflow.com/a/24792164
has comment: http://stackoverflow.com/comment/38479120
has comment: http://stackoverflow.com/comment/38478964
answers question: http://stackoverflow.com/q/24792128
score: 0
has comment: http://stackoverflow.com/comment/38478815
type: Answer
has body: Set refreshDiv to be called after the site has loaded.

http://stackoverflow.com/a/24837520
has body: Using map in jquery data.dashLayout.dashlets = $.map(data.dashLayout.dashlets, function (dashList, indexpos) { if (dashList.rowNo == selectedrowno) { if (dashList.rowNo &lt; data.dashLayout.dashlets[index].rowNo || index == -1) { index = indexpos; } else { return dashList; } } });
type: Answer
score: 0
answers question: http://stackoverflow.com/q/24837039

http://stackoverflow.com/comment/38635966
type: Comment
comment on: http://stackoverflow.com/a/24875343
has text: Just edited the answer. Obviously you should retrieve the coordinates in `complete` callback of the $.animate(), namely after each movement. Does it make sense?
score: 0
type: AnswerComment

imacros
tags question: http://stackoverflow.com/q/24899457
tags question: http://stackoverflow.com/q/24857132
tags question: http://stackoverflow.com/q/24897487
type: Tag
tag name: imacros

http://stackoverflow.com/a/24865200
type: Answer
has body: we can get user data using access token,just make ajax call and you are done.use following code to get user data after successful signin. &lt;script type="text/javascript"&gt; (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/client:plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })(); function signinCallback(authResult) { if (authResult['status']['signed_in']) { console.log(authResult); document.getElementById('signinButton').setAttribute('style', 'display: none'); /* get google plus id */ $.ajax({ type: "GET", url: "https://www.googleapis.com/oauth2/v2/userinfo?access_token="+access_token }) .done(function( data ){ console.log(data); }); } else { console.log('Sign-in state: ' + authResult['error']); } } &lt;/script&gt; If you are trying to get user email address then change ajax with following: $.ajax({ type: "GET", url: "https://www.googleapis.com/plus/v1/people/me?access_token="+access_token }) see this link for more deatils about get user data using google plus api
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24863652
answers question: http://stackoverflow.com/q/24863652

http://stackoverflow.com/comment/38565966
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24838782
type: QuestionComment
has text: OK thanks everyone. The code is fine. It's just me who had to change another script by focus() instead of keyup(). Use it if you want it works perfectly

http://stackoverflow.com/q/24799629
tagged with: jquery
downvote count: 1
favorite count: 0
tagged with: loading
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24799996
has title: Detecting browser loading
score: 1
has body: I was just wondering about this, and I haven't found a good answer so far, so I thought I'd just ask it here. What I'm wondering is, if it's possible to detect browser loading actions. And just to be clear, I'm not talking specificly AJAX request nor the initial loading of the page. I'm talking about everything the browser loads, so IFrames, jQuery loads, requests. I know that AJAX requests are detectable, but as for image loading, or IFrames not so much. And I'd like for this to be as dynamic as possible, ie. nothing added to the DOM structure whatsoever. Well, that's it really, I thought that this would be an interesting thingy. Anyway, thanks for reading and have a nice day. ;)
type: Question
upvote count: 2
tagged with: browser
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/38638142
type: QuestionComment
has text: Factory and Services are singletons - they are global. But you can implement a getInstance() that returns a new object every time its called.
comment on: http://stackoverflow.com/q/24856734
score: 0
type: Comment

http://stackoverflow.com/a/24774247
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24771471
has body: Vertical panning is supported! The getting started page explains this. var mc = new Hammer.Manager(element); mc.add(new Hammer.Pan({ direction: Hammer.DIRECTION_VERTICAL }); mc.on("pan", function(ev) { console.log(ev); });
answers question: http://stackoverflow.com/q/24771471
score: 1
has comment: http://stackoverflow.com/comment/38483994
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38712555

http://stackoverflow.com/comment/38473041
score: 0
comment on: http://stackoverflow.com/q/24789119
type: Comment
type: QuestionComment
has text: If the logic isnt working, its probably not getting the controller from the scope. You need to expose it in the directive, otherwise it has no access to it. Regarding the styles- thats a bit weird. If you call $digest manually on one of the views after they load, does it work?

http://stackoverflow.com/a/24812772
downvote count: 0
has body: You're returning the promise in the wrong place. Authenticated needs to be a function that returns a promise but you're just returning the promise in the the .then() function and then authenticated is returning undefined: resolve: { authenticated: ['$q', 'AccountService', function ($q, accountService) { var deferred = $q.defer(); accountService.userLoggedIn().then(function (loggedIn) { if (loggedIn) { deferred.resolve(); } else { deferred.reject('Not logged in'); &lt;-- This happens } }); return deferred.promise; }] }
type: Answer
accepted answer of: http://stackoverflow.com/q/24812682
upvote count: 20
answers question: http://stackoverflow.com/q/24812682
score: 20
type: AcceptedAnswer

http://stackoverflow.com/q/24800391
type: AnsweredQuestion
has body: I am building an extension that redirect to google.com if the URL is in a black list. I store the black list in a file "list.txt" locally and use XMLHttpRequest to retrieve the list of URL. The problem I am having is that the chrome.webRequest.onBeforeRequest only redirect if the URL is the last one in the list. Here is my code: var list = ["something.something/something"]; var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if (xhr.readyState == 4 &amp;&amp; xhr.status == 200) { list = xhr.responseText.split(/\n/); abc(); } } xhr.open("GET", chrome.extension.getURL('text/list.txt'), true); xhr.send(null); function abc() { chrome.webRequest.onBeforeRequest.addListener( function (details) { return {redirectUrl: "https://google.com"}; }, {urls: list, types: []}, ["blocking"]); } File "list.txt" is: *://*.domain1.com/* *://*.domain2.com/* *://*.domain3.com/* *://*.domain4.com/* Is only redirect if the URL is domain4.com. Please help. Note that I declare var list = ["something.something/something"]; Because chrome.webRequest.onBeforeRequest will redirect every URL if the list is empty.
tagged with: http-redirect
type: Question
score: 0
has title: chrome.webRequest.onBeforeRequest Only Redirect the last URL
answer count: 1
tagged with: javascript
tagged with: google-chrome-extension
tagged with: xmlhttprequest
has answer: http://stackoverflow.com/a/24807168
accepted answer: http://stackoverflow.com/a/24807168

http://stackoverflow.com/q/24907266
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38695541
score: 0
has answer: http://stackoverflow.com/a/24909467
has body: I have got a div with a class "select": 1 2 3 I use the second label tag to apply my own checkbox in a span tag: input[type="checkbox"] { display:none; } input[type="checkbox"] + label span { display:inline-block; background:url(/images/checkbox.png) left top no-repeat; } input[type="checkbox"]:checked + label span { background:url(/images/checkbox.png) -15px top no-repeat; } now, I have got a string array, ARRAY, which can be "1" or "2" or "3" or a combination of them: "1","2" or "3","1" or "2","1","3" and so on. Lets say the ARRAY = ["3","1"]; The Idea is to sort the div elements according to the ARRAY order in the first place and checked and elements which are not offered in the ARRAY, should be at the bottom of the div. --------- |[ ] 1 | |[ ] 2 | |[ ] 3 | --------- the ARRAY has only order ["3","1"]. "2" is not there try to get: --------- |[x] 3 | |[x] 1 | |[ ] 2 | --------- Can somebody offer a logic or an algorithm? I am stack.
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/38695601
type: Question
tagged with: javascript
has title: a list which has to be reordered according to the string array output
tagged with: jquery
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/38433475
score: 1
type: Comment
type: QuestionComment
has text: Is this for a site you own or one you're visiting? If you own it, simply modify the markup to not include the ` ` in question. If it's for one you're visiting, then this may be a better fit for [Super User](http://superuser.com/) than Stack Overflow.
comment on: http://stackoverflow.com/q/24768497

grunt-contrib-uglify
tags question: http://stackoverflow.com/q/24846519
tags question: http://stackoverflow.com/q/24844061
type: Tag
tag name: grunt-contrib-uglify
tags question: http://stackoverflow.com/q/24860277

http://stackoverflow.com/comment/38410681
score: 0
type: Comment
has text: Yes that would be good then I only need to add an index number to call both 'Image' and 'Description'
comment on: http://stackoverflow.com/a/24752359
type: AnswerComment

http://stackoverflow.com/q/24902918
has comment: http://stackoverflow.com/comment/38727318
answer count: 1
has body: Although the natural progression would replace the fixture adapter with another adapter, I'd like to retain fixtures for development environment while leveraging a different Ember data adapter for production. This is due to: Heavy iterations of progressive enhancement Intended to run embedded in a UIWebView from an iOS app, production configuration is tightly coupled with bridged calls to native assembly for data. Ember CLI asset compilation is based on broccoli to load either a Web or Native API: app.import({ development: 'vendor/company/WebAPI.js', production: 'vendor/company/NativeAPI.js' }); However, I'm unsure how to leverage this pattern to change adapters. Development Environment For development, I want to use mock data or http services to enable testing in browser. Therefore, launching Ember server in development environment leverages fixtures. ember server --environment=development This configuration would extend FixtureAdapter for development: var ApplicationAdapter = DS.FixtureAdapter.extend({ /* ... */ }); export default ApplicationAdapter; Production Environment However, the complexity is production environment where different adapters are needed. When launching Ember server in production, services are provided via a bridge:// scheme where the native iOS app is managing transport layer and data models. ember server --environment=production This configuration would extend the base Adapter for production: var ApplicationAdapter = DS.Adapter.extend({ /* ... */ }); export default ApplicationAdapter; How can multiple adapters be used in an Ember app? How is the adapter swapped in the App, or perhaps the store from the route would define a different adapter?
tagged with: ember-cli
favorite count: 0
tagged with: ember.js
accepted answer: http://stackoverflow.com/a/26288058
type: AnsweredQuestion
score: 7
upvote count: 7
has answer: http://stackoverflow.com/a/26288058
type: Question
has title: Retain fixtures with multiple adapters per Ember environment
tagged with: ember-data
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/24814845
answers question: http://stackoverflow.com/q/24814569
has body: try this: var str = "This is the match [more] or [less]"; var you_arr = str.match(/(\[.*?\])/g); resultant your_arr: ("[more]","[less]")
downvote count: 0
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/38626654
type: AnswerComment
comment on: http://stackoverflow.com/a/24870567
type: Comment
has text: Just pass in `"#washington` instead of `.washington`.
score: 0

http://stackoverflow.com/comment/38471002
comment on: http://stackoverflow.com/q/24787921
score: 0
type: Comment
type: QuestionComment
has text: You can try to set the dataType argument to "xml". function cargar(e) { $.ajax({ url:'perros.xml', success:procesar, dataType:'xml'}); e.preventDefault(); }

http://stackoverflow.com/comment/38522970
type: QuestionComment
score: 2
has text: If you're worried about this, you probably shouldn't be writing this in JavaScript. V8 is fast, but very far from optimal.
comment on: http://stackoverflow.com/q/24815912
type: Comment

http://stackoverflow.com/a/25097251
answers question: http://stackoverflow.com/q/24784792
type: Answer
has body: for me, the question is now clearly a Java 8 bug. I found the workaround to integrate the Java 7 JavaScript engine into my project. This should work until the bug is fixed. See this description on how to do it: https://wiki.openjdk.java.net/display/Nashorn/Using+Rhino+JSR-223+engine+with+JDK8 cu Frank
score: 0

http://stackoverflow.com/q/24798464
has answer: http://stackoverflow.com/a/24800018
has body: What's the problem let's say I want do a query on my MongoDB and display the result in a table. Some documents have more or less fields then others do - which is fine for me. But I run into a problem on the client side. I'm using "mongoose" with a model to retrieve the data via NodeJS and then on the client, I'm using "knockout.js" to bind the list to the table. Now that's where the problem occurs - as soon as any field does not exist, but is bound in the table, KO will throw an exception and stop processing. What did I try I tried to define a default value on the mongoose-model, but this does not add non-existing fields. Additionally it would increase the payload going over the wire ;-( I tried "knockout.punches" and the "default" text-filter which works fine, but only when the value is null or empty. Undefined still throws an exception. I tried several approaches to use the extend-mechanism of KO, but either I have to write a wired syntax in the binding or it also does not work for undefined. Another possibility I did not try so far could be creating a model on the client and then map it to the response - honestly I just don't want to do that, because in most cases the data-structure from the DB is totally fine and it would just mean additional effort. What I'm looking for Does anyone has a solution to either automatically add missing fields from the mongoose model to the response or get it running so that KO does not stop processing for undefined fields (is there maybe some parameter). In my case it's an observableArray, most workarounds and solutions here were regarding single fields. So interesting would be a solution for a list with undefined fields. Thanks [{"firstname":"Foo", "lastname":"Bar"},{"firstname":"John"}]; self.allUsers = ko.observableArray(); self.onResponseAllUsers = function (response) { if (response &amp;&amp; response.length &gt; 0) { self.allUsers(response); } }; &lt;tbody data-bind="foreach: allUsers"&gt; &lt;tr&gt; &lt;td data-bind="text: f…
tagged with: knockout.js
type: Question
tagged with: mongodb
tagged with: mongoose
tagged with: javascript
score: 0
has title: Binding undefined fields from observableArray or providing default
answer count: 1
accepted answer: http://stackoverflow.com/a/24800018
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/a/24808076
answers question: http://stackoverflow.com/q/24790002
has comment: http://stackoverflow.com/comment/80687221
has comment: http://stackoverflow.com/comment/38509625
downvote count: 1
upvote count: 5
score: 4
has comment: http://stackoverflow.com/comment/38517593
has body: There's also another tricky way to do it : Go over the element which makes your tooltip appear. Right click to open the contextual menu. Move your mouse to your dev tool window and left click anywhere in the dev tool panel. Your tooltip will stay visible, you will then be able to inspect it in the Element tab. Tested on Chrome. Doesn't seem to work on Firefox.
type: Answer

http://stackoverflow.com/comment/38522545
score: 0
type: Comment
has text: combined.. it is the array of object.something like this { {"a" :1,"b": 2,"c":3}, {"a" :3,"b": 4,"c":5}, {"a" :1,"b": 2,"c":3} }
comment on: http://stackoverflow.com/a/24815638
type: AnswerComment

http://stackoverflow.com/comment/38589159
comment on: http://stackoverflow.com/q/24851135
type: Comment
type: QuestionComment
score: 0
has text: Actually I use both `socketio` and `PHP` in my web app. And the `user session` is stored on PHP side. ~~

http://stackoverflow.com/q/24818202
has answer: http://stackoverflow.com/a/35571068
tagged with: javascript
answer count: 3
upvote count: 7
favorite count: 0
tagged with: promise
has body: I'm using NodeJS, with bcrypt-nodejs (https://github.com/shaneGirish/bcrypt-nodejs) and Bluebird for promises. Came up with this code and been wondering if there is better way to do the same thing. I have module with: var Promise = require("bluebird"), bcrypt = Promise.promisifyAll(require('bcrypt-nodejs')); // ....[some othe code here] Users.prototype.setPassword = function(user) { return bcrypt.genSaltAsync(10).then(function(result) { return bcrypt.hashAsync(user.password, result); }); }; then from another module I call users.setPassword as below: app.post('/api/v1/users/set-password', function(req, res, next) { users.setPassword(req.body).then(function(result) { // Store hash in your password DB. console.log(result[1]); res.json({ success: true }) }) .catch(function(err) { console.log(err); }); }); It always ends up with "[Error: No callback function was given.]" message as bcrypt.hashAsync seems to require 4 parameters. Original, non-promisified hash method requires 3 only though. When I add empty callback to hashAsync, it works fine: Users.prototype.setPassword = function(user) { return bcrypt.genSaltAsync(10).then(function(result) { return bcrypt.hashAsync(user.password, result,function() {}); }); }; Is there any better way to do this, without providing empty callback as above? EDIT: In response to Bergi's comment.. the function will set password eventually, I just didn't get that far when posted the question. Now got this far, please let me know if something is not quite right though: Users.prototype.setPassword = function(user) { return bcrypt.genSaltAsync(10).then(function(result) { return bcrypt.hashAsync(user.password, result, null); }) .then(function(result) { // store in database console.log("stored in database!"); return result; }); };
has comment: http://stackoverflow.com/comment/38530369
has title: Promisifying bcrypt-nodejs with Bluebird
has answer: http://stackoverflow.com/a/24849764
tagged with: node.js
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/35571068
tagged with: bluebird
downvote count: 0
has answer: http://stackoverflow.com/a/24820172
accepted answer: http://stackoverflow.com/a/24820172
score: 7
type: Question

http://stackoverflow.com/a/24758841
answers question: http://stackoverflow.com/q/24758776
score: 5
upvote count: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/38414968
has comment: http://stackoverflow.com/comment/38415039
type: Answer
has body: Try to use .filter() with its call back to accomplish your task, $('section.imagesec[img-width]').filter(function(){ return (parseInt($(this).attr('img-width'),10) &lt; 350); }).hide(); DEMO
has comment: http://stackoverflow.com/comment/38415002
has comment: http://stackoverflow.com/comment/38415110
has comment: http://stackoverflow.com/comment/38415207
has comment: http://stackoverflow.com/comment/38415312
has comment: http://stackoverflow.com/comment/38415067

http://stackoverflow.com/q/24847284
has answer: http://stackoverflow.com/a/54901029
answer count: 2
possible better answer: http://stackoverflow.com/a/54901029
tagged with: jquery
has comment: http://stackoverflow.com/comment/38581634
favorite count: 0
accepted answer: http://stackoverflow.com/a/24847292
has comment: http://stackoverflow.com/comment/38581689
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
score: 3
upvote count: 3
has title: How to remove whitespace from input during Jquery keyup event before displaying
type: Question
has answer: http://stackoverflow.com/a/24847292
downvote count: 0
has body: flat1: price1: <input type="text" name="org_price[]" class="" value="" flat2: price2: <input type="text" name="org_price[]" class="" value="" flat3: price3: <input type="text" name="org_price[]" class="" value="" flat4: price4: <input type="text" name="org_price[]" class="" value="" flat5: price5: <input type="text" name="org_price[]" class="" value="" flat6: price6: <input type="text" name="org_price[]" class="" value="" flat7: price7: <input type="text" name="org_price[]" class="" value="" flat8: price8: <input type="text" name="org_price[]" class="" value="" flat9: price9: <input type="text" name="org_price[]" class="" value="" flat10: price10: <input type="text" name="org_price[]" class="" value="" I want to display what is typed in .flat input box to .new_price input box on keyup Jquery event. I've accomplished this, but now I want to remove white space from displaying in the .new_price input. I attempted to use the replace method with no luck. http://jsfiddle.net/qsDn5/3/ $(document).ready(function(){ $('.flat').on('keyup',function(e) { $( this ).siblings(".new_price").eq(0).val ( $(this).val() ); }); });
tagged with: javascript

http://stackoverflow.com/comment/38454200
type: QuestionComment
comment on: http://stackoverflow.com/q/24779637
has text: What error are you getting ?
score: 0
type: Comment

http://stackoverflow.com/a/24812967
accepted answer of: http://stackoverflow.com/q/24810864
has body: You already got it, before your JSON can be parsed into your data model it needs to be in the form: [ { "role": "admin" }, { "role": "user" }, { "role": "developer" }, { "role": "super" } ] ... but if you're rocking ExtJS 5.x you don't need to manually make the Ajax call - you can apply a transform on the proxy's reader, for example: Ext.create('Ext.data.Store', { model: 'RoleModel', proxy: { type: 'ajax', url : '/roles', reader: { type: 'json', transform: function(data) { return data.map(function(x){ return { role: x }; }); } } } }); &raquo; Fiddle
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24810864
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/q/24831299
has title: Conditional formatting of table with angular and javascript
tagged with: angularjs
type: UnansweredQuestion
tagged with: css
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38555401
type: Question
has body: How would I go about conditioning below table for when the lastPingedTimeAsString reaches a 5 minute mark and changes the color of the text from green to red, and vice versa. &lt;form name="myform" data-ng-submit="submit()" data-ng-controller="Ctrl" id="submitForm"&gt; &lt;p data-ng-repeat="beat in beats"&gt; Station ID: {{ beat.stationID }} Uptime: &lt;/p&gt; &lt;input type="submit" id="submit" value="Submit" /&gt; &lt;/form&gt; I've looked up several pages on here describing how to use formatting by class, but haven't gotten it to work out correctly. EDIT: To be more clear I need to know how to create the function that determines 5 minutes has elapsed and turn the result from green to red. Sorry for the confusion. EDIT2: Here is the original sample (not formatted at all). I will integrate the new code now. Station ID: default Uptime: Jul 18 2014 2:09PM
has answer: http://stackoverflow.com/a/24831445
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/comment/38502748
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24800375
score: 0
has text: Could you put your code in a [Fiddle](http://jsfiddle.net/), so someone could have a look.

http://stackoverflow.com/a/24760310
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24760214
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24760214
has body: That's because you are defining your controller 3 times in your template. You just need the ng-controller directive in your first div.
upvote count: 1

http://stackoverflow.com/comment/38461762
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24783404
has text: Thanks. I removed the p from the jQuery but still not working. Is there any way to do this also without using the siblings selector etc, as i may want to move the "edit" link to a sidebar in future.

http://stackoverflow.com/a/24859272
answers question: http://stackoverflow.com/q/24858703
score: 1
has comment: http://stackoverflow.com/comment/38605434
type: AcceptedAnswer
type: Answer
has body: Looks like a blank anchor tag does not work Jsfiddle - anchor tag dsadsdsad dsadsads $(document).ready(function () { console.log("ready!"); alert($(":focusable").length); });
upvote count: 2
downvote count: 1
accepted answer of: http://stackoverflow.com/q/24858703

http://stackoverflow.com/comment/38471480
has text: Aside from certain options backbone.js no longer attaches variables you pass in automatically.
score: 2
comment on: http://stackoverflow.com/q/24788451
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24750784
accepted answer of: http://stackoverflow.com/q/24750626
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24750626
has body: try this: var letters = ["a", "b", "c"]; var wordlength = 3; var word = ""; for(var i = 0; i &lt; wordlength; i++){ word += letters[Math.floor(Math.random() * letters.length)]; } alert(word);
type: Answer

http://stackoverflow.com/comment/38428651
score: 1
comment on: http://stackoverflow.com/q/24766107
type: Comment
type: QuestionComment
has text: Have you tried using `document.URL.length`?

timer
tag name: timer
tags question: http://stackoverflow.com/q/24887706
type: Tag
tags question: http://stackoverflow.com/q/24873004

http://stackoverflow.com/comment/38681154
has text: OMG! Thank you so much! Getting no error almost made me insane!!! Can I ask where did you test it? Which browser or debugging software? I've managed to make it work with your help! Thank you!
comment on: http://stackoverflow.com/q/24875192
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24901314
tagged with: angularjs
has title: How to organize many Angular.js constants?
has body: I am working on an Angular.js and Rails application, and am using asset_path(...) calls for all my templates. Instead of having these littered all over my app, I'd like to have them stored in a single file to make testing easier. I know of $provide.constant, but since each constant has to be injected as a dependency, I have some functions which end up having a long list of dependencies, e.g. my routes file. Is there a better way to organize my template paths? I thought of making a factory just for holding all my constants, so any controller could just inject the one factory to get any paths it needs.
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: ruby-on-rails
type: Question
has comment: http://stackoverflow.com/comment/38684829
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0

http://stackoverflow.com/a/24759099
has body: Pretty simple. Set the interval to a variable then clear it. var refreshIntervalId = setInterval(fname, 10000); /* later */ clearInterval(refreshIntervalId); Stop setInterval call in JavaScript
accepted answer of: http://stackoverflow.com/q/24759055
score: 5
type: Answer
answers question: http://stackoverflow.com/q/24759055
type: AcceptedAnswer
upvote count: 5
downvote count: 0

http://stackoverflow.com/q/24852288
tagged with: javascript
has title: convert image to base64 using javascript
has body: function convertImgToBase64(url){ var canvas = document.createElement('CANVAS'); var ctx = canvas.getContext('2d'); var img = new Image; img.crossOrigin = 'Anonymous'; img.onload = function(){ canvas.height = img.height; canvas.width = img.width; ctx.drawImage(img,0,0); var dataURL = canvas.toDataURL('image/png',""); alert(dataURL); canvas = null; }; img.src = url; } var url_to_be_converted = "http://www.google.com/image/sample" convertImgToBase64(url_to_be_converted); Alert(dataURL) does not showing any result.No pop up is generated there? How to solve this? What wrong there?
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/38591397
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/24852565
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/38591907
type: Question
has comment: http://stackoverflow.com/comment/38591376
tagged with: canvas
accepted answer: http://stackoverflow.com/a/24852565

http://stackoverflow.com/q/24805737
answer count: 2
possible better answer: http://stackoverflow.com/a/24806491
has answer: http://stackoverflow.com/a/24806491
accepted answer: http://stackoverflow.com/a/24806336
tagged with: upload
tagged with: javascript
tagged with: jquery
score: 0
has title: jQuery image preview for multiple image upload
tagged with: preview
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24806336
type: Question
has body: I am using this code in my image uploader: Html: &lt;input type="file" id="files" name="files[]" multiple /&gt; &lt;ul id="list"&gt;&lt;/ul&gt; JS: function handleFileSelect(evt) { var files = evt.target.files; // FileList object for (var i = 0, f; f = files[i]; i++) { if (!f.type.match('image.*')) { continue; } var reader = new FileReader(); reader.onload = (function(theFile) { return function(e) { var li = document.createElement('li'); li.innerHTML = ['&lt;img class="thumb" src="', e.target.result, '" title="', escape(theFile.name), '"/&gt;&lt;input type="text" class="rename" name="',i,'" value="',escape(theFile.name),'"&gt;&lt;input type="text" class="reorder" name="',i,'" value="',i,'"&gt;'].join(''); document.getElementById('list').insertBefore(li, null); }; })(f); reader.readAsDataURL(f); } } document.getElementById('files').addEventListener('change', handleFileSelect, false); My problem is when it gets to reader.onload, the for loop is done so i = #of images not image # like I want it to be. Is there any way to fix this so the name of my inputs is the image # of the image they're next to?

http://stackoverflow.com/a/24847780
answers question: http://stackoverflow.com/q/24847656
upvote count: 1
has comment: http://stackoverflow.com/comment/38598768
score: 1
downvote count: 0
has body: Something like this should work var mySchema = new mongoose.Schema({ stuff1 :{type:String}, stuff2 :{type:Number}, array :[{arraystuff1:{type:String}}] }); Here is a link where you can find information about it http://mongoosejs.com/docs/guide.html
type: Answer

http://stackoverflow.com/a/24844435
has body: Add the event to the actual contentWindow (or browser) and stop it there. Of course, this will still not allow the event to bubble down again, i.e. it will prevent the Bubbling Phase and Target Phase.
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/24834817
has comment: http://stackoverflow.com/comment/38578288
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24834817
has comment: http://stackoverflow.com/comment/38578523
type: Answer

http://stackoverflow.com/a/24764600
score: -1
accepted answer of: http://stackoverflow.com/q/24764578
answers question: http://stackoverflow.com/q/24764578
upvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38425884
type: Answer
has comment: http://stackoverflow.com/comment/38426125
has comment: http://stackoverflow.com/comment/38425957
downvote count: 1
has comment: http://stackoverflow.com/comment/38425837
has body: You do that this way: Person.prototype.getName = function () { return this.name; }; If you want to use an existing function then you do this: Person.prototype.getName = whatName; whatName is the name of the previous declared function

http://stackoverflow.com/a/24909785
accepted answer of: http://stackoverflow.com/q/24904503
has body: Ensure that you have created the Windows Phone project in VS. If you can run it on the device then it should work with the following. Taken from this site: http://sviluppomobile.blogspot.cz/2013/03/how-to-debug-windows-phone-html5-apps.html You can verify if the server started by opening a browser page and loading 127.0.01:8080 (8080 is the default port for Weinre). If you are seeing this page then the server is running: Now click on the Debug Client User Interface link where you will be able to see if any client is connected and debug the connected clients. Let's create the Windows Phone HTML5 application. Use the SDK template to create a new project, open the page index.html inside the folder Html and add this line to the head section: &lt;script src="http://[the server ip]:8080/target/target-script-min.js#anonymous"&gt;&lt;/script&gt; replace [the server ip] with the IP of the PC running the Winre server and run the application. If everything went as we expected in the Debug Client user Interface on the Server we should see one Target connected: Once the target Windows Phone page is connected you can inspect and change the DOM in real-time Failing that you can always run the site in IE11 and change its settings to emulate a Windows Phone device, then use the inbuilt IE debug tools, but that obviously doesn't debug on the device...
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/24904503
score: 3

http://stackoverflow.com/a/24830141
has comment: http://stackoverflow.com/comment/39000961
has body: You don't have to build a binary addon to interoperate with your C++ code. Perhaps you could turn the C++ code into a command line tool? You can then use the child_process module in node to spawn a process of your DSP tool and use some kind of IPC (inter-process communication) such as Unix sockets to communicate between node and c++. This way you eradicate the need for too much C++ glue code. Child Process: http://nodejs.org/api/child_process.html Net (for sockets): http://nodejs.org/api/net.html It would only be as slow as your individual components. Node wouldn't block while waiting for data from your C++, so can be doing other things (responding to HTTP requests etc). Another option for IPC is to use a message passing library such as zeromq. zeromq c++ bindings: http://zeromq.org/bindings:cpp zeromq node binding: http://zeromq.org/bindings:node-js
accepted answer of: http://stackoverflow.com/q/24830093
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38999972
type: Answer
answers question: http://stackoverflow.com/q/24830093

http://stackoverflow.com/comment/82611660
score: 0
type: Comment
type: QuestionComment
has text: Related on the security settings portion - https://stackoverflow.com/questions/32177060/hta-safety-settings-on-this-computer-prohibit-accessing-a-data-source-on-anot
comment on: http://stackoverflow.com/q/24778918

http://stackoverflow.com/a/24757957
answers question: http://stackoverflow.com/q/24756826
score: 0
type: Answer
has body: You just need to add a extra div above the div on which you are applying redactor editor, and on the click of that div just initialize your editor. Fiddle $(function(){ $('#upperDiv').click(function(){ $.getScript("http://imperavi.com/js/redactor/redactor.js",function(){ $('#article').redactor(); }); }); });

http://stackoverflow.com/a/24761369
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24761256
type: Answer
accepted answer of: http://stackoverflow.com/q/24761256
has body: Edit Corrected following DNNX's comment. I think you need to convert it to json (a subset of JavaScript) before rendering: require "json" ... var loc = &lt;%= @locations.to_json.html_safe %&gt;
downvote count: 0
has comment: http://stackoverflow.com/comment/38420557
has comment: http://stackoverflow.com/comment/38420060
score: 1

http://stackoverflow.com/comment/38527469
type: Comment
has text: I insist you to please see the fiddle link that i have posted. here as a parameter of getDateFormat function i have passed new Date() which contains today date and time. For your output see the result in console.
comment on: http://stackoverflow.com/a/24817848
type: AnswerComment
score: 0

http://stackoverflow.com/q/24808239
answer count: 0
type: UnansweredQuestion
tagged with: php
type: Question
tagged with: cookies
has comment: http://stackoverflow.com/comment/38509725
has comment: http://stackoverflow.com/comment/38508452
has title: Getting cookies set by javascript using PHP curl
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38508360
score: 0
tagged with: curl
has body: I'm trying to log into a website, but it seems that the cookies set when logging in, are set using jquery/javascript. Since I am attempting to log in using PHP, the code is unable to pick them up. I can see the value for the cookie as it would be when set, because it comes in the response to my form submission, but it does not set the cookie because the PHP doesn't seem to interpret the javascript. Is there a way to make this work?

http://stackoverflow.com/q/24907229
tagged with: es6-proxy
has answer: http://stackoverflow.com/a/32553145
tagged with: javascript
has body: Is this even possible? How about other browsers? Any estimates when es6 will be "ready" and rolled out? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy btw. https://github.com/tvcutsem/harmony-reflect Proxy does not work with current chrome (36.0.n)
has answer: http://stackoverflow.com/a/30923652
downvote count: 0
favorite count: 0
tagged with: polyfills
upvote count: 8
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/36051623
answer count: 4
score: 8
has answer: http://stackoverflow.com/a/34520059
has title: Is there Proxy-object polyfill available google chrome?
tagged with: google-chrome
type: Question

http://stackoverflow.com/q/24831323
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24832121
has body: Is it possible to inject a constant into another constant with AngularJS? e.g. var app = angular.module('myApp'); app.constant('foo', { message: "Hello" } ); app.constant('bar', ['foo', function(foo) { return { message: foo.message + ' World!' } }]); I need the use of an angular constant because I need to inject this into a config routine. i.e. app.config(['bar', function(bar) { console.log(bar.message); }]); I know that you can only inject constants and providers into config routines, and my understanding is that you can do dependency injection into providers, however, it does not seem to be the best method for this sort of scenario... Thanks in advance for your help!
has answer: http://stackoverflow.com/a/52730299
downvote count: 0
answer count: 7
has answer: http://stackoverflow.com/a/24832121
favorite count: 0
possible better answer: http://stackoverflow.com/a/45169425
tagged with: angularjs
upvote count: 41
has answer: http://stackoverflow.com/a/24831612
tagged with: constants
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38554844
score: 41
has comment: http://stackoverflow.com/comment/38552549
has title: AngularJS constants
has answer: http://stackoverflow.com/a/45169425
type: Question
has answer: http://stackoverflow.com/a/33299876
has answer: http://stackoverflow.com/a/24831613
has answer: http://stackoverflow.com/a/49161593

http://stackoverflow.com/comment/38482491
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24794276
has text: You might want to read up on what the `&&` and `||` operators do: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#Logical_operators
score: 0

http://stackoverflow.com/q/24894916
has title: Javascript Alphanumeric String Comparison
has answer: http://stackoverflow.com/a/68481912
upvote count: 2
score: 2
type: AnsweredQuestion
tagged with: alphanumeric
accepted answer: http://stackoverflow.com/a/24894944
type: Question
has body: I have a list of string 'X1','X2','X3','S1','S2','S3',etc. I want to do the following comparison var string = INPUT STRING; if( string &gt; 'X10' ){ DO THIS }else{ DO THAT } In this case, if the input string is 'X8' then my code is returning X8 IS GREATER than X10. If there a way I can truly get X10 > X8?
tagged with: javascript
has comment: http://stackoverflow.com/comment/38672467
has comment: http://stackoverflow.com/comment/38672756
answer count: 2
has comment: http://stackoverflow.com/comment/38672773
tagged with: string-comparison
downvote count: 0
has answer: http://stackoverflow.com/a/24894944
favorite count: 0
possible better answer: http://stackoverflow.com/a/68481912

http://stackoverflow.com/a/24754783
answers question: http://stackoverflow.com/q/24754561
has body: It's possible with some tricky code. $(document).ready(function() { open($('select')); }); function open(elem) { if (document.createEvent) { var e = document.createEvent("MouseEvents"); e.initMouseEvent("mousedown", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); elem[0].dispatchEvent(e); } else if (element.fireEvent) { elem[0].fireEvent("onmousedown"); } } See this JSFiddle From: Simulate click on select element with jQuery
accepted answer of: http://stackoverflow.com/q/24754561
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/24878297
possible better answer: http://stackoverflow.com/a/24878391
has answer: http://stackoverflow.com/a/24878391
has answer: http://stackoverflow.com/a/24878370
has body: I tried to trigger fullscreen using javascript by clicking the button. fullscreen it works. but I would like to trigger it automatically by adding $(document).ready(function() { $("#fullscreen").click(); }); then it doesn't work. can anyone help?
has title: javascript trigger fullscreen
upvote count: 1
has comment: http://stackoverflow.com/comment/38641873
tagged with: fullscreen
has comment: http://stackoverflow.com/comment/38641239
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24878330
accepted answer: http://stackoverflow.com/a/24878370
score: -3
type: Question
downvote count: 4
answer count: 3
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38641271

http://stackoverflow.com/a/24764760
has comment: http://stackoverflow.com/comment/38426354
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38430048
has comment: http://stackoverflow.com/comment/38426187
has comment: http://stackoverflow.com/comment/38427327
type: Answer
accepted answer of: http://stackoverflow.com/q/24764680
has comment: http://stackoverflow.com/comment/38426478
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/24764680
has comment: http://stackoverflow.com/comment/38426559
has comment: http://stackoverflow.com/comment/38426601
has comment: http://stackoverflow.com/comment/38426333
has comment: http://stackoverflow.com/comment/38427696
has body: Try this syntax: .animate( properties, options ) jQuery( '.front-page-content-wrap' ).animate( {marginTop: 0, opacity: 1}, 600, function(){ jQuery( "#box-button-1" ).animate( { bottom: 78, opacity: 1 }, { easing: 'easeOutBounce', complete: function(){ jQuery( "#box-button-2" ).animate( { bottom: 78, opacity: 1 }, { easing: 'easeOutBounce', complete: function(){ jQuery( "#box-button-3" ).animate( { bottom: 78, opacity: 1 }, { easing: 'easeOutBounce' } ); }}); }}); }); http://jsfiddle.net/mblase75/42BjC/
upvote count: 2

http://stackoverflow.com/q/24805740
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/22610042
accepted answer: http://stackoverflow.com/a/24806373
has comment: http://stackoverflow.com/comment/38503619
has body: I have a 'test.html' and a 'test.php' files. The 'test.html': Hello And the 'test.php': <?php echo " "; echo " one "; echo " two "; echo " three "; echo " "; ?> When i click the 'p' item (Hello), then the jQuery load a new content into 'p'. But when i change a select item, I would like to see the alert messages, but it will not appear. How can I solve this?
type: Question
duplicate of: http://stackoverflow.com/q/22610042
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
has title: jQuery load and change
has comment: http://stackoverflow.com/comment/38503389
has answer: http://stackoverflow.com/a/24806373
possible better answer: http://stackoverflow.com/a/24805957
has answer: http://stackoverflow.com/a/24805957
tagged with: php

http://stackoverflow.com/q/24829911
has comment: http://stackoverflow.com/comment/38549212
has comment: http://stackoverflow.com/comment/38549085
has comment: http://stackoverflow.com/comment/38549049
type: Question
has comment: http://stackoverflow.com/comment/38549100
has title: AngularJS $http.get not loading data
has comment: http://stackoverflow.com/comment/38549169
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38549574
tagged with: angularjs
answer count: 0
has body: I'm trying to load data from a json file but when I try to access through $http.get it just don't load, as if the file doesn't exists. This is my controllers.js: angular.module('QuizQuestions.controllers', []) .controller('Preguntas', function($scope,$http) { $http.get('data/preguntas.json').success(function(data) { $scope.questions = data; }); $scope.tags = [ { text: 'just' }, { text: 'some' }, { text: 'cool' }, { text: 'tags' } ]; }); Then in the view when I try to access the "tags" data it works perfectly, but when I try with "questions", it's empty. If I explicity declare the $scope.questions instead of calling a file with $http.get it works. Here my partial questions.html: Questions Question Tags Send {{question.text}} I'm not sure if I'm clear enough, please ask me if you don't understand anything.
type: UnansweredQuestion

http://stackoverflow.com/comment/38634399
has text: Your javascript function works fine, the problem is probably how you are calling it. Try adding console.info(email) to see what you are passing in.
comment on: http://stackoverflow.com/q/24874516
score: 0
type: Comment
type: QuestionComment

dom
tags question: http://stackoverflow.com/q/24874643
tags question: http://stackoverflow.com/q/24885069
tags question: http://stackoverflow.com/q/24751153
type: Tag
tags question: http://stackoverflow.com/q/24871067
tags question: http://stackoverflow.com/q/24807581
tags question: http://stackoverflow.com/q/24832876
tags question: http://stackoverflow.com/q/24873647
tags question: http://stackoverflow.com/q/24758776
tags question: http://stackoverflow.com/q/24833687
tags question: http://stackoverflow.com/q/24843985
tags question: http://stackoverflow.com/q/24846911
tags question: http://stackoverflow.com/q/24836621
tags question: http://stackoverflow.com/q/24905602
tags question: http://stackoverflow.com/q/24857146
tags question: http://stackoverflow.com/q/24903061
tags question: http://stackoverflow.com/q/24814575
tags question: http://stackoverflow.com/q/24804312
tags question: http://stackoverflow.com/q/24841855
tags question: http://stackoverflow.com/q/24867006
tags question: http://stackoverflow.com/q/24864719
tags question: http://stackoverflow.com/q/24810565
tags question: http://stackoverflow.com/q/24869761
tags question: http://stackoverflow.com/q/24862187
tags question: http://stackoverflow.com/q/24796252
tags question: http://stackoverflow.com/q/24839587
tags question: http://stackoverflow.com/q/24836213
tags question: http://stackoverflow.com/q/24908354
tags question: http://stackoverflow.com/q/24901119
tags question: http://stackoverflow.com/q/24792157
tags question: http://stackoverflow.com/q/24896559
tags question: http://stackoverflow.com/q/24766690
tags question: http://stackoverflow.com/q/24839383
tags question: http://stackoverflow.com/q/24895306
tags question: http://stackoverflow.com/q/24885455
tags question: http://stackoverflow.com/q/24843865
tags question: http://stackoverflow.com/q/24840083
tags question: http://stackoverflow.com/q/24769555
tags question: http://stackoverflow.com/q/24882721
tags question: http://stackoverflow.com/q/24751674
tags question: http://stackoverflow.com/q/24874636
tags question: http://stackoverflow.com/q/24864947
tags question: http://stackoverflow.com/q/24850845
tags question: http://stackoverflow.com/q/24767133
tags question: http://stackoverflow.com/q/24907693
tags question: http://stackoverflow.com/q/24906830
tags question: http://stackoverflow.com/q/24768497
tag name: dom
tags question: http://stackoverflow.com/q/24893588
tags question: http://stackoverflow.com/q/24859463
tags question: http://stackoverflow.com/q/24870626
tags question: http://stackoverflow.com/q/24852386
tags question: http://stackoverflow.com/q/24909102
tags question: http://stackoverflow.com/q/24793133
tags question: http://stackoverflow.com/q/24828089
tags question: http://stackoverflow.com/q/24830173
tags question: http://stackoverflow.com/q/24867624

http://stackoverflow.com/comment/38531569
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24820762
score: 0
has text: Please **do not** use abbreviations on this kind of terms. `JQ` is something else, which has nothing to do with `jQuery`.

http://stackoverflow.com/comment/38472600
type: Comment
has text: ReferenceError: data is not defined
comment on: http://stackoverflow.com/a/24788959
type: AnswerComment
score: 0

http://stackoverflow.com/a/24905847
answers question: http://stackoverflow.com/q/24905520
score: 0
has body: document.getElementById('tweets').innerHTML = 'Your content';
type: Answer

ffmpeg
tags question: http://stackoverflow.com/q/24757690
tags question: http://stackoverflow.com/q/24881832
tags question: http://stackoverflow.com/q/24781251
tags question: http://stackoverflow.com/q/24750943
tag name: ffmpeg
type: Tag

http://stackoverflow.com/comment/38504178
type: AnswerComment
comment on: http://stackoverflow.com/a/24806159
type: Comment
has text: A minor note. You don't really even need to return anything from your function. You can simply use `found_words` in the calling function once the recursion completes. I left this out of my answer as it doesn't really affect the issues with your code. http://jsfiddle.net/8rLvM/1/
score: 0

http://stackoverflow.com/a/24821246
answers question: http://stackoverflow.com/q/24821190
upvote count: 1
has body: Try this: $(value).find("td:nth-child(5) span:first").text();
score: 1
downvote count: 0
type: Answer

http://stackoverflow.com/comment/38505012
comment on: http://stackoverflow.com/a/24806534
score: 0
type: AnswerComment
has text: Just to finalize things.... what should the anonymous `click:function() { ....}` return if confirm returns false?
type: Comment

http://stackoverflow.com/comment/38487514
comment on: http://stackoverflow.com/q/24795894
score: 0
type: Comment
type: QuestionComment
has text: It looks like you set all parameters correctly. I'm not sure but try to set 'animation' option by array with single needed item 'rollOutY'.

http://stackoverflow.com/comment/38543766
type: QuestionComment
has text: You should probably change it to ` `
comment on: http://stackoverflow.com/q/24827058
score: 0
type: Comment

http://stackoverflow.com/a/24809547
answers question: http://stackoverflow.com/q/24797686
score: 1
downvote count: 0
has body: I found a fairly straightforward algorithm to handle the left/right scrolling. With a bit of work I should be able to get this working without JQuery. JFiddle example is here. HTML &lt;div class="mtabArrowLeft"&gt;&amp;laquo;&lt;/div&gt; &lt;div class="menuTabs"&gt; &lt;div class="img-reel"&gt; &lt;input class="menutabBTN" name="" type="button" value="a" /&gt; &lt;input class="menutabBTN" name="" type="button" value="b" /&gt; &lt;input class="menutabBTN" name="" type="button" value="c" /&gt; &lt;input class="menutabBTN" name="" type="button" value="d" /&gt; &lt;input class="menutabBTN" name="" type="button" value="e" /&gt; &lt;input class="menutabBTN" name="" type="button" value="f"/&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="mtabArrowRight"&gt;&amp;raquo;&lt;/div&gt; JavaScript $(function() { var imageWidth = 71; var reelSize = 4; var imageSum = $('.img-reel input').size(); var imageReelWidth = imageWidth * imageSum; $('.img-reel').css({'width' : imageReelWidth}); rotate = function(){ var trigger = $btn.attr('class'); var image_reelPosition = (trigger=='mtabArrowLeft') ? -imageWidth : imageWidth; var reel_currentPosition = $('.img-reel').css('left').replace('px',''); var pos = reel_currentPosition-image_reelPosition; var maxPos = (imageSum-reelSize)*-imageWidth; //console.log('pos='+pos+', max='+maxPos); if(pos&gt;=maxPos &amp;&amp; pos&lt;=0){ $('.img-reel').animate({left:pos},300); $('.mtabArrowLeft,.mtabArrowRight').fadeTo(250,1); //console.log('move'); if(pos==maxPos){$('.mtabArrowRight').fadeTo(250,0.2);} else if(pos==0){$('.mtabArrowLeft').fadeTo(250,0.2);} } }; if (imageSum &gt; 4) { $('.mtabArrowLeft,.mtabArrowRight').click(function(){ $btn = $(this); rotate(); return false; }); } else { $('.mtabArrowLeft,.mtabArrowRight').fadeTo(0,0.2).click(function(){return false}); } }) CSS html,body,h1,h2,h3,h4,h5,p,ul,li,form,button { margin:0; padding:0 } body { margin:20px; font:normal 62.5% tahoma } p { margin:20px; } .menuTabs { float: left; width: 284px; overfl…
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/70677896

http://stackoverflow.com/comment/38507178
comment on: http://stackoverflow.com/q/24807701
score: 0
type: Comment
type: QuestionComment
has text: Won't cause problems... You can call it... afterall jQuery is javascript...

http://stackoverflow.com/q/24836801
duplicate of: http://stackoverflow.com/q/24546142
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38562107
has answer: http://stackoverflow.com/a/24836817
answer count: 2
tagged with: function
linked to: http://stackoverflow.com/q/24546142
downvote count: 0
tagged with: external
favorite count: 0
has answer: http://stackoverflow.com/a/24836812
has title: Call a function in an external .js file from another .js file
type: UnansweredQuestion
tagged with: reference
has comment: http://stackoverflow.com/comment/38561988
has body: I have two .js files: Card_API.js script.js I want to be able to call functions in Card_API.js from script.js. My references in the HTML file look like this: &lt;script type="text/javascript" src="js/Card_API.js"&gt;&lt;\script&gt; &lt;script type="text/javascript" src="js/script.js"&gt;&lt;\script&gt; in the Card_API.js file, I have a function: function sortCardsByMana(array, reverse){ // Do Stuff } I want to be able to call the above function in the script.js file, but when I try it like this: sortCardsByMana(cards, false); ...it gives an error saying that the function is not defined. Can anyone tell me what I'm doing wrong or if I it's possible?
score: 1
tagged with: file
upvote count: 1

http://stackoverflow.com/comment/38504746
type: Comment
has text: JavaScript can't make PDFs.
comment on: http://stackoverflow.com/q/24806456
score: 0
type: QuestionComment

http://stackoverflow.com/q/24819854
has comment: http://stackoverflow.com/comment/38530139
score: 0
answer count: 1
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/24820780
has body: <?php $qry = " select * from `HX_tableService` "; $result = mysql_query($qry, $link); $serviceList = array(); while($row = mysql_fetch_array($result)) { $serviceList[$row['serviceID']] = $row['serviceName']; } echo " ---- select ---- "; foreach ($serviceList as $serviceID => $serviceName) { echo " ".$serviceName." "; } echo "</selected>"; echo " "; echo " "; echo " "; echo " PRINT OUT THE NUMBER "; echo " "; echo " "; ?> This code is my drop-down menu to select services and input the number. I want to get the result on ( PRINT OUT THE NUMBER ) while typing the number. -get value from selected series -get value from input number box -use both value query from my database -show result on next column If I'm explain my problem unclear, sorry about that. you can see my attach picture at this link also. http://www.uppic.org/image-8C74_53C8D1D6.jpg Sorry for my English also. Thanks.
has comment: http://stackoverflow.com/comment/38530211
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has title: How to get value from drop down and use it to query then show a result
has comment: http://stackoverflow.com/comment/38530435
type: Question
tagged with: javascript

http://stackoverflow.com/q/24908812
has body: I have php code, it works fine, but the customer want to convert it into javascript. I have a web api service url, i need to authorize by username:password then post a json object to the web api url to receive data(also in json type). Here is my php code: curl_setopt($ch, CURLOPT_URL, $MyWebApiUrl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLINFO_HEADER_OUT, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json' ) ); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); // curl authentication curl_setopt($ch, CURLOPT_USERPWD, "$Username:$Password"); // curl authentication curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,$MyPostJsonObject); $str= curl_exec($ch); curl_close($ch); $data = json_decode($str) This is my javascript code so far $.ajax({ type: 'POST', url: MyWebApiUrl, beforeSend: function (xhr) { xhr.setRequestHeader("Authorization", "Basic XXXXXXXXXX");}, data: JSON.stringify(MyPostJsonObject), contentType: 'application/json; charset=utf-8', dataType: 'json', success: function (data) { alert(data.d); }, error: alert("An error occurred: ") }); I always receive "An error occurred: ". Hope you can help. Thank you.
tagged with: javascript
type: UnansweredQuestion
tagged with: authorization
tagged with: post
has answer: http://stackoverflow.com/a/24909375
downvote count: 0
has title: How to post json object to web api and then receive response?
score: 1
favorite count: 0
type: Question
tagged with: php
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
answer count: 1

http://stackoverflow.com/comment/38524500
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24813831
has text: Thanks, but must change this : `function ort(event)` to `function ort(evt)` and in html `onKeyPress="ort()"` to `onKeyPress="ort(event)"` the code is true after that :)

http://stackoverflow.com/q/24878285
has title: Turning off specific javascript function for mobile
answer count: 1
has answer: http://stackoverflow.com/a/24979748
has comment: http://stackoverflow.com/comment/38641258
has comment: http://stackoverflow.com/comment/38642418
has comment: http://stackoverflow.com/comment/38641325
has comment: http://stackoverflow.com/comment/38833211
type: AnsweredQuestion
has body: I have a question regarding turning off javascript for mobile users so that it specifically stops using a parallax scrolling feature called "stellar". I had it working but somewhere along the way of designing my site it stopped functioning and I can't figure out why. I have two basic parts (shown below): //check for mobile window.mobilecheck = function() { var check = false; (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(…
accepted answer: http://stackoverflow.com/a/24979748
has comment: http://stackoverflow.com/comment/38641265
type: Question
has comment: http://stackoverflow.com/comment/38641282
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38641374
score: 0

http://stackoverflow.com/q/24808225
has answer: http://stackoverflow.com/a/25540124
tagged with: javascript
answer count: 2
tagged with: yql
downvote count: 0
has body: I am trying to build a simple clock widget for a webpage. I want to use YQL to query for the time using one of Yahoo!'s tables. I cannot find a table that allows me to query for the current time based off of a location. I was thinking that the weather.forecast table would contain the time due to the fact that people can find the weather for specific locations based off of the current time. Can someone direct me to a Yahoo! table that contains the time for a specified location?
favorite count: 0
linked to: http://stackoverflow.com/q/12816992
has title: Looking for YQL table to query for the current time
has answer: http://stackoverflow.com/a/36145615
tagged with: datetime
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/comment/38405210
type: Comment
has text: How to receive it in the opened page with javascript??
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/24753547

http://stackoverflow.com/comment/38522497
type: AnswerComment
has text: Thanks @Marco Del Valle , but how can i partition div into 2 parts ? I can use 3 divs, 2 divs inside 3rd, but the 2 divs get displayed one below other and not in same line
type: Comment
comment on: http://stackoverflow.com/a/24815556
score: 0

http://stackoverflow.com/q/24787085
has title: Why does PhantomJS return integers when using the getBBox() method?
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38476331
tagged with: phantomjs
score: 1
accepted answer: http://stackoverflow.com/a/24789783
upvote count: 1
type: Question
has body: I'm using PhantomJS 1.9.7 and a modified version of this D3.js tree sample, but need to do some different calculations with the labels that involve using their bounding box. When I call getBBox() on the text DOM element the values I receive are all integers, not floats. I've put together an example which showcases this: Look at the following result in your browser, then run this with PhantomJS and observe the console output: var page = require('webpage').create(); page.onConsoleMessage = function(msg, lineNum, sourceId) { console.log(msg); }; page.onAlert = function() { phantom.exit(); }; page.open('http://jsfiddle.net/99mAZ/4/'); For me, the output (truncated) is like so with Chrome: {"x":10,"y":-6.40625,"width":60,"height":13.015625} {"x":-49,"y":-6.40625,"width":39,"height":13.015625} {"x":-41,"y":-6.40625,"width":31,"height":13.015625} {"x":-39,"y":-6.40625,"width":29,"height":13.015625} {"x":-29,"y":-6.40625,"width":19,"height":13.015625} And with Phantom: {"x":10,"y":-7,"width":60,"height":13} {"x":-49,"y":-7,"width":39,"height":13} {"x":-41,"y":-7,"width":31,"height":13} {"x":-39,"y":-7,"width":29,"height":13} getBBox() returns an SVGRect. The interface for an SVGRect is defined to return all float values. They could very well be floats, but they're at the very least rounded, which isn't of much use when working with larger units such as inches. Is there any way to get more precision?
tagged with: javascript
has comment: http://stackoverflow.com/comment/38468911
has comment: http://stackoverflow.com/comment/38468663
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/24789783

http://stackoverflow.com/comment/38658052
comment on: http://stackoverflow.com/q/24886892
type: Comment
score: 0
type: QuestionComment
has text: @JasonTS - I don't think what you are doing is against their ToS and I haven't found any information to the contrary. Keep in mind that you can embed the script tag dynamically as well based on width. Also, the `push` method is actually what is serving the ad/creating the impression, not just embedded the google-supplied js, so it appears that the code you have posted should work fine and be within their ToS. Are you having problems with it?

http://stackoverflow.com/q/24843318
downvote count: 0
tagged with: jasmine
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38574083
answer count: 0
score: 1
upvote count: 1
type: Question
tagged with: javascript
has title: exclude functions from jasmine firing?
has body: How do you exclude functions from jasmine firing? Say I have a function call get_chats() that fires when a controller is set up, how do I exclude this from firing as a whole when checking if the controller is instantiated. Cheers. Code: //Spec require("/tijasmine/tijasmine").infect(this); describe("RegisterForm controller", function() { var Alloy = require("alloy"); var $; it('Load RegisterForm Controller.', function() { $ = Alloy.createController('registerForm', {}); expect($.__iamalloy).toEqual(true); }); }); Controller: default_data(); The controller function is instantiated at run time, even though all I am interested in is just seeing if the controller loads up without the actual implementation in that function firing. Cheers Update: One way of solving it is to place the function in an event handler: $.win.addEventListener('open', onOpen); function onOpen(e) { get_Chats(); } This way I can purely test if the controller has been instantiated. Although this does not exclude functions from jasmine that may be nested within another one from being fired.

http://stackoverflow.com/q/24873845
tagged with: javascript
type: UnansweredQuestion
has body: This can be considered a general programming question or even logic question, as it's language independent. I have the following piece of code in JavaScript: ... {text: 'Modelo', dataIndex: 'model', filterable: true, renderer: function(value) { // this will asynchronously load the object "Model" from the database which have primary key equals to "value". MyApp.model.Model.load(value, { scope: this, success: function(record, operation) { // this will be executed if succeeded. I need to return the "record" parameter in the outer function. } }); return value; // There must be a way to return the "record" parameter from above. } }, ... As stated in the comments, there's the outer function renderer that calls an inner asynchronous function load that retrieves the value record I need to return from the outer function. I tried ugly things like an empty while-loop waiting for a variable declared in the outer function to be set in the inner function and then return it, but no success, the loop ended up being infinite.
has comment: http://stackoverflow.com/comment/38633022
tagged with: logic
upvote count: 0
tagged with: asynchronous
favorite count: 0
linked to: http://stackoverflow.com/q/14220321
type: Question
downvote count: 2
has comment: http://stackoverflow.com/comment/38660490
has title: Return a value asynchronously acquired in a function
linked to: http://stackoverflow.com/q/23667086
score: -2
answer count: 1
has answer: http://stackoverflow.com/a/24873996

http://stackoverflow.com/comment/38694618
comment on: http://stackoverflow.com/q/24906773
type: QuestionComment
type: Comment
has text: ` ` does not have `type` attribute at all. See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td
score: 0

http://stackoverflow.com/a/24779820
has comment: http://stackoverflow.com/comment/38455081
accepted answer of: http://stackoverflow.com/q/24778424
answers question: http://stackoverflow.com/q/24778424
upvote count: 2
has body: If you only want to hide/show the SVG object tag, you can do it as usual with jQuery. But if you want to deal with the content of the 'remote' SVG object, this seems to be possible but with some restrictions: You need to have the SVG file in the same domain as your hosted page (due to the same security reasons as the iframe tag). To manipulate SVG object tags with JS you need to have extra JS code, as shown here. I think with jQuery you could try $("#rect1").get(0).getSVGDocument() or something similar (I haven't tested that snippet). Check that link to learn more. You have the possibility to include SVG fallback (if the SVG file can't be rendered).
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/comment/38653908
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/24885383
has text: `$('div:visible', this).each(function (e) { });`
type: Comment

http://stackoverflow.com/comment/38532777
comment on: http://stackoverflow.com/q/24821374
type: Comment
type: QuestionComment
has text: check this http://stackoverflow.com/questions/503093/how-can-i-make-a-redirect-page-in-jquery-javascript/21396837#21396837
score: 0

http://stackoverflow.com/a/24819764
has comment: http://stackoverflow.com/comment/38531184
has comment: http://stackoverflow.com/comment/38530761
has comment: http://stackoverflow.com/comment/38531377
type: Answer
has comment: http://stackoverflow.com/comment/38531425
has body: I would have the ensure-unique directive modify its transcluded contents within its compile function by adding another directive to the input element. Something like 'nameToCheck' directive, which is set to user.username. The nameToCheck directive would 'require' ng-model and import ng-model's controller inside its link function. Within the link function, check if the username is unique: if it is not unique, then set the validity flag: scope: true, require: 'ngModel', link: function(scope, element, attr, ngModelController) { var username = scope.$eval(attr.nameToCheck); if (// username taken //) { ngModelController.$setValidity('unique', false); } else { ngModelController.$setValidity('unique', true); } });
answers question: http://stackoverflow.com/q/24819405
score: 0
has comment: http://stackoverflow.com/comment/38531165
has comment: http://stackoverflow.com/comment/38530443

http://stackoverflow.com/a/24785790
answers question: http://stackoverflow.com/q/24762759
has body: this.constructor.name doesn't work in IE. Changing it to this.constructor.toString().match(/function (.{1,})\(/)[1] fixes the issue.
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24762759

http://stackoverflow.com/comment/38525825
has text: that's right , but the actual and formal arguments need to match in function call –
comment on: http://stackoverflow.com/a/24817469
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/a/24874000
answers question: http://stackoverflow.com/q/24873809
has comment: http://stackoverflow.com/comment/38633305
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/38633259
has body: Sort them firstly. Secondly, if their length is different, then they're not a match. After that, iterate one array and test a[i] with b[i], a being the first array, b the second. var search1 = ["barry", "beth", "debbie"], search2 = ["beth", "barry", "debbie"]; // If length are different, than we have no match. if ((search1.length != search2.length) || (search1 == null || search2 == null)) document.write("Nothing matches"); var a = search1.sort(), b = search2.sort(), areEqual = true; for (var i = 0; i &lt; a.length; i++) { // if any two values from the two arrays are different, than we have no match. if (a[i] != b[i]) { areEqual = false; break; // no need to continue } } document.write(areEqual ? "We've found a match!" : "Nothing matches");

http://stackoverflow.com/q/24788941
type: Question
tagged with: css
answer count: 4
accepted answer: http://stackoverflow.com/a/24788985
has body: I have a div that contains text that is selected dynamically using a drop down menu. When my page loads the text shows before disappearing once the page has fully loaded. Is there any way of stopping this happening? As i only want the text to appear once it has been selected. HTML : option1 option2 option3 option4 asdf Tilt. zxcv qwerty Jquery: (function($) { $(document).ready(function () { $('.group').hide(); $('#option1').show(); $('#selectMe').change(function () { $('.group').hide(); $('#'+$(this).val()).show(); }) }) })(jQuery);
has title: Is there a way to stop hidden text appearing when loading and then disappearing?
possible better answer: http://stackoverflow.com/a/24788989
score: 0
has answer: http://stackoverflow.com/a/24788989
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24788985
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38472309
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24789246
has answer: http://stackoverflow.com/a/24789181

http://stackoverflow.com/q/24767668
has answer: http://stackoverflow.com/a/24767716
has title: Alternating clicks
type: Question
answer count: 2
has body: http://jsfiddle.net/qVfy7/ HTML ko JS $('#button').click(function () { $('#mydiv').text('ok'); }); CSS #button{ width:100px; height:100px; background-color:red; } On clicking the button, mydiv's text changes. What I want to do, is clicking again on it to change the text back to ko, and so on, alternating between the two values. Is there a way to do that?
has answer: http://stackoverflow.com/a/24767697
downvote count: 0
possible better answer: http://stackoverflow.com/a/24767716
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/24767697
upvote count: 1
type: AnsweredQuestion
score: 1

http://stackoverflow.com/q/24882608
has body: I am using gwt highcharts and I want to get client timezone calling jsni method from jstimezoneDetect in my client java code: I bind it to my html: &lt;script type="text/javascript" src="js/jstz-1.0.4.min.js"&gt;&lt;/script&gt; and call this on client: static native String getClientTZ() /*-{ var tz = jstz.determine(); return tz.name(); }-*/; then I am calling it on page loading: private String clientTimeZone; pulic UI{ clientTimeZone=getClientTZ(); .... but I'm gettin these error: com.google.gwt.core.client.JavaScriptException: (ReferenceError) @UI::getClientTZ()([]): 'jstz' is undefined Please any suggestions, what i am doing wrong?
possible better answer: http://stackoverflow.com/a/57458809
has answer: http://stackoverflow.com/a/57458809
type: AnsweredQuestion
score: 1
has title: Exception jstz library using
tagged with: java
upvote count: 1
type: Question
tagged with: gwt
accepted answer: http://stackoverflow.com/a/24882773
tagged with: javascript
answer count: 2
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/24882773

http://stackoverflow.com/q/24852349
has answer: http://stackoverflow.com/a/27490332
has body: I have a drop-down list which gets populated dynamically . I have a button which has to clear the drop-down list whenever the user wishes to. test.html &lt;select id="test"&gt; &lt;option&gt;&lt;/option&gt; &lt;/select&gt; &lt;input type="button" id="refresh" /&gt; here my select tag is populated dynamically. Once I click on the refresh button the populated values should be cleared. How do i proceed?
has answer: http://stackoverflow.com/a/24852358
tagged with: javascript
has answer: http://stackoverflow.com/a/38769381
type: Question
downvote count: 0
has answer: http://stackoverflow.com/a/24852440
tagged with: jquery
favorite count: 0
answer count: 5
tagged with: http://stackoverflow.com/tag/html
has title: Onclick of a button clear the populated drop-down list
has comment: http://stackoverflow.com/comment/38591360
has answer: http://stackoverflow.com/a/27490007
type: UnansweredQuestion
score: 1
linked to: http://stackoverflow.com/q/9909326
upvote count: 1

http://stackoverflow.com/a/24770857
score: 1
has comment: http://stackoverflow.com/comment/38467677
has body: The last shim you tried was close, but the values of deps should be an array rather than a string. Try: shim: { 'responsiveIframe': { deps: ['jquery'] } } This is ensure jquery is loaded before the responseIframe script is loaded and run.
downvote count: 0
answers question: http://stackoverflow.com/q/24769399
type: Answer
upvote count: 1

http://stackoverflow.com/comment/38408773
type: AnswerComment
comment on: http://stackoverflow.com/a/24755430
score: 0
type: Comment
has text: Download this plugin to your script folder.

http://stackoverflow.com/comment/38658904
comment on: http://stackoverflow.com/a/24870830
type: AnswerComment
has text: Naveen, it seems to just be a helper from an ASP.NET script resource -- I've updated my answer to include some more information on it. Function.createDelegate is not in any native implementations of JS.
score: 0
type: Comment

http://stackoverflow.com/comment/38573946
type: QuestionComment
comment on: http://stackoverflow.com/q/24843145
score: 0
has text: @ramby, it does. `console.log(this);` shows full html
type: Comment

http://stackoverflow.com/comment/38408462
comment on: http://stackoverflow.com/q/24753940
has text: That was my point it will always fall behind document ready. Because document structure is loaded before content. ` ` tag is loaded before the real image.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/24883726
score: 1
has answer: http://stackoverflow.com/a/24883762
possible better answer: http://stackoverflow.com/a/24883790
has answer: http://stackoverflow.com/a/24883891
has answer: http://stackoverflow.com/a/24883790
has comment: http://stackoverflow.com/comment/38651119
has title: jQuery - assigning ID to an element
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38651160
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/24883762
has comment: http://stackoverflow.com/comment/38651077
has comment: http://stackoverflow.com/comment/38651166
tagged with: css
has answer: http://stackoverflow.com/a/24883773
has comment: http://stackoverflow.com/comment/38651134
answer count: 5
upvote count: 1
has answer: http://stackoverflow.com/a/24883768
type: Question
type: AnsweredQuestion
has body: I have a simple menu, that goes like this Home About I need to assign an ID of "nav" to a second div (class="main-menu") and I have to do it by jQuery. Anyone can help with this?

http://stackoverflow.com/comment/38459126
score: 0
type: Comment
has text: I gave the validation group to all the controls, but it is not giving me the normal required field error also.
comment on: http://stackoverflow.com/a/24777327
type: AnswerComment

http://stackoverflow.com/q/24789364
tagged with: socket.io
answer count: 1
has comment: http://stackoverflow.com/comment/38473236
tagged with: javascript
type: UnansweredQuestion
has body: The following code will create 2 clients and connects to the server. The life time of socket variable is expected to live till the end of the program. Although the code works fine, just wondering, Is it necessary to add the socket variable inside the closure to an array or some container outside the closure in order to protect the lifetime of the socket. var usernames = []; usernames.push('tom'); usernames.push('bob'); usernames.forEach(function (username) { var socket = require('socket.io-client')('http://localhost:3000', {'forceNew': true}); socket.emit('loaded', {username: username}); }
has answer: http://stackoverflow.com/a/24789415
type: Question
has comment: http://stackoverflow.com/comment/38473282
tagged with: node.js
score: 0
has title: Is it necessary to protect the lifetime of objects inside a closure

http://stackoverflow.com/comment/38590483
has text: http://jsfiddle.net/KNch9/ check here :) It's only an example.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24851589

http://stackoverflow.com/comment/38527499
has text: @I make a few test and detect a few problems. I don't know how do you want to detect if it's idle or not, if you want it stricted or not. Anyway i will post an answer with a few anotations
comment on: http://stackoverflow.com/q/24799745
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/24821057
downvote count: 0
score: 1
has body: Thanks to the comment of Lars Kotthoff and some extra researching I came down to this: var myColors = ["#f5800a","#ff8000","#ff8a14", "#ff9427", "#ff9d3b", "#ffa74e","#ffb162", "#ffbb76", "#ffc489", "#ffce9d", "#ffd8b1", "#ffe2c4","#ffebd8","fff5eb"]; d3.scale.myColors = function() { return d3.scale.ordinal().range(myColors); }; and at the end append the custom colors to .showLabels(false).color(d3.scale.myColors().range()) So I am creating an array of custom colors , then I am putting that as the range of colors and finally I am adding the range as an option of the colors of the bar chart. Hopes that helps other people as well.
accepted answer of: http://stackoverflow.com/q/24784225
answers question: http://stackoverflow.com/q/24784225
upvote count: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/38661240
has text: @Mark, I thought I have the AJAX call that is saving the data, so I decided to use the same AJAX call to save and then redirect.
comment on: http://stackoverflow.com/q/24888850
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/38521849
comment on: http://stackoverflow.com/q/24815286
type: QuestionComment
has text: **You cannot have multiple HTML elements with the same id on the same page**. That's what classes are for.
type: Comment
score: 3

http://stackoverflow.com/q/24838747
has body: I have this problem that I add 8 textbox and it works fine but when i add more textbox like 16 textbox it doesnt add the last textbox. does anyone encoutered this problem? Thanks in Advance. Live Link: JAVASCRIPT. function sum() { var basicpay = document.getElementById('basicpay').value; var overtime = document.getElementById('overtime').value; var regularholiday = document.getElementById('regularholiday').value; var specialholiday = document.getElementById('specialholiday').value; var allowanceday = document.getElementById('allowanceday').value; var others = document.getElementById('others').value; var grosspay = document.getElementById('grosspay').value; var monthpay13 = document.getElementById('monthpay13').value; var absent = document.getElementById('absent').value; var tardiness = document.getElementById('tardiness').value; var sss = document.getElementById('sss').value; var pagibig = document.getElementById('pagibig').value; var philhealth = document.getElementById('philhealth').value; var cashadvances = document.getElementById('cashadvances').value; var withholdingtax = document.getElementById('withholdingtax').value; var others = document.getElementById('others').value; var result = parseInt(basicpay) + parseInt(overtime) + parseInt(regularholiday) + parseInt(specialholiday) + parseInt(allowanceday) + parseInt(others) + parseInt(grosspay) + parseInt(absent) + parseInt(tardiness) + parseInt(sss) + parseInt(pagibig) + parseInt(philhealth) + parseInt(cashadvances) + parseInt(withholdingtax) + parseInt(others) + parseInt(monthpay13); if (!isNaN(result)) { document.getElementById('totalincome').value = result; } }
type: Question
tagged with: javascript
has title: Addition, Add Multiple textbox using Javascript function
score: 0
answer count: 3
tagged with: function
has answer: http://stackoverflow.com/a/24838816
has answer: http://stackoverflow.com/a/24838829
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38565502
has answer: http://stackoverflow.com/a/24838830

http://stackoverflow.com/comment/38482225
comment on: http://stackoverflow.com/a/24794152
score: 0
type: Comment
has text: Just tried that. Unfortunately, that redirects to www.domain.com/app/RouteTo/login rather than www.domain.com/login
type: AnswerComment

http://stackoverflow.com/comment/38630301
type: Comment
score: 0
type: QuestionComment
has text: @AnastasieLaurent on `$actions = array('' => 'Select Action Name') + Action::lists('name' , 'id');`, `array_unshift` prepends elements to an array.
comment on: http://stackoverflow.com/q/24872060

http://stackoverflow.com/comment/38498714
comment on: http://stackoverflow.com/a/24783944
type: AnswerComment
score: 0
type: Comment
has text: Thanks this works. Do you have any idea how I would add slide numbers to this?

http://stackoverflow.com/comment/38468136
comment on: http://stackoverflow.com/a/24786460
score: 0
type: Comment
has text: Hey cool, nice on the road answer :+1:
type: AnswerComment

http://stackoverflow.com/q/24902328
answer count: 1
has body: Can anyone help to how to add modify header user-agent to chrome browser using selenium webdriver programmatically File addonpath = new File("D:\\innpjfdalfhpcoinfnehdnbkglpmogdi_20452.crx"); ChromeOptions chrome = new ChromeOptions(); chrome.addArguments("start-maximized"); chrome.addExtensions(addonpath);
tagged with: javascript
score: 0
has title: Can anyone help to how to add modify header user-agent to chrome browser using selenium webdriver programmatically
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24956347
tagged with: testng
type: UnansweredQuestion
tagged with: selenium
tagged with: java
type: Question

http://stackoverflow.com/comment/38423490
type: Comment
comment on: http://stackoverflow.com/a/24763094
type: AnswerComment
score: 0
has text: thanks al give it go , just new to html5 and javascript

http://stackoverflow.com/a/24848761
has comment: http://stackoverflow.com/comment/38584645
answers question: http://stackoverflow.com/q/24848746
score: 0
has comment: http://stackoverflow.com/comment/38584867
has body: Sometimes? always use a password. and if you don't need one, like your local environment, you should use a config file for that environment like ./config/dev.js which has the credentials for that environment.
has comment: http://stackoverflow.com/comment/38585025
has comment: http://stackoverflow.com/comment/38585035
type: Answer
has comment: http://stackoverflow.com/comment/38584838
has comment: http://stackoverflow.com/comment/38584955
has comment: http://stackoverflow.com/comment/38585075
has comment: http://stackoverflow.com/comment/38584971
has comment: http://stackoverflow.com/comment/38584923

http://stackoverflow.com/a/24861478
type: Answer
score: 1
upvote count: 1
has body: Problem is this because you have declared only one row for all Items. Create new Row for Each item. change your function like bellow. $.getJSON("calc.json", function(data) { var $table = $('&lt;table/&gt;'); for(var i = 0; i &lt; data.item.length; i ++){ var $row = $('&lt;tr/&gt;'); //new Row for current ITEM $row.append( '&lt;td&gt;' + data.item[i].name + '&lt;/td&gt;' ); for (var cost = 0; cost &lt; data.item[i].cost.length; cost ++) { $row.append( '&lt;td&gt;' + data.item[i].cost[cost] + '&lt;/td&gt;' ); } $table.append($row); // append current row } $('.calc').append($table); });
downvote count: 0
answers question: http://stackoverflow.com/q/24861229

http://stackoverflow.com/q/24866845
tagged with: javascript
has body: I am going crazy at the moment, I have been spending a day on something that should take nothing. I am doing the following on my compoundjs site (on the server) var cookie = req.cookies.my_user; if(!cookie){ console.log("not user"); res.cookie('my_user', user._id, {maxAge: 900000, httpOnly: false }); } I am running the site as localhost:3000 When I run the following bookmarklet from some page I do not control var link = document.createElement("link"); link.type = "text/css"; link.rel = "stylesheet"; link.href = "//localhost:3000/bookmarklet/bookmarklet.css"; var head = document.getElementsByTagName("head"); head[0].appendChild(link); var script = document.createElement('script'); script.src = "//localhost:3000/bookmarklet/bookmarklet.js"; head[0].appendChild(script); and inside of bookmarklet.js I do console.log(document.cookie); I do not have the cookie I set. Obviously I should have access because the script is being served from the same domain as my cookie is being set. I go look at an actual html document being served from that page and open up the console and do console.log(document.cookie) I see my cookie, but not if I execute inside of the javascript being written into the document. In other words it is behaving as though it were a session cookie I set, even though it should not be as I understand it.
has answer: http://stackoverflow.com/a/24868205
type: UnansweredQuestion
has title: reading my own domain cookies as a third party
has comment: http://stackoverflow.com/comment/38619825
type: Question
has comment: http://stackoverflow.com/comment/38619888
tagged with: cookies
has comment: http://stackoverflow.com/comment/38620089
tagged with: compoundjs
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/24879092

http://stackoverflow.com/comment/38469232
comment on: http://stackoverflow.com/a/24765473
type: Comment
has text: Here's the jsfiddle that works: you must declare parseResponse as a window function. http://jsfiddle.net/Wqu68/2/
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38577201
comment on: http://stackoverflow.com/q/24844829
type: QuestionComment
has text: well i get it, although i think it is a bit complicated no? i just want swipe effect why can't i just have div and images and some library that provides the swipe? since it is such a mainstream effect nowadays.
score: 0
type: Comment

http://stackoverflow.com/comment/63164809
has text: @art-solopov it is hacky but it's this or re-author a 3rd party library to make it commonjs-able.
score: 1
comment on: http://stackoverflow.com/a/33138958
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38463062
comment on: http://stackoverflow.com/a/24782902
has text: `$scope.$apply` takes a function--you would wrap the output in that function. As you've written this, `$scope.$digest` is sufficient here to trigger dirty checking and an update (it does not take a function). Switch that out and I'll see it upvoted.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38419690
comment on: http://stackoverflow.com/q/24761070
score: 0
type: Comment
type: QuestionComment
has text: In theory, if you set up your page correctly, you could do this using pure javascript, yes.

http://stackoverflow.com/a/24808616
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/38510435
has body: html: &lt;div id="countdown" style="background:gray"&gt;&lt;/div&gt; js code: // set the date we're counting down to var target_date = new Date().getTime(); var delay=10; // variables for time units var days, hours, minutes, seconds; // get tag element var countdown = document.getElementById("countdown"); // update the tag with id "countdown" every 1 second setInterval(function () { // find the amount of "seconds" between now and target var current_date = new Date().getTime(); var seconds_left = (current_date - target_date) / 1000; var a=(delay-seconds_left); // do some time calculations minutes = parseInt(a / 60); seconds = parseInt(a % 60); var progress = a/delay*100; // format countdown string + set tag value countdown.innerHTML = '&lt;div style="background:red; width:'+progress+'%"&gt;'+minutes + "m: " + seconds + "s" + '&lt;/div&gt;'; if(seconds_left&gt;delay) {setTimeout(action(),10);} if(a &lt; 0) { countdown.innerHTML = 'END'; window.close(); } }, 1000); var action=function() { close(); } demo -->http://jsfiddle.net/Junkie/DEc4F/3/
accepted answer of: http://stackoverflow.com/q/24808026
answers question: http://stackoverflow.com/q/24808026
has comment: http://stackoverflow.com/comment/38511060
type: AcceptedAnswer

http://stackoverflow.com/comment/38657595
has text: share your gridview code.
score: 0
comment on: http://stackoverflow.com/q/24887173
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24782640
answers question: http://stackoverflow.com/q/24782456
has body: Make an ajax call to a method in Controller where a session keeps track if button was clicked.
score: 0
type: Answer

http://stackoverflow.com/q/24762611
has answer: http://stackoverflow.com/a/24762659
has body: I have the following form validation and submission script in jquery but for some reason its not working. It looks like its submitting but when i click submit it just resets the form and it doesn't validato or do the ajax post. Does anyone know what i am doing wrong here? MODIFIED CODE &lt;script type="text/javascript"&gt; $(function(){ $('#form').submit(function(e){ e.preventDefault(); $("#form").validate({debug: false, rules: { name: "required", email: { required: true, email: true }, phone: { required: true, phone: true } }, messages: { name: "Please let us know who you are.", email: "A valid email will help us get in touch with you.", phone: "Please provide a valid phone number.", }, submitHandler: function() { // Send the request $.post('/submit.php', { name: $('#name').val(), email: $('#email').val(), phone: $('#phone').val(), message: $('#message').val() }, function(d){ alert("Thank you for submitting your request someone will contact your shortly."); }); } }); }); }); &lt;/script&gt;
tagged with: javascript
tagged with: jquery
tagged with: ajax
has title: Jquery form not submitting or validating
has comment: http://stackoverflow.com/comment/38422137
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/24762767
tagged with: forms
score: 0
answer count: 2

http://stackoverflow.com/comment/38518660
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24813533
has text: I clarified my question a bit. I knew mine created a new object each time, I just was curious if it removed the factory-method cons that were listed by linked site (which I included in my question now). Or added any pros/cons for that matter.
score: 0

http://stackoverflow.com/q/24814735
score: -1
has comment: http://stackoverflow.com/comment/38521047
type: Question
tagged with: replace
answer count: 2
has body: I Need to replace a set of characters from a string, I don't have control over the string so I can't just escape the + symbol inside the string. So my question is, seeing as this works if I change my value to 'breeding' it does replace the string. How can I escape a string without manually escaping them? I have tried var s = "http://example.co/kb/tags/anazolic~racing~all+articles~breeding"; var value = 'all+articles'; var find = new RegExp('\~?\\b' + value + '\\b', 'g'); var l = s.replace(find, ''); console.log(l); DEMO: http://jsfiddle.net/AnBc6/1/ I have also tried adding: value = encodeURIComponent(value); but this didn't work either. Any Help?
upvote count: 0
linked to: http://stackoverflow.com/q/399078
tagged with: javascript
tagged with: jquery
tagged with: string
has answer: http://stackoverflow.com/a/24814792
tagged with: regex
favorite count: 0
possible better answer: http://stackoverflow.com/a/24814782
has title: Escape string characters without manually escaping them
downvote count: 1
has answer: http://stackoverflow.com/a/24814782
accepted answer: http://stackoverflow.com/a/24814792
type: AnsweredQuestion

http://stackoverflow.com/q/24822741
has comment: http://stackoverflow.com/comment/38535421
has title: Refreshing browser on resize after certain amount
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/24822852
tagged with: javascript
has comment: http://stackoverflow.com/comment/38535393
tagged with: jquery
tagged with: android
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38535624
has answer: http://stackoverflow.com/a/24822852
has comment: http://stackoverflow.com/comment/38535349
type: Question
has body: I have quite a complex page (responsive) with a lot of scripts running, and rather than trying to recalculate all these scripts when the browser is resized, I simply wish to trigger a refresh when the browser is resized. Trouble is, that a refresh on browser resize sends Android devices, and some versions of IE into a refresh loop. I was thinking therefore to only refresh the browser after it has been resized a certain amount, and see if that cures the problem, which is what I'm attempting to do below. Though for some reason, the browser won't refresh at all. The counter works fine, but the window.location.reload(); doesn't appear to be working here (works outside of this function fine). Any ideas as to why this is? var $resizeTolerance = 0; jQuery(window).on("resize", function(){ $resizeTolerance++; console.log($resizeTolerance); if($resizeTolerance &gt; 10) { window.location.reload(); } });
has comment: http://stackoverflow.com/comment/38535523

http://stackoverflow.com/q/24827728
type: AnsweredQuestion
tagged with: underscore.js
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/24828274
tagged with: arrays
downvote count: 0
tagged with: javascript
has body: Assume I have an array of objects: var a = [ {label: 'one', value: 0}, {label: 'two', value: 5}, {label: 'three', value: 9}, {label: 'four', value: 4}, {label: 'five', value: 2}, {label: 'six', value: 0} ] Now I need to put all items in ascending order which is easily done with _.sortBy, but then I want to put all zero values from the start of the array to the end, so I have values row looking like 2, 4, 5, 9, 0, 0?
possible better answer: http://stackoverflow.com/a/24828221
has answer: http://stackoverflow.com/a/24828221
tagged with: lodash
favorite count: 0
has title: How to move all zero values to the end of the array with LoDash/Underscore?
upvote count: 2
has answer: http://stackoverflow.com/a/24828274
score: 2

http://stackoverflow.com/comment/38592674
type: Comment
has text: Is it possible to run that function with no controller ?. I want to animate one element on mouse move. So i have to create controller and wrap all body tag, or can I put in in global $scope and run it?
type: AnswerComment
comment on: http://stackoverflow.com/a/24851362
score: 0

http://stackoverflow.com/a/24887812
has comment: http://stackoverflow.com/comment/38674776
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/38672515
has comment: http://stackoverflow.com/comment/38672063
has body: You're missing quotes around the JavaScript strings. Change dept_names[&lt;%=i%&gt;] = &lt;%=dept_list[i]%&gt;; to dept_names[&lt;%=i%&gt;] = "&lt;%=dept_list[i]%&gt;"; or simply dept_names.push("&lt;%=dept_list[i]%&gt;"); Change also limit = dept_list.length; to limit = dept_names.length; Notes : there's no reason here to loop twice, once in Java and once in JS. You could do a simple Java loop to build your options it would be cleaner and less tedious to use a JSON encoder to directly write your JS literals from Java. This would also avoid errors (like a " in the middle of your string) you should declare the variables in JavaScript (limit, index)
answers question: http://stackoverflow.com/q/24887761
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24887761

http://stackoverflow.com/a/24783657
score: 0
type: Answer
has body: Alternative you can use this: js $(".edit-post").on("click", function(){ var edit = $(this) .prev() .find("p") .html();//find comment to edit $(this) .next() .find("textarea") .val(edit);//find textarea and insert comments to edit }); fiddle
answers question: http://stackoverflow.com/q/24783372

http://stackoverflow.com/q/24761782
has body: I would like to rotate an &lt;img&gt; element (JPG) 90 deg clockwise. The images might be rectangular and the solution must transform and rotate those pixel by pixel in Javascript (no CSS, no canvas transf, no jquery.rotate, etc) rotated image has to be saved to the server.
has comment: http://stackoverflow.com/comment/38421249
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38420726
has comment: http://stackoverflow.com/comment/38421008
has comment: http://stackoverflow.com/comment/38420815
favorite count: 0
has comment: http://stackoverflow.com/comment/38421178
has comment: http://stackoverflow.com/comment/38420639
answer count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/246801
upvote count: 1
has comment: http://stackoverflow.com/comment/38420645
downvote count: 1
has title: How to rotate a rectangular img 90 deg at a pixel level in Javascript?

http://stackoverflow.com/comment/38687932
comment on: http://stackoverflow.com/a/24902984
type: Comment
has text: Thanks!, if you consider the question is useful could you vote up the question.
score: 0
type: AnswerComment

http://stackoverflow.com/a/24890350
type: Answer
has body: You are using three prompt calls, so if the first is not correct, it will show another prompt instead of checking the value from one prompt against three different values. Put the result from the prompt in a variable, so that you can use it in all the conditions: var answer = prompt('What brings Little Red Riding Hood in the basket? A: Food - B: Book - C:Carbon'); if (answer == 'A') { ... and so on
answers question: http://stackoverflow.com/q/24890264
score: 0

http://stackoverflow.com/a/24794516
has comment: http://stackoverflow.com/comment/38485001
has comment: http://stackoverflow.com/comment/38484994
has comment: http://stackoverflow.com/comment/38484107
upvote count: 3
has comment: http://stackoverflow.com/comment/38489959
downvote count: 5
type: Answer
answers question: http://stackoverflow.com/q/24794434
has comment: http://stackoverflow.com/comment/38485036
score: -2
has body: You could use the $q.defer() like this: this.update = function (data_loaded) { var deferred = $q.defer(); if (data_loaded) { deferred.resolve(null); // put something that your callback will know the data is loaded or just put your loaded data here. } else { Restangular.all('someBase').customGet('foo/bar').then(function(data) { // Do something here when update is finished deferred.resolve(data); } } return deferred.promise; }; Hope this helps.

http://stackoverflow.com/comment/38572547
score: 0
type: Comment
has text: Firstly thank you for the reply. Secondly here is the [fiddle](http://jsfiddle.net/KheKhe/2zj8M/4/) You can see that there is still a scrollbar with the entire html page, which means the html is bigger than the browser window in height. Secondly, you can see the effects of resizing in the screenshot I am adding the question :s
comment on: http://stackoverflow.com/a/24841554
type: AnswerComment

http://stackoverflow.com/q/24859190
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38605161
possible better answer: http://stackoverflow.com/a/48597274
score: 13
has answer: http://stackoverflow.com/a/48597274
type: Question
has comment: http://stackoverflow.com/comment/38605227
has body: I need to match an expression and extract values from it using named groups. Lets say this is my string: var str = 'element=123' So i want to match it using regex and extract the element and value. I know how to do it is c#, I am trying to figure it out in JS. This is my regex: new RegExp(/^(&lt;element&gt;[A-Za-z0-9])+=[A-Za-z0-9]+$/); What am I doing wrong?
has answer: http://stackoverflow.com/a/24859271
linked to: http://stackoverflow.com/q/5367369
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Javascript: Named Capture Groups
accepted answer: http://stackoverflow.com/a/24859271
tagged with: regex
upvote count: 13

http://stackoverflow.com/comment/38682708
type: QuestionComment
type: Comment
has text: Assuming `confirmOn` is a valid library you are using, you would have to prevent the default action _before_ you would do anything else with it. Just a note - I was not the downvoter.
comment on: http://stackoverflow.com/q/24900321
score: 0

http://stackoverflow.com/q/24839210
tagged with: javascript
has comment: http://stackoverflow.com/comment/38569411
answer count: 2
has body: I have this scheme: JS: jQuery.validator.addMethod( "check_membership", function() { console.log('A'); $.ajax({ type: "POST", url: "/subscriptions/check_validity", dataType:"JSON", data: {coupon: "12345"}, }); console.log('&lt;%= @aaa %&gt;'); }, "mmmmm" ); and Rails action: def check_validity @aaa = 'xxx' respond_to do |format| format.js { render :text =&gt; @aaa } end end My goal is to display in Javascript the value from Rails - @aaa, but the output of console.log('&lt;%= @aaa %&gt;'); is just an empty space... But I am not sure what the proper workflow should be here (I need to pass just a kind of information like "yes"/"no"). Thanks guys!
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/24841956
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/5658510
score: 1
tagged with: render
has answer: http://stackoverflow.com/a/24839371
upvote count: 1
tagged with: ruby-on-rails
has title: How to retrieve a value from an AJAX call with Rails?
type: Question

http://stackoverflow.com/a/24880452
answers question: http://stackoverflow.com/q/24880404
upvote count: 2
type: Answer
score: 2
has body: You can try below code: Demo This is some long text that will not fit in the box #div2 { white-space:nowrap; width:12em; overflow:hidden; text-overflow:ellipsis; border:1px solid #000000; }
downvote count: 0

http://stackoverflow.com/comment/38643914
score: 0
has text: You got it. I removed the submits and coded a button to do it - fixed.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24879457

http://stackoverflow.com/comment/38444925
comment on: http://stackoverflow.com/a/24759815
has text: I was only responding to the OP's requirement but I agree.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/24791526
upvote count: 1
score: 1
has body: Put that done variable into the global scope. Else it is redefined again and again every time that run_once() is called. A better approach would be adding a first parameter to that function to identify which action is ran or not (function run_once(identifier,callback) { if(!done[identifier]) { run function and set done[identifier] to true; }) Remove that return function() from run_once() See Fiddle
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24791341

http://stackoverflow.com/q/24814575
type: UnansweredQuestion
score: 0
tagged with: dom
type: Question
tagged with: javascript
has title: Mapbox bindPop with external result list
has body: I am using Mapbox to plot location data on a map while also displaying the information in a list below the map. Clicking one of the results in the list should open the corresponding marker popup window on the map. I also have a need for the ability to tie javascript functions to links within the popup. I believe I have it working but the main issue I have now is that when you click a result listing, it opens on the map but is then removed from the DOM. I've put together a jsfiddle to illustrate my issue. Any suggestions would be greatly appreciated. http://jsfiddle.net/jvitelli/7BNC5/4/ var map = L.mapbox.map("testMap"); var layerGroup; //set up the map and center it based on the user. map.addLayer(L.mapbox.tileLayer("examples.map-i86nkdio", { detectRetina: true })); map.zoomControl.setPosition('topright'); map.setView([40.7348522, -73.9910852], 15); var featureLayer = L.mapbox.featureLayer(); featureLayer.setGeoJSON(response.results); layerGroup = L.layerGroup(); layerGroup.addLayer(featureLayer); layerGroup.addTo(map); var resultSet = document.getElementById("results"); featureLayer.eachLayer(function (marker) { var d = document.createElement("div"); var aTitle = document.createElement("a"); aTitle.innerHTML = marker.feature.properties.title; aTitle.id = marker.feature.properties.id; aTitle.onclick = function (e) { alert(marker.feature.properties.title); map.panTo(marker.getLatLng()); marker.openPopup(); return false; }; var address = document.createElement("p"); address.innerHTML = marker.feature.properties.address + "&lt;br /&gt;" + marker.feature.properties.city + ' ' + marker.feature.properties.state + "&lt;hr /&gt;"; d.appendChild(aTitle); d.appendChild(address); resultSet.appendChild(d); //bind the same content to the info window. marker.bindPopup(d, { autoPan: true, autoPanPadding: L.point(40, 40), closeButton: true }); });
answer count: 1
has answer: http://stackoverflow.com/a/24936097
tagged with: mapbox

http://stackoverflow.com/a/24854902
accepted answer of: http://stackoverflow.com/q/24854759
answers question: http://stackoverflow.com/q/24854759
score: 0
type: AcceptedAnswer
type: Answer
has body: Try this, will return true if validation succeeds: function validateName(name) { var cap = /^[A-Z]{1}.+$/; var con = /[bcdfghjklmnpqrstvwxyz]/i; var vow = /[aeiou]/i; if(cap.test(name) &amp;&amp; con.test(name) &amp;&amp; vow.test(name)) { return true; } else { return false; } }
has comment: http://stackoverflow.com/comment/38596717

http://stackoverflow.com/q/24826019
possible better answer: http://stackoverflow.com/a/24826106
upvote count: 1
has answer: http://stackoverflow.com/a/24826106
downvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24826217
has comment: http://stackoverflow.com/comment/38541763
has answer: http://stackoverflow.com/a/24826272
has comment: http://stackoverflow.com/comment/38542155
type: Question
score: 0
answer count: 3
has body: I have sliders which gives user chance to choose time range . Based on this time range some messages printed in the screen with some style. I am kinda generating style for those messages between following tags. &lt;section&gt; .... &lt;/section&gt; When I change my slider values which determines the range of the new messages, the new ones come behind old messages. I just want the all messages from the new range not old one . You can see jsFiddle of my code also here $(function() { $( "#slider-5" ).slider({ range:true, min: parseInt(ctime[0]), max: parseInt(ctime[ctime.length-1]), values: [ parseInt(ctime[4]),parseInt(ctime[len])], change: function( event, ui ) { $( "#slidevalue" ) .val( formatDateTime(ui.values[ 0 ]) + " - " + formatDateTime(ui.values[ 1 ]) ); new_var=ui.values[0]; var body = document.getElementsByTagName('body')[0]; var section = document.createElement('section'); section.id = 'cd-timeline'; section.className = 'cd-container'; body.appendChild(section); for (var x=0;parseInt(ctime[x])&lt;ui.values[0];x++); for (var x = 0;parseInt(ctime[x])&lt;=ui.values[1]; x++) { var datum = new Date(parseInt(ctime[x])); var outerDiv = document.createElement('div'); outerDiv.className = 'cd-timeline-block'; section.appendChild(outerDiv); var div = document.createElement('div'); div.className = 'cd-timeline-img cd-location'; outerDiv.appendChild(div); var img = document.createElement('img'); img.src = 'img/cd-icon-location.svg'; img.setAttribute('alt', 'Location'); div.appendChild(img); var div = document.createElement('div'); div.className = 'cd-timeline-content'; outerDiv.appendChild(div); var h2 = document.createElement('h2'); div.appendChild(h2); h2_text = document.createTextNode('foo'); h2.appendChild(h2_text); var p = document.createElement('p'); div.appendChild(p); p_text = document.createTextNode(&lt;?php echo json_encode($content); ?&gt;[x]); p.appendChild(p_text); var span = document.createElement('span'); span.className = 'cd-date'; div.appendChild(span)…
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38541723
favorite count: 0
has comment: http://stackoverflow.com/comment/38541962
has comment: http://stackoverflow.com/comment/38541878
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38541799
has answer: http://stackoverflow.com/a/24826217
has title: Javascript erasing old elements using html
has comment: http://stackoverflow.com/comment/38541630

http://stackoverflow.com/comment/38659703
comment on: http://stackoverflow.com/a/24887624
score: 0
type: AnswerComment
type: Comment
has text: Thanks for your note, but it just is a simple calculation on integer values.

http://stackoverflow.com/comment/38503754
has text: This do not resolve the main problem of have all runinng on desktop
type: Comment
comment on: http://stackoverflow.com/a/24801753
score: 0
type: AnswerComment

http://stackoverflow.com/a/24860935
has body: How can I have it so that I can use the addon.port.emit() in the content scripts that are called directly in the HTML file so that I don't have to use the self.data.url('htmlFile'), because I don't want to use the resource://pageckage-GUID-at-jetpack/path/to/file The SDK only considers pages "trusted" if the URL you're loading is part of the add-on assets (data/). chrome:// URIs are not. Hence you'll need to use regular content scripts via the contentScriptFile: [...] option in your PageWorker definition. &lt;script type="text/javascript" src="http://code.jquery.com/jquery-2.1.1.min.js"&gt;&lt;/script&gt; Don't ever load remote scripts for security reasons (and performance reasons to a far lesser extent)! Ship a local copy of jQuery if you want to use it.
accepted answer of: http://stackoverflow.com/q/24859828
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38608880
answers question: http://stackoverflow.com/q/24859828
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/q/24832876
score: 2
has comment: http://stackoverflow.com/comment/38555144
downvote count: 0
has body: Sometimes I want to update the value of a random DOMNode but I don't really know what type of element it is for sure. I am assuming I will need some block of code that checks to see what type of node it is. if(el.tagName == 'input' ) el.value = "foo"; if(el.tagName == 'div') el.innerHTML = "foo"; Or even if certain properties exist: var value = "foo"; if(el.value != "undefined" &amp;&amp; el.value != value) { el.value = value; } if(el.innerHTML != "undefined" &amp;&amp; el.innerHTML != value) { el.innerHTML = value; } The el.nodeType does list several basic types, but they are just basic node types. What is the best way to update any type of elements display? Update: @dfsq had a good idea. el["value" in el ? "value" : "innerHTML"] = value; However, it doesn't seem to work with just any element: ["value" in document.createElement('li')] // true Update 2 strict type checking might be a solution: document.createElement('input').value "" document.createElement('li').value 0 document.createElement('div').value undefined document.createElement('textarea').value "" Note: No jQuery solutions unless you want to point out how jQuery does it
has comment: http://stackoverflow.com/comment/38554998
type: Question
has title: How do you set the display value of any DOM element?
has comment: http://stackoverflow.com/comment/38555061
tagged with: javascript
tagged with: dom
upvote count: 2
has comment: http://stackoverflow.com/comment/38555182
has comment: http://stackoverflow.com/comment/38555765
answer count: 1
has comment: http://stackoverflow.com/comment/38555905
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38555066
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24834175

http://stackoverflow.com/q/24882511
type: AnsweredQuestion
has body: I have a problem, what I am trying to do is: I have this button, if the user is unsubscribed, he can click the button to get subscribed. Now the thing is, if the user is subscribed I want him to click the button to get unsubscribed. &lt;button class="btn btn-primary subscribe-btn" ng-click="subscribe()" &gt; Subscribe &lt;/button&gt; How can I do this in angularJS? Based on the state of the user (eg: isSubscribed=true) change what the button does, how it looks and what function does it call..
favorite count: 0
possible better answer: http://stackoverflow.com/a/24882818
tagged with: angularjs
type: Question
answer count: 2
score: 5
has title: Change the function of an ng-click based on other events?
has answer: http://stackoverflow.com/a/24882633
has comment: http://stackoverflow.com/comment/38649105
upvote count: 5
accepted answer: http://stackoverflow.com/a/24882633
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/24882818

http://stackoverflow.com/comment/38530295
type: Comment
type: QuestionComment
has text: yes, same is the code there
comment on: http://stackoverflow.com/q/24819907
score: 0

http://stackoverflow.com/a/24786682
upvote count: 2
accepted answer of: http://stackoverflow.com/q/24785550
answers question: http://stackoverflow.com/q/24785550
type: AcceptedAnswer
has body: Okay, thanks to the comment left above, I managed to throw together an answer. Basically using: newleft = parseInt(div.style.top) + Math.cos(90) * parseInt(div.style.height); newtop = parseInt(div.style.left) + Math.sin(90) * parseInt(div.style.height); after the div had been rotated. I've updated my jsfiddle aswell, because the one in the comment above uses jQuery, but this way uses only javascript.
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/comment/38454676
type: Comment
comment on: http://stackoverflow.com/q/24779525
has text: Yes, the show/hide is working just fine it's just I need it to make the div height longer when displaying the hidden content because the text will run into my footer.
score: 0
type: QuestionComment

http://stackoverflow.com/q/24867006
accepted answer: http://stackoverflow.com/a/24867114
has comment: http://stackoverflow.com/comment/38620347
tagged with: dom
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38620098
tagged with: javascript
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38619854
has comment: http://stackoverflow.com/comment/38619785
score: 1
tagged with: css
has body: Why don't &lt;section&gt; elements accept width and height attributes just as &lt;canvas&gt; elements do? (JSFiddle)
has comment: http://stackoverflow.com/comment/38620226
has comment: http://stackoverflow.com/comment/38619778
possible better answer: http://stackoverflow.com/a/24867217
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/24867217
downvote count: 1
has title: Setting section width and height in Javascript
has answer: http://stackoverflow.com/a/24867114

http://stackoverflow.com/a/24846446
type: Answer
has body: First: try to console.log(absenceDateTo) before inserting and be sure that the value is not undefined. Second: In the line : absenceDateTo.value.toString You are passing the function context but you should call the function instead. absenceDateTo.value.toString() Try this ;)
has comment: http://stackoverflow.com/comment/38580298
answers question: http://stackoverflow.com/q/24846280
score: 0

http://stackoverflow.com/a/24847089
answers question: http://stackoverflow.com/q/24847070
has body: Correct!! puzzlers[0] will be function ( a ) { return 8*a - 10; } then you are invoking function ( a ) { return 8*a - 10; } with 9 as a.
downvote count: 0
score: 1
upvote count: 1
type: Answer

http://stackoverflow.com/a/24787928
has comment: http://stackoverflow.com/comment/38499366
has comment: http://stackoverflow.com/comment/38506597
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38506489
has comment: http://stackoverflow.com/comment/38619425
has comment: http://stackoverflow.com/comment/38472749
answers question: http://stackoverflow.com/q/24787133
accepted answer of: http://stackoverflow.com/q/24787133
has body: You have to use recursion when parsing every single row. Assuming that you always have two tab separated columns and there is only one root your code could look like that: //example data var str = "Charles Johnson\t4184\nCharles Johnson-Donald Williams\t8385\nCharles Johnson-Donald Williams-Daniel Fertig\t428\nCharles Johnson-Donald Williams-Daniel Fertig-Lino Walling\t1091\nCharles Johnson-Donald Williams-Daniel Fertig-Lino Walling-Jim Cooke\t318"; var lines = str.split("\n"); var name_ = lines[0].split("\t")[0]; var val_ = lines[0].split("\t")[1]; var obj = {name: name_, children: [], value: val_}; //process all lines for (var i=1;i&lt;lines.length;i++) { var addr = lines[i].split("\t")[0].split("-"); var val = lines[i].split("\t")[1]; var local_obj = obj; var recursive_obj; for (var j=1;j&lt;addr.length;j++) { recursive_obj = null; for (var k=0;k&lt;local_obj.children.length;k++) { if (local_obj.children[k].name==addr[j]) { recursive_obj=local_obj.children[k]; } } if (recursive_obj==null) { recursive_obj = {name: addr[j], children: [], value: null }; local_obj.children.push(recursive_obj); } local_obj=recursive_obj; } recursive_obj.value=val; } //print a json result alert(JSON.stringify(obj));
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/38477507

http://stackoverflow.com/q/24902592
score: 0
answer count: 2
tagged with: jquery
tagged with: angularjs
has answer: http://stackoverflow.com/a/24902686
has comment: http://stackoverflow.com/comment/38687097
has title: Retrieving Angularjs Variable output
type: AnsweredQuestion
has body: {{searchKeyword}} Your search for "{{searchKeyword}}" returned {{totalResults}} {{searchResultsText}} SORRY NO RESULTS FOUND Please try again I'm new to angular so can someone point me in the right direction to how to get the search results from the #searchKeyword dom. Everytime I get the document via jquery('#searchkeyword').html() I get the angular variable of {{searchKeyword}} instead of margret river.
type: Question
has comment: http://stackoverflow.com/comment/38689554
accepted answer: http://stackoverflow.com/a/24902686
possible better answer: http://stackoverflow.com/a/24902751
has answer: http://stackoverflow.com/a/24902751
has comment: http://stackoverflow.com/comment/38689795
tagged with: javascript

http://stackoverflow.com/q/24858576
favorite count: 0
has comment: http://stackoverflow.com/comment/38606379
answer count: 1
has comment: http://stackoverflow.com/comment/38603906
has comment: http://stackoverflow.com/comment/38604104
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/21795105
has body: The title pretty much says it all. Directives that resemble inline JavaScript leave a bad taste in my mouth. Is there any way to steer clear of them altogether? Is there a better way within Angular? Here's a quick example:
has title: Angular.js - Is there any way to get away from ng-click and other directives that resembles inline JavaScript?
has comment: http://stackoverflow.com/comment/38604018
has comment: http://stackoverflow.com/comment/38605881
score: 2
has comment: http://stackoverflow.com/comment/38606266
has answer: http://stackoverflow.com/a/25119801
has comment: http://stackoverflow.com/comment/38604064
type: Question
has comment: http://stackoverflow.com/comment/38604054
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38603957

http://stackoverflow.com/a/24826106
has comment: http://stackoverflow.com/comment/38543304
has body: Before appending child elements to the 'section' you can say $('section').children().remove(); to get rid of everything within the 'section' This will take everything inside of your section and remove it. Be careful though. If you have other elements within your section already, those will be removed too. If you want to avoid that. Put your content that will be added and the stuff to be removed inside of an element that is seperate from the other content. Like this &lt;section&gt; &lt;div&gt; //all your other content &lt;/div&gt; &lt;div id='sliderContent'&gt; //all your slider content &lt;/div&gt; &lt;/section&gt; Then in your jquery use instead $('section #sliderContent').children().remove(); This will make it so you do not have to append a section to the dom anymore
has comment: http://stackoverflow.com/comment/38542206
answers question: http://stackoverflow.com/q/24826019
score: 0
has comment: http://stackoverflow.com/comment/38543198
type: Answer
has comment: http://stackoverflow.com/comment/38542731

http://stackoverflow.com/a/24779471
has comment: http://stackoverflow.com/comment/38453887
type: Answer
answers question: http://stackoverflow.com/q/24779356
has comment: http://stackoverflow.com/comment/38454268
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/38453843
has comment: http://stackoverflow.com/comment/38454951
score: 0
has comment: http://stackoverflow.com/comment/38454608
has body: You know how to use jQuery, right? $(document).ready(function() { $('div').on('click', function() { alert('clicked!'); }); }); You can put onclick on div, but it most likely won't work like you're currently doing it because how javascript and php works. (I don't think those noclicks ever get bound)

http://stackoverflow.com/comment/38456427
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24779039
has text: That might be because iOS's filesystem is basically protected / restricted from the outside with the exception of images. I mean if you could search for text files on your device in the first place when trying to upload one - you would have a working file browser on iOS, which is not possible.

http://stackoverflow.com/comment/118881878
type: AnswerComment
comment on: http://stackoverflow.com/a/63300459
type: Comment
has text: I don't think this will work if the non-repeating char is coming in non-alphabetical order.
score: 0

http://stackoverflow.com/comment/38424693
type: Comment
comment on: http://stackoverflow.com/a/24763801
has text: "The sum of the square roots of any two sides of an isosceles triangle is equal to the square root of the remaining side!" Thanks so much! I completely forgot about `volatile()`. I feel like Ember Guides need to be really updated, at least mention all the things controllers/etc. offer. Their API documentation seems decent though.
score: 0
type: AnswerComment

http://stackoverflow.com/a/24883288
has comment: http://stackoverflow.com/comment/38656499
has comment: http://stackoverflow.com/comment/38650719
has comment: http://stackoverflow.com/comment/38650673
has comment: http://stackoverflow.com/comment/38656827
type: Answer
has body: You can do something like this: $scope.coords = []; for(var i=0;i&lt;$scope.properties.length;i++){ $scope.coords.push($scope.properties[i].coordinates); } Working Fiddle Check the console
score: 0
answers question: http://stackoverflow.com/q/24882980
has comment: http://stackoverflow.com/comment/38657884

http://stackoverflow.com/comment/38591778
has text: I've answered a very similar question recently: http://stackoverflow.com/a/24687874/96100
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24845254

http://stackoverflow.com/a/24889569
has comment: http://stackoverflow.com/comment/38664387
has body: You can do parseFloat(2.5).toFixed(4); If you need exactly the same floating point you may have to figure out the amount function parseFloatToFixed(string) { return parseFloat(string).toFixed(string.split('.')[1].length); } console.log(parseFloatToFixed('2.54355')); But i don't really understand why you even need to use parseFloat then? Numbers in javascript do not retain the floating-point count. so you would have to keep them as strings, and calculate against them as floats. Also don't forget toFixed may have weird rounding issues in different browsers, for example console.log((0.1).toFixed(20));
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 30
answers question: http://stackoverflow.com/q/24889498
has comment: http://stackoverflow.com/comment/74773287
accepted answer of: http://stackoverflow.com/q/24889498
upvote count: 30

http://stackoverflow.com/a/24809871
type: Answer
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/24809661
has body: i have reformatted a few things: html: Select AAA BBB CCC gave the selector an id to trigger in the jQ function also gave each hidden option a common class to select all at once. jq: $('#selector').on('change',function() { var divClass = $(this).val(); $(".op").hide(); $("."+divClass).slideDown('medium'); }); binds onChange to selector, gets current value, hides all options, shows the related ones http://jsfiddle.net/66rN8/1/
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24809661

http://stackoverflow.com/comment/38635756
type: Comment
type: QuestionComment
has text: That is odd why I get Apr 30 2014 18:00:00? I get that in JSFiddle as well
comment on: http://stackoverflow.com/q/24875254
score: 0

http://stackoverflow.com/comment/38686593
comment on: http://stackoverflow.com/q/24902335
has text: @Sudharsan I am testing this in latest version of chrome..! what browser are you using.?
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/24887051
accepted answer of: http://stackoverflow.com/q/24882436
answers question: http://stackoverflow.com/q/24882436
has comment: http://stackoverflow.com/comment/38687399
has comment: http://stackoverflow.com/comment/38659668
score: 0
has body: I assume you want to check this in daily basis, below code should works: $("#compare_time").click(function(){ //take the hours and minutes var time_1 = $("#office_hours_from").val().substring(0,5).split(":"); var time_2 = $("#office_hours_to").val().substring(0,5).split(":"); //convert it to minutes var time_minute_1 = time_1[0] * 60 + time_1[1]; var time_minute_2 = time_2[0] * 60 + time_2[1]; //if it's "pm" then add 12 hours to the minute variable if($("#office_hours_from").val().substring(5,2) == "pm") time_minute_1 += 12 * 60; if($("#office_hours_to").val().substring(5,2) == "pm") time_minute_2 += 12 * 60; if(time_minute_2 &gt;= time_minute_1) alert("valid"); else alert("not valid"); }); Check out this Fiddle...
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/38498018
comment on: http://stackoverflow.com/q/24802534
score: 0
has text: Well just call `wrap(d.name, <width>)`.
type: QuestionComment
type: Comment

http://stackoverflow.com/q/24859460
accepted answer: http://stackoverflow.com/a/24859534
has comment: http://stackoverflow.com/comment/38605909
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38605525
has body: I'm sending data from my client like this: data = { Checked: ?? Matches: null, Text: null, } My data is stored like this: var a = { "Answers": [ { "answerUId":1, "correct":true, "checked":true, "text":"`public`" }, { "answerUId":2, "correct":false, "checked":true, "text":"`static`" } ] } How can I get out the values of just the checked field and use it to make another array but with just the one parameter so I can use this to replace the ?? in my code? What I need is: [ true, false ]
has title: How can I take a field out of an array in Javascript and make another array
score: 0
has answer: http://stackoverflow.com/a/24859534
tagged with: arrays
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38605509

http://stackoverflow.com/a/24892303
has comment: http://stackoverflow.com/comment/38668029
accepted answer of: http://stackoverflow.com/q/24892293
has body: Just remove the checked attribute all together &lt;input type="checkbox" id="chkbox1" name="chkbox1" value="unChecked" readonly="readonly" /&gt; Setting the checked attribute with any string value (even false) makes the checkbox checked i want the checkbox always be unselected and users should not able to select it.I should not use the disable option too as i want to send the value of checkbox when i submit the form It doesn't really sound like you want a checkbox at all, but just a hidden input that sends a value &lt;input type="hidden" name="chkbox1" value="unChecked" /&gt;
score: 4
answers question: http://stackoverflow.com/q/24892293
has comment: http://stackoverflow.com/comment/38667664
upvote count: 4
has comment: http://stackoverflow.com/comment/38667641
has comment: http://stackoverflow.com/comment/38668001
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38667771
has comment: http://stackoverflow.com/comment/38667681
type: Answer
has comment: http://stackoverflow.com/comment/38667562

http://stackoverflow.com/q/24854519
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38596264
tagged with: php
has comment: http://stackoverflow.com/comment/38595807
has title: Angularjs PHP $http and populating $scope in a controller with data
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/24854901
upvote count: 1
tagged with: javascript
favorite count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38595839
has body: Ok here we go. I have an angularjs platform and I want to call the data in my controllers scope from an external php files. This is the original code. .controller("morrisChartCtrl", ["$scope", function ($scope) { return $scope.mainData = [{ month: "2013-01", xbox: 294e3, will: 136e3, playstation: 244e3 }, { month: "2013-02", xbox: 228e3, will: 335e3, playstation: 127e3 }, { month: "2013-03", xbox: 199e3, will: 159e3, playstation: 13e4 }, { month: "2013-04", xbox: 174e3, will: 16e4, playstation: 82e3 }, { month: "2013-05", xbox: 255e3, will: 318e3, playstation: 82e3 }, { month: "2013-06", xbox: 298400, will: 401800, playstation: 98600 }, { month: "2013-07", xbox: 37e4, will: 225e3, playstation: 159e3 }, { month: "2013-08", xbox: 376700, will: 303600, playstation: 13e4 }, { month: "2013-09", xbox: 527800, will: 301e3, playstation: 119400 }], $scope.simpleData = [{ year: "2008", value: 20 }, { year: "2009", value: 10 }, { year: "2010", value: 5 }, { year: "2011", value: 5 }, { year: "2012", value: 20 }, { year: "2013", value: 19 }], $scope.comboData = [{ year: "2008", a: 20, b: 16, c: 12 }, { year: "2009", a: 10, b: 22, c: 30 }, { year: "2010", a: 5, b: 14, c: 20 }, { year: "2011", a: 5, b: 12, c: 19 }, { year: "2012", a: 20, b: 19, c: 13 }, { year: "2013", a: 28, b: 22, c: 20 }], $scope.donutData = [{ label: "Download Sales", value: 12 }, { label: "In-Store Sales", value: 30 }, { label: "Mail-Order Sales", value: 20 }, { label: "Online Sales", value: 19 }] } ]) Instead of inline data in the js file I want to use $http to get the code for each scope from a individual php file that will generate to JSON format. What is wrong with this format .controller("morrisChartCtrl", ["$scope", function ($scope) { return $scope.mainData = $http.get('php/mainData.php').success(function (data) { $scope.mainData = data; }), $scope.simpleData = $http.get('php/simpleData.php').success(function (data) { $scope.simpleData = data; }), $scope.comboData = $http.get('php/comboData.php').succe…

http://stackoverflow.com/q/24894211
accepted answer: http://stackoverflow.com/a/24894640
has answer: http://stackoverflow.com/a/24894557
tagged with: dom-manipulation
has title: How do I bind each child of one element to the child of another element?
has comment: http://stackoverflow.com/comment/38671619
possible better answer: http://stackoverflow.com/a/24894557
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24894640
type: Question
score: 0
has comment: http://stackoverflow.com/comment/38671148
tagged with: javascript
tagged with: jquery
has body: There is a bootstrap carousel that is changing automatically: Only one div is set to active at a time, and it cycles through like that. How can I bind all of carousel's children to another element so that it can set it's specific child to be active as well. For example: How can I bind copy-cat to have the same child active as carousel? Keep in mind, I don't want to copy all of the class attributes- just detect that one is active, and set that same numbered child to active also.
answer count: 3
has answer: http://stackoverflow.com/a/24894592
has comment: http://stackoverflow.com/comment/38671343

http://stackoverflow.com/comment/38667533
type: Comment
comment on: http://stackoverflow.com/q/24892293
type: QuestionComment
has text: An unchecked checkbox will not pass its value.
score: 1

list
type: Tag
tags question: http://stackoverflow.com/q/24875941
tags question: http://stackoverflow.com/q/24865037
tag name: list
tags question: http://stackoverflow.com/q/24775875

http://stackoverflow.com/comment/38441649
has text: Yes, probably the best solution. (Cookies can be deleted / set to expire too by the way, but it requires to do more.)
type: AnswerComment
comment on: http://stackoverflow.com/a/24772945
score: 0
type: Comment

http://stackoverflow.com/q/24774367
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/46986663
possible better answer: http://stackoverflow.com/a/24774649
has comment: http://stackoverflow.com/comment/38447005
has answer: http://stackoverflow.com/a/24774649
tagged with: validation
has title: How to validate html textbox not to allow special characters and space?
tagged with: http://stackoverflow.com/tag/html
tagged with: textbox
has body: This is my html: &lt;input type="text" name="folderName"&gt; Here, I want to validate the textbox value by not allowing to key in special characters and space. But it should allow underscore. How to validate this textbox?
score: 8
favorite count: 0
has answer: http://stackoverflow.com/a/24774462
upvote count: 8
answer count: 5
has answer: http://stackoverflow.com/a/24774485
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24774542
has comment: http://stackoverflow.com/comment/38447155
accepted answer: http://stackoverflow.com/a/24774462
type: Question

http://stackoverflow.com/comment/38581271
score: 0
type: AnswerComment
has text: The syntax is $("body").on('click', 'img', function()... so the body exists on creation.
type: Comment
comment on: http://stackoverflow.com/a/24829675

http://stackoverflow.com/q/24791289
has title: Get the current height of video
answer count: 2
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/24791471
tagged with: css
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/24791451
accepted answer: http://stackoverflow.com/a/24791451
has body: I can't understand what is cutting the height of video. When I look in to dev tool - it show's me that the height of video is 384px, but when geting it I have 342px Tried something like this, but it's return me the natural height, not the current $("#right-top-box video").bind("loadedmetadata", function () { var height = this.videoHeight; }); How can I get the current height of video? http://beardhouse.com.ua/#/informacia
type: Question
possible better answer: http://stackoverflow.com/a/24791471
tagged with: javascript
tagged with: jquery
tagged with: html5-video

http://stackoverflow.com/comment/38587253
has text: other webites are quite a problem cuz they give me the link to their code to put inside my html, so I can't "mess" with it, that's why I'm trying doing it my self. I wish the previw showed up only when I click on the thumbnail and not when the mouse pass over it. By changing the hover and putting onclick the only thing I got was no review at all. The remove has been added to delete the caption, that's all.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24849951

http://stackoverflow.com/q/24884487
possible better answer: http://stackoverflow.com/a/24884536
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/24884536
has title: get src from every and set it to css as background
has answer: http://stackoverflow.com/a/24884601
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38652363
type: AnsweredQuestion
upvote count: 1
accepted answer: http://stackoverflow.com/a/24884601
downvote count: 1
type: Question
has body: im trying to make jquery code which will get src from every image in html and set it to css for class for example number-1 and then set css for every img : visibility:hidden; I have coded function which add div before and will be wrapped into it. I have auto-generated html code and i dont want to edit every page. var a = $('div.gallery &gt; a &gt; img'); for( var i = 0; i &lt; a.length; i+=1 ) { a.slice(i, i+1).wrapAll('&lt;div class="grid-img"&gt;&lt;/div&gt;'); } $('.grid-img').each(function(i){ $(this).addClass('number-' + (i+1)); }); and then take every src from img add it to variable imgBgLink1,2,3,4 and set it as background-image for class number1,2,3,4 $("div.gallery a img").each(function(i){ var imgBgLink+'(i+1)' = $(this).attr("src"); $(".number+(i+1)").css("background-image", "url("imgBgLink+(i+1)")"; }); jsfiddle
tagged with: javascript
score: 0
answer count: 2

http://stackoverflow.com/comment/126103858
type: Comment
comment on: http://stackoverflow.com/a/62137958
type: AnswerComment
score: 5
has text: Append `&confirm=t` if the URL points to a binary that Google Drive cannot scan (for example, a `.tar.gz`).

http://stackoverflow.com/q/24868474
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24868892
has comment: http://stackoverflow.com/comment/38623941
answer count: 3
has answer: http://stackoverflow.com/a/24868619
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
possible better answer: http://stackoverflow.com/a/24868619
has comment: http://stackoverflow.com/comment/38622398
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/24868938
has comment: http://stackoverflow.com/comment/38622447
has answer: http://stackoverflow.com/a/24868892
has title: How can you output HTML depending on the width of browser windows?
downvote count: 0
has body: I made this javascript and tried but never works. It has to show advertising banner. If I put this iframe on out side of javascript tag, it works fine but I did put inside of javascript tag because iframe will be decided depending one the width of browser window. How can I make this work???? UPDATE
tagged with: javascript

http://stackoverflow.com/comment/38468156
type: QuestionComment
has text: you can add the following code in the error callback and check what is the output. `function (err) {alert("Error code:"+err.code+":Message:"+err.message);}`. Do let us know what is the output?
comment on: http://stackoverflow.com/q/24782416
score: 0
type: Comment

http://stackoverflow.com/q/24901916
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/24902020
answer count: 1
has body: In this article The prototype object is being set to the "superclass" function Mammal(name){ this.name=name; this.offspring=[]; } Cat.prototype = new Mammal(); In the code that I am reading right now, it has this construct COMPANY.BILLING = function(){ //more code } COMPANY.BILLING.prototype = (function(COMPANY){ //more code })(COMPANY) I am confused, why would you set the value of the prototype object to an anonymous function? This is not some sort of inheritance, right? Is this some sort of a JavaScript pattern?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38685715
has title: Why would you set the JavaScript prototype to an anonymous function?
has comment: http://stackoverflow.com/comment/38685756
type: Question
has comment: http://stackoverflow.com/comment/38686040
has comment: http://stackoverflow.com/comment/38685960

http://stackoverflow.com/q/24835954
has answer: http://stackoverflow.com/a/25585778
has answer: http://stackoverflow.com/a/44698858
tagged with: configuration
accepted answer: http://stackoverflow.com/a/25585778
answer count: 4
has body: I'm using browserify-shim and I want to use a generic jQuery plugin. I have looked over the Browserify-shim docs multiple times and I just can't seem to understand what's going on and/or how it knows where to put plugins, attach to the jQuery object etc. Here's what my package.json file looks like: "browser": { "jquery": "./src/js/vendor/jquery.js", "caret": "./src/js/vendor/jquery.caret.js" }, "browserify-shim": { "caret": { "depends": ["jquery:$"] } } According the the example given on the browserify-shim documentation, I don't want to specify an exports because this plugin (and most if not all jQuery plugins) attach themselves to the jQuery object. Unless I'm doing something wrong above, I don't understand why it doesn't work (I get an error telling me the function is undefined) when I use it. See below: $('#contenteditable').caret(5); // Uncaught TypeError: undefined is not a function So my question is, how does one configure a generic jQuery plugin (which attaches itself to the jQuery object) with browserify and browserify-shim?
has answer: http://stackoverflow.com/a/27886366
score: 41
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27886366
has title: Configure a generic jQuery plugin with Browserify-shim?
type: Question
tagged with: browserify
has answer: http://stackoverflow.com/a/38422102
type: AnsweredQuestion
favorite count: 0
upvote count: 41

http://stackoverflow.com/a/47362344
has body: So to make Bootstrap to work with Browserify you're going to need one of Browserify CSS transforms. First the index.js (browserify entry) // Bootstrap needs jQuery on the Window window.jQuery = $ = require('jquery'); // include popper.js if you want Bootstrap tooltips window.Popper = require('popper.js'); // include bootstrap js libs (not the CSS libs as yet) require('bootstrap'); // then the CSS Lib require('bootstrap/dist/css/bootstrap.css'); NPM Installs: npm install bootstrap@4.0.0-alpha.6 jquery popper.js To use tooltips globally: Per the Bootstrap docs. $('[data-toggle="popover"]').popover(); I have a Browserify-Budo repo here. If you want to see it working.
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/24827964
downvote count: 0

arrays
tags question: http://stackoverflow.com/q/24787872
tags question: http://stackoverflow.com/q/24759717
tags question: http://stackoverflow.com/q/24775875
tags question: http://stackoverflow.com/q/24880999
type: Tag
tags question: http://stackoverflow.com/q/24762348
tags question: http://stackoverflow.com/q/24796443
tags question: http://stackoverflow.com/q/24882985
tags question: http://stackoverflow.com/q/24783092
tags question: http://stackoverflow.com/q/24827821
tags question: http://stackoverflow.com/q/24854889
tags question: http://stackoverflow.com/q/24824519
tags question: http://stackoverflow.com/q/24781076
tags question: http://stackoverflow.com/q/24752190
tags question: http://stackoverflow.com/q/24825537
tags question: http://stackoverflow.com/q/24882906
tags question: http://stackoverflow.com/q/24772306
tags question: http://stackoverflow.com/q/24901967
tags question: http://stackoverflow.com/q/24819668
tags question: http://stackoverflow.com/q/24827323
tags question: http://stackoverflow.com/q/24754382
tags question: http://stackoverflow.com/q/24755952
tags question: http://stackoverflow.com/q/24895652
tags question: http://stackoverflow.com/q/24754306
tags question: http://stackoverflow.com/q/24864665
tags question: http://stackoverflow.com/q/24872192
tags question: http://stackoverflow.com/q/24849613
tags question: http://stackoverflow.com/q/24823777
tags question: http://stackoverflow.com/q/24832519
tags question: http://stackoverflow.com/q/24806260
tags question: http://stackoverflow.com/q/24805978
tags question: http://stackoverflow.com/q/24868555
tags question: http://stackoverflow.com/q/24797786
tags question: http://stackoverflow.com/q/24763525
tags question: http://stackoverflow.com/q/24771098
tags question: http://stackoverflow.com/q/24882655
tags question: http://stackoverflow.com/q/24756251
tags question: http://stackoverflow.com/q/24855142
tags question: http://stackoverflow.com/q/24866448
tags question: http://stackoverflow.com/q/24784879
tags question: http://stackoverflow.com/q/24791010
tags question: http://stackoverflow.com/q/24787435
tags question: http://stackoverflow.com/q/24844821
tags question: http://stackoverflow.com/q/24899780
tags question: http://stackoverflow.com/q/24759985
tags question: http://stackoverflow.com/q/24840740
tags question: http://stackoverflow.com/q/24878012
tags question: http://stackoverflow.com/q/24834812
tags question: http://stackoverflow.com/q/24883866
tags question: http://stackoverflow.com/q/24908890
tags question: http://stackoverflow.com/q/24821107
tags question: http://stackoverflow.com/q/24834818
tags question: http://stackoverflow.com/q/24871734
tags question: http://stackoverflow.com/q/24820306
tags question: http://stackoverflow.com/q/24752825
tags question: http://stackoverflow.com/q/24854630
tags question: http://stackoverflow.com/q/24834900
tags question: http://stackoverflow.com/q/24776728
tags question: http://stackoverflow.com/q/24848339
tags question: http://stackoverflow.com/q/24783468
tags question: http://stackoverflow.com/q/24863519
tags question: http://stackoverflow.com/q/24813158
tags question: http://stackoverflow.com/q/24789801
tags question: http://stackoverflow.com/q/24834992
tags question: http://stackoverflow.com/q/24884951
tags question: http://stackoverflow.com/q/24847070
tag name: arrays
tags question: http://stackoverflow.com/q/24796333
tags question: http://stackoverflow.com/q/24900705
tags question: http://stackoverflow.com/q/24895191
tags question: http://stackoverflow.com/q/24752846
tags question: http://stackoverflow.com/q/24863630
tags question: http://stackoverflow.com/q/24778287
tags question: http://stackoverflow.com/q/24808278
tags question: http://stackoverflow.com/q/24790225
tags question: http://stackoverflow.com/q/24827728
tags question: http://stackoverflow.com/q/24840310
tags question: http://stackoverflow.com/q/24750626
tags question: http://stackoverflow.com/q/24799767
tags question: http://stackoverflow.com/q/24852669

http://stackoverflow.com/q/24831057
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38551576
has body: I have a form where depending on users choice, the input elements are visible or not. Actually, the user is setting a defined type of partner in another form, with the elements that are allowed to be visible on that type of partner if selected Type 1 would have this elements visible: <input type="text" id="partner" name="partner" class="span12" value="<?= $partner->partner;?>" /> <input type="text" id="address" name="address" class="span12" value="<?= $partner->address;?>" /> <input type="text" id="phone" name="phone" class="span12" value="<?= $partner->phone;?>" /> Type 2 would have as visible elements: <input type="text" id="partner" name="partner" class="span12" value="<?= $partner->partner;?>" /> <input type="text" id="country" name="country" class="span12" value="<?= $partner->country;?>" /> <input type="text" id="markname" name="markname" class="span12" value="<?= $partner->markname;?>" /> Type 3 is supposed to have them all. The partner form will start with a select box like this: Type 1 Type 2 Type 3 The user can definde new visual types and therefore the partner page has to be dynamic. The page will start by showing only the select box and after selection the elements allowed by the selected type would be displayed. I know it has to be done by ajax, but I do not now how how to keep them all in same page and refresh the content without refreshing the page
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24831235
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/24831235
has comment: http://stackoverflow.com/comment/38551527
has title: Show input elements after select
tagged with: php

http://stackoverflow.com/comment/38432455
type: QuestionComment
has text: Can you grab the URL the response is trying to redirect you to, and send the request directly to that? The URL can be found in the `Location` response header.
score: 0
comment on: http://stackoverflow.com/q/24767944
type: Comment

http://stackoverflow.com/a/24788310
has comment: http://stackoverflow.com/comment/38471271
type: AcceptedAnswer
downvote count: 0
has body: You need to name your function, apply a class to those elements that should have the click handler, and create the click function: &lt;button class="myClass"&gt; $(function () { function doSomething() { goUrl = 'http://www.example.com/' + $("#basic").val() + '?referringRepId=' + $("#textbox1").val(); window.location = goUrl; } $('.myClass').unbind().click(function () { doSomething(); }); });
has comment: http://stackoverflow.com/comment/38471339
has comment: http://stackoverflow.com/comment/38471174
type: Answer
has comment: http://stackoverflow.com/comment/38471242
score: 2
accepted answer of: http://stackoverflow.com/q/24788211
upvote count: 2
has comment: http://stackoverflow.com/comment/38471326
has comment: http://stackoverflow.com/comment/38471287
has comment: http://stackoverflow.com/comment/38471375
answers question: http://stackoverflow.com/q/24788211

http://stackoverflow.com/q/24754717
tagged with: highcharts
downvote count: 0
has body: I have a column chart with two columns per point and n number of splines. The splines are rendering behind the columns in IE8, but works fine in chrome, I need this to work in IE8. series: [{ data: [minReturn], name: "Minimum Projected Return" }, { data: [maxReturn], name: "Maxmimum Projected Return" }, { type: 'spline', name: 'Target - ' + targetName0 + " : " + targetReturn0 + "%", data: [targetReturn0], marker: { lineWidth: 2, lineColor: Highcharts.getOptions().colors[3], fillColor: 'white' } }] I add the extra splines dynamically: riskReturnoptions.series.push({ type: 'spline', name: 'Target - ' + $('#targetname' + i).val() + " : " + parseFloat($('#targetreturn' + i).val()) + "%", data: [parseFloat($('#targetreturn' + i).val())], marker: { lineWidth: 2, lineColor: Highcharts.getOptions().colors[3], fillColor: 'white'} }); Then for each series add the point: var pointcounter = 3; riskReturnchart.xAxis[0].setCategories(categoryArray); riskReturnchart.series[0].addPoint(minReturn); riskReturnchart.series[1].addPoint(maxReturn); riskReturnchart.series[2].addPoint(targetReturn0); for (i = 1; i &lt;= targetno; i++) { riskReturnchart.series[pointcounter].addPoint(parseFloat($('#targetreturn' + i).val()); pointcounter++; } riskReturnchart.redraw();
tagged with: javascript
favorite count: 0
answer count: 1
score: 1
has answer: http://stackoverflow.com/a/24756831
has comment: http://stackoverflow.com/comment/38412101
upvote count: 1
has title: Spline rendered behind column chart
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24756831
type: Question

http://stackoverflow.com/q/24765268
accepted answer: http://stackoverflow.com/a/24814172
has body: I am still fairly new to JS and am having an issue updating a value of a textbox so that it passes the value through to the MVC Model. Currently the code semi works, and by that I mean that when you click the button it updates the text but not the value so the incorrect value is being passed to my model. Lets hope I don't mess this up in the cleanup for the post. :) The HTML side of the code looks like this: @Html.LabelFor(x => x.DefaultItem) @if(Model.DefaultItem != null) { @Html.TbbTextBoxFor(x => x.DefaultItem, new { disabled = "disabled" }) @Html.HiddenFor(x => x.DefaultItem); } @Html.ListBox("AssignedItems", new MultiSelectList(Model.Items, "Id", "FriendlyDisplay"), new { @size = 5 }) Set Default Here is the view source HTML: Items Default Item 8526 1234 9988565 Set Default Here is the code for the setDefault button that it calls: this.setDefault = function () { var selectedItem = $("#AssignedItems option:selected").text(); document.getElementById("DefaultItem").innerHTML = selectedItem; document.getElementById("DefaultItem").value = selectedItem; }; For the value to even be passed from the HTML view to the controller I had to add the HiddenFor code in the HTML otherwise it would pass a null value. The other things I have tried after searching the net is adding the .innerHTML to update the value but it does not work either. I have also found posts talking about adding the window.onload but I was not able to get that to work correctly either. Any help on this issue would be greatly appreciated. Thank you
type: Question
score: 0
answer count: 1
tagged with: javascript
tagged with: textbox
has comment: http://stackoverflow.com/comment/38428573
tagged with: http://stackoverflow.com/tag/html
has title: javascript Button not updating the html value of a textbox
has answer: http://stackoverflow.com/a/24814172
tagged with: model-view-controller
has comment: http://stackoverflow.com/comment/38427098
type: AnsweredQuestion

http://stackoverflow.com/q/24806954
downvote count: 1
has comment: http://stackoverflow.com/comment/38505787
has answer: http://stackoverflow.com/a/24807028
score: -1
linked to: http://stackoverflow.com/q/7577897
type: Question
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38507254
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38505996
favorite count: 0
has body: I know this question has been asked quite a bit, but I am unable to stop my page scrolling to the top. I have numerous links like Delete Delete Delete Delete Delete When I click on one of these the server action is invoked, and then the page refreshes, to the top. I tried, putting the following in the header, to no avail: I tried adding "Return false" as: onClick="Return false;" But this stop the server action being invoked I have seen references to: Delete But then I need to handle the call to the server action. I would be most grateful for some advice on this please. Thanks in advance. EDIT: Changed to Delete, to make clearer. So if record deleted, I would page to retain its scroll position, rather than scroll to the top. EDIT2: Solution I found at Sitepoint, for the benefit of all. This works.
has comment: http://stackoverflow.com/comment/38506491
has title: How to prevent page scrolling to top, after hyperlink clicked, and after server based refresh
type: UnansweredQuestion

http://stackoverflow.com/comment/38583933
comment on: http://stackoverflow.com/q/24848420
score: 0
has text: would you please share your html code as well? or better a jsfiddle!
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38634162
type: QuestionComment
type: Comment
has text: You simply use a relative path from your entrypoint eg `require('./vendor/xyz.js')`. Browserify is best with commonjs, but it works fine with any js.
comment on: http://stackoverflow.com/q/24874139
score: 0

http://stackoverflow.com/a/24888288
score: 1
upvote count: 1
type: AcceptedAnswer
has body: It sounds like you want to append to the output rather than overwrite it inside your for loop. Try using += instead, e.g., for (var i=0;i&lt;= num ;i++ ){ output+= "number is " +i; }
type: Answer
accepted answer of: http://stackoverflow.com/q/24888211
downvote count: 0
answers question: http://stackoverflow.com/q/24888211

http://stackoverflow.com/a/24908664
type: Answer
has comment: http://stackoverflow.com/comment/38698003
has comment: http://stackoverflow.com/comment/38698081
score: 0
has body: Fiddle USE THIS $('.name').attr("data", "element");
answers question: http://stackoverflow.com/q/24908619

http://stackoverflow.com/a/24837113
has comment: http://stackoverflow.com/comment/38594287
has comment: http://stackoverflow.com/comment/38602620
has comment: http://stackoverflow.com/comment/38589058
has comment: http://stackoverflow.com/comment/38687374
answers question: http://stackoverflow.com/q/24835425
has comment: http://stackoverflow.com/comment/38592569
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/38594244
score: 1
has comment: http://stackoverflow.com/comment/38667866
has body: Try This $.ajax({ url: 'index.php?route=sale/customer/checkout&amp;token=&lt;?php echo $token; ?&gt;&amp;customer_id=&lt;?php echo $customer_id; ?&gt;', type: 'post', dataType: 'json', data: { products: data }, success: function (data) { alert(data); } });
downvote count: 0
has comment: http://stackoverflow.com/comment/38606425

repeat
tags question: http://stackoverflow.com/q/24883713
tag name: repeat
type: Tag

http://stackoverflow.com/comment/38696227
score: 2
type: AnswerComment
has text: I don't understand the downvote. This is the only complete answer on this page.
type: Comment
comment on: http://stackoverflow.com/a/24907625

http://stackoverflow.com/comment/38480542
comment on: http://stackoverflow.com/q/24779226
type: Comment
type: QuestionComment
has text: That doesn't fix the problem.
score: 0

http://stackoverflow.com/q/24756826
accepted answer: http://stackoverflow.com/a/24758490
score: 0
has answer: http://stackoverflow.com/a/24757957
tagged with: default
has body: when I load the redactor editor $('#redactor").redactor(); it loads with the default text Click to add comment... once clicked inside of the editor the text is removed. Is there a way (simple, built in) to get back the text once clicked outside the editor and the editor is empty (nothing has been written in)? Thank you.
tagged with: redactor
tagged with: text
type: AnsweredQuestion
has title: Redactor default text after clicked outside of editor
possible better answer: http://stackoverflow.com/a/24757957
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24758490

http://stackoverflow.com/q/24874648
type: Question
has answer: http://stackoverflow.com/a/24875343
has body: How can I find the coordinates of my movable div? I want to be able to find the coordinates after it has been moved so that I can add boundaries to the game, have it shoot lasers from the divs location etc. Thank you very much in advance! edit: I tried using this: var offsets = $('#img').offset(); var top = offsets.top; var left = offsets.left; if (left &gt; 0) {$('#img').animate({left: "-=10px"}, 'fast');} this didn't work so I test to see what was happening by putting: setTimeout(function() {alert(left);}, 5000); I then moved it around and discovered that it wasn't updating the location of the Div as after the alert activated it gave me a number that wasn't the original css value but was close to it which may be because it's an irregular div or just the way offset works. var state = 1; $(document).ready(function() { $(document).keydown(function(key) { if(state == 1) { switch(parseInt(key.which,10)) { // Left case 37: $('#img').animate({left: "-=10px"}, 'fast'); state = 2; setTimeout(function() { state = 1; }, 200); break; // Up case 38: $('#img').animate({top: "-=10px"}, 'fast'); state = 2; setTimeout(function() { state = 1; }, 200); break; // Right case 39: $('#img').animate({left: "+=10px"}, 'fast'); state = 2; setTimeout(function() { state = 1; }, 200); break; // Down case 40: $('#img').animate({top: "+=10px"}, 'fast'); state = 2; setTimeout(function() { state = 1; }, 200); break; } } }); });
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38637806
has title: How can I find the coordinates of a movable div in Jquery
has comment: http://stackoverflow.com/comment/38637471
answer count: 1
has comment: http://stackoverflow.com/comment/38635048
has comment: http://stackoverflow.com/comment/38635402
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24875343
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38636184

http://stackoverflow.com/q/24756933
has comment: http://stackoverflow.com/comment/38411386
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38417413
has body: I recently started using jQuery in my code and used the latest jQuery autocomplete plugin in my project. Basically, there's a log in screen and when you start typing the username, the autocomplete plugin does its magic and fetches the available usernames corresponding to the given input using MySql database. It works perfectly fine except for the first time when I open the browser. The autocomplete fails to work ( Even observed it using firebug, the request was failing ) and once I logged in - logged out - tried to log in again, it started working again. I tried this in Chrome - Mozilla and IE 9 and the results were the same. If I restart my browser again, the same thing repeats. For the first time the request fails and then works perfectly for the corresponding requests. P.S: I am using CodeIgniter for backend coding of the project. Jquery: &lt;script type="text/javascript"&gt; $(document).ready(function(){ $("#username").autocomplete({ source:'controller_name/get_usernames', minLength:1 }); }); &lt;script&gt;
has answer: http://stackoverflow.com/a/24776100
has comment: http://stackoverflow.com/comment/38443059
has comment: http://stackoverflow.com/comment/38411918
has comment: http://stackoverflow.com/comment/38411350
tagged with: codeigniter
tagged with: mysql
type: Question
has comment: http://stackoverflow.com/comment/38440757
tagged with: autocomplete
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38443421
has title: jQuery autocomplete works only after the corresponding tag is used atleast once after starting the browser
score: 0
has comment: http://stackoverflow.com/comment/38411967
answer count: 1

http://stackoverflow.com/q/24873944
downvote count: 0
tagged with: web
favorite count: 0
type: UnansweredQuestion
score: 1
has title: javascript file wont work in my jsp
upvote count: 1
type: Question
tagged with: jsp
tagged with: javascript
has answer: http://stackoverflow.com/a/24874171
answer count: 2
has body: I just started to learn web development and I am having some trouble. I want to have a clock show up on my home page. Just a running clock. I used an example from w3 but they have it all in the html and I wanted to use a separate file. When I launch the site nothing happens and the clock doesn't show up. When I put the showtime in a script tag by itself into the jsp it works. index.jsp <%@page contentType="text/html" pageEncoding="UTF-8"%> JSP Page Test Hello World test2 showtime.js function startTime() { var today=new Date(); var h=today.getHours(); var m=today.getMinutes(); var s=today.getSeconds(); m = checkTime(m); s = checkTime(s); document.getElementById('txt').innerHTML = h+":"+m+":"+s; var t = setTimeout(function(){startTime()},500); } function checkTime(i) { if (i<10) {i = "0" + i}; // add zero in front of numbers < 10 return i; } startTime();
has answer: http://stackoverflow.com/a/24873998
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/38689187
type: Comment
has text: Why the downvotes? You can answer your own question, no?
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/24903766

http://stackoverflow.com/q/24874378
accepted answer: http://stackoverflow.com/a/24874477
has title: How do I enable my submit button after the totaled value of my inputs reaches 50?
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24874520
has answer: http://stackoverflow.com/a/24874520
type: Question
has answer: http://stackoverflow.com/a/24874477
has body: I am trying to enable the submit button after the total value of my fields reaches 50. Each field has a different quantity value, the first one is 5, the second 10 and the third 25. When The user inputs a number it is multiplied by the quantity and then added to the total. I am trying to enable the submit button once the total reaches 50. I tried to use a key up function to change the disabled value of the button that targets the total but nothing seems to work. I stripped out the code that doesnt work, so now I am back at square one. Here is the fiddle http://jsfiddle.net/mdiadmin/TJ7VL/1/ HTML: How many units did you sell? How many ball joints? (5 laps per unit) How many struts? (10 laps per unit) How many total undercar assemblies? (25 laps per unit) Total Laps 0.00 Javascript: $(document).ready(function () { $(".txtMult input").keyup(multInputs); function multInputs() { var mult = 0; // for each row: $("tr.txtMult").each(function () { // get the values from this row: var $val1 = $('.val1', this).val(); var $val2 = 5; var $val3 = 10; var $val4 = 25; var $total = ($val1 * 1) * ($val2 * 1) $('.multTotal',this).text($total); mult += $total; }); $("#grandTotal").text(mult); } });
tagged with: javascript
score: 0
answer count: 2

http://stackoverflow.com/q/24820381
tagged with: angularjs
has answer: http://stackoverflow.com/a/61569552
has answer: http://stackoverflow.com/a/24821669
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24821669
type: Question
score: 0
answer count: 2
has title: Disable submit when validate confirm password in angularjs
tagged with: javascript
has body: I want to disable submit button when validate confirm password. I followed this model: JSFIDDLE Angularjs: var app = angular.module('myapp', ['UserValidation']); angular.module('UserValidation', []).directive('validPasswordC', function () { return { require: 'ngModel', link: function (scope, elm, attrs, ctrl) { ctrl.$parsers.unshift(function (viewValue, $scope) { var noMatch = viewValue != scope.myForm.password.$viewValue ctrl.$setValidity('noMatch', !noMatch) }) } } }) view : &lt;div ng-app="myapp"&gt; &lt;form name="myForm"&gt; &lt;label for="password"&gt;Password&lt;/label&gt; &lt;input type="password" id="password" name="password" ng-model="formData.password" ng-minlength="8" ng-maxlength="20" ng-pattern="/(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z])/" required /&gt; &lt;span ng-show="myForm.password.$error.required &amp;&amp; myForm.password.$dirty"&gt;required&lt;/span&gt; &lt;span ng-show="!myForm.password.$error.required &amp;&amp; (myForm.password.$error.minlength || myForm.password.$error.maxlength) &amp;&amp; myForm.password.$dirty"&gt;Passwords must be between 8 and 20 characters.&lt;/span&gt; &lt;span ng-show="!myForm.password.$error.required &amp;&amp; !myForm.password.$error.minlength &amp;&amp; !myForm.password.$error.maxlength &amp;&amp; myForm.password.$error.pattern &amp;&amp; myForm.password.$dirty"&gt;Must contain one lower &amp;amp; uppercase letter, and one non-alpha character (a number or a symbol.)&lt;/span&gt; &lt;br /&gt; &lt;label for="password_c"&gt;Confirm Password&lt;/label&gt; &lt;input type="password" id="password_c" name="password_c" ng-model="formData.password_c" valid-password-c required /&gt; &lt;span ng-show="myForm.password_c.$error.required &amp;&amp; myForm.password_c.$dirty"&gt;Please confirm your password.&lt;/span&gt; &lt;span ng-show="!myForm.password_c.$error.required &amp;&amp; myForm.password_c.$error.noMatch &amp;&amp; myForm.password.$dirty"&gt;Passwords do not match.&lt;/span&gt; &lt;br /&gt; &lt;button type="submit" class…
possible better answer: http://stackoverflow.com/a/61569552

http://stackoverflow.com/q/24815428
has comment: http://stackoverflow.com/comment/38527586
has body: so I have scoured stackoverflow and found some similar articles but nothing has worked for me yet. I am creating a rails app and I want to use the Masonry for my layout. I have tried uploading the js as described in this post, but I could not get it to work no matter how many times I tried (yes I matched all the correct IDs and classes). I know the gem is working because the CSS is loading fine, I just cant get the JS to work. Here is what I have at the moment Gemfile: # masonry layout gem 'masonry-rails' application.js: //= require jquery //= require jquery_ujs //= require turbolinks //= require bootstrap //= require_tree . //= require masonry/jquery.masonry index.html.erb: <%= render @products %> <%= will_paginate @products, renderer: BootstrapPagination::Rails %> _products.html.erb <% gfyid = product.gfy.to_s.gsub("http://gfycat.com/", "") %> <%= product.name %> <div class="gfyitem" data-title=false data-autoplay=false data-controls=false data-expand=false data-id="<%= gfyid %>"> I am so lost, I have been working on this for hours trying everything. The CSS is working/looking fine but I am just struggling with the js. Would appreciate any help thank you so much!
type: AnsweredQuestion
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/29483184
tagged with: masonry
has comment: http://stackoverflow.com/comment/38785446
linked to: http://stackoverflow.com/q/13973261
tagged with: jquery-masonry
tagged with: ruby-on-rails-4
answer count: 1
tagged with: javascript
has title: Cannot get Masonry-Rails Gem to work in my app
tagged with: jquery
score: 7
has comment: http://stackoverflow.com/comment/38554911
has comment: http://stackoverflow.com/comment/38803048
favorite count: 0
upvote count: 8
has answer: http://stackoverflow.com/a/29483184

http://stackoverflow.com/q/24865991
has title: Add text to element after submitting form in jQuery
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38617819
accepted answer: http://stackoverflow.com/a/24866103
tagged with: forms
type: Question
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/38617667
has comment: http://stackoverflow.com/comment/38617737
has comment: http://stackoverflow.com/comment/38617751
has body: I'm using the jQuery function .submit() on a form and I need to change text of already created element with function .text() after this form is submitted, but it doesn't work. Code looks like this: $('form').submit(function (){ var text = "error"; $('p.error').text(text); }); If i get that .text() function out of the .submit() function, it works well, but I need to call it after submitting. It seems like it refreshes the page after submitting and text changing, so the text there is lost. Is there any way how to fix it?
has comment: http://stackoverflow.com/comment/38617695
has answer: http://stackoverflow.com/a/24866103

http://stackoverflow.com/q/24777670
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38450794
has answer: http://stackoverflow.com/a/24778025
has comment: http://stackoverflow.com/comment/38450301
accepted answer: http://stackoverflow.com/a/24780669
possible better answer: http://stackoverflow.com/a/24778025
has comment: http://stackoverflow.com/comment/38450565
has body: I have a places.php file on my server that returns the following json: {"places":[{"poi_id":"1","poi_latitude":"53.9606","poi_longitude":"27.6103","poi_title":"Shop1","poi_category":"Shopping","poi_subcategory":"Grocery Store","poi_address":"Street 1, 1","poi_phone":null,"poi_website":null},{"poi_id":"2","poi_latitude":"53.9644","poi_longitude":"27.6228","poi_title":"Shop2","poi_category":"Shopping","poi_subcategory":"Grocery Store","poi_address":"Street 2","poi_phone":null,"poi_website":null}]} In my javascript I use the following piece of code: $(document).ready(function() { var url="places.php"; $.getJSON(url,function(data){ $.each(data.places, function(i,place){ var new1 = place.poi_id; alert(new1); }); }); }); However the message box with the poi_id doesn't pop up. What am I doing wrong?
tagged with: php
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24778298
has answer: http://stackoverflow.com/a/24777770
has comment: http://stackoverflow.com/comment/38450367
type: Question
has title: How do I retrieve objects from JSON received from a php file?
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/24780669

http://stackoverflow.com/comment/74728793
type: AnswerComment
has text: @Suganth G i want to set current month all the dates on y ex in charts so can you please help me how can do that.
type: Comment
comment on: http://stackoverflow.com/a/26609992
score: 0

http://stackoverflow.com/q/24873540
tagged with: request
tagged with: xmlhttprequest
type: AnsweredQuestion
has body: I am trying to get xhr request. (The script should run in a loop every 2 seconds) This is my script: function getJson() { var xhr = new XMLHttpRequest(); xhr.open("get", "http://www.oref.org.il/WarningMessages/alerts.json", true); xhr.onload = function(){ var response = JSON.parse(xhr.responseText); checkJson(response); } xhr.send(null); setTimeout(arguments.callee, 2000); } getJson(); I am getting this error: XMLHttpRequest cannot load http://www.oref.org.il/WarningMessages/alerts.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://klh-dev.com' is therefore not allowed access. So I searched online and I tried to add few lines to my script but it didnt work: response.addHeader("Access-Control-Allow-Origin", "http://www.oref.org.il/WarningMessages"); response.addHeader("Access-Control-Allow-Origin", "*"); and I tried this one in external html page header('Access-Control-Allow-Origin: *'); Nothing worked..
tagged with: http
type: Question
linked to: http://stackoverflow.com/q/12296910
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24873654
score: 0
has title: xhr request Control Origin
answer count: 1
has answer: http://stackoverflow.com/a/24873654
has comment: http://stackoverflow.com/comment/38632628

http://stackoverflow.com/a/24760953
accepted answer of: http://stackoverflow.com/q/24760771
score: 3
upvote count: 3
type: AcceptedAnswer
has body: First of all, you'll need an other variable. I've called mine current and it default value is 0; Then, change every place where you have .eq(0) to .eq(current). After that, add that else statement in the timeout : else{ ++current; if(!$('.percentage').eq(current).html('0%').length) return; perc = 0; } Fiddle : http://jsfiddle.net/c2C6U/4/
has comment: http://stackoverflow.com/comment/38443525
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/24760771

http://stackoverflow.com/comment/38446907
comment on: http://stackoverflow.com/q/24775647
type: QuestionComment
has text: This works: `"lat=78.23456,long=26.56789".split(',')`. Please check the browser console, the alert very likely does not execute because there is a error somewhere.
score: 0
type: Comment

http://stackoverflow.com/comment/38597551
type: Comment
has text: :Works fine with firefox...but will figure something out for chrome... much obliged though
type: AnswerComment
comment on: http://stackoverflow.com/a/24853062
score: 1

http://stackoverflow.com/comment/38631357
score: 0
comment on: http://stackoverflow.com/q/24872873
type: Comment
type: QuestionComment
has text: My variable are reported like this: var Timer; var TimerSec;

http://stackoverflow.com/comment/38671630
type: Comment
has text: What is your JS? We need to see that to before we can attempt to help you....
type: QuestionComment
comment on: http://stackoverflow.com/q/24894517
score: 2

http://stackoverflow.com/q/24754585
has comment: http://stackoverflow.com/comment/38407471
has body: After loading the Maps API (https://maps.googleapis.com/maps/api/js?v=3.exp), I just test the following basic map init, which fails. This is just copy-paste from Map's tutorial. var map; function initialize() { var mapOptions = { zoom: 8, center: new google.maps.LatLng(-34.397, 150.644) }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); } google.maps.event.addDomListener(window, 'load', initialize); In Chrome dev tools I get the error : Uncaught TypeError: undefined is not a function If I type in the console : google -> Object {loader: Object, load: function, T: function..... google.maps -> Object {modules: Object, __gjsload__: function, Load: function} google.maps.LatLng -> undefined google.maps.Map -> undefined google.maps.event -> undefined The div id="map-canvas" exists, it has a width, a height and a blue border and I can see an empty blue rectangle in my page. Can anyone help? Thanks!
has title: google.maps is defined but does not work
has answer: http://stackoverflow.com/a/24754838
upvote count: 1
accepted answer: http://stackoverflow.com/a/24754838
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24754970
has comment: http://stackoverflow.com/comment/38406869
has answer: http://stackoverflow.com/a/24754970
has comment: http://stackoverflow.com/comment/38407370
downvote count: 3
has comment: http://stackoverflow.com/comment/38407166
type: Question
answer count: 2
tagged with: google-maps
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/38407197
has comment: http://stackoverflow.com/comment/38407216
favorite count: 0
has comment: http://stackoverflow.com/comment/38407042
has comment: http://stackoverflow.com/comment/38407473

http://stackoverflow.com/q/24762902
has title: Table style view and AngularJS
type: Question
has comment: http://stackoverflow.com/comment/38422578
score: 0
answer count: 1
tagged with: javascript
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24764090
has body: I have a prbolem with AngularJS and table view. I have a JSON-data like this (for example): { { name: 'Item #1', description: 'Item #1 description' }, { name: 'Item #2', description: 'Item #2 description' }, { name: 'Item #3', description: 'Item #3 description' } } I want to show this data in a table style, like Amazon. It's a table with some columns and rows (columns count is dynamic value). I can use 'data-ng-repeat', but how I can put only 3 or 5 (for example) elements in one row, and next 3 or 5 elements in the next row. How I can do it? I use Bootstrap. I can view data as list: {{ item.name }} {{ item.description }} But I want to view 3 items in one row. Good example is Amazon style.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38423878

http://stackoverflow.com/comment/38693692
type: AnswerComment
comment on: http://stackoverflow.com/a/24884445
score: 0
type: Comment
has text: @MMMM: You may want to read http://va.lent.in/optimize-for-readability-first/

http://stackoverflow.com/a/24850940
accepted answer of: http://stackoverflow.com/q/24850356
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38588892
type: Answer
has comment: http://stackoverflow.com/comment/38592021
has comment: http://stackoverflow.com/comment/38588767
has comment: http://stackoverflow.com/comment/38588844
upvote count: 1
has comment: http://stackoverflow.com/comment/38588942
score: 1
answers question: http://stackoverflow.com/q/24850356
has body: This is because your chosen call finishes before it can find any element and also there are a lot of places where you can make your code better - One Wrong Placement of codes The first chosen call is okay but why the other codes are outside document.ready? you should keep them inside document.ready - jQuery(function ($) { ChosenSelect(); function ChosenSelect() { $('.chosen-select').chosen({ allow_single_deselect: true }); //resize the chosen on window resize $(window).on('resize.chosen', function () { var w = $('.chosen-select').parent().width(); $('.chosen-select').next().css({ 'width': w }); }).trigger('resize.chosen'); } $('#&lt;%= ddlMoo.ClientID %&gt;').on('change', function () { FooList(this.value); ChosenSelect(); }); ....... }); Two The 2nd call is not okay and reason why chosen cannot see items in list - $('#&lt;%= ddlMoo.ClientID %&gt;').on('change', function () { FooList(this.value); ChosenSelect(); }); Why? Because FooList is an ajax call and the execution does not stop there. So, before the ajax can fetch all the entries and populate then inside the drop down list, chosen is called before it is done and it will show empty list. You have 2 choices, either call chosen inside success callback or if you want to keep the current chosen call, then you have to notify chosen that you have updated the list by calling updated callback method. I will go with the one that calls chosen list update method, add this call inside the success method - function FooList(MooId) { $.ajax({ type: "POST", url: "Foo.aspx/Foo", data: "{ 'MooId': '" + MooId+ "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { $("#&lt;%= divFoo.ClientID %&gt;").show(); if (data.d.length &gt; 1) $("#&lt;%= ddlFoo.ClientID %&gt;").html($('&lt;option&gt;&lt;/option&gt;').val("").html("Choose..")) for (var i = 0; i &lt; data.d.length; i++) { $("#&lt;%= ddlFoo.ClientID %&gt;").append($('&lt;option&gt;&lt;/option&gt;').val(data.d[i].FooId).html(data.d[i].F…

http://stackoverflow.com/comment/38540608
comment on: http://stackoverflow.com/a/24825544
type: Comment
has text: So you basically just copy-pasted my comment? :)
score: 1
type: AnswerComment

http://stackoverflow.com/q/24865994
type: Question
upvote count: 2
tagged with: d3.js
duplicate of: http://stackoverflow.com/q/18100266
has comment: http://stackoverflow.com/comment/38628730
has body: I'm using D3 to generate multiple visualizations per page, but I'm having a problem when it comes to IRIs or functional IRIs. Namely, code with textPaths: this.linkGroup.selectAll(".text_path") .attr("xlink:href", function(d) { return "#" + d.id }) .text(function(d) { return d.text }) or markers: this.linkGroup.selectAll(".link") .attr("marker-start", function(d) { return "url(#startArrow)" }) With both of these, if any SVG I create after the first has the same IRI id as a previous one, it will use the first id found in the HTML, even if that is from a different SVG than the current context. As an example: ... ... If in the second SVG I reference the marker with url(#startArrow), it will instead get the first #startArrow in the entire document, in this case, the first SVG. Is there a way to use only the ids/IRIs within the current SVG instead of the entire document? Not sure if this would require some namespacing or not.
has title: D3 Multiple Visualizations Per Page Namespace IRI Conflicts
downvote count: 0
tagged with: http://stackoverflow.com/tag/xhtml
answer count: 0
tagged with: javascript
type: UnansweredQuestion
score: 2
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/18100266
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg

http://stackoverflow.com/a/24782422
has body: You're mixing jQuery code with standard DOM API. The function appendChild() expects a DOM node, not an Element ID. Try var svg = document.getElementById(svgId+"V"); document.getElementById("LightBoxDiv").appendChild(svg);
answers question: http://stackoverflow.com/q/24781920
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 11
upvote count: 11
accepted answer of: http://stackoverflow.com/q/24781920

http://stackoverflow.com/a/24779808
has body: Read thejQuery.get() API. Tells you right there. var myData; $.get( "your_css.css", function( data ) { console.log(data); myData = data; }); console.log(myData); Just a warning, due to JavaScript's nature, line 6 may fire off before line 3. Just food for thought. EDIT I know the console.log(myData); responds null. I meant it to. I was teaching him that if he does this, make sure that if the data is being manipulated anymore, either force it sync or put it in the callback. A better choice would be to put it in the callback.
has comment: http://stackoverflow.com/comment/38454214
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38454814
accepted answer of: http://stackoverflow.com/q/24779637
has comment: http://stackoverflow.com/comment/38454531
type: Answer
has comment: http://stackoverflow.com/comment/38454906
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/24779637

http://stackoverflow.com/a/24883218
score: 2
upvote count: 2
has body: For exact time match(24 hour format), \b(?:0[1-9]|1[1-9]|2[0123])[:-](?:0[1-9]|[1-5][0-9]|00)\b DEMO
answers question: http://stackoverflow.com/q/24883037
downvote count: 0
type: Answer

http://stackoverflow.com/q/24833704
favorite count: 0
tagged with: events
has body: I use Syn.js in my tests for my website but I have a problem when I use Syn.click and then try to check something that happens after the event like a title change or something it doesn't work. It's like the onClick event doesn't end before it begins to check what happened after. The onClick function is something I can't see so I can't put a custom event to make sure it's over so I need a different way to do this. I need a way to make sure an event ended to continue to the next line in the code without changing the event itself. I really need an idea because I don't have a clue how to continue. It can be in JavaScript, jQuery, whatever .... //syn.js ---- this is from the syn.js (from the internet) "_click": function (options, element, callback, force) { Syn.helpers.addOffset(options, element); Syn.trigger("mousedown", options, element); //timeout is b/c IE is stupid and won't call focus handlers schedule(function () { Syn.trigger("mouseup", options, element); if (!Syn.support.mouseDownUpClicks || force) { Syn.trigger("click", options, element); callback(true); } else { //we still have to run the default (presumably) Syn.create.click.setup('click', options, element); Syn.defaults.click.call(element); //must give time for callback schedule(function () { callback(true); }, 1); } }, 1); } // eventually it calls element.dispatchEvent(event); in syn.js and the user use my app like this (jasmin + syn + etc...) // user code (sort off) : (doesnt work) Syn.click({}, button); expect(title).not.BeNull; // -------- here is the probleme the title need to be something but its not. // user code (sort off) : (work) Syn.click({}, button); setTimeout(function() { expect(title).not.BeNull;},1000); // ----------- I need to do this but not in here ( the user cant write this it looks bad---- The only thing I can change is the syn.js or something in between because I don't want the user to write stuff in his code that he doesn't need. If the user writes after every Syn.*** a setTimeout it l…
upvote count: 0
has comment: http://stackoverflow.com/comment/38558854
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38564261
has comment: http://stackoverflow.com/comment/38556999
has answer: http://stackoverflow.com/a/25094756
score: -2
has comment: http://stackoverflow.com/comment/38556555
type: Question
has title: Waiting between events in Syn.js
downvote count: 2
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: dom-events

http://stackoverflow.com/q/24873756
tagged with: timestamp
has title: how to get a human readable time to javascript time
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24874716
has body: Ok, so I have tried all sorts of thing without getting the result I wanted I have a sql database filled with timestamps (and data) that needs to get plotted in a highchart Seems I need to convert it to a javascript timestandard, in milliseconds sinds 1 jan 1970 My database timestamp format looks like this " 2014-07-14 03:37:28 " and needs to get to the javascript format I'm using a piece of php code to extract the data from the database and trow out a json format of the data, but would love some help on how to convert the string into the timestamp i need for the graph, preferably in php. Hope someone can help me out here this is the php code used
type: Question
has comment: http://stackoverflow.com/comment/38632825
tagged with: javascript
has answer: http://stackoverflow.com/a/24874547
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38632794
tagged with: php

resize
tags question: http://stackoverflow.com/q/24873790
tags question: http://stackoverflow.com/q/24847973
type: Tag
tags question: http://stackoverflow.com/q/24857872
tag name: resize

http://stackoverflow.com/comment/38626539
type: QuestionComment
comment on: http://stackoverflow.com/q/24870261
has text: What calls `listUsers` and why do you expect `@` to be anything in particular when it that function is called?
score: 0
type: Comment

http://stackoverflow.com/comment/38685028
type: Comment
comment on: http://stackoverflow.com/a/24899335
has text: I updated. The format might be a little off, but that's it for the most part. See anything?
type: AnswerComment
score: 0

http://stackoverflow.com/q/24836053
tagged with: web
favorite count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24836079
downvote count: 1
type: Question
upvote count: 0
tagged with: javascript
has body: I was debugging a javascript game that I made, so I went to the console on chrome. I know about the first error, but what is the scorecardresearch.com get request that failed? Have I been hacked? Please help. Thanks! Here is the console output: GET http://aquariumkids.com/css/bg.png 404 (Not Found) (index):342 GET http://b.scorecardresearch.com/b?c1=7&amp;c2=10137436&amp;c3=1&amp;ns__t=1405734869806&amp;…3Ddefault%232&amp;c9=http%3A%2F%2Faquariumkids.com%2Fmake-your-own-aquarium%2F net::ERR_CONNECTION_REFUSED beacon.js:1
score: -1
accepted answer: http://stackoverflow.com/a/24836079
has title: Score Card Research - Have I been hacked?
has comment: http://stackoverflow.com/comment/38560696
answer count: 1

http://stackoverflow.com/a/24842967
has comment: http://stackoverflow.com/comment/38573642
has comment: http://stackoverflow.com/comment/38573970
has body: They don't reset. They were never set. The executeSQL and the transaction methods are Async. Which means you have to do somethin lik this: function getAmountOfWins(player, callback) { // Call function, callback is executed after the query calculations getPlayerValues(1, player, function(p1num){ // Call function, callback is executed after the query calculations getPlayerValues(2, player, function(p2num){ // Call the original callback function callback( p1num + p2num ); }); }); } // Get the player values function getPlayerValues(playernr, player, callback){ db.transaction(function (tx) { tx.executeSql("SELECT * FROM Filter WHERE player" + playernr + "='" + player + "'", [], function (tx, results) { var p = 0; for (var i = 0; i &lt; results.rows.length; i++) { current = results.rows.item(i); p = p + current.p2wins; } callback(p); }); }); } the call: // Get the amount of wins, this is an async functionm with the callback getAmountOfWins(player, function(value){ console.log("Total Wins before return: " + (value)); });
has comment: http://stackoverflow.com/comment/38574049
has comment: http://stackoverflow.com/comment/38574527
accepted answer of: http://stackoverflow.com/q/24842928
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24842928
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/a/62180276
answers question: http://stackoverflow.com/q/24866293
score: 0
type: Answer
has body: Try rendering the HTML server-side (if you think you have high server capacity). If the HTML is pre-rendered the API calls are not visible to the end user. If you are using: React - https://www.freecodecamp.org/news/server-side-rendering-your-react-app-in-three-simple-steps-7a82b95db82e/ Angualar - https://angular.io/guide/universal Frameworks like Django by default do server side rendering. -> Server side rendering may cause load on the server compared to client-side rendering.

http://stackoverflow.com/comment/47582418
type: Comment
score: 0
has text: @Mathletics the only problem is that "extend" term is not defined for JS/ES. And for other imperative languages it means something different.
type: QuestionComment
comment on: http://stackoverflow.com/q/24806821

http://stackoverflow.com/comment/38599196
has text: datepicker is working fine only when i load the application. when i try to use datepicker after moving on to some other page(navigation), it is acting like a text box.It works fine only when i reload the application
score: 0
comment on: http://stackoverflow.com/q/24797056
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24767956
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38432325
answers question: http://stackoverflow.com/q/24767897
has body: This should do it: $('.collapse-all').click(function(){ $('.collapse').toggleClass('in'); });
has comment: http://stackoverflow.com/comment/38432897
has comment: http://stackoverflow.com/comment/38446655
has comment: http://stackoverflow.com/comment/38432701
has comment: http://stackoverflow.com/comment/38435846
has comment: http://stackoverflow.com/comment/38432738
downvote count: 0
has comment: http://stackoverflow.com/comment/38432418
has comment: http://stackoverflow.com/comment/38443829
type: Answer

http://stackoverflow.com/comment/38556999
score: 0
comment on: http://stackoverflow.com/q/24833704
type: QuestionComment
type: Comment
has text: check: setTimeout() function to add delay.

http://stackoverflow.com/comment/38613831
has text: doesn't `map` gives parameters as `(value,key)` not `(key,value)`
comment on: http://stackoverflow.com/a/24864025
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/24836079
has comment: http://stackoverflow.com/comment/38560729
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/24836053
has body: They seem to be a market research company that track your information. It provides market research data to website owners through a mixture of online surveys and the use of web beacons. ScorecardResearch's privacy policy says its tracking will collect information such as: when your browser visited a website what page of the website it was the title of the web page IP address
type: Answer
answers question: http://stackoverflow.com/q/24836053
has comment: http://stackoverflow.com/comment/38560756

http://stackoverflow.com/comment/38520700
has text: Thanks for the help...everything seems to be cruising along now.
type: Comment
comment on: http://stackoverflow.com/a/24814166
score: 0
type: AnswerComment

http://stackoverflow.com/a/51318098
answers question: http://stackoverflow.com/q/24864613
has body: var obj = {"key1":1,"key2":2,"key3":3,"key4":4}; if (!('multidelete' in Object.prototype)) { Object.defineProperty(Object.prototype, 'multidelete', { value: function () { for (var i = 0; i &lt; arguments.length; i++) { delete this[arguments[i]]; } } }); } obj.multidelete("key1","key3"); You can use it like this to delete multiple keys in object
score: 0
type: Answer

http://stackoverflow.com/q/24749310
has title: 500 server error (connection reset), JS file won't load
score: 0
tagged with: apache
answer count: 1
tagged with: shared-hosting
type: UnansweredQuestion
has body: My Website: iansvoboda.com This JS file I am loading doesn't load properly for some reason. This randomly cropped up at some point in the last week or so and I haven't actually made any changes between now and then. www.iansvoboda.com/js/app.min.js My console indicates that this is due to a 500 internal server error: ERR_CONNECTION RESET I did some research and according to my server logs I saw an entry that stood out: [Mon Jul 14 11:09:43 2014][debug] core.c(3118): [client 85.247.10.199] redirected from r-&gt;uri = /js/app.min.js, referer: http://iansvoboda.com/ [Mon Jul 14 11:11:11 2014][error] [client 180.76.6.58] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. Can anyone provide a suggestion for how to resolve? If you all need more info, just let me know.
has answer: http://stackoverflow.com/a/24749361
type: Question
tagged with: javascript
tagged with: internal-server-error

http://stackoverflow.com/comment/38472540
type: Comment
has text: It already was a key:value pair. Please explain what appending `+data` does here.
comment on: http://stackoverflow.com/a/24788959
score: 1
type: AnswerComment

http://stackoverflow.com/comment/38593740
comment on: http://stackoverflow.com/q/24852584
has text: you have your js code in which file?
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/24807549
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/48773975
has title: How do I get my embedded Vimeo video to resize dynamically to the width of the screen?
has answer: http://stackoverflow.com/a/24815969
has body: How do I get my embedded Vimeo video to resize dynamically to the width of the screen? Here's the embedded video code: First thing I tried was to set the width: 100% and height: inherit but it doesn't size the video itself. only stretches the iframe to the width of the screen. What I'm trying to do is make sure the video is viewable at any screen size, not just an array of preset sizes. I know I can grab the screen.width with Javascript, but I'm stumped as how I relate that to the iframe object. On top of that, calculating the size needed for height as well. I know the math to get the height from the width is: H = W x 0.5625 I really appreciate any help that comes my way. Cheers!
score: 2
upvote count: 2
tagged with: dynamic
type: UnansweredQuestion
tagged with: iframe
tagged with: vimeo
type: Question
answer count: 2

http://stackoverflow.com/comment/38677180
comment on: http://stackoverflow.com/q/24896765
has text: add this before your jquery-ui.js.. ` ` or you could download the Jquery.js file from [JQuery](http://jquery.com/)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38514305
score: 0
type: Comment
type: QuestionComment
has text: Thank you, that worked great. I realize now that something more insidious was going on with `backbone-fetch-cache.` On first page load the models were correctly validated, and only on subsequent refreshes were invalid models shown. But useing collection.parse got around that.
comment on: http://stackoverflow.com/q/24810775

http://stackoverflow.com/q/24835907
tagged with: jquery
favorite count: 0
score: 2
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/38560822
has answer: http://stackoverflow.com/a/24835971
type: Question
has title: Comparing two ranges of numbers performantly
tagged with: javascript
tagged with: css-animations
has body: I'm creating some parallax scrolling code (I know, I know), and I've got running smoothly, but I've run into a snag with an advanced use-case. Here's a demo. It's now a buttery smooth 60fps in Chrome, Safari &amp; FF, and that's partly because I'm only updating positions of elements when they're in view. I check for this using this code (found in main.js of said demo): a = obj.offset + obj.height - winScroll, b = winHeight - (obj.offset - winScroll); if ( (a &lt;= winHeight &amp;&amp; a &gt;= 0) || (b &lt;= winHeight &amp;&amp; b &gt;= 0) ) { Basically, I'm checking if the object is in view like this: If a or b are greater than 0 but less than the height of the window, then it's visible. This works great for things that are smaller than the window, but what about things that are larger? Basically, what I have to do is take a range of numbers (all the pixels between the top of the window and the top of the window + it's height) and compare it to another range of numbers (the offset of the object and the offset of the object + it's height) and see if any are the same numbers. How do I do this in the already crowded 16ms I have every frame?
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/24835971

http://stackoverflow.com/a/24753989
type: Answer
downvote count: 1
answers question: http://stackoverflow.com/q/24753815
upvote count: 0
score: -1
has body: try this var catchDom = $("#tabs").children(); catchDom.hide(); $("#tab1").click(function () { catchDom.hide().eq(0).show(); }); $("#tab2").click(function () { catchDom.hide().eq(1).show(); }); DEMO

http://stackoverflow.com/comment/38575161
type: Comment
has text: How about the html mark up, how to set the pop up divs there?
type: AnswerComment
comment on: http://stackoverflow.com/a/24843815
score: 0

http://stackoverflow.com/q/24846846
has title: 2 window.onload in 2 separate .js files, only 1 function loads
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24847182
score: 3
downvote count: 0
type: Question
has answer: http://stackoverflow.com/a/24847310
tagged with: javascript
tagged with: conflicting-libraries
upvote count: 3
has body: I have 2 external JavaScript files which both call functions via window.onload. The files conflict, so only the second js file is working. How would I fix the window.onload so both functions work? Should I do this in the HTML file or can I fix it in one of the js files? The HTML header is: &lt;link type="text/css" rel="stylesheet" href="house.css" /&gt; &lt;style type="text/css"&gt;&lt;/style&gt; &lt;script type="text/javascript" src="slideshow_library.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="slideshow.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="house.js"&gt;&lt;/script&gt; house.js: var $ = function(id){ return document.getElementById(id); } var calculateClick = function() { console.log("click, calculate click is running"); //blahblahblah, lots of code } window.onload = function(rental){ console.log("onload, javascript is running"); console.log(rental); $("calculate").onclick = calculateClick; } Second window.onload is in 2 js files: slideshow.js: var slideShow; window.onload = function (slideShow) { var params = { //blahblahblah lots of code } } slideshow_library.js: var $ = function(id) { return document.getElementById(id); } var SlideShow = function( params ){ //blahblah blah even more code } SlideShow.prototype.displayImage = function(){ //blahblah blah even more code } SlideShow.prototype.displayNextImage = function(){ //blahblah blah even more code } SlideShow.prototype.displayPreviousImage = function(){ //blahblah blah even more code } SlideShow.prototype.togglePlay = function(){ //blahblah blah even more code }
answer count: 2
favorite count: 0

http://stackoverflow.com/q/24769070
type: UnansweredQuestion
tagged with: animation
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: .slideToggle() Runs With a Lagging/Jerky Animation
score: 1
has body: So I have read a lot of the other posts and none of them seem to be of any help. Whenever I toggle up the animation jumps and shows some lag. Here is my CSS: Below is my HTML: Directory Below is my jQuery: I am using IE9 and I have not been able to use any other browser. Any help would be greatly appreciated.
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38440543
tagged with: javascript
has answer: http://stackoverflow.com/a/24769514
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38440855
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38435452
has comment: http://stackoverflow.com/comment/38435253

http://stackoverflow.com/a/24759147
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/38415508
score: 2
has body: Use /^abc(?:_.*_|_)xyz$/ Be sure to include the ^ and $, they guard the beginning and end of the string. Otherwise strings like "123abc_foo_xyz" will match. (?:_.*_|_) Is a non-capture group that matches either _[someArbitaryStringHere]_ or a single _
has comment: http://stackoverflow.com/comment/38415585
answers question: http://stackoverflow.com/q/24759024
downvote count: 0

http://stackoverflow.com/comment/38536321
comment on: http://stackoverflow.com/q/24823158
type: QuestionComment
has text: why are you splitting on `/` and then immediately recombining?
type: Comment
score: 0

http://stackoverflow.com/q/24884906
tagged with: web-services
accepted answer: http://stackoverflow.com/a/25758653
type: AnsweredQuestion
tagged with: google-analytics
upvote count: 1
has comment: http://stackoverflow.com/comment/38683951
type: Question
has comment: http://stackoverflow.com/comment/38683999
downvote count: 0
tagged with: javascript
answer count: 1
has body: I am creating a dashboard using Google Analytics Data using JSON webservice. What it does is when I enter the From Date &amp; To Date, Google analytics will trigger a query according to that dates and reply with a response. According to that response the chart will be drawn. Updated Two dates taken from a HTML form &amp; it's in below. Dashboard.html &lt;script type="text\javascript src="js/jquerysoap.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/script.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;form action="" method="post"&gt; From Date : &lt;input type="text" id="from_date" /&gt; To Date : &lt;input type="text" id="to_date" /&gt; &lt;input type="submit" value="Submit" class="submit_button" onClick="getVaria(); return false" /&gt; &lt;/form&gt; These entered dates will be grabbed by some JavaScript functions in the Script.js file. Script.js function retStartDate(){ var strStartDate = document.getElementById("from_date").value; alert("Start date " + strStartDate); return strStartDate; } function retEndDate(){ var strEndDate = document.getElementById("to_date").value; alert("End date " + strEndDate); return strEndDate; } These 2 dates will then paaased to the chart query to fraw the chart as like the below. function getVaria(){ /* Chart query.*/ var strWsUrl = 'https://www.googleapis.com/analytics/v3/data/ga?ids=ga%3A76546294&amp; dimensions=ga%3Asource&amp;metrics=ga%3Ausers&amp;filters=ga%3Asource!%3D(direct)&amp;sort=-ga%3Ausers&amp;start-date= ' + retStartDate() + ' &amp;end-date= ' + retEndDate() + ' &amp;max-results=10'; alert(strWsUrl); return strWsUrl; } The source code is above. I am able to pass the 2 dates to the query. Then I cannot find out a way to get the response from JSON and so on. I'm using JavaScript on this one because it gives more mobility than server side scripting. So could you someone give me a clue for that? Thanks &amp; regards, Chiranthaka
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/25758653
has comment: http://stackoverflow.com/comment/38653347
has title: Creating Google Analytics Dashboard With Custom Dates

http://stackoverflow.com/q/24908710
tagged with: indexof
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/38698133
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/24908867
has title: javascript indexes from codewars
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38698158
has comment: http://stackoverflow.com/comment/38699246
has answer: http://stackoverflow.com/a/33949185
has comment: http://stackoverflow.com/comment/38698253
has body: I am working on the following codewars problem. The question looks like this: Instructions Write a function capitals that takes a single string (word) as argument. The functions must return an ordered list containing the indexes of all capital letters in the string. Example Test.assertSimilar( capitals('CodEWaRs'), [0,3,4,6] ); And my solution is: function capitals(word){ var ara = [] for(var i = 0; i < word.length; i++){ if(word[i] == word[i].toUpperCase()){ ara.push(word.indexOf(word[i])) } } return ara } The code works fine whenever I pass a string to it. The only problem I have is I am getting the same index for a repeated spelling. for instance, capitals("HeLLo") returns [0, 2, 2] instead of [0, 3, 4]. Is there any way to fix this?
has answer: http://stackoverflow.com/a/24908846
type: Question
has comment: http://stackoverflow.com/comment/38698037

http://stackoverflow.com/a/28275664
answers question: http://stackoverflow.com/q/24853686
has body: var buffer = new ArrayBuffer(0x10000); var Uint32 = new Uint32Array(buffer); is not the same thing as: var Uint32 = new Uint32Array(0x10000); not because of the new ArrayBuffer (you always get an array buffer: see Uint32.buffer in both cases) but because of the length parameter: with ArrayBuffer you have 1 byte per element, with Uint32Array you have 4 bytes per element. So, in the first case (and in your code), Uint32.length = 0x1000/4 and your loops are out of bounds 3 out of 4 times. But sadly you will never get errors, only poor performances. Using new ArrayBuffer, you have to declare Uint32 like this: var buffer = new ArrayBuffer(0x10000 * 4); var Uint32 = new Uint32Array(buffer); See jsperf with (0x10000) and jsperf with (0x10000 * 4).
accepted answer of: http://stackoverflow.com/q/24853686
downvote count: 2
has comment: http://stackoverflow.com/comment/55061738
has comment: http://stackoverflow.com/comment/66261779
upvote count: 49
type: AcceptedAnswer
score: 47
has comment: http://stackoverflow.com/comment/56650182
type: Answer

http://stackoverflow.com/q/24781888
type: Question
has comment: http://stackoverflow.com/comment/38459648
has answer: http://stackoverflow.com/a/24782059
has comment: http://stackoverflow.com/comment/38458362
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24782018
has comment: http://stackoverflow.com/comment/38458373
score: 0
accepted answer: http://stackoverflow.com/a/24782059
has comment: http://stackoverflow.com/comment/38458351
has body: Basically I have about 36 variables that are named t0, t1, t3 ... and so on, each variable is initiated with the value 0, and depending on actions they get incremented by 1. I want a way to be able to list the top ten highest valued variables ideally by putting them in an array like Var topTen = [t33,t31,t2].
has answer: http://stackoverflow.com/a/24782003
has answer: http://stackoverflow.com/a/28883680
answer count: 5
type: AnsweredQuestion
has title: Get the top ten vars with the highest value in Javascript
has answer: http://stackoverflow.com/a/24782063
has answer: http://stackoverflow.com/a/24782018

http://stackoverflow.com/comment/38496219
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24800174
has text: Added the code in the question.

http://stackoverflow.com/a/24861561
has comment: http://stackoverflow.com/comment/38649238
downvote count: 0
has comment: http://stackoverflow.com/comment/38648436
has comment: http://stackoverflow.com/comment/38614099
answers question: http://stackoverflow.com/q/24859083
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24859083
has comment: http://stackoverflow.com/comment/38610828
type: Answer
has comment: http://stackoverflow.com/comment/38612266
has comment: http://stackoverflow.com/comment/38612093
has body: Instead of trying to add a value change listener to the pager you could put the code in the data provider (assuming you have one). In the data provider that is providing the content (again I am assuming a table or list) then simply update the browser history as necessary. Something like @Override protected void onRangeChanged(final HasData&lt;YourObject&gt; display) { // update browser URL without navigating History.newItem(historyMapper.getToken(place), false); ... } then add support into your place token for storing the paging data, start index, page length, that sort of thing. You will need corresponding code at the start of your activity to read the paging data and handle it as necessary. Ideally if you are using activities and places you want to avoid using the browser back button as generally it will cause a new place and new activity to be created which is a bit heavy. I would imagine you can code your way around this.
has comment: http://stackoverflow.com/comment/38618737
score: 1
has comment: http://stackoverflow.com/comment/38612919
upvote count: 1

http://stackoverflow.com/a/24858280
answers question: http://stackoverflow.com/q/24857707
score: 1
accepted answer of: http://stackoverflow.com/q/24857707
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38604275
downvote count: 0
type: Answer
has body: First OSx is similar to Linux... please check the permission on that folder. Most of the time you can not copy or past even a folder unless u used a command line. sudo cp -a source /opt/ for that matter see the permission on that folder ,or u can change its permission using sudo chown -R yourusername /opt to list the permission and files status ls -alh But , i suggest you do upload or download images in /tmp/ folder or on your project folder under web-inf and /temp /
has comment: http://stackoverflow.com/comment/38603591
upvote count: 1

http://stackoverflow.com/comment/38637169
type: QuestionComment
has text: this should be fine, depending on how much other stuff you have going on. why not give it a shot and see if you can discern any problems?
score: 1
comment on: http://stackoverflow.com/q/24875736
type: Comment

express
tags question: http://stackoverflow.com/q/24851817
tags question: http://stackoverflow.com/q/24838246
tags question: http://stackoverflow.com/q/24870283
tags question: http://stackoverflow.com/q/24866006
tags question: http://stackoverflow.com/q/24835466
tags question: http://stackoverflow.com/q/24887911
tags question: http://stackoverflow.com/q/24869267
tags question: http://stackoverflow.com/q/24840330
tags question: http://stackoverflow.com/q/24810712
tags question: http://stackoverflow.com/q/24772726
tags question: http://stackoverflow.com/q/24770639
tags question: http://stackoverflow.com/q/24800511
tags question: http://stackoverflow.com/q/24836489
tags question: http://stackoverflow.com/q/24771824
tags question: http://stackoverflow.com/q/24871368
tags question: http://stackoverflow.com/q/24750395
tags question: http://stackoverflow.com/q/24835395
tags question: http://stackoverflow.com/q/24790536
tags question: http://stackoverflow.com/q/24784944
tags question: http://stackoverflow.com/q/24857214
tags question: http://stackoverflow.com/q/24814352
tags question: http://stackoverflow.com/q/24855619
tags question: http://stackoverflow.com/q/24872273
tags question: http://stackoverflow.com/q/24845221
tags question: http://stackoverflow.com/q/24756392
tags question: http://stackoverflow.com/q/24854744
tags question: http://stackoverflow.com/q/24771495
tags question: http://stackoverflow.com/q/24900232
tags question: http://stackoverflow.com/q/24869627
tags question: http://stackoverflow.com/q/24847821
tags question: http://stackoverflow.com/q/24808903
tags question: http://stackoverflow.com/q/24795911
tags question: http://stackoverflow.com/q/24823993
tag name: express
tags question: http://stackoverflow.com/q/24750169
tags question: http://stackoverflow.com/q/24759768
tags question: http://stackoverflow.com/q/24795244
type: Tag
tags question: http://stackoverflow.com/q/24803215
tags question: http://stackoverflow.com/q/24812708
tags question: http://stackoverflow.com/q/24820027
tags question: http://stackoverflow.com/q/24766897
tags question: http://stackoverflow.com/q/24847384
tags question: http://stackoverflow.com/q/24836037
tags question: http://stackoverflow.com/q/24841190

http://stackoverflow.com/comment/38456837
comment on: http://stackoverflow.com/q/24780915
has text: Try to add `[WebMethod(EnableSession=true)]` and store value in the session. WebServices are not supposed to store some data into themselves.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24816397
answers question: http://stackoverflow.com/q/24815614
has body: The way that you are approaching this problem is incorrect because chrome.tabs.query is an asynchronous method. Read this excellent answer for an explanation of what that entails, as well as a possible solution EDIT: Depending on how your project is structured, the simplest solution is to wrap the logic that requires the tab info in a function. Then you can invoke that function from within the chrome.tabs.query callback and pass the tab info in. For example: var alertTab = function(tab) { alert(tab); } chrome.tabs.query({'active': true, 'lastFocusedWindow': true}, function (tabs) { alertTab(tabs[0].url); }); This is a very naive/dangerous approach and will only work if you wrap all of the synchronous code dependent on the tab info in that (or other) functions. There are many better approaches that are less bug prone... check out the promise pattern, for example.
downvote count: 0
has comment: http://stackoverflow.com/comment/38544335
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/comment/38433654
score: 0
type: AnswerComment
type: Comment
has text: @jgreenebrg: In fact, you should *always* pass the data back into the `deferred.resolve`. Even if jQuery fails at passing [usable results](http://stackoverflow.com/a/19090635/1048572) from `$.when`
comment on: http://stackoverflow.com/a/24766738

http://stackoverflow.com/comment/38499071
comment on: http://stackoverflow.com/a/24803507
type: AnswerComment
has text: You should nuance your answer though. **Against this reasoning:** (1)When you don't have a lot of webstorage available and lots of images, it could be preferable to store them somewhere else (eg. Flickr, imgur). (2)Also, I've known Wordpress migrations to mess up the filepaths (requiring DB changes), which wouldn't have been the case with external sites.
score: 0
type: Comment

http://stackoverflow.com/q/24806772
has answer: http://stackoverflow.com/a/61173564
has answer: http://stackoverflow.com/a/73210224
has answer: http://stackoverflow.com/a/55770754
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/24806827
has answer: http://stackoverflow.com/a/39431956
has comment: http://stackoverflow.com/comment/136670088
has comment: http://stackoverflow.com/comment/138062753
has answer: http://stackoverflow.com/a/73475370
has answer: http://stackoverflow.com/a/58417066
has answer: http://stackoverflow.com/a/55260552
has comment: http://stackoverflow.com/comment/87063540
tagged with: javascript
has answer: http://stackoverflow.com/a/64014018
score: 908
has answer: http://stackoverflow.com/a/51794457
has body: How can I skip an array element in .map? My code: var sources = images.map(function (img) { if(img.src.split('.').pop() === "json"){ // if extension is .json return null; // skip } else{ return img.src; } }); This will return: ["img.png", null, "img.png"]
has answer: http://stackoverflow.com/a/46900857
has comment: http://stackoverflow.com/comment/38505383
linked to: http://stackoverflow.com/q/27110212
has answer: http://stackoverflow.com/a/78601427
has answer: http://stackoverflow.com/a/75858191
possible better answer: http://stackoverflow.com/a/55260552
has answer: http://stackoverflow.com/a/62729584
has title: How to skip over an element in .map()?
has comment: http://stackoverflow.com/comment/108069264
has answer: http://stackoverflow.com/a/61085770
favorite count: 0
has answer: http://stackoverflow.com/a/42194793
upvote count: 909
answer count: 20
has answer: http://stackoverflow.com/a/24806827
has answer: http://stackoverflow.com/a/45326991
has answer: http://stackoverflow.com/a/72132830
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/56955986
has answer: http://stackoverflow.com/a/51059280

http://stackoverflow.com/comment/38490431
type: Comment
has text: In Chrome it seems to work for me, but it doesn't have the nice fluid movement which Firefox has. Just an observation I thought I'd add.
comment on: http://stackoverflow.com/q/24798475
score: 0
type: QuestionComment

http://stackoverflow.com/comment/38666621
type: AnswerComment
comment on: http://stackoverflow.com/a/24891397
score: 0
type: Comment
has text: nitpick: `14.` is a `number`, not a `Number`; `.toString` autoboxes it

http://stackoverflow.com/q/24866252
has comment: http://stackoverflow.com/comment/38618597
duplicate of: http://stackoverflow.com/q/17335329
has answer: http://stackoverflow.com/a/24869738
upvote count: 2
has title: Ruby on Rails -- javascript doesn't work
score: 1
tagged with: ruby-on-rails
downvote count: 1
has comment: http://stackoverflow.com/comment/38618949
has comment: http://stackoverflow.com/comment/38619692
type: Question
has comment: http://stackoverflow.com/comment/38618251
accepted answer: http://stackoverflow.com/a/24869738
has body: I need to implement Star Rating system to let users rate hotels. I took this tutorial as the example. rating.js file is: $(function() { $('.rating_star').click(function() { var star = $(this); var form_id = star.attr("data-form-id"); var stars = star.attr("data-stars"); $('#' + form_id + '_stars').val(stars); $.ajax({ type: "post", url: $('#' + form_id).attr('action') + '.json', data: $('#' + form_id).serialize(), success: function(response){ console.log(response); update_stars(); if(response["avg_rating"]){ $('#average_rating').text(response["avg_rating"]); } } }) }); }); function update_stars(){ $('.star_rating_form').each(function() { var form_id = $(this).attr('id'); set_stars(form_id, $('#' + form_id + '_stars').val()); }); } function set_stars(form_id, stars) { for(i = 1; i &lt;= 5; i++){ if(i &lt;= stars){ $('#' + form_id + '_' + i).addClass("on"); } else { $('#' + form_id + '_' + i).removeClass("on"); } } } But this code doesn't work, because when I mouse-on or click the stars, nothing happens at all... I think the error is somewhere in the java code, because testing javascript file works fine. But I can't find this error. PS: ratings_controller.rb before_filter :js_logged_in def create @rating = Rating.new(params[:rating]) @hotel = Hotel.find(params[:rating][:hotel_id]) respond_to do |format| if @rating.save format.json { render :json =&gt; { :avg_rating =&gt; @hotel.avg_rating } } else format.json { render :json =&gt; @rating.errors, :status =&gt; :unprocessable_entity } end end end def update @rating = Rating.find(params[:id]) @hotel = Hotel.find(params[:rating][:hotel_id]) @rating.update_attributes(params[:rating]) respond_to do |format| if @rating.save format.json { render :json =&gt; { :avg_rating =&gt; @hotel.avg_rating } } else format.json { render :json =&gt; @rating.errors, :status =&gt; :unprocessable_entity } end end end def rating_params params.require(:rating).permit(:stars) end private def js_logged_in if(!signed_in?) flash[:error] = "You must…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38619552
tagged with: javascript
has comment: http://stackoverflow.com/comment/38620399
has comment: http://stackoverflow.com/comment/38625507
has comment: http://stackoverflow.com/comment/38618383
answer count: 1
has comment: http://stackoverflow.com/comment/38618179
has comment: http://stackoverflow.com/comment/38618936
has comment: http://stackoverflow.com/comment/38619555
favorite count: 0
tagged with: rating-system
linked to: http://stackoverflow.com/q/17335329
has comment: http://stackoverflow.com/comment/38618852
has comment: http://stackoverflow.com/comment/38619428

http://stackoverflow.com/q/24826932
has comment: http://stackoverflow.com/comment/38553101
has comment: http://stackoverflow.com/comment/38552763
favorite count: 0
tagged with: d3.js
upvote count: 1
has comment: http://stackoverflow.com/comment/38546434
has title: Not all coordinates are plotted using parallel-coordinates (d3)
accepted answer: http://stackoverflow.com/a/24869566
tagged with: parallel-coordinates
type: AnsweredQuestion
has body: I am trying to use the parallel-coordinates library to plot some data. The coordinates of the data points that I have are all strings. Consider for example the following CSV table: ID,TYPE,USER,OS,FooBar,Country a1,X,1S,iOS,foo,US a2,Y,1S,Android,bar,US These are two data points, each having six attributes. The html MWE that I have is the following: Minimal Working Example Lines from the data Unfortunately, as you can see in the screenshot, this plots only four (4) coordinates... I believe that the problem is somehow related to the fact that all the coordinates are strings, but I'm not sure. Any suggestions how to correct this?
score: 1
has answer: http://stackoverflow.com/a/24869566
type: Question
has comment: http://stackoverflow.com/comment/38606091
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: data-visualization

http://stackoverflow.com/q/24828094
upvote count: 1
has comment: http://stackoverflow.com/comment/41932204
type: Question
tagged with: javascript
has body: I'd like to change the layout of my page when I click anywhere in the page. Basically what I did, into my application view, I created a function that changes the layoutName, then rerender the view. application.js (view) export default Ember.View.extend({ layoutName: 'application-layout1', click: function () { this.set('layoutName', 'application-layout2'); this.rerender(); } }); application.hbs {{outlet}} application-layout1.hbs Layout 1 header {{yield}} Layout 1 footer application-layout2.hbs Layout 2 header {{yield}} Layout 2 footer It works fine, but I get some errors coming from Ember depending of the page I'm in. From page 1, when I click, I get this: Assertion Failed: Attempted to register a view with an id already in use: null From page 2: TypeError: Cannot read property 'parentNode' of null Do you have any idea from where those errors are coming? Thanks
has title: Rerender view causes errors
downvote count: 0
tagged with: ember-app-kit
favorite count: 0
type: UnansweredQuestion
tagged with: ember.js
answer count: 0
score: 1

http://stackoverflow.com/comment/38695875
has text: I hope you got it.Right?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24903944
type: Comment

http://stackoverflow.com/comment/38461508
type: QuestionComment
comment on: http://stackoverflow.com/q/24783346
score: 0
has text: How can I do this without any php code but with just javascript calls?
type: Comment

http://stackoverflow.com/comment/38627071
type: QuestionComment
score: 0
has text: Did u add into imacros code SET !TIMEOUT_MACRO 60 ?
comment on: http://stackoverflow.com/q/24857132
type: Comment

http://stackoverflow.com/q/24781955
has comment: http://stackoverflow.com/comment/38459389
tagged with: javascript
type: UnansweredQuestion
has title: JavaScript: Function to check if parameter is a number
score: 2
downvote count: 0
has answer: http://stackoverflow.com/a/24782411
favorite count: 0
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/38458503
has comment: http://stackoverflow.com/comment/38458911
has body: I have problem. I am writing online JavaScript test, and there is a task to write a function which checks if the value of the parameter is a number. If so, then function must return true. So I wrote it: function Numeric(a) { if(isNaN(a)===false) return true; else throw "Element is not a number"; } It works fine is JSfiddle, but I don't know why, at that site it is not working. Doesn't pass the test. Any ideas?
has comment: http://stackoverflow.com/comment/38458863
has comment: http://stackoverflow.com/comment/38458464
answer count: 1
has comment: http://stackoverflow.com/comment/38458469
has comment: http://stackoverflow.com/comment/38458847
linked to: http://stackoverflow.com/q/18082

http://stackoverflow.com/q/24764904
score: 2
has comment: http://stackoverflow.com/comment/38426849
has answer: http://stackoverflow.com/a/24832444
has title: Yammer Embed suddenly not working in IE when Compatibility View is enabled
type: Question
upvote count: 2
answer count: 1
has body: As of yesterday, our employees no longer see the Yammer Embed feed within our intranet site. In its place is white space - no errors on the page. We found that disabling compatibility view in IE fixes the issue - however, Yammer Embed was working just fine in compatibility view before yesterday. When compatibility view is enabled, we also see this error: SCRIPT438: Object doesn't support property or method 'querySelector' platform_embed.js, line 1 character 3802 We are curious if code has changed on the Yammer end recently that would be causing this issue?
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: yammer
has comment: http://stackoverflow.com/comment/38434230
type: UnansweredQuestion

http://stackoverflow.com/q/24904700
has comment: http://stackoverflow.com/comment/38690969
tagged with: css
has comment: http://stackoverflow.com/comment/38691615
has comment: http://stackoverflow.com/comment/38695040
has comment: http://stackoverflow.com/comment/38691203
type: Question
has body: I have a bit of javascript / jquery that upon pressing "enter" in a search box goes through all table rows and then hides those which are not applicable/ do not contain the string. This process is however is extremely taxing on slower systems and so I decided to implement a small loading gif so people know something is happening even though it seems the browser has frozen. The problem though is that the image never appears. I'm assuming it's because the browser freezes. So, now to my question. How can i either make the loop faster, use less computing power, and show the gif? Thank you very much var $rows = $('tbody tr.visall'); $('#search').keydown(function(e) { if (e.keyCode == 13){ $('.load').show(); var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase(); $rows.show().filter(function () { var text = $(this).text().replace(/\s+/g, ' ').toLowerCase(); return !~text.indexOf(val); }).hide(); }; $('.load').hide(); }); edit: this code goes through about 9000-10000 tr elements.
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/38691541
has answer: http://stackoverflow.com/a/24906115
has comment: http://stackoverflow.com/comment/38691280
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38691176
has answer: http://stackoverflow.com/a/24906594
has title: Prevent javascript search function from slowing down browser
type: UnansweredQuestion

http://stackoverflow.com/a/24826133
upvote count: 1
type: AcceptedAnswer
has body: Try following, it works for just two arrays _.reject(one, function(obj){ return _.findWhere(two, obj); }); But objects should be like bellow var one = [ { _id:"53c907016b7536a18b0001ab", title:"..." }, { _id:"53c90942b879875e2b0001ec", title:"..." } ] var two = [ { _id:"53c907016b7536a18b0001ab", title:"..." } ]
type: Answer
has comment: http://stackoverflow.com/comment/38542302
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24825948
accepted answer of: http://stackoverflow.com/q/24825948
has comment: http://stackoverflow.com/comment/38542237

http://stackoverflow.com/q/24889112
tagged with: facebook
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24889278
score: 0
has title: Fetch Information from Facebook Login
type: Question
tagged with: javascript
tagged with: jquery
has body: I want to know how can I access a user's name and email address from a Facebook-login button, that I have inserted in my site. I want to save the name and the respective score of the user, so that I can update them. I have tried many methods like graph API, access tokens but nothing has worked for me...... Am developing a game using Parse. I want to save the score and username including email on cloud code(Parse) Secondly I want to print the scoreboard in descending order automatically.
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/24889278

http://stackoverflow.com/a/24828802
downvote count: 0
has body: Variable declarations are moved to the top of the scope they are defined in and the values are not assigned, till the assignment line is executed. So, your second code can be understood as function a() { var h = 1; function b() { var h; if (false) { h = h * 2; } alert(h); } b(); } a(); Even though you have defined h within the if clause, since JavaScript doesn't have block scoping, the variable declaration is actually moved to the top of the function. And since the if condition is not satisfied, h is never assigned a value. That is why it alerts undefined
type: Answer
answers question: http://stackoverflow.com/q/24828743
score: 5
upvote count: 5

http://stackoverflow.com/a/24788700
has comment: http://stackoverflow.com/comment/38471902
has comment: http://stackoverflow.com/comment/38472454
type: Answer
has comment: http://stackoverflow.com/comment/38471932
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/38473064
has body: I think you are wrong in your assumption therefore requiring an http request each time it appears on the page is not desired jQuery will be cached by the browser as long as it is getting it from the same URL. It is basically a free request. Now, the reason you can't "share" the jQuery object as you want, is that selector's have a context. A DOM Element, Document, or jQuery to use as context The default is document (I believe), and as you are accessing the parents object, it's default is the already set document. You should be able to do: window.jQuery = window.parent.jQuery; jQuery('#elem-in-iframe', document) In the iframe to pass in the iframes window as the context, and then it should theoretically work. You may even be able to do this in the iframe: window.jQuery = window.parent.jQuery; $ = jQuery(document); and then you can just do $('#elem-in-iframe')
answers question: http://stackoverflow.com/q/24788452
has comment: http://stackoverflow.com/comment/38472298
upvote count: 2
has comment: http://stackoverflow.com/comment/38476527

http://stackoverflow.com/comment/39861411
comment on: http://stackoverflow.com/a/25520452
type: Comment
type: AnswerComment
has text: Thanks Axel for all of you help with other questions and this one.
score: 0

http://stackoverflow.com/q/24879723
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/38645554
has comment: http://stackoverflow.com/comment/38644857
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38646044
possible better answer: http://stackoverflow.com/a/24880184
has answer: http://stackoverflow.com/a/24880184
has comment: http://stackoverflow.com/comment/38644835
has answer: http://stackoverflow.com/a/24882092
has comment: http://stackoverflow.com/comment/38645835
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38644893
type: Question
tagged with: charts
answer count: 2
accepted answer: http://stackoverflow.com/a/24882092
has comment: http://stackoverflow.com/comment/38645890
has body: I have an HTML table that contains dynamically generated values. This is what it looks like on page load: http://jsfiddle.net/HE8Vj/ The first column of the HTML table contains check boxes. I want the pie chart that is generated from the HTML table to ONLY contain the rows on the HTML table whose check box has been checked. I am using Highcharts library for the pie chart. I have managed to get the code partially working. When checkboxes in row (1) or (1,2) or (1,2,3) or (1,2,3,4) are selected, the pie chart is generated properly. But when that proper order is changed, like when a row is skipped, eg: row (2) or (2,3,4) or (1,3,4) or (4), the console pops an error and the pie chart is not generated. Here is the JSFIDDLE This has been bugging me for quite some time. Small code segment: if ($('#check'+i).is(':checked')) { console.log(i); options.series[0].data[i-1].push(this.innerHTML); } Thanks! Edit: Here is the entire file (no additional files needed to run it) - http://pastebin.com/nhr4Q0fm
tagged with: highcharts
has title: Highchart from select rows in HTML table
has comment: http://stackoverflow.com/comment/38645088
tagged with: javascript

http://stackoverflow.com/q/24827377
has comment: http://stackoverflow.com/comment/38544683
type: AnsweredQuestion
type: Question
linked to: http://stackoverflow.com/q/518000
tagged with: arrays
tagged with: javascript
tagged with: date
has answer: http://stackoverflow.com/a/24827654
accepted answer: http://stackoverflow.com/a/24827654
linked to: http://stackoverflow.com/q/13104494
score: 0
has body: I am working on a website where users can book vacation houses. Booking always is from Saturday to Saturday. If users click on any date in that week, the whole week must be selected. I've got that part working. I gave the selected dates the "date-range-selected" class. And if the first day was already booked, but only in the morning then I gave it the class "half-selected". Now because I need to calculate with these dates I need the full dates and not only the day number. Only the ones with the "half-selected" and the "date-range-selected" need to be added to an array. I tried to push variables to that array and it seemed to work, but when I try to use the array after the for loop, it seems like all array content is changed to the date after the last selected date, what am I doing wrong? //ex.selected dates are: 9-16 august var halfke= document.getElementsByClassName("half-selected"); var rest = document.getElementsByClassName("date-range-selected"); var dagen = []; if(typeof halfke[0] != 'undefined') { dagen.push(halfke[0].getElementsByClassName("ui-state-default")[0].innerHTML.trim()); } for (index = 0; index &lt; rest.length; ++index) { dagen.push(rest[index].getElementsByClassName("ui-state-default")[0].innerHTML.trim()); } var myDate = new Date(cur); var dw = myDate.getDay(); myDate.setDate(myDate.getDate() - (dw+1)); var myDate2 = new Date(cur); myDate2.setDate(myDate2.getDate() + (6-dw)); //alert(dagen[0]); var juiste_dagen = new Array(); for (var d = myDate; d &lt;= myDate2; d.setDate(d.getDate() + 1)) { //alert(dagen[0]+ " - " + String(d.getDate())) if(dagen.indexOf(String(d.getDate()))&gt;-1) { //alert(d); juiste_dagen.push(d); alert(juiste_dagen[0]);//here it alerts 9 august (as it should) } } alert("done"); alert(juiste_dagen[0]);//here it alerts 17 august(which it should not do) alert(juiste_dagen[1]);//here it alerts 17 august(which it should not do) alert(juiste_dagen[2]);//here it alerts 17 august(which it should not do) It's probably something small…
answer count: 1
tagged with: datepicker
has title: Javascript dates to array

http://stackoverflow.com/comment/38624174
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24869295
type: Comment
has text: Basic usage is actually pretty simple. Just create a Node.js file with `require()`s, run the `browserify` command from a CLI, and be done with it.

http://stackoverflow.com/a/24880300
type: Answer
answers question: http://stackoverflow.com/q/24876420
has body: You can achieve this functionality by implementing a custom extension. I will show you the steps that we need to take to achieve this. So our extension should have a name Programmerrkt_AdvancedCms. First step is activating our module. For this add this file in etc/modules Location : app/etc/modules/Programmerrkt_AdvancedCms.xml <Programmerrkt_AdvancedCms> true local </Programmerrkt_AdvancedCms> Next step is to define configuration of our module. Let us do that. Location : app/code/local/Programmerrkt/AdvancedCms/etc/config.xml <Programmerrkt_AdvancedCms> 1.0.0 </Programmerrkt_AdvancedCms> <programmerrkt_advancedcms> programmerrkt_advancedcms.xml </programmerrkt_advancedcms> This file tells to Magento that our module has a layout file for frontend section. That's it. Our layout file is the heart of our module. It is going to hold the important parts of our module. Let us define our layout file. Location : app/design/frontend/<your_package>/<your_theme>/layout/programmerrkt_advancedcms.xml <cms_page> skin_css css/customcss/readmore.css skin_js js/jquery1.js skin_js js/customjs/readmore.js <block type="core/template" name="readmore.script.template" template="programmerrkt/advancedcms/readmore/script.phtml" /> </cms_page> So here we defined layout for cms_page handler. Magento will look for this layout handler whenever a request for CMS page is made. So this handler would be a perfect handler for us. Next we added jquery and readmore.js in header section. Then at last we defined a template file script.phtml for holding our custom javascript code. Note that we included this template at the bottom of page. This will ensure that, our custom code will invoked perfectly. Now our script.phtml should look like this. Location : app/design/frontend/<yourpackag>/<your_theme>/template/programmerrkt/advancedcms/readmore/script.phtml As you can see readmore() method is called on an element with an id readomore-demo. So it is required that, you need to enclose all the content your cm…
has comment: http://stackoverflow.com/comment/38703514
has comment: http://stackoverflow.com/comment/38681339
score: 0
has comment: http://stackoverflow.com/comment/38682473

http://stackoverflow.com/comment/38670720
comment on: http://stackoverflow.com/a/24892642
score: 0
type: AnswerComment
has text: one more question before I accept answer. How I can add event-listener for enter just when cursor is focused in one of the form field. I don't want to submit form wherever hit enter.
type: Comment

http://stackoverflow.com/q/24793563
tagged with: css
tagged with: youtube
has title: show and start hidden video after click
type: Question
tagged with: hidden
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/24793685
has body: I need an easy way to cover a youtube Video with an image and when I click on it, the video should show up and start. What is the easiest way to get this done? I tried to make a css change on click, but it doesnt work out. It works with a css :hover effect but not with jquery.? #videowrapper{ width:560px; height:315px; background:url("//"); cursor:pointer; margin:100px -40px; float:right; border:1px solid white; } #video{ opacity:0; }
type: UnansweredQuestion

http://stackoverflow.com/a/24751597
score: 0
answers question: http://stackoverflow.com/q/24750161
type: Answer
has body: Just a comment, but I needed space: Assuming the forEach function is something like: function forEach(arr, fn) { for (var i=0, iLen=arr.length; i&lt;iLen; i++) { if (arr.hasOwnProperty(i)) { fn(arr[i], i, arr); } } } then: flatten([[[1,2,3]]]) // =&gt; [[1,2,3]] which seems to be what you want. Or have I misread the question?

http://stackoverflow.com/q/24858066
tagged with: css
answer count: 4
has comment: http://stackoverflow.com/comment/38602984
score: 1
has answer: http://stackoverflow.com/a/24858254
has body: Is there any way to copy text from tool tip without using any addition plugins in javascript? For Example : NitiN when i hover on td tag it show me tooltip and that contains string "NitiN". So,I want allow users to select texts on tooltip without using any addition JS plugins
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38603023
tagged with: javascript
has comment: http://stackoverflow.com/comment/38603197
has comment: http://stackoverflow.com/comment/38602865
has answer: http://stackoverflow.com/a/24858129
has comment: http://stackoverflow.com/comment/38602869
has title: Copying text from tool-tip in javascript?
has comment: http://stackoverflow.com/comment/38603097
tagged with: jquery
has comment: http://stackoverflow.com/comment/38602953
favorite count: 0
upvote count: 2
has answer: http://stackoverflow.com/a/24858089
has answer: http://stackoverflow.com/a/24858430
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/38442986
comment on: http://stackoverflow.com/q/24772208
has text: I did try and still getting node: Command not found.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38668667
type: Comment
has text: Good answer. The only addition I would add, would be to drop the `lockedPoints` array. It's cleaner to have each "tooltip" store it's own information, and jquery makes that easy with the `data` and `attr` methods. Here's an example: http://jsfiddle.net/NVxU6/2/
score: 2
type: AnswerComment
comment on: http://stackoverflow.com/a/24883170

http://stackoverflow.com/a/24786529
answers question: http://stackoverflow.com/q/24786381
score: 0
type: Answer
has body: Try this code: //Class var Item = function() { this.itemNumber = 1; } Item.prototype.itemUp = function(){ this.itemNumber++; } //New Object item = new Item(); $scope.currentItem = item; item.itemUp();

http://stackoverflow.com/a/24832365
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38554681
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38554512
upvote count: 1
has body: You can use ngModelController: .directive('checkMeIfApplyAll', function($timeout) { return { require: 'ngModel', link: function(scope, element, attrs, ngModel) { scope.$watch(attrs.checkMeIfApplyAll, function(value) { debugger; if(value === true) { element.prop('checked', true); } else { element.prop('checked', false); } // Set value like this ngModel.$setViewValue(value); }); } };
accepted answer of: http://stackoverflow.com/q/24832120
has comment: http://stackoverflow.com/comment/38558151
answers question: http://stackoverflow.com/q/24832120
type: Answer

http://stackoverflow.com/comment/39078077
has text: Could you clarify what I need to exactly put in the "Do you initialization here or separate js file" area? Do you mean I can either put all my jQuery code in there? If I keep my jQuery code in a separate file, what exactly would I type there?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24834406
type: Comment

http://stackoverflow.com/q/24845075
upvote count: 2
answer count: 3
favorite count: 0
tagged with: cordova
possible better answer: http://stackoverflow.com/a/24848064
tagged with: phonegap-build
has title: Ionic basics - which elements to use for a basic app?
tagged with: css
type: AnsweredQuestion
score: 2
downvote count: 0
accepted answer: http://stackoverflow.com/a/30875155
tagged with: ionic-framework
type: Question
has answer: http://stackoverflow.com/a/24848064
has answer: http://stackoverflow.com/a/30875155
has body: The ionic documentation is very frustrating. First of all I can't install it via the method described on the site, on my Mac or PC I get a "Your version of Cordova is too old. Please reinstall." error and despite following instructions I can't fix it. Tbh I'm not a huge fan of installing things on the command line if I can just download the files (a la jQuery mobile) and get on with it. So I got the latest Ionic beta and I've been trying to build some tests with it. The todo app on the Ionic site pretty much works (though the project list text is white when you Phonegap Build it). Anyway, my question is this: Which elements am I supposed to use for building - the CSS ones or the JavaScript ones? I'm hoping I'm missing something really obvious but I've used the docs here: http://ionicframework.com/docs/components/ and here: http://ionicframework.com/docs/api/ Let's take headers. The CSS page says you can build them like this: bar-light and the JavaScript page says like this: bar-light Both work for me, locally at least. So which is it? The CSS elements aren't all mirrored in the Javascript page. I'm just baffled by this and I don't want to use the slower, less efficient or less flexible method.
tagged with: javascript
has answer: http://stackoverflow.com/a/24852367

http://stackoverflow.com/comment/38670613
score: 0
type: AnswerComment
has text: Forgot to mention that the `$scope.$digest()` will not work if use in a directive with an isolated scope because it will not trigger watchers of a parent scope that it is binded to. There may be some other situation like this, so you should be careful if you want to do a micro-optimization by using `$scope.$digest()`.
type: Comment
comment on: http://stackoverflow.com/a/24883691

http://stackoverflow.com/comment/38686525
comment on: http://stackoverflow.com/q/24901802
type: Comment
type: QuestionComment
score: 0
has text: Is success not alerting???

http://stackoverflow.com/comment/38401022
has text: Can you post on Fiddle
score: 2
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24751374

http://stackoverflow.com/comment/38465572
comment on: http://stackoverflow.com/q/24785494
has text: And the problem you're having is.....?
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/38529445
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24817347
has text: @Noitidart I want to use it for file upload as per my other 2 questions

http://stackoverflow.com/comment/38565872
type: QuestionComment
comment on: http://stackoverflow.com/q/24838976
has text: `echo $usercokie` i think `$usercokie` has blank value
score: 0
type: Comment

http://stackoverflow.com/a/25085811
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/24783276
answers question: http://stackoverflow.com/q/24783276
type: AcceptedAnswer
downvote count: 0
has body: This is fairly straightforward. You can define your scales and axes in D3 as normal, then map the input array to a new array of objects by calling your D3 methods. You can then easily pass this data to Snap.svg. var input = [33, 54, 14, 45, 322, 653, 11]; var xScale = d3.scale.ordinal() .domain(input) .rangeBands([0, 550]); var yScale = d3.scale.linear() .domain([0, 800]) .range([275, 0]); var output = input.map(function(value){ return { x: xScale(value), y: yScale(value) }; }); var svg = Snap("svg"); output.forEach(function(value){ var c = svg.circle(value.x, value.y, 5); }); Here is a JSBin demonstrating this functionality.
type: Answer

http://stackoverflow.com/a/24771728
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38461842
type: Answer
has comment: http://stackoverflow.com/comment/38471567
has comment: http://stackoverflow.com/comment/38474416
has comment: http://stackoverflow.com/comment/38460009
accepted answer of: http://stackoverflow.com/q/24768450
has comment: http://stackoverflow.com/comment/38465333
has comment: http://stackoverflow.com/comment/38463844
answers question: http://stackoverflow.com/q/24768450
has comment: http://stackoverflow.com/comment/38471491
has comment: http://stackoverflow.com/comment/38458648
has body: Update Based on the fiddle @gaitat provided here, this looks like a bug to me. It does not behave as I would have expected. Here's a fiddle that distills the issue. @gaitat has opened a bug report: https://github.com/ericdrowell/KineticJS/issues/973 Original Answer Here are a couple fiddles based on your code. The first is a simple implementation of the true / false condition in your question: http://jsfiddle.net/klenwell/R49Pg/ You can change the PASS var setting to verify both true and false cases work as expected. The second example is more interesting: http://jsfiddle.net/klenwell/5HB5h/ The conditional logic is event-based: layer.find('.rectangle').on('dragstart dragend', function(evt) { if ( evt.type == 'dragstart' ) { console.log('pass'); rectTweenPass.play(); } else { console.log('fail'); rectTweenFail.play(); } }); I notice one unexpected behavior that might be related to your issue: With the event-based logic, it is easy for the tweens to step on one another. To see what I mean, drag the rectangle for only a second or so then release it and you'll see the fail tween interrupt the pass one. Watching the console log helps track the events. Also note that if your tweens can be run multiple times, you'll need to reset the tweens between each call. You can see in my example that, after the first execution, when each tween is called, it appears to just skip to the finish without the animation. This, too, could contribute to unexpected behavior.
score: 0

http://stackoverflow.com/a/24818821
type: Answer
has comment: http://stackoverflow.com/comment/38607303
has comment: http://stackoverflow.com/comment/38529334
has comment: http://stackoverflow.com/comment/38566331
has comment: http://stackoverflow.com/comment/38607318
answers question: http://stackoverflow.com/q/24817601
score: 0
has body: Have you give image name with it it's path.If yes then check that image exist at given location.

http://stackoverflow.com/a/24827776
downvote count: 0
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/24827649
has body: The $timeout service has a cancel method to cancel a timeout var promise = $timeout(function(){ Service.getDataDetails(id).then(function (result) { $scope.data = result; }); },1000); //... //somewhere else $timeout.cancel(promise); The cancel method will cause the promise to be rejected instead of resolved.

http://stackoverflow.com/q/24879945
has body: I am trying to load a url and parse its contents (say all anchor tags) inside a chrome extension using jquery .How can I do it?P.S. I am new to this so bare me if this question doesn't meet the criteria of S.O.
score: -1
downvote count: 1
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24880336
tagged with: google-chrome-extension
tagged with: http://stackoverflow.com/tag/html
tagged with: parsing
favorite count: 0
has comment: http://stackoverflow.com/comment/38645187
type: UnansweredQuestion
has title: How to load and parse the contents of different url using jquery?

http://stackoverflow.com/q/24901516
downvote count: 0
tagged with: javascript
has body: Currently when I use browserify and coffeeify the source maps work perfectly. However when I add another transform of uglifyify the sourcemap gets obscured into the minified javascript. Is it possible to use both transforms and pass the sourcemap from coffeeify to uglifyify? Here is my arguments for browserify: -d -t coffeeify -g uglifyify --extension=".coffee" -e "main.coffee" -o "bundle.js" Also, while i'm asking, does anyone know how to require modules that I have installed globally for node? Browserify seems to only look in the local node_modules folder and not the global one.
tagged with: browserify
favorite count: 0
answer count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: node.js
score: 2
tagged with: uglifyjs
has title: NodeJS Browserify: Using uglifyfy with coffeeifyfy with source maps
tagged with: coffeescript
type: Question

http://stackoverflow.com/comment/38611366
score: 0
type: Comment
type: QuestionComment
has text: @adeneo: *"You have "JSON arrays", but there's no such thing"* Sure there is: `"[1, 2, 3, 4]"` That's a JSON array. ;-D *(I know you know that, just trying a bit of levity.)*
comment on: http://stackoverflow.com/q/24862347

http://stackoverflow.com/q/24832286
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/24832824
answer count: 1
type: UnansweredQuestion
has title: Error twitter API with node js
tagged with: node.js
has body: I have the following node js code var http= require('http').createServer(); var util = require('util'); var twitter=require('ntwitter'); http.listen(3000); var twit= new twitter({ consumer_key: 'consumer_key', consumer_secret: 'consumer_secret', access_token_key: 'access_token_key', access_token_secret: 'access_token_secret' }); console.log('Connected to twittere'); twit.stream( 'statuses/filter', { track: ['awesome', 'cool', 'rad', 'gnarly', 'groovy'] }, function(stream) { stream.on('data', function(tweet) { console.log(tweet.text); }); } ); console.log('after Connected'); after executing the code i get error as : $ node twitter1 Connected to twittere after Connected events.js:74 throw TypeError('Uncaught, unspecified "error" event.'); ^ TypeError: Uncaught, unspecified "error" event. at TypeError (&lt;anonymous&gt;) at EventEmitter.emit (events.js:74:15) at ClientRequest.&lt;anonymous&gt; (/Users/atishshinde/Documents/RIT/GIS/node_modules/ntwitter/lib/twitter.js:251:14) at ClientRequest.EventEmitter.emit (events.js:95:17) at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1688:21) at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:121:23) at CleartextStream.socketOnData [as ondata] (http.js:1583:20) at CleartextStream.read [as _read] (tls.js:507:12) at CleartextStream.Readable.read (_stream_readable.js:320:10) at EncryptedStream.write [as _write] (tls.js:366:25) i am not sure what is going wrong here? Its a simple code .. Please suggest.. Thank you.
tagged with: twitter
type: Question

http://stackoverflow.com/comment/38560795
score: 1
comment on: http://stackoverflow.com/a/24836075
has text: `join()` is native javascript array method, used to join array elements
type: AnswerComment
type: Comment

http://stackoverflow.com/a/24772869
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38442894
type: Answer
has body: Try this : if ($(this).attr("class") == "Btn1 selected"){ $(this).removeClass("selected"); alert($(this).attr("class")); //alert output --&gt;Btn1 }else if($(this).attr("class") == "Btn1"){ $(this).addClass("selected"); alert($(this).attr("class")); //alert output --&gt;Btn1 selected }
answers question: http://stackoverflow.com/q/24772738
score: 0
accepted answer of: http://stackoverflow.com/q/24772738

http://stackoverflow.com/q/24808396
has comment: http://stackoverflow.com/comment/38509470
tagged with: http://stackoverflow.com/tag/html
answer count: 1
score: 1
has comment: http://stackoverflow.com/comment/38508725
favorite count: 0
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38509445
has comment: http://stackoverflow.com/comment/38509687
has body: I wrote the following code that uses jQuery UI's autocomplete method on a text box. $(function() { $('#project').autocomplete({ source: function(request, response){response(Object.getOwnPropertyNames(projects))}, minLength: 0, messages: {noResults: '', results: function(){}}, autoFocus: true }).on('focus', function(event) { //Display the suggestions list on focus $(this).autocomplete("search", ""); }); }) I'm facing the following issues: While clicking on a text field does show the corresponding list of suggestions, the autoFocus doesn't work. I want the first value in the list to be highlighted. But this is all I get: On mouse-over, the list elements get highlighted, like so: I use the following styling to accomplish this: .ui-autocomplete a:hover {background-color: #C1CDCD;cursor:default} But, when I use the up/down arrows to navigate the list, the corresponding value shows in the text field but the element in the list doesn't get highlighted. How do I resolve these issues? Here's the JSFiddel. Thanks for your time.
tagged with: jquery-ui
has answer: http://stackoverflow.com/a/24809295
has comment: http://stackoverflow.com/comment/38509283
type: Question
accepted answer: http://stackoverflow.com/a/24809295
tagged with: autocomplete
has title: Issues with jQuery UI autocomplete
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38509531

3d-model
type: Tag
tag name: 3d-model
tags question: http://stackoverflow.com/q/24789045

http://stackoverflow.com/comment/38729808
comment on: http://stackoverflow.com/a/24901124
has text: No. Wait! This does work!! Stupid me!! Playing and tweaking the code fixed the issue with the suggestion from Navas Basheer. THANKYOU NAVAS BASHEER. edit your answer and I will mark it as correct.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38661340
type: Comment
type: QuestionComment
has text: So i am stuck with adding 24 html forms for my buttons just for the GET requests? Like i said i have these buttons that do Jquery magic on there own in a couple of lines but i cannot do a simple GET request within the click function?
score: 0
comment on: http://stackoverflow.com/q/24889045

http://stackoverflow.com/comment/38663462
type: Comment
type: QuestionComment
has text: @jeremy - I'm running inside nodejs, so in any case that never gets set, it should be set to the global scope object
comment on: http://stackoverflow.com/q/24890107
score: 0

http://stackoverflow.com/q/24868951
tagged with: animation
tagged with: ng-view
answer count: 0
has comment: http://stackoverflow.com/comment/38623435
has body: I am new to Angular but I was wondering if you could animate inside ng-view once the template has been loaded? For example, I want to click on a link within my navigation and load a html template within the ng-view, within this html template then i want individual divs to automatically animate/fade onto the page without any further clicking/interaction needed by the user. So it all comes together as one smooth animation from that initial click on the navigation. Is this possible? So far all the info I have seen, just talks about animating the actual ng-view itself and not the html content located dynamically. Any help will be most appreciated!
has comment: http://stackoverflow.com/comment/38650904
has title: Can you animate within angular ng-view?
type: Question
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/comment/38621523
comment on: http://stackoverflow.com/q/24867928
score: 0
type: QuestionComment
has text: `call stack exceeded` usually means infinite recursion. Based on your gruntfile I believe you should not setup output file the same as input in `uglify` section. UPD: just noticed that build halts on CSS minification, so uglify is not the reason of issue.
type: Comment

http://stackoverflow.com/comment/38573395
type: QuestionComment
has text: in `iframe` use `parent.functionName();` inside ` ` tag.
score: 1
comment on: http://stackoverflow.com/q/24842957
type: Comment

http://stackoverflow.com/q/24759792
tagged with: events
has answer: http://stackoverflow.com/a/24759921
has comment: http://stackoverflow.com/comment/38417552
favorite count: 0
score: 2
has comment: http://stackoverflow.com/comment/38416871
upvote count: 2
accepted answer: http://stackoverflow.com/a/24759811
possible better answer: http://stackoverflow.com/a/24759921
type: AnsweredQuestion
has body: I have a button: &lt;input onclick="if (!PreSaveItem()) return false;WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$m$g_1b663413_07f2_4335_90bd_e843be587b73$ctl00$toolBarTbl$RightRptControls$ctl00$ctl00$diidIOSaveItem", "", true, "", "", false, true))" type="button" target="_self" jQuery1110039212041699899153="167" value="Save"/&gt; When I have an error on form, i remove the attr onclick.... so it wont save the page... and when i dont have an error, i replace the attr onclick to default... But when i do this, the onclick function is not executed.... can I declare a function with the my code in a variable? like this: var onClickBtn = $( 'input' ).attr( 'onclick' ); function myFunc = onClickBtn; myFunc();
tagged with: onclick
type: Question
has title: How to make a function with my code in a variable
answer count: 2
has answer: http://stackoverflow.com/a/24759811
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38416862

http://stackoverflow.com/q/24752316
has comment: http://stackoverflow.com/comment/38410316
has answer: http://stackoverflow.com/a/30625222
type: Question
has comment: http://stackoverflow.com/comment/38403830
has comment: http://stackoverflow.com/comment/38411532
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Custom Autocomplete with jquery
has comment: http://stackoverflow.com/comment/38402852
has body: I am working on jquery autocomplete custom data and display.I want to display some static dropdown on keypress in textbox.when user select that list item i want to add it to textbox. the code which i have tested is $('#uinput').keyup(function() { var val = $('#uinput').val(); if(val.length&gt;1) { // check length // handle successful DWR response //alert(data); var b=[{value: "jquery-ui", label: "jQuery UI",}]; $('#uinput').autocomplete({source:b, select: function( event, ui ) { $( "#uinput" ).val( ui.item.label+"="+document.getElementById('uinput').value ); return false; } }).data("autocomplete")._renderItem = function( ul, item ) { return $( "&lt;li&gt;" ) .data('item.autocomplete', item) .append( "&lt;a&gt;" + item.label + "=" + document.getElementById('uinput').value + "&lt;/a&gt;" ) .appendTo( ul ); }; } else { $('#uinput').autocomplete([]); // clean } }); For reference what i want to do custom autocomplete
answer count: 1
has comment: http://stackoverflow.com/comment/38407712
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38403050
has comment: http://stackoverflow.com/comment/38403316
has comment: http://stackoverflow.com/comment/38403171
score: 2

http://stackoverflow.com/comment/38661541
type: Comment
comment on: http://stackoverflow.com/a/24889162
has text: changing location.href changes the page, didn't mean the history api pushState method
type: AnswerComment
score: 0

http://stackoverflow.com/q/24855487
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/24855590
has body: if using the following code: $("#element").on('click', function(){ alert("clicked!"); }); $("#element").on('click', function(){ alert("clicked!"); }); it is well known that the click event will fire twice. because it was bound with the method on() and no unbinding with off() followed. Now my question is why on this page the click event method is registered only once no matter how many times you click the binding button?? &lt;script&gt; function flash() { $( "div" ).show().fadeOut( "slow" ); } $( "#bind" ).click(function() { $( "body" ) .on( "click", "#theone", flash ) .find( "#theone" ) .text( "Can Click!" ); }); $( "#unbind" ).click(function() { $( "body" ) .off( "click", "#theone", flash ) .find( "#theone" ) .text( "Does nothing..." ); }); &lt;/script&gt; I thought that is because the on() method was binding to a named function not anonymous function. but I tested it on jsbin here and it failed ? can any one give me a hint of what am I missing here?
has answer: http://stackoverflow.com/a/24855628
possible better answer: http://stackoverflow.com/a/24855590
has title: jQuery on click event binding
upvote count: 1
type: AnsweredQuestion
tagged with: onclick
score: 1
accepted answer: http://stackoverflow.com/a/24855628
type: Question

http://stackoverflow.com/comment/38507141
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24796293
has text: That's what you want to do. But that is not what your doing. You also never load the array with any values.
score: 0

http://stackoverflow.com/q/24802865
has comment: http://stackoverflow.com/comment/38498462
tagged with: google-maps
has answer: http://stackoverflow.com/a/24804252
tagged with: javascript
has comment: http://stackoverflow.com/comment/38498727
accepted answer: http://stackoverflow.com/a/24804252
score: 0
has title: Location names in google maps using loops
answer count: 1
has comment: http://stackoverflow.com/comment/38498758
has comment: http://stackoverflow.com/comment/38498349
favorite count: 0
has comment: http://stackoverflow.com/comment/38499395
tagged with: http://stackoverflow.com/tag/html
tagged with: quotes
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38499506
has body: I'm writing a code that will plot multiple locations on a map using google's api. The coordinates, name and MMSI number is stored on an XML file and is imported in a javascript. This is the part of code I'm talking about: for(i=0; i&lt;x; i++) { var locations = [ ['MMSI', 50.26835, 50.45563, 1], ['MMSI', 50.29435, 50.44523, 2], ['MMSI', 50.09399, 50.40548, 3] } What I would like to do is add i to the end of 'MMSI' and turn it into a variable which is predefined above. So what is written above the first code is: var MMSI1 = 163474; var MMSI2 = 209483; var MMSI3 = 705245; etc, etc... and need the map markers to display those numbers instead of simply MMSI. But I don't know how to achieve this as the program won't run every time I try it and google's api will only work with quotes, not variables. I'm pretty sure there is a simple answer to this question and I am sorry for having to ask such a stupid question but I can't seem to find an answer anywhere or figure it out on my own. Thanks in advance for any help. Also I'm sorry if I used any terms wrong I'm still learning this language and I don't always know if I'm saying things correctly.
tagged with: loops
upvote count: 1
downvote count: 1
type: Question

http://stackoverflow.com/comment/38433657
has text: Oh, no...:(((the theory of placement of scripts in docs I know. The main problem is when I put my page on host, I see line-banner in the head of my site...and I sent XMLHttpRequest to page and found that this banner was made by <scrip>, which automatically was generated by hosting serve)))
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24768497
score: 0

http://stackoverflow.com/comment/38506130
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/24806983
has text: Check your console. You probably have an script error (JS fails silently...). If that doesn't work, you should consider posting some actual code (JSFiddle) ;)

http://stackoverflow.com/q/24819044
has answer: http://stackoverflow.com/a/24819045
type: Question
answer count: 1
tagged with: javascript
has title: Why is my BootstrapSwitch not working in a Backbone table built using a foreach
tagged with: jquery
tagged with: backbone.js
score: 0
has body: I'm trying to replace a checkbox in a table with this good looking bootstrap switch. I'm also using Backbone.marionette.js and the binding handler as suggested by this link http://www.jque.re/plugins/version3/bootstrap.switch/. However I cannot get the binding handler to work and or the switch to be clickable in the table built using a backbone for each.
tagged with: twitter-bootstrap
type: UnansweredQuestion

http://stackoverflow.com/q/24819482
tagged with: requirejs
type: Question
tagged with: javascript
tagged with: cdn
downvote count: 0
answer count: 1
tagged with: web
tagged with: jquery
has answer: http://stackoverflow.com/a/24819605
favorite count: 0
type: UnansweredQuestion
has body: I have reference requirejs in my website now I want to have a fallback in case CDN is not available Something like this in jQuery It should also run without dependency in jQuery all other libraries. Anyone?
score: 2
has title: RequireJS fallback if CDN is not available
upvote count: 2

http://stackoverflow.com/a/24811865
type: Answer
downvote count: 0
score: 1
upvote count: 1
has body: You can stop applying the shadow effect by setting: ctx.shadowBlur=0;
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24811464
accepted answer of: http://stackoverflow.com/q/24811464

http://stackoverflow.com/a/24946773
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/24885388
answers question: http://stackoverflow.com/q/24885388
has body: I finally decided to go ahead with this location.constructor.toString() == Location.constructor.toString(); //true This seems to work on most of the major browsers. Do let me know if this is a more elegant way to solve the problem. Thanks!!

http://stackoverflow.com/comment/38432583
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24767897
score: 0
has text: Ok, thank you for insight. I will take care in future. In morning I will have access to my office computer and then I will paste my code.

http://stackoverflow.com/comment/70194322
type: AnswerComment
score: 2
type: Comment
has text: Sorry but this is a terrible solution. The other two answers using the provided removeFile() and removeAllFiles() methods are correct and will cause less headaches down the road. The internal file counter will not reset when doing this.
comment on: http://stackoverflow.com/a/24811431

http://stackoverflow.com/comment/38469074
comment on: http://stackoverflow.com/q/24787035
has text: @Kevin B Said person may be an idiot like me, but will hopefully find this question and then follow your excellent advice on seeing the comment. :)
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/24770843
tagged with: url
has answer: http://stackoverflow.com/a/24771062
type: UnansweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/38437673
has body: I get url-images from imgur with 'href': article.data.url, (ex: https://i.sstatic.net/VMz26.jpg) But some times I get these urls-images without .jpg extension (ex: https://i.sstatic.net/I0Iaq.jpg) So, I would like to convert any url-image-without-extension (or not ending in .jpg) to the format http://i.imgur.com/&lt;ID&gt;.jpg (ex: https://i.sstatic.net/I0Iaq.jpg --> becomes --> https://i.sstatic.net/FVPsu.jpg) What I would have to change on code to fix this? Here the code I used to resolve URLs images: // getting image URLs App.image_domains = { 'i.imgur.com': function (article) { var url = article.data.url; var split_url = url.split("imgur.com/"); if (split_url[1].indexOf(".") === -1) { return url + ".jpg"; } return url; }, 'imgur.com': function (article) { var url = article.data.url; // Ignore album images if (url.indexOf("/a/") !== -1) { return ""; } // Remove unnecessary paths from image URLs url = url.replace(/(www\.)?imgur.com/, "i.imgur.com"); url = url.replace(/\/r\/[^\/]+/, ""); url = url.replace("/new", ""); url = url.replace("/gallery", ""); // Make sure the URL doesnt already have an extension var split_url = url.split("imgur.com/"); if (split_url[1].indexOf(".") === -1) { url += ".jpg"; } return url; } };
type: Question
tagged with: reddit
has comment: http://stackoverflow.com/comment/38437747
has title: Add .jpg extension to image-urls without extension
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: imgur

http://stackoverflow.com/comment/38598273
has text: Interesting, thanks. Things gets more complicated in real-use case, where continous allocation/disallocations of various objects/arrays leads to memory fragmentation, and processing time explodes if memory is not pre-allocated. In real life Typed Array will cost less since they're pre-allocated (Rq : js Arrays might be preallocated also...)
score: 3
comment on: http://stackoverflow.com/a/24855023
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38613541
type: Comment
type: QuestionComment
has text: How much you have points in your data, becuase you need to be aware that your chart is limited by size (in pixels) so when points is more than amount of pixels, we have no chance to print more. The best solution is using [lazy-lading](http://www.highcharts.com/stock/demo/lazy-loading)
score: 2
comment on: http://stackoverflow.com/q/24852946

nested
tags question: http://stackoverflow.com/q/24761819
tag name: nested
type: Tag
tags question: http://stackoverflow.com/q/24884550
tags question: http://stackoverflow.com/q/24892849
tags question: http://stackoverflow.com/q/24771082
tags question: http://stackoverflow.com/q/24891963
tags question: http://stackoverflow.com/q/24892280

http://stackoverflow.com/q/24793519
tagged with: node.js
has answer: http://stackoverflow.com/a/24793608
accepted answer: http://stackoverflow.com/a/24793608
type: AnsweredQuestion
upvote count: 0
has title: module export scenario confusion
type: Question
has comment: http://stackoverflow.com/comment/38481078
score: -1
has comment: http://stackoverflow.com/comment/38481112
downvote count: 1
answer count: 1
tagged with: javascript
has body: I dont understand certain scenarios of module.exports concept of nodejs. math.js var add = function(a, b){ return a + b; } multiply = function(a, b){ return a * b; } Scenario 1: app.js require("./math") //can I use add? //can I use multiply? Scenario 2: app.js var math = require("./math") //can I use math.add? //can I use math.multiply? I have put down my questions inside each scenarios. Thanks for help.
favorite count: 0
tagged with: module

http://stackoverflow.com/q/24896379
has comment: http://stackoverflow.com/comment/38675374
type: UnansweredQuestion
has body: I have this code and, if everything is okay, the result should be a thank you page. Here is the code: לחץ כאן I have tried several options but can't get the thank you page to display.
has title: Trouble getting JQuery AJAX's success event to show a thank you page
has comment: http://stackoverflow.com/comment/38675248
type: Question
has comment: http://stackoverflow.com/comment/38675263
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38675298
has comment: http://stackoverflow.com/comment/38675477
has answer: http://stackoverflow.com/a/24896605
has answer: http://stackoverflow.com/a/24896627
tagged with: jquery
tagged with: ajax

http://stackoverflow.com/comment/38702746
type: AnswerComment
comment on: http://stackoverflow.com/a/24806058
type: Comment
has text: You would have to add a counter that simply increments once every click and then sets back to 0 when you hit clear.
score: 0

http://stackoverflow.com/comment/38548028
type: Comment
has text: My code is kinda big (especially css) so I trimmed it to just show the structure of the document, and CSS of "menuframe" [jsfiddle](http://jsfiddle.net/9xTV3/) . All my JS is between elements, is it really bad? The first function by herself works fine. Tell me if it helps or if I should add more info
comment on: http://stackoverflow.com/a/24828724
type: AnswerComment
score: 0

http://stackoverflow.com/comment/103700349
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24865231
has text: addEventListener("change", function(){...}); seems to work for the last element in the document if used in the same page how can I solve this. I have three sets of forms on the same page but the change event only affects the one I put last.

http://stackoverflow.com/comment/38524534
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24816462
type: Comment
has text: Maybe I wasn't clear enough! Let me try explain: I'm creating a app inside a ready html page. There are 10 comments in this page displayed in a linear mode. Each comment has picture and a text. My challenge is to get this comments and the picture! So I'm trying to ready all '.poi-reviews .poi-review' (which are the commentaries classes) and catch all the '.poi-reviews .author-photo-canvas img' which are the img classes. I simply want to take these images from the classes and display them again in another format.. sorry for my loong history haha

http://stackoverflow.com/comment/38550254
has text: The thing is to having one way to deal with default values, not having to always think about what should contain the variable. This is not good enough because there are exceptions with falsy values.
type: AnswerComment
comment on: http://stackoverflow.com/a/24830473
score: 0
type: Comment

http://stackoverflow.com/q/24781110
has comment: http://stackoverflow.com/comment/38456973
favorite count: 0
has title: Change color of HTML element based on previous value - CSS
type: AnsweredQuestion
score: 3
upvote count: 3
possible better answer: http://stackoverflow.com/a/24781940
has comment: http://stackoverflow.com/comment/38456796
has body: I would like to change the background-color of an element in HTML using CSS when the element is hovered on. Here is what I have: h1 { background-color: rgb(100,60,0); } h1:hover { /* increase background-color red component by 50 */ /* new background-color would be rgb(150,60,0) */ } I can't figure out how to achieve that. Also, I have seen some suggestions online about doing it with LESS or SASS but I would really prefer a pure-CSS solution. Thank you very much.
type: Question
accepted answer: http://stackoverflow.com/a/24781205
answer count: 2
has comment: http://stackoverflow.com/comment/38457348
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/24781205
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24781940
tagged with: css

http://stackoverflow.com/a/24775769
score: 4
upvote count: 4
downvote count: 0
answers question: http://stackoverflow.com/q/24775725
type: Answer
has body: Try with for loop. It gives error in forEach because it is a collection of nodes nodelist. Or this should convert node-list to array function toArray(obj) { var array = []; for (var i = 0; i &lt; obj.length; i++) { array[i] = obj[i]; } return array; } Or you can use this var array = Array.prototype.slice.call(obj);

http://stackoverflow.com/a/24853742
score: 5
upvote count: 5
downvote count: 0
answers question: http://stackoverflow.com/q/24852588
accepted answer of: http://stackoverflow.com/q/24852588
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38610909
type: Answer
has body: For a PIXI.Graphics object to be interactive you need to set a hitArea shape (it can be a Rectangle, Circle or a Polygon): shape.hitArea = new PIXI.Polygon([ new PIXI.Point(/* first point */), new PIXI.Point(/* second point */), new PIXI.Point(/* third point */), new PIXI.Point(/* fourth point */), new PIXI.Point(/* fifth point */) ]); Another approach would be to generate a texture from the shape and use a Sprite, but the hit area would be the entire rectangular bounds of the hexagon: var texture = shape.generateTexture(); var sprite = new PIXI.Sprite(texture); sprite.setInteractive(true); sprite.anchor.set(0.5, 0.5); Fiddle with this applied to your example
has comment: http://stackoverflow.com/comment/38605131

http://stackoverflow.com/comment/38498738
comment on: http://stackoverflow.com/q/24803259
has text: To start with, there's a syntax error on the last line of the JS code you provided. In `});`, the close paren is unnecessary. Should be just `};`.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38605719
type: Comment
type: QuestionComment
has text: @jfriend00 The first one can be immediately supported by an integer array while the second one can't. Not pretending I'm sure this is what really happens with the current version of V8 but this reasoning often leads to better performances.
comment on: http://stackoverflow.com/q/24858951
score: 0

http://stackoverflow.com/q/24829527
type: Question
has body: I'm using Bootstrap 3.2.0. I want to validate a form. I already could validate my form in case the username is empty, so the alert is displayed but disappears immediately, so the users are not going to be able to read the message. I don't know how to set a time to disappear automatically or leave it there without closing it. Here is my html code: &lt;div class="container"&gt; &lt;div class="row"&gt; &lt;div class="col-lg-6"&gt; &lt;div class="well bs-component"&gt; &lt;form class="form-horizontal" name="login" method="post"&gt; &lt;fieldset&gt; &lt;legend&gt;L Torres Goldsmith&lt;/legend&gt; &lt;div class="form-group"&gt; &lt;label for="inputEmail" class="col-lg-2 control-label"&gt;User:&lt;/label&gt; &lt;div class="col-lg-10"&gt; &lt;input type="text" class="form-control" id="inputEmail" name="username" placeholder="Username"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label for="inputPassword" class="col-lg-2 control-label"&gt;Password&lt;/label&gt; &lt;div class="col-lg-10"&gt; &lt;input type="password" class="form-control" id="inputPassword" name="password" placeholder="Password"&gt; &lt;div class="checkbox"&gt; &lt;label&gt; &lt;input type="checkbox"&gt;&amp;nbsp;Keep me signed in &lt;/label&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;div class="col-lg-10 col-lg-offset-2"&gt; &lt;button type="submit" class="btn btn-primary" onclick="validateForm();"&gt;Submit&lt;/button&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;button class="btn btn-default"&gt;Cancel&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;/form&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="col-lg-6" id="wronguser"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; And here my javascript code: &lt;script type="text/javascript"&gt; function validateForm() { var user = document.forms["login"]["username"].value; var html = ""; if( user.trim() == "" ) { document.getElementById("wronguser").style.display = "block"; html = "&lt;div class=\"alert alert-…
tagged with: javascript
score: 0
has title: Bootstrap - Set time to close automatically an alert?
answer count: 1
has answer: http://stackoverflow.com/a/24830096
accepted answer: http://stackoverflow.com/a/24830096
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
has comment: http://stackoverflow.com/comment/38548790

http://stackoverflow.com/a/24909183
type: Answer
has body: Have a look at the yo angular generator here http://yeoman.io/ and here https://github.com/yeoman/generator-angular. This sets up a nice structure for your app
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/24909017
downvote count: 0

http://stackoverflow.com/q/24780212
has comment: http://stackoverflow.com/comment/38678291
upvote count: 1
has comment: http://stackoverflow.com/comment/38456094
answer count: 1
downvote count: 0
favorite count: 0
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/38473210
tagged with: marionette
has body: I am am having difficulties with making marionette's router to work, precisely the router's controller. Here is my code: App.RouterController = Marionette.Controller.extend({ render: function(){ alert(123); } }); //Router App.Router = Backbone.Marionette.AppRouter.extend({ appRoutes: { "*actions": "render" }, controller: new App.RouterController, initialize: function(){ var self = this; Backbone.history = Backbone.history || new Backbone.History({}); var root = "/"; Backbone.history.start({ pushState: Modernizr.history, root: root, silent: !Modernizr.history }); // handle history for old internet explorer + normal behaviour if(!Modernizr.history) { var rootLength = Backbone.history.options.root.length; var fragment = window.location.pathname.substr(rootLength) || 'cs'; self.navigate(fragment, { trigger: true }); } } }); App.on('start', function(options) { App.Main = new App.Main; App.Router = new App.Router(); }); App.start(); I am expecting that render method from App.RouterControler will be executed on all routes, but nothing is happening, even no errors in the console are showing... What am i doing wrong? Note: Initialize method of the router is working, if i put alert or console log in it, it will show up
has answer: http://stackoverflow.com/a/24851235
has title: Can't make marionette router to work
type: UnansweredQuestion
score: 1
type: Question
has comment: http://stackoverflow.com/comment/38460910
tagged with: backbone-routing
has comment: http://stackoverflow.com/comment/38455902
tagged with: javascript
has comment: http://stackoverflow.com/comment/38545871

http://stackoverflow.com/q/24849649
possible better answer: http://stackoverflow.com/a/24849976
has answer: http://stackoverflow.com/a/24849929
accepted answer: http://stackoverflow.com/a/24849929
has comment: http://stackoverflow.com/comment/38586251
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38586468
has comment: http://stackoverflow.com/comment/38586421
has comment: http://stackoverflow.com/comment/38586531
has body: Maybe this is weird, but this is what I need. For example, we can do this: var elem = document.getElementById("some_id"); if ("asd" in elem) alert(elem.asd); // and this in second pass else elem.asd = "dsa"; //this will be executed first I want something like this: &lt;input type = "button" value = "test btn" asd = "something" /&gt; But this does not work. maybe there is some other way? I really can't use body.onload to assign needed things.
type: Question
answer count: 2
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/38586298
downvote count: 2
has comment: http://stackoverflow.com/comment/38586413
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24849976
favorite count: 0
has comment: http://stackoverflow.com/comment/38586202
has comment: http://stackoverflow.com/comment/38586228
has title: Is there anyway to assign custom property for html element in it's tag? Need pure html + js solution

http://stackoverflow.com/q/24782881
linked to: http://stackoverflow.com/q/18790333
type: AnsweredQuestion
has body: I've discovered that when I use ng-include it gets called far too often. Every time you click one of the Nothing buttons or change Views, or type something in the input box, getView gets run several times. Up to 6 times when changing views. Basically doing anything that alters the $scope will generate a call to getView. I've created a plunker to show the behavior I'm describing: plnkr.co Is this normal behavior and is there any way to make it only run once? I'm worried I may be losing performance due to this. MY CODE: index.html Script.js angular.module('includeExample', ['ngAnimate', 'ui.bootstrap']) .controller('ExampleController', ['$scope', function($scope) { $scope.getView = function(filename) { console.log("getView " + new Date()); return filename + ".html"; }; } ]); Template1.html Content of template1.html Nothing
score: 1
has comment: http://stackoverflow.com/comment/38460853
upvote count: 1
has answer: http://stackoverflow.com/a/24783082
type: Question
has title: ng-include is being called far too often
tagged with: javascript
tagged with: angular-ui-bootstrap
answer count: 2
downvote count: 0
accepted answer: http://stackoverflow.com/a/24783082
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/24783090
has answer: http://stackoverflow.com/a/24783090

http://stackoverflow.com/comment/38489898
has text: @user2867054: check out the loop and think of doing something safe to output your data instead of `document.write`.
comment on: http://stackoverflow.com/a/24797933
score: 0
type: AnswerComment
type: Comment

ember.js
tags question: http://stackoverflow.com/q/24845007
tags question: http://stackoverflow.com/q/24874094
tags question: http://stackoverflow.com/q/24891980
tags question: http://stackoverflow.com/q/24763299
tags question: http://stackoverflow.com/q/24873660
tags question: http://stackoverflow.com/q/24902918
tags question: http://stackoverflow.com/q/24874704
tags question: http://stackoverflow.com/q/24788881
tags question: http://stackoverflow.com/q/24772853
tags question: http://stackoverflow.com/q/24764610
tags question: http://stackoverflow.com/q/24776619
tags question: http://stackoverflow.com/q/24871938
tags question: http://stackoverflow.com/q/24853010
tags question: http://stackoverflow.com/q/24903952
type: Tag
tags question: http://stackoverflow.com/q/24792717
tag name: ember.js
tags question: http://stackoverflow.com/q/24851355
tags question: http://stackoverflow.com/q/24752552
tags question: http://stackoverflow.com/q/24884925
tags question: http://stackoverflow.com/q/24770767
tags question: http://stackoverflow.com/q/24870445
tags question: http://stackoverflow.com/q/24770332
tags question: http://stackoverflow.com/q/24895354
tags question: http://stackoverflow.com/q/24835298
tags question: http://stackoverflow.com/q/24854953
tags question: http://stackoverflow.com/q/24861251
tags question: http://stackoverflow.com/q/24901966
tags question: http://stackoverflow.com/q/24853897
tags question: http://stackoverflow.com/q/24869386
tags question: http://stackoverflow.com/q/24837647
tags question: http://stackoverflow.com/q/24833945
tags question: http://stackoverflow.com/q/24882597
tags question: http://stackoverflow.com/q/24845692
tags question: http://stackoverflow.com/q/24810448
tags question: http://stackoverflow.com/q/24871887
tags question: http://stackoverflow.com/q/24828094
tags question: http://stackoverflow.com/q/24884927
tags question: http://stackoverflow.com/q/24772377
tags question: http://stackoverflow.com/q/24832372
tags question: http://stackoverflow.com/q/24751621
tags question: http://stackoverflow.com/q/24852076
tags question: http://stackoverflow.com/q/24813232
tags question: http://stackoverflow.com/q/24852699
tags question: http://stackoverflow.com/q/24815446
tags question: http://stackoverflow.com/q/24898436
tags question: http://stackoverflow.com/q/24891718
tags question: http://stackoverflow.com/q/24788258

http://stackoverflow.com/a/24768756
answers question: http://stackoverflow.com/q/24768446
type: Answer
has body: Image tag change &lt;img id="avoir" src="images/avoir.gif" width="700" height="394"&gt; &lt;img id="aller" src="images/aller.gif" width="700" height="394"&gt; First Script file $(document).ready(function(){ function changeImageAvoir() { var image = document.getElementById('aller'); if (image.src.match("allerchart")) { image.src = "images/aller.gif"; } else { image.src = "images/allerchart.gif"; } //This will call the function on the click event $(document).on('click','#avoir', null, changeImageAvoir); }();} Second Script file $(document).ready(function(){ function changeImageAller() { var image = document.getElementById('aller'); if (image.src.match("allerchart")) { image.src = "images/aller.gif"; } else { image.src = "images/allerchart.gif"; } //This will call the function on the click event $(document).on('click','#aller', null, changeImageAller); }();} The function calls are pretty much keeping your code in a private scope. The on function is assigning the click event to the image tags. This is non-intrusive coding, and keeps your HTML cleaner. If you really want to be slick, add a parameter to the function call to receive the image handle, then you won't have to use the getElementById. Also, if you make the function call generic, you can pass in the match value that you are looking for, and the true and false conditions, so that you only have the one function. Then you may only need one file.
score: 0

http://stackoverflow.com/q/24871287
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38627878
type: AnsweredQuestion
upvote count: 1
has body: I recently re-factored a bit of html into a directive. The original HTML had an ng-click attribute that called a function in the control and cleared out a data field. Its fast. But when I re-factored it into a directive, there is a lag between the button press and the clearing of the field. .directive('evFilterbox', ['$parse', function ($parse) { return { restrict: "EA", template: function (el, at) { return "&lt;div class=\"filterbox\"&gt;" + "&lt;div class=\"input-group\"&gt;" + "&lt;input id=\"input-"+ at.id +"\" class=\"form-control\" type=\"text\"" + " tooltip=\"{{tt." + at.id + "}}\"" + " placeholder=\"{{pp." + at.id + "}}\"" + " ng-model=\"data." + at.id + "\"&gt;" + "&lt;span id=\"span-"+at.id +"\" class=\"input-group-addon glyphicon glyphicon-remove\"&gt;&lt;/span&gt;" + "&lt;/div&gt;&lt;/div&gt;"; }, replace: true, link: function (scope, element, attrs) { $('#span-' + attrs.id).bind('click', function() { scope.data[attrs.id] = ''; }); } }; }]) Any comments on improving this directive are welcome.
type: Question
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/24871379
tagged with: performance
score: 1
possible better answer: http://stackoverflow.com/a/24871373
has answer: http://stackoverflow.com/a/24871373
has comment: http://stackoverflow.com/comment/38627937
answer count: 2
has comment: http://stackoverflow.com/comment/38627985
downvote count: 0
tagged with: javascript
has title: Angularjs directive and now onclick is slow
has comment: http://stackoverflow.com/comment/38628134
accepted answer: http://stackoverflow.com/a/24871379
favorite count: 0

http://stackoverflow.com/q/24807537
type: Question
score: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/24912953
has body: I have a request for assistance concerning what is best described as a “Time Triggered Event”, (a timer?). I'm working on a basic simple 3 page site using a jQuery page fade code to fade from Pg1 to Pg2 to Pg3 (shown below). The jQuery code uses a “click on link” to execute the fade between pages. Works Great! I would like to eliminate this “click on link” and replace it with a “Timer”. Rather than a Manual Click to execute the page fade, a timer will pause for a set period of time, then execute the jquery page fade code to the next page. Here is the jQuery page fade code I'm using: Welcome To My Homepage Click on the link to see the fade effect. Fade to Page Two Footer Text Welcome To My Homepage Click on the link to go back. Note: fade is default. Go to Page One Footer Text
has title: Executing a jquery page fader using a Timer with Execution
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38706185
type: UnansweredQuestion
tagged with: javascript

http://stackoverflow.com/q/24789814
tagged with: angularjs
has title: convert a promised variable to normal one - angular
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38474339
has comment: http://stackoverflow.com/comment/38474720
has comment: http://stackoverflow.com/comment/38475056
has answer: http://stackoverflow.com/a/24790237
type: Question
score: 0
has comment: http://stackoverflow.com/comment/38474407
tagged with: google-maps
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38474371
has comment: http://stackoverflow.com/comment/38474763
has body: i want to share variables in my controllers. when i try to do so, the variable is converted to a promised one, even though i used the .then function. all i want is to move the asd variable to the $scope map latitude and longitude values. inside the getFoo() the console shows the data as it should be but on the out side of the function it shows promise. my service: .factory('getGoogleCoordinates', function($http) { return { getFoo: function(zip,street,city,state) { //since $http.get returns a promise, //and promise.then() also returns a promise //that resolves to whatever value is returned in it's //callback argument, we can return that. return $http.get('http://maps.google.com/maps/api/geocode/json?address=' + zip + ',' + street + ',' + city + ',' + state + '&amp;sensor=false').then(function(mapData) { return mapData; }); } } }) my controller: .controller('mapCtrl', function(getGoogleCoordinates, myService2, $scope) { console.log(myService2.show3()[0].street); var asd = getGoogleCoordinates.getFoo(myService2.show3()[0].zip, myService2.show3()[0].street, myService2.show3()[0].city, myService2.show3()[0].state).then(function(data){ console.log(data.data.results[0].geometry.location); return data.data.results[0].geometry.location.lat; }); console.log(asd); $scope.map = { center: { latitude: 33.025859, longitude: -96.844698 }, zoom: 15 }; });

http://stackoverflow.com/comment/38495407
comment on: http://stackoverflow.com/q/24801528
has text: Can you add your HTML here too?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/117180848
type: Comment
comment on: http://stackoverflow.com/a/24806827
score: 2
has text: See the next answer and use `.flatMap()` instead.
type: AnswerComment

http://stackoverflow.com/comment/38584431
has text: I do know that `/` refers to root. But angular or gulp or `ui-view` or whatever that is could be mucking with it.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24848533

http://stackoverflow.com/a/24897520
downvote count: 0
has body: Seems fine here: $(document).ready(function(){ $('input[type=checkbox]').change(function() { console.log("box was clicked "+$(this).attr('id')); }); }); http://jsfiddle.net/Gz3Zb/
type: Answer
answers question: http://stackoverflow.com/q/24897452
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38678613

http://stackoverflow.com/a/24782616
answers question: http://stackoverflow.com/q/24782366
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/38459912
downvote count: 0
has comment: http://stackoverflow.com/comment/38476779
score: 1
has comment: http://stackoverflow.com/comment/38460075
has comment: http://stackoverflow.com/comment/38460205
has body: set the option suppressMarkers of the DirectionsRenderer to true http://jsfiddle.net/F4gDW/7/
accepted answer of: http://stackoverflow.com/q/24782366

http://stackoverflow.com/q/24843893
has body: I am creating a slider control, I have problems setting the value though _x = 512; _y = 256; _width = 128; _height = 12; _min = 0; _max = 10; I do something like, // set the value _input = 5; _value = median(_x-(_width/2)+(_input/_max),_x-((_width/2)),_x+((_width/2))) Setting the _input to 5 should put the slider in the middle, but it doesn't, I think I have the calculation wrong in some way. _x-(_width/2) will give you 0 in percent, 0 in value _x+(_width/2) will give you 100 in percent, 10 in value. The max.
linked to: http://stackoverflow.com/q/5731863
has answer: http://stackoverflow.com/a/33130213
has title: How to set the value of custom slider
tagged with: c++
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/38603501
upvote count: 1
type: Question
tagged with: numbers
tagged with: math
tagged with: formula
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38592019
favorite count: 0
has comment: http://stackoverflow.com/comment/38575168
has comment: http://stackoverflow.com/comment/38575483

http://stackoverflow.com/comment/41274035
type: QuestionComment
comment on: http://stackoverflow.com/q/24874029
score: 0
type: Comment
has text: @AdrianRosca unfortunately no.

http://stackoverflow.com/q/24867060
linked to: http://stackoverflow.com/q/58211880
type: Question
accepted answer: http://stackoverflow.com/a/27632418
tagged with: charts
has comment: http://stackoverflow.com/comment/81996088
has title: Chart.js tooltip not showing
tagged with: javascript
upvote count: 13
has comment: http://stackoverflow.com/comment/39422624
has answer: http://stackoverflow.com/a/27632418
answer count: 3
possible better answer: http://stackoverflow.com/a/69766193
downvote count: 0
has body: I am attempting to add tooltips to my chart, the options are correctly loading, however tooltips are not showing, any ideas? &lt;script&gt; var lineChartData = { labels : ["January","February","March","April","May","June","July"], datasets : [ { fillColor : "rgba(139, 157, 195, 1)", strokeColor : "#4c66a4", pointColor : "#fff", pointStrokeColor : "#3b5998", pointHighlightFill: "#fff", data : [{{implode(',', $fanCounts)}}] } ] } var options = { showTooltips: true, tooltipEvents: ["mousemove", "touchstart", "touchmove"], tooltipFillColor: "rgba(0,0,0,0.8)" } var myLine = new Chart(document.getElementById("fancanvas").getContext("2d")).Line(lineChartData, options); &lt;/script&gt; I have also changed the chart.js global config to enable tooltips for line charts.
favorite count: 0
linked to: http://stackoverflow.com/q/15979149
linked to: http://stackoverflow.com/q/41243132
has answer: http://stackoverflow.com/a/44614862
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/69766193
score: 13

http://stackoverflow.com/comment/38550219
type: QuestionComment
has text: When you load a new "page", you should have a cleanup routine that stops any ongoing scripts, removes handlers. If that is too hard, you are probably working with a lot of global functions instead of testable, reusable JavaScript objects. It's kind of a really big architecture question, not a good fit for SO since one could write a book about it.
score: 0
comment on: http://stackoverflow.com/q/24830234
type: Comment

http://stackoverflow.com/a/24878827
type: Answer
has body: You are starting a new project and you are using Yeoman so what you are doing is specific to the tool that you are using. So with Yeoman you have to make a directory then cd into it and run yo ember. Having to do npm install -g generator-ember (which you do once to install node package globally) is to install the generators for ember that Yeoman needs for you to run commands like yo ember from the command line for use with Yeoman with Ember. Now if you were to use a tool called ember-cli http://iamstef.net/ember-cli/ creating a new project would be a little different you have two options. One is just running ember new &lt;appname&gt; from the command line that will create a new folder with whatever name you used for the 'appname'. The second way with ember-cli is similar to Yeoman where you would make a new directory, cd into that directory and run ember initfrom the command line. Both Yeoman and ember-cli install files and setup a folder structure for you. I believe these files and folders are what you are calling boilerplate. When you look into your rails project you will see alot of boilerplate if you will but its there for a reason. All of this boilerplate is helping you and assisting you in not having to setup things like a build solution, installing dependencies, testing solutions, css compilation etc. Ember-cli and Yeoman are built differently under the hood and implement different things but essentially set out to solve the same thing, tooling for building client-side apps. If you just making a quick app you can do something similar to http://emberjs.com/guides/getting-started/ however once you app starts to grow having a clear separation of files and a application structure will be of benefit. Hope this helps, hope you have fun learning ember.
score: 2
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/24874704

http://stackoverflow.com/q/24820156
has answer: http://stackoverflow.com/a/24945393
tagged with: cordova
score: 0
type: UnansweredQuestion
tagged with: gestures
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/26186159
tagged with: javascript
has title: Hammer.js - slide element slowly (carousel effect) on swipe/drag right or left
tagged with: jquery
tagged with: hammer.js
has body: I'm developing a mobile app using cordova 3.0 for Android. I have a list of element in a wrapper div: &lt;div id='list_wrapper'&gt; &lt;ul class="table-view"&gt; &lt;li id="listItem1"&gt; &lt;/li&gt; &lt;li id="listItem2"&gt; &lt;/li&gt; &lt;/ul&gt; &lt;!-- ... -- &gt; &lt;/div&gt; now I'd like to move this list_wrapper slowly when user drag left o right to change view with another element, so to create a slide effect. I'm talking abount something like this: At this moment I succeeded in doing it only on swipe and it's not what I want because on swipe the view is changed once all in block. This is what I did: var hammer_options = { drag_block_horizontal: true, dragLockToAxis: true, preventDefault: true }; var hammertime = $('#list_wrapper').hammer(hammer_options); var leftSwipeHandler = function() { console.log("swipeleft"); // ... }; var rightSwipeHandler = function() { console.log("swiperight"); // ... }; hammertime.on("swipeleft", leftSwipeHandler); hammertime.on("swiperight", rightSwipeHandler); Besides I don't like this swipe solution very much because the swipe does not work well for me (I tested the swipe on chromium and firefox running my app on ripple emulate). Any advice? Thanks

http://stackoverflow.com/comment/38486407
type: QuestionComment
has text: It does work: http://jsfiddle.net/4mEhG/
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24796280

http://stackoverflow.com/comment/38492067
comment on: http://stackoverflow.com/q/24799560
score: 0
type: Comment
type: QuestionComment
has text: Or using the `{}` button in the toolbar.

http://stackoverflow.com/a/56777541
upvote count: 53
downvote count: 0
answers question: http://stackoverflow.com/q/24837646
has comment: http://stackoverflow.com/comment/116540147
type: Answer
has body: Simple Solution. No Jquery &lt;img id="output" src="" width="100" height="100"&gt; &lt;input name="photo" type="file" accept="image/*" onchange="document.getElementById('output').src = window.URL.createObjectURL(this.files[0])"&gt;
score: 53

http://stackoverflow.com/q/24783067
score: 0
tagged with: mojoportal
tagged with: asp.net
type: UnansweredQuestion
type: Question
has title: Attach js into mojoPortal
has answer: http://stackoverflow.com/a/24981866
answer count: 1
tagged with: javascript
has body: I have wrote JS calculator and need include it into mojoPortal site. I have upload js files to directory /calculator/ and add script tags at page content. But when browser request http://example.com/calculator/calculator.js it get 500 error: Runtime Error Description: An exception occurred while processing your request. Additionally, another exception occurred while executing the custom error page for the first exception. The request has been terminated. How I can disable execution of this folder or attach files in code?

http://stackoverflow.com/comment/38624726
type: AnswerComment
comment on: http://stackoverflow.com/a/24858519
has text: I see what you mean. So if I were somehow able to run console.log(verb); after the button was clicked, it would correctly log the form value to console?
type: Comment
score: 1

rxjs
tags question: http://stackoverflow.com/q/24856662
type: Tag
tag name: rxjs
tags question: http://stackoverflow.com/q/24816691

http://stackoverflow.com/a/24763553
score: 0
has comment: http://stackoverflow.com/comment/38454040
type: AcceptedAnswer
has body: Lets go through the steps of ajax in rails a. Create a route for your custom action, since we want to send data so it'll be post request post "/rate" =&gt; "your_controller#calculate_rate" , as: "calculate_rate" b. Write a javascript code that will listen to your periods input field. $(document).on("change","#id_of_periods_input",function(){ var periods = $(this).val(); var age = $("#id_of_age_input").val(); $.ajax({ type: "POST", url: "/rate", data: { periods: periods, age: age } //this will enable you to use params[:periods] and params[:age] in your controller }); }); This will work but i think it'll be better if you have some sort of button and when user clicks on it then calculate your rate of interest because if you'll use on change event then then lets say your periods value is 365 so your ajax call will fire 3 times( first time when you enter 3 then for 6 and then for 5) If you want to use button then also you have to use same logic only this line will change $(document).on("click","#id_of_btn",function(){ // same logic }); c. Getting your data in controller and performing your logic def calculate_rate @periods = params[:periods] @age = params[:age] // perform your logic here and store rates value in lets say @rate respond_to do |format| format.js{} #this will make rails look for a file named calculate_rate.js.erb in your views end end d. Filling rates input field by writing js in calculate_rate.js.erb $("#id_of_rate_field").val(@rate);
has comment: http://stackoverflow.com/comment/38445816
has comment: http://stackoverflow.com/comment/38456103
type: Answer
has comment: http://stackoverflow.com/comment/38445588
has comment: http://stackoverflow.com/comment/38445740
has comment: http://stackoverflow.com/comment/38455849
has comment: http://stackoverflow.com/comment/38456356
accepted answer of: http://stackoverflow.com/q/24752435
answers question: http://stackoverflow.com/q/24752435

http://stackoverflow.com/q/24881377
has answer: http://stackoverflow.com/a/24881590
type: Question
has answer: http://stackoverflow.com/a/24881490
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24881490
has body: i wanted DorodownmenuList is append Button...... i wanted this First Step, I wanted ul li is append To Button when it is click. After dropdownmenu is hide. html &lt;div class="input-group-btn"&gt; &lt;button class="btn" data-toggle="collapse"&gt; &lt;span class="current" data-url=""&gt;Submenu1&lt;/span&gt; &lt;span class="right"&gt;&amp;nabla;&lt;/span&gt; &lt;/button&gt; &lt;ul id="categories" class="dropdown-menu"&gt; &lt;li&gt;&lt;a href="#" class="unicode ieUnicode"&gt;Submenu2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" class="unicode ieUnicode"&gt;Submenu3&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" class="unicode ieUnicode"&gt;Submenu4&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" class="unicode ieUnicode"&gt;Submenu5&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" class="unicode ieUnicode"&gt;Submenu6&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; css .input-group-btn{ position:relative; } .btn{ width:300px; background-color:#ddd; color:red; border:1px solid #ccc; padding:10px; font-size:20px; text-align:left; cursor:pointer; } .btn .right{ color:#fff; background-color:#000; border-radius:50%; display:inline-block; padding:0 5px; float:right; } .dropdown-menu{ background-color: #ddd; border: 1px solid #ccc; list-style: none outside none; padding: 0; position: absolute; top: 34px; width: 300px; display:block; display:none; } jquery $('.btn').click(function(){ $(this).parent().addClass('open'); //how use li appendto btn and dropdown-menu is hide }); it is what i want. how use jquery.. when I click Submen2 it is append button when I click Submen3 it is append button SEE DEMO
has comment: http://stackoverflow.com/comment/38647048
answer count: 2
accepted answer: http://stackoverflow.com/a/24881590
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38647035
has title: How use Append Jquery
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38647353
score: 1
upvote count: 1

http://stackoverflow.com/comment/38490997
comment on: http://stackoverflow.com/q/24798950
score: 0
type: Comment
has text: I'm assuming you want $template to be the var 'template'?
type: QuestionComment

http://stackoverflow.com/q/24841975
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/38571873
has comment: http://stackoverflow.com/comment/38572564
has body: I have a for loop iterating over an array of windows to perform checks on them. I then go on to make use of some information found in the for loop in a later function. It appears the latter function is being executed before the loop has finished which is causing buggy behaviour. // Look for a existing window to add the tab to (BLOCK 1) chrome.windows.getAll(function(allWindows) { for(var i = 0; i &lt; allWindows.length; i++) { alert("found a window"); if(allWindows[i].incognito == newWindowMode) { windowToAddTo = allWindows[i].id; } } alert("done looping"); }); // Perform the mode switch (BLOCK 2) chrome.tabs.query({currentWindow: true, active: true}, function(tabList) { // Get the url of the current tab and encode it currentUrl = encodeURI(tabList[0].url); // Check if tab is valid in both incog and normal modes if(invalidURL.indexOf(currentUrl) == -1) { if(windowToAddTo == -1) { alert("needs new window"); chrome.windows.create({url: currentUrl, incognito: newWindowMode}); } else { chrome.tabs.create({windowId: windowToAddTo, url: currentUrl, active: true}); chrome.windows.update(windowToAddTo, {focused: true}); } chrome.tabs.remove(tabList[0].id); } }); When run, the alerts are prompted in this order when 1 window is open at the beginning: "found a window" "needs a new window" "found a window" "done looping"
has comment: http://stackoverflow.com/comment/38571614
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/38571658
type: Question
has comment: http://stackoverflow.com/comment/38571847
tagged with: for-loop
linked to: http://stackoverflow.com/q/24821829
has title: Javascript chrome extension not processing for loop as expected
tagged with: javascript
score: 0

http://stackoverflow.com/a/24832654
upvote count: 9
has body: Your friendly neighborhood Stef Panner created such a tool just for that a few months ago. It's called es3-safe-recast. There is also a grunt task for it. Let's go through what it does. First it requires the Esprima package for JS syntax tree analysis and recast on top of it that is built for these conversions: 'use strict'; var esprima = require('esprima'); var recast = require('recast'); var Visitor = recast.Visitor; var types = recast.types; var namedTypes = types.namedTypes; var builders = types.builders; Then it contains a big map of all the identifiers - just like your list: identifierToLiteral.finally = true; // here is `finally` for example Here is how it parses the tree and replaces it with a visitor: var ES6Safe = Visitor.extend({ visitProperty: function(node) { // go through all properties // check if need to replace name with literal if (namedTypes.Identifier.check(node.key) &amp;&amp; identifierToLiteral[node.key.name]) { node.key = builders.literal(node.key.name); } return this.genericVisit(node); }, visitMemberExpression: function(node) { // and all member expressions var property = node.property; var newNode; // check if need to replace name with literal if (namedTypes.Identifier.check(property) &amp;&amp; identifierToLiteral[property.name]) { newNode = builders.memberExpression(node.object, builders.literal(property.name), true); } else { newNode = node; } return this.genericVisit(newNode); } }); Finally, it runs the code through recast: ast = recast.parse(source, { esprima: esprima } ); new ES6Safe().visit(ast); code = recast.print(ast).code; Producing the safe version of the above code.
accepted answer of: http://stackoverflow.com/q/24784222
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24784222
score: 9
type: Answer

http://stackoverflow.com/a/50349309
type: Answer
has body: You can use prevAll() also I have the same issue. In my case there are multiple checkboxes in li with labels, and each checkbox above target have class parent (generated in js) $(this).parents().prevAll('input:checkbox.parent').each(function () { $(this).attr('checked', true); });
score: 0
answers question: http://stackoverflow.com/q/24892315

http://stackoverflow.com/a/24905576
type: Answer
score: 1
answers question: http://stackoverflow.com/q/24905520
upvote count: 1
has body: Replace .after with .html: $('#tweets').html($('&lt;div&gt;').text(msg));
downvote count: 0

http://stackoverflow.com/a/24909839
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24885053
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/24885053
has body: I tried to do this in firebug javascript console: var path = "/All Files/Personal Files/admin's Files/"; console.log(typeof path) //logs "string" console.log(path) //logs "/All Files/Personal Files/admin's Files/" path = path .replace("admin's Files/", ""); console.log(path) //logs "/All Files/Personal Files/" And it works, check if your path variable is a string.

http://stackoverflow.com/a/24766229
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24763333
has body: Your post sounded interesting because it was joining so many new features so I decided to try it, however next time try to provide more information and a jsfiddle or codepen with your work so far ;). The great trick is to use data URI this way we can store the font files we unzip from the files and use them in @font-face rules. Once we get the Entry for the font file we just get it data: fontEntry.getData(new zip.Data64URIWriter(fontMimeType), function(data){ appendFontFace(data, fontType); }); and use it to append in a @font-face rule: function appendFontFace(dataUrl, fontType){ var fontFace = document.createTextNode("\ @font-face {\ font-family: 'font-name';\ src: url('" + dataUrl + "') format("+fontType+");\ }\ "); //remove the previous font-face if any if(style.childNodes.length &gt; 0) style.removeChild(style.childNodes[0]); style.appendChild(fontFace); } You can check it working in: http://codepen.io/luizgrs/pen/zAxly
answers question: http://stackoverflow.com/q/24763333
type: Answer
has comment: http://stackoverflow.com/comment/38949568

http://stackoverflow.com/q/24822632
tagged with: javascript
tagged with: html5-video
answer count: 1
has title: How to Create and Fire HTML Video tag Events
has answer: http://stackoverflow.com/a/24908419
tagged with: dom-events
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38543509
type: UnansweredQuestion
score: 0
has body: I have come across a weird requirement, where I need to create a HTML video tag event like Play, Pause, VolumeChanged etc and then fire them, as it will be handled by a different module. Is there any way where this can be done similar to CreateCustomEvent or CreateEvent and Dispatch Event? I searched in net, but could not find any help except for directly calling document.getElementsByTagName('video')[0].play() etc but this is not what I need, because I want the registered event handler to handle the events once fired. But directly calling play() will actually play the video along with firing the 'play' event. So please help me out...
type: Question

http://stackoverflow.com/a/24850201
type: Answer
has comment: http://stackoverflow.com/comment/38587287
answers question: http://stackoverflow.com/q/24850122
has comment: http://stackoverflow.com/comment/38587418
has comment: http://stackoverflow.com/comment/38619575
accepted answer of: http://stackoverflow.com/q/24850122
has comment: http://stackoverflow.com/comment/38587351
has body: Since you mention Chrome, you can use querySelector and .style to change the background color: document.querySelector(".topbar").style.background = "#FFFFFF";
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/38587596

http://stackoverflow.com/comment/38627792
type: Comment
score: 0
has text: isn't it correct to say that if the list is ordered it will also returns the partitions?
type: AnswerComment
comment on: http://stackoverflow.com/a/24871110

http://stackoverflow.com/comment/38435846
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24767956
type: Comment
has text: @HaukurHaf -- I am not a big fan of data-attributes where [they aren't needed](http://stackoverflow.com/questions/24767897/how-to-find-and-select-specific-div-with-javascript-jquery/24769766#24769766)

http://stackoverflow.com/q/24802344
tagged with: jquery
possible better answer: http://stackoverflow.com/a/24802420
has title: Add slideup callback to animate Jquery
accepted answer: http://stackoverflow.com/a/24802382
tagged with: animation
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
type: Question
has body: I have the below html aaa bbb ccc On click I want to move the clicked item to the left 50px then slide it up then output how many list items are now visible in my div with the id vis. If I do the below it counts 1 to many because the animation hasn't completed when I add the length see fiddle. If I just do hide() I get the expected output in the vis div but don't get the animation I require. See Fiddle and if I try a callback, I get a similar result to my first attempt. See Fiddle What is the best way to do this so that after you click an item it animates left, slides up then outputs the remaining visible list items?
has answer: http://stackoverflow.com/a/24802382
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/24802420

http://stackoverflow.com/comment/38605959
score: 0
type: Comment
type: AnswerComment
has text: Just setting the `z-index` doesn't allow to click through it.
comment on: http://stackoverflow.com/a/24859166

http://stackoverflow.com/a/24857850
score: 0
accepted answer of: http://stackoverflow.com/q/24857223
type: AcceptedAnswer
type: Answer
has body: First, I'd say until this PR is merged, I wouldn't count on batman.js to encode your attributes. Instead, let batman.js encode the data its own way, then transform it in your Rails controller. (That's how we do it in Planning Center Check-Ins.) To transform the params in your Rails controller, update the task_params method: def task_params # first, permit the params without the _attributes suffix: returned_params = params.require(:task).permit( task_entries: [ :status, :due_at, :defer_until, :estimated_duration, :completed_at, items: [ :title, :description, :flagged, :visibility, :difficulty ] ] ) # then, reassign them to different keys in the params hash (and delete the old keys) if returned_params[:task_entries].present? task_entries_params = returned_params.delete(:task_entries) returned_params[:task_entries_attributes] = task_entries_params # do the same for the items params if returned_params[:task_entries_attributes][:items].present? items_params = returned_params[:task_entries_attributes].delete(:items) returned_params[:task_entries_attributes][:items_attributes] = items_params end end end This is assuming batman.js models that look like this: class MyApp.Task extends Batman.Model # ... @hasMany "task_entries", saveInline: true class MyApp.TaskEntry extends Batman.Model # ... @encode "status", "due_at", "defer_until", "estimated_duration", "completed_at" @hasOne "item", saveInline: true, polymorphic: true, as: "parent" class MyApp.Item extends Batman.Model # ... @encode "title", "description", "flagged", "visibility", "difficulty" @belongsTo "parent", polymorphic: true I'd agree that transforming the params isn't ideal. Hopefully that will be cleared up in batman.js 0.17.
answers question: http://stackoverflow.com/q/24857223

http://stackoverflow.com/q/24822490
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38534873
accepted answer: http://stackoverflow.com/a/24823001
has comment: http://stackoverflow.com/comment/38534984
has comment: http://stackoverflow.com/comment/38534886
has body: I'm forced to use Backbone at work though my knowledge is still very limited. I'm having troubles understanding "this" element - here's an example: Normally, this would be a piece of jQuery code: $('.birds').click(function() { $(this).fadeOut(); }); What I would like to achieve is when clicking on one element among many with the same class (.birds for example) to be able to perform an action on this specific, clicked element. I see though that "this" is used very often in the view and I don't even know where to start to make "this" my "this". I would appreciate a short explanation about what is THIS about in Backbone. EDIT: Thank you for the links, I'll read about it. In the meantime - assuming this structure: events: { 'click .birds' : 'birdsFunction' }, birdsFunction: { $(this).fadeOut(); } Is it correctly written or what I consider "this" (the clicked element with .birds class) is not MY "this"?
has comment: http://stackoverflow.com/comment/38535229
type: Question
has comment: http://stackoverflow.com/comment/38534913
has comment: http://stackoverflow.com/comment/38534878
tagged with: javascript
tagged with: jquery
score: 0
linked to: http://stackoverflow.com/q/3127429
answer count: 1
has comment: http://stackoverflow.com/comment/38535134
tagged with: backbone.js
duplicate of: http://stackoverflow.com/q/3127429
has answer: http://stackoverflow.com/a/24823001
has title: Backbone - which "this" is "this"?
has comment: http://stackoverflow.com/comment/38534894

http://stackoverflow.com/a/26811208
answers question: http://stackoverflow.com/q/24752638
has body: You'll want to makes sure you are triggering the click event on the correct element. https://github.com/ExactTarget/fuelux/blob/3.2.1/js/tree.js#L35-L42 For Fuel UX 3.2.1 (current as of answer) run the following in the console on http://getfuelux.com/javascript.html#tree-usage for an example. $('#treeIllustration .tree-branch-name').trigger('click') This triggers the openFolder method which you could call directly. https://github.com/ExactTarget/fuelux/blob/3.2.1/js/tree.js#L198 At this point after loaded.fu.tree triggers a method could be created/called to climb the tree recursively and call openFolder This would be a nice enhancement. Please submit an issue so that it can be prioritized. If you come up with a good solution feel free to submit a pull request. https://github.com/ExactTarget/fuelux/issues/new
score: 2
downvote count: 0
upvote count: 2
type: Answer

http://stackoverflow.com/comment/38475873
type: AnswerComment
has text: Got to love the 'tactical down voter' two seconds after I post my answer. :P
type: Comment
comment on: http://stackoverflow.com/a/24790728
score: 0

http://stackoverflow.com/comment/80888139
type: AnswerComment
type: Comment
has text: what if i add some text to textbox and removed it or cleared it? will this be treated as change or no change occured. How do i accomplish as if no change occured.
comment on: http://stackoverflow.com/a/24759739
score: 0

http://stackoverflow.com/q/24903631
has answer: http://stackoverflow.com/a/24903999
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24904050
has comment: http://stackoverflow.com/comment/38714139
has comment: http://stackoverflow.com/comment/38688923
type: Question
tagged with: scope-chain
has body: If we have this basic function (and its closures): function counter(){ var n = 0; return { count: function() {return n++}, reset: function() {n = 0} }; } Is this what's happening in memory? (basically a pointer to a function object and its scope chain) (source: geraldleroy.com) Is the above diagram correct? If so, I'm not understanding why these two lines of code create two new scope chains and new private variables: var c = counter(); var d = counter(); It seems like both c and d would refer to the original function object and would use its scope chain. I'm a little confused and would appreciate any insight on this that anyone can offer. Thanks!
tagged with: closures
tagged with: javascript
has comment: http://stackoverflow.com/comment/38719105
has title: Why do new invocations of this function create new scope chains and a new private variables?
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/24903931

http://stackoverflow.com/comment/38594307
type: AnswerComment
type: Comment
has text: @Bas-Another point which comes here is that what if someone is forgetting all the methods of a class,say in `html`,if you don't know which attributes are defuined for a tag,it'll help by enlisting the whole of attributes in a quick view.Ain't it powerful,best and innovative feature!
comment on: http://stackoverflow.com/a/24838919
score: 0

http://stackoverflow.com/q/24883780
favorite count: 0
has answer: http://stackoverflow.com/a/24883854
answer count: 5
has answer: http://stackoverflow.com/a/24884265
type: AnsweredQuestion
tagged with: textfield
possible better answer: http://stackoverflow.com/a/24883922
has body: i have this code, and is working. But i wanna show this total in textfield or hiddenfield. &lt;script&gt; function calculate_total(className, div){ var elements = document.getElementsByClassName(className); var total = 0; for(var i = 0; i &lt; elements.length; ++i){ total += parseInt(elements[i].value); } document.getElementById(div).innerHTML = "Total: " + total; } &lt;/script&gt; Html &lt;input type="text" name="box1" id="box1" class="addition_textbox" value="4" /&gt;&lt;br /&gt; &lt;input type="text" name="box2" id="box2" class="addition_textbox" value="4" /&gt;&lt;br /&gt; &lt;input type="text" name="box3" id="box3" class="addition_textbox" value="4" /&gt;&lt;br /&gt; &lt;input type="text" name="box4" id="box4" class="addition_textbox" value="4" /&gt;&lt;br /&gt; &lt;input type="text" name="box5" id="bo5" class="addition_textbox" value="4" /&gt;&lt;br /&gt; &lt;input type="submit" name="calculate" id="calculate" value="Calculate Total" onclick="calculate_total('addition_textbox', 'total_text')" /&gt;&lt;br /&gt; &lt;div id="total_text"&gt;&lt;/div&gt; i just wanna show the total value in here &lt;input type="text" id="here"&gt;
has answer: http://stackoverflow.com/a/24883922
downvote count: 1
accepted answer: http://stackoverflow.com/a/24883854
has answer: http://stackoverflow.com/a/24883930
type: Question
has comment: http://stackoverflow.com/comment/38651254
has title: Get Value into textfield javascript
score: -1
upvote count: 0
has answer: http://stackoverflow.com/a/24884143
tagged with: javascript

http://stackoverflow.com/a/24856949
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/24856883
has body: Document your code correctly and other developers that will use your code will know what type your function supports. If your don't offer a solid fallback then there is no need for checking the type of the object because JavaScript will manage to throw an error on it's own. And obviously if there is no data-loss at danger to eventually safely exit the program.
downvote count: 0

http://stackoverflow.com/q/24767325
tagged with: statistics
tagged with: random
answer count: 1
favorite count: 0
has body: I'm using var crypto = require('crypto'); var uid = crypto.pseudoRandomBytes(8); to generated 64-bit IDs. I don't need these to be truly random, but I would like them to be uniformly distributed between 0 and ffffffffffffffff. However, they are not. Generating 1,000,000 64-bit integers this way: var bignum = require('bignum'); var crypto = require('crypto'); var randomBignum = function() { return bignum.fromBuffer(crypto.pseudoRandomBytes(8)); } var avg = randomBignum(); var avg_len = avg.bitLength(); var lengths = {}; for (var i = 0; i &lt; 1e6; i++) { var big = randomBignum(); avg = avg.add(big).div(2); var length = big.bitLength(); if (typeof lengths[length] === 'undefined') { lengths[length] = 0; } lengths[length] += 1; avg_len = (avg_len + length) / 2; } console.log('Average integer: %s', avg); console.log('Average bit length: %s', avg_len); console.info('Bit length distribution: %s', require('util').inspect(lengths)); produces: Average integer: 8386866841744540769 Average bit length: 63.11672078688376 Bit length distribution: { '45': 1, '47': 2, '48': 7, '49': 15, '50': 23, '51': 66, '52': 114, '53': 248, '54': 521, '55': 955, '56': 1905, '57': 4019, '58': 7742, '59': 15552, '60': 31396, '61': 63048, '62': 125182, '63': 249271, '64': 499933 } I may be confused about the stats here, but these are not uniformly distributed, right? The fact that each byte is individually randomly generated makes it improbable that successive 0-bytes will be generated, so you get exponentially fewer small numbers. What is a good and fast way to generate uniformly distributed, 64-bit IDs in Node? Should I use Math.random and multiply the result by ffffffffffffffff?
tagged with: node.js
has answer: http://stackoverflow.com/a/24767416
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24767416
score: 1
upvote count: 1
type: Question
has title: Generating a uniform distribution of 64-bit integers
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/24857019
has title: Knockout js nested control flow bindings not working
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24858043
tagged with: knockout.js
has body: I'm just starting with Knockout and I'm not sure if I found a bug with the library or if I'm just noobing it up. I have an array that I want to split between three lists for display purposes but it appears the start and end ul tags are messing stuff up for me. Here is a jsfiddle of what I'm trying to do, it appears that only the first list item is being rendered for each list while the others are skipped. http://jsfiddle.net/bn44e/2/ Here is a nearly identical jsfiddle where I replace the tags with start and stop and all the list items are being rendered. http://jsfiddle.net/Ue4C3/
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/24858043
answer count: 1

http://stackoverflow.com/comment/38559276
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/24834991
has text: @SnowMagician, please avoid asking two unrelated questions. Second question has nothing to do nor title nor first example.

http://stackoverflow.com/comment/38671941
has text: In am not using a promise library, just the native promise implementation.
score: 0
comment on: http://stackoverflow.com/q/24891963
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24808200
tagged with: javascript
has answer: http://stackoverflow.com/a/24809704
has title: Javascript - setInterval for 2 auto slide on the same page
type: AnsweredQuestion
type: Question
has body: I was trying to create a auto slide for the slider using setInterval. It works like a charm when there's only one slider. When there are 2 slider, the first slider wont work, and the second slider will slide faster, because there will be 2 setInterval and both are sliding the second slider. Anyway to make sure each setInterval slide their own slider? var autoSlideTimer = 5; var autoslide = setInterval(function () { if (autoSlideTimer == 0) { var slideMargin = offsetMarginLeft - width; if (-slideMargin == (width * totalImages)) { offsetMarginLeft = width; displayImage = 0; } slider.style.marginLeft = (offsetMarginLeft - width) + 'px'; displayImage += 1; pagination = element.getElementsByTagName('ul')[0]; pagination.innerHTML = paginate; pagination.getElementsByTagName('li')[displayImage - 1].setAttribute("class", "displayed"); slider = element.getElementsByTagName('div')[0]; offsetMarginLeft = parseInt(slider.style.marginLeft.replace('px', '')); autoSlideTimer = 5; } else { autoSlideTimer--; } }, 1000); thanks
score: 0
accepted answer: http://stackoverflow.com/a/24809704
answer count: 1

http://stackoverflow.com/a/24876117
downvote count: 1
type: Answer
upvote count: 0
has body: i think the right way to do this: $(".article").each(function () { $( ".thumbnails" ).append( $(this).html() ); });
score: -1
has comment: http://stackoverflow.com/comment/38638064
answers question: http://stackoverflow.com/q/24875941

http://stackoverflow.com/a/25992824
has body: For disable the background you have to call on more div with you pop. When you call your popup using javascript just place another div having style(background-color: hsl(0, 0%, 50%) !important; opacity: 0.8 !important;) Make height and width full 100%. Make this div display:none When you want to show the popup with that pop just make div display:block. Hopefully it i'll b helpfull for you.
type: Answer
answers question: http://stackoverflow.com/q/24884319
score: 0

http://stackoverflow.com/comment/38460895
score: 0
type: AnswerComment
type: Comment
has text: This is partially wrong. [Do not use `href` with {{}} but ng-href](https://docs.angularjs.org/api/ng/directive/ngHref). Do not include the URI in the brackets!
comment on: http://stackoverflow.com/a/24783026

http://stackoverflow.com/comment/38523648
type: Comment
type: QuestionComment
has text: Can you provide a [JSFiddle](http://jsfiddle.net/)?
score: 1
comment on: http://stackoverflow.com/q/24816240

dc.js
tag name: dc.js
tags question: http://stackoverflow.com/q/24794967
tags question: http://stackoverflow.com/q/24753383
tags question: http://stackoverflow.com/q/24770378
tags question: http://stackoverflow.com/q/24848550
tags question: http://stackoverflow.com/q/24783004
tags question: http://stackoverflow.com/q/24848470
type: Tag
tags question: http://stackoverflow.com/q/24873427
tags question: http://stackoverflow.com/q/24791496

equality
tags question: http://stackoverflow.com/q/24853340
tag name: equality
type: Tag

http://stackoverflow.com/a/61515195
score: 5
upvote count: 5
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24800511
has body: Besides the solutions with formidable, there is another module which I have been using in my recent projects since 2019. The module express-form-data can be easily declared in your server file like: const express = require('express'); const formData = require('express-form-data'); app.use(formData.parse()); app.post('/image-upload', (req, res) =&gt; { console.log(req.files); }) ... In case of image uploading, for instance, req.files will provide all relevant data you need for handling the files such as path, size, filename, etc.

http://stackoverflow.com/comment/38685893
type: AnswerComment
type: Comment
has text: I don't want the elements to float. I just want the #wanttooverlay div to be displayed over the OBJECT tag.
comment on: http://stackoverflow.com/a/24901073
score: 0

http://stackoverflow.com/q/24838576
has body: I've got a dropdown menu on a site I'm working on that has different classes added to it when it is activated. It's built into a WordPress theme so I'm having to build a workaround on it for iPad landscape mode. The site navigation displays the same as desktop when on landscape so I need to create some touch events to mimic the behavior. The first thing I'm having to do is to deactivate the link on the first click and then reactivate it if it's clicked again. This works fine. if ('ontouchstart' in document.documentElement) { $('#masthead nav ul &gt; li:has(.sub-menu) a').click(function(e){ e.preventDefault(); $('li.clicked_link').on('click', function(){ var this_link = $(this).find('&gt; a').attr('href'); document.location.href=this_link; }); $(this).parent().addClass('clicked_link'); }); } The problem is that when you click on the li.sub-menu it adds a class of sub-hover onto it which activates a dropdown menu. It's a CSS/jQuery dropdown menu so it's based on the presence of that sub-hover class. It works fine when I first click but I then want to remove that class when you click outside of it. It deactivates it if I click another link in the dropdown but I'd like to bind a click event to the html or body elements so if you click anywhere outside of it, it will remove the sub-hover class, thus removing the dropdown. I tried to do this: if ('ontouchstart' in document.documentElement) { $('#masthead nav ul &gt; li:has(.sub-menu) a').click(function(e){ e.preventDefault(); $('li.clicked_link').on('click', function(){ var this_link = $(this).find('&gt; a').attr('href'); document.location.href=this_link; }); $(this).parent().addClass('clicked_link'); $('html').on('click',function(){ $('#masthead nav ul &gt; li:has(.sub-menu)').removeClass('sub-hover').removeClass('clicked_link'); }); }); } It doesn't work though because it seems to fire the first click function and then immediately fire the html click function. I tried to use bind as well but the same thing happened. I a…
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38567053
tagged with: javascript
tagged with: jquery
tagged with: css
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24839289
linked to: http://stackoverflow.com/q/4616694
type: Question
has title: Attach Click Event to HTML after Menu Click

http://stackoverflow.com/comment/38674822
has text: i put that so i can see the control in code behind in aspx page.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24895567

http://stackoverflow.com/comment/38665592
score: 0
has text: Ok you've updated the answer but still what are you doing on scroll `$("#"+id).addClass('active');` what `id`. Id of the clicked element, ok, but what about changing active class accordingly with active section.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24887405

http://stackoverflow.com/q/24786957
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38468548
score: 0
tagged with: typeerror
tagged with: bundling-and-minification
has comment: http://stackoverflow.com/comment/38468644
has title: Uncaught TypeError: Undefined is not a function in JS while using bundling process
tagged with: asp.net
has comment: http://stackoverflow.com/comment/38468460
type: UnansweredQuestion
has body: while bundling the JS files, i came across the "Uncaught TypeError: Undefined is not a function". I researched in the internet but failed to find the solution. Can someone help me to find out what the problem is?. Here is the unminified JS file. The Error is showing in the below line of code exactly before 'live'. live('click', function () the full js file code is like this $(document).ready(function () { $('.login_link_bg').hover(function () { $('.login_hover_outer').fadeIn(); }, function () { $('.login_hover_outer').fadeOut(); }); $('a.forgot_pass').click(function () { $('.forgot_pass_outer').slideToggle(); }); $(".popup_open").live('click', function () { var popup_name = $(this).attr("popup"); var popheight = $(popup_name).height(); var popWidth = $(popup_name).width(); var pageWidth = $(document).width(); var pageHeight = $(document).height(); var left = (pageWidth - popWidth) / 2; $(popup_name).show(); $(".back-popup-layer").show(); $(".back-popup-layer").css({ "height": pageHeight, "width": pageWidth }); }); $('.close-btn').live('click',function(){ $('.back-popup-layer').hide(); $('.main_popup_outer').hide(); }); $("#resend_activation_btn").click(function () { $('#spError2').hide(); spError.innerHTML = ""; $('input[id$=txtEmail]').val = ""; $("#resend_activate_box").fadeToggle(); }); function toggle_visibility(id) { var e = document.getElementById(id); if (e.style.display == 'block') e.style.display = 'none'; else e.style.display = 'block'; } });
answer count: 0

http://stackoverflow.com/q/24899832
has title: cant get ajax get to show in page but can see in google element inspector
has body: I am making a simple invoice page. I populate a dropdown box from mysql and when I check the item i want the description box to prepopulate. But its not working....i can see it in the network inspector on chrome and preview it. my code as follows htmlinputform, php, ajaxget <?php require ('dbconnect.php'); $result = $con->query("select id, item from items"); while ($row = $result->fetch_assoc()) { unset($id, $name); $id = $row['id']; $name = $row['item']; echo ' '.$name.' '; } echo " "; mysqli_close($con); ?> php <?php $q = intval($_GET['q']); require ('dbconnect.php'); mysqli_select_db($con,"items"); $sql="SELECT description FROM items WHERE id = '".$q."'"; $result = mysqli_query($con,$sql); while($row = mysqli_fetch_array($result)) { echo $row['description']; } mysqli_close($con); ?> AJAX
tagged with: javascript
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/38682056
tagged with: php
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24899984
accepted answer: http://stackoverflow.com/a/24899984
score: 1
tagged with: mysql
upvote count: 1
type: Question

http://stackoverflow.com/comment/38659028
has text: worse comes to worse, you could fork a copy from github, and try to improve it. https://github.com/twbs/bootstrap
comment on: http://stackoverflow.com/q/24887923
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38446191
comment on: http://stackoverflow.com/q/24774757
type: QuestionComment
type: Comment
has text: you want to fix the regex query? I don't really understand what is your objective?
score: 0

http://stackoverflow.com/comment/38629702
comment on: http://stackoverflow.com/a/24872132
type: AnswerComment
has text: Removing the return didn't do anything, I think I had already tried that. As far as the $scope.message part goes, I had tried to do that originally, but it won't work because my index.html does not have an associated controller. All of the controllers are established using the $routeProvider as you can see above, and I could not figure out a way add the index and make this work. How I was getting around it was using ng-controller with this main controller as I saw in a Plunkr on the AngularJS site.
type: Comment
score: 0

tabs
tags question: http://stackoverflow.com/q/24825493
type: Tag
tags question: http://stackoverflow.com/q/24865650
tags question: http://stackoverflow.com/q/24812790
tags question: http://stackoverflow.com/q/24897402
tags question: http://stackoverflow.com/q/24803779
tag name: tabs
tags question: http://stackoverflow.com/q/24861068

http://stackoverflow.com/a/24766097
upvote count: 2
accepted answer of: http://stackoverflow.com/q/24765808
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24765808
has body: >>>Test the Fiddle&lt;&lt;&lt; Well... with pure JavaScript: function getCheckboxesValues(){ return [].slice.apply(document.querySelectorAll("input[type=checkbox]")) .filter(function(c){ return c.checked; }) .map(function(c){ return c.value; }); } document.getElementById("btntest").addEventListener("click", function(){ console.log(getCheckboxesValues()); });
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/q/24841973
answer count: 4
has answer: http://stackoverflow.com/a/24842510
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24842030
score: 1
accepted answer: http://stackoverflow.com/a/24843291
has title: Javascript Function to Remove Div
has comment: http://stackoverflow.com/comment/38572584
type: Question
has comment: http://stackoverflow.com/comment/38572283
has answer: http://stackoverflow.com/a/24843291
has body: I need a function that can delete the div one by one . My code is shown below. in my code i have created a function to create a div when i click a button . and i can't figure how to delete div one by one . Please help me with the correct code to delete div one by one. CREATE A DIV Remove DIV
downvote count: 0
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/24842030
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24842328

http://stackoverflow.com/comment/38466521
type: AnswerComment
type: Comment
has text: @davidkonrad yes, that is what I was trying to explain. Do you know how can I fix it?
comment on: http://stackoverflow.com/a/24783111
score: 0

http://stackoverflow.com/a/24860300
score: 2
has body: You are populating the params object but you are not actually using it in the request. You are merely using it in the opensocial.newIdSpec() call which gives you an IdSpec object. However, if you look at the documentation of the IdSpec object - this one has only user-related fields, additional data is ignored. You should actually pass in params in your newFetchPeopleRequest() call: req.add(req.newFetchPeopleRequest(idSpec, params), "profiles"); For reference: opensocial.DataRequest.newFetchPeopleRequest method.
upvote count: 2
accepted answer of: http://stackoverflow.com/q/24820881
answers question: http://stackoverflow.com/q/24820881
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/38659561
type: QuestionComment
type: Comment
score: 1
has text: Maybe you can get away without javascript... what if you use the 'target' attribute for a form to POST the Mobile Number to an iFrame in the same page, which handles the OTP generation code. Then you can use a normal form for entering the OTP and submitting the registration.
comment on: http://stackoverflow.com/q/24888151

http://stackoverflow.com/a/24751487
type: Answer
has comment: http://stackoverflow.com/comment/38405049
has comment: http://stackoverflow.com/comment/38401448
has comment: http://stackoverflow.com/comment/38407461
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/24751339
has comment: http://stackoverflow.com/comment/38407112
score: 0
has comment: http://stackoverflow.com/comment/38401412
has body: You need to use a ng-controller for root level Home A resource A deep linked resource See here it works fine
has comment: http://stackoverflow.com/comment/38405120

http://stackoverflow.com/a/24827477
answers question: http://stackoverflow.com/q/24827323
has body: Cleanest imo will be using Array.filter() and counters for the exact categories you need. // these are the categories and their allowed maxCounts var counts = { "Vegetables": {maxCount: 4, count: 0}, "Fingerfood": {maxCount: 3, count: 0}, //... }; // filtered is the reduced array containing just the ones you need var filtered = result.filter(function(_item) { var c = counts[_item.category]; // include only if allowed as per counts if(c &amp;&amp; c.count &lt; c.maxCount) { c.count++; return true; } return false; }); PS: Fill in the counts rule set as per your needs Your category names in counts should match the case of the ones in result
accepted answer of: http://stackoverflow.com/q/24827323
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/a/24846622
has comment: http://stackoverflow.com/comment/38580543
has body: I believe the point of an isolated scope is to keep the scope separate from everything else, separating concerns. You should really interface your directive by providing objects bound to a controller, or via the event system. In other words, your controller should not know anything explicit about your directive internals. I cannot think of a good reason you would need access to the entire directive scope from a controller.
has comment: http://stackoverflow.com/comment/38580595
score: 3
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38580496
type: Answer
answers question: http://stackoverflow.com/q/24846501
upvote count: 3
accepted answer of: http://stackoverflow.com/q/24846501

http://stackoverflow.com/q/24785644
tagged with: video
has answer: http://stackoverflow.com/a/25310180
type: Question
has title: Jquery cycle2 video js plugin does not work for Drupal 7
tagged with: drupal-7
tagged with: javascript
has body: I have video slider and wen I started video on the one slide and then change it to the another slide previous video does not stop. My js options this.speed = 1000; this.timeout = 0; this.slider = $('.cycle-slideshow'); this.slider.cycle({ slides: '.slide', fx: 'scrollHorz', swipe: true, timeout: this.timeout, speed: this.speed, next: '.tagg-video-slider .cycle-next', prev: '.tagg-video-slider .cycle-prev', youtube: true, youtubeAutostart: true }); structure of my slide : Video of zSm91-i_h6Y Is it problem with iframe or what? Thanks!
score: 0
answer count: 1
tagged with: jquery
type: UnansweredQuestion
tagged with: drupal

http://stackoverflow.com/comment/38511872
type: AnswerComment
has text: Though this would require the `--harmony` right? Also I'm still confused if I would rewrite their code to newer specs, how it would look. I believe __proto__ wouldnt be there anymore because node.js has util.inherit now. But i cant understand how to write it with util.
score: 0
comment on: http://stackoverflow.com/a/24810169
type: Comment

http://stackoverflow.com/comment/38599079
score: 0
comment on: http://stackoverflow.com/q/24842252
type: Comment
has text: I suggest filing a bug report at https://parse.com/help
type: QuestionComment

http://stackoverflow.com/a/30947409
score: 4
upvote count: 4
downvote count: 0
type: Answer
has body: The problem here is that you had not loaded the image data. "btoa" creates a Base64 encoded ASCII string from '../img/myImage.jpeg'. To get the image data you need create image data from canvas or from a physical image. Change var doc = new jsPDF(); doc.setFontSize(12); doc.addImage(imgData, 'JPEG', 15, 40, 180, 180); To var img = new Image(), canvas = document.createElement("canvas"), ctx = canvas.getContext("2d"); img.onload = function () { ctx.drawImage(img, 0, 0 ); var imgData = canvas.toDataURL('image/jpeg'); var doc = new jsPDF(); doc.setFontSize(12); doc.addImage(imgData, 'JPEG', 15, 40, 180, 180); } img.src = '../img/myImage.jpg'; I hope it helps.
answers question: http://stackoverflow.com/q/24769424

http://stackoverflow.com/q/24865772
score: -2
has title: Sound HTML with Java Script?
accepted answer: http://stackoverflow.com/a/24865976
tagged with: audio
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38617997
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43726443
has comment: http://stackoverflow.com/comment/38617308
has body: I am making a small project with HTML and I would like to play MP3 files in the background one sound all the time in a loop. How do I do that I am new to Java Script.
tagged with: playback
has answer: http://stackoverflow.com/a/24865976
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38617330
favorite count: 0
has comment: http://stackoverflow.com/comment/38617265
downvote count: 2

http://stackoverflow.com/q/24802368
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24802673
tagged with: http://stackoverflow.com/tag/json
answer count: 1
tagged with: javascript
has body: I am trying to read from a database some data but without waiting for the page to load, so I created an ajax post that starts sending data when page is ready, now after ajax completes I need to read the values from another file. The problem is that after the ajax completes, json that is reading the data is running indefinite. JQUERY &lt;?php $url = $_GET['url']; ?&gt; var jQuery_1_11_0 = $.noConflict(true); jQuery_1_11_0(document).ready(function () { var domain = '&lt;?php echo $url; ?&gt;'; $.ajax({ type: 'POST', url: 'lib/ajax.php', data: { action: 'get_all_seo_details', // function that collects data domain: domain // the domain that is being send to the function in order to get data }, success: function (data) { // doesn't need to echo anything only to insert the data, which it done properly } }); // Below is the second part of the script that starts when ajax stops $(document).ajaxStop(function () { $.getJSON('lib/get-details.php', function(data) { var twitter_followers = data.twitter_followers; $('#twitter-followers').html(twitter_followers); }); // data is being read correctly but it loops repeatedly in the console without finishing }); }); PHP - get-details.php, reading the data from database after getting inserted with ajax if (!isset($_SESSION)) { sec_start(); } global $db; $domain = isset($_SESSION['domain']) ? $_SESSION['domain'] : ''; if ($domain == '') { $domain = $db-&gt;query("SELECT * FROM seo_data"); } else { $domain = $db-&gt;query("SELECT * FROM seo_data WHERE domain = '$domain'"); } $domain_now = $domain-&gt;fetch_assoc(); $twitter_followers = (int) $domain_now['twitter_followers']; echo json_encode(array('twitter_followers' =&gt; $twitter_followers));
tagged with: jquery
tagged with: ajax
score: 0
has title: Ajax.stop function with json request issue
has answer: http://stackoverflow.com/a/24802673
tagged with: php

http://stackoverflow.com/q/24782775
has answer: http://stackoverflow.com/a/24782862
has body: Im trying to use a factory in angularJS, but I don't work as expected. Here is my controller: as.controller('Test', ['testFactory', function($scope, $http, $rootScope) { $http.get($rootScope.appUrl + '/nao/test/test') .success(function(data, status, headers, config) { $scope.test = data; }); $scope.form = {}; $scope.submitForm = function(isValid) { if(isValid) { testFactory.testFactoryMethod(function($http) { $scope.test = data; }); } }; }]); As you can see, I "include" my factory to the controller. Here is my factory: .factory('testFactory', function($http) { return { testFactoryMethod: function(callback) { return $http('http://127.0.0.1:81/test/test', data).success(function(data) { callback(data); }); } }; }); When I run this, I get this error message: Error: $http is undefined @http://127.0.0.1:82/nao/js/controllers.js:82:3 Anyone who can help me?
tagged with: factory
type: Question
score: 0
has answer: http://stackoverflow.com/a/24782885
has answer: http://stackoverflow.com/a/24784494
has title: Factory in angularJS
tagged with: javascript
has answer: http://stackoverflow.com/a/24782816
accepted answer: http://stackoverflow.com/a/24784494
tagged with: runtime-error
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/24782816
answer count: 4
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/24780449

http://stackoverflow.com/a/24831628
has comment: http://stackoverflow.com/comment/38553358
upvote count: 1
has comment: http://stackoverflow.com/comment/38553079
downvote count: 1
has comment: http://stackoverflow.com/comment/38553337
has comment: http://stackoverflow.com/comment/38553015
has comment: http://stackoverflow.com/comment/38553554
has comment: http://stackoverflow.com/comment/38552645
score: 0
has body: ko.applyBindings(DealerNumberLotNumberViewModel(obj)); - this should go inside the callback method though like this - $(function () { var obj; $.ajax({ dataType: "json", url: "/Scripts/dealerData.json", success: function (data) { obj = JSON.parse(data); ko.applyBindings(DealerNumberLotNumberViewModel(obj)); } }); Because obj is undefined till the callback method "success" actually assigns it something. and ko.applyBinding method should execute once obj is defined. Hence, it should go inside the callback method. Also, it is a good idea to always have a failure callback method, just so that any failure doesn't go uncaught. $(function () { var obj; $.ajax({ dataType: "json", url: "/Scripts/dealerData.json", success: function (data) { obj = JSON.parse(data); ko.applyBindings(DealerNumberLotNumberViewModel(obj)); }, error: function(args) { console.log('error occured: '+ args); } }); Hope, this helps
has comment: http://stackoverflow.com/comment/38553209
has comment: http://stackoverflow.com/comment/38552618
has comment: http://stackoverflow.com/comment/38552582
type: Answer
answers question: http://stackoverflow.com/q/24831567
has comment: http://stackoverflow.com/comment/38553538

http://stackoverflow.com/a/45033237
upvote count: 0
score: -1
has body: Try this one: factoryObject.__proto__.constructor.name
answers question: http://stackoverflow.com/q/24780192
downvote count: 1
type: Answer

http://stackoverflow.com/comment/38557471
type: Comment
score: 0
comment on: http://stackoverflow.com/q/24834183
has text: Where did you find the code `google.load("jquery", "1.3.2")` ?
type: QuestionComment

cursor
tags question: http://stackoverflow.com/q/24770559
type: Tag
tag name: cursor

http://stackoverflow.com/comment/38536831
has text: if that works for you, then post your answer to this question and mark it as the accepted answer! ;)
score: 0
comment on: http://stackoverflow.com/a/24822755
type: Comment
type: AnswerComment

http://stackoverflow.com/a/24894407
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38671642
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24894151
answers question: http://stackoverflow.com/q/24894151
has comment: http://stackoverflow.com/comment/38671528
score: 1
has body: if(navigator.onLine){ window.location.href = "http://example.com"; } window.location is an object which exists as a property of window. href is a property of window.location which indicates the URL of your current page. You can redirect by assigning a URL to window.location.href.
upvote count: 1

http://stackoverflow.com/a/24854108
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/38679272
has body: So exprs will be an array of tokens that you'll need to map over. Simple example: macro str_expr { case { _ ($toks:expr) } =&gt; { var toks = #{$toks}; var toks_str = toks.map(function(tok) { return unwrapSyntax(tok); }).join(""); letstx $tok_str = [makeValue(toks_str, #{here})]; return #{ $tok_str } } } str_expr (2 + 4) // expands to '2+4' You just need to handle the normal token case and the :expr cases individually.
answers question: http://stackoverflow.com/q/24809324
downvote count: 0
type: Answer

http://stackoverflow.com/comment/39722734
has text: Thank you, now it's really hacky :)
type: AnswerComment
comment on: http://stackoverflow.com/a/25410999
score: 1
type: Comment

http://stackoverflow.com/q/24813528
accepted answer: http://stackoverflow.com/a/24814437
tagged with: flot
answer count: 1
favorite count: 0
has title: Flotchart issues joining bar and line graph
has body: I want to create a chart using flotchart combining both line and bar graphs. I have been able to create both separately but I'm having problems joining them. This is the code I'm using to display only the graphs: var dataset = [{ label: "Eficiencia", data: data }]; var datasetSubtotal = [{ label: "Subtotal", data: dataSubtotal }]; // this has the data for the line I want to add. var placeholder = $("#chartdiv"); var options = { series: { bars: { show: true }, }, bars: { align: "center", barWidth: 0.5 }, legend: { noColumns: 0, labelBoxBorderColor: "#000000", position: "nw" }, xaxis: { axisLabel: "Operadores", axisLabelUseCanvas: true, axisLabelFontSizePixels: 12, axisLabelFontFamily: 'Verdana, Arial', axisLabelPadding: 10, ticks: ticks, }, yaxis: { axisLabel: "Eficiencia por fuente", axisLabelUseCanvas: true, axisLabelFontSizePixels: 12, axisLabelFontFamily: 'Verdana, Arial', axisLabelPadding: 3, min:0, max: 100, tickSize: 5 }, grid: { hoverable: true, borderWidth: 2, backgroundColor: { colors: ["#ffffff", "#EDF5FF"] } }, margin: { top: 40, left: 10, bottom: 10, right: 10, } }; $.plot(placeholder, dataset, options); I also tried plotting it differently, but it's always getting either only one graphic at each time, or both with the same data. This is one of the failed examples. $.plot(placeholder, datasetSubtotal, { lines: { show: true } }); $.plot(placeholder, [ { data: datasetSubtotal, lines:{show:true, steps:true} }, { data: dataset, bars:{show:true} } ],options);
has answer: http://stackoverflow.com/a/24814437
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
tagged with: graph
tagged with: javascript
upvote count: 1

http://stackoverflow.com/comment/38468616
type: QuestionComment
comment on: http://stackoverflow.com/q/24787035
score: 0
has text: What's the exact error you're getting?
type: Comment

http://stackoverflow.com/comment/38423711
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24763525
score: 0
has text: You have one `[0]` too many in that push operation.

http://stackoverflow.com/q/24864352
score: 1
has answer: http://stackoverflow.com/a/31462300
type: Question
tagged with: highcharts
downvote count: 0
tagged with: javascript
has body: These are the options for the secondary axis: { title: { text: 'This should be on the other side' }, opposite: true }], I expected it to show on the left, buy it does not. How can I show it on the left side? http://jsfiddle.net/5XQT9/1/
answer count: 3
has answer: http://stackoverflow.com/a/24864673
upvote count: 1
has title: Highchart.js secondary axis not showing on the opposite side
favorite count: 0
has answer: http://stackoverflow.com/a/24864667
type: UnansweredQuestion

http://stackoverflow.com/a/24792003
answers question: http://stackoverflow.com/q/24788048
type: Answer
has body: Try this, note the space after "Basic" function obtainData(){ //enter subject-id of admin // | // V var userid = "123456789" var payload = { "action" : "/companies.xml" }; var options = { "headers" : { "USER-AGENT" : "name@company.com", "Authorization" : "Basic " + Utilities.base64Encode( "APIkey_from_Highrise_website" + ":" + "Dummy_password" ) }, "method" : "GET", "payload" : payload, muteHttpExceptions : true }; var xmlCompanies = UrlFetchApp.fetch("https://foocompany.highrisehq.com/companies.xml", options).getContentText(); Logger.log(xmlCompanies);
has comment: http://stackoverflow.com/comment/38505252
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24788048

http://stackoverflow.com/a/24806079
has body: Though there is no regulated way to send emails to multiple recipients via the mailto: protocol, you could introduce a format that uses checkboxes (or some other fashion) to mimic it. However, as already stated, there's no guarantee it'll work: &lt;label&gt; &lt;input type="checkbox" name="to" value="1@1.com"&gt;1@1.com &lt;/label&gt; &lt;label&gt; &lt;input type="checkbox" name="to" value="2@2.com"&gt;2@2.com &lt;/label&gt; &lt;label&gt; &lt;input type="checkbox" name="to" value="3@3.com"&gt;3@3.com &lt;/label&gt; &lt;label&gt; &lt;input type="checkbox" name="to" value="4@4.com"&gt;4@4.com &lt;/label&gt; &lt;input type="button" value="Send Email" id="send-email" /&gt; Use some jQuery here for simplicity: $('#send-email').on('click', function(e){ var to = []; $('input[name="to"]:checked').each(function(){ to.push($(this).val()); }); window.location.replace('mailto:' + to.join(',')); e.preventDefault(); return false; }); Example of the above However, you're better off using PHP in the back-end to send the email as it can (and will) handle multiple recipients gracefully and consistently.
upvote count: 1
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24805921

xmlhttprequest
tags question: http://stackoverflow.com/q/24873540
tags question: http://stackoverflow.com/q/24888024
tags question: http://stackoverflow.com/q/24800391
tags question: http://stackoverflow.com/q/24872047
tags question: http://stackoverflow.com/q/24880730
tags question: http://stackoverflow.com/q/24846790
tag name: xmlhttprequest
tags question: http://stackoverflow.com/q/24870044
tags question: http://stackoverflow.com/q/24885547
tags question: http://stackoverflow.com/q/24760021
tags question: http://stackoverflow.com/q/24853059
type: Tag
tags question: http://stackoverflow.com/q/24903100
tags question: http://stackoverflow.com/q/24830582
tags question: http://stackoverflow.com/q/24768192
tags question: http://stackoverflow.com/q/24853974
tags question: http://stackoverflow.com/q/24906487
tags question: http://stackoverflow.com/q/24859532
tags question: http://stackoverflow.com/q/24894288

jquery-ui
tags question: http://stackoverflow.com/q/24775408
tags question: http://stackoverflow.com/q/24810780
tags question: http://stackoverflow.com/q/24757992
tags question: http://stackoverflow.com/q/24808396
tags question: http://stackoverflow.com/q/24885425
tags question: http://stackoverflow.com/q/24838239
tags question: http://stackoverflow.com/q/24906865
tags question: http://stackoverflow.com/q/24781177
tags question: http://stackoverflow.com/q/24786861
tags question: http://stackoverflow.com/q/24865385
tags question: http://stackoverflow.com/q/24909155
tags question: http://stackoverflow.com/q/24872144
tags question: http://stackoverflow.com/q/24783452
tags question: http://stackoverflow.com/q/24860032
tags question: http://stackoverflow.com/q/24840261
tags question: http://stackoverflow.com/q/24750173
tags question: http://stackoverflow.com/q/24813339
tags question: http://stackoverflow.com/q/24807701
tags question: http://stackoverflow.com/q/24845979
tags question: http://stackoverflow.com/q/24842237
tags question: http://stackoverflow.com/q/24773798
tags question: http://stackoverflow.com/q/24785153
tags question: http://stackoverflow.com/q/24759781
tags question: http://stackoverflow.com/q/24901869
tags question: http://stackoverflow.com/q/24819381
tags question: http://stackoverflow.com/q/24894355
tags question: http://stackoverflow.com/q/24803709
tags question: http://stackoverflow.com/q/24771277
tags question: http://stackoverflow.com/q/24777886
tags question: http://stackoverflow.com/q/24825493
tags question: http://stackoverflow.com/q/24833726
tags question: http://stackoverflow.com/q/24902870
tags question: http://stackoverflow.com/q/24897235
tags question: http://stackoverflow.com/q/24869173
tags question: http://stackoverflow.com/q/24779986
tags question: http://stackoverflow.com/q/24843145
tags question: http://stackoverflow.com/q/24778305
tags question: http://stackoverflow.com/q/24764645
tags question: http://stackoverflow.com/q/24817252
tags question: http://stackoverflow.com/q/24788678
type: Tag
tags question: http://stackoverflow.com/q/24799419
tag name: jquery-ui
tags question: http://stackoverflow.com/q/24791106
tags question: http://stackoverflow.com/q/24780721
tags question: http://stackoverflow.com/q/24797056
tags question: http://stackoverflow.com/q/24888467
tags question: http://stackoverflow.com/q/24777425
tags question: http://stackoverflow.com/q/24794295
tags question: http://stackoverflow.com/q/24869688
tags question: http://stackoverflow.com/q/24905906
tags question: http://stackoverflow.com/q/24811800
tags question: http://stackoverflow.com/q/24830356

loops
tags question: http://stackoverflow.com/q/24904296
tags question: http://stackoverflow.com/q/24783040
tags question: http://stackoverflow.com/q/24896572
tags question: http://stackoverflow.com/q/24790225
tags question: http://stackoverflow.com/q/24802865
tags question: http://stackoverflow.com/q/24857132
tags question: http://stackoverflow.com/q/24890255
tags question: http://stackoverflow.com/q/24871304
tags question: http://stackoverflow.com/q/24797710
type: Tag
tags question: http://stackoverflow.com/q/24814395
tags question: http://stackoverflow.com/q/24812903
tag name: loops
tags question: http://stackoverflow.com/q/24772412
tags question: http://stackoverflow.com/q/24827611
tags question: http://stackoverflow.com/q/24867375
tags question: http://stackoverflow.com/q/24775725
tags question: http://stackoverflow.com/q/24882980

http://stackoverflow.com/a/24882513
answers question: http://stackoverflow.com/q/24882435
has comment: http://stackoverflow.com/comment/38653230
has comment: http://stackoverflow.com/comment/38648989
type: AcceptedAnswer
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/38651909
downvote count: 1
has comment: http://stackoverflow.com/comment/38649038
accepted answer of: http://stackoverflow.com/q/24882435
has body: document.referrer gives you the URI of the page that linked to the current page. more informative link here
score: 1

http://stackoverflow.com/comment/38655357
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24884120
has text: Then at least make sure your fiddle contains `.fullpage`

http://stackoverflow.com/comment/110052182
type: Comment
has text: This answer makes a lot of assumptions about the state of ones `package.json`.
comment on: http://stackoverflow.com/a/54173575
score: 7
type: AnswerComment

http://stackoverflow.com/a/24763867
answers question: http://stackoverflow.com/q/24763790
score: 0
type: Answer
has body: You are doing $("#infoToggler img"), which selects all images inside element with id #infoToggler. So no need to find img again. You are getting it wrong way, try this way: $("#infoToggler img").click(function() { window.alert('hi'); $("#infoToggler img").toggle(); }); Yes, you will have to toggle both. Look here, gives you an example : http://jsfiddle.net/mz47F/

http://stackoverflow.com/comment/38640404
type: AnswerComment
has text: @dystroy However, if I change `a[0] |= b;` to `a[b] = b`, the two examples run almost the same time.
comment on: http://stackoverflow.com/a/24859070
type: Comment
score: 0

http://stackoverflow.com/comment/38642231
has text: @TaleebAhmad Yes that part is clear, did you get a chance to read the answer I linked to and try with the `input` event? I think that's the best that you can do in this scenario (apart from disabling autocomplete in your form). My comment was about you having more than one text input because then the button may become disabled when one has a value and the other doesn't. But if your other field is not a text input then there shouldn't be an issue.
type: AnswerComment
comment on: http://stackoverflow.com/a/24857017
score: 0
type: Comment

http://stackoverflow.com/q/24771471
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/24774247
answer count: 1
accepted answer: http://stackoverflow.com/a/24774247
tagged with: hammer.js
has body: I have just upgraded to hammer.js version 2, and I need to change the way that I am handling events where the user pans vertically. I was reading the docs, and it says that only horizontal panning is supported. Why is this the case, and is there an alternative for handling vertical panning events?
type: AnsweredQuestion
has title: Vertical panning gesture
type: Question

http://stackoverflow.com/q/24875575
has title: Angular ui routers nested ui-views not working
has comment: http://stackoverflow.com/comment/38636549
tagged with: javascript
upvote count: 3
has answer: http://stackoverflow.com/a/24878654
has body: I'm trying to create a simple nested route within angular and whenever a nested route occurs the view doesn't pop up With a path of http://localhost:9000/#/home/hello I still only see homeHello Why isn't the nested ui view picking up the home.hello template? Rendered HTML home Hello Angular Ui Router // app.js angular.module('spoonFeeder', ['ui.router', 'ngAnimate', 'ngCookies', 'ngResource', 'ngSanitize', 'ngTouch']) .config(function($stateProvider, $urlRouterProvider, $locationProvider) { $urlRouterProvider.otherwise('/home') $stateProvider .state('home', { url: '/home', templateUrl: 'home/home.html' }) .state('home.hello', { url: '/hello', templateUrl: 'home/hello.html' }) // use the HTML5 History API // $locationProvider.html5Mode(true); }); Views homeHello Hello
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38636188
type: AnsweredQuestion
score: 3
type: Question
tagged with: angular-ui-router
accepted answer: http://stackoverflow.com/a/24878654

http://stackoverflow.com/a/79027304
has comment: http://stackoverflow.com/comment/139342531
upvote count: 0
has body: Iterate JSONObject and check for existence of JSONObject or String and invoke this repeatedly to parse entire JSON Below code works fine public JSONObject parseJSON(JSONObject jsonObject,String prefix) { if (parsedJSONObject == null) parsedJSONObject = new JSONObject(); Iterator iteration = jsonObject.keys(); while(iteration.hasNext()) { String key = (String)iteration.next(); System.out.println(key); String correctedPrefix = (prefix != null && prefix.length()> 0)?(prefix+"."+key):(key); if(jsonObject.get(key) instanceof JSONObject) { // System.out.println("JSON Object" + key); parseJSON((JSONObject)jsonObject.get(key), correctedPrefix); }else if(jsonObject.get(key) instanceof JSONArray) { System.out.println(" JSON Array " + key); }else if(jsonObject.get(key) instanceof String) { // System.out.println(" String "+ key); parsedJSONObject.put(correctedPrefix, jsonObject.get(key)); } } return parsedJSONObject;
answers question: http://stackoverflow.com/q/24833379
type: Answer
downvote count: 1
score: -1

http://stackoverflow.com/comment/38540565
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24825505
has text: But, you have explicitly mentioned ui-btn class. Should I remove it if i use data-role="button" ??
score: 0

http://stackoverflow.com/q/24802099
has title: clear form and show new comment jquery php
tagged with: php
tagged with: mysql
has answer: http://stackoverflow.com/a/24804220
type: Question
tagged with: javascript
tagged with: comments
score: 0
answer count: 1
tagged with: jquery
has body: I'm trying to do a comment form, that puts the comment in my mysql database, and puts the new comment on my page right after submitting (and clears the form). But somehow you have to always refresh to see the new comments and if you click on submit more than once it shows duplicated comments after refresh. How can I solve that problem? I'm kinda a noob, so my codes are mostly from tutorials that I don't fully understand yet... my php-page: <?php // Error reporting: error_reporting(E_ALL^E_NOTICE); include "connect.php"; include "comment.class.php"; $comments = array(); $result = mysql_query("SELECT * FROM comments ORDER BY id ASC"); while($row = mysql_fetch_assoc($result)) { $comments[] = new Comment($row); } ?> Bausatz ON THE WOODWAY TRAVELS BLOG ME <?php foreach($comments as $c){ echo $c->markup(); } ?> Add a Comment Your Name Your Email Comment Body contact copyright jQuery: $(document).ready(function(){ var working = false; $('#addCommentForm').submit(function(e){ e.preventDefault(); if(working) return false; working = true; $('#submit').val('Working..'); $('span.error').remove(); /* Sending the form fileds to submit.php: */ $.post('submit.php',$(this).serialize(),function(msg){ working = false; $('#submit').val('Submit'); if(msg.status){ $(msg.html).hide().insertBefore('#addCommentContainer').slideDown(); $('#body').val(''); } else { $.each(msg.errors,function(k,v){ $('label[for='+k+']').append(''+v+''); }); } },'json'); }); }); comment.class.php <?php class Comment { private $data = array(); public function __construct($row) { /* / The constructor */ $this->data = $row; } public function markup() { /* / This method outputs the XHTML markup of the comment */ // Setting up an alias, so we don't have to write $this->data every time: $d = &$this->data; $link_open = ''; $link_close = ''; // Converting the time to a UNIX timestamp: $d['dt'] = strtotime($d['dt']); return ' '.$link_open.$d['name'].$link_close.' '.date('d M Y',$d['dt']).' '.$d['body'].' '; } public sta…
type: UnansweredQuestion

http://stackoverflow.com/comment/38644408
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24874861
has text: As I have said, I have tried removing each jquery once, but nothing is working yet

http://stackoverflow.com/q/24812462
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38517731
has body: I have a bunch of Angular JS content, and most of it is working fine, when it appears. Sometimes, however, when I refresh the page, all of it simply disappears, and it seems like the AngularJS stopped working all of a sudden. After this, I tried refreshing the page a few more times, and after a few clicks, it finally came back. However, if I try refreshing again after this, the same as before happens. I'm not really sure what information I can given you that will be relevant, so please let me know if you would like to see the code. EDIT: Some of the stuff I thought I could get help with: 1) Has something like this occurred to anyone else before? 2) Does placement of the angularJS scripts inside the HTML document make a difference here? EDIT: Here are the warnings when the content doesn't show up: 13:38:38.499 Unknown pseudo-class or pseudo-element '-webkit-inner-spin-button'. Ruleset ignored due to bad selector. bootstrap.css:153 13:38:38.499 Unknown pseudo-class or pseudo-element '-webkit-search-cancel-button'. Ruleset ignored due to bad selector. bootstrap.css:163 13:38:38.500 Unknown property '-moz-osx-font-smoothing'. Declaration dropped. bootstrap.css:279 13:38:38.501 Expected color but found 'auto'. Expected color but found '-webkit-focus-ring-color'. Expected end of value but found '-webkit-focus-ring-color'. Error in parsing value for 'outline'. Declaration dropped. bootstrap.css:923 13:38:38.501 Expected end of value but found '\9 '. Error in parsing value for 'width'. Declaration dropped. bootstrap.css:938 13:38:38.501 Expected end of value but found '\9 '. Error in parsing value for 'width'. Declaration dropped. bootstrap.css:947 13:38:38.502 Expected end of value but found '\9 '. Error in parsing value for 'margin-top'. Declaration dropped. bootstrap.css:2325 13:38:38.502 Expected color but found 'auto'. Expected color but found '-webkit-focus-ring-color'. Expected end of value but found '-webkit-focus-ring-color'. Error in parsing value for 'outline'. D…
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38518730
has comment: http://stackoverflow.com/comment/38517084
has comment: http://stackoverflow.com/comment/38518517
has comment: http://stackoverflow.com/comment/38517535
score: 0
has comment: http://stackoverflow.com/comment/38518362
tagged with: angularjs
has title: AngularJS content doesn't always appear, randomly shows up
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38518880

http://stackoverflow.com/a/24891853
has body: If you would like to run some code in the parent directive before the child, you could put your code in the preLink function. The preLink function can be specified like this: return { link: { pre: function preLink(scope, element, attrs) { // put your code here // code in here of parent will be executed before child's (top down). }, post: function postLink(scope, element, attrs) { // code in here of parent will be executed after child's (bottom up). } } };
answers question: http://stackoverflow.com/q/24889628
upvote count: 4
downvote count: 0
type: Answer
score: 4

http://stackoverflow.com/comment/38415617
type: AnswerComment
has text: @musthafa For reference, "upvoting" a comment does not confer any reputation to the user who made it - simply marking it as *"useful"* to any other users browsing the question (and makes it more likely the comment will not be hidden when the comment count rises and some start to be hidden by default). Accepting (the green tick) and/or upvoting an answer helps future users with the same problem immediately see that the answer helped you/solved the problem, and rewards users who take time to answer. It also makes it more likely your future questions will be answered - **and** gives you rep.
type: Comment
comment on: http://stackoverflow.com/a/24756657
score: 0

http://stackoverflow.com/comment/38683583
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24899981
has text: Thanks, but this is not what I want to accomplish. I will elaborate in a new question.

http://stackoverflow.com/comment/38495814
type: AnswerComment
has text: It is strange you have accepted an answer that is breaking your own rule and matching input like `a.1.2.3`
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24801405

http://stackoverflow.com/q/24758733
type: Question
has comment: http://stackoverflow.com/comment/38416702
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38416382
score: 0
has title: I am calling the Jquery function from code behind in asp net but it showing for one time only not for other
has comment: http://stackoverflow.com/comment/38414843
has comment: http://stackoverflow.com/comment/38416527
tagged with: asp.net
has answer: http://stackoverflow.com/a/24758936
has comment: http://stackoverflow.com/comment/38414834
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38416627
has comment: http://stackoverflow.com/comment/38414778
has comment: http://stackoverflow.com/comment/38416788
has body: ServerMonitoringDetails objServerMonitorings = new ServerMonitoringDetails(); objServerMonitorings = ServerMonitoringBusinessManager.GetAllIpDetailsByIpAddress(); StringBuilder sbPhysicalMemory = new StringBuilder(); sbPhysicalMemory.Append("Physical Memory"); sbPhysicalMemory.Append(" "); sbPhysicalMemory.Append("KHUSHVINDER-PC"); ScriptManager.RegisterStartupScript(this.divPhysicalMemory, this.Page.GetType(), "script", " ", false); sbPhysicalMemory.Append(" "); sbPhysicalMemory.Append(" "); sbPhysicalMemory.Append(" "); divPhysicalMemory.InnerHtml = sbPhysicalMemory.ToString(); StringBuilder sbVirtualMemory = new StringBuilder(); sbVirtualMemory.Append("Virtual Memory"); sbVirtualMemory.Append(" "); sbVirtualMemory.Append("KHUSHVINDER-PC"); ScriptManager.RegisterStartupScript(this.divVirtualMemory, this.Page.GetType(), "script", " ", false); sbVirtualMemory.Append(" "); sbVirtualMemory.Append(" "); divVirtualMemory.InnerHtml = sbVirtualMemory.ToString(); hi this is my above code i am calling same function twice in code behind but not working
has comment: http://stackoverflow.com/comment/38415101

http://stackoverflow.com/comment/38592723
comment on: http://stackoverflow.com/q/24852946
has text: yes. ajax means asynchrounously
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24797809
has answer: http://stackoverflow.com/a/24797938
has comment: http://stackoverflow.com/comment/38489086
tagged with: prototype
has body: Trying to add a method to js Date object to get formatted date, Date is not declared anywhere or called with new/create(): Date.prototype.format = function () { // return this.getFullYear() + '-' + ('0' + (this.getMonth() + 1)).slice(-2) + '-' + ('0' + this.getDate()).slice(-2) var curr_date = this.getDate(); var curr_month = this.getMonth() + 1; var curr_year = this.getFullYear(); return curr_year + "-" + curr_month + "-" + curr_date; } I've messed up with this variable. getDate(), getMonth(),getFullYear() are methods of Date object. Error is thrown when.getDate(); is called: undefined is not a function Please clarify how can I use other methods of single object type inside its prototype.
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38489156
tagged with: addition
has comment: http://stackoverflow.com/comment/38488918
accepted answer: http://stackoverflow.com/a/24797916
type: AnsweredQuestion
has title: Add a method to prototype of js object
has answer: http://stackoverflow.com/a/24797916
tagged with: methods
type: Question
possible better answer: http://stackoverflow.com/a/24797938
tagged with: javascript

http://stackoverflow.com/comment/38501991
comment on: http://stackoverflow.com/q/24804657
score: 0
type: QuestionComment
has text: Simply use `Array.reverse()`, for example: `var arr = [1,2,3]; arr.reverse(); // [3,2,1]`
type: Comment

http://stackoverflow.com/comment/38454940
comment on: http://stackoverflow.com/q/24779986
score: 0
type: Comment
type: QuestionComment
has text: thanks that works! but half way, if i'm deleting something the total remains. any suggestions?

http://stackoverflow.com/comment/38861702
type: Comment
has text: i am having the same problem, but on the server. Do you have an idea as to which node library should i be looking at?
comment on: http://stackoverflow.com/a/24957873
score: 0
type: AnswerComment

http://stackoverflow.com/q/24862496
tagged with: d3.js
has answer: http://stackoverflow.com/a/24863042
has answer: http://stackoverflow.com/a/24862841
upvote count: 1
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24863042
score: 1
has comment: http://stackoverflow.com/comment/38612454
type: Question
accepted answer: http://stackoverflow.com/a/24862841
answer count: 2
has comment: http://stackoverflow.com/comment/38611102
downvote count: 0
tagged with: javascript
has title: Unable to change font size using d3.js
has body: Being new to d3.js, I am trying to write a simple code to compute font-sizes for paragraphs from an array. This is my code: para 1 para 2 It seems like a very simple thing to do but for some reason isn't working. Any help as to where I am going wrong would really help.
favorite count: 0

http://stackoverflow.com/q/24782238
tagged with: ajax
type: AnsweredQuestion
has title: Update Django Object with Jquery, possible?
favorite count: 0
accepted answer: http://stackoverflow.com/a/24782433
type: Question
tagged with: django
upvote count: 1
answer count: 1
has body: I'm trying to update a Django Object (Company) that already exists in the table by using jQuery. The code I have executes fine, the Company object is not updated. Here is an excerpt from my template: {% if companies %} {% for company in companies %} {{ company.name }} {{ company.user.first_name }} {{ company.created_on }} Edit | Delete {% endfor %} {% else %} There are no companies yet. Do you want to create one? {% endif %} The JavaScript I have tried is: Finally, here is the view I tried: def list_companies_json(request): if request.is_ajax(): companies_list = Company.objects.filter(user=request.user).order_by('-name') context_dict = {'companies': companies_list, 'form': form, 'errors': errors, 'success': success} #context_dict = serializers.serialize('json', list(companies_list)) return render(request, 'panel/company/list_companies.html', context_dict)
has answer: http://stackoverflow.com/a/24782433
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery

http://stackoverflow.com/a/24757425
type: Answer
has body: You can use grunt --gruntfile Gruntfile-second.js to run the second file.
score: 6
upvote count: 6
accepted answer of: http://stackoverflow.com/q/24755552
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24755552

http://stackoverflow.com/q/24799419
has comment: http://stackoverflow.com/comment/38492064
type: AnsweredQuestion
has title: jquery UI Combobox ONCHANGE not working
tagged with: jquery-ui-selectmenu
type: Question
accepted answer: http://stackoverflow.com/a/24802469
tagged with: jquery-ui
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38492358
score: 0
has body: I am trying to use Jquery UI code to make a dropdown box. I am struggling to understand how to put in an onchange event listener so that: (a) the value of the dropdown box is passed to a variable called 'x' and (b) pass the value to an alert function which displays the selected value. I have tried using a simple select box with Jquery and it works fine. However I can't get it to work with more complex code. There is a similar thread to this which has been answered but I still couldnt get it to work with the ui code I am using below. Grateful for any help, and perhaps putting it on Fiddle? JQ onchange alert Choose: Select one... Amsterdam London Rome Asp BASIC C C++ Clojure COBOL ColdFusion Erlang Fortran Groovy Haskell Java JavaScript Lisp Perl PHP Python
has answer: http://stackoverflow.com/a/24802469
tagged with: combobox

http://stackoverflow.com/a/24852762
has comment: http://stackoverflow.com/comment/38592311
score: 1
has comment: http://stackoverflow.com/comment/38592224
has comment: http://stackoverflow.com/comment/38592578
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38592465
accepted answer of: http://stackoverflow.com/q/24852728
has body: I'm not familiar with this plugin but I'll give it a shot. Based off what you've provided I think your problem is: jQuery(this).addClass("active") Since you already know the class, just do: var tempClass = $(this).attr("class"); jQuery("a."+tempClass).addClass("active");
type: Answer
answers question: http://stackoverflow.com/q/24852728
has comment: http://stackoverflow.com/comment/38592268
downvote count: 0
has comment: http://stackoverflow.com/comment/38592577

http://stackoverflow.com/comment/38479202
has text: change `onOpen` to `onReady`, maybe it needs to wait for document to load? not sure
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24781015
score: 0

http://stackoverflow.com/q/24772500
tagged with: jsp
tagged with: javascript
favorite count: 0
tagged with: python
has body: I'm using Python 3.3 and Requests 2.2.1. I'm trying to POST to a website ending in .jsp, which then changes to .doh ending. Using the same basic requests code outline I'm able to successfully login and scrape other websites, but the javascript part on this site is not working. This is my code: import requests url = 'https://prodpci.etimspayments.com/pbw/include/sanfrancisco/input.jsp' payload = {'plateNumber':'notshown', 'statePlate':'CA'} #tried CA and California s = requests.Session() #Tried 'session' and 'Session' following different advice post = s.post(url, data=payload) r = s.get('https://prodpci.etimspayments.com/pbw/include/sanfrancisco/input.jsp') print(r.text) Finally, when manually entering data into the webpage through firefox browser, the page changes and url becomes https://prodpci.etimspayments.com/pbw/inputAction.doh, which only has contet if you are redirected there after typing in license plate. From the printed text, I know I'm getting content from the page as it would be without POSTing anything, but I need the content for the page once I've POSTed the payload. For the POST payload, do I need to include something like 'submit':'submit' to simulate clicking the search button? Am I doing the GET request from the right url, considering the url I POST to?
upvote count: 1
has title: POST to .jsp website with Python requests library
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24773449
accepted answer: http://stackoverflow.com/a/24773449
score: 1
tagged with: post
type: Question
downvote count: 0
answer count: 1

http://stackoverflow.com/q/24775966
accepted answer: http://stackoverflow.com/a/24776092
upvote count: 1
has comment: http://stackoverflow.com/comment/38447410
answer count: 1
has body: I have the following jpages code on jsfiddle where i am using a list of text and jpages to create pagination. However it is not working, even though I have referenced all of the relevent js libraries and included the javascript required. http://jsfiddle.net/HV88U/ $(function () { /* initiate pugin assigning the desired button labels */ $("div.holder").jPages({ containerID: "itemContainer", perPage: 2, first: false, previous: "span.arrowPrev", next: "span.arrowNext", last: false }); }); EDIT: jPages is a client-side pagination plugin but it gives you a lot more features comparing to most of the other plugins for this purpose, such as auto page turn, key and scroll browse, showing items with delay, completely customizable navigation panel and also integration with Animate.css and Lazy Load. http://luis-almeida.github.io/jPages/ The code is meant to paginate the list items, 2 per page, as can be seen in the parameters of the JS EDIT The only error messages I am recieving inside of visual studio 2012 are these below and seem to look non threatening Message 1 JSHint (r10): Expected '!==' and instead saw '!='. jPages.js 250 41 Message 2 JSHint (r10): Expected '!==' and instead saw '!='. jPages.js 254 52 Message 3 JSHint (r10): Expected '!==' and instead saw '!='. jPages.js 265 74 Message 4 JSHint (r10): Expected '===' and instead saw '=='. jPages.js 268 26 Message 5 JSHint (r10): Expected '===' and instead saw '=='. jPages.js 269 26
favorite count: 0
has answer: http://stackoverflow.com/a/24776092
has title: Jpages not working
tagged with: css
type: AnsweredQuestion
downvote count: 0
tagged with: jpage
score: 1
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/24882936
score: 1
has body: I have encountered similar problem. In my case, browser on the Android tablet sometimes ran ontouch event and onclick event on a single tap. It occurred when user taps any other place quickly after tapping the submit button. The problem was solved when calling preventDefault(); at both ontouch and onclick. How about checking what kind of a browser and a terminal your users are using? ADD: OK, your actual problem is "a submit button is clicked even if it is disabled", isn't it? Try this &lt;script type="text/javascript"&gt; function changeButtonText(e,form){ form.submit_button.disabled=true; //if validation is true then it submits the form like this error_notification.style.display="none"; jQuery('#submit_button').css({'background-color':'#C3CACD'}); form.submit(); //else if the validation fails then 'submit button' is not disabled form.submit_button.disabled=true; e.preventDefault(); } &lt;/script&gt;
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/24879234
has comment: http://stackoverflow.com/comment/38690594
type: Answer
has comment: http://stackoverflow.com/comment/38650580
has comment: http://stackoverflow.com/comment/38690375

http://stackoverflow.com/q/24753321
has title: JQuery.SlideToggle() isn't functioning
has comment: http://stackoverflow.com/comment/38404775
has body: <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MainDesign.master.cs" Inherits="Web_Assignment.MainDesign" %> Master Design Login this will show Home About Gallery Contact <asp:ContentPlaceHolder ID="ContentPlaceHolder" runat="server"></asp:ContentPlaceHolder> I wonder why it wouldn't toggle the slides down whenever I clicked "Login"? Been searching and trying to sort this out for days. I wanted to add a id: and password: inside the slided-div and possibly to hide it back whenever "Login" clicked again.
score: 0
has comment: http://stackoverflow.com/comment/38405136
possible better answer: http://stackoverflow.com/a/24753674
has answer: http://stackoverflow.com/a/24753674
has answer: http://stackoverflow.com/a/24753562
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/1070760
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/24753562
has comment: http://stackoverflow.com/comment/38404691
tagged with: javascript
tagged with: jquery
tagged with: asp.net

http://stackoverflow.com/q/24861295
tagged with: ruby-on-rails
type: AnsweredQuestion
has title: jQuery ajax call from a numberfield using Rails is not working
type: Question
has answer: http://stackoverflow.com/a/24863289
answer count: 1
has body: For my application, I have fixeddeposits where we can create new fixeddeposits. Now, i want to update the rateofinterest field based upon the number(365/730/1095/1460 & 1825) I typed in the deposit period(number_field) and i have to check the customer age. I have calculated customer age in fixeddeposits_controller. I don't know where i am wrong that too is not working. Example 1: 1.1: If a customer age >58 && age<75, i want to open the fixed deposit for 365days means i have to sum the two fields rate(9.5%) + seniorincrement(0.5%) and then pass the value(10.0%) to rateofinterest field. 1.2: If a customer age >75, i want to open the fixed deposit for 365days means i have to sum the two fields rate(9.5%) + superseniorincrement(1.0%) and then pass the value(10.5%) to rateofinterest field. 1.3: If a customer age <58, i want to open the fixed deposit for 365days means i have to pass the rate(9.5%) field value alone to rateofinterest field. Where as(rate, seniorincrement, superseniorincrement)fields are from interestrates table. For this i am using AJAX/JQUERY which was suggest by Mandeep in my previous question. I have implemented, but its not working. I have attached the code i tried. Kindly check it and please give me some ideas. _form.html.erb <%= form_for @fixeddeposit do |f| %> <% if @fixeddeposit.errors.any? %> Couldn't open FD Account <% @fixeddeposit.errors.full_messages.each do |error| %> <%= error %> <% end %> <% end %> <%= f.label :customer_name, class:'required' %> <%= f.text_field :customername, :placeholder =>'Name' %> <%= f.label :date_of_birth, class:'required' %> <%= f.date_select :dateofbirth, { :include_blank => true, :start_year => 1900, :end_year => 2014 }, :id => "dateofbirth" %> <%= f.label :Periods, class:'required' %> <%= f.number_field :periods, :id => "fixeddeposit_periods", :placeholder => "Days", :class => "input-mini" %> <%= f.label :Rate_Of_Interest %> <%= f.text_field :rateofinterest, :id => "fixeddeposit_rateofinterest", :value => "", :dis…
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/24752435
tagged with: ruby-on-rails-3
tagged with: ajax
score: 0
accepted answer: http://stackoverflow.com/a/24863289

http://stackoverflow.com/a/24846539
score: 5
has body: Note that document.getElementsByClassName returns a set of elements which have all the given class names. You should be certain that your styleTable and hoverColorChange functions iterate through that returned collection (by means of a for loop or perhaps Array.filter). http://devdocs.io/dom/document.getelementsbyclassname I would recommend you rename your variable to be plural, by the way, to make it more clear that it is a collection (tables not table). ADDENDUM: Thanks for posting your complete code. Pasting it into Sublime Text 3 with JSLinter enabled, I'm getting several warnings, including: Variables (e.g. tr and anchors) used out of their declared scopes. Use of == rather than ===. Missing semicolons. Functions defined within for loops. Fix those, and give it another run.
has comment: http://stackoverflow.com/comment/38580282
answers question: http://stackoverflow.com/q/24846521
has comment: http://stackoverflow.com/comment/38580333
upvote count: 5
has comment: http://stackoverflow.com/comment/38580231
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/38580316

http://stackoverflow.com/a/24889544
has comment: http://stackoverflow.com/comment/38888619
accepted answer of: http://stackoverflow.com/q/24882778
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24882778
type: Answer
has comment: http://stackoverflow.com/comment/38892144
upvote count: 1
score: 1
has body: In JavaScript the order in which you load the .js files matters. Have you tried loading ajax.js before jsfunctions.js? Basically when jsfunctions.js is loaded in your browser the functions in ajax.js are undefined if the latter has not been loaded. Also, make sure that there is a field called 'csrfmiddlewaretoken' present in the data in the ajax call. From a maintainability perspective, instead of handling the data directly you could keep it in a form and then serialize it when you send it to your back end. Like so: &lt;form id="my-form" method="POST" action="/dummy/{{ frame.slug }}/"&gt; {% csrf_token %} &lt;input name="whatever" value="your_data_goes_here" /&gt; &lt;/form&gt; Then in your ajax call: var form = $('#my-form'); $.ajax({ type: form.attr('method'), url: form.attr('action'), data: form.serialize(), success: function() { alert("Huzzah!"); }, error: function() { alert("Oh no!"); } }); And finally in your views.py, you can address your data: if "whatever" in request.POST: my_data = request.POST.get("whatever")

http://stackoverflow.com/q/24882659
tagged with: jquery
favorite count: 0
has title: Moving from one ordered list to another OL
has comment: http://stackoverflow.com/comment/38649377
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
upvote count: 0
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/38649323
has comment: http://stackoverflow.com/comment/38649440
score: -1
has answer: http://stackoverflow.com/a/24882832
answer count: 2
has answer: http://stackoverflow.com/a/24882850
has body: When i click on the text from the OL "firstlist" i want the exact text to be moved to the other OL "seclist". It is not necessary to remove that text from the firstlist. The thing i lack is how to get the selected element from the firstlist. I think others will work if we pass the selected item from the first list to "var text" in click function. Please help me out. Thanks in advance. Example Item 1 Item 2 Item 3 Item 4 Item 5
tagged with: javascript

http://stackoverflow.com/a/24770445
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/24770412
downvote count: 0
has body: The given code will be parsed like this: var foo = 1; function bar() { var foo; if (!foo) { foo = 10; } alert(foo); } bar(); The local foo is hoisted to the top of the function since JS only has function scope and no block scope. The "hoisted" variable will take precedence over the foo defined outside the function, which is why the variable is undefined in your if statement.
type: Answer

http://stackoverflow.com/a/33130213
type: Answer
score: 0
has body: Mapping x0 € [_x-_width/2 .. _x+_width/2] to sl € [0..10] linearly and vica versa is not a big deal. If having x0: offset of -(_x-_width/2) transforms it to 0.._width, so a scale of 10/_width is needed for 0..10: sl == ( x0 - (_x-_width/2) ) * 10 / _width // float div unless 10 | _width Reversed: x0 == (_x-_width/2) + sl * _width / 10 Take care of int vs. float divisions and rounding (+.5).
answers question: http://stackoverflow.com/q/24843893

http://stackoverflow.com/a/24755014
has body: You could use the following regex: [a-zA-Z]+(?:(?:\. |[' ])[a-zA-Z]+)* (?:\. |[' ]) means "either a dot followed by a space, or an apostrophe, or a space". If you need to allow hypens as well for example, replace [' ] by [' -] (a hypen must be either at the beginning or at the end of a class to be matched). More info at http://www.regular-expressions.info/. Debuggex Demo
upvote count: 12
has comment: http://stackoverflow.com/comment/91716352
type: Answer
answers question: http://stackoverflow.com/q/24754914
accepted answer of: http://stackoverflow.com/q/24754914
score: 12
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/24847909
upvote count: 2
answers question: http://stackoverflow.com/q/24847877
accepted answer of: http://stackoverflow.com/q/24847877
has body: Shorten format of document ready is this. $(function () { $('#datetimepicker1').datetimepicker(); }); This will do the trick..
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38582909
type: Answer
has comment: http://stackoverflow.com/comment/38582936
score: 2

http://stackoverflow.com/comment/38631132
comment on: http://stackoverflow.com/a/24832838
has text: Trying what you suggested. Not getting desired result. Get error messages when using code such as: storeAttribute //script[contains(@src, 'filename.js')] x echo ${x} The error message is: [error] Invalid xpath [2]: //script[contains( Can you use my example as reference, given that it is located in the HEAD of a page. Thanks!
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/24795450
has comment: http://stackoverflow.com/comment/38484901
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/38484888
has comment: http://stackoverflow.com/comment/38484962
answers question: http://stackoverflow.com/q/24795434
has comment: http://stackoverflow.com/comment/38485238
accepted answer of: http://stackoverflow.com/q/24795434
score: 2
has comment: http://stackoverflow.com/comment/38484839
has comment: http://stackoverflow.com/comment/38485352
has comment: http://stackoverflow.com/comment/38484851
has body: Html: &lt;div class='tag' id="&lt;?php echo $id;?&gt;"&gt; &lt;span class='tagName' id="&lt;?php echo $tag_name;?&gt;"&gt;Something&lt;/span&gt; &lt;/div&gt; Jquery $('.tag').find('.tagName').attr('id'); // get child id $('.tag').attr('id'); // parent id
has comment: http://stackoverflow.com/comment/38484760
type: AcceptedAnswer
upvote count: 3

http://stackoverflow.com/q/24908183
tagged with: sharepoint
favorite count: 0
has answer: http://stackoverflow.com/a/24909538
accepted answer: http://stackoverflow.com/a/24909538
has body: I have a code like below to get current web in my SharePoint 2013 portal project var clientContext; var website; SP.SOD.executeFunc('sp.js', 'SP.ClientContext', sharePointReady); function sharePointReady() { clientContext = SP.ClientContext.get_current(); website = clientContext.get_web(); clientContext.load(website); clientContext.executeQueryAsync(onRequestSucceeded, onRequestFailed); } function onRequestSucceeded() { alert('URL of the website: ' + website.get_url()); } function onRequestFailed(sender, args) { alert('Error: ' + args.get_message()); } When I log in to site everything works perfect. But when I open site with anonymous user web url not is not avaliable. Am I missing something? Thanks
has title: ECMAScript not working for anonymous user
downvote count: 0
score: 1
type: AnsweredQuestion
type: Question
upvote count: 1
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/38447515
comment on: http://stackoverflow.com/q/24775647
has text: @mfdoran :thank you for your efforts. But I just get alerts of the string but not the alerts after splitting.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/24781934
accepted answer of: http://stackoverflow.com/q/24781532
score: 0
type: AcceptedAnswer
has body: I don't know what a "gup" function is. I'm going to assume that you're talking about a "Get URL Parameter" function here, possibly like the one defined here. If I'm wrong about what it does, then you can still adapt this answer to whatever function you need. I see that you're trying to use the Dojo toolkit. But Dojo has no "gup" function, and vanilla JavaScript doesn't have one either, so you'll need to define it yourself. Paste the code for your function (or write it out) into a file, and then reference it using another
answers question: http://stackoverflow.com/q/24781532
type: Answer

http://stackoverflow.com/comment/38682894
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24900321
has text: sure, the link to the plugin is https://github.com/invetek/jquery-confirmon
score: 0

http://stackoverflow.com/q/24792707
answer count: 2
has comment: http://stackoverflow.com/comment/38479589
has comment: http://stackoverflow.com/comment/38479593
has comment: http://stackoverflow.com/comment/38479608
accepted answer: http://stackoverflow.com/a/24792748
has body: I'm not sure how to explain this question, so I'll illustrate with code. var bob = { "1": ["a", "b"] } var jim = bob[1] jim.shift() print(bob[1]) Running this with d8, I get an output of [b]. Notice how bob (the object I am referencing from jim) is being changed when I modify jim. I would like to have behavior where modifying jim does nothing to bob. That is, even after the shift(), I'd like bob[1] to still be [a,b] instead of [b]. I'm sure that this is a well-documented part of JS, but I wasn't sure how to search for it. Thanks for your help.
has comment: http://stackoverflow.com/comment/38479765
linked to: http://stackoverflow.com/q/7486085
has answer: http://stackoverflow.com/a/24792748
has comment: http://stackoverflow.com/comment/38479674
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/7486085
has comment: http://stackoverflow.com/comment/38479670
has comment: http://stackoverflow.com/comment/38479749
has comment: http://stackoverflow.com/comment/38479748
type: Question
has comment: http://stackoverflow.com/comment/38479573
has answer: http://stackoverflow.com/a/24792740
has comment: http://stackoverflow.com/comment/38479612
tagged with: javascript
linked to: http://stackoverflow.com/q/122102
has title: Javascript references to object
possible better answer: http://stackoverflow.com/a/24792740
score: 0

http://stackoverflow.com/a/24762832
upvote count: 2
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/24762779
has body: You need to make the data: A safe JavaScript string — use json_encode instead of ', addslashes, and '. A safe HTML attribute value — use htmlspecialchars Thus: &lt;button onclick="text(&lt;?php echo htmlspecialchars(json_encode($variable1)); ?&gt;);"&gt; As a rule of thumb, dealing with PHP quotes inside JavaScript quotes inside HTML quotes is more trouble then it is worth. You can usually get rid of at least one level of nesting by keeping your JS in a &lt;script&gt; element instead of inside attribute values. &lt;script&gt; function myFunction() { text(&lt;?php echo json_encode($variable1); ?&gt;); } document.querySelector('button').addEventListener('click', myFunction); &lt;/script&gt;
accepted answer of: http://stackoverflow.com/q/24762779
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/38423466

http://stackoverflow.com/a/24811366
answers question: http://stackoverflow.com/q/24811205
accepted answer of: http://stackoverflow.com/q/24811205
score: 0
has body: Unfortunately, you can't do that. This is because the properties of menuSetup haven't been defined yet. For example, var menuSetup = { m: [100, 200], height: menuSetup.m[0] }; will through (in chrome) TypeError: Cannot read property 'm' of undefined because menuSetup is just undefined (because it was hoisted by the var declaration) The only two ways I can think of is to a) Save m as a variable before. For example: var m = [100, 200]; var menuSetup = { m: m, height: m[0] } b) Use a method instead of a variable and execute it. var menuSetup = { m: [100, 200], height: function() { return this.m[0]; } } Then, when you get menuSetup.height, you would actually do menuSetup.height().
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/38682107
has text: @KingKing My mention of the `translateZ` was to help other users as that is the most common source of error, though I'm open to changing it if you are against that opinion
score: 1
comment on: http://stackoverflow.com/a/24899875
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38619780
type: AnswerComment
has text: @Tomas Lycken I have this very useful regex testing website :) http://www.gethifi.com/tools/regex
type: Comment
comment on: http://stackoverflow.com/a/24866947
score: 2

http://stackoverflow.com/a/32866283
score: 13
answers question: http://stackoverflow.com/q/24902061
downvote count: 0
has comment: http://stackoverflow.com/comment/106587432
has body: In Nodejs, console.log representation of a Javascript object can be overridn by adding inspect() method to that Object eg: function User(name, password){ this.name = name; this.password = password; } User.prototype.toString = function(){ return this.name; }; User.prototype.inspect = function(){ return 'Model: ' + this.name ; } -Thanks to 'Ciro Santilli'
type: Answer
upvote count: 13
has comment: http://stackoverflow.com/comment/105830591
has comment: http://stackoverflow.com/comment/105832179
has comment: http://stackoverflow.com/comment/105760634

http://stackoverflow.com/a/24892518
answers question: http://stackoverflow.com/q/24891799
downvote count: 1
score: 1
has body: Adeneo's answer is correct, but you also asked to loop back to the start. Assuming you want the div to go back to its original position, you need to chain another animation like this: $('#pig').animate({left: 200}, 300, function() { $('#pig').animate({left: 0}, 300); });
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24891799
type: Answer
upvote count: 2

http://stackoverflow.com/comment/38528483
score: 0
has text: I did this at frist (with CSS). The problem is that on the HOME page, the Home menu item is at 100% opacity and others are at 30%. I want when I am on my HOME page, all my menu items to be at 100% opacity. For this i think i need jQuery.
type: AnswerComment
comment on: http://stackoverflow.com/a/24804545
type: Comment

http://stackoverflow.com/comment/38866430
type: AnswerComment
has text: indeed it does.... i am not completely sure - i will have a better look at your structure now.
type: Comment
comment on: http://stackoverflow.com/a/24997899
score: 0

http://stackoverflow.com/q/24855840
has comment: http://stackoverflow.com/comment/38598579
type: Question
answer count: 2
tagged with: javascript
has title: CSS - Setting the top/left properties of a rotated element
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/24855966
has answer: http://stackoverflow.com/a/24855964
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
possible better answer: http://stackoverflow.com/a/24855966
upvote count: 1
downvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24855964
has body: Consider I have a relative/absolute positioned div with a transform: rotate property set on it. How does changing the top/left properties of this div affects its position on the screen? In a small demo that I created, it looks like when trying to move that div, by changing its top/left properties, it won't move as expected. For example, in the demo below, i have a relative positioned div, which is rotated by 45deg, and initially positioned at (300px, 300px). When trying to move this div by (5px, 5px), the div will actually move backwards... Why it that? Here is the demo - Demo (Click the red square in order to move it by 5px in each direction) Thanks!

http://stackoverflow.com/comment/38598390
has text: A separate file, login.js. I ensured that the code has run, as it hit the breakpoint I set in Chrome.
score: 0
comment on: http://stackoverflow.com/q/24852584
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38667891
type: AnswerComment
comment on: http://stackoverflow.com/a/24892359
type: Comment
has text: @Quentin Good poin\t, forgot the `t`
score: 0

http://stackoverflow.com/comment/38641774
type: Comment
type: QuestionComment
has text: Yep, found a reference to 1.7.2 which I have now removed, but no improvement.
comment on: http://stackoverflow.com/q/24878480
score: 0

http://stackoverflow.com/q/24776162
accepted answer: http://stackoverflow.com/a/24777044
tagged with: http://stackoverflow.com/tag/html
has body: I'm developing a wallboard to display service calls. I want to change the background of the wallboard to a certain colour (e.g. red) when the date within the 'date logged' is older than 24 hours, I've not got much experience with jQuery and am struggling to get this working! Hope this makes sense! Superslides - A fullscreen slider for jQuery <?php $conn=odbc_connect('wallboard_data','',''); if (!$conn) { exit("Connection Failed: " . $conn); } $sql2="SELECT * FROM [data$]"; $rs2=odbc_exec($conn,$sql2); if (!$rs2) { exit("Error in SQL"); } echo " "; while (odbc_fetch_row($rs2)) { $date=odbc_result($rs2,"Date"); $customer=odbc_result($rs2,"Customer"); $region=odbc_result($rs2,"Region"); $sla=odbc_result($rs2,"SLA"); $machine_fault=odbc_result($rs2,"Machine Fault"); $machine_type=odbc_result($rs2,"Machine Type"); $cust_updated_date=odbc_result($rs2,"Customer Updated"); $ops_mngr=odbc_result($rs2,"Ops manager Informed"); $rgm_informed=odbc_result($rs2,"RGM Informed"); echo " Date logged: $date "; echo "Customer Name: $customer "; echo "Region: $region "; echo "SLA: $sla "; echo "Machine Fault: $machine_fault "; echo "Machine Type: $machine_type "; echo "Customer Last Updated: $cust_updated_date "; echo "Operations Manager Informed: $ops_mngr "; echo "RGM Informed: $rgm_informed "; } echo " "; odbc_close($conn); ?>
tagged with: css
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/38448188
downvote count: 1
type: Question
tagged with: javascript
score: -1
has title: Change CSS If date inside a div is older than 24 hours
answer count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/24777044

http://stackoverflow.com/q/24908049
tagged with: mobiscroll
tagged with: virtual
upvote count: 2
has answer: http://stackoverflow.com/a/24911628
score: 2
type: AnsweredQuestion
has body: There are a lot of questions about this. But they all talk about leaving the focus on a field. Here is my problem: I have a input type field. When the user clicks on it, it will open my custom mobiscroll feature. and in some cases like by Android 2.* or windows surface tablets it shows the virtual keyboard as well ! How can i code a case that the virtual keyboard will never appear ! Who can help me :)
type: Question
has answer: http://stackoverflow.com/a/24909086
accepted answer: http://stackoverflow.com/a/24911628
downvote count: 0
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/24909086
tagged with: keyboard
favorite count: 0
has title: Hide virtual keyboard on mobile with Jquery/Javascript (Mobiscroll)
answer count: 3
has answer: http://stackoverflow.com/a/28344205

http://stackoverflow.com/comment/38520159
type: QuestionComment
comment on: http://stackoverflow.com/q/24814264
has text: Well, I guess that you're creating the span element to frame the D3 Gauges. Perhaps the problem is the timing. Are you sure that the span exists before loading the D3 Gauges?
score: 0
type: Comment

http://stackoverflow.com/q/24777282
answer count: 2
tagged with: javascript
has body: I'm trying to forward the user when he clicks on the submit button using angular into my web-app this way: html code Modifier Modifier app.js (function(){ var app = angular.module('m', [ ]); app.controller('fCtrl', function(){ this.edit = 0; this.editLine = function(){ this.edit = 1; }; this.canBeEdited = function(){ return this.edit === 1; } this.submitEdit = function(qualif0, qualif1, commentaire){ this.edit = 0; window.location.replace('./fiche/traiter?qualif0='+qualif0+'&qualif1='+qualif1+'&commentaire='+commentaire); } }); })(); But, this wouldn't work. How to fix this, please? Thanks in advance!
has comment: http://stackoverflow.com/comment/38455827
has answer: http://stackoverflow.com/a/24777657
score: 0
has comment: http://stackoverflow.com/comment/38449695
linked to: http://stackoverflow.com/q/11541695
has title: how to redirect user using angular
has comment: http://stackoverflow.com/comment/38453510
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24777613
has comment: http://stackoverflow.com/comment/38460971
has comment: http://stackoverflow.com/comment/38450026
type: Question

http://stackoverflow.com/a/24807142
has body: Perhaps trying the .live method instead of the .on something like ('.openDialog').live('click', function (e) { This solved a similar issue I was having recently, granted I am relatively new to JS/jQuery
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24806751

http://stackoverflow.com/q/24829905
has title: Get an image to upload and display within a div
tagged with: css
possible better answer: http://stackoverflow.com/a/24830090
tagged with: image-uploading
type: AnsweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/24830111
type: Question
score: 1
has body: Please review my Fiddle... I have a file upload button, which works fine. You'll see it when you barely scroll down in the fiddle. The image uploads, but it uploads down at the bottom of the page, and I'm trying to get it to display within a div, immediately below the upload button. HTML... `&lt;input type='file' onchange="readURL(this);" /&gt;&lt;/label&gt; &lt;p&gt; &lt;strong&gt;(Image will display below)&lt;/strong&gt; &lt;/p&gt; &lt;div style="max-width: 100px; height: 100px; border:1px dashed black;"&gt; &lt;img id="blah" src="#" alt="Your image goes here..." /&gt; &lt;/div&gt;` JS... `$("input").change(function(e) { for (var i = 0; i &lt; e.originalEvent.srcElement.files.length; i++) { var file = e.originalEvent.srcElement.files[i]; var img = document.createElement("img"); var reader = new FileReader(); reader.onloadend = function() { img.src = reader.result; } reader.readAsDataURL(file); $("input").after(img); } });`
answer count: 2
accepted answer: http://stackoverflow.com/a/24830111
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/24830090
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/24801488
type: AcceptedAnswer
has body: this is gonna fix your problem: $(document).on('blur', 'tr td input.autoupdate',function(event){ event.stopPropagation(); event.preventDefault(); rid = $(this).closest('tr').attr('id'); }); $(document).on('focus', 'tr td input.autoupdate',function(e){ e.stopPropagation(); e.preventDefault(); newid = $(this).closest('tr').attr('id'); check(); }); problem was: your trs and tds are dynamically added, therefor they have no event listener listening for the events happening on them, this is how you can set event listeners on your dynamically added elements.
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24801421
answers question: http://stackoverflow.com/q/24801421
score: 1
upvote count: 1

http://stackoverflow.com/a/24803542
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/38499087
score: 2
has body: I wouldn't go against the attributes at all. Updating an elements data (with e.g. $('.myclass').data('foo', 'bar') does not update the attributes. The attributes set the initial values of the elements data but that is all. In your case I would recommend using jQuerys filter function. Something like $('.some-class-common-to-all-candidates').filter(function(){ var d = $(this).data('1'); if( 'foo' == d ){ return true; } else if( d &gt; 10 ){ return true; } // If we get this far then no match return false; }) Untested and I made up the conditions but you should get the gist. jQuery filter documentation
downvote count: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24803312
has comment: http://stackoverflow.com/comment/38509978
answers question: http://stackoverflow.com/q/24803312

http://stackoverflow.com/a/24861511
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38609156
has comment: http://stackoverflow.com/comment/38610209
has comment: http://stackoverflow.com/comment/38609739
type: Answer
has comment: http://stackoverflow.com/comment/38609591
has body: Your function needs to actually return something, otherwise it will always return undefined (which is falsy), and that's why none of your ng-ifs get triggered. For example: lolModule.controller("ctrl",function($scope){ $scope.testExpr=function(e){ console.log("bool=",e); return e == 'true'; } }); See it here: http://plnkr.co/edit/gPizAfnD0BrmHFAfcNyu?p=preview
has comment: http://stackoverflow.com/comment/38609897
has comment: http://stackoverflow.com/comment/38610288
accepted answer of: http://stackoverflow.com/q/24861424
score: 0
answers question: http://stackoverflow.com/q/24861424

http://stackoverflow.com/comment/38408924
type: Comment
comment on: http://stackoverflow.com/a/24754772
has text: this was a big help :D thanks. iv used a little over a day with different script builds and none of em worked. this was the most simple i could make. just needed the check function.
score: 0
type: AnswerComment

http://stackoverflow.com/q/24817035
upvote count: 1
tagged with: php
tagged with: captcha
has answer: http://stackoverflow.com/a/24817069
has body: I have a contact-us form with Google captcha inside a JQuery accordion section and the recaptcha is displayed distorted. I suspect some JS conflict to be the reason but not sure. Does anyone have any idea? I cannot post images yet, you can see it at http://trcont-ekb.ru/contacts.php Here's the code: Имя:* Телефон:* Ваш e-mail:* Выберите адресата:* --------- Ваше сообщение:* <?php require_once('recaptchalib.php'); $publickey = "123456789"; echo recaptcha_get_html($publickey); ?>
score: 1
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: google captcha displayed distorted
tagged with: accordion
has comment: http://stackoverflow.com/comment/38525015
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/24857733
has body: I am currently working with a javascript library called clmTrackr which includes the computer vision library JsFeat, and am having problems extracting the RBG value of a pixel in this javascript library. I have succesfully extracted the values by creating another &lt;canvas&gt; and using this code: // Pixel extraction --RGB function cropFaceColor(canvas, locationX, locationY) { var idata = canvas.getImageData(locationX,locationY ,1,1); var data = idata.data; var R = data[0]; var G = data[1]; var B = data[2]; document.getElementById('colorExtraction').innerHTML = R + " " +G + " " + B ; } But am wondering if there is a way to accomplish the same goal using only the available functions inside of these libraries.
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/24906501
answer count: 1
tagged with: javascript
score: 0
has title: Javascript - Extracting RGB values from pixels
has answer: http://stackoverflow.com/a/24906501
tagged with: computer-vision

http://stackoverflow.com/a/24833417
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24833219
type: Answer
accepted answer of: http://stackoverflow.com/q/24833219
score: 1
upvote count: 1
has body: That's exactly expected. You are logging the data object, which contains three properties. The first property is named products and it's type is Object, the second is named token and it's type is string which is outputted, and the last is customer_id whose value is 1. If you were to call: console.log(data.products) you would get a log of the properties of the products object. You could do this for each of the properties of each of the objects to log their values. You can think of JavaScript objects as a hash of key value pairs, where the value could be anything including another hash of key value pairs.

http://stackoverflow.com/comment/38729275
comment on: http://stackoverflow.com/a/24901124
type: Comment
has text: Navas Basheer, unfortunately I had already tried this approach. The "selectedValue" you recommend returns the selected value of **en** (because **English (US)** is selected) despite selecting **Bulgarian - Български** from the html select list.
score: 0
type: AnswerComment

http://stackoverflow.com/q/24880249
has comment: http://stackoverflow.com/comment/38644883
answer count: 1
accepted answer: http://stackoverflow.com/a/24880456
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
type: Question
has title: Javascript accessing the main object from withing its property
has answer: http://stackoverflow.com/a/24880456
has body: I have this object: var myObj = new function(){ this.dateInfo = "someinfo"; } and then I have the following properties: myObj.add = function(){ console.log("Added"); } myObj.remove.item = function(key){ console.log("Item "+key+" removed."); } The issue is here: myObj.remove.undo = function(key){ // here I want to use `myObj.add()` function, what should I do? } In the above (last) function, I want to utilize the myObj.add(), how should I refer to it? I know this does not do the trick (from inside the remove.undo()). I need help. Thanks.
upvote count: 1

http://stackoverflow.com/a/24810416
score: 1
has body: Its possible with vanilla javascript and jQuery.animate but it can also be done entirely css3 transition &amp; animate. Take a look here for example
upvote count: 1
answers question: http://stackoverflow.com/q/24810192
downvote count: 0
type: Answer

http://stackoverflow.com/q/24868297
type: Question
tagged with: javascript
has title: image zoom frame position using class selector in jQuery
score: 0
has answer: http://stackoverflow.com/a/24868534
answer count: 1
tagged with: jquery
tagged with: zooming
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/24868534
type: AnsweredQuestion
has body: Please take a look at this fiddle I got the image magnifying plugin Leroy Zoom from this site. I have trouble making it work with multiple images on the same page. The zoom frame is fixed at a certain position and won't dynamically move next to any image on hover. Is there a way to make the zoom frame's position correspond to the hovered image? HTML: Executive Script: $(document).ready(function() { $(".demo-trigger").each(function(){ var area = $(this).closest('.area') $(this).leroyZoom({ zoomTop: 200, // Zoom frame distance from top in pixels zoomLeft: 160, // Zoom frame distance from left in pixels parent: area }); }); });

http://stackoverflow.com/a/24777236
has comment: http://stackoverflow.com/comment/38449659
score: 0
type: Answer
has body: For input it's val() for divs and stuff it's text(). If you wanna do everything with a single event, you can do something like: $('.listen').on(... { if($(this).is('input')) { use val() } else { use text() } }
upvote count: 1
has comment: http://stackoverflow.com/comment/38449536
downvote count: 1
answers question: http://stackoverflow.com/q/24777152

http://stackoverflow.com/a/24777608
has comment: http://stackoverflow.com/comment/38450857
upvote count: 1
answers question: http://stackoverflow.com/q/24777399
score: 1
downvote count: 0
has body: Should do the job &lt;div class="form-group" ng-class="{ 'has-error' : (isDublicateColumn($parent.filterName) || createForm.name.$invalid &amp;&amp; !createForm.name.$pristine) , 'has-success': createForm.name.$valid}"&gt;
has comment: http://stackoverflow.com/comment/38450578
type: Answer

greasemonkey
tags question: http://stackoverflow.com/q/24804623
tags question: http://stackoverflow.com/q/24835559
type: Tag
tag name: greasemonkey
tags question: http://stackoverflow.com/q/24802606
tags question: http://stackoverflow.com/q/24772842
tags question: http://stackoverflow.com/q/24797451

http://stackoverflow.com/comment/80564520
comment on: http://stackoverflow.com/a/24902734
type: AnswerComment
has text: What and where has to be in ajax-category.php ?
score: 0
type: Comment

http://stackoverflow.com/comment/80687221
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/24808076
type: Comment
has text: This is what I normally do, but it doesn't always work.

http://stackoverflow.com/q/24766958
upvote count: 2
type: Question
tagged with: polymer
has comment: http://stackoverflow.com/comment/38559375
tagged with: javascript
has title: Extending core elements like core-item in polymer - without copying CSS or mapping all attributes?
has comment: http://stackoverflow.com/comment/38560288
tagged with: web-component
has comment: http://stackoverflow.com/comment/38437945
linked to: http://stackoverflow.com/q/18623765
has comment: http://stackoverflow.com/comment/70616999
downvote count: 0
has comment: http://stackoverflow.com/comment/38469245
favorite count: 0
type: UnansweredQuestion
has body: Are there guidelines on the best way to extend core elements like core-item in Polymer? For example, I wanted to extend core-item with a paper-ripple ("Ripple All The Things!") and it seems like the options are to either extend core-item or compose a new element including it. Extending seems to lose styling of core-item, and Composing means I need to map all the attributes: Extend core-item: This has the unfortunate side effect that the CSS defined in core-item.css nolonger matches for all the 'html /deep/ core-item' rules and I lose the padding around the icon, etc, unless I manually go set it up again in my-item. I need to go into my-item and attempt to style it match the work done in core-item.css, either matching to 'my-item' or maybe just on the :host? This seems like a bunch of extra copy/paste : Or compose a new my-item: This works great, though I then need to map all the attributes of core-item to my published attributes. Not that bad, but it feels like there may be a better way, particularly for more complicated components?
tagged with: css
score: 2
answer count: 0

http://stackoverflow.com/a/24829598
has comment: http://stackoverflow.com/comment/38548598
has comment: http://stackoverflow.com/comment/38550790
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38549327
has comment: http://stackoverflow.com/comment/38550050
has comment: http://stackoverflow.com/comment/38550264
upvote count: 1
has comment: http://stackoverflow.com/comment/38558444
has comment: http://stackoverflow.com/comment/38549728
answers question: http://stackoverflow.com/q/24828511
has body: The CSS file is loaded asynchronously because it is evaluated immediately when it is appended. Append does this asynchronously while the rest of the DOM executes. I've seen some people use this same trick with a tag without using async = true and it seems to work as well without using async = true. This still works on new browsers, even if you add the async attribute to your or tags. However, the javascript way is more of a workaround solution compared to using the new HTML5 async attribute and so solely using the async attribute inline is preferred if your not worried about supporting older browsers for async loading. The async attribute works much better and is built to work better and more intuitively with the DOM. According to your switch statement, the script.async = true is only being called in the loadJs() function, which is only being called if the extension is '.js'. So yes, javascript, jQuery and ajax files will be loaded using script.async = true, because they have a '.js' extension, but so will any other '.js' file. Here's a decent resource for more reading on the javascript async trick: async-javascript
type: Answer

http://stackoverflow.com/comment/38597398
score: 0
has text: @zerkms Yes, they are as passed by PHP. It's the 556 that is showing the wrong thing.
type: QuestionComment
comment on: http://stackoverflow.com/q/24855142
type: Comment

http://stackoverflow.com/q/24788773
has answer: http://stackoverflow.com/a/24914020
tagged with: angularjs-ng-options
upvote count: 7
type: AnsweredQuestion
has body: I have a view that is filled with dropdownlists to filter a report. I also have a view of saved filters that are displayed as links. When a user clicks on their saved filters, I want the appropriate values of the dropdownlists to be selected. The drop downs are being populated properly. On the saved filter link there is an ng-click that will call a function that iterates through the collection of saved filter values and automatically selects the correct one. I cannot figure out how to programmatically set the selected option. Any help is much appreciated! -- Select One -- Here is the list of saved filters: Saved Filters No saved filters And here is my controller (function(){ 'use strict'; var ReportDetailController = function(ReportsService, $scope){ var _locList = {}; var _hospitalStatusList = {}; var _providerStatusList = {}; var _savedFilters = []; var _sourceTypeList = {}; var _dateRangeList = {}; var _init = function(){ ReportsService.getCurrentReportSavedFilters().then(function(data){ $scope.reportDetail.savedFilters =data; $scope.hasSavedFilters = ReportsService.hasSavedFilters(); }); ReportsService.getLOCListForDDL().then(function(data){ $scope.reportDetail.locList = data; //$scope.reportDetail.selectedLoc = $scope.reportDetail.locList[0]; }); ReportsService.getSelectListData() .then(function(data){ $scope.reportDetail.sourceTypeList = data.CONNECTION_TARGET_STATUS; $scope.reportDetail.hospitalStatusList = data.CONNECTION_SOURCE_STATUS; }); ReportsService.getDateRangesForDDL() .then(function(data){ $scope.reportDetail.dateRangeList = data; }); $scope.reportDetail.providerStatusList = ReportsService.getProviderStatusForDDL(); }; var _loadSavedFilters = function(filters){ for(var i = 0, l = $scope.reportDetail.locList.length; i<l; i++){ if($scope.reportDetail.locList[i].serviceName == filters.levelOfCare){ $scope.reportDetail.selectedLoc = $scope.reportDetail.locList[i]; console.log($scope.reportDetail.selectedLoc); } } } var _isActive = function(filter){ for(…
has answer: http://stackoverflow.com/a/24916298
score: 7
type: Question
accepted answer: http://stackoverflow.com/a/24916298
downvote count: 0
has title: How to programmatically select ng-option value?
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24788936
favorite count: 0
has answer: http://stackoverflow.com/a/24788936
tagged with: angularjs
answer count: 5
has answer: http://stackoverflow.com/a/24849532
has answer: http://stackoverflow.com/a/42997948

http://stackoverflow.com/comment/38494053
score: 0
type: Comment
has text: Thank you. It works. I almost forgot to use another ng-repeat in this case.
type: AnswerComment
comment on: http://stackoverflow.com/a/24800106

http://stackoverflow.com/comment/38578528
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24845578
type: AnswerComment
has text: Why would one want to click a button using the keyboard?

http://stackoverflow.com/comment/38580282
type: Comment
has text: Best answer I can provide, given the current scope of information provided in the question. You're right, though. It would help a lot to see the actual code for OP's styling functions.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24846539

http://stackoverflow.com/a/24871367
has comment: http://stackoverflow.com/comment/38628279
has comment: http://stackoverflow.com/comment/38628971
has body: You could use Array.some() to check if any of the selects have a selected value function hasThing() { return $('select').toArray().some(function(el) { return el.value != ""; }) } function create() { var test = hasThing(); if (test) { alert('at least one select was changed'); //$('#myForm').submit(); } else { alert('you suck!'); } } function hasThing() { return $('select').toArray().some(function(el) { return el.value != ""; }) } Select at least one option ! blank option1 blank option1
downvote count: 0
has comment: http://stackoverflow.com/comment/38629005
has comment: http://stackoverflow.com/comment/38629014
has comment: http://stackoverflow.com/comment/38628950
type: Answer
has comment: http://stackoverflow.com/comment/38628405
has comment: http://stackoverflow.com/comment/38628783
has comment: http://stackoverflow.com/comment/38628667
score: 3
has comment: http://stackoverflow.com/comment/38629049
upvote count: 3
has comment: http://stackoverflow.com/comment/38628255
has comment: http://stackoverflow.com/comment/38628871
has comment: http://stackoverflow.com/comment/38628552
answers question: http://stackoverflow.com/q/24871304

http://stackoverflow.com/comment/38559264
type: Comment
score: 0
type: AnswerComment
has text: Tested it out, worked perfectly! Initially I thought it would only add the elements when angular bootstraps, but it updates the view as you update the array.
comment on: http://stackoverflow.com/a/24835138

http://stackoverflow.com/comment/38582927
comment on: http://stackoverflow.com/q/24847572
has text: @BenjaminGruenbaum I just found it. Took me a while to digest the code. Thanks a lot :)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38661617
score: 1
has text: you can pass parameters for that. That is not a big issue
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24889134

http://stackoverflow.com/a/24793344
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24793139
type: Answer
has comment: http://stackoverflow.com/comment/38481510
upvote count: 6
has body: Using a single html element with background images HTML - doesn't get simpler than this &lt;div id="imgHolder"&gt;&lt;/div&gt; CSS #imgHolder { width: 200px; height: 200px; display: block; position: relative; } /*Initial image*/ #imgHolder::before { content:""; top: 0; left: 0; bottom: 0; right: 0; position: absolute; background-image:url(http://placehold.it/200x200); -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; z-index:10; } #imgHolder:hover::before { opacity:0; } #imgHolder::after { content:""; background: url(http://placehold.it/200x200/FF0000); top: 0; left: 0; bottom: 0; right: 0; position: absolute; z-index: -1; } Demo OR if you want to use image tags... Stealing straight from: http://css3.bradshawenterprises.com/cfimg/ HTML &lt;div id="cf"&gt; &lt;img class="bottom" src="pathetoImg1.jpg" /&gt; &lt;img class="top" src="pathetoImg2.jpg" /&gt; &lt;/div&gt; CSS #cf { position:relative; height:281px; width:450px; margin:0 auto; } #cf img { position:absolute; left: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; } #cf img.top:hover { opacity:0; } There are many other examples in the link as well to play with, but this will get you started. Final Opacity You've mentioned you don't want the initial image to disapear comletely. To do this change opacity:0 to opacity:0.5 or something similar. You'll need to experiment with that value to get the result you want. Demo with final opacity of 0.8 Dynamic Image Sizes I think you will be stuck with the two image version for this if just using CSS. HTML is the same. CSS #cf { position:relative; } #cf img { -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; } #cf img.bottom { z-index:-1; opacity:…
score: 6
has comment: http://stackoverflow.com/comment/38483108
accepted answer of: http://stackoverflow.com/q/24793139

http://stackoverflow.com/comment/38503896
type: QuestionComment
has text: or [event delegation](http://learn.jquery.com/events/event-delegation/)
comment on: http://stackoverflow.com/q/24805994
score: 0
type: Comment

http://stackoverflow.com/comment/38624175
score: 0
has text: I don't understand how browserify actually becomes aware of my project. Do I put a specific file in my ASP.NET MVC project? Or do I put this on my server, or my dev machine, or what? Is it just always there and looking at my javascript?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24869121

http://stackoverflow.com/comment/38646343
type: AnswerComment
has text: But you have to understand that this is a grid and each "DetailItemTemplate" is repeated for each row. So there will always be multiple textboxs with IDs like "ct100_Div_Txt002_Txt_Pad_Dtl".
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24859493

http://stackoverflow.com/a/24777637
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24773753
has body: the index of the selected route you may get via the method getRouteIndex of the DirectionsRenderer. A possible event to detect changes on the routeIndex is routeindex_changed. google.maps.event.addListener(directionsRenderer,'routeindex_changed',function(){ //current routeIndex console.log(this.getRouteIndex()); //current route console.log(this.getDirections().routes[this.getRouteIndex()]); });
answers question: http://stackoverflow.com/q/24773753
upvote count: 2

http://stackoverflow.com/a/24757897
has comment: http://stackoverflow.com/comment/38431115
has comment: http://stackoverflow.com/comment/38413713
has comment: http://stackoverflow.com/comment/38413258
has body: If you look at the Advanced bindings section of the manual, they note that uploaded files will be bound to a File object. File upload is easy with Play. Use a multipart/form-data encoded request to post files to the server, and then use the java.io.File type to retrieve the file object. When I take your code and test it with the f1 parameter of addPhoto2 as a File, it works perfectly fine. With f1 as Object, the parameter doesn't get set (and thus is null). I'm guessing the automatic Play parameter binding process gets confused when you specify a file parameter as an object and refuses to set it.
has comment: http://stackoverflow.com/comment/38413868
answers question: http://stackoverflow.com/q/24756749
score: 0
has comment: http://stackoverflow.com/comment/38449266
type: Answer

http://stackoverflow.com/q/24768624
tagged with: jquery
has comment: http://stackoverflow.com/comment/38456977
tagged with: ajax
score: 0
tagged with: jconfirm
has answer: http://stackoverflow.com/a/24781345
has comment: http://stackoverflow.com/comment/38457163
accepted answer: http://stackoverflow.com/a/24781345
type: AnsweredQuestion
has title: jConfirm is not defined
has body: I have a simple script that prompts the user to confirm delete, then it just alerts them that the process was completed properly. I tried using jConfirm and the Javascript console spits out: "ReferenceError: jConfirm is not defined" &lt;!-- jConfirm --&gt; // the script is referenced properly &lt;script src="/js/jconfirm/jquery.jconfirm-1.0.min.js"&gt;&lt;/script&gt; &lt;script&gt; function careersDelete(career_id) { jConfirm('Are you sure you want to delete this career?', 'Delete Career', function (x) { if (x) { jQuery.ajax({ url: "ajax_career_delete.php", type: "GET", data: "career_id=" + career_id, success: function (response) { alert('Career deleted'); } }); } }); } On the button that should enable the confirm dialog, I have: &lt;a href="#" onclick="careersDelete('&lt;?php echo $career_id; ?&gt;')"&gt;delete&lt;/a&gt;
type: Question
tagged with: confirm
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/24859464
has comment: http://stackoverflow.com/comment/38611928
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/24859009
type: AcceptedAnswer
has body: Use drawImage instead of fillRect var robbie = document.getElementById("robbie"); for(var i=0; i&lt;this.invaders.length; i++) { var invader = this.invaders[i]; ctx.drawImage(robbie,invader.x - invader.width/2, invader.y - invader.height/2); }
downvote count: 0
answers question: http://stackoverflow.com/q/24859009
type: Answer

http://stackoverflow.com/q/24872144
tagged with: jquery-ui
tagged with: modal-dialog
tagged with: javascript
has title: jQuery UI dialog not showing, backbone, Django
score: 0
has answer: http://stackoverflow.com/a/24914621
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/24914621
tagged with: requirejs
upvote count: 1
type: AnsweredQuestion
downvote count: 1
has body: I have a problem. In my django templates I have django, require, jQuery UI. The thing is that a template loading at the bottom should be a dialog, some sort of modal, with the jQuery UI. But doesn't show as a modal but as part of the first content. This is the pos_send_to_admin.html which appears at the end of the website, instead of being a modal. {% extends "pos/pos_homepage.html" %} {% block windows %} {% csrf_token %} Description Peruvian soles (S/.) American Dollars(US$) Fondo de caja de apertura {{ balance_status.initial_soles }} {{ balance_status.initial_dollars }} Ingresos totales brutos {{ balance_status.inflow_soles }} {{ balance_status.inflow_dollars }} Ajustes anteriores {{ balance_status.adjust_soles }} {{ balance_status.adjust_dollars }} Dinero en caja teórico Dinero en caja real {{pos_adjust_form.adjust_soles}} {{pos_adjust_form.adjust_dollars}} Ajuste Fondo de caja para sgte. turno {{pos_send_form.send_in_soles}} {{pos_send_form.send_in_dollars}} Deposito recepcion 0 0 Cancel {% endblock windows %} {% block css %} {{ block.super }} {% endblock css %} {% block script %} {{ block.super }} {% endblock script %} This is the send_to_admin.js file which is not called, so there is no modal define([ 'jquery', 'backbone', 'jquery.ui', 'jquery.keyboard' ], function($){ var calculate = function(){ var last_soles = parseFloat($('#last_soles').html()); var last_dollars = parseFloat($('#last_dollars').html()); var total_soles = parseFloat($('#total_soles').html()); var total_dollars = parseFloat($('#total_dollars').html()); var adjust_soles = parseFloat($('#adjust_soles').html()); var adjust_dollars = parseFloat($('#adjust_dollars').html()); var teoric_soles = last_soles + total_soles + adjust_soles; var teoric_dollars = last_dollars + total_dollars + adjust_dollars; $('#teoric_soles').html(teoric_soles); $('#teoric_dollars').html(teoric_dollars); //ajuste var soles_adjust = parseFloat($('#id_adjust_soles').val()); var dollars_adjust = parseFloat($('#id_adjust_dol…
type: Question

http://stackoverflow.com/q/24766452
has comment: http://stackoverflow.com/comment/38429352
tagged with: forms
upvote count: 1
has comment: http://stackoverflow.com/comment/38429411
tagged with: preventdefault
accepted answer: http://stackoverflow.com/a/24766531
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/1200266
type: AnsweredQuestion
tagged with: submit
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38429514
favorite count: 0
has title: jQuery - e.preventDefault conundrum / can't submit form after preventing default
has comment: http://stackoverflow.com/comment/38429973
type: Question
has comment: http://stackoverflow.com/comment/38429392
has answer: http://stackoverflow.com/a/24766531
answer count: 1
has body: Goal: Stop 'submit' button, validate field, create popover alerting of results, submit form when popover is closed. So I have a hidden popover div, and when the submit button is pressed I do this to check for certain conditions AND display the popover: $("form").submit(function(e) { e.preventDefault(); if (($("#conditions").find("input:checkbox:checked").length ) || $('#radio_condition_1').is(":checked")) { $("#popback").css('display', 'block'); } }); Then I THOUGHT this code would submit the form once the popover is cleared: $("#popback").click(function() { $("#popback").css('display', 'none'); $("form").submit(); }); without: $("form").submit(); The second code works fine to clear the popover. However, with the submit function inserted it not only doesn't clear the popover, it also doesn't submit the form. NOTE: there are two forms on the page. Help?
has comment: http://stackoverflow.com/comment/38430156

http://stackoverflow.com/a/28398045
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24811862
has body: It depends on the nature of the API. The credentials will not be secure from other users with access to the same device. But if you're working with a scenario which requires zero or only very minimal security requirements, using localStorage could work. Regarding encryption of the localStorage data -- recognize that you're essentially just obfuscating, not protecting. Since the encryption key must be passed to the client the best you can hope for is to make it (a little) more difficult to find the API credentials should someone have access to the machine.

http://stackoverflow.com/q/24754567
has answer: http://stackoverflow.com/a/24754628
accepted answer: http://stackoverflow.com/a/24754628
answer count: 1
has title: What does 'if (err)' tests precisely in Javascript?
tagged with: undefined
tagged with: instanceof
has body: Many callback functions start by checking an err parameter as following: function myCallback(err, result) { if ( err ) { // Handle error ... } ... } What does the if (err) test verifies? Does it check whether the object is null? Does it check whether it is undefined? Shouldn't one test for instanceof Error? When does this test return true?
type: AnsweredQuestion
tagged with: if-statement
tagged with: null
tagged with: javascript
type: Question
score: 0

http://stackoverflow.com/q/24785492
has answer: http://stackoverflow.com/a/24785640
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/24785640
type: Question
tagged with: boolean
tagged with: function
has body: In this fiddle I have a div that moves when another element is clicked and moves back when all elements except for the div itself are clicked. I check what position it is in with a boolean. the problem I have is that after the boolean changed it executes the other function without another click so the div just moves back and forth on each click. This is the code: Click me! div { height: 50px; width: 50px; background-color: red; } $(document).ready(function () { var isRight = false; function toRight() { $('div').animate({'margin-left':'60%'}, 500); isRight = true; } function toLeft() { $('div').animate({'margin-left':'0'}, 500); isRight = false; } $('*:not(div)').on('click', function() { if (isRight) { toLeft(); } }); $('p').on('click', function () { if (!(isRight)) { toRight(); } }); });
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: click
favorite count: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/24785668
has answer: http://stackoverflow.com/a/24785668
has answer: http://stackoverflow.com/a/24785557
has title: jquery click handles extra function after boolean changed
upvote count: 1

http://stackoverflow.com/q/24856143
answer count: 3
downvote count: 3
score: -3
has body: I'm trying to figure out the best way to take a json object which I'm storing as a scope, and filter/query it to display specific data from within it. For example: $scope.myBook = {"bookName": "Whatever", "pages": [ {"pageid": 1, "pageBody": "html content for the page", "pageTitle": "Page 1"}, {"pageid": 2, "pageBody": "html content for the page", "pageTitle": "Page 2"}, {"pageid": 3, "pageBody": "html content for the page", "pageTitle": "Page 3"}, ] } How would I go about grabbing the object for pageid:2 ?
has title: Drill Down into JSON Object in Angular
upvote count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38599379
favorite count: 0
has comment: http://stackoverflow.com/comment/38599321
tagged with: angularjs
type: Question
has answer: http://stackoverflow.com/a/24869998
has answer: http://stackoverflow.com/a/24856260
has answer: http://stackoverflow.com/a/24856265

http://stackoverflow.com/a/24771243
type: Answer
accepted answer of: http://stackoverflow.com/q/24771208
score: 2
downvote count: 0
has body: Using chrome dev tools, you could inspect the element and on the side bar in the right, select the Event Listeners tab, that will list the event listeners attached to the element. Additional Info, in response to comment: If you are using jquery is going to be way harder, but here we go... Chrome dev tools again... this time go to the Sources tab instead of Elements tab. In the side bar to the right, there is an Accordion named Event Listener Breakpoint, select the event listener that you suspect is triggering your mysterious function... from there is javascript step by step debugging. if you are using jQuery, just keep hitting F11 until you are out of jQuery and into whatever other javascript you have. Unfortunately, is not easy to debug event listeners if you don't know where is being created. You could also search your entire code base after all event listeners and add a console.log until you find the one.
upvote count: 2
has comment: http://stackoverflow.com/comment/38438728
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24771208

http://stackoverflow.com/q/24908881
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/710957
score: -1
has answer: http://stackoverflow.com/a/24909287
has comment: http://stackoverflow.com/comment/38698446
duplicate of: http://stackoverflow.com/q/710957
downvote count: 1
has body: Is there any way to get its filename by only using javascript? For example I want to get the string somefile.js?v=32&amp;b=2.2 inside that same javascript file. Is it possible to get it without going through the script tag?
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24909287
has title: Get JavaScript File Name?
upvote count: 0
answer count: 1

http://stackoverflow.com/comment/38684541
type: QuestionComment
type: Comment
score: 0
has text: OK, how exactly does the first snippet add the element to the document? Because by itself, it doesn't (http://jsfiddle.net/AVBLa/).
comment on: http://stackoverflow.com/q/24901057

http://stackoverflow.com/q/24828459
has answer: http://stackoverflow.com/a/29797653
tagged with: http://stackoverflow.com/tag/pdf
answer count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
type: UnansweredQuestion
tagged with: pdfmake
upvote count: 4
has title: AngularJS export SVG to PDF
downvote count: 0
type: Question
has body: I'm trying to export a &lt;svg&gt; element sitting in DOM to a PDF file, generated on client side. I tried with different libraries, and pdfmake is so close to what I want. Any working example with this library or any other library would be helpful. downloadPdf = function() { //var docDefinition = { content: 'This is an sample PDF'}; var html = d3.select("svg") .attr("version", 1.1) .attr("xmlns", "http://www.w3.org/2000/svg") .node().parentNode.innerHTML; console.log(btoa(html)); var imgsrc = 'data:image/svg+xml;base64,'+btoa(html); var docDefinition = {content: [{image: imgsrc}]} pdfMake.createPdf(docDefinition).open('Sample.pdf'); }
tagged with: javascript
score: 4

http://stackoverflow.com/a/24901935
upvote count: 3
accepted answer of: http://stackoverflow.com/q/24901898
score: 3
answers question: http://stackoverflow.com/q/24901898
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: Use $.noConflict() to avoid conflicts between jquery's files : Follow this link : http://api.jquery.com/jquery.noconflict/

google-chrome
tags question: http://stackoverflow.com/q/24894627
tags question: http://stackoverflow.com/q/24867864
tags question: http://stackoverflow.com/q/24807441
tags question: http://stackoverflow.com/q/24834984
tags question: http://stackoverflow.com/q/24907229
tags question: http://stackoverflow.com/q/24837069
tags question: http://stackoverflow.com/q/24802984
tags question: http://stackoverflow.com/q/24878488
tags question: http://stackoverflow.com/q/24762770
tags question: http://stackoverflow.com/q/24901360
tags question: http://stackoverflow.com/q/24905991
tags question: http://stackoverflow.com/q/24899444
tags question: http://stackoverflow.com/q/24758297
tags question: http://stackoverflow.com/q/24791119
tags question: http://stackoverflow.com/q/24852427
tags question: http://stackoverflow.com/q/24756877
tags question: http://stackoverflow.com/q/24809497
tags question: http://stackoverflow.com/q/24856089
tags question: http://stackoverflow.com/q/24790893
tags question: http://stackoverflow.com/q/24766518
tags question: http://stackoverflow.com/q/24862025
tags question: http://stackoverflow.com/q/24847323
tags question: http://stackoverflow.com/q/24832990
tags question: http://stackoverflow.com/q/24894388
tags question: http://stackoverflow.com/q/24865202
tags question: http://stackoverflow.com/q/24888965
tags question: http://stackoverflow.com/q/24821100
tags question: http://stackoverflow.com/q/24754028
tags question: http://stackoverflow.com/q/24848762
tags question: http://stackoverflow.com/q/24812017
tags question: http://stackoverflow.com/q/24858071
tags question: http://stackoverflow.com/q/24818970
tags question: http://stackoverflow.com/q/24905145
tags question: http://stackoverflow.com/q/24899375
tags question: http://stackoverflow.com/q/24853261
tags question: http://stackoverflow.com/q/24857334
tags question: http://stackoverflow.com/q/24869615
tags question: http://stackoverflow.com/q/24838139
tags question: http://stackoverflow.com/q/24859490
tags question: http://stackoverflow.com/q/24886893
tags question: http://stackoverflow.com/q/24871067
tags question: http://stackoverflow.com/q/24841397
type: Tag
tags question: http://stackoverflow.com/q/24789997
tags question: http://stackoverflow.com/q/24880860
tags question: http://stackoverflow.com/q/24872674
tags question: http://stackoverflow.com/q/24813886
tags question: http://stackoverflow.com/q/24861817
tag name: google-chrome
tags question: http://stackoverflow.com/q/24895921
tags question: http://stackoverflow.com/q/24875580
tags question: http://stackoverflow.com/q/24874590
tags question: http://stackoverflow.com/q/24857010
tags question: http://stackoverflow.com/q/24752464
tags question: http://stackoverflow.com/q/24811958
tags question: http://stackoverflow.com/q/24807340
tags question: http://stackoverflow.com/q/24899700
tags question: http://stackoverflow.com/q/24830911
tags question: http://stackoverflow.com/q/24786746
tags question: http://stackoverflow.com/q/24879023
tags question: http://stackoverflow.com/q/24763691
tags question: http://stackoverflow.com/q/24777295
tags question: http://stackoverflow.com/q/24876832
tags question: http://stackoverflow.com/q/24837813
tags question: http://stackoverflow.com/q/24825044
tags question: http://stackoverflow.com/q/24875501

http://stackoverflow.com/q/24839418
has answer: http://stackoverflow.com/a/24839460
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/24839632
type: Question
has answer: http://stackoverflow.com/a/24839444
accepted answer: http://stackoverflow.com/a/24839444
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24839632
has comment: http://stackoverflow.com/comment/38566653
score: 0
answer count: 3
has title: Parsing JSON data and checking if array is empty
has comment: http://stackoverflow.com/comment/38566612
has body: I'm trying to get an array from a JSON object, and check if it's empty, but it's giving me problems. HTML: &lt;p id="r"&gt;&lt;/p&gt; JS: var r = document.getElementById('r'); var obj = { "_id": "4345356", "title": "sdfsf", "data": [] }; obj = JSON.parse(obj); function isEmpty(a) { if (typeof a === 'undefined' || a.length == 0) return true; return false; } r.innerHTML = isEmpty(obj.data); Fiddle. What did I miss? Thanks!
type: AnsweredQuestion

http://stackoverflow.com/a/24759597
has comment: http://stackoverflow.com/comment/38419846
has comment: http://stackoverflow.com/comment/38418075
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38419939
has comment: http://stackoverflow.com/comment/38418054
has comment: http://stackoverflow.com/comment/38419220
type: Answer
has comment: http://stackoverflow.com/comment/38420167
accepted answer of: http://stackoverflow.com/q/24759298
has body: This resolved it for you. http://jsfiddle.net/t4Vec/ var count = 2300; while (count){ var _objectsOfArray = [], ul = document.createElement("ul"); for (var i = 0; i &lt; 20; i++){ var item = document.createElement("li"); item.innerText = i; _objectsOfArray.push(item); ul.appendChild(_objectsOfArray[i]); count --; } //do something with UL document.body.appendChild(ul); } If you have a precreated list, you could use innerHTML and parse it accordingly. My sample just prints a ul with 20 Li elements with the text node set to the index of the node Edit: New Fiddle: http://jsfiddle.net/t4Vec/1/
has comment: http://stackoverflow.com/comment/38419754
answers question: http://stackoverflow.com/q/24759298
has comment: http://stackoverflow.com/comment/38418222
has comment: http://stackoverflow.com/comment/38419605
has comment: http://stackoverflow.com/comment/38420086
has comment: http://stackoverflow.com/comment/38420042
has comment: http://stackoverflow.com/comment/38417444
score: 0

http://stackoverflow.com/comment/38404111
has text: @user875139, your original context (which is `#productThumbnail img`) is wrapped within jQuery collection, but when you access an element *in* that collection it returns the underlying ('native') element.
comment on: http://stackoverflow.com/a/24752838
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38475104
score: 0
comment on: http://stackoverflow.com/a/24790135
has text: Wait... not to be off topic but how did you make a gif of a screenshot that easily???
type: Comment
type: AnswerComment

http://stackoverflow.com/q/24880951
has comment: http://stackoverflow.com/comment/38646270
tagged with: javascript
has title: How listen to other model events from your model in backbone js?
answer count: 2
upvote count: 1
accepted answer: http://stackoverflow.com/a/24882588
has comment: http://stackoverflow.com/comment/38646446
favorite count: 0
tagged with: backbone.js
has answer: http://stackoverflow.com/a/24882588
has answer: http://stackoverflow.com/a/24882652
type: AnsweredQuestion
downvote count: 0
score: 1
possible better answer: http://stackoverflow.com/a/24882652
type: Question
has body: I have a problem with backbone. I have two models: A and B I need to listen to events in one model (for instance A), and then after the event has happened make changes in the view of model B and its view. Does anyone have a fairly simple example how such functionality can be implemented in backbone? var Model_A_View= Backbone.View.extend({ events: { // some events; "click" : "ok", }, initialize: function () { this.Model_A = new Model_A({ // }); } var Model_B_View= Backbone.View.extend({ events: { // some events; }, initialize: function () { this.Model_B = new Model_B({ // }); this.listenTo( model_A , "change: ok", this.dosomethingFunction()); } dosomethingFunction: function () { //dosomething }

http://stackoverflow.com/comment/38561782
has text: Well written question, good job
comment on: http://stackoverflow.com/q/24836573
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24755893
type: Question
upvote count: 4
has body: I am attempting to use the devtool feature of webpack, I have set up my configuration like so: { devtool: 'eval-source-map' } This appears to work fine and I can see that my source code is being wrapped within eval() functions and that a base64 source map is appended to the end. However my errors are not being mapped to the source (Chrome developer tools), instead I am getting errors like the following: ReferenceError: _ is not defined at eval (eval at &lt;anonymous&gt; (http://localhost:8080/build/abc.js:78:2), &lt;anonymous&gt;:125:21) Where abc.js is the name of my built and concatenated file. Clicking the error to the view the source just takes me to the eval function like so: eval("var __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {\n /** @type {angular.Module} */\n return angular.module('utils', []);\n}.call(exports, __webpack_require__, exports, module)), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined &amp;&amp; (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n// Load exports\n__webpack_require__(6);\n//@ sourceMappingURL=[binary]"); If I decode the base64 I can see that the source maps it is generating appear to be valid: { "version":3, "sources":[ "./modules/utils/src/module.js" ], "names":[ ], "mappings":"kCAAA;AACA,aAAa,eAAe;AAC5B;AACA,CAAC;;AAED;AACA", "sourcesContent":[ "define(function() {\n /** @type {angular.Module} */\n return angular.module('utils', []);\n});\n\n// Load exports\nrequire('./exports/core');\n" ], "sourceRoot":"webpack-module://" } Does anyone know why these source maps don't appear to be working? The webpack documentation is still a bit ambiguous in areas. Please not I am only using eval-source-map in development and a seperate map file is generated for production (which also does not work).
tagged with: webpack
answer count: 1
downvote count: 0
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/31286391
favorite count: 0
has title: webpack source maps are anonymous
tagged with: node.js
linked to: http://stackoverflow.com/q/25425072
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39664017

http://stackoverflow.com/a/24763192
type: Answer
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/24762893
has comment: http://stackoverflow.com/comment/38423431
has body: I think you're trying to show divs with ids "result"+IdInfo where your div ids are container1, container2 and container3, so you should replace: document.getElementById('result'+idInfo).style.display = 'block'; for document.getElementById('container'+idInfo).style.display = 'block'; Also keep in mind that loading all the forms in the html (even if they are hidden) is not a good practice, so someone could see what he doesn't have to (and also can submit it). Consider to use some dynamic language (such PHP) to load only the form needed as the user type.

http://stackoverflow.com/q/24863343
type: UnansweredQuestion
has body: does AJAX use XML parser? if yes where it uses it? I think the java-script engine on the client side use the DOM parser to retrieve the required information from the received XML document which is received from the server. Am I right or AJAX does not use XML parser at all!
type: Question
tagged with: xml-parsing
answer count: 1
tagged with: javascript
has title: does AJAX use XML parser?
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/24863761
tagged with: http://stackoverflow.com/tag/xml
has comment: http://stackoverflow.com/comment/38612347

http://stackoverflow.com/comment/38630665
type: AnswerComment
score: 0
type: Comment
has text: I have read somewhere that iOS treat localStorage as temporary. It'll wipe out the localStorage if it needs that memory. @AndrewMcGivery
comment on: http://stackoverflow.com/a/24851397

http://stackoverflow.com/comment/45841209
type: Comment
comment on: http://stackoverflow.com/a/28707474
score: 0
type: AnswerComment
has text: I cannot store he response for future use because the application architecture is such that I can have only 1 form tag at a time.

http://stackoverflow.com/a/24796483
answers question: http://stackoverflow.com/q/24796443
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38486541
type: Answer
has comment: http://stackoverflow.com/comment/38486435
downvote count: 0
score: 1
has body: My first thought would be to use Array.prototype.filter(): var filteredArray = ["Criteria.Make=scion", "Criteria.ModelName=xb", "Criteria.PriceMax=4000", "Criteria.ZipCode=23212", "Criteria.MaxDistance=50"].filter(function(a){ return a.indexOf('Criteria.PriceMax') &lt; 0; }); // returns: ["Criteria.Make=scion", "Criteria.ModelName=xb", "Criteria.ZipCode=23212", "Criteria.MaxDistance=50"] JS Fiddle demo. References: Array.prototype.filter().
has comment: http://stackoverflow.com/comment/38486761
has comment: http://stackoverflow.com/comment/38486650
accepted answer of: http://stackoverflow.com/q/24796443

http://stackoverflow.com/q/24770009
tagged with: asynchronous
tagged with: callback
favorite count: 0
has answer: http://stackoverflow.com/a/24770165
has title: jQuery.noConflict() while loading jQuery asynchronously
type: UnansweredQuestion
score: 3
has body: I am writing a Javascript library that requires jQuery 1.7 or higher. However, users of my library could be loading their own version of jQuery on their websites, which we can't control. Right now, I am loading jQuery asynchronously with a callback in my library, and using jQuery's noConflict(true) method to deal with version conflicts. I have not come across any issues so far, but problems relating to asynchronous behavior and concurrency are random and very difficult to test. I am not very familiar with the details of asynchronous functions in Javascript, so I want an explanation. Let's say I have the following code: Code on user's website: // loading javascript library &lt;script type="text/javascript" src="library.js"&gt; // loading jQuery version lower than 1.7.0 &lt;script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.2.3/jquery.min.js"&gt; Code in library for loading jQuery asynchronously: // set jQuery and $ to $j using noConflict() loadScript("//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js", function() { $j = jQuery.noConflict(true); }); function loadScript(url, callback){ var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = url; script.onreadystatechange = callback; script.onload = callback; head.appendChild(script); } As I understand it, the user's page will first load my library's code, which will begin to load jQuery 1.11.1 asynchronously and use jQuery.noConflict(true) to rename the jQuery and $ global variables. The page will then continue to load jQuery 1.2.3 on the original page. So jQuery and $ should refer to 1.2.3, while $j will refer to 1.11.1. However, is it possible for $j to ever point to 1.2.3 instead of 1.11.1 due to the asynchronous loading of jQuery or multithreading in browsers? For example, can the line that loads jQuery 1.2.3 be executed right before $j = jQuery.noConflict(true), so that $j would now point to…
upvote count: 3
type: Question
linked to: http://stackoverflow.com/q/1014203
tagged with: javascript
tagged with: jquery
downvote count: 0
answer count: 1

http://stackoverflow.com/q/24842616
answer count: 2
has body: I'm building a site using Joomla 3.3.1, and I'd like an alert box to pop up whenever users first visit the site (and not pop up on subsequent page clicks or when refreshing the page). The alert box should say "By visiting this page, you agree to its Terms of Service" with "Terms of Service" being a link to a specific page. And users can click OK. I'm very new to JavaScript, but I tried the code below: &lt;script&gt; function TOS(){ alert("By visiting this page, you agree to its Terms of Service."); } TOS(); &lt;/script&gt; Unsurprisingly, this made the alert pop up anytime I clicked on anything on the page. I also tried calling the function in the with onload, but I got similar results. Any guidance or references you can provide would be much appreciated!
favorite count: 0
tagged with: joomla
has title: Terms of Service Javascript Alert Box
type: UnansweredQuestion
upvote count: 2
score: 1
linked to: http://stackoverflow.com/q/4825683
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/24842872
has answer: http://stackoverflow.com/a/24842716
tagged with: javascript

http://stackoverflow.com/a/24783075
answers question: http://stackoverflow.com/q/24783045
upvote count: 1
has body: These articles might help you: http://briantford.com/blog/huuuuuge-angular-apps http://cliffmeyers.com/blog/2013/4/21/code-organization-angularjs-javascript Also read this answer. I mostly choose the Modular approach.
downvote count: 0
type: AcceptedAnswer
score: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/24783045

http://stackoverflow.com/comment/38460015
comment on: http://stackoverflow.com/q/24762682
score: 0
type: Comment
type: QuestionComment
has text: try adding both images and using the 'visible' property to change which one shows

http://stackoverflow.com/a/24883170
has comment: http://stackoverflow.com/comment/38674953
type: Answer
has comment: http://stackoverflow.com/comment/38674214
score: 3
has comment: http://stackoverflow.com/comment/38679581
downvote count: 0
has comment: http://stackoverflow.com/comment/38674593
has body: You can do something like this: function relocateLockedTips(dataSets) { // get coordinates from graph, replace "graph" with your id var graphX = $('#graph').offset().left; var graphY = $('#graph').offset().top; // loop over all data series for (var i = 0; i &lt; lockedPoints.length; i++) { // loop over locked points for this series for (var j = lockedPoints[i].length -1; j &gt;= 0; j--) { var point = lockedPoints[i][j]; // if point is out of zoom range, remove it if (point.datapoint[0] &lt; minX || point.datapoint[0] &gt; maxX || point.datapoint[1] &lt; minValue || point.datapoint[1] &gt; maxValue) { $('#lockedPoint' + point.dataIndex).remove(); lockedPoints[i].splice(j); } else { // move tooltip to new coordinates var newCoords = { left: graphX + dataSets[i].xaxis.p2c(point.datapoint[0]), top: graphY + dataSets[i].yaxis.p2c(point.datapoint[1]) }; $('#lockedPoint' + point.dataIndex).offset(newCoords); } } } } PS: Shouldn't the tooltip id also include the seriesIndex? As it is now the tooltip for a point from another series with the same dataIndex could overwrite an existing tooltip.
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24879551
has comment: http://stackoverflow.com/comment/38668667
answers question: http://stackoverflow.com/q/24879551
upvote count: 3

http://stackoverflow.com/comment/38577057
score: 0
type: Comment
type: QuestionComment
has text: While that is the output he's going to get with this solution, he said he doesn't want it to be random.
comment on: http://stackoverflow.com/q/24844821

http://stackoverflow.com/comment/133733544
has text: All declarations (variables and functions) are hoisted.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24902689

http://stackoverflow.com/comment/38605998
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24839853
score: 1
has text: Well, you can use any way you like to slap new properties onto an existing object. `ko.utils.extend()` is just a convenience method, like jQuery's `.extend()`. You could also make a wrapper viewmodel that contains an instance of `PageSectionVM`. Or you write `PageSectionVM`'s constructor in a way that it recognizes what kind of arguments you give it and build different objects depending on that. Or you use KO's mapping plugin to make the constructor fully dynamic.

http://stackoverflow.com/q/24788012
answer count: 1
has comment: http://stackoverflow.com/comment/38470653
has comment: http://stackoverflow.com/comment/38472613
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38472570
has comment: http://stackoverflow.com/comment/38472817
has comment: http://stackoverflow.com/comment/38472917
score: 0
has comment: http://stackoverflow.com/comment/38470934
has comment: http://stackoverflow.com/comment/38472409
accepted answer: http://stackoverflow.com/a/24789351
has comment: http://stackoverflow.com/comment/38472008
has comment: http://stackoverflow.com/comment/38470788
has comment: http://stackoverflow.com/comment/38472736
has comment: http://stackoverflow.com/comment/38472972
linked to: http://stackoverflow.com/q/24747266
has body: I've got a page where I have 2 sets of checkboxes. When a checkbox on the bottom in Set 2 gets checked off it checks off its corresponding checkbox in the set 1 above it. Here's the thing, I have an "Add" button under the first set 1 of checkboxes that duplicates the set 2 of checkboxes. However, this is only to add another line item to a specific department. So a user can issue a workorder with multiple tasks for multiple departments attached to it. SEE EDIT FOR DETAILED EXPLANATION. The problem now is that the first lineup item check offs work but any other lineup item I add doesn't work when checking off. $('.cad, .design, .shop, .cnc').on('change', function() { // Split into space-delimited array in case we want // to check off more than one var elemsToCheck = $(this).data('check').split(' '); var checked = $(this).attr('checked'); $.each(elemsToCheck, function() { $('#' + this).attr('checked', !!checked); }); }); You can take a look at my jquery in this jsfiddle for code to see what I tried: http://jsfiddle.net/Bg5Uk/ EDIT: Going to try to explain how this works again. A tool (lets call it Tool X) is ready to be kicked off and manufactured so a manager has to submit a work order to his employees. The manager will create a work order for Tool X and will be presented with something similar to the form in my fiddle. Now, the manager wants multiple "Tasks" (Lineups) completed for Tool X and each "Task" will be assigned to a separate department. The manager starts filling out Task 1 (Lineup #1) and once completed, he checks off C - CAD on the lineup. This will check off CAD in the above set. So, the workorder will now notify the CAD department of the Workorder so they can start the work. The manager isn't done, now he wants to fill out 2 more Tasks. He'll have to click the "ADD" button at the bottom of the form to add another TASK form (Line up #2). He fills it out and checks off M - CNC and S - SHOP which will check off CNC and SHOP in the first set of checkboxes a…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38472457
has answer: http://stackoverflow.com/a/24789351
type: Question
has title: Check and uncheck a checkbox when another is clicked
has comment: http://stackoverflow.com/comment/38472713
has comment: http://stackoverflow.com/comment/38470614

http://stackoverflow.com/comment/38507198
type: Comment
type: QuestionComment
has text: What does the parseMondial function look like?
comment on: http://stackoverflow.com/q/24803832
score: 0

http://stackoverflow.com/q/24890087
has answer: http://stackoverflow.com/a/24890165
has title: Javascript for loop that yields the object, not the object index
has comment: http://stackoverflow.com/comment/38663409
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/24890545
tagged with: javascript
has comment: http://stackoverflow.com/comment/38663277
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/500504
has comment: http://stackoverflow.com/comment/38663421
type: UnansweredQuestion
has body: Is there a short hand notation for iterating through a javascript array that yields the actual object, instead of the index of the object? For example: var dataset = ['a','b','c'] for (item in dataset){ console.log(item); } I want to log 'a','b','c' -- not 0,1,2. My reason for not wanting to use dataset[item] is that I have several nested for loops, and the code is getting very verbose.

http://stackoverflow.com/comment/38536090
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/24822600
has text: @ServerHalilov: yep, `$('#newWrapper img')` works fine on `'/category/page-2/'`

http://stackoverflow.com/a/24752047
type: Answer
has body: In Javascript, functions are first class objects and hence can be passed around as objects. Here the containing function is fs.stat and since the containing function has the callback function in its parameter as a function definition, it can execute the callback anytime. // A function that takes two parameters, the last one a callback function function getInput (options, callback) { allUserData.push (options); callback (options); } As you can see, in the above example, getInput provides the parameters to the callback. Hope this explanation helps
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38402696
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24751875
has comment: http://stackoverflow.com/comment/38402895
answers question: http://stackoverflow.com/q/24751875

http://stackoverflow.com/comment/38544485
score: 0
type: AnswerComment
has text: @Anoop Joshi: Fixed now. I changed the wrong line before (PS. I hit enter on comment too soon before, hence "working" came up) :)
comment on: http://stackoverflow.com/a/24827183
type: Comment

http://stackoverflow.com/comment/38730309
comment on: http://stackoverflow.com/q/24905274
type: Comment
type: QuestionComment
has text: no fiddle in not giving this error.
score: 1

http://stackoverflow.com/a/24854302
score: 1
has comment: http://stackoverflow.com/comment/38595517
downvote count: 0
has body: this.focus(); and this.select(); will only work for input and textarea. Here is a simple way: Assign contenteditable attribute to that particular element. If user set focus into editable div then content of editable div is selected. some text some text: when you hover over therer, it gets selected JSFiddle Demo
answers question: http://stackoverflow.com/q/24854254
type: Answer
upvote count: 1

http://stackoverflow.com/q/24907879
has body: I have a View which contains collection. I want: handle collection add event inside a View. Question: How to handle add event inside View? Code: var MyView = Backbone.View.extend({ collection: null, subViews: [], setCollection: function(collection) { this.collection = collection; }, // HOW TO CALL THIS FUNCTION ON COLLECTION ADD EVENT? handleCollectionAdd: function(model) { X = .... subViews[X] = new SubView(model); } });
has answer: http://stackoverflow.com/a/24908073
tagged with: javascript
score: 0
has title: Backbone: invoke containing view's function on ADD event
answer count: 1
tagged with: backbone.js
accepted answer: http://stackoverflow.com/a/24908073
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/24779234
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/24779327
has body: I need to fetch data from and external API. Since I have to make the call again and again to check the status until the status is TRUE, I have placed it in a recursive loop. I need to know what's wrong with my logic, because I'm unable to get the desired output. Does the response.status update itself or do i need to make another ajax like how I have done in the code fetchFunct(); function fetchFunct(){ console.log("entered function"); $.ajax ({ type: "GET", url: "/content/mosaic/multi/preview/status/"+testId , async: false, dataType : "json", success : function(response) { console.log(response); if(response.status === false) { console.log("Processing details"); //show still in progress $("#load").show(); $("#heading").hide(); $("#b1").hide(); $("#b2").hide(); $("#b3").hide(); $("#b4").hide(); $("#b5").hide(); }else { $("#load").hide(); console.log("Loading 1"); $("#b1").click(function(){ $("#ad22img").attr("src","http://" + response.images.android22);}) console.log("Loading 2"); $("#b2").click(function(){$("#ad4img").attr("src","http://" + response.images.android4);}) console.log("Loading 3"); $("#b3").click(function(){ $("#apm6img").attr("src","http://" + response.images.appmail6);}) console.log("Loading 4"); $("#b4").click(function(){ $("#blbimg").attr("src","http://" + response.images.blackberryhtml);}) console.log("Loading 5"); $("#b5").click(function(){$("#iphnimg").attr("src","http://" + response.images.iphone5s);}) is_loaded = true; } } }).fail(function(data) { console.log("FAIL"); }).done(function(data) { console.log("coming out of ajax"); }); if(!is_loaded) { console.log("entered if"); delay=delay*2; if(delay&gt;60) {delay=1;} setTimeout(fetchFunct,delay*1000); } //console.log("if not entered"); }
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24779327
has title: Error on recursive method call
answer count: 1
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/38453062

http://stackoverflow.com/a/24788082
has comment: http://stackoverflow.com/comment/38471180
answers question: http://stackoverflow.com/q/24766155
has comment: http://stackoverflow.com/comment/38471633
has body: To change the width of the image to a fixed block width of 200, change your size definition to: width: 200, height: size[1]*200/size[0] This will preserve the aspect ratio while resizing the image to the proper width. Note that it is possible that the resulting image will be taller than the height specified. If the original image is 100x200, the resulting resized image will be 200x400. This is unavoidable, given the problem constraints.
has comment: http://stackoverflow.com/comment/38471602
has comment: http://stackoverflow.com/comment/38471392
has comment: http://stackoverflow.com/comment/38472341
has comment: http://stackoverflow.com/comment/38472013
type: Answer
has comment: http://stackoverflow.com/comment/38471720
score: 0

http://stackoverflow.com/a/24766515
has comment: http://stackoverflow.com/comment/38429594
downvote count: 0
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38429664
accepted answer of: http://stackoverflow.com/q/24766402
type: Answer
answers question: http://stackoverflow.com/q/24766402
score: 2
has body: So you're close but you've got some things you need to adjust. Ajax is async which means that you're waiting on a server response. You need to fill your data once you have that piece of data. Note you will not be able to reference fbjson until AFTER the getJSON has fired and completed. According to the jQuery documentation for getJSON you need to have a callback similar to this - var fbuid = 'zuck'; var fbjson; $.getJSON( "https://graph.facebook.com/"+fbuid, function( data ) { fbjson = data; }); Notice I assign the fbjson in the callback to data which is the server response. now you can reference it as fbjson.id

epub
type: Tag
tags question: http://stackoverflow.com/q/24812358
tags question: http://stackoverflow.com/q/24796595
tag name: epub

http://stackoverflow.com/comment/38418581
comment on: http://stackoverflow.com/q/24760680
type: QuestionComment
type: Comment
has text: I would think you need to include jquery before jcarousel
score: 1

http://stackoverflow.com/q/24882346
tagged with: javascript
tagged with: jquery
has body: I'm creating a list of clickable divs to show a pop up window with the information relative to the clicked item. Every list item is assuming the 'on click' function of the last item of the list. When I remove the last item then they all assume the 'on click' function of the new last item. (ex: I click on any item on the list and a pop window appears with the info about the last item. I remove it by clicking the button 'approve'. When i click on any item now a pop window will appear with the info of the new last item) What I want is for it to show the info of the clicked item. HTML Absence to Approve Reject Approve JS function getAbsencesToApprove_success(tx, results) { var len = results.rows.length; if(internetStatus != 'none') $('#absencesToApproveList').empty() for (var i=0; i<len; i++) { var absence = results.rows.item(i); var absenceType = absence.type; var absenceText = absence.note; var absenceDateFrom = absence.absenceFrom; var absenceDateTo = absence.absenceTo; var yyyy = absenceDateFrom.split("-")[0]; var mm = absenceDateFrom.split("-")[1]; var dd = absenceDateFrom.split("-")[2]; var newAbsenceBox = $('<div class="absenceBox" style="border: 2px solid black; position:relative;" ') .append($('<div class="absenceDateBox" style="border: 2px solid black;" ') .append('<span style="display: inline-block;vertical-align: middle; line-height: normal;" </span ').text(dd + "/" + mm)) .append($('<p class="absenceText" ').text(absenceText)); var newAbsenceBoxItem = $('<li id="absence' + absence.id + 'Item" style="margin-left:-35px;" ').append(newAbsenceBox) $('#absencesToApproveList').append(newAbsenceBoxItem) $('#absence' + absence.id + 'Item').click(function(){ $('.absencePhoto').text('photo' + absence.id) $('.noteAbsence').text(absenceText) $('#addAbsenceBoxOuter2').show() $('.approveAbsenceBox').show() $('#rejectAbsence').click(function () { $('#addAbsenceBoxOuter2').hide() $('.approveAbsenceBox').hide() $('.absencePhoto').empty() $('.noteAbsence').empty() }) $('#app…
has comment: http://stackoverflow.com/comment/38648671
has comment: http://stackoverflow.com/comment/38651378
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/24884117
downvote count: 0
has comment: http://stackoverflow.com/comment/38649462
favorite count: 0
has comment: http://stackoverflow.com/comment/38648703
has comment: http://stackoverflow.com/comment/38649920
has title: Clickable - click function of the last item spreading to other items
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38648681
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/24884117
type: Question

http://stackoverflow.com/q/24864034
answer count: 1
has comment: http://stackoverflow.com/comment/38640966
has comment: http://stackoverflow.com/comment/58441964
has comment: http://stackoverflow.com/comment/38614827
has body: I have a strange problem and it is hard to explain. Still I will go ahead and try it. What is happening is I have an infinite scroll logic, where I load more content when user scrolls to the bottom of the page and if the no of DOM elements increases beyond a certain limit, I remove an equal chunk of DOM element from the top, to keep the no of DOM elements in the page constant and to keep the memory in check. Now, when I add new elements at the bottom and remove old elements from the top, I have to set the scrollTop position of the scrollable element (the parent container) explicitly just to maintain the user's scroll position. I am using Jquery's scrollTop() method call to set the scroll position at the moment. As soon as I update the scroll position with a call to scrollTop() the page flickers and I can see a white patch for a brief moment on iOS devices. This happens even with the native Javacript scrollTop property. The issue is seen only on iOS webkit browsers(both webviews and browsers on devices as well as simulator) and I am not seeing the same issue on Android webviews. Even on desktop browsers, it runs just fine including Safari. The code that I am writing is meant to be a bi-directional infinite scrolling but for this question I am only posting the code for downward scrolling. Here is the code snippet -
type: UnansweredQuestion
has title: Infinite Scroll Flickering on iOS webkit browser when setting scrollTop explicitly
tagged with: scrolltop
has comment: http://stackoverflow.com/comment/38643658
type: Question
tagged with: ios
has comment: http://stackoverflow.com/comment/38648312
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29325476
score: 0

http://stackoverflow.com/comment/38454625
type: Comment
comment on: http://stackoverflow.com/a/24779852
has text: Well, looks like I'd better write about `document.ready` there rather than create own answer
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38576184
type: QuestionComment
has text: @Gor81 can you share your modal instance template ie dialog.html
comment on: http://stackoverflow.com/q/24844385
score: 0
type: Comment

http://stackoverflow.com/a/24795072
has body: like this: working demo => http://jsfiddle.net/vLtgk/ :) you need to unbind the contextmenu : http://api.jquery.com/unbind/ Lemme know if I misunderstood anything, but this will fit you needs :) code $(document).unbind("contextmenu"); full code if ( $("#tm").prop('checked') === true ) { // Trigger action when the contexmenu is about to be shown $(document).bind("contextmenu", function (event) { // Avoid the real one event.preventDefault(); $("#custom-menu").hide(100); // Show contextmenu if ($("#showcustom-menu").show() === true) { $("#custom-menu").hide(100). // In the right position (the mouse) css({ top: event.pageY + "px", left: event.pageX + "px" }); } else { $("#custom-menu").show(100). // In the right position (the mouse) css({ top: event.pageY + "px", left: event.pageX + "px" }); } }); // If the document is clicked somewhere $(document).bind("mousedown", function () { $("#custom-menu").hide(100); }); $("#custom-menu li").click(function(){ // This is the triggered action name switch($(this).attr("data-action")) { // A case for each action. Should personalize to your actions case "duplicate": alert("duplicate called"); break; case "remove": alert("remove called"); break; case "deselect": alert("deselect called"); break; } }); } else { $(document).unbind("contextmenu"); } $("#tm").on('change', function() { if ( $(this).prop('checked') === true ) { // Trigger action when the contexmenu is about to be shown $(document).bind("contextmenu", function (event) { // Avoid the real one event.preventDefault(); $("#custom-menu").hide(100); // Show contextmenu if ($("#custom-menu").show() === true) { $("#custom-menu").hide(100). // In the right position (the mouse) css({ top: event.pageY + "px", left: event.pageX + "px" }); } else { $("#custom-menu").show(100). // In the right position (the mouse) css({ top: event.pageY + "px", left: event.pageX + "px" }); } }); // If the document is clicked somewhere $(document).bind("mousedown", function () { $("#custom-menu").hide(100);…
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24795039
has comment: http://stackoverflow.com/comment/38483890
has comment: http://stackoverflow.com/comment/38483879
accepted answer of: http://stackoverflow.com/q/24795039
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/24780580
has comment: http://stackoverflow.com/comment/38457232
has comment: http://stackoverflow.com/comment/38455803
has comment: http://stackoverflow.com/comment/38456359
tagged with: checkbox
has comment: http://stackoverflow.com/comment/38456824
has comment: http://stackoverflow.com/comment/38455998
answer count: 0
has comment: http://stackoverflow.com/comment/38456692
type: Question
has comment: http://stackoverflow.com/comment/38456336
has comment: http://stackoverflow.com/comment/38456633
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38455846
has comment: http://stackoverflow.com/comment/38457273
score: 0
has comment: http://stackoverflow.com/comment/38455762
has comment: http://stackoverflow.com/comment/38456804
has comment: http://stackoverflow.com/comment/38455709
has title: JQuery. CheckBoxes in a table
has comment: http://stackoverflow.com/comment/38456508
has comment: http://stackoverflow.com/comment/38456918
has comment: http://stackoverflow.com/comment/38457903
has body: &lt;script type="text/javascript"&gt; var button = document.getElementById("button"); button.addEventListener("click", function (){ $('.checkbox').each(function(){ if ($(this).prop("checked")) { window.open("[@spring.url "/visit/publicate?id=" + item.visit.id/]"); visit_id="${item.id}"; } }); }, false); &lt;/script&gt; I have a big table. Each lane contains checkbox and some URL(each lane contains different URL). If checkbox in some lane has a value "checked", browser should open URL from this lane. My script always return me URL from the first lane of the table. why?
type: UnansweredQuestion

http://stackoverflow.com/q/24773577
answer count: 3
possible better answer: http://stackoverflow.com/a/24774175
has title: Unchecking checkbox value using javascript and jquery
tagged with: checkbox
has comment: http://stackoverflow.com/comment/38442701
has answer: http://stackoverflow.com/a/24792546
type: AnsweredQuestion
has body: I am generating 5 checkboxes dynamically. I can select upto 3 checkboxes. Once 3 checkboxes are selected, If I try to select one more checkbox it should give an alert and once i click ok on the alert box the fourth checkbox that I have selected should be unchecked. Code I am using for generating checkboxes dynamically $("#catalog_table").append(' '+productCatalog[i].productCode+' '+productCatalog[i].productName +' '); I tried number of ways...but all are getting unchecked.Can anyone tell me how to do this.
tagged with: alert
has comment: http://stackoverflow.com/comment/38443533
has comment: http://stackoverflow.com/comment/38443554
has answer: http://stackoverflow.com/a/24774202
type: Question
has comment: http://stackoverflow.com/comment/38443783
accepted answer: http://stackoverflow.com/a/24774202
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24774175
linked to: http://stackoverflow.com/q/18699839
score: 0

http://stackoverflow.com/q/24877377
linked to: http://stackoverflow.com/q/1106377
linked to: http://stackoverflow.com/q/2343418
linked to: http://stackoverflow.com/q/19041447
has comment: http://stackoverflow.com/comment/38639795
has answer: http://stackoverflow.com/a/24877737
has comment: http://stackoverflow.com/comment/38639771
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has body: The HTML looks like this: Download I want to display a loading icon on the page, and hide it after the file starts to download. The JavaScript looks like this: $.fancybox.showLoading(); // after download started when_download_started( function(){ $.fancybox.hideLoading(); }); Is there any event that is triggered when a download starts? Thanks!
has comment: http://stackoverflow.com/comment/38639713
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38639743
has title: How to monitor html a download event?
has comment: http://stackoverflow.com/comment/38640117
score: 2
upvote count: 2
type: UnansweredQuestion
type: Question

http://stackoverflow.com/a/24846129
has body: Note: For some dumb reason, I assumed jQuery (note that you do not need jQuery for this, but makes it a little easier). Here is one solution uses a combination of text-indent and an absolutely positioned &lt;span&gt; (for the prefix part). Demo: http://jsfiddle.net/4YzZy/ $('textarea.withprefix').each(function() { var prefix = $('&lt;span/&gt;') .text($(this).data('prefix')) .addClass('prefix') .appendTo('body') .css({ left: $(this).position().left + 'px', top: $(this).position().top + 'px', }); $(this).css({textIndent: prefix.outerWidth() + 'px'}); }); textarea, span.prefix { font-family: arial; /* change these as needed, but ensure that the textarea and the span use the same font */ font-size: 1em; font-weight: normal; padding: 2px; border-width: 1px; } span.prefix { position:absolute; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;textarea class="withprefix" data-prefix="Hi There, "&gt;&lt;/textarea&gt;
type: Answer
upvote count: 4
downvote count: 0
answers question: http://stackoverflow.com/q/24846041
has comment: http://stackoverflow.com/comment/38579531
score: 4
accepted answer of: http://stackoverflow.com/q/24846041
type: AcceptedAnswer

http://stackoverflow.com/q/24872987
tagged with: grouping
tagged with: momentjs
accepted answer: http://stackoverflow.com/a/24873195
type: Question
type: AnsweredQuestion
tagged with: filtering
has title: Hiding the grouping header when filtering grouped contents with Angularjs
has body: I have a grouped list of contents which is grouped based on date: 2014/7/21 100: 2014/7/21 05:30 101: 2014/7/21 05:30 2014/7/22 102: 2014/7/22 05:30 103: 2014/7/22 05:30 104: 2014/7/22 05:30 2014/7/23 105: 2014/7/23 05:30 106: 2014/7/23 05:30 107: 2014/7/23 05:30 2014/7/24 108: 2014/7/24 05:30 I also have a selection filter that allows user to select the ID (100~ 108). Let's say if the user select 101 and then the filtered content will look like this: 2014/7/21 101: 2014/7/21 05:30 2014/7/22 2014/7/23 2014/7/24 Therefore, I'm wondering is there's a way to dynamically hide/show the header when applying filter? JsFiddle: http://jsfiddle.net/4D3Jw/5/ View All {{option_ID.id}} {{item.id}}: Controller var app = angular.module('myApp', []); app.controller('GroupController', function ($scope) { var myLogs = [{ id: 100, datetime: "2014-07-21T17:30:00" }, { id: 101, datetime: "2014-07-21T17:30:00" }, { id: 102, datetime: "2014-07-22T17:30:00" }, { id: 103, datetime: "2014-07-22T17:30:00" }, { id: 104, datetime: "2014-07-22T17:30:00" }, { id: 105, datetime: "2014-07-23T17:30:00" }, { id: 106, datetime: "2014-07-23T17:30:00" }, { id: 107, datetime: "2014-07-23T17:30:00" }, { id: 108, datetime: "2014-07-24T17:30:00" }]; $scope.options = _.uniq(myLogs, 'id'); $scope.logs = _.chain(myLogs).groupBy(function (log) { var moment_log_datetime = moment(log.datetime, "YYYY-MM-DD"); return (moment_log_datetime.format("YYYY-MM-DD")); }).pairs().map(function (currentItem) { return _.object(_.zip(["dateheader", "items"], currentItem)); }).value(); }) app.filter('moment', function () { return function (dateString, format) { return moment(dateString).format(format); }; }); app.filter('IDFilter', [function () { return function (myLogs, ID) { if (!angular.isUndefined(ID) && !angular.isUndefined(myLogs)) { if(ID != ""){ var logs = _.filter(myLogs, function (log) { return log.id == ID }); return logs; } else{ retu…
has answer: http://stackoverflow.com/a/24873195
answer count: 1
tagged with: javascript
score: 0
tagged with: angularjs

http://stackoverflow.com/comment/38675007
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24896205
has text: @Danny Yes that is exactly what I want to find out.

http://stackoverflow.com/q/24781535
has comment: http://stackoverflow.com/comment/38457865
has body: I'm using the following code to limit entry on some inputs to integers only. This works fine in all the browsers I have tested with the exception of Firefox. In Firefox when you hold CTRL then press A, C or V the function returns false. How can I permit the multiple keypress event with Firefox to allow for these actions without allowing A, C and V through on other browsers? //Validate integers only function integersonly(myfield, e) { var key; var keychar; if (window.event) { key = window.event.keyCode; } else if (e) { key = e.which; } else { return true; } keychar = String.fromCharCode(key); if (iscontrolkey(key)) { return true; } else if ((("0123456789").indexOf(keychar) &gt; -1)) { return true; } else { return false; } } function iscontrolkey(key) { if ((key == null) || (key == 0) || (key == 8) || (key == 9) || (key == 13) || (key == 27) || (key == 63232) || (key == 63233) || (key == 63234) || (key == 63235) || (key == 63272)) return true; }
tagged with: validation
has comment: http://stackoverflow.com/comment/38461097
has comment: http://stackoverflow.com/comment/38458032
answer count: 0
type: UnansweredQuestion
has title: Validation to allow Ctrl + V for Firefox but restrict V independently
has comment: http://stackoverflow.com/comment/38458992
type: Question
tagged with: firefox
tagged with: javascript
score: 0

http://stackoverflow.com/comment/38668311
comment on: http://stackoverflow.com/a/24892359
type: Comment
has text: now this will not be considered end tag @Quentin ? need little elaboration please
score: 0
type: AnswerComment

http://stackoverflow.com/q/24869851
has comment: http://stackoverflow.com/comment/38625284
upvote count: 2
tagged with: toggle
score: 2
type: AnsweredQuestion
has title: jQuery .slideToggle change 'x' class background when toggled
accepted answer: http://stackoverflow.com/a/24870060
tagged with: nav
tagged with: navigation
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has body: So for the last two hours or so I have been trying to execute a piece of code and so far everything is working except one key component. On 'header .menu a' click the 'navigation' is supposed to slide down and display all of the links. I also want the '.menu' class to have its background set to '#3D3D3D' when the 'navigation' is down and turn into background 'whitesmoke' afterwards. I have been trying 'addClass' and 'removeClass' on the handlers of the '.slideToggle'. $( 'header .menu a' ).click( function() { $( 'header nav' ).slideToggle( 'fast', function() { console.log('Toggle works'); }); }); I am sorry if this is a dumb question. I have limited jQuery experience and I am eager to learn from you guys. Here is the Fiddle for the js, css and html. Cheers!
favorite count: 0
has answer: http://stackoverflow.com/a/24870060

http://stackoverflow.com/a/24847209
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24847115
has body: Blur event fire only when control lose focus, use keydown event or input event instead. You probably don’t want interrupt while user is typing, setup a timer do formatCurrentcy when no keydown for a while.
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24847115

http://stackoverflow.com/q/24768915
upvote count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/24771175
has body: I cannot show an error message when validation the first field in this example. Only the second field show up the message. Could you tell me what is wrong in my code? http://plnkr.co/edit/OXtrm9skUUe1D6e8F8gw?p=preview var app = angular.module('plunker', []); app.directive('gaTime', function () { var EMAIL_REGX = /^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$/; return { restrict: 'E', scope: { timeInfo: '=info' // Unique to directive scope }, template: ' ' }; }); app.controller('MainCtrl', function($scope) { // Default values $scope.operativeFromTime = '00:00:00'; $scope.operativeToTime = '23:59:59'; }); +++ INVALID FROM. +++ INVALID TO.
tagged with: angularjs
has title: Issue with ng-show in angular
has answer: http://stackoverflow.com/a/24771175
type: AnsweredQuestion
downvote count: 0
score: 1
possible better answer: http://stackoverflow.com/a/24769479
type: Question
has answer: http://stackoverflow.com/a/24769479
tagged with: angularjs-directive
answer count: 2
tagged with: javascript

http://stackoverflow.com/q/24887686
has comment: http://stackoverflow.com/comment/38661631
has body: I have a ViewModel with a function that does something on click function viewModel() { var.self = this; self.printFoo = function() { console.log(this); .... } self.fooArray = ko.observableArray( [ "foo", "bar" ]); } The HTML has a foreach: fooArray with each elements having a click: printFoo binding to call the function. How can i write a testcase for printFoo with sensible Values for this? I think i have to extract the ViewModel somehow. Any ideas?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38661086
answer count: 0
has comment: http://stackoverflow.com/comment/38665645
tagged with: knockout.js
tagged with: unit-testing
has comment: http://stackoverflow.com/comment/38666546
type: Question
has comment: http://stackoverflow.com/comment/38664191
has title: knockoutjs: Writing unit-test for viewModel
score: 0
has comment: http://stackoverflow.com/comment/38696584
tagged with: javascript

http://stackoverflow.com/q/24888012
score: 0
has answer: http://stackoverflow.com/a/24888533
answer count: 1
has comment: http://stackoverflow.com/comment/38659365
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24888533
has body: I want to load the contents of my web page's menu-bar by a URL. (This URL results in downloading a file with .slt file extension) URL: https://drive.google.com/file/d/0BxgoZYVaFm3ecFRGYThjcE85OUU/edit?usp=sharing The "content.slt" file contains { "list": [ { "productName": "bulb", "Code": "130", "levelNumber": 2, "itemId": 0 }, { "productName": "switch", "Code": "131", "levelNumber": 6, "itemId": 0 }, { "productName": "fan", "Code": "132", "levelNumber": 3, "itemId": 0 } ] } And I have used my java script like this $(document).ready(function () {' $.getJSON("https://www.******************", function(data) { $.each(data.list, function (i, list) { var option = '&lt;li class="list_1"&gt;&lt;a href="#"&gt;' + list.productName + '&lt;/a&gt; &lt;/li&gt;'; $(option).appendTo('#product_details'); }); }); }); Here i want to Load the productnames to my menu-bar directly from the URL. with this above approach i am not getting the productName inside my menu-bar.
type: Question
tagged with: javascript
has title: How to get a json object from servlet(.slt) in javascript

http://stackoverflow.com/q/24817093
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: Well i think .child() function is my problem... But im not sure about this. I have this in html 1st level link 1st level link 1st TEXT 2nd level link 2nd level link 1st TEXT One element with class "tabs" inside another... ok; in JS: $(function($) { var Tabs = function(element,options){ self = this; self.$element = element; self.testdrive = function (){ console.log(self.$element.attr("data-name")); } self.$element.children(".nav").children("li").children("a").click(function(e){ e.preventDefault(); //Returns EVER 2nd level self.testdrive(); //Triggering directly a Tabs instance returns EVER 2nd level $(this).closest(".tabs").data("test.tabs").testdrive(); }); } //JQuery plugin $.fn.tabs = function () { return this.each(function () { var $this = $(this); var data = $this.data('test.tabs'); //Creating only one instance of Tabs if(!data){ data = new Tabs($this); $this.data('test.tabs',data); } }); } //Adding tabs plugin to all ".tabs" $(function() { $('.tabs').each(function(){ $(this).tabs(); }); }); }( jQuery )); When $(element).tabs() called, creates a instance of function Tabs inside a data attribute test.tabs. If test.tabs has been defined only uses an old instance to preserve it. To test it, i created a function called testdrive, to print in console "data-name" attribute when .tabs>.nav>li>a has been clicked. The code works but, in console i receive "2st level tabs" if i clicked on 1st level item. Is a problem with child() function? Something wrong in my code? Thanks for help.
has answer: http://stackoverflow.com/a/24817149
answer count: 1
score: 1
favorite count: 0
has title: .child() returns 2nd level items
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24817149

http://stackoverflow.com/a/24793891
accepted answer of: http://stackoverflow.com/q/24793660
has comment: http://stackoverflow.com/comment/38481831
score: 0
has body: Always make sure to check your console for errors when debugging. Usually its in the devtools (F12 on chrome and IE) First you are trying to use a class selector with getElementsByClassName. This method just takes the class name not a selector. So .slideImage should be slideImage when passed to it. document.getElementsByClassName("slideImage")[1].style.width="0px"; Second your slides and back_slide functions (in the fiddle anyway) are declared within an onload event (the default option for jsfiddle) so it is not in global scope for the inline js to see So change the jsfiddle setting or take the inline js out and use addEventListener to attach events to your buttons. HTML &lt;button id="prevBtn" class="prev"&gt;&amp;#171;&lt;/button&gt; &lt;button id="nextBtn" class="next"&gt;&amp;#187;&lt;/button&gt; JS document.getElementById("prevBtn").addEventListener("click",function(){ back_slide(true); }); document.getElementById("nextBtn").addEventListener("click",function(){ slides(true); }); The last problem you have is that you have var slide = document.getElementsByClassName("slideImage")[4]; The array index should be 3, as array indexes start at 0. JSFiddle Demo
has comment: http://stackoverflow.com/comment/38481792
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/24793660
has comment: http://stackoverflow.com/comment/38506453

http://stackoverflow.com/comment/38494945
type: Comment
has text: @TrueBlueAussie good point. OP, see my update if you need to maintain the order of requests within the `$.when` callback.
comment on: http://stackoverflow.com/a/24800638
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38944271
score: 1
type: AnswerComment
type: Comment
has text: This problem **was** due to a problem in JSfiddle. A different but related problem was due to a Chrome bug. I'll just delete the question. The odds of someone else having this problem are probably not high plus it prevents people from thinking I am still looking for an answer to award bounty to.
comment on: http://stackoverflow.com/a/25024356

http://stackoverflow.com/comment/38418222
score: 0
type: AnswerComment
type: Comment
has text: no, I need to display those 20 elements many times to complete 2300 places in the screen..just repeat them randomly..
comment on: http://stackoverflow.com/a/24759597

http://stackoverflow.com/q/24767153
tagged with: javascript
linked to: http://stackoverflow.com/q/13104494
has answer: http://stackoverflow.com/a/24767297
duplicate of: http://stackoverflow.com/q/13104494
favorite count: 0
accepted answer: http://stackoverflow.com/a/24767255
possible better answer: http://stackoverflow.com/a/24767297
answer count: 5
has body: I have looked online about changing variables in an function but still doesn't work. I'm trying to change the global variable in a function. An object with numbers are multiplied by each other. The function will be use several time with different global variables. so don't want to use there names directly. HERE IS THE CODE var homeTeamOppw = {"last_gp": 0.2, "2nd_gp": 0.2, "3rd_gp": 0.8, "4th_gp": 0.4, "5th_gp": 0.8}; ans = 0; function timesArrayitems(teamOpp, array){ var num = 1; for(item in array){ num = num * array[item]; } teamOpp = num; } timesArrayitems(ans, homeTeamOppW); console.log(ans); The ans come out as undefine. Can someone explain please and thanks
downvote count: 1
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/38430786
upvote count: 3
has answer: http://stackoverflow.com/a/24767353
has title: Changing a global variable in an function JS
type: Question
has answer: http://stackoverflow.com/a/24767305
has answer: http://stackoverflow.com/a/24767255
has comment: http://stackoverflow.com/comment/38430817
has answer: http://stackoverflow.com/a/24767391

http://stackoverflow.com/a/24793804
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/38482247
downvote count: 0
answers question: http://stackoverflow.com/q/24793598
accepted answer of: http://stackoverflow.com/q/24793598
has comment: http://stackoverflow.com/comment/38481727
has comment: http://stackoverflow.com/comment/38481784
score: 1
has body: Try this code. It reads the ID and convert it to coordinates X and Y Demo: jsFiddle var pointOrder=$(this).attr("id").replace("p",""); pointOrder=parseInt(pointOrder); var corX=parseInt(pointOrder/15); var corY=pointOrder%15;

http://stackoverflow.com/comment/38787736
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24955442
has text: As well - why should redirecting to url with hash be not recommended. I want to use the hash on the client side ONLY, and for all my intended purposes hitting `/items/#/item-[id]/` should be same as hitting `/items/` as far as server is concerned (where if I'll change it to `/items/?/item-[id]/` then these are two different URLs). Unfortunately your solution doesn't address the issue.
type: AnswerComment

http://stackoverflow.com/comment/38619646
has text: That should be fine. How are you constructing your `Date`? It can be annoying to get right in JS, particularly with older browsers.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24866406

http://stackoverflow.com/q/24902460
answer count: 2
has answer: http://stackoverflow.com/a/24902496
has comment: http://stackoverflow.com/comment/38686834
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38704172
has comment: http://stackoverflow.com/comment/38691114
has comment: http://stackoverflow.com/comment/38686819
downvote count: 2
has comment: http://stackoverflow.com/comment/38686767
type: Question
has answer: http://stackoverflow.com/a/24902481
has title: Why does the thank you page not appear
has body: I have this code and after success the thank you page has to appear. The code executes but remains on the same page and does not redirect to the thank you page. &lt;a id="ajaxpost" class="large red button round" href="javascript:void(0)"&gt;לחץ כאן&lt;a&gt; &lt;script&gt; $("#ajaxpost").click(function () { $.ajax({ type: 'POST', data: $('#newsletter').serialize(), url: 'http://www.stress-free-life.co.il/lists/?p=subscribe&amp;amp;id=1', success: function (msg) { openWin(); $('#Name').val(''); $('#email').val(''); window.location = "www.bkalut.co.il/thankyou.html"; }, failure: function (msg) { alert('Sorry, we were unable to process your subscription.'); } }); });
upvote count: 0
score: -2
tagged with: javascript
tagged with: ajax

http://stackoverflow.com/a/24906952
has comment: http://stackoverflow.com/comment/38694982
has comment: http://stackoverflow.com/comment/38694865
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38696284
type: Answer
has comment: http://stackoverflow.com/comment/38698880
upvote count: 3
has comment: http://stackoverflow.com/comment/38698626
has body: Pipeline stages like $group and $project are "absolute" in that only the declared fields are emitted. You need another operator here. $first will do: activities.aggregate([ { "$match": { "_id": ObjectID(req.params.id) } }, { "$unwind": "$ratings" }, { "$group": { "_id": "$_id", "name": { "$first": "$name" }, "tags": { "$first": "$tags" }, "rating": { "$avg": "$ratings.rating" }, }}, ]); Since $unwind makes many documents out of the array contents de-normalized, you can use $first here to just take the "first" occurrence of the additional field that you are not otherwise aggregating. If you are worried about lots of fields to declare this way MongoDB 2.6 does offer the $$ROOT variable. I'ts usage and output are likely not what you really want: activities.aggregate([ { "$match": { "_id": ObjectID(req.params.id) } }, { "$project": { "_id": "$$ROOT", "ratings": 1 }}, { "$unwind": "$ratings" }, { "$group": { "_id": "$_id", "rating": { "$avg": "$ratings.rating" }, }}, ]); This gives you something like: { "_id" : { "_id": "53ce85eda2579da8b40c1f0f", "name" : "Autokino", "tags" : [ "forMen" ], "ratings" : [ { "rating" : 5, "uuid" : "..."}, { "rating" : 4, "uuid" : "..."}, { "rating" : 4, "uuid" : "..."}, { "rating" : 1, "uuid" : "..."}, ] }, "rating": 3.5 } This is okay here since grouping by _id is the same as grouping on the whole document. So you can always add a final $project to return to similar state. But there are no wildcards here.
score: 3
accepted answer of: http://stackoverflow.com/q/24906890
answers question: http://stackoverflow.com/q/24906890

http://stackoverflow.com/comment/38466944
type: Comment
has text: also make sure you add `type:"image"` for images parsed through scripts
type: QuestionComment
comment on: http://stackoverflow.com/q/24784605
score: 0

http://stackoverflow.com/comment/38648631
type: AnswerComment
score: 0
has text: @MichalLeszczyk I don't see your point. CSS3 is quite old by now as are transitions. This stuff is widely supported and is part of standard practices in web development.
type: Comment
comment on: http://stackoverflow.com/a/24880675

http://stackoverflow.com/comment/38573401
comment on: http://stackoverflow.com/q/24842754
score: 0
type: Comment
type: QuestionComment
has text: path is obviously wrong, so adjust based on output

http://stackoverflow.com/comment/38582691
comment on: http://stackoverflow.com/q/24847572
has text: @BenjaminGruenbaum that was a huge piece of code in mozilla, I think somewhere there can be a observer returned. http://mxr.mozilla.org/comm-central/source/calendar/providers/caldav/calDavCalendar.js#1437 I also wanted to make sure that if there is anyway to ensure a method completion if it does not return a promise or a callback.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24883323
has comment: http://stackoverflow.com/comment/38651042
has comment: http://stackoverflow.com/comment/38651512
answers question: http://stackoverflow.com/q/24883207
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38651231
accepted answer of: http://stackoverflow.com/q/24883207
has body: http://jsfiddle.net/Praveen16oct90/tNYVJ/ Its working here.. Please look at this.. $(document).ready(function(){ $("button").click(function(){ $("div").animate({left:'-=10%'}, 5000, 'linear'); }); });
has comment: http://stackoverflow.com/comment/38651331
has comment: http://stackoverflow.com/comment/38650851
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/38651541

http://stackoverflow.com/q/24848645
tagged with: jquery-filter
answer count: 1
has answer: http://stackoverflow.com/a/24848694
type: UnansweredQuestion
has title: jQuery optimize efficient for filtering then adding class to multiple element
tagged with: performance
has body: Given a list of elements and I need to filter by some properties and add a class to the qualifying ones. Since the data set could be large, I'm just wondering if one way is faster than the other Suppose listOfElement is given and consists of lots of elements and I also want to return say the value of each qualifying element method 1: for(var i = 0; i &lt; listOfElement.length ; i ++){ if ( testing condition ) { $(listOfElement[i]).addClass("blah"); selected.push(listOfElement[i]; } } method 2: selected = listOfElement.filter(...); $(selected).addClass("blah") I want to know the performance cost for $ selection operation and the addClass operation. It would be great if someone can point me to a document for some JavaScript guide for better performance (e.g. use hide/show is faster than insert/delete a DOM)
type: Question
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/51466146
comment on: http://stackoverflow.com/a/24841366
type: Comment
has text: Why the downvote? Setting it to an empty string is perfectly valid in html5; in fact, setting it to anything *other* than an empty string or the attribute name is explicitly *not* valid: "If the attribute is present, its value must either be the empty string or a value that is an ASCII case-insensitive match for the attribute's canonical name, with no leading or trailing whitespace." (http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#boolean-attributes)
score: 0
type: AnswerComment

http://stackoverflow.com/a/24829066
has comment: http://stackoverflow.com/comment/38563807
downvote count: 0
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/38564240
has body: I realise there are already 4 answers, but I would like to demonstrate the tips I mentioned in comment for creating simple code that is easier to maintain. Also your HTML concatenation is actually not quite right, but nobody can tell with all the string operations. Use the existing row count (or last id) etc to determine the next id number to generate. Consider using a dummy/template element instead of HTML string concatenation. This allows for maintainable templates. Use single quotes for the outer strings, that that the HTML attributes have double-quotes (for browser compatibility). This example has the first two as the quotes issue goes away: JSFiddle: https://jsfiddle.net/pUeue/1787/ $('#add').click(function () { var count = $('#tab_logic tr').length; $('#tab_logic').append($('#template').html().replace(/{i}/g, count)); }); function deleterow(obj) { $(obj).parent().parent().remove(); return false; } In this example your template row sits in a dummy script block (of unknown type so is ignored). It uses a "global" replace option in a regex to replace all occurrences of a placeholder with the desired value(s).
answers question: http://stackoverflow.com/q/24828525

http://stackoverflow.com/q/24753837
tagged with: google-plus
favorite count: 0
has title: In Google+ Share button how set custom image , title and description by JavaScript.?
upvote count: 2
type: UnansweredQuestion
score: 2
answer count: 0
has body: I am using a Google+ share feature in my page. There are many article in list(on single page ) so my question is that how will i set Google + share image ,title and description for respected article so at the time of sharing it show relative image and content in Google share page By JavaScript. Thanks ...
type: Question
downvote count: 0
tagged with: javascript
tagged with: sharing

http://stackoverflow.com/a/24890221
accepted answer of: http://stackoverflow.com/q/24889806
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
has body: It looks like your canvas is 200 x 100. But you're trying to draw a rectangle 100 pixels from the top. Your code probably works, but the rectangle doesn't show up because it's drawn at the bottom of the canvas. Try changing this line top: 100 to this: top: 0 UPDATE If this doesn't work at first, it could be because the DOM hasn't loaded before your script runs. You can put your code in a jQuery document ready listener like so: $(document).ready(function(){ //Your code here... }); This will ensure that the canvas element is actually ready to be used by the time your script fires. Best of luck!
has comment: http://stackoverflow.com/comment/38664629
upvote count: 1
has comment: http://stackoverflow.com/comment/38663660
answers question: http://stackoverflow.com/q/24889806

http://stackoverflow.com/a/24834406
type: Answer
has comment: http://stackoverflow.com/comment/38557803
has comment: http://stackoverflow.com/comment/39078077
has comment: http://stackoverflow.com/comment/39103905
has body: You can use the following approach for loading jquery. It is slightly more performant than using the google.load() approach. It isn't a huge gain, but it does cut down on a few unnecessary HTTP requests: EDIT 1: Here is how your file might look:
score: 0
has comment: http://stackoverflow.com/comment/39152236
answers question: http://stackoverflow.com/q/24834183

http://stackoverflow.com/comment/38645554
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24879723
has text: I have created a JSFIDDLE demo and added the link to it in your question. Please work out the demo for the error resolution as far as you can and then if you are stuck somewhere then let me know !

http://stackoverflow.com/a/24762469
accepted answer of: http://stackoverflow.com/q/24762228
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/38421792
upvote count: 2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24762228
type: Answer
has body: Attributes in a non-null namespace must be set via setAttributeNS so you need this... photoDOM.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', photo.src);

http://stackoverflow.com/a/24759739
has body: Try, $('#Form input').on( 'input', function() { //This would be called if any of the input element has got a change inside the form });
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/80888139
downvote count: 1
accepted answer of: http://stackoverflow.com/q/24759718
upvote count: 15
answers question: http://stackoverflow.com/q/24759718
type: Answer
score: 14
has comment: http://stackoverflow.com/comment/79312290
has comment: http://stackoverflow.com/comment/79290575

http://stackoverflow.com/q/24815467
has answer: http://stackoverflow.com/a/24831266
favorite count: 0
score: 4
type: UnansweredQuestion
has body: I have an IMG DOM element I generated with a data-uri. How can I attach it to the React.js "virtual DOM"? When I try the following: myImgComponent = React.createClass({ getInitialState: function() { slowGenerateImage((function(_this) { return function(img) { /* img is an HTMLImageElement */ return _this.setState({ image: img }); }; })(this)); return {image: null}; }, render: function() { return div( {}, this.state.image /* image is a raw HTMLImageElement */ ); } }); I get the following error: Invariant Violation: traverseAllChildren(...): Encountered an invalid child; DOM elements are not valid children of React components.
has answer: http://stackoverflow.com/a/24815891
type: Question
upvote count: 4
has title: How do I attach an existing element (HTMLImageElement) to a Facebook React.js component?
tagged with: reactjs
answer count: 2
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/24831286
has answer: http://stackoverflow.com/a/56157533
has answer: http://stackoverflow.com/a/24831422
type: Question
has answer: http://stackoverflow.com/a/28025049
tagged with: aspdotnetstorefront
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/24831879
favorite count: 0
answer count: 5
has answer: http://stackoverflow.com/a/24831416
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I'm not sure whether a Javascript or CSS fix could fix this issue on my site. This seems to only happen with Chrome (not sure about IE, yet). Whenever a user copies text from my AspDotNetStorefront site and paste it onto a Word document, the pasted text includes a gray background. Is there anything I can do on my site to prevent this rich text formatting paste feature onto documents? I'm not sure what would be the cause of this besides Microsoft Word's default paste setting.
upvote count: 3
type: UnansweredQuestion
has title: Removing rich text formatting for copy + paste? (Cross Browser)
score: 3
has comment: http://stackoverflow.com/comment/38553616
has comment: http://stackoverflow.com/comment/38553234

http://stackoverflow.com/comment/38518543
has text: Have you looked at jQuery.parseHTML()? See [https://api.jquery.com/jquery.parsehtml/](https://api.jquery.com/jquery.parsehtml/). It looks like it'll do exactly what you want.
score: 0
comment on: http://stackoverflow.com/q/24813438
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38625806
score: 8
has text: I'd vote to close this question as being primarily opinion based; answers to this question aren't going to solve the problem, they will just give you and whoever finds this question in the future even more things to think about. Unfortunately, it has an open bounty, and as such cannot be voted on for closing.
type: QuestionComment
comment on: http://stackoverflow.com/q/24836384
type: Comment

http://stackoverflow.com/comment/38510654
comment on: http://stackoverflow.com/q/24781551
score: 0
type: QuestionComment
type: Comment
has text: @AMD_Paulius Did you read my answer? The script includes tons of mentions of DealPly.

http://stackoverflow.com/a/24781397
score: 7
upvote count: 7
answers question: http://stackoverflow.com/q/24780891
accepted answer of: http://stackoverflow.com/q/24780891
has body: Remove this line content.innerHTML = ''; React will look at the old virtual dom, and what's returned by &lt;Posts /&gt; (which is the same as Posts()). It'll compare them, and make the updates required to the DOM.
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/24876586
favorite count: 0
tagged with: cordova
tagged with: oauth
tagged with: angularjs
has body: I'm working on an app which uses a Oauth authentication, I'm having some trouble with the url parameters. I've tried several different ways but my API is returning that the username and password aren't being passed to the API Here's my code (removed the private details): $http({ url: 'http://test.com/oauth/v2/token', method: "GET", params:{ username: user.username, password: user.password, client_id: 'xxxxxxx', client_secret: 'xxxxxxx', grant_type: 'password' } }).success(function(data, status) { console.log(data); }).error(function(data, status) { console.log(data); console.log(status); }); My API returns Object {error: "invalid_request", error_description: "Missing parameters. "username" and "password" required"} (error 400). Cheers in advance!
has answer: http://stackoverflow.com/a/24876999
accepted answer: http://stackoverflow.com/a/24876999
type: AnsweredQuestion
score: 2
downvote count: 0
type: Question
tagged with: javascript
upvote count: 2
has title: Missing parameters in AngularJS $http.get('')
answer count: 1

http://stackoverflow.com/q/24893205
has answer: http://stackoverflow.com/a/24893258
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
upvote count: 2
answer count: 5
has answer: http://stackoverflow.com/a/24893373
has answer: http://stackoverflow.com/a/24893357
accepted answer: http://stackoverflow.com/a/24893357
type: AnsweredQuestion
score: 2
tagged with: href
possible better answer: http://stackoverflow.com/a/24893258
tagged with: onclick
has comment: http://stackoverflow.com/comment/38669363
has title: HTML/JQuery How can I use BOTH href and onclick?
type: Question
has answer: http://stackoverflow.com/a/24893676
downvote count: 0
has answer: http://stackoverflow.com/a/24893451
tagged with: javascript
tagged with: jquery
has body: I was assigned to work on a web page which has a bunch of buttons on it. Each of those buttons needs to scroll down to a specific div and change the content of it. My problem is, that every time I click, it only ever anchors and never activates the onclick unless I remove the href. How can I make it use BOTH href AND onclick? Example: &lt;a href="#divId" onclick="alert('Test');"&gt;&lt;img src="images/image.png" /&gt;&lt;/a&gt;

http://stackoverflow.com/a/24763103
has comment: http://stackoverflow.com/comment/38423100
type: Answer
has body: $(function(){ $("#incidentform").validate({ rules: { incidate: "required" }, messages: { incidate: "Please enter the incident date." } }) }); Missing brackets around it.
has comment: http://stackoverflow.com/comment/38423161
upvote count: 1
answers question: http://stackoverflow.com/q/24763022
score: 1
accepted answer of: http://stackoverflow.com/q/24763022
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/24865385
has answer: http://stackoverflow.com/a/24866813
type: Question
answer count: 1
score: 0
has body: We use Jssor program, we have many picture on the left side. Have you any idea, how we can show a scrollbar next left side? Thanks
has title: Jssor - scrollbar show next images
upvote count: 1
downvote count: 1
tagged with: jquery-ui
tagged with: javascript
type: UnansweredQuestion
favorite count: 0

http://stackoverflow.com/comment/38425713
comment on: http://stackoverflow.com/a/24764360
score: 0
type: AnswerComment
has text: Sorry that didn't help me out either. But 5 `li` elements were created.
type: Comment

http://stackoverflow.com/a/24897545
has comment: http://stackoverflow.com/comment/38677583
answers question: http://stackoverflow.com/q/24897452
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/38678555
has body: $("input:checked") will return all the checkboxes and radio boxes that are currently checked. You could iterate over that and just add the values to the array.

http://stackoverflow.com/comment/38425702
score: 0
has text: @dandavis Yeah, I was hoping to get around that. If I set null `desc` properties to just whitespace, it at least leaves the child's ` ` empty.
comment on: http://stackoverflow.com/q/24762700
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38492961
type: QuestionComment
has text: Where's jQM, CSS, Ajax relevant code? dont use irrelevant tags pls.
score: 0
comment on: http://stackoverflow.com/q/24798021
type: Comment

http://stackoverflow.com/comment/38597659
has text: upvoted,and thanks for ur vote too atleast now I am a eligible voter (:
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24853062
score: 1

http://stackoverflow.com/comment/38456973
comment on: http://stackoverflow.com/q/24781110
score: 0
has text: It sounds like you're asking this because the CSS will be modified at some point after the page has been loaded by something other than CSS, in which case you'll have to use javascript.
type: Comment
type: QuestionComment

actioncontext
tags question: http://stackoverflow.com/q/24837711
type: Tag
tag name: actioncontext

http://stackoverflow.com/comment/38689750
has text: no, it doesn't get called
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24897505

flash
tags question: http://stackoverflow.com/q/24813497
tags question: http://stackoverflow.com/q/24825865
tags question: http://stackoverflow.com/q/24769645
tags question: http://stackoverflow.com/q/24830022
tags question: http://stackoverflow.com/q/24799013
tags question: http://stackoverflow.com/q/24816026
tag name: flash
type: Tag

http://stackoverflow.com/comment/38456544
type: QuestionComment
has text: Can you or are you using jquery? It's possible to use it to monitor the status code of a resource query, but I've never tried to use jquery ajax to download a resource. With it, you could potentially set your window.location.href when the success: function on the ajax call is fired.
score: 0
comment on: http://stackoverflow.com/q/24777242
type: Comment

http://stackoverflow.com/comment/38644825
has text: this wouldn't wait for the transition to complete and then set the `motionComplete` to `true`, you need to use a `setTimeout` because the transition is given by CSS
comment on: http://stackoverflow.com/a/24880213
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38702455
has text: Double pipes has semantics, so unfortunately I can't just get rid of them :(
type: Comment
comment on: http://stackoverflow.com/a/24891068
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38481831
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24793891
type: Comment
has text: also if the `slide` variable in `back_slide` is supposed to represent the last slide, you can just get the last index of the array by using the `.length` property minus 1

http://stackoverflow.com/q/24906362
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38695496
type: UnansweredQuestion
upvote count: 1
score: 1
has title: Webapp in 2 monitors
tagged with: multiscreen
type: Question
tagged with: browser
answer count: 1
downvote count: 0
tagged with: javascript
has body: I am trying to find a way how to build a browser web app that runs in 2 monitors, like; i have a secondary monitor that i want to put there some window, i want it fullscreen, and automatically in the secondary, so no drags, while the main app should stay in the primary monitor, where is the browser... no way seems, nothing really works so the only way seems to be with some desktop app. I don't really care if the solution is browser dependent at this point, but still can't find a real solution. Does a ny body tried something like this and can give me some ideas how to build it? EDIT ... i need the second monitor to have some specific content, so not a clone of the primary... kind of... i'm playing some game in the first monitor and i see statistics on the second...
favorite count: 0
has answer: http://stackoverflow.com/a/24906819
has comment: http://stackoverflow.com/comment/38694264
tagged with: multi-window

http://stackoverflow.com/a/26683105
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/42972263
answers question: http://stackoverflow.com/q/24892363
downvote count: 0
has body: This code example below will allow you to grab data from fields on the page and write them out to a txt file directly to the users local box. I am currently looking for a way to write them out to XMl for a project that I am on, but at the very least I can get the data I want written out to a text file. var userInput = document.getElementById("userInputId").value; var fileURL = 'data:application/notepad;charset=utf-8,' + encodeURIComponent(userInput); var fileName = "test.txt"; if (!window.ActiveXObject) { var save = document.createElement('a'); save.href = fileURL; save.target = '_blank'; save.download = fileName || 'unknown'; var event = document.createEvent('Event'); event.initEvent('click', true, true); save.dispatchEvent(event); (window.URL || window.webkitURL).revokeObjectURL(save.href); } // for IE else if (!!window.ActiveXObject &amp;&amp; document.execCommand) { var _window = window.open(fileURL, '_blank'); _window.document.close(); _window.document.execCommand('SaveAs', true, fileName || fileURL) _window.close(); }

http://stackoverflow.com/q/24783372
has answer: http://stackoverflow.com/a/24783657
type: Question
tagged with: javascript
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/38461316
has answer: http://stackoverflow.com/a/24783702
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/24783404
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24783404
accepted answer: http://stackoverflow.com/a/24783702
has body: I want to allow users to edit their posts, to do this i'd like them to be able to click a link, once pressed the div their post is in originally would hide and a new div would be visible with the text from the old div inside the textarea - so they can literally edit their old post with ease. I've tried searching for the past hour and cannot find a solid answer anywhere. The HTML I have: Users comment will go here Edit Post
has title: Add text from div to textarea on click

http://stackoverflow.com/a/24877510
accepted answer of: http://stackoverflow.com/q/24794217
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
score: 2
has body: If you use a combination of setupGrid and draw, the highlights will persist between redraws and you won't need to manually reapply (like you would if you re-init). Also, to manipulate the data between re-draws (say on the zoom selection), use a combination of getData and setData: $("#flot_chart").bind("plotselected", function (event, ranges) { var fr = ranges.xaxis.from; var to = ranges.xaxis.to; $.each(plot.getXAxes(), function(_, axis) { var opts = axis.options; opts.min = fr; opts.max = to }); //pad data points, so the hover effect doesn't look spotty var series = plot.getData(); // get series series[0].data = []; // clear it out for (var i = fr; i &lt; to; i+=(to-fr)/100){ series[0].data.push([i,Math.sin(i)]); // push in data with a suitable increment to i } plot.setData(series); // set the new data plot.setupGrid(); // redo the grid plot.draw(); // redraw the plot plot.clearSelection(); }); Here's a fiddle example.
answers question: http://stackoverflow.com/q/24794217

http://stackoverflow.com/a/24782364
has comment: http://stackoverflow.com/comment/38459794
upvote count: 2
has body: You don't call the LESS task at all. To call it add the taskname in the registered task grunt.registerTask('default', ['uglify','less']); See the documentation to learn more about task registration: http://gruntjs.com/creating-tasks EDIT: I saw you created a watch task, so if you don't call the LESS task manually but by watching files, be sure to have executed grunt watch in a terminal (and not closed the terminal windows) before modifying the files
type: Answer
answers question: http://stackoverflow.com/q/24782303
downvote count: 0
score: 2

http://stackoverflow.com/comment/38573512
has text: I tested this and it does work. I suspect the first option results in the browser decoding the image twice. Thankfully I do control the source library so I can make a version that returns a dataUri instead of a full IMG object.
comment on: http://stackoverflow.com/a/24831266
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/24784944
tagged with: javascript
tagged with: express
score: 0
answer count: 1
tagged with: node.js
type: AnsweredQuestion
tagged with: http-headers
linked to: http://stackoverflow.com/q/7042340
tagged with: http
type: Question
has answer: http://stackoverflow.com/a/24785049
accepted answer: http://stackoverflow.com/a/24785049
has title: Can't set headers after they are sent after setting the content-type
has body: I am trying to get an object from my server API. This API has it as a stream. I can get its mime thanks to its key (which ends by .jpg etc...). I would like to send back a content-type with the right type-mime and not always with application/octet-stream. I found in npm mime which does the work but when I go to the url http://localhost:3000/file/myb/userId/test.jpeg the server shutdown and throw : http.js:691 throw new Error('Can\'t set headers after they are sent.'); ^ Error: Can't set headers after they are sent. at ServerResponse.OutgoingMessage.setHeader (http.js:691:11) at ServerResponse.res.setHeader (D:\Utilisateurs\A579871\Documents\GIT\shb- gitrepository-1\node_modules\express\node_modules\connect\lib\patch.js:63:22) at ServerResponse.&lt;anonymous&gt; (D:\Utilisateurs\A579871\Documents\GIT\shb-gitrepository-1\node_modules\express\node_modules\connect\lib\patch.js:80:14) at Array.forEach (native) at ServerResponse.res.writeHead (D:\Utilisateurs\A579871\Documents\GIT\shb-gitrepository-1\node_modules\express\node_modules\connect\lib\patch.js:79:28) at IncomingMessage.&lt;anonymous&gt; (D:\Utilisateurs\A579871\Documents\GIT\shb-gitrepository-1\server.js:49:17) at IncomingMessage.EventEmitter.emit (events.js:95:17) at IncomingMessage.&lt;anonymous&gt; (_stream_readable.js:746:14) at IncomingMessage.EventEmitter.emit (events.js:92:17) at emitReadable_ (_stream_readable.js:408:10) I found this topic about the subject and tried to use the advices without finding the solution Error: Can&#39;t set headers after they are sent to the client Here is my code : var express = require('express'); var http = require('http'); var mime = require('mime'); var app = express(); var maxAge = 31557600000; var port = 3000; app.use(express.static(__dirname + '/app')); app.get('/file/:bId/:userId/:fileKey', function(req, res) { var headersGet = { 'auth-format': 'UID', 'Authorization': req.params.userId }; var optionsGet = { host: 'localhost', port: 5000, path: '/' + req.params.bId + …

http://stackoverflow.com/comment/38525907
has text: The `function(data){...}` part is the callback of getJSON, `data` is the JSON response that you will get.
comment on: http://stackoverflow.com/q/24817590
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38697264
has text: @all , Yeah, I realize that now. I am with PHP background and was thinking this might be some sort of associative array. Thanks a lot. Got the answer.
score: 0
comment on: http://stackoverflow.com/q/24908117
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/138049157
score: 0
comment on: http://stackoverflow.com/a/24826474
type: Comment
type: AnswerComment
has text: The link you have referenced is no longer actual (returns 404). It's also missing in web archive :(

http://stackoverflow.com/comment/38504303
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24806160
has text: Can you replicate the error using [jsfiddle](http://jsfiddle.net)
score: 0

http://stackoverflow.com/q/24756251
has title: Javascript read text file and append values to array
type: AnsweredQuestion
has body: I have a problem with populating a JavaScript array with a function... I have some charting software that uses JavaScript. I can input my own values into an array directly to create my desired chart like so: var data_array=[[0,170],[0,185],[0,179]] The first value in the array corresponds to sample number (e,g, 0) and the second value corresponds to height (e.g. 170, 185 etc). This works but I will eventually have a huge list of thousands of values. The height values will be stored in text files. There will be a different file for each sample. The text file will contain a simply list of values separated by lines. What I need my program to do is open a text file and extract the values and then append them to the data array. So far I have this: $.get('sample0.txt', function(data, data_array){ var lines=data.split('\n'); for (var i=0; i&lt;lines.length-1;i++){ var item=lines[i]; data_array.push([0,item]); } return data_array } This doesn't work, although I know it is correctly extracting the values from the text file. I'm not worried about sample number as I can set this for each file. My problem is how to populate the array and make that array exist outside of the function. I normally code in PHP and I apologize that my knowledge of JavaScript is very basic!
has answer: http://stackoverflow.com/a/24756412
type: Question
answer count: 2
tagged with: arrays
tagged with: javascript
score: 0
possible better answer: http://stackoverflow.com/a/24756430
accepted answer: http://stackoverflow.com/a/24756412
has answer: http://stackoverflow.com/a/24756430

http://stackoverflow.com/q/24876700
has body: I have been working on this for a little while today and I am stumped. I am attempting to select a date using a date picker and take that date, populate a label with it and also take input from the user to add days to the selected date. The date picker works fine, I however cannot get the date to populate the label and I am not sure how to calculate say 6 days in advance with that date. The code to add the days is straight forward, I am not sure how to take the date and make it calculable. Here is what I have so far: View @{ ViewBag.Title = "Index"; } Calendar Application This application will display a the specified number of days the user inputs on a calendar. Select A Date @model VanickCalendarApp.Models.Calendar @using (Html.BeginForm("Calculate Days", "Calendar", FormMethod.Post)) { Enter The Number Of Days To Display @Html.TextBoxFor(model => model.DaysToBeViewed) "Date" } Controller using System.Web.Mvc; using VanickCalendarApp.Models; namespace VanickCalendarApp.Controllers { public class CalendarController : Controller { public string CalculateDays(string Date) { var oneDAY = 1000 * 60 * 60 * 24; return Date; } // // GET: /Calendar/ public ActionResult Calendar() { return View(); } // // GET: /Calendar/Details/5 public ActionResult Details(int id) { return View(); } // // GET: /Calendar/Create public ActionResult Create() { return View(); } // // POST: /Calendar/Create [HttpPost] public ActionResult Create(FormCollection collection) { try { // TODO: Add insert logic here return RedirectToAction("Index"); } catch { return View(); } } // // GET: /Calendar/Edit/5 public ActionResult Edit(int id) { return View(); } // // POST: /Calendar/Edit/5 [HttpPost] public ActionResult Edit(int id, FormCollection collection) { try { // TODO: Add update logic here return RedirectToAction("Index"); } catch { return View(); } } // // GET: /Calendar/Delete/5 public ActionResult Delete(int id) { return View(); } // // POST: /Calendar/Delete/5 [HttpPost] public ActionResult Dele…
has comment: http://stackoverflow.com/comment/38638543
has title: Issue populating label from date picker and calculating
has comment: http://stackoverflow.com/comment/38638443
tagged with: javascript
has comment: http://stackoverflow.com/comment/38638416
score: 0
has comment: http://stackoverflow.com/comment/38638670
answer count: 0
has comment: http://stackoverflow.com/comment/38638777
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38638995
tagged with: razor
has comment: http://stackoverflow.com/comment/38638851
has comment: http://stackoverflow.com/comment/38638449
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/38638513
tagged with: jquery-ui-datepicker
type: Question

http://stackoverflow.com/a/25005010
score: 8
type: Answer
accepted answer of: http://stackoverflow.com/q/24893267
answers question: http://stackoverflow.com/q/24893267
downvote count: 0
upvote count: 8
type: AcceptedAnswer
has body: &lt;script type="text/javascript"&gt; (function($) { /* * render_map * * This function will render a Google Map onto the selected jQuery element * * @type function * @date 8/11/2013 * @since 4.3.0 * * @param $el (jQuery element) * @return n/a */ function render_map( $el ) { // var var $markers = $el.find('.marker'); // vars var args = { zoom : 16, center : new google.maps.LatLng(0, 0), mapTypeId : google.maps.MapTypeId.ROADMAP }; // create map var map = new google.maps.Map( $el[0], args); // add a markers reference map.markers = []; // add markers $markers.each(function(){ add_marker( $(this), map ); }); // center map center_map( map ); } // create info window outside of each - then tell that singular infowindow to swap content based on click var infowindow = new google.maps.InfoWindow({ content : '' }); /* * add_marker * * This function will add a marker to the selected Google Map * * @type function * @date 8/11/2013 * @since 4.3.0 * * @param $marker (jQuery element) * @param map (Google Map object) * @return n/a */ function add_marker( $marker, map ) { // var var latlng = new google.maps.LatLng( $marker.attr('data-lat'), $marker.attr('data-lng') ); // create marker var marker = new google.maps.Marker({ position : latlng, map : map }); // add to array map.markers.push( marker ); // if marker contains HTML, add it to an infoWindow if( $marker.html() ) { // show info window when marker is clicked &amp; close other markers google.maps.event.addListener(marker, 'click', function() { //swap content of that singular infowindow infowindow.setContent($marker.html()); infowindow.open(map, marker); }); // close info window when map is clicked google.maps.event.addListener(map, 'click', function(event) { if (infowindow) { infowindow.close(); } }); } } /* * center_map * * This function will center the map, showing all markers attached to this map * * @type function * @date 8/11/2013 * @since 4.3.0 * * @param map (Google Map object) * @return n/a */ function center_map( map ) {…

http://stackoverflow.com/comment/38647244
comment on: http://stackoverflow.com/q/24881443
score: 0
type: Comment
type: QuestionComment
has text: @amin : '' tried not working

http://stackoverflow.com/comment/38447504
type: Comment
comment on: http://stackoverflow.com/a/24772837
score: 0
type: AnswerComment
has text: call newWindow.toString();

http://stackoverflow.com/comment/44270854
type: Comment
comment on: http://stackoverflow.com/a/27936312
type: AnswerComment
has text: Just a note to others, simply selecting a character then simulating the Home or an arrow keystroke also eliminates the slowness.
score: 0

http://stackoverflow.com/a/24810930
answers question: http://stackoverflow.com/q/24810340
upvote count: 1
downvote count: 1
type: Answer
has body: apart from the functionality missing there are numerous issues with your code. I tried my best to address them all and give you easy understandable code. So first of all: inline javascript ( i.e. putting code in onchange) is rather bad practique second you have multiple elements with the same id(&lt;button id="minus") one should use class in such cases. i modified your html as following &lt;p&gt; &lt;input type="button" class="minus" value="-"&gt; &lt;input type="text" id="textb" value="0" readonly="readonly"/&gt; &lt;input type="button" class="plus" value="+"&gt; Health &lt;/p&gt; &lt;p&gt; &lt;input type="button" class="minus" value="-"&gt; &lt;input type="text" id="textm" value="0" readonly="readonly" /&gt; &lt;input type="button" class="plus" value="+"&gt; Energy &lt;/p&gt; &lt;p&gt; &lt;input type="button" class="minus" value="-"&gt; &lt;input type="text" id="textd" value="0" readonly="readonly"/&gt; &lt;input type="button" class="plus" value="+"&gt; Chakra &lt;/p&gt; &lt;p&gt; &lt;input type="text" id="textc" readonly="readonly" /&gt; Free points &lt;/p&gt; and this js, note i used jQuery to save some typing, but with minor modifications this code can be used with pure vanilla DOM API (document.querySelectorAll and so on) $(function(){ var free = 10 , max = 10 , min = 0 ; $('.minus').click(function(){ var edit = $(this).parent().find('[type="text"]').get(0) if(edit.value &gt; 0 &amp;&amp; edit.value &gt; min) { edit.value--; free++; } $("#textc").get(0).value = free; }); $('.plus').click(function(){ var edit = $(this).parent().find('[type="text"]').get(0) if(free &gt; 0 &amp;&amp; edit.value &lt; max) { free--; edit.value++; } $("#textc").get(0).value = free; }); $("#textc").get(0).value = free; }); and here is it in the fiddle
score: 0

http://stackoverflow.com/a/24789783
downvote count: 0
has comment: http://stackoverflow.com/comment/38476366
has comment: http://stackoverflow.com/comment/38474686
has comment: http://stackoverflow.com/comment/44293196
upvote count: 2
has comment: http://stackoverflow.com/comment/38476947
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24787085
answers question: http://stackoverflow.com/q/24787085
type: Answer
has body: Most browsers, until the last year or two, have had very little concept of positioning below whole-pixel resolution. Since it is so new, it will be hard to get full consistency of these values across multiple browsers. The version of PhantomJS that you are using probably doesn't support sub-pixel positioning. I'm not sure if that's because you have an older version or it is simply isn't supported.
score: 2

http://stackoverflow.com/a/24874375
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24874030
upvote count: 1
has comment: http://stackoverflow.com/comment/38633943
has body: performance.now() is more accurate than using Date: var t0 = performance.now(); your_function(); var t1 = performance.now(); console.log("Call to your_function took " + (t1 - t0) + " milliseconds."); And read the output in your console.

http://stackoverflow.com/q/24878585
tagged with: replace
possible better answer: http://stackoverflow.com/a/24878630
type: AnsweredQuestion
score: 1
tagged with: string
has comment: http://stackoverflow.com/comment/38641833
favorite count: 0
type: Question
has body: I noticed the JavaScript Replace() Method here: http://www.w3schools.com/jsref/jsref_replace.asp and using this code here: var str = "Visit Microsoft!"; var res = str.replace("Microsoft", "W3Schools"); I'm wondering if it can be used to replace my pages title that is set here: document.title = "Supplies -" + " Orbs : " + Orbs; I need to replace these items: "Supplies -" " Orbs : " Orbs The last one is a variable i defined here: var Orbs = 0;
has answer: http://stackoverflow.com/a/24878735
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/38642300
tagged with: methods
has title: Javascript Replace page title and Variable with Replace() Method?
accepted answer: http://stackoverflow.com/a/24878735
has answer: http://stackoverflow.com/a/24878630
downvote count: 0
tagged with: javascript
tagged with: variables

http://stackoverflow.com/a/24835797
has comment: http://stackoverflow.com/comment/38560307
has body: window.setTimeout Calls a function or executes a code snippet after a specified delay. $scope.hideIt = function () { window.setTimeout(function() { $scope.hovering = false; $scope.$apply(); }, 500); // 500ms delay }; Or the Angular $timeout service: $scope.hideIt = function () { $timeout(function() { $scope.hovering = false; }, 500); // 500ms delay };
has comment: http://stackoverflow.com/comment/38560317
answers question: http://stackoverflow.com/q/24835774
score: 3
downvote count: 0
upvote count: 3
type: Answer

http://stackoverflow.com/a/24885910
has comment: http://stackoverflow.com/comment/38655726
has comment: http://stackoverflow.com/comment/38655353
score: 3
has comment: http://stackoverflow.com/comment/38655434
upvote count: 3
has comment: http://stackoverflow.com/comment/38655548
has comment: http://stackoverflow.com/comment/38655860
has comment: http://stackoverflow.com/comment/38656387
downvote count: 0
has comment: http://stackoverflow.com/comment/38655028
has body: A onload doesn't work because onload I can use only with body. But how do onload for other tags? No, it works for elements that have a load event. a doesn't have a load event because it never has something to load. All a content is inline. load relates to things like images and scripts and stylesheets and such, that load a separate resource. img has a load event, if you're talking about the image inside the link loading. You have to be sure to hook the event before setting the img source (the onload attribute works), or check the complete flag on the element if hooking the event later to see if it's already done. From the comments below, it sounds like you want to change the img's source when the link is clicked. You can do that like this: &lt;a onclick="document.getElementById('video_642').src = '/new/src/here.png' ... ...or as you're using jQuery, this will handle all youtube links: $("a.youtube").click(function() { $(this).find("img").attr("src", "/new/src/here.png"); }); But the user may not see it, because when the link is followed, the browser tears down the page right away. You can improve the chances your user will see it if you make sure it's already in cache, by putting it on your page somewhere but hidden: &lt;img style="display: none" src="/new/src/here.png"&gt; ...so the browser has it in cache to display it before tearing down the page. I want to while page is loading src in img will be changed by script You mean when the page these links are on is loading? Okay. This would go in a script tag at the end of the body (just before the closing &lt;/body&gt; element: // Find all images within a.youtube links and change their `src` $("a.youtube img").each(function() { var img = $(this); // Save current src so we can put it back later img.attr("data-real-src", this.src); // Set new source this.src = "/new/src/here.png"; }); // Then when the page is done loading... $(window).on("load", function() { // Restore the original `src` values on the images $("img[data…
type: Answer
has comment: http://stackoverflow.com/comment/38655389
has comment: http://stackoverflow.com/comment/38655255
answers question: http://stackoverflow.com/q/24885830
has comment: http://stackoverflow.com/comment/38655583
has comment: http://stackoverflow.com/comment/38656172

http://stackoverflow.com/comment/38639637
has text: Wow @keune. Great catch. Don't know how I made that mistake. So simple.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24877380

http://stackoverflow.com/comment/38579672
comment on: http://stackoverflow.com/q/24835704
score: 0
has text: @minitech Yes, I think that's the gist of it. It passes the TypeError above when mocha tries to test that.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38793947
type: Comment
has text: Actually, forgot my previous comment, you don't need an API key for such a request, test https://api.dailymotion.com/video/VIDEO_ID?fields=available_formats by replacing VIDEO_ID with a valid video id You can read the documentation at http://www.dailymotion.com/doc/api/obj-video.html
comment on: http://stackoverflow.com/a/24912123
type: AnswerComment
score: 0

http://stackoverflow.com/a/73771907
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/24836442
has body: I've had the same issue with href's in the elements. Removed them and it all works now. Just a heads up: to check if request is ajax in Django use: if request.headers.get('x-requested-with') == 'XMLHttpRequest': Instead of if request.is_ajax(): as it's deprecated.

http://stackoverflow.com/comment/38476334
has text: Maybe those peeps don't know what `.add()` does, or they expect more specific answers here. It's alright. I'd upvote you twice if I could -- to return balance to the force.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/24788788
type: Comment

http://stackoverflow.com/q/24762342
has answer: http://stackoverflow.com/a/24763026
has comment: http://stackoverflow.com/comment/38422338
downvote count: 1
has comment: http://stackoverflow.com/comment/38422128
has answer: http://stackoverflow.com/a/24762491
type: Question
answer count: 2
upvote count: 0
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/38422488
has body: I am a newbies to Javascript and recent need to support for it. May anyone help me to understand the following coding? var proj = proj || {}; (function () { var functA = function () { var base = {}; // I don't understand from this line base.getString = this.getString; this.getString = function () { var strings = base.getString.call($this); return strings.concat(["ab","cd","ef"]); }; }; })(); I am quite confused with the getString function. Can anyone kindly explain the purpose of it? Also, is there any name for such kind of coding style or can anyone lead me to some articles about this style of coding? Many thanks.
favorite count: 0
type: UnansweredQuestion
has title: Javascript coding style
has comment: http://stackoverflow.com/comment/38421802

http://stackoverflow.com/q/24905148
type: AnsweredQuestion
has title: having any options for circle click event on map and marker as visible false
has comment: http://stackoverflow.com/comment/38692804
has comment: http://stackoverflow.com/comment/38692807
has comment: http://stackoverflow.com/comment/38692709
has answer: http://stackoverflow.com/a/24910700
type: Question
answer count: 2
tagged with: google-maps
tagged with: javascript
tagged with: jquery
score: -1
tagged with: google-maps-api-3
accepted answer: http://stackoverflow.com/a/24910700
has body: function setCircleMap(lat,lng,Diameter){ // lat,lng,diameter get values from Server var myLatLng = new google.maps.LatLng(lat, lng); var mapOptions = { center: myLatLng, zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: true, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU }, zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.LARGE, position: google.maps.ControlPosition.RIGHT_CENTER }, panControl: true, panControlOptions: { position: google.maps.ControlPosition.RIGHT_CENTER } }; map = new google.maps.Map(document.getElementById("circleMap-canvas"), mapOptions); google.maps.event.addListener(map, "idle", function(){ google.maps.event.trigger(map, 'resize'); }); var circleOptions = { strokeColor: "#FF0000", strokeOpacity: 0.8, strokeWeight: 2, fillColor: "#FF0000",//32EBEB fillOpacity: 0.35, map: map, center: new google.maps.LatLng(lat, lng), radius: parseInt(Diameter,10) }; AOICircle = new google.maps.Circle(circleOptions); from above code i got the circle on map, but now i tried click on circle i need to get circle latitude,longitude values, i tried with this code, google.maps.event.addDomListener(AOICircle ,"click",function(e){ alert("clicked")//not get any alert }); is circle having event click option in v3-API, if give solution very helpfull for me.
has comment: http://stackoverflow.com/comment/38691985
favorite count: 0
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/38692302
possible better answer: http://stackoverflow.com/a/38125512
has comment: http://stackoverflow.com/comment/38692071
has comment: http://stackoverflow.com/comment/38692530
has answer: http://stackoverflow.com/a/38125512

http://stackoverflow.com/comment/38598990
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24855875
has text: I hear you. In the above example, isn't the code sufficient for the explanation. I would certainly add explanation in the future answers.
score: 0

http://stackoverflow.com/a/25430165
upvote count: 2
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/24882468
has body: I had a similiar issue with opening CRM 2013 URLs and was able to fix it by adding two query strings histKey (which takes a random number as value) and newWindow to the URL, as follows: "histKey=" + Math.floor(Math.random() * 10000) "newWindow=true" Hope this helps.

http://stackoverflow.com/a/24845274
upvote count: 1
has body: You probably meant to do window["func"] instead of window[func]. The latter expression is equivalent to window["function(someParam) { ... }"] (i.e., a whatever the content of func actually is). window probably does not have a property whose name is the entire stringified text content of func.
has comment: http://stackoverflow.com/comment/38615636
downvote count: 0
answers question: http://stackoverflow.com/q/24844424
type: Answer
has comment: http://stackoverflow.com/comment/38596674
has comment: http://stackoverflow.com/comment/38596751
has comment: http://stackoverflow.com/comment/38597126
score: 1

http://stackoverflow.com/q/24826226
type: Question
has answer: http://stackoverflow.com/a/24826359
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24826359
score: 0
tagged with: validation
answer count: 1
tagged with: angularjs
type: AnsweredQuestion
has body: With reference to this plunk: http://plnkr.co/edit/GzC9ufa1WJmKQ6Ad15v9?p=preview I have a directive that runs a test and then calls $scope.form['myfield'].setValidity() with the result. However this does not reflect in the view or the controller. Simple example that will always set false: app.directive('myDirective', function() { return { link: function(scope, elem, attrs) { elem.on('blur change', function() { console.log("start valid:" + scope.form[attrs.name].$valid); scope.form[attrs.name].$setValidity('myfield', false); console.log("end valid:" + scope.form[attrs.name].$valid); }); } }; }); in my view: &lt;input type="text" ng-model="myModel" name="myfield" my-directive/&gt; Console logging confirms that when the event in the directive first fires, the field is valid, then after setValidity it becomes false. On subsequent events it is false before the event fires. However, when I print out {{form['myfield'].$valid}} in the view, it remains true regardless. I guess this is might be a timing thing, that by the time setValidity(false) runs in the directive, the view has already checked. How do I fix this?
has title: Directive calls setValidity(false) on field but field validity never changes according to view

http://stackoverflow.com/q/24755779
type: Question
has comment: http://stackoverflow.com/comment/38411068
linked to: http://stackoverflow.com/q/23589174
has body: How to match character in the text except the first occurrence? Eg: 98C546CC456C67 should match 98C546CC456C67
tagged with: regex
has comment: http://stackoverflow.com/comment/38409630
accepted answer: http://stackoverflow.com/a/24756750
possible better answer: http://stackoverflow.com/a/24756693
has answer: http://stackoverflow.com/a/24756693
answer count: 3
has comment: http://stackoverflow.com/comment/38410764
upvote count: 1
has comment: http://stackoverflow.com/comment/38410903
tagged with: javascript
has answer: http://stackoverflow.com/a/24756750
has comment: http://stackoverflow.com/comment/38411110
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
has title: Regular expression for matching a character except the first occurrence
has answer: http://stackoverflow.com/a/24756505

http://stackoverflow.com/q/24801528
type: Question
has answer: http://stackoverflow.com/a/24801705
has title: Can't load content inside a div
tagged with: javascript
linked to: http://stackoverflow.com/q/18998192
accepted answer: http://stackoverflow.com/a/24801617
has comment: http://stackoverflow.com/comment/38495407
has body: I am trying to load some content inside a div #display. I have read many questions regarding this matter here, but still I have been unable to get it working. The alert function which I have just added for testing purpose works without any problem. Here is what I have tried $(document).ready(function(){ $('#townships').click(function() { $('#display').load("helloworld.html"); alert("Hi"); }); }); I am trying this offline. The helloworld.html file is in the same folder with the homepage file.
answer count: 3
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38495564
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38495462
has answer: http://stackoverflow.com/a/24801617
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/24806476
upvote count: 1
possible better answer: http://stackoverflow.com/a/24801705

http://stackoverflow.com/comment/38497992
score: 1
has text: The questions should be: why would you NOT define them outside this.y?
type: Comment
comment on: http://stackoverflow.com/q/24802817
type: QuestionComment

http://stackoverflow.com/a/24901049
answers question: http://stackoverflow.com/q/24899645
type: Answer
score: 0
has body: I went with Krzysztof Safjanowski's solution. It turns out I already had 'test/spec/**/*.js' in my karma.conf.js which meant I could just put common.js in my test/spec folder. Only thing to be careful of is isolation &amp; race conditions etc since the tests are run in parallel: files: [ 'app/bower_components/angular/angular.js', 'app/bower_components/angular-mocks/angular-mocks.js', 'app/bower_components/angular-resource/angular-resource.js', 'app/bower_components/angular-cookies/angular-cookies.js', 'app/bower_components/angular-sanitize/angular-sanitize.js', 'app/bower_components/angular-route/angular-route.js', 'app/bower_components/angular-bootstrap/ui-bootstrap.js', 'app/bower_components/angular-bootstrap/ui-bootstrap-tpls.js', 'app/bower_components/angular-touch/angular-touch.js', 'app/bower_components/angular-scroll/angular-scroll.min.js', 'app/bower_components/angular-gapi/modules/gapi-client.js', 'app/bower_components/angular-xeditable/dist/js/xeditable.js', 'app/bower_components/angular-gettext/dist/angular-gettext.js', 'app/bower_components//ngstorage/ngStorage.js', 'app/scripts/*.js', 'app/scripts/**/*.js', //'test/mock/**/*.js', 'test/spec/**/*.js' ],

http://stackoverflow.com/comment/38403830
type: Comment
type: QuestionComment
has text: second requirement is working fine ,i have edited code now
comment on: http://stackoverflow.com/q/24752316
score: 0

http://stackoverflow.com/q/24857334
has title: How to get the url of previous page in chrome extension
answer count: 0
tagged with: javascript
type: UnansweredQuestion
type: Question
tagged with: google-chrome-extension
tagged with: http://stackoverflow.com/tag/html
score: 0
has comment: http://stackoverflow.com/comment/38617037
tagged with: google-chrome
has body: I am trying to build a chrome extension for which I need to parse webpage from which files get downloaded. The problem is that when I click the download link I am redirected to another page from where my file gets downloaded.Now by using downloadItem.url; I am able to get the url but the url is of the page which I am redirected to ,But what I want is the url of page which contains the downloading link .Is there any way that I could get the url of previous page or I have to parse each and every webpage to check for the download link?for eg this
has comment: http://stackoverflow.com/comment/38604438

http://stackoverflow.com/q/24819064
score: 0
has body: Here is my Fiddle. I need to make the textbox to be displayed on the middle of the slider. The textbox should not get affected if hover. I tried z-index:999 But it didn't worked. I saw the questions div not showing above text box But it didn't helped me. Here is my code : html : Hover Style #5 A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. Read More css : .view-fifth:hover img { -webkit-transform: translateX(300px); -moz-transform: translateX(300px); -o-transform: translateX(300px); -ms-transform: translateX(300px); transform: translateX(300px); } How can i do this ?
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24819177
has answer: http://stackoverflow.com/a/24819235
type: Question
possible better answer: http://stackoverflow.com/a/24819177
has answer: http://stackoverflow.com/a/24819167
has title: How to make the textbox above the slider
linked to: http://stackoverflow.com/q/10716709
accepted answer: http://stackoverflow.com/a/24819167
has answer: http://stackoverflow.com/a/24819289
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/38663720
has text: Shouldn't the whole thing just be `function whatBring() {if (prompt('What brings Little Red Riding Hood in the basket? A: Food - B: Book - C:Carbon') == 'A') {alert('bene, conosci la storia!'); } else { alert("Hint: it's not correct!");} }`
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/24890264

http://stackoverflow.com/a/24817712
score: 0
accepted answer of: http://stackoverflow.com/q/24817582
answers question: http://stackoverflow.com/q/24817582
type: Answer
has body: You should use comma to separate event for separate IDs.Use following Update according to OP's requirement and New fiddle $(function(){ $('div').append( '&lt;input id="first"/&gt;&lt;input id="second"/&gt;' ); $('#first').on('click',function(){ $('#second').attr('id','third'); }); $('#second').bind('click',function(){ alert("third"); }); }); OR u can do it this way also Fiddle $(function(){ $('div').append( '&lt;input id="first"/&gt;&lt;input id="second"/&gt;' ); $('#first').on('click',function(){ $('#second').attr('id','third'); $('#third').bind('click',function(){ alert("third"); }); }); }); old one: $(document).on('change','#frmLocations , #cboSearch',function(event){ }); You can check here and here its working.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38526812
has comment: http://stackoverflow.com/comment/38526466

http://stackoverflow.com/comment/38632995
comment on: http://stackoverflow.com/q/24873807
type: QuestionComment
type: Comment
has text: yes, i figured i'd have to call it -> `slider.interval()`
score: 0

canvas
tags question: http://stackoverflow.com/q/24792134
tags question: http://stackoverflow.com/q/24871734
tags question: http://stackoverflow.com/q/24861043
tags question: http://stackoverflow.com/q/24851386
tags question: http://stackoverflow.com/q/24907322
tags question: http://stackoverflow.com/q/24811464
tags question: http://stackoverflow.com/q/24858293
tags question: http://stackoverflow.com/q/24784789
tags question: http://stackoverflow.com/q/24791555
tags question: http://stackoverflow.com/q/24846874
tags question: http://stackoverflow.com/q/24873422
tags question: http://stackoverflow.com/q/24765545
tags question: http://stackoverflow.com/q/24815365
tags question: http://stackoverflow.com/q/24859009
tags question: http://stackoverflow.com/q/24890296
tags question: http://stackoverflow.com/q/24892671
tags question: http://stackoverflow.com/q/24806167
tags question: http://stackoverflow.com/q/24881418
tags question: http://stackoverflow.com/q/24803185
tags question: http://stackoverflow.com/q/24850051
tags question: http://stackoverflow.com/q/24885326
tags question: http://stackoverflow.com/q/24788044
tags question: http://stackoverflow.com/q/24870494
tags question: http://stackoverflow.com/q/24883619
tags question: http://stackoverflow.com/q/24862257
tags question: http://stackoverflow.com/q/24824785
tags question: http://stackoverflow.com/q/24876908
tags question: http://stackoverflow.com/q/24844305
tags question: http://stackoverflow.com/q/24791445
tags question: http://stackoverflow.com/q/24856243
tags question: http://stackoverflow.com/q/24875192
tags question: http://stackoverflow.com/q/24882871
tags question: http://stackoverflow.com/q/24883585
tags question: http://stackoverflow.com/q/24841264
tags question: http://stackoverflow.com/q/24787880
tags question: http://stackoverflow.com/q/24799879
tags question: http://stackoverflow.com/q/24790386
tags question: http://stackoverflow.com/q/24823956
tags question: http://stackoverflow.com/q/24758442
tags question: http://stackoverflow.com/q/24903476
tags question: http://stackoverflow.com/q/24853908
tags question: http://stackoverflow.com/q/24852288
tags question: http://stackoverflow.com/q/24843443
tag name: canvas
tags question: http://stackoverflow.com/q/24887884
tags question: http://stackoverflow.com/q/24781078
tags question: http://stackoverflow.com/q/24780260
tags question: http://stackoverflow.com/q/24823034
tags question: http://stackoverflow.com/q/24858270
tags question: http://stackoverflow.com/q/24883480
type: Tag
tags question: http://stackoverflow.com/q/24770559
tags question: http://stackoverflow.com/q/24749630
tags question: http://stackoverflow.com/q/24783961
tags question: http://stackoverflow.com/q/24769089
tags question: http://stackoverflow.com/q/24766113
tags question: http://stackoverflow.com/q/24753940
tags question: http://stackoverflow.com/q/24894118
tags question: http://stackoverflow.com/q/24760537
tags question: http://stackoverflow.com/q/24841813
tags question: http://stackoverflow.com/q/24771123
tags question: http://stackoverflow.com/q/24880618
tags question: http://stackoverflow.com/q/24799218

http://stackoverflow.com/comment/38693217
comment on: http://stackoverflow.com/q/24905700
has text: can u show me how to do this?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/24769029
score: 1
has body: {{#constant}} is now removed. Previously meteor was not able to 'fix' areas of the screen you didn't want reactive. We needed to do this because jquery plugins would stop working when meteor changed the DOM. Since 0.8.0 we no longer need to do this since the new rendering engine 'understands' DOM a bit better. You can safely remove it without having to worry about anything breaking. The warning you see is a deprecation notice. {{#constant}} is actually ignored from 0.8.0.
accepted answer of: http://stackoverflow.com/q/24767124
answers question: http://stackoverflow.com/q/24767124
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/38445277

http://stackoverflow.com/a/24756477
score: 0
answers question: http://stackoverflow.com/q/24755259
has body: There are multiple problems in your try: You are putting handler in wrong place. Keeping it inside another click handler will assign handler multiple times and incrementaly call handler. You may want to click somewhere else to convert it back to span. So go with document click bind. Also, keep your code inside $(document).ready() function to ensure DOM has been loaded. Do this: $(document).ready(function() { var edit_box = $('[content-editable]'); $(document).on("click",function() { console.log($(event.target)); if($(event.target).is("[content-editable]")) { $(edit_box).html('&lt;input type="text" value="' + $(edit_box).html() + '"&gt;'); $(edit_box).find('input').select(); } else if(!$(event.target).is("input")){ $(edit_box).html($(edit_box).find('input').val()); } }); }); DEMO I have document click for my part but if you want to use body click handler then you may use it, but this will convert input back to span only on body clicks.
type: Answer

http://stackoverflow.com/comment/38531395
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24820627
has text: @Wolle Well that is the question my friend, is PHP/js able to do such tasks? or will i have to stick to c# or c++

http://stackoverflow.com/comment/38598263
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24855665
score: 0
has text: You need plain js or a jQuery solution would be fine?

http://stackoverflow.com/comment/38426453
score: 0
type: AnswerComment
type: Comment
has text: @Zhouster Please answer separately if you have figured it out. Please provide citation for the same, AFAIK HTML can be partially rendered and rendering blocks only on `css` which is not used here.
comment on: http://stackoverflow.com/a/24751318

http://stackoverflow.com/q/24877371
tagged with: javascript
has comment: http://stackoverflow.com/comment/38682995
has comment: http://stackoverflow.com/comment/38639792
favorite count: 0
has comment: http://stackoverflow.com/comment/38684425
has comment: http://stackoverflow.com/comment/38639640
type: UnansweredQuestion
has title: Javascript Input Validation Using Object
has comment: http://stackoverflow.com/comment/38639714
has body: Has anyone ever used input validation by passing a created object to a function? See my code. var inputValidation = { validationEmployeeName: "Please Enter Your Name", validationOdomReading: "Please Enter A Valid Number", validationEndReading: "The Ending Odometer Reading Must be &gt;= Beginning", validationDaysUsed: "Please Enter The Number of Days Car Used", validateEmployeeName: inputData.elements["txtEmployeeName"].value, validateBegOdomReading: parseFloat(inputData.elements["txtBegOdomReading"].value), validateEndOdomReading: parseFloat(inputData.elements["txtEndOdomReading"].value), validateDaysCarUsed: parseFloat(inputData.elements["txtDaysCarUsed"].value) }; //Input Validation validData = checkValidation(inputValidation);
answer count: 0
has comment: http://stackoverflow.com/comment/38639647
upvote count: 2
score: 1
has comment: http://stackoverflow.com/comment/38640113
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38639590
has comment: http://stackoverflow.com/comment/38639633

http://stackoverflow.com/comment/38689358
has text: @ChrisZ I have a code for you here. It's not exactly you are looking. But similar to that. [CLICK LINK](http://jsfiddle.net/yeshansachithak/zz5nk/). You can use the `jquery load function`
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24903217
type: Comment

http://stackoverflow.com/comment/38671665
has text: Thank you for your time. CORS does work with Python. I answered my own question above that my issue was a bad auth code. Dumb mistake on my part.
type: AnswerComment
comment on: http://stackoverflow.com/a/24894345
score: 0
type: Comment

http://stackoverflow.com/comment/38436460
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24770101
has text: You have a typo: `$("ul li a").attr("href", mydata.results[i].url);` remove the quotes around the variable.
score: 0

http://stackoverflow.com/q/24870617
has comment: http://stackoverflow.com/comment/38626686
linked to: http://stackoverflow.com/q/6332516
type: Question
has comment: http://stackoverflow.com/comment/38626602
has body: I'm trying to create fade in and fade out function with JavaScript, but it's not working. Please tell me what I'm doing wrong.I'm not getting transitioning effect. var fade_in_btn = document.getElementById('fade-in'), fade_out_btn = document.getElementById('fade-out'), fading_div = document.getElementById('fading-div'); function sleep(milliseconds) { var start = new Date().getTime(); for (var i = 0; i &lt; 1e7; i++) { if ((new Date().getTime() - start) &gt; milliseconds){ break; } } } fade_out_btn.onclick = function(){ for (var i=100; i &gt;= 0; i--) { sleep(0010); opacity_function(i); } } fade_in_btn.onclick = function(){ for (var i=1; i &lt;= 100; i++) { sleep(0010); opacity_function(i); } } function opacity_function(opacity_value){ fading_div.style.opacity = opacity_value / 100; fading_div.style.filter = 'alpha(opacity=' + opacity_value + ')'; console.log(fading_div.style.opacity); } Fiddle with HTML. All code Working Fine. But from my point of view problem is the for...loop is not updating the value of opacity after each iteration; it's only updating the final value. Please Help me to resolve this problem.
tagged with: javascript
has comment: http://stackoverflow.com/comment/38626888
has comment: http://stackoverflow.com/comment/38627070
has comment: http://stackoverflow.com/comment/38626520
score: 0
has answer: http://stackoverflow.com/a/24870928
has comment: http://stackoverflow.com/comment/38626753
has comment: http://stackoverflow.com/comment/38626550
answer count: 1
has comment: http://stackoverflow.com/comment/38626833
has comment: http://stackoverflow.com/comment/38627228
has title: Pure Javascript Fading in and fading out not working
linked to: http://stackoverflow.com/q/5832276
accepted answer: http://stackoverflow.com/a/24870928
type: AnsweredQuestion

http://stackoverflow.com/q/24854636
possible better answer: http://stackoverflow.com/a/24854685
has answer: http://stackoverflow.com/a/24854682
linked to: http://stackoverflow.com/q/11487216
has title: javascript: Internet Explorer not sending ajax call before form submit/page unload
has body: Trying to send AJAX POST on form submit. Already have a code working in all browsers except IE. Working code (except IE) $('form').one("submit", function(e) { $.ajax( { url : url, type: "POST", data : data, async: false, complete: function() { return true; } }); }); Tried almost everything I can, like onunload and onbeforeunload, and obviously the general onsubmit (both native Javascript and jQuery methods). But IE won't wait for AJAX calls to finish and loads the form action page. onbeforeunload would make it wait, but bring a dialogue confirmation box (which I am not willing to show). Also, async:false doesn't work on IE. I can't use HTTPRequest as the request is cross domain. Again, XDomainRequest is asynchronous, so even that is not useful. Other ways, like event.preventDefault() won't submit the form after callback. Note: The form on the page is submitted after successful validation with native submit function. I can't mess that code because it belongs to our client, and we are loading our code asynchronously. Already checked links: using onbefore unload onbeforeunload with timeout
type: Question
accepted answer: http://stackoverflow.com/a/24874369
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/24874369
upvote count: 3
answer count: 3
has answer: http://stackoverflow.com/a/24854685
tagged with: onbeforeunload
favorite count: 0
linked to: http://stackoverflow.com/q/21228349
type: AnsweredQuestion
score: 3
linked to: http://stackoverflow.com/q/9480302
tagged with: internet-explorer-8

http://stackoverflow.com/comment/38640479
type: Comment
type: QuestionComment
has text: then you're probably asking in the wrong place. Asking on the ES6 mailing lists is far more likely to give you answer you want. Stackoverflow's foremost about asking code questions with code answers.
score: 1
comment on: http://stackoverflow.com/q/24877452

http://stackoverflow.com/a/24864217
has body: Usually the solution is to HTML encode the offending data which is being sent to the server. Since the error occurs on run, try and identify the line of code triggering the error, probably from javascript.
answers question: http://stackoverflow.com/q/24864156
score: 0
type: Answer

http://stackoverflow.com/comment/38593406
has text: already tried..but not working
comment on: http://stackoverflow.com/q/24853294
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/38679422
type: AnswerComment
comment on: http://stackoverflow.com/a/24898445
type: Comment
has text: Ah, I see you have the button in an update panel. Instead of using that as your selector, try this: $(document).on('click', '[id*=submitform]', function () {}); When the update panel is updated, your click event is being discarded. by binding to the document instead and providing the selector as a parameter, you should be good.
score: 0

http://stackoverflow.com/a/24763530
accepted answer of: http://stackoverflow.com/q/24762288
type: AcceptedAnswer
downvote count: 0
has body: I took a stab at your code and added a simple jquery code to show you how to toggle between '+' and '-' icon. Note that for this example, i used text, but you can replace the text by an image and so on. Here is the updated jsfiddle In your TabContainer link I changed it this way. Instead of using inline javascript function call onClick, you can simplify everything by giving a main class to all your headers. Next you can add a custom attribute, in this case 'data-content' to which you give the id of the tab you wish to display. Inside the link tag, i added a 'span' tag with the '+' text. Test1 + In order to toggle your tab, I added this bit of jquery. We create an Onclick event for our main tab header class. Once a click is made, we can extract the id of the tab to display by getting the value of our custom attribute. Next we can select all content tabs with jquery to hide everything. Once this is done, you can use the id to display the current content tab. Again, with jquery, we target all toggle icon and reset everything. Finally, you can use the 'this' selector, that refers to the current 'myTabHeader' that was clicked and you can search its children elements with jquery '.find(x)' method. This way, you can then call the '.text("string")' to change, well, the text. //On Document ready $(function(){ //Click event for our Accordion Tab Headers $('.myTabHeader').click(function(){ //Get which tab to display var openTab = $(this).attr('data-content'); //Close all visible tabs $('.tabContent').css({ display:'none' }); //Display our selected tab $('#'+openTab).css({ display:'block' }); //Reset icon $('.toggle-icon').text("+"); //Change icon for currently opened tab $(this).find('.toggle-icon').text("-"); }); }); Of course, like I said, you could add an image in the span element instead of text. Then you could just change this part: //Reset icon $('.toggle-icon img').attr('src','/images/path-to-Plus-icon-image.jpg'); //Change icon for currently opened tab $(this).find('im…
answers question: http://stackoverflow.com/q/24762288
score: 1
has comment: http://stackoverflow.com/comment/38429242
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/38431031

http://stackoverflow.com/q/24777399
has title: How to set input state angularjs
tagged with: angularjs
tagged with: twitter-bootstrap
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24777608
type: Question
answer count: 2
has body: I have some form with angularjs valid/invalid states. Name Name shouldn't be empty Name already exists How do I set input to invalid state based on result of isDublicateColumn($parent.filterName) ? Or is any better way to change bootstrap state to 'has-error' when isDublicateColumn($parent.filterName) return true ?
has answer: http://stackoverflow.com/a/24778218
tagged with: javascript
has comment: http://stackoverflow.com/comment/38450661
score: 0
tagged with: validation

http://stackoverflow.com/comment/38455456
has text: OK i won't may be it will help others
score: 0
comment on: http://stackoverflow.com/a/24780326
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29944927
upvote count: 12
downvote count: 0
score: 12
answers question: http://stackoverflow.com/q/24768795
has body: Here is a version of Rory's approach above, except written to function as a jQuery plugin. It may have more general applicability in that format. Great answer, Rory - thanks! $.fn.visibleHeight = function() { var elBottom, elTop, scrollBot, scrollTop, visibleBottom, visibleTop; scrollTop = $(window).scrollTop(); scrollBot = scrollTop + $(window).height(); elTop = this.offset().top; elBottom = elTop + this.outerHeight(); visibleTop = elTop &lt; scrollTop ? scrollTop : elTop; visibleBottom = elBottom &gt; scrollBot ? scrollBot : elBottom; return visibleBottom - visibleTop } Can be called with the following: $("#myDiv").visibleHeight(); jsFiddle
type: Answer
has comment: http://stackoverflow.com/comment/55833565

http://stackoverflow.com/q/24837575
accepted answer: http://stackoverflow.com/a/24840027
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/24840027
has body: I think my title sums up my question. If I hover the mouse over one state in a d3 map, how do I change the colors of a preset group of other states? I could do something like.. .on("mouseover", function(d,i) { if this == (one of the present map selections){ d3.select({theotherdataname}}.parentNode.appendChild({{theotherdataname??}})).transition().duration(300) .style({'stroke-opacity':1,'stroke':'#F00'}); } } }); OK that is terrible code. But I wanted to offer something to start. Can someone please point me in the right direction? Maybe I need to completely update the chart data?
tagged with: d3.js
has comment: http://stackoverflow.com/comment/38564953
type: AnsweredQuestion
type: Question
has title: On mouseover one state, change colors of other states with d3 map

http://stackoverflow.com/comment/38590495
type: AnswerComment
comment on: http://stackoverflow.com/a/24851862
type: Comment
score: 2
has text: forEach is native javascript

http://stackoverflow.com/comment/38615745
has text: http://jigsaw.w3.org/css-validator/documentation.html Try this
comment on: http://stackoverflow.com/q/24864919
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38676729
type: AnswerComment
has text: i getting a white pdf no images are there
type: Comment
comment on: http://stackoverflow.com/a/24896731
score: 0

http://stackoverflow.com/comment/38419290
score: 4
comment on: http://stackoverflow.com/q/24758683
has text: @pattmorter isn't [this](http://nodejs.org/api/debugger.html) a Node debugger? Sure looks like it to me...
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24802984
tagged with: developer-tools
answer count: 1
linked to: http://stackoverflow.com/q/13092715
upvote count: 3
has title: localStorage.property vs localStorage['property']
tagged with: google-chrome
has body: Is there a difference between writing localStorage['key'] = value or localStorage.setItem('key', value)? I saw this question marked as duplicate but within Developer Tools the behavior of both notations is different: the bracket notation does not seem to serialize to a string. For instance: &gt; localStorage['key'] = [1,2,3] [1, 2, 3] &gt; localStorage.setItem('other', [4,5,6]) undefined &gt; localStorage.key [1, 2, 3] &gt; localStorage.other "4,5,6" &gt; localStorage.key.length 3 &gt; localStorage.other.length 5 Can anyone explain that difference in behavior? Can I use the bracket notation and forget about always serializing to JSON?
has answer: http://stackoverflow.com/a/24803910
tagged with: web-storage
has comment: http://stackoverflow.com/comment/38499844
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38499414
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/24803910
favorite count: 0
has comment: http://stackoverflow.com/comment/38498127
type: Question
tagged with: local-storage

http://stackoverflow.com/q/24854401
type: Question
score: 1
has title: javascript text match count and regex spaces not work
has body: i have a ploblem. im genereting a small scipt for text matches cont and ordering match counts. click to see jsfiddle live example my example scripts : var testtext1 = "apple banana and kiwi pineapple juice"; var testtext2 = "need apple banana pineapple milkshake"; var testtext3 = "apple pineapple lower prices"; var testtext4 = "only apple banana kiwi pineapple lovers"; var testtext5 = "kiwi pineapple apple banana sales"; alert(testtext1.match(/apple banana kiwi|apple banana|apple|banana|kiwi/gi).length); //3 matches alert(testtext2.match(/apple banana kiwi|apple banana|apple|banana|kiwi/gi).length); //2 m alert(testtext3.match(/apple banana kiwi|apple banana|apple|banana|kiwi/gi).length); //2 m alert(testtext4.match(/apple banana kiwi|apple banana|apple|banana|kiwi/gi).length); //2 m alert(testtext5.match(/apple banana kiwi|apple banana|apple|banana|kiwi/gi).length); //3 matches text1= only 3 matches why ? watch regex apple banana kiwi OR apple banana OR apple OR banana OR kivi apple banana kiwi NO match 0 apple banana YES match 1 appple YES match 2 banana YES match 3 kiwi YES match 4 okay why return 3 matches not 4 matches ?? and other examples ?
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/24854425
accepted answer: http://stackoverflow.com/a/24854425
favorite count: 0
tagged with: regex
type: AnsweredQuestion
tagged with: whitespace
upvote count: 1
tagged with: match

http://stackoverflow.com/q/24863889
tagged with: javascript
tagged with: ajaxcontroltoolkit
has body: My ModalPopupExtender works as expected if you click into the texbox named as it's control id. &lt;cc1:modalpopupextender id="ModalPopupExtender1" runat="server" targetcontrolid="txtCosCodeExpCode" popupcontrolid="Panel1" backgroundcssclass="ModalPopupBG"&gt; &lt;/cc1:modalpopupextender&gt; However, if you use the tab button, placing the cursor in the control field, the popup does not happen. Is there a way I can do this?
answer count: 1
has answer: http://stackoverflow.com/a/24865363
tagged with: asp.net
type: UnansweredQuestion
score: 0
has title: Can I make a ModalPopupExtender respond to tabbing cursor to control field?
type: Question

http://stackoverflow.com/q/24883585
accepted answer: http://stackoverflow.com/a/24895485
has body: I'm very new to javascript and canvas and I have a program that's supposed to detect elements animated on an elliptical path. It later on goes to form a tree.. But this is the basic structure that I've linked onto jsfiddle. It works fine without scaling or panning but as soon as I try to scale or Pan, the mouse coordinates go haywire. I tried following markE's advice from HTML5 canvas get coordinates after zoom and translate But i'm definitely doing something wrong and I've clearly not understood whats happening with the canvas and the transformation matrix. I've spent about 3 days trying to change all the combinations I can think of but I can't seem to figure it out :s SOLVED: Here's my code with zooming and mouse panning and for animating and detecting elements on an ellipse: http://jsfiddle.net/metalloyd/A8hgz/ theCanvas = document.getElementById("canvasOne"); context = theCanvas.getContext("2d"); var status = document.getElementById('status'); var $canvas = $("#canvasOne"); var canvasOffset = $canvas.offset(); var offsetX = canvasOffset.left; var offsetY = canvasOffset.top; var scrollX = $canvas.scrollLeft(); var scrollY = $canvas.scrollTop(); var cw = theCanvas.width; var ch = theCanvas.height; var scaleFactor = 1.00; var panX = 0; var panY = 0; var mainX = 250; // setting the middle point position X value var mainY = 100; // setting the middle point position Y value var mainR = 125; // main ellipse radius R var no = 5; // number of nodes to display var div_angle = 360 / no; var circle = { centerX: mainX, centerY: mainY + 100, radius: mainR, angle: .9 }; var ball = { x: 0, y: 0, speed: .1 }; var a = 1.8; //Ellipse width var b = .5; //Ellipse height //Scale and Pan variables var translatePos = { x: 1, y: 1 }; var startDragOffset = {}; var mouseDown = false; var elements = [{}]; // Animate var animateInterval = setInterval(drawScreen, 1); //Animation function drawScreen() { context.clearRect(0, 0, cw, ch); // Background box context.beginPath(); context.fillStyle …
linked to: http://stackoverflow.com/q/21717001
has title: Mouse coordinates don't match after Scaling and Panning canvas
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38782514
favorite count: 0
has comment: http://stackoverflow.com/comment/38651955
tagged with: animation
type: Question
has answer: http://stackoverflow.com/a/24895485
type: AnsweredQuestion
score: 10
upvote count: 10
tagged with: canvas
has comment: http://stackoverflow.com/comment/38776889
tagged with: html5-canvas
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/38580877
comment on: http://stackoverflow.com/q/24846877
has text: What is `#SelectFilled`?
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/38646217
has text: A `Frustum` takes 6 `Plane`s as arguments, you're not providing anything. That's probably why it doesn't work.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24877880

http://stackoverflow.com/comment/38540828
type: Comment
has text: As the error states, `line[1]` is undefined.
type: QuestionComment
comment on: http://stackoverflow.com/q/24825568
score: 3

http://stackoverflow.com/comment/38694270
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/24906640
has text: don't think you need type for html5
type: Comment

http://stackoverflow.com/comment/38569196
comment on: http://stackoverflow.com/a/24840736
type: AnswerComment
score: 0
type: Comment
has text: Your code is fine, but please consider adding an explanation of what you changed/did so that future readers can use this question and answer to solve their own problems.

http://stackoverflow.com/q/24824635
type: Question
has body: how can I make effects like they are on Mesut Oezils webpage I mean the effect where the background moves slower as the rest of the page. Or the effect at the end of the page where the last content scrolls up and the footer stands. Is there a jquery plugin or how do I make this? And a last question: For example I have a big Image with opacity 1 on my landing page. How can I turn the opacity down to 0.3 when I start to scroll down (and the image stays with position:fixed). It would be cool when the opacity is based on the scrolled px until a minimum like 0.3 so that it is not an animation that is triggered at a fixed point.
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24825164
score: 0
answer count: 1
tagged with: parallax
type: AnsweredQuestion
has title: How To make these effect like on MesutOezil webpage?
accepted answer: http://stackoverflow.com/a/24825164

http://stackoverflow.com/comment/38677422
type: Comment
type: QuestionComment
has text: you probably need to wrap it in document.ready function
comment on: http://stackoverflow.com/q/24897452
score: 0

http://stackoverflow.com/comment/38550905
comment on: http://stackoverflow.com/q/24828781
score: 0
type: Comment
type: QuestionComment
has text: OK i found it value="'+frm.speciesweight.value+'" name was wrong should be value="'+frm.speciesweight1.value+'" Thanks for the comments

http://stackoverflow.com/q/24880844
tagged with: asp.net
favorite count: 0
has answer: http://stackoverflow.com/a/24958720
has comment: http://stackoverflow.com/comment/38646018
has comment: http://stackoverflow.com/comment/38646094
upvote count: 2
tagged with: nivo-slider
tagged with: css
answer count: 1
has comment: http://stackoverflow.com/comment/38646563
has body: My nivo slider runs only for one time at the time of loading very fastly then it wont loop again
has comment: http://stackoverflow.com/comment/38646024
score: 2
has comment: http://stackoverflow.com/comment/38646403
has title: nivo slider does work for only once
downvote count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/38646377

http://stackoverflow.com/a/24784947
has comment: http://stackoverflow.com/comment/38482480
type: AcceptedAnswer
has body: Posting an answer purely because it was fun to solve. But really, had you given it a serious try yourself, you probably would have been able to solve this in a few minutes. Make chrome dev tools your best buddy. :-) function express(_number) { // s is a string representation of your number // o is where the output is generated var s = _number.toString(), o = ''; // while there are more digits while(+s &gt; 0) { // append a separator if not the first digit o += (o !== '' ? ' + ' : ''); // append the first digit followed by the appropriate number of zeros o += (+s.substr(0, 1) * Math.pow(10, s.length - 1)).toString(); // strip off first digit from the number s = s.substr(1); } // return the result return o; } And you can call it like: express(5467) to get back the string "5000 + 400 + 60 + 7"
type: Answer
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24784156
answers question: http://stackoverflow.com/q/24784156
upvote count: 3

http://stackoverflow.com/comment/38570048
comment on: http://stackoverflow.com/a/24839081
score: 0
type: AnswerComment
has text: OK I think that I am going for the good way... only a last question, how is it possible to know the request.referer that is OUTSIDE of your domain. I mean to take only the value when the URL is not your domain.
type: Comment

http://stackoverflow.com/comment/38552164
has text: Yes, there is an Areas. I assume you're referring to a folder within the project structure?
comment on: http://stackoverflow.com/q/24829688
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24851942
upvote count: 0
score: -2
has comment: http://stackoverflow.com/comment/38590635
tagged with: javascript
has body: When I tab, the result putted in the textbox was NaN. While in my computer at home, it outputs a number. Please help. function ageCount() { var date1 = new Date(); var dob = document.getElementById("dob").value; var date2 = new Date(dob); var pattern = /^\d{4}-\d{1,2}-\d{1,2}$/; if (pattern.test(dob)) { var y1 = date1.getFullYear(); //getting current year var y2 = date2.getFullYear(); //getting dob year var age = y1 - y2; //calculating age document.getElementById("ageId").value = age; document.getElementById("ageId").focus (); return true; } else { alert("Invalid date format. Please Input in (dd/mm/yyyy) format!"); return false; } }
favorite count: 0
linked to: http://stackoverflow.com/q/6177975
has comment: http://stackoverflow.com/comment/38590630
has answer: http://stackoverflow.com/a/24852017
has title: NaN error in Javascript
type: UnansweredQuestion
downvote count: 2
has answer: http://stackoverflow.com/a/24852216
type: Question
answer count: 2

http://stackoverflow.com/q/24893165
score: 2
answer count: 0
type: Question
tagged with: firefox
tagged with: javascript
has title: Cisco Web Communicator dll plugin available to use in html page but not in FF extension/addon
has comment: http://stackoverflow.com/comment/38669196
tagged with: firefox-addon
downvote count: 0
has body: I'm scratching my head on an issue with Firefox accessing a dll file in an extension. I am using version 3.0.6. The functions of the dll is handled through a cwic.js file, which can be referenced here. The functions of registering a phone, making a call, etc can all be accessed and works when I make a simple html page with JS and load it with Firefox. However, once I try and have functionality in an extension toolbar it fails. I'm using Firefox 24. extension.xul &lt;overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"&gt; &lt;!--I have some more code here--&gt; &lt;!--Init Plugin--&gt; &lt;window id="main-window"&gt; &lt;vbox collapsed="true"&gt; &lt;html:object type="application/x-ciscowebcommunicator" heigth="1" width="1" id="ciscowebcommunicator" style="visibility:hidden;"&gt; &lt;/html:object&gt; &lt;html:div id="call-container" /&gt; &lt;/vbox&gt; &lt;/window&gt; install.rdf contains this line &lt;em:unpack&gt;true&lt;/em:unpack&gt; My extension script $("#call-container").cwic('init', { ready: function(){ /* DISABLE CERTIFICATION */ if ((jQuery(document).cwic('about').capabilities.certValidation)) { jQuery(document).cwic('disableCertValidation'); } jQuery(this).cwic('registerPhone', { //values below are referenced elsewhere user: username, password: password, mode: 'DeskPhone', cucm: 'CUCM_IP', success: function() { alert('logged in!'); } }); } }); Error I get back [12:47:07.420] "[cwic] 22/07/2014 12:47:07.419 Plugin not available" I'm not sure why it wont work in an extension. I used alert() to check if the block runs, and it should. Would appreciate any help.
favorite count: 0
has comment: http://stackoverflow.com/comment/38669284
upvote count: 2
type: UnansweredQuestion
tagged with: browser-plugin
tagged with: xul

http://stackoverflow.com/q/24873807
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24874104
has comment: http://stackoverflow.com/comment/38632995
has title: Why is a function being self-invoked within an object literal?
has comment: http://stackoverflow.com/comment/38633409
possible better answer: http://stackoverflow.com/a/24874104
type: Question
accepted answer: http://stackoverflow.com/a/24873933
tagged with: javascript
has comment: http://stackoverflow.com/comment/38632907
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38633472
has comment: http://stackoverflow.com/comment/38633036
tagged with: setinterval
tagged with: jquery
has body: jQuery (fragmented for simplicity) The interval property contains an setInterval() function with in the object literal slider, the setInterval() defined in interval is invoking itself, or at-least appears to be, but why? var slider = { config : function(imgs, callback){ //mandatory var images = $(imgs); //optional var animationInterval; var animationTime; callback(images); }, target : 0, get lastElem(){ return this.images.length-1; }, interval : setInterval(function () { setSlider(); }, 3000) }; slider.config('ul.images li', setConfig); slider.images.hide().first().show(); function setConfig(imgs){ slider.images = imgs; } function setSlider(dest) { slider.target === slider.lastElem ? slider.target = 0 : slider.target++; slider.images.hide().eq(slider.target).fadeIn(1000); slider.triggers.removeClass('active').eq(slider.target).addClass('active'); } JSFiddle
has answer: http://stackoverflow.com/a/24873933
has comment: http://stackoverflow.com/comment/38633341
has comment: http://stackoverflow.com/comment/38633462

http://stackoverflow.com/q/24793523
has comment: http://stackoverflow.com/comment/38489273
has answer: http://stackoverflow.com/a/24799862
tagged with: javascript
score: 0
answer count: 1
has body: Is there a way to programmatically add a lookup field to a form using JavaScript? I can't seem to find anything in the SDK, so I assume it is not supported. Has anyone accomplished this using unsupported methods?
accepted answer: http://stackoverflow.com/a/24799862
has comment: http://stackoverflow.com/comment/38520686
tagged with: dynamics-crm
has comment: http://stackoverflow.com/comment/38520843
type: AnsweredQuestion
has title: Dynamically Add a Lookup to a CRM 2013 Form
tagged with: dynamics-crm-2013
type: Question

http://stackoverflow.com/a/24794382
score: 3
accepted answer of: http://stackoverflow.com/q/24793547
answers question: http://stackoverflow.com/q/24793547
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 3
has body: Showing printing page number can be achieved by using CSS counter and pseudo class. I've implemented a simple example for this issue, you could refer to it: HTML Page 1 title Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nulla laborum necessitatibus maiores nesciunt, blanditiis nihil error ratione quasi optio, quam, tempore. Dolore, quae nostrum labore aliquid accusantium modi beatae. Magni.lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quaerat fuga inventore magnam non, omnis temporibus excepturi, veniam hic voluptas minus autem laudantium, quis quos, ratione optio! Rerum quod, alias ipsa. Page 2 title Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nulla laborum necessitatibus maiores nesciunt, blanditiis nihil error ratione quasi optio, quam, tempore. Dolore, quae nostrum labore aliquid accusantium modi beatae. Magni.lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quaerat fuga inventore magnam non, omnis temporibus excepturi, veniam hic voluptas minus autem laudantium, quis quos, ratione optio! Rerum quod, alias ipsa. CSS @media print{ body{ counter-reset: pageNumber; } .pager{ min-height: 800px; } .page-breaker{ page-break-after: always; text-align: center; } .page-breaker:before{ counter-increment: pageNumber; content: "Page:" counter(pageNumber); } } "counter-reset" will initialize the value of variable 'pageNumber' which is maintained by CSS. This variable will be increased by CSS rules (in this case, .page-breaker:before). It means that increase the page number per page-breaker. Screenshot:

http://stackoverflow.com/a/24888581
has body: You should not name any form element "submit" since that will mask/eclipse the JavaScript form.submit() function and it will not be available! You can address any form field by its name using document["nameOfForm"]["nameOfField"] or document.nameOfForm.nameOfField. There are already form properties like document.myForm.name or methods like document.myForm.submit(). Using names of form properties or methods that are already defined by the browser will interfere with any functionality that depends on them. Other common field names to avoid: action enctype method name target It appears your JS library of choice is using form.submit() to submit the form.
answers question: http://stackoverflow.com/q/24888237
downvote count: 0
has comment: http://stackoverflow.com/comment/38684571
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/38688473
score: 1

http://stackoverflow.com/q/24782303
tagged with: gruntjs
has title: Compiling less files with Grunt
accepted answer: http://stackoverflow.com/a/25475538
has answer: http://stackoverflow.com/a/24782380
has body: Complete newbie to Grunt here, but basically I am trying to use Grunt to do a couple of things to start with. Minify a JS file, and compile multiple LESS files into one CSS file. The javascript bit works i.e. my file custom.js compresses to a file called custom.min.js, however the LESS bit doesn't work at all (no errors, just doesn't compile). Can anyone see why this is? module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), uglify: { build: { src: 'scripts/custom.js', dest: 'scripts/custom.min.js' } }, less: { build: { src: 'less/*.less', dest: 'style.css' } }, watch: { files: ['scripts/custom.js'], tasks: ['uglify','less'] } }); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-less'); // Default task(s). grunt.registerTask('default', ['uglify']); };
answer count: 3
downvote count: 0
favorite count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/38459606
has comment: http://stackoverflow.com/comment/38459344
tagged with: css
tagged with: node.js
possible better answer: http://stackoverflow.com/a/24782364
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25475538
has answer: http://stackoverflow.com/a/24782364
tagged with: less
type: Question
tagged with: javascript

http://stackoverflow.com/q/24835114
has answer: http://stackoverflow.com/a/24835291
has comment: http://stackoverflow.com/comment/38559364
favorite count: 0
has title: query error using Parse javascript sdk
tagged with: parse-platform
downvote count: 0
has comment: http://stackoverflow.com/comment/38559108
has comment: http://stackoverflow.com/comment/38559383
has comment: http://stackoverflow.com/comment/38559047
has comment: http://stackoverflow.com/comment/38559215
type: AnsweredQuestion
has body: In my code I would like to allow the user to delete their images. Here's my code var Image = Parse.Object.extend("Image"); var query = new Parse.Query(Image); query.equalTo('data', image); query.find({ success: function(results) { window.result = results; console.log('successful query', results, image); }, error: function(error) { console.log('Error: ' + error.code + ' ' + error.message); } }); the results object keeps returning an empty array. What could be causing this issue? I'm entering the success branch but it's an empty array. Could there be a limit to the size of the element you select for? this image variable is a datastring for a url it is very long > 12K characters.
score: 1
accepted answer: http://stackoverflow.com/a/24835291
type: Question
upvote count: 1
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/24766746
has comment: http://stackoverflow.com/comment/38430141
type: Answer
has body: Try using this : google.maps.event.addListener(markerAcademicCenter, "mouseover", function (e) { markerIconAcademicCenter.setIcon('url to icon'); }); instead of code below : google.maps.event.addListener(markerAcademicCenter, "mouseover", function (e) { markerIconAcademicCenter.url = 'MapIcons/Circle32.png' }); This will sort out your problem of icon size change on mouseover and mouseout problem.
has comment: http://stackoverflow.com/comment/38430038
has comment: http://stackoverflow.com/comment/38430313
answers question: http://stackoverflow.com/q/24766416
score: 0

http://stackoverflow.com/a/24903879
score: 0
has body: paste_retain_style_properties: "all" should be what you looking for, but as this does not work, maybe try to replace all with color font-size… Or set paste_auto_cleanup_on_paste to false, as the documentation does not really specify what this actually does
answers question: http://stackoverflow.com/q/24891400
type: Answer

http://stackoverflow.com/a/24790522
has comment: http://stackoverflow.com/comment/38476108
has comment: http://stackoverflow.com/comment/38479599
has comment: http://stackoverflow.com/comment/38475708
downvote count: 1
has comment: http://stackoverflow.com/comment/38475651
has comment: http://stackoverflow.com/comment/38475929
type: Answer
has comment: http://stackoverflow.com/comment/38475638
has body: You don't really need jQuery for this, so here's a plain-old JavaScript solution. Declare this function: function setOptionByValue(select, value){ var options = select.options; for(var i = 0, len = options.length; i &lt; len; i++){ if(options[i].textContent === value){ select.selectedIndex = i; return true; //Return so it breaks the loop and also lets you know if the function found an option by that value } } return false; //Just to let you know it didn't find any option with that value. } Use it like this: setOptionByValue(document.getElementById('ifacility'), 'Room 2'); Demo
score: 7
has comment: http://stackoverflow.com/comment/38476715
has comment: http://stackoverflow.com/comment/38476006
has comment: http://stackoverflow.com/comment/38475660
has comment: http://stackoverflow.com/comment/38476084
upvote count: 8
has comment: http://stackoverflow.com/comment/38476035
accepted answer of: http://stackoverflow.com/q/24790457
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24790457

http://stackoverflow.com/comment/38670602
type: Comment
comment on: http://stackoverflow.com/q/24893944
has text: Where is `CDV` being defined?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/38552800
type: QuestionComment
comment on: http://stackoverflow.com/q/24831689
score: 0
has text: I have added a picture of part of the source I am dealing with. @Diodeus it is all on the same domain and is actually built into sharepoint.
type: Comment

http://stackoverflow.com/comment/38489782
type: Comment
type: QuestionComment
has text: What specific pitfall are you alluding to ? What's your exact problem ? In the general case there's nothing better than `/` to divide two js numbers to get another js number.
score: 6
comment on: http://stackoverflow.com/q/24798322

http://stackoverflow.com/comment/38579527
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24845835
has text: I was originally thinking it have been possible to use selectors, or listening to the entire DOM somehow, to obtain which element was clicked or fired off certain event. I don't know the deeper side of javascript to know what methods to call.
score: 0

http://stackoverflow.com/comment/38577795
has text: Is there a reason you have to use a `div` with `contenteditable` instead of a `textarea` or something similar?
score: 0
comment on: http://stackoverflow.com/q/24845254
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24810937
has comment: http://stackoverflow.com/comment/38515817
has comment: http://stackoverflow.com/comment/38513382
answers question: http://stackoverflow.com/q/24810788
type: Answer
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer
has body: Yes, in this case, because getPubSubz is only called in one place, immediately after declaring it, it could safely be inlined. It's hard to say exactly what the author had in mind, but in a growing code base there may be some value to having a "getter" function which could be modified if the act of getting the pubsubz object required more advanced logic.
accepted answer of: http://stackoverflow.com/q/24810788

http://stackoverflow.com/comment/38440884
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/24772521
type: Comment
has text: PLease post your full code

http://stackoverflow.com/comment/38498788
has text: Try the following $('yourparentElement[data-1:contains("--,--,--")]').further your acitons.if you can share your code i can figure out more easily.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24803312
score: 0

http://stackoverflow.com/a/24900558
upvote count: 1
has comment: http://stackoverflow.com/comment/38683369
type: Answer
has comment: http://stackoverflow.com/comment/38683387
answers question: http://stackoverflow.com/q/24900481
downvote count: 0
score: 1
has body: JSFIDDLE a Basic example of what you want to achieve : JS : $('a').on("click",function(){ alert($(this).text()); if($(this).text() == "Print 1"){ $('#1').show(); $('#2').hide(); }else{ $('#2').show(); $('#1').hide(); } }); putting an event on click of your anchors and then checking the value of the clicked anchor.

http://stackoverflow.com/q/24783040
answer count: 1
tagged with: javascript
has title: Dynamically generate url and page content from multiple JSON files using node.js
score: 0
has comment: http://stackoverflow.com/comment/38461777
tagged with: node.js
has comment: http://stackoverflow.com/comment/38460805
has answer: http://stackoverflow.com/a/24783386
tagged with: loops
type: AnsweredQuestion
has body: I was trying to generate multiple url/pages using node.js express. I have multiple (currently 10 but the number may change) urls stored in one JSON file and I have another 10 (bound to change) JSON files that contain the information for each url respectively. Currently I am using request-json to get the JSON file from a local server. However, my codes only allow me to create the very last url and its content in the loop client.get("url1", function(error, response, body){ for (var i=0; i&lt;10; i++){ var urlName = body.row[i]; client.get("url2" + urlName, function(error, response, body) { app.get('/'+ urlName, function (req, res){ res.send(body); }) }) } });
tagged with: http://stackoverflow.com/tag/json
type: Question
accepted answer: http://stackoverflow.com/a/24783386

http://stackoverflow.com/comment/38598579
score: 1
comment on: http://stackoverflow.com/q/24855840
has text: It moves just as expected, top is still top even when rotated, it's just the top of the element, and not neccessarely the top of the window, so it's just not what you seem to expect, but it actually makes perfect sense. Look into tranforming the origin instead.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38478268
has text: `$('html, body').add(document)`
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24791954
type: QuestionComment

http://stackoverflow.com/q/24788286
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24788354
tagged with: ajax
type: Question
has body: This question is a followup to a question asked a while ago. Here is my block of code: &lt;head&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div&gt; &lt;a class="link" href="#about" data-link="first"&gt;Instructions&lt;/a&gt; &amp;#8226; &lt;a class="link" href="#about" data-link="second"&gt;Video&lt;/a&gt; &amp;#8226; &lt;/div&gt; &lt;div&gt; &lt;div class="instruction_type" data-link="first"&gt; &lt;p&gt;TEXT 1&lt;/p&gt; &lt;/div&gt; &lt;div class="instruction_type" data-link="second"&gt; &lt;p&gt;TEXT 2&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;script type="text/javascript"&gt; $('.instruction_type').hide(); $('.link').click(function() { $('.instruction_type').hide(); $('.instruction_type[data-link=' + $(this).data('link') + ']').fadeIn({ width: '200px'}, 300); }); &lt;/script&gt; It is functional! However, currently, you load the page and see two clickable links: "Instructions" and "Video." The rest of the page is blank. I would like the page to DEFAULT to "Instructions" and then if you click "Video" it changes the content of the page. To be clear: functional code, want to have the page display Instructions upon loading.
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24788563
has title: Change content of div with button outside that div?
score: 0
has answer: http://stackoverflow.com/a/24788327
answer count: 3
possible better answer: http://stackoverflow.com/a/24788327
tagged with: javascript
has answer: http://stackoverflow.com/a/24788354
type: AnsweredQuestion

http://stackoverflow.com/comment/38439583
type: QuestionComment
has text: Kevin, you are correct. I am having duplicate IDs. How can I resolve that? This is where I downloaded the modal plugin. http://www.jacklmoore.com/notes/jquery-modal-tutorial/
type: Comment
comment on: http://stackoverflow.com/q/24771635
score: 0

http://stackoverflow.com/comment/38612286
has text: Please provide jsFiddle
comment on: http://stackoverflow.com/q/24863294
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/24779640
score: 1
upvote count: 1
has body: I recommend this jquery plugin: http://tinysort.sjeiti.com/
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38453898
accepted answer of: http://stackoverflow.com/q/24779310
type: Answer
answers question: http://stackoverflow.com/q/24779310

http://stackoverflow.com/q/24790225
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24790441
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/24790475
accepted answer: http://stackoverflow.com/a/24790475
tagged with: arrays
tagged with: eval
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24790441
has body: I created some buttons dynamically based on loop over an array of names, then I want to add rollover actions on these buttons, but the alert() in this code always prints the name of the last item (black). I tried using eval() on that alert() part but it didn't make any difference. I expect it to return red, green or black depending on which button I hover the mouse. &lt;div id="channels_buttons_container"&gt; &lt;/div&gt; &lt;script&gt; channels_array = ["red", "green", "black"]; for(var i = 0; i &lt; channels_array.length; i++) { loop_channel_name = channels_array[i]; // append an element inside the container var new_button_element = document.createElement("span"); new_button_element.id = 'channel_button_'+loop_channel_name; new_button_element.innerHTML = '&lt;br&gt;BLA BLA'; document.getElementById('channels_buttons_container').appendChild(new_button_element); // try to add rollover actions on the new button document.getElementById('channel_button_'+loop_channel_name).onmouseover = function(){ alert('Rollover '+loop_channel_name); } } &lt;/script&gt;
type: AnsweredQuestion
tagged with: loops
type: Question
has title: Cannot properly create rollover on dynamically created html element

http://stackoverflow.com/comment/38638985
has text: Unfortunately using stopPropagation() doesn't stop the snapping to the top of the screen. It does activate the links though
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24876661

http://stackoverflow.com/comment/75497044
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24801109
has text: Other browsers? Now that pre-11 IE versions have receded, support by other browsers becomes interesting. I created a [New Issue](https://github.com/Fyrd/caniuse/issues/3467) on caniuse.com.
score: 0

http://stackoverflow.com/q/24774720
has answer: http://stackoverflow.com/a/24775292
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/38445408
tagged with: cordova
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/24776241
tagged with: jquery-mobile
tagged with: javascript
has title: CSS animations fadeIn doesn't seem to work
has body: I'm trying to applicate on my webpage a fade in effect on the content of my webpage but instead of getting the fade in effect my content is just "hiding". This is the CSS I'm using: /* make keyframes that tell the start state and the end state of our object */ @-webkit-keyframes fadeIn { from { opacity:0 !important; } to { opacity:1 !important; } } @-moz-keyframes fadeIn { from { opacity:0 !important; } to { opacity:1 !important; } } @keyframes fadeIn { from { opacity:0 !important; } to { opacity:1 !important; } } fadeIn .fade-in { opacity:0; /* make things invisible upon start */ -webkit-animation:fadeIn ease-in 1 ; /* call our keyframe named fadeIn, use animattion ease-in and repeat it only 1 time */ -moz-animation:fadeIn ease-in 1 ; animation:fadeIn ease-in 1; -webkit-animation-fill-mode:forwards; /* this makes sure that after animation is done we remain at the last keyframe value (opacity: 1)*/ -moz-animation-fill-mode:forwards; animation-fill-mode:forwards; -webkit-animation-duration:1s ; -moz-animation-duration:1s ; animation-duration:1s ; } .fade-in.one { -webkit-animation-delay: 0.7s ; -moz-animation-delay: 0.7s ; animation-delay: 0.7s; } For this piece of html: Entre los melismas sonoros del rebalaje y las intrincadas calles del antiguo barrio del Perchel, y a la sombra espiritual de su Iglesia parroquial del Carmen, surgi&oacute en el año 2005 el sueño colectivo de un grupo de j&oacutevenes de aquel barrio, que bajo el &aacutenimo y el empuje del entonces p&aacuterroco nuestro querido Manolo Segura- se propusieron poner en marcha la hoy conocida como Banda de Cornetas y Tambores de Nuestra Señora del Carmen del Perchel-M&aacutelaga. If I set opacity as NOT 0 on ".fade-in { opacity:0; /* make things invisible upon start */" I can see the content, but of course that's not what I'm looking for. Regards.
has comment: http://stackoverflow.com/comment/38444979
has comment: http://stackoverflow.com/comment/38445114
answer count: 2
downvote count: 0
favorite count: 0

http://stackoverflow.com/q/24847958
has title: Re-define escape function in an XSS attack using URL hash
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: xss
tagged with: security
favorite count: 0
upvote count: 2
accepted answer: http://stackoverflow.com/a/24848308
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24848308
type: Question
has body: This is related to XSS attack using jQuery selector. I'm reading the url hash in my code. If I have a malformed URL like this http://www.example.com/#&lt;img src='/' onerror='alert(1)'&gt; A safe way to get around would be have an escape function in my code (e.g. _.escape) before creating a selector (I know I can avoid this with $('body').find(...) but my question isn't about avoiding it) var wHash = escape(window.location.hash.replace('#','')); $(wHash); Question: Is it possible to re-define escape inside the payload, to render it useless. Something like this: &lt;img src='/' onerror='(function(){window.escape = function(x) { return x; } })()'&gt; I can't precisely craft this to make it work, but I'm wondering what's stopping the attacker from re-defining the escaping part of the code from the url hash?

http://stackoverflow.com/q/24762462
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/2010892
has answer: http://stackoverflow.com/a/24762728
has comment: http://stackoverflow.com/comment/38425155
answer count: 2
accepted answer: http://stackoverflow.com/a/24762717
tagged with: javascript
has comment: http://stackoverflow.com/comment/38422112
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/24762717
has comment: http://stackoverflow.com/comment/38421817
possible better answer: http://stackoverflow.com/a/24762728
downvote count: 4
upvote count: 0
has title: Building a PHP JavaScript App
score: -4
has body: Im building a PHP JavaScript web App. My main concern is how can I stitch the JS with PHP. For example; I have some PHP Classes defined in the backend and some object instantiated at the time the first page loads; obviously the JS has no idea about them. When I make an Ajax call to a php file that has no reference to the Objects, how can I access the Object that were already instantiated instead of having re-instantiate then again. Is it good practice to store the Objects in the session maybe? Is there a "best practice" for scenarios like these?
tagged with: php
type: Question
tagged with: object

http://stackoverflow.com/comment/38538246
score: 0
type: QuestionComment
has text: I have only 6 different pages, and I think the framework will only slow down the app. what do you think?
type: Comment
comment on: http://stackoverflow.com/q/24822402

http://stackoverflow.com/q/24864753
has comment: http://stackoverflow.com/comment/38615936
type: Question
tagged with: local
has body: I'm playing around with Apache Cordova and I want to implement a search box that can search in a list or something similar (local database?). I want it to be local so that the app does not require an internet connection to search. The way I want it to be set up is that it need to be able to search for both the name of the item and a number. Example 1: A user searches for: "Honda". He will then be sent to a page where information about "Honda" will be diplayed. Example 2: A user searches for the id: "1337". He will then be sent to the page containing information about "Honda". So "Honda = 1337" and "1337 = Honda" if you guys understand? The question: I'm wondering what solution would suite my needs for this project? or there any frameworks out there for this? Thanks in advance!
tagged with: database
tagged with: javascript
has comment: http://stackoverflow.com/comment/38615450
tagged with: search
score: 0
has comment: http://stackoverflow.com/comment/38626161
has answer: http://stackoverflow.com/a/24865020
answer count: 1
tagged with: cordova
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/10442211
accepted answer: http://stackoverflow.com/a/24865020
has title: How can I make a search box to search in a local database?

http://stackoverflow.com/q/24771308
has answer: http://stackoverflow.com/a/24771403
has comment: http://stackoverflow.com/comment/38438919
score: 6
has answer: http://stackoverflow.com/a/61135982
has comment: http://stackoverflow.com/comment/38438599
has body: How can I reset multiple select boxes in a form with jquery? there are multiple select boxes they are dynamically generated &amp; we don't know what they will be some of the boxes option tags will be marked as selected fiddle: http://jsfiddle.net/Qnq82/ I have this so far, it resets everything but the selects. $('button#reset').click(function(){ $form = $('button#reset').closest('form'); $form.find('input:text, input:password, input:file, select, textarea').val(''); $form.find('input:radio, input:checkbox').removeAttr('checked').removeAttr('selected'); $form.find('select').selectedIndex = 0; }); Added some markup: &lt;form id="form" name="form" method="post" class="form" role="form" action="inventory-search" enctype="multipart/form-data"&gt; &lt;div class="form-group"&gt; &lt;label for="grade"&gt;Grade&lt;/label&gt; &lt;select name="grade" class="form-control input-sm" onchange="this.form.submit();"&gt; &lt;option value=""&gt;Any&lt;/option&gt; &lt;option value="opt1"&gt;opt1&lt;/option&gt; &lt;option value="opt2" selected="selected"&gt;opt2&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;!-- there are 6 more select controls --&gt; &lt;div class="form-group"&gt; &lt;label&gt;&amp;nbsp;&lt;/label&gt; &lt;button type="submit" name="search" id="search" value="search" class="btn button-sm btn-primary"&gt;Search&lt;/button&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label&gt;&amp;nbsp;&lt;/label&gt; &lt;button type="reset" name="reset" id="reset" value="reset" class="btn button-sm btn-primary"&gt;Reset&lt;/button&gt; &lt;/div&gt; &lt;/form&gt;
has comment: http://stackoverflow.com/comment/38438757
favorite count: 0
has answer: http://stackoverflow.com/a/76796055
has comment: http://stackoverflow.com/comment/38438876
linked to: http://stackoverflow.com/q/1414276
type: Question
has comment: http://stackoverflow.com/comment/38438874
has comment: http://stackoverflow.com/comment/38438807
upvote count: 6
has answer: http://stackoverflow.com/a/24771324
has comment: http://stackoverflow.com/comment/38438972
has answer: http://stackoverflow.com/a/58575047
has title: How to reset multiple select boxes in a form with jquery?
has comment: http://stackoverflow.com/comment/38438764
has comment: http://stackoverflow.com/comment/38438722
answer count: 7
has comment: http://stackoverflow.com/comment/38438963
has comment: http://stackoverflow.com/comment/38438676
has answer: http://stackoverflow.com/a/34090059
has answer: http://stackoverflow.com/a/27800610
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38438849
tagged with: jquery
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/16913094

http://stackoverflow.com/q/24833618
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/38556308
has comment: http://stackoverflow.com/comment/38556629
type: Question
has title: One function in jquery, any step by step guides out there on how to Reset it?
tagged with: javascript
tagged with: jquery
has body: jQuery.noConflict(); jQuery(document).ready(function(){ jQuery(".aj-hidden").hide(); jQuery(".aj-hidden").addClass("aj-visible"); jQuery(".aj-collapse").one( 'click', function() { rel = jQuery(this).attr('rel'); jQuery("#" + rel).slideToggle('fast'); }); }); Sorry if this is impossible to do, I have searched all over this site with little idea if I'm even looking at the right answer. Its taken me some time to figure out the "one" function and it gets me half the way there, I just want to know if I can possibly reset the link to be clicked again afterwards?
score: -3
downvote count: 4
answer count: 1
has answer: http://stackoverflow.com/a/24833736
favorite count: 0
has comment: http://stackoverflow.com/comment/38556388

http://stackoverflow.com/q/24762957
has comment: http://stackoverflow.com/comment/38422802
score: -3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24763094
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38422698
downvote count: 3
possible better answer: http://stackoverflow.com/a/24763028
type: Question
has answer: http://stackoverflow.com/a/24763028
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24763094
has body: I have a project I'm working on where there's a "Save" button that saves the user's data to localStorage and there's a "Load" button that loads a user's saved data from localStorage. However, it's not working. Can someone please help me fix this problem? HTML: Save Load JavaScript: function doSave(){ var txt = text.value; localStorage.storedText= txt; } function doLoad(){ text.value = localStorage.storedText; } window.onload = function(){ saveButton = document.getElementById("save"); saveButton.onclick = doSave(); loadButton = document.getElementById("load"); loadButton.onclick = doLoad(); textarea = document.getElementById("text"); };
answer count: 2
upvote count: 0
has title: HTML5 Javascript . how to Save Textarea input then loading it via buttons
has comment: http://stackoverflow.com/comment/38422624
favorite count: 0

http://stackoverflow.com/a/24760917
downvote count: 0
answers question: http://stackoverflow.com/q/24758442
has body: As you provided no code, click here to get the idea and have some nice tutorial regarding the frame by frame animation of SVGs. I'd never recommend it though, simply because you'll have a vector based element on each frame whose anchor points, curves etc behave independently from each other. So for just a small part to animate, it will have to load all of the points, colors over and over again. You can create a SVG that animates instead.
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/24825860
favorite count: 0
has answer: http://stackoverflow.com/a/64730192
has body: Is there a way to have code coverage in the JavaScript Jest testing framework, which is built on top of Jasmine? The internal framework does not print out the code coverage it gets. I've also tried using Istanbul, blanket, and JSCover, but none of them work.
tagged with: jestjs
has answer: http://stackoverflow.com/a/46918744
has answer: http://stackoverflow.com/a/77317274
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/131914822
has answer: http://stackoverflow.com/a/54173575
has answer: http://stackoverflow.com/a/26770102
has answer: http://stackoverflow.com/a/58161570
type: Question
has answer: http://stackoverflow.com/a/79520758
has answer: http://stackoverflow.com/a/67591964
has title: How to get the code coverage report using Jest?
upvote count: 340
tagged with: javascript
accepted answer: http://stackoverflow.com/a/46918744
answer count: 11
score: 340
has comment: http://stackoverflow.com/comment/39753740
possible better answer: http://stackoverflow.com/a/27479903
has answer: http://stackoverflow.com/a/56528589
has answer: http://stackoverflow.com/a/27479903
downvote count: 0
has answer: http://stackoverflow.com/a/42125848

http://stackoverflow.com/comment/38667574
has text: @Quentin then he can just assume it wasn't checked… it's a binary yes or no.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24892293
type: QuestionComment

http://stackoverflow.com/comment/38541615
comment on: http://stackoverflow.com/q/24826003
score: 2
type: Comment
type: QuestionComment
has text: possible duplicate of [Javascript global variables](http://stackoverflow.com/questions/4862193/javascript-global-variables)

http://stackoverflow.com/comment/38402112
score: 0
type: Comment
has text: Did you read the linked question, it explains all the different ways to define functions.
comment on: http://stackoverflow.com/a/24751371
type: AnswerComment

http://stackoverflow.com/a/24753772
has comment: http://stackoverflow.com/comment/38409136
score: 0
has body: For the first part, what you're doing is correct. Use the console (press F12 in your browser) to examine the hidden field, and check if it has the value. If you see it in the server side, it should be in the client side. You can also run js code, and set breakpoints to discover what the problem is. You can also add a PreRender handler in the server side, and add a breakpoint and debug to check that the Value has not been deleted in the server side (this event happens just before the page is rendered to be sent to the browser). For the second part, the fastest way to do what you need is to use knockout mapping, which creates a model from a JavaScript object, or from JSON. You need to use this: ko.mapping.fromJSON. This will create a new viewmodel, which you can directly bind, from your JSON. (As you can read in the docs, you can customize how the view model is created). However, what you're doing is quite strange. You normally use Knockout with Web API, or Web Services, or Page methods, without reloading the page. The model is recovered, and updated, changed, etc. through one of those technologies, using AJAX.
type: Answer
answers question: http://stackoverflow.com/q/24752669
has comment: http://stackoverflow.com/comment/38410182

http://stackoverflow.com/q/24782151
accepted answer: http://stackoverflow.com/a/24822329
tagged with: casperjs
score: 0
has comment: http://stackoverflow.com/comment/38472191
has body: We have written several test cases with casperjs now. In comparison to other testing frameworks it works like charm. But there is one crucial part of our app, where we fail to write a suitable test case. In our app we have integrated a type of autocomplete plugin which is called Geocomplete (http://ubilabs.github.io/geocomplete/) which makes it possible to fetch geodata from the Google Maps Api. There is the following workflow. On the start page of our site there is a form with one single input field, which is used for the autocomplete functionality. There the user can enter the name of a specific city and Google returns the data. In the background a backbone model is populated with that data. Here is the code of the testcase: casper.test.begin('Test User Login Form', 4, function suite(test) { casper.options.verbose = true; casper.options.logLevel = 'debug'; var url = 'http://localhost:8889/'; var session; casper.start(url); casper.test.comment('Start Testing'); casper.waitFor(function check() { return this.evaluate(function() { return document.getElementById('page-wrap'); }); }, function then() { casper.waitForSelector('#landingForm', function() { this.echo('waiting'); }); }); // input is populated with a some letters casper.then(function() { casper.sendKeys('#landingForm input[name="location.name"]', 'Klag', { keepFocus: true }); }); // .pac-item container whill show the autocomplete suggestions casper.then(function() { casper.waitUntilVisible('.pac-item', function() { // we have tried several methods here like mouse_over + click etc. this.sendKeys('#landingForm input[name="location.name"]', casper.page.event.key.Down, { keepFocus: true }); this.sendKeys('#landingForm input[name="location.name"]', casper.page.event.key.Enter, { keepFocus: true }); // form is submitted this.click('#landingForm &gt; div &gt; div &gt; div &gt; span &gt; button'); }); }); casper.then(function() { // wait until next page is visible casper.waitUntilVisible('div.activity-pic', function()…
answer count: 1
tagged with: autocomplete
tagged with: javascript
has answer: http://stackoverflow.com/a/24822329
has title: Testing jQuery Geocomplete Plugin (Autocomplete) with casperJS
has comment: http://stackoverflow.com/comment/38531108
type: AnsweredQuestion
tagged with: backbone.js
type: Question

http://stackoverflow.com/q/24824491
tagged with: selenium-webdriver
linked to: http://stackoverflow.com/q/242813
has body: Every protractor example I can find on the internet seems to use browser.get with a web URI. browser.get('http://localhost:8000'); I'd like to use Selenium to simple navigate to a file:// path so that I don't need a local web server running in order to perform tests. All I need is a simple HTML page and some assets. That doesn't seem to work though. browser.get('file:///Users/myusername/dev/mpproject/spec/support/index.html'); When I paste that URI into my browser window I get a HTML page. When I try to open it with protractor I get a timeout. How can I run tests on this page with protractor? The ideal answer will work with a relative file path from the myproject root.
tagged with: selenium
type: Question
tagged with: protractor
tagged with: javascript
has answer: http://stackoverflow.com/a/39559126
upvote count: 18
has answer: http://stackoverflow.com/a/24827768
downvote count: 0
has answer: http://stackoverflow.com/a/31181058
favorite count: 0
has answer: http://stackoverflow.com/a/26231070
has title: Opening a file with protractor
type: UnansweredQuestion
score: 18
answer count: 4

http://stackoverflow.com/comment/38535523
comment on: http://stackoverflow.com/q/24822741
type: QuestionComment
has text: @T.J.Crowder Ordinarily I would agree, but the page I am working on was written by another agency, and is extremely complex. Given the time restraints on this project, I am currently unable to think of a better way. Time is money!
type: Comment
score: 0

http://stackoverflow.com/q/24845971
score: 0
has title: Scroll To same position on page depending on which element is clicked
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24846027
tagged with: css
answer count: 4
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24846356
type: Question
has answer: http://stackoverflow.com/a/24846034
has body: Is it possible to have the title of my div scroll to the top of the page for multiple divs? For example: If I click on a person I would like them to scroll to the top of the page. So their image would be at the top and you are able to read their description. Currently if you click on the bottom image you do not notice the description, as it's below the page. Fiddle here: http://jsfiddle.net/sPLDh/5/ HTML: Our people Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sollicitudin molestie ipsum ut fermentum. Duis adipiscing purus gravida, elementum neque nec, mollis tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sollicitudin molestie ipsum ut fermentum. Duis adipiscing purus gravida, elementum neque nec, mollis tortor. John doe Peter Pan Sally Hills John Doe is Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sollicitudin molestie ipsum ut fermentum. Duis adipiscing purus gravida, elementum neque nec, mollis tortor. Peter Pan is Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sollicitudin molestie ipsum ut fermentum. Duis adipiscing purus gravida, elementum neque nec, mollis tortor. Sally Hills is Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sollicitudin molestie ipsum ut fermentum. Duis adipiscing purus gravida, elementum neque nec, mollis tortor. Betty Boo Sm Hunt Paula Walls Betty Jones Doe is Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sollicitudin molestie ipsum ut fermentum. Duis adipiscing purus gravida, elementum neque nec, mollis tortor. Sam Hunt is Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sollicitudin molestie ipsum ut fermentum. Duis adipiscing purus gravida, elementum neque nec, mollis tortor. Paula Walls is Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sollicitudin molestie ipsum ut fermentum. Duis adipiscing purus gravida, elementum neque nec, mollis tortor.
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24846003

http://stackoverflow.com/a/24803835
upvote count: 4
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24803660
has body: A simple approach would be to add each string to an array, then join the array elements to produce the end result you are looking for. var params = []; if (facebook_url !== "") { params.push("fb=" + facebook_url); } if (twitter_url !== "") { params.push("tw=" + twitter_url); } alert(params.join("&amp;")); Reference
answers question: http://stackoverflow.com/q/24803660
score: 4
has comment: http://stackoverflow.com/comment/38500347
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/24872132
has comment: http://stackoverflow.com/comment/38629875
answers question: http://stackoverflow.com/q/24872044
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24872044
has comment: http://stackoverflow.com/comment/38629702
has body: please try to remove the return you don'e need to return anything from the controller wpApp.controller("controllerMain", function($scope, $http) { $scope.ready = 'true'; $scope.message = "This is the Main Controller"; $http.get("config.json").success(function(data) { console.log("Here"); }); }); I also suggest to use $scope.message = "This is the Main Controller"; and on html {{message}}
has comment: http://stackoverflow.com/comment/38630026
score: 1
has comment: http://stackoverflow.com/comment/38630138

http://stackoverflow.com/q/24847913
has comment: http://stackoverflow.com/comment/39193358
type: Question
has answer: http://stackoverflow.com/a/25055590
has answer: http://stackoverflow.com/a/25056172
has answer: http://stackoverflow.com/a/24848162
tagged with: javascript
has title: How to hide actual link but not alert the affiliate that the link came from a redirected link?
score: 0
has answer: http://stackoverflow.com/a/25173473
has comment: http://stackoverflow.com/comment/38989965
favorite count: 0
has comment: http://stackoverflow.com/comment/39034646
answer count: 5
type: UnansweredQuestion
tagged with: http-redirect
tagged with: php
has answer: http://stackoverflow.com/a/25124915
has body: So far I've tried a simple page that 301 php redirects using the id (domain.com/link/1234/). Then I tried the same php redirect (forwards the id) to a php page uses id to et the uri to redirect using JavaScript (redirects using onload). If I just click the link everything works fine. But redirecting receives a 404 from the affiliate company. Any ideas as to how I can accomplish this? I would like to have all of my links use the id of the post. example: domain.com/link/1234/ instead of the affiliate link: affiliate.com/sniper.php?s=g&amp;7=8&amp;g=0 EDIT So if I use this JavaScript in the head it redirects perfect. &lt;script&gt; var url = "http://affiliate.com/sniper.php?s=g&amp;7=8&amp;g=0"; // IE8 and lower fix if (navigator.userAgent.match(/MSIE\s(?!9.0)/)) { var referLink = document.createElement("a"); referLink.href = url; document.body.appendChild(referLink); referLink.click(); } // All other browsers else { window.location.replace(url); } &lt;/script&gt; But if I add PHP into the JavaScript to add the URL dynamically. For example: &lt;script&gt; var url = "&lt;?php echo $url_to_affiliate_website; ?&gt;"; // IE8 and lower fix if (navigator.userAgent.match(/MSIE\s(?!9.0)/)) { var referLink = document.createElement("a"); referLink.href = url; document.body.appendChild(referLink); referLink.click(); } // All other browsers else { window.location.replace(url); } &lt;/script&gt; This fails, I have zero idea why. PHP can be on this page but not after the script tag. Any ideas??
upvote count: 1
has comment: http://stackoverflow.com/comment/38976027
downvote count: 1

http://stackoverflow.com/a/24760905
has body: You can use this pattern to basically extract all the numbers: /-?\d+(?:\.\d+)?/g If, as in your string example, you want to extract these numbers by pairs, you need to use capturing groups: /^Lat = (-?\d+(?:\.\d+)?)\s*?\r?\nLong = (-?\d+(?:\.\d+)?)\s*?$/mg for each pairs founded, the latitude is in the capture group 1 and the longitude in the capture group 2. Note that this second pattern take in account that literal strings "Lat = " and "Long = " are at the start of a line, always in this order, and only separated by a newline character. (with the m modifier, ^ means "start of the line, and $ means "end of the line"). Trailing spaces are allowed with \s*? for each line. Example: var yourString = "Lat = 38.7970308\nLong = -100.8665928"; var myRe = /^Lat = (-?\d+(?:\.\d+)?)\s*?\r?\nLong = (-?\d+(?:\.\d+)?)\s*?$/mg; var m; while ((m = myRe.exec(yourString)) !== null) { console.log(m[1] + "\t" + m[2]+ "\n\n"); }
type: Answer
answers question: http://stackoverflow.com/q/24760396
score: 0

http://stackoverflow.com/q/24875388
type: Question
answer count: 1
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38636546
type: UnansweredQuestion
has body: I need to display a specific option inside a select based on certain values of the zip code. So far I've managed to do the opposite, hide it based on values of the zip, but that is too easy to game. Zip Code Location Choose Shipping Option Free Shipping $0.00 I do no have access to add classes to the options, they are dynamically generated by a rendering engine. I can however target values which stay fixed. The plan was to have it hidden by default, then adding conditions in which to show it. This is not about setting a value to an option but showing/hiding an option with a certain value A little background story: the system I work with gives me the option to add various types of shipping some free some paid. However, because there is no way to discern/filter between them, especially by zip, I am left in the hilarious position of letting the users choose either free shipping or paid shipping which, as human nature goes, it's pretty much pointless. So my idea was to have the user enter their zip and show the free option, which can only be identified by value, only to those that have a specific zip (full number) and not to anybody else. I am aware of the security issues and willing to live with them. Is there a way to add/show that option instead of removing it? Is there a way to set it selected?
has title: Display an option in a select based on a specific value
has comment: http://stackoverflow.com/comment/38637478
has answer: http://stackoverflow.com/a/24875867

http://stackoverflow.com/comment/38419596
type: Comment
has text: In short, no. You should never do that.
comment on: http://stackoverflow.com/q/24761221
score: 0
type: QuestionComment

http://stackoverflow.com/comment/38530223
comment on: http://stackoverflow.com/q/24819957
has text: *"Is there any way to prevent the timer from resetting?"* is a very different question than your title *"Preventing refresh"* suggests.
score: 4
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38694372
type: AnswerComment
comment on: http://stackoverflow.com/a/24906616
score: 0
type: Comment
has text: Hi again and thank you for your reply @Nitin Mall, all of my table's dynamic so datatable's feauteres contains my requirements very well.

http://stackoverflow.com/comment/38491492
comment on: http://stackoverflow.com/a/24799072
type: AnswerComment
has text: you should've explained why like the other answer did.
type: Comment
score: 1

http://stackoverflow.com/q/24885227
tagged with: backbone.js
type: UnansweredQuestion
has body: I've implemented a webworker inside a web-page that uses backbone. I want to start the webworker in my index.html file as soon as the web page begins to load. Here's my index.html's javascript code: var w; startWorker(); function startWorker() { alert("new worker"); if(typeof(Worker) !== "undefined") { alert("new worker"); if(typeof(w) == "undefined") { alert("new worker"); w = new Worker("js/models/worker_prefetch_starred.js"); } w.onmessage = function(event) { // Comunication WebWorker &lt;-&gt; Webapp }; } } As you can se I'm only creating the worker and works fine. Here's my worker_prefetch_starred.js webworker's javascript code: define(["underscore", "backbone" ], function ($, _) { require('collections/folder_items').starred_items_fetched().then(function(starred_items) { _.each(starred_items, function(item) { var linked_item = item.get("item"); linked_item.isOnWebsql(linked_item); }); }); }); When I execute the code it throws me : define is not defined What should I do?
tagged with: requirejs
has answer: http://stackoverflow.com/a/25191418
type: Question
answer count: 1
tagged with: javascript
has title: WebWorker with Backbone : "define is not defined"
tagged with: web-worker
score: 0
has comment: http://stackoverflow.com/comment/38657009

http://stackoverflow.com/comment/38541878
has text: Or, why are you creating new sections every time..? looks like you just want to have a single section?
comment on: http://stackoverflow.com/q/24826019
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/24789933
has comment: http://stackoverflow.com/comment/38477554
has comment: http://stackoverflow.com/comment/38476302
accepted answer of: http://stackoverflow.com/q/24789801
type: Answer
has comment: http://stackoverflow.com/comment/38474867
answers question: http://stackoverflow.com/q/24789801
score: 2
has body: Giving multiple arguments to push is just short for calling push separately with each argument, it doesn't collect them together in an array. You need to make them an object first: function plotgraph1(filter1) { var processed_json = $j.each(filter1, function(i, obj) { processed_json.push([obj[0], obj[1]]); }); console.log(processed_json) ................... } DEMO
has comment: http://stackoverflow.com/comment/38478048
downvote count: 0
has comment: http://stackoverflow.com/comment/38477973
upvote count: 2
has comment: http://stackoverflow.com/comment/38476042
has comment: http://stackoverflow.com/comment/38477520
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38478139

http://stackoverflow.com/q/24856656
upvote count: 2
has body: Can anyone help me? Here is the JSFiddle ( http://jsfiddle.net/uupd4/ ). $(document).ready(function() { var video_src = '7100569'; var $video_wrapper = $('body'); var $video = $('iframe'); $video_vimeo = $f($video[0]); $video_vimeo.addEvent('ready', vimeo_ready); function vimeo_ready(){ console.log('ready'); $video_vimeo.addEvent('playProgress', onProgress); } function onProgress(data){ console.log('onProgress'); } }); I did what the documentation says to add playProgress event only when the ready event is triggered. Thanks
type: Question
type: AnsweredQuestion
tagged with: vimeo
tagged with: vimeo-api
accepted answer: http://stackoverflow.com/a/26873682
downvote count: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/26873682
favorite count: 0
has title: Vimeo Api - Can't fire playProgress event using Froogaloop
tagged with: froogaloop
score: 2

http://stackoverflow.com/a/24859518
answers question: http://stackoverflow.com/q/24858342
has body: You have not included Js and Css file in your fiddle Css: http://smartik.ws/downloads/free_demo/scripts/smk_accordion/css/smk-accordion.css Js: http://smartik.ws/downloads/free_demo/scripts/smk_accordion/js/smk-accordion.js Check Updated Demo Your js Code: jQuery(document).ready(function ($) { $(".accordion_example1").smk_Accordion(); $(".accordion_example2").smk_Accordion({ closeAble: true, }); $(".accordion_example3").smk_Accordion({ showIcon: false, }); $(".accordion_example4").smk_Accordion({ closeAble: true, closeOther: false, }); $(".accordion_example5").smk_Accordion({ closeAble: true }); $(".accordion_example6").smk_Accordion(); $(".accordion_example7").smk_Accordion({ activeIndex: 2 }); $(".accordion_example8").smk_Accordion(); });
type: Answer
score: 0

http://stackoverflow.com/comment/38526692
type: Comment
comment on: http://stackoverflow.com/q/24817252
score: 0
type: QuestionComment
has text: Please post some more code and description with what your trying to achieve.

http://stackoverflow.com/q/24756302
accepted answer: http://stackoverflow.com/a/24756404
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
has title: jQuery events for both desktop and mobile
type: Question
possible better answer: http://stackoverflow.com/a/24756568
has comment: http://stackoverflow.com/comment/38410789
has body: I'm doing a fully responsive page and got to the jQuery part. My question is how to do events that cover both mobile and desktop usage. I have looked in jQuery 1.11.1 file and found no trace of "touch". I figure that I could use mousedownas a start. What is best practice when it comes to this? $('.touch-me').on('mousedown, click', function () { console.log('touch me'); });
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24756568
tagged with: events
has answer: http://stackoverflow.com/a/24756404
has comment: http://stackoverflow.com/comment/38410350
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38410215
has comment: http://stackoverflow.com/comment/38410362

http://stackoverflow.com/comment/38410544
comment on: http://stackoverflow.com/q/24756414
has text: I could, yes but there is AJAX functions that will not work, and I only just thought about setting one up after I posted - sorry...
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/24786359
favorite count: 0
accepted answer: http://stackoverflow.com/a/24787844
has comment: http://stackoverflow.com/comment/38467416
type: AnsweredQuestion
score: 1
has body: I have looked through many posts and tried their suggestions. A new problem arises each time though. Objective: To create a Google line chart taking data from MYSQL table and encoding it in JSON. From there, I attempt to use an html file to display the chart. someFile.php: <?php //connect to the database $username = ...; $password = ...; $hostname = ...; $database = ...; $conn = mysqli_connect($hostname, $username) or die("Unable to connect to MySQL"); echo "Connected to MySQL "; //Select database $db_found = mysqli_select_db($conn,$database); if($db_found) { print "Database Found "; } else{ print "Database NOT Found "; } $sql = mysqli_query($conn, 'SELECT * FROM Travel_Test'); if (!$sql) { die("Error running $sql: " . mysql_error()); } $results = array( 'cols' => array ( array('label' => 'travel_time_date', 'type' => 'datetime'), array('label' => 'travel_time_duration', 'type' => 'number') ), 'rows' => array() ); while($row = mysqli_fetch_assoc($sql)) { //date assumes "yyyy - mm -- dd" format $dateArr = explode('-', $row['travel_time_date']); $year = (int) $dateArr[0]; $month = (int) $dateArr[1]; //subtract 1 to make compatible with javascript months $day = (int) $dateArr[2]; //time assumes "hh:mm:ss" format $timeArr = explode(':', $row['travel_time_timestamp']); $hour = (int) $timeArr[0]; $minute = (int) $timeArr[1]; $second = (int) $timeArr[2]; $results['rows'][] = array('c' => array( array('v' => "travel_time_date($year, $month, $day, $hour, $minute, $second)"), array('v' => $row['travel_time_duration']) )); } $json = json_encode($results, JSON_NUMERIC_CHECK ); echo $json; //header("Access-Control-Allow-Origin: *"); ?> JSON output: {"cols":[{"label":"travel_time_date","type":"datetime"}, {"label":"travel_time_duration","type":"number"}], "rows":[{"c": [{"v":"travel_time_date(2014, 2, 1, 1, 30, 30)"},{"v":55}]},{"c": [{"v":"travel_time_date(2014, 2, 1, 2, 30, 30)"},{"v":80}]},{"c": [{"v":"travel_time_date(2014, 2, 1, 3, 30, 30)"},{"v":60}]},{"c": [{"v":"travel_ti…
upvote count: 1
tagged with: php
has title: Table has no columns using google charts
type: Question
tagged with: http://stackoverflow.com/tag/json
tagged with: mysql
has answer: http://stackoverflow.com/a/24787844
has comment: http://stackoverflow.com/comment/38467579
tagged with: google-visualization
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/24800260
answer count: 2
upvote count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/38493623
favorite count: 0
tagged with: ajax
has body: I have a built a php backend which returns a JSON object (effectively a 2D array, I can reference it as json[0][0] for example, I don't know why though, I did not parse the JSON object) of information(train number, days it runs on etc) on trains between two stations. Now what I want to query the availability of each train. I already have the php script for that (which returns a JSON object as well, giving the availability of the specified date as well as the next 5 days.). This availability php script requires some input which is present as the first element of every nested(wrong term to use ?) array eg : json[0][0], json[1][0], json[2][0] if 3 trains are returned I want this information returned as a response to parallel ajax calls. In the end I want to create a table based on these responses. My problems are: Since I don't know the number of trains which will returned before hand, hence the number of parallel ajax calls to be made, how do I code this portion ? Best way to make parallel calls seems to be $.when, how do I use it in this problems ? I have just begun coding the function, and have something like this, yes I am an utter novice with JS and jQuery : $(document).ready(function() { $("form").submit(function(){ event.preventDefault(); $.ajax({ //type: "POST", url: "./trains_bw_stations.php", dataType: 'json', data: { source: $('input[name*="src"]').val(), destination: $('input[name*="dstn"]').val(), day: $('input[name*="day"]').val(), month: $('input[name*="month"]').val(), cl: $('input[name*="cl"]').val() } }) .done(function(trains) { console.log(trains) var requests = [], allData = {}; for (var i = 0; i &lt; trains.length; i++) { console.log(trains[i][0]); requests.push($.ajax({ url: './availability.php', dataType: 'json', data: { day: $('input[name*="day"]').val(), month: $('input[name*="month"]').val(),lccp_trndtl: trains[i][0] } // success: function(data) { // console.log(data); // allData[''+i] = data; }).done(function(data) { console.log(data); allDat…
accepted answer: http://stackoverflow.com/a/24820770
has title: Executing unknown number of parallel ajax calls based on data returned by a previous ajax call
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/24820770
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38493434
type: Question
has answer: http://stackoverflow.com/a/24800638
has comment: http://stackoverflow.com/comment/38493731
tagged with: javascript
has comment: http://stackoverflow.com/comment/38493387
has comment: http://stackoverflow.com/comment/38493597
possible better answer: http://stackoverflow.com/a/24800638

http://stackoverflow.com/comment/38585260
has text: the problem still appear : 1- change the url to ../../wp-admin/admin-ajax.php. 2 - put the function in admin-ajax.php . 3- i don't know how to separate the function populate . in the first its popup ("Error : Please try again") the i comment if(data) ,but the problem still accrue.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24808408
type: Comment

http://stackoverflow.com/q/24772726
has answer: http://stackoverflow.com/a/24772774
type: AnsweredQuestion
downvote count: 0
score: 1
has title: How to send plain HTML from Express.js
possible better answer: http://stackoverflow.com/a/24772774
favorite count: 0
tagged with: angularjs
type: Question
accepted answer: http://stackoverflow.com/a/24773014
tagged with: node.js
answer count: 2
upvote count: 1
has body: My index.html file has this: &lt;input name='qwe'&gt; {{qwe}} I want that {{qwe}} to be sent literally, i.e. not replaced by variables populated by the server. How should I do that? I was thinking in this pseudo code: app.get('*',function(req,res){ fs.read('index.html',function(data){ res.send(data) }) }) But I suppose I don't know how is this usually done. Maybe I have to use a predefined Express.js template engine: app.engine('html', ...) But I don't know what part of the documentation to read. I also took a look at consolidate.js, but all of these templates, seem to be, "template engines", do I really need a template engine? I want to send a file as it is. By the way, I am doing all of this because I want to work with Angular.js, but for experimentation purposes I am not using MEAN, I assume MEAN has to do something like this. Update I am trying this: app.get('*',function(req, res){ require('fs').readFile('views/index.html', 'utf8', function(err, data){ if(err) throw err; res.send(data); }) // res.sendfile('views/index.html'); }); But file is downloaded and not rendered, any advice? I suppose I have to set Content-Type or another header?
has comment: http://stackoverflow.com/comment/38469463
has answer: http://stackoverflow.com/a/24773014
tagged with: javascript
has comment: http://stackoverflow.com/comment/38446255
tagged with: express

http://stackoverflow.com/q/24899588
type: Question
has body: I'm trying to generate a graph in D3 with data as json. The concept is to show the time taken by each developer in a project. In this, I have to show a bar graph generating from the json data which is using for plotting start week and end week on 'x axis' and developer name on 'y axis'. Also on tooltip, I have to show other relevant details for each developer. I'm unable to generate this graph properly using start week and end week in 'x axis'. I'm looking for support from d3 developer community. Thank You.
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38681444
has title: D3 graph generation with range in x axis
upvote count: 1
favorite count: 0
tagged with: nvd3.js
tagged with: d3.js
type: UnansweredQuestion
answer count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38681783

http://stackoverflow.com/comment/38420009
score: 0
has text: when you scroll down the div begins to stick/scroll down to where you are in the site @ckersch
comment on: http://stackoverflow.com/q/24761404
type: Comment
type: QuestionComment

http://stackoverflow.com/a/47357852
answers question: http://stackoverflow.com/q/24894517
score: 0
has body: I faced this issue when the onclick on html elements created in code would not trigger. In the below sample code the button created in code shows up but nothing happens when it is clicked But if I add this meta tag in the head then the click event on the dynamically created event fires and I see the alert. Seems like this is not an issue for Edge browser
type: Answer

http://stackoverflow.com/comment/38572886
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24842479
has text: See the answers about jQuery Mobile below. You can figure out these things by using the DOM inspector in your browser's developer tools.

logarithm
tags question: http://stackoverflow.com/q/24895996
type: Tag
tag name: logarithm

http://stackoverflow.com/q/24864952
tagged with: jasmine
favorite count: 0
has answer: http://stackoverflow.com/a/26571796
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24865352
possible better answer: http://stackoverflow.com/a/24865352
tagged with: unit-testing
type: Question
has body: How do i use jasmine to simply check if element exist on the page by id? I went over the matchers, toExist() not seems to solve this issue. This is what i tried: 1. expect(by.id('my-id')).not.toExist(); 2. expect($(document)).not.toContain($(#my-id)); can you help?
tagged with: protractor
accepted answer: http://stackoverflow.com/a/26571796
score: 18
upvote count: 18
answer count: 2
has title: How do i check if element exists by id with Jasmine?
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/38668520
score: 0
type: AnswerComment
type: Comment
has text: @Lochemage - "If you click Users & Roles. All the children should be checked/unchecked."
comment on: http://stackoverflow.com/a/24892622

http://stackoverflow.com/comment/38429290
type: Comment
has text: So check value, if X, set it to Y.
type: QuestionComment
comment on: http://stackoverflow.com/q/24766451
score: 0

http://stackoverflow.com/comment/38580313
score: 0
type: Comment
type: QuestionComment
has text: what is it you're trying to do? What isn't working?
comment on: http://stackoverflow.com/q/24846501

http://stackoverflow.com/comment/38696284
type: AnswerComment
comment on: http://stackoverflow.com/a/24906952
score: 0
type: Comment
has text: unwind does not work, because $ratings does not exists after the projection

http://stackoverflow.com/a/24779162
answers question: http://stackoverflow.com/q/24779112
type: Answer
has comment: http://stackoverflow.com/comment/38738027
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24779112
score: 1
has comment: http://stackoverflow.com/comment/38496217
has body: You could use to get the selected value: var notify = $('#send_options option:selected').val(); LIVE DEMO UPDATE: I think the question is not clear that all, but after your comment you are looking for: $('#send_options').on('change', function(){ var $value=this.value; $('#send_options option').removeAttr('selected'); //remove selected that all option $('#send_options option[value='+ $value+']').attr("selected", "selected") //add selected to option selected }) DEMO UPDATED
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38490837

http://stackoverflow.com/q/24867323
upvote count: 2
has answer: http://stackoverflow.com/a/24890408
tagged with: backbone-events
has comment: http://stackoverflow.com/comment/38623664
answer count: 2
has body: I have a backbone app that loads some data from an API into a chart. This app has several tabs that can be navigated through to access these different charts, and every tab executes a route. Every chart is an instance of ChartView with the appropriate data put in. I have a problem that is caused by some API calls that may take a while. When the requests takes too long, some users start to cycle quickly through the tabs, executing each route quickly after each other. This fires up all the collection fetches which eventually messes up the interface because some callbacks will do a bit of rendering. So my question is, how can i make sure that every time a new route is loaded (even if it is done in quick succession) that all pending or started requests are stopped so no "request-success" callbacks are fired?
has title: Clean up requests and callbacks when switching routes
has answer: http://stackoverflow.com/a/24871834
tagged with: backbone-routing
has comment: http://stackoverflow.com/comment/38621978
has comment: http://stackoverflow.com/comment/38621764
possible better answer: http://stackoverflow.com/a/24871834
has comment: http://stackoverflow.com/comment/38646269
accepted answer: http://stackoverflow.com/a/24890408
score: 2
downvote count: 0
tagged with: javascript
tagged with: backbone.js
type: Question
type: AnsweredQuestion
favorite count: 0

http://stackoverflow.com/q/24896284
tagged with: find
tagged with: arrays
has comment: http://stackoverflow.com/comment/38675278
tagged with: javascript
tagged with: variables
score: 0
tagged with: filter
possible better answer: http://stackoverflow.com/a/24896487
has answer: http://stackoverflow.com/a/24896990
has answer: http://stackoverflow.com/a/24896487
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24896990
has body: Can someone please help me fix this function? It will work if I change the two variables to integers (ie: '987') but if I change them to a character value like 'test' it won't search the array. I'm new to javascript so excuse me if this is an easy fix. Thank you in advance. var myArray = [{ 'Vendor': '123', 'Item': '987', 'ID': '1' }, { 'Vendor': '123', 'Item': '654', 'ID': '2' }]; function findById(source, Vendor, Item) { return source.filter(function(obj) { return +obj.Vendor === +Vendor, +obj.Item === +Item; })[0]; } var vendin = '123'; var prodin = '654'; var result = findById(myArray, vendin, prodin); console.log(result.ID); The variables in question are vendin and prodin.
has title: Javascript Function Variable
answer count: 2

http://stackoverflow.com/comment/38678584
type: QuestionComment
comment on: http://stackoverflow.com/q/24897646
has text: No you're wrong. If you look at the code it's a loop. Each JSON object changes the stockTicker. I said that in the comments as well.
score: 0
type: Comment

http://stackoverflow.com/comment/38699549
comment on: http://stackoverflow.com/a/24909460
type: Comment
score: 1
type: AnswerComment
has text: About "wrap them in a div/span where they are sitting in the document": OP means to wrap ` ` with HTML tag to something like ` `. But, as you know, there is simplier way to get comments text

http://stackoverflow.com/comment/38465066
score: 0
comment on: http://stackoverflow.com/a/24785075
type: Comment
has text: i wanna but SO says wait 4 mins
type: AnswerComment

http://stackoverflow.com/q/24822067
possible better answer: http://stackoverflow.com/a/24823537
has answer: http://stackoverflow.com/a/24823537
has answer: http://stackoverflow.com/a/24933090
has title: Simple readFile() function in HTML5 / Cordova
accepted answer: http://stackoverflow.com/a/24933090
tagged with: cordova
tagged with: http://stackoverflow.com/tag/html
tagged with: html5-filesystem
type: AnsweredQuestion
type: Question
tagged with: closures
tagged with: javascript
has body: Here is a simple function that should return the contents of given file in current directory. It reads the file contents correctly, but when I want to return it, it fails to do so. reader.onloadend is called when data are read. How can I make it return data from that function? readFile: function(fileName) { app.fs.data = "{}"; // clear whatever was stored before var hasFile = function(fileEntry) { var gotFile = function(file) { var reader = new FileReader(); reader.onloadend = function(evt) { app.fs.data = evt.target.result; console.log("Read as Text: " + file.name); console.log("Data: " + app.fs.data); // app.fs.data contains correct data }; reader.onerror = function(e) { console.log("Error: " + e); }; reader.readAsText(file); }; fileEntry.file(gotFile, app.fs.fail); }; app.fs.dir.getFile(fileName, null, hasFile, app.fs.fail); console.log("Actual data: " + app.fs.data); // app.fs.data contains INCORRECT data "{}" return app.fs.data; } Console output: Actual data: {}:92 Read as Text: article.json:81 Data: {"id":1405518906105,"name":"My Name","category":0,"abstract":"","content":"","published":false,"lastPublish":null}:82
score: 0
answer count: 2

http://stackoverflow.com/comment/38717031
type: QuestionComment
has text: This may just have to do with the current implementation. MP3 files are not accurately seekable on their own. You can needle-drop and get close however.
comment on: http://stackoverflow.com/q/24899375
score: 0
type: Comment

http://stackoverflow.com/q/24890600
has comment: http://stackoverflow.com/comment/38665248
tagged with: jasmine
favorite count: 0
tagged with: promise
upvote count: 2
has body: I have: code snippet like this: Utils.calculate(data).then( function(data) { alert('success'); }, function(data) { alert('error'); } ); Problem: Neither 'seccess' nor 'error' are called. Question: What I should to check? P.S. I launch those code snippet with jasmine. So its probably that then callback have no time to run. So I decided ti set 1 second timeout at the end of my test - no result.
type: UnansweredQuestion
has title: when.js Promise: then() callbacks is never called
score: 2
has comment: http://stackoverflow.com/comment/38665071
answer count: 0
has comment: http://stackoverflow.com/comment/38664960
type: Question
has comment: http://stackoverflow.com/comment/38664682
downvote count: 0
tagged with: javascript
tagged with: callback
has comment: http://stackoverflow.com/comment/38664883
tagged with: when-js
has comment: http://stackoverflow.com/comment/38664831
has comment: http://stackoverflow.com/comment/38665031
has comment: http://stackoverflow.com/comment/38664925

http://stackoverflow.com/q/24800279
tagged with: javascript
has answer: http://stackoverflow.com/a/60155899
score: 0
tagged with: android
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38493469
has answer: http://stackoverflow.com/a/24800441
has comment: http://stackoverflow.com/comment/38493232
has comment: http://stackoverflow.com/comment/38493506
answer count: 4
has comment: http://stackoverflow.com/comment/38493242
has title: AutoComplete- Off Not working
linked to: http://stackoverflow.com/q/15738259
type: UnansweredQuestion
has body: I have a webiview in my android Activity. In that webview i am uploading a native html page. the HTML page contains input text field. I am trying to use autocomplete-off to make Off Suggestions. But Autocomplete -off not working in android .some suggestions are still there when i try to input some text. Code i am trying is given below &lt;tr&gt; &lt;td style="position:absolute; top:5%;height:35px;width:100%;" &gt; &lt;input type="text" id="userName" placeholder = "User Name" autocomplete ="off" &gt; &lt;/td&gt; &lt;/tr&gt;
has comment: http://stackoverflow.com/comment/48276590
has answer: http://stackoverflow.com/a/24800418
has answer: http://stackoverflow.com/a/25878365
type: Question

http://stackoverflow.com/q/24758297
has comment: http://stackoverflow.com/comment/38416059
downvote count: 0
has answer: http://stackoverflow.com/a/24759274
has comment: http://stackoverflow.com/comment/38415898
score: 1
has comment: http://stackoverflow.com/comment/38414539
has comment: http://stackoverflow.com/comment/38415224
has answer: http://stackoverflow.com/a/24760512
tagged with: google-chrome
has title: rest request ending by "/" works on chrome, not firefox
has answer: http://stackoverflow.com/a/24759467
type: Question
has comment: http://stackoverflow.com/comment/38415223
tagged with: firefox
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24759467
has comment: http://stackoverflow.com/comment/38415706
tagged with: rest
answer count: 3
has body: I am using Angularjs Chrome 35.0 and Firefox 30.0. I need to make Rest requests to an API. Some of those finishes by / like : http://mydomain.com/path/to/folder/ It won't work without this / and I don't have the hand on the API. To do this I use un service using resource : this.folder = function(folderKey) { var methods = resource(url, null, { 'create': { method: 'PUT', url: config.domain + folderPath + '\\/' } }); return methods; }; If I only put / or \/, angular doesn't keep the ending / while doing the request. The '\\/' is the only way i found to keep it. It does work well in chrome but in firefox it does make this url which obviously doesn't work : http://mydomain.com/path/to/folder%5C
upvote count: 1
favorite count: 0
tagged with: angularjs
linked to: http://stackoverflow.com/q/11850025
accepted answer: http://stackoverflow.com/a/24760512
has comment: http://stackoverflow.com/comment/38414486
has comment: http://stackoverflow.com/comment/38415695
has comment: http://stackoverflow.com/comment/38415571
type: AnsweredQuestion

http://stackoverflow.com/q/24828415
has comment: http://stackoverflow.com/comment/38546334
favorite count: 0
has comment: http://stackoverflow.com/comment/38546348
answer count: 3
has comment: http://stackoverflow.com/comment/38546546
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/24828446
has answer: http://stackoverflow.com/a/24828446
has comment: http://stackoverflow.com/comment/38546368
has comment: http://stackoverflow.com/comment/38546574
has comment: http://stackoverflow.com/comment/38547075
has comment: http://stackoverflow.com/comment/38546476
has title: Get content from pre element and run as javascript
accepted answer: http://stackoverflow.com/a/24828508
downvote count: 2
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38547111
has comment: http://stackoverflow.com/comment/38546405
type: Question
has comment: http://stackoverflow.com/comment/38546859
has comment: http://stackoverflow.com/comment/38546383
has body: So I have a bunch of JavaScript snippets each contained in their own pre tags. I would like to know if it is possible to get the content out of the pre tag and run it as JavaScript. For example let say one of my pre tags look like this: alert('Hello World'); When I click a button I want to get the content from within this pre and run it as JavaScript. I know I can simply do this $('[data-target="#basic-alert"]').on('click', function(e) { alert('Hello World'); }); But I have a quite a few code examples and would like to know if it is possible to avoid adding each of them into the JavaScript file. I would like to do something like this Run Code alert('Hello World'); Then call something like this in JavaScript $('.code-example > button').on('click', function(e) { var code = $(this).closest('.code-example').find('pre').text(); executeJS(code); }); executeJS is not a function I have made, I just used it because I am not sure what the code to would be to dynamically execute JavaScript code. I do have access to PHP for any server side scripting. Not sure if that will make this task easier or not, but thought I would state it anyways. If this is impossible please just let me know.
upvote count: 0
has answer: http://stackoverflow.com/a/24828508
score: -2
has comment: http://stackoverflow.com/comment/38546585
tagged with: javascript
has answer: http://stackoverflow.com/a/24828490
tagged with: jquery

http://stackoverflow.com/a/24814111
has comment: http://stackoverflow.com/comment/38555415
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24813400
type: Answer
has comment: http://stackoverflow.com/comment/38556838
answers question: http://stackoverflow.com/q/24813400
score: 2
downvote count: 0
has body: the css you're importing is setting a min-width of 30px on the rule: .progress-bar[aria-valuenow="0"] Easiest fix is to just override it in your html, or you could override it with pure css if you don't like inline css. Just use the rule I specified above. Working jsfiddle &lt;div class="progress-bar" role='progressbar' aria-valuemax="100" style="width: 0px;min-width:0px;" aria-valuemin="0" aria-valuenow="0"&gt;
has comment: http://stackoverflow.com/comment/38529732
upvote count: 2

http://stackoverflow.com/q/24883279
has body: My need is to have a watermark on row's table. I use this code (link to jsfiddle) to have the watermark. This is working fine, but I have a click function on some td element and this is covered by watermark. How update css to have click and watermark visible. z-index is not working :/ Thanks for your help.
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/24883348
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24883732
has title: css :after and click function
has answer: http://stackoverflow.com/a/24883732
type: Question
has comment: http://stackoverflow.com/comment/38650428
accepted answer: http://stackoverflow.com/a/24883348
tagged with: javascript
score: 0
answer count: 2
tagged with: jquery

http://stackoverflow.com/q/24875083
type: UnansweredQuestion
tagged with: aggregation-framework
tagged with: node.js
type: Question
tagged with: mongodb
tagged with: mongoose
has answer: http://stackoverflow.com/a/24877947
tagged with: javascript
has answer: http://stackoverflow.com/a/53297888
has body: I have a BlogPost model, and two of its attributes are draft: Boolean and user: String. Is it possible to get the following counts in one query using mongo's aggregation framework with Mongoose? BlogPost.count({ user: userID }, function(err, response() {}); BlogPost.count({ user: userID, draft: true }, function(err, response() {});
score: 0
has title: How To Get Multiple Counts In One Query?
answer count: 2
has comment: http://stackoverflow.com/comment/38636107

http://stackoverflow.com/comment/38641695
type: Comment
has text: It returns the val at the end after printing the output in the console
type: AnswerComment
comment on: http://stackoverflow.com/a/24878058
score: 0

http://stackoverflow.com/q/24763333
type: Question
tagged with: javascript
has body: After a few hours of attempting this, I'm starting to think it may be more work than it's worth but here goes: My users are uploading zipped files that include a .woff file. On page load, I need to step through each of these zipped records and use their .woff file as the src for a dynamic @font-face. So, the end goal would be something like: &lt;style type="text/css"&gt; {% for font in fonts %} @font-face { font-family: "{{ font.name }}"; src: url({{ font.woff_file }}); } {% endfor %} &lt;/style&gt; I started to mess with zip.js but didn't have too much luck and the documentation is pretty limited. How could I do something like this? Is the effort worth it, or should I just force my users to upload a .woff outside of the zipped file (I've done this and it works just fine, of course)
has answer: http://stackoverflow.com/a/24766229
score: 0
tagged with: unzip
answer count: 1
accepted answer: http://stackoverflow.com/a/24766229
has title: Dynamic font faces from zipped file?
tagged with: css
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/zip
has comment: http://stackoverflow.com/comment/38423397

http://stackoverflow.com/comment/38444685
comment on: http://stackoverflow.com/q/24774516
score: 0
type: Comment
type: QuestionComment
has text: secondly divs on their own don't have a "default" onclick action, so you could remove `e.preventDefault();`

http://stackoverflow.com/q/24804454
duplicate of: http://stackoverflow.com/q/14379274
linked to: http://stackoverflow.com/q/14379274
has body: I am curious but Google is not helping on this one... We are looking for a tidy way of using an object key (it is an object containing functions) while also having clean access to the key names. var obj={'key1':'val1','key2':'val2','key3':'val3'}; To get the desired key names in a loop we do: EDIT: this is wrong! for(var i=0;i&lt;obj.length;i++){ console.log(Object.keys(obj)[i]); } but would it be possible in this kind of loop? for(var k in obj){ //? } I have seen combination loops before using &amp;&amp;. Is JavaScript able to do an elegant combination of both? The closest I have got without disrupting the standard loop is: var i=0; for(var k in obj){ console.log(Object.keys(obj)[i]); i++; } but it is hardly elegant, not very innovative, it is more of a work around because 'i' is declared outside of the loop. Everything else we have tried errors.
has title: Can we combine regular for loops with for in
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24804542
has answer: http://stackoverflow.com/a/24804544
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/24804525
has comment: http://stackoverflow.com/comment/38500819
tagged with: for-loop
has answer: http://stackoverflow.com/a/24804472
tagged with: javascript
score: -1
possible better answer: http://stackoverflow.com/a/24804525
accepted answer: http://stackoverflow.com/a/24804472
has comment: http://stackoverflow.com/comment/38501089
has comment: http://stackoverflow.com/comment/38501034
upvote count: 0
favorite count: 0

http://stackoverflow.com/a/24820356
accepted answer of: http://stackoverflow.com/q/24820170
answers question: http://stackoverflow.com/q/24820170
downvote count: 0
has body: There's nothing wrong with clear, easily maintained code even if it's a few characters more to type initially, it might save a lot of time and effort later. Seems you need to set the value of $scope.msgBody, I don't think it's a good idea to do that in the assignment. Consider: $scope.msgBody = typeof $scope.input.gps === 'undefined'? 'Location not found.' : $scope.input.gps + ' not found.' However, I don't think that's "easier".
type: AcceptedAnswer
score: 4
type: Answer
upvote count: 4

http://stackoverflow.com/comment/38515276
score: 0
comment on: http://stackoverflow.com/a/24811504
type: Comment
has text: Thank you. This was an amazing answer.
type: AnswerComment

http://stackoverflow.com/a/24845115
type: AcceptedAnswer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24844939
has body: CSS can offer some possibilities. One out many with a pseudo element, text-indent and transition and pointer-events to toggle the click effect. tabindex in HTML to allow div to be focused via click and eventually via tab key. DEMO HTML &lt;div class="slidebif" tabindex="0"&gt;&lt;img src="http://lorempixel.com/200/300/people/9"/&gt;&lt;/div&gt; CSS .slidebif { margin:1em auto;/* optionnal*/ cursor:pointer;/* let's show it clicks */ width:200px;/* img width*/ white-space:nowrap;/* keep img and cloned pseudo on same line */ text-indent:0;/* set for transition */ transition:0.5s;/* tune it */ overflow:hidden;/* hide the pseudo */ } .slidebif:after { content: url(http://lorempixel.com/200/300/people/9);/* same image as img src */ } .slidebif:after, .slidebif img { vertical-align:top;/* optionnal*/ } .slidebif:focus { text-indent:-200px;/* bring pseudo in sight */ pointer-events:none;/* kill click catching , so it looses focus if clicked again */ } variant with a 2 columns table.
answers question: http://stackoverflow.com/q/24844939
type: Answer
has comment: http://stackoverflow.com/comment/38577715
has comment: http://stackoverflow.com/comment/38578324
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38577848
has comment: http://stackoverflow.com/comment/38577638
has comment: http://stackoverflow.com/comment/38578110
has comment: http://stackoverflow.com/comment/38577582
has comment: http://stackoverflow.com/comment/38582494

http://stackoverflow.com/comment/38563305
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/57594/discussion-between-logan-and-rajesh-kakawat).
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24837172
score: 0

http://stackoverflow.com/q/24840198
answer count: 1
has comment: http://stackoverflow.com/comment/38569081
tagged with: javascript
has comment: http://stackoverflow.com/comment/38569309
has comment: http://stackoverflow.com/comment/38568955
has comment: http://stackoverflow.com/comment/38568517
tagged with: google-maps-api-3
score: 2
accepted answer: http://stackoverflow.com/a/24841990
type: AnsweredQuestion
downvote count: 0
linked to: http://stackoverflow.com/q/5296115
favorite count: 0
has body: Im working on loading google map on-demand for my website utilizing this code: var googleMaps = document.createElement("script"); googleMaps.type = "text/javascript"; googleMaps.src = "https://maps.googleapis.com/maps/api/js?v=3.exp&amp;" + "callback=googlemapready"; Problem is that no matter what i do, callback is executed as 'window.googlemapready', is there any way i can set it to be a method of a different object ? That is without polluting global namespace, i know i could just wrap above code in a function and set window.googlemapready = something...
has title: Altering this value of googlemap callback
type: Question
has comment: http://stackoverflow.com/comment/38568710
upvote count: 2
has answer: http://stackoverflow.com/a/24841990

http://stackoverflow.com/comment/38652609
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24884197
has text: I tried changing it to another variable name, to no avail. Besides, even if this were the problem, it wouldn't explain why the snippet google.maps.event.addListener(markers[0], 'click', function() { infowindows[0].open(map,markers[0]); map.panTo(markers[0].getPosition()); }); wouldn't work, when called outside of the for loop.
score: 0

http://stackoverflow.com/a/24898104
has comment: http://stackoverflow.com/comment/38716337
has comment: http://stackoverflow.com/comment/38703420
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/38714213
has comment: http://stackoverflow.com/comment/38691040
has body: Here is a working example of your code with some adjustments: function ajax(action,id){ action = 'save'; if(action =="save") data = $("#userinfo").serialize()+"&amp;action="+action; else if(action == "delete"){ data = "action="+action+"&amp;item_id="+id; } $.ajax({ type: "GET", url: "http://demo.ckan.org/api/3/action/package_list", data: data, dataType: "jsonp", success: function(response){ console.log(response); if(response.success == "1"){ if(action == "save"){ $(".dert-form").fadeOut("fast",function(){ alert("here first"); }); } else if(action == "delete"){ alert("here to delete"); } } }, error: function(res, textStatus, errorThrown){ console.log("Unexpected error! Try again."); } }); } I'm hitting a data.gov API endpoint and logging the response to the console. Note, the dataType has to be jsonp since I'm make a cross-domain request. You can also look at the JSBin I created with the above code.
has comment: http://stackoverflow.com/comment/38714402
has comment: http://stackoverflow.com/comment/38716245
answers question: http://stackoverflow.com/q/24895982
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/24895982

http://stackoverflow.com/comment/38497839
score: 0
type: AnswerComment
has text: $(document).ajaxStop(function () { console.log("ajaxStop is called"); $.getJSON('lib/get-details.php', function(data) { var twitter_followers = data.twitter_followers; $('#twitter-followers').html(twitter_followers); }); });
type: Comment
comment on: http://stackoverflow.com/a/24802673

http://stackoverflow.com/comment/38686396
comment on: http://stackoverflow.com/q/24901802
score: 0
type: Comment
type: QuestionComment
has text: I can't understand post your error log.

http://stackoverflow.com/comment/38428974
comment on: http://stackoverflow.com/q/24766148
type: Comment
score: 1
has text: `$('input[name="price[]"]').filter(":checked").map(function () { return this.value; }).get());` - http://jsfiddle.net/H7mCt/
type: QuestionComment

http://stackoverflow.com/comment/38669704
comment on: http://stackoverflow.com/a/24878260
score: 0
type: AnswerComment
has text: **Works** _thanks again_ @IvyLynx Updated with the `for (var i=0; i< textIn.length; i = i+1) { ...` & `variableNameS[i]` to handle the array returned by `getElementsBtClassName` ; here : [http://jsfiddle.net/positive_x/qsStc/](http://jsfiddle.net/positive_x/qsStc/)
type: Comment

http://stackoverflow.com/q/24762341
tagged with: javascript
score: 0
answer count: 1
has title: Html field incrementer breaks if field is edited by user
type: UnansweredQuestion
has body: Below I have code that is problematic to me. The purpose of it is to increment "input class=qty". This works great unless the user puts in their own number then decides they want to return to using the incremental buttons. My impression is that I can no longer reference the value once the field is edited, but I'm unsure as to what the cause is or a proper solution. Help would be appreciated. &lt;html&gt; &lt;head&gt; &lt;script&gt; function qtyPlus(fieldId){ var curVal = parseInt(document.getElementById(fieldId).value); if(isNaN(curVal)) { document.getElementById(fieldId).setAttribute('value', 0); } else { document.getElementById(fieldId).setAttribute('value', curVal+1); } } function qtyMinus(fieldId) { var curVal = parseInt(document.getElementById(fieldId).value); if(isNaN(curVal)) { document.getElementById(fieldId).setAttribute('value', 0); } else { if(curVal != 0) { document.getElementById(fieldId).setAttribute('value', curVal-1); } } } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input type='button' value='-' onclick='qtyMinus("numOfAttendees")' class='qtyminus' &gt; &lt;input type='text' value='0' class='qty' id='numOfAttendees' &gt; &lt;input type='button' value='+' onclick='qtyPlus("numOfAttendees")' class='qtyplus' &gt; &lt;/body&gt; &lt;/html&gt;
tagged with: http://stackoverflow.com/tag/html
type: Question
has answer: http://stackoverflow.com/a/24762464

http://stackoverflow.com/a/24750042
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38430631
upvote count: 1
has body: You need to use a promise construct to get at the data. The controller code can be re-written as: app.controller('ArticleListCtrl', function($scope, nprService) { //call the service and store as a variable nprService.get().then(function(result){ $scope.article = result.data; });
type: Answer
answers question: http://stackoverflow.com/q/24749655

http://stackoverflow.com/a/24795682
has body: After inspecting the script and setData() function I've found there isn't any setter function. But options can be reset and redraw like below. Initiate the Chart on js file (Hard Coded) var options = { element : 'lead-summery', data : xChart.leads, xkey: 'date', ykeys: ['total', 'bananas', 'apples', 'oranges'], labels:['Total', 'Bananas', 'Apples', 'Oranges'], lineColors:['#E67A77', '#D9DD81', '#79D1CF'], fillOpacity: 0.2, behaveLikeLine: true, lineWidth: 1 }; // you must save the cart in a global variable window.myAreaChart = Morris.Area(options); Dynamically Update The Chart Options Now say we want to Add some new data via AJAX and want to change xLabelFormat function and xLabelAngle for labels. var data = {}; // we get this from ajax call or whatever // now we update the options // xLabelFormat callback function window.myAreaChart.options.xLabelFormat = function(date){ return formatDate(date); } // xLabelAngle window.myAreaChart.xLabelAngle = 60; // add data and update the chart window.myAreaChart.setData(data); It is very important to understand that in order to update the chart we need to call redraw() method for example window.myAreaChart.redraw(). Otherwise the chart won't update. We did not call redraw() on the example above because the setData() method calls it so no need for call it twice. But if you do not use setData() you will need to call redraw() in order to update the chart visually.
upvote count: 4
answers question: http://stackoverflow.com/q/24794962
downvote count: 0
score: 4
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/50154376
accepted answer of: http://stackoverflow.com/q/24794962
type: Answer
has comment: http://stackoverflow.com/comment/57478313

http://stackoverflow.com/comment/38560083
score: 0
comment on: http://stackoverflow.com/q/24835395
type: Comment
type: QuestionComment
has text: @Pogrindis i notice its running express 4 the newest version...could this be a problem for openshift?

http://stackoverflow.com/comment/38474708
score: 0
has text: @ThomasP1988, I'm doing this from the controller. Because I need to get a scope value.
comment on: http://stackoverflow.com/q/24790050
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24802730
type: Answer
has body: The JQuery focus event will be your best bet: JSFiddle $('body').on('focus', 'select', function(){ ... }); Reference: why to use .on() instead of .click()
has comment: http://stackoverflow.com/comment/38498285
has comment: http://stackoverflow.com/comment/38498385
score: 0
answers question: http://stackoverflow.com/q/24802638

http://stackoverflow.com/comment/38624129
score: 0
type: AnswerComment
type: Comment
has text: I am reading up on it right now, but I am still very confused about how to use it. Trying to see if I can find more examples. It seems to expect a lot of knowledge about node.js
comment on: http://stackoverflow.com/a/24869295

http://stackoverflow.com/comment/38445976
score: 0
comment on: http://stackoverflow.com/q/24774439
type: Comment
type: QuestionComment
has text: I get the model object from ajax call, for picture, complete path of picture (string value).

http://stackoverflow.com/a/24878009
upvote count: 1
has body: $actions = Input::get('action_id'); Where actions should ba an array. From this you can pretty much do whatever you want. The easy way is to do a foreach. foreach($actions as $action) { //validate }
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24875804
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/24875804

http://stackoverflow.com/comment/38415118
type: Comment
comment on: http://stackoverflow.com/a/24758436
score: 1
type: AnswerComment
has text: Ah - you're doing it via cross-domains? Yes - the same rule as for iframes applies to objects regarding cross-domain URLs.

http://stackoverflow.com/q/24819835
has comment: http://stackoverflow.com/comment/38530222
has title: How to show multiple months in bootstrap-datepicker
tagged with: twitter-bootstrap-3
linked to: http://stackoverflow.com/q/21507771
has answer: http://stackoverflow.com/a/24820067
type: Question
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/45866393
has body: How to show two months in a single view of bootstrap-datepicker. Please find the sample code from the following link. JSFiddle Link $("#datepicker").datepicker();
tagged with: twitter-bootstrap
type: UnansweredQuestion

http://stackoverflow.com/q/24844566
tagged with: submit
downvote count: 0
answer count: 7
tagged with: button
has answer: http://stackoverflow.com/a/61684311
favorite count: 0
has answer: http://stackoverflow.com/a/24844862
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/62568788
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24844744
score: 4
has comment: http://stackoverflow.com/comment/38576411
has answer: http://stackoverflow.com/a/69051522
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/32352828
upvote count: 4
has body: I was wondering if anyone could help with a simple JavaScript code to click all buttons with the same value name/input name on a page? They each share: &lt;input name="all" type="submit" value="Do All"&gt; Here's a screenshot of the buttons: http://oi61.tinypic.com/2nqblnr.jpg Maybe one should make a button that works as a "click all" button? This will be a chrome extension (for personal use), so I can't really go about changing the "do all" button's code. I was having a hard time finding it on Google, and I'm fine with HTML/CSS but really terrible with JavaScript.
has title: Click All Buttons on Page
has answer: http://stackoverflow.com/a/24844702

http://stackoverflow.com/a/25364946
answers question: http://stackoverflow.com/q/24798902
score: 5
has body: Finally, I figured out how to send the ws_key: $http({ method: 'get', url: ws_url + 'customers/?schema=blank', params: { ws_key: ws_key }); You have to pass the ws_key param with your key to access the PrestaShop webservice.
type: AcceptedAnswer
upvote count: 5
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24798902

http://stackoverflow.com/q/24893344
has body: Why is this click handler not called after adding an element to the list? Test Test Add One Here is the JS: $(document).ready(function(){ $('#a').on('click', '> .a1', function(){ alert('works')}) $('#b').on('click', '> .b1 > ul > li > .b2', function(){ alert('works')}) $('#btn').click(function(){ $('#list').append('Test Added') }) }) Fiddle: http://jsfiddle.net/eV4rX/
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24893389
upvote count: 1
has answer: http://stackoverflow.com/a/24893478
type: Question
has answer: http://stackoverflow.com/a/24893505
tagged with: javascript
has answer: http://stackoverflow.com/a/24893530
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/24893453
has comment: http://stackoverflow.com/comment/38669547
answer count: 5
has title: jQuery on() Not Firing For Dynamic Element

http://stackoverflow.com/comment/121435441
score: 5
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/55260552
has text: Wonderful function! Shorter modern syntax with nullish coalescing: foo.flatMap(bar => bar.baz ?? [ ])

http://stackoverflow.com/comment/38657573
score: 0
type: Comment
has text: Possible duplicate - http://stackoverflow.com/questions/20034555/how-to-make-side-id-navigation-links-active-hover-state-as-i-scroll-down-to-thei?rq=1
type: QuestionComment
comment on: http://stackoverflow.com/q/24887258

http://stackoverflow.com/q/24823781
score: 0
has answer: http://stackoverflow.com/a/24823932
has answer: http://stackoverflow.com/a/24823820
upvote count: 1
linked to: http://stackoverflow.com/q/12065329
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
favorite count: 0
answer count: 5
has body: I am adding input dynamically using jQuery. After that i am trying to use focus event to generate yet another input group. Here is the jsfiddle (http://jsfiddle.net/sk8UG/) and the snippet is below HTML: &lt;div class='row' id='addChild'&gt; &lt;input type='name' name='child0' id='child0'&gt; &lt;input type='name' name='phone0' id='phone0'&gt; &lt;/div&gt; JS: $(document).ready(function(){ $("#child0").focus(function() { $('#addChild').append("&lt;input type='name' name='child1' id='child1'&gt;&lt;input type='name' name='phone1' id='phone1'&gt;"); }); $("#child1").focus(function() { $('#addChild').append("&lt;input type='name' name='child2' id='child2'&gt;&lt;input type='name' name='phone2' id='phone2'&gt;"); }); }); On focus of #child0 it will create #child1. But, on focus of #child1, it does nothing
has answer: http://stackoverflow.com/a/24824895
tagged with: input
has answer: http://stackoverflow.com/a/24823824
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/24823949
has title: Focus event not working on dynamic content
accepted answer: http://stackoverflow.com/a/24823820
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/24823824

http://stackoverflow.com/q/24785713
has answer: http://stackoverflow.com/a/36364801
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27875782
accepted answer: http://stackoverflow.com/a/25064022
tagged with: chart.js
has answer: http://stackoverflow.com/a/24785797
has answer: http://stackoverflow.com/a/26131875
has body: The API for chart.js allows one to edit points of the datasets loaded into it, for example: .update( ) Calling update() on your Chart instance will re-render the chart with any updated values, allowing you to edit the value of multiple existing points, then render those in one animated render loop. .addData( valuesArray, label ) Calling addData(valuesArray, label) on your Chart instance passing an array of values for each dataset, along with a label for those points. .removeData( ) Calling removeData() on your Chart instance will remove the first value for all datasets on the chart. All of these are great, but I cannot figure out how to load an entirely new dataset in, wiping out the old. The documentation does not seem to cover this.
has answer: http://stackoverflow.com/a/33788118
has answer: http://stackoverflow.com/a/60313165
has answer: http://stackoverflow.com/a/45418428
type: Question
has answer: http://stackoverflow.com/a/34852606
has answer: http://stackoverflow.com/a/25064022
score: 103
has answer: http://stackoverflow.com/a/61154847
has answer: http://stackoverflow.com/a/73913387
has title: chart.js load totally new data
tagged with: javascript
linked to: http://stackoverflow.com/q/25768583
has answer: http://stackoverflow.com/a/46587564
has answer: http://stackoverflow.com/a/41981345
has answer: http://stackoverflow.com/a/27853849
has answer: http://stackoverflow.com/a/26983257
has answer: http://stackoverflow.com/a/64508534
answer count: 24
favorite count: 0
has answer: http://stackoverflow.com/a/43831674
has answer: http://stackoverflow.com/a/77866519
has answer: http://stackoverflow.com/a/30677206
has answer: http://stackoverflow.com/a/57058292
has answer: http://stackoverflow.com/a/73619360
downvote count: 0
upvote count: 103
possible better answer: http://stackoverflow.com/a/26983257
has answer: http://stackoverflow.com/a/36945550
linked to: http://stackoverflow.com/q/24815851
has answer: http://stackoverflow.com/a/37039846
has answer: http://stackoverflow.com/a/67233404

http://stackoverflow.com/q/24870896
has answer: http://stackoverflow.com/a/24989799
has body: Sorry if this was already asked, but I really didn't find anything that applies exactly to my problem. Well, although I know that an AngularJS form value must be loaded from controllers and that I can create routes and RESTful resources with AngularJS, I am using Python and Flask to get the page and data but AngularJS to post data to the server. The problem is, when I put "ng-model" within a text input, the value from server is ignored, like so: &lt;input type="text" ng-model="first_name" value={{user.first_name}}&gt; is interpreted as: &lt;input type="text" ng-model="first_name" value="John" class="ng-pristine ng-valid"&gt; but the value cannot be seen, as if there is no "value" attribute. Given that situation, I tried to use directives, but I didn't realise how to get this server data and share it with another scope. What I want is to simply load a page with server data inside a ng-model input and access it through controller methods later ("placeholder" is useless here). I am sending the page like this: class ShowUser(MethodView): def get(self): s = Session(request) if s.is_logged(): user = dict({'username': s.user.username, 'first_name': s.user.first_name, 'last_name': s.user.last_name, 'email': s.user.email, 'logged': True}) return render_template('users/show-user.html', user=user) else: user = dict({'username': 'null', 'logged': False}) return render_template('index.html', user=user) It's that "user" variable in "render_template" that I am trying to access.
has comment: http://stackoverflow.com/comment/38629113
answer count: 1
has comment: http://stackoverflow.com/comment/38629913
downvote count: 0
tagged with: javascript
tagged with: flask
has comment: http://stackoverflow.com/comment/38627627
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38627863
tagged with: python
has comment: http://stackoverflow.com/comment/38627265
has comment: http://stackoverflow.com/comment/38630695
has comment: http://stackoverflow.com/comment/38629949
has comment: http://stackoverflow.com/comment/38630636
has comment: http://stackoverflow.com/comment/38629726
upvote count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38630984
type: Question
has title: AngularJS: Change input value with server data when page loads
score: 3

http://stackoverflow.com/comment/38444723
score: 0
type: AnswerComment
type: Comment
has text: glad to be able to help! ;)
comment on: http://stackoverflow.com/a/24773758

http://stackoverflow.com/a/24771944
score: 0
has body: You can't run java code in jquery, jquery is a library for javascript and java is a programming language. also jquery is more for UI, animation and other web related things, your code seems to be logic code.
answers question: http://stackoverflow.com/q/24771788
type: Answer

http://stackoverflow.com/comment/38520960
score: 0
has text: You can't reject a promise from outside. You can try to cancel it.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24813232

http://stackoverflow.com/q/24819921
has comment: http://stackoverflow.com/comment/38530163
downvote count: 4
has comment: http://stackoverflow.com/comment/38530230
upvote count: 0
has title: Find the closest element by class from previous all elements
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/24820002
has comment: http://stackoverflow.com/comment/38530248
has answer: http://stackoverflow.com/a/24820510
has comment: http://stackoverflow.com/comment/38530160
answer count: 3
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/24820052
has answer: http://stackoverflow.com/a/24820052
score: -4
accepted answer: http://stackoverflow.com/a/24820002
type: AnsweredQuestion
has body: Here is my html Header 1 OPTION 1 OPTION 2 OPTION 3 Header 2 OPTION 4 OPTION 5 OPTION 6 Header 3 OPTION 7 OPTION 8 OPTION 9 If OPTION 1 is clicked then text 'Header 1' should be alerted,if OPTION 4 is clicked then text 'Header 2' should be alerted.Please tell jquery function to do this.
type: Question
has comment: http://stackoverflow.com/comment/38530252

http://stackoverflow.com/q/24807581
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38508885
has comment: http://stackoverflow.com/comment/38507866
has comment: http://stackoverflow.com/comment/38512640
has body: The point is that my app looks cool in Firefox and Google Chrome. But when I get the app compiled with PhoneGap, in my Android device it looks like "What happened with my CSS3 code and some JS events?". I can list the features not reflected in my PhoneGap app that are reflected in Firefox and Chrome browsers: box-shadow text-shadow border-radius flex and flex-*, justify-content, align-items (and flex-related stuff, in general) transitions And about JS, it is curious, because some events are fired, but others not. Concretely, I use DOM manipulation via JS to deploy (manually-coded) dialogs (I mean, not alert, prompt or confirm functions), and when the dialog-button is pressed, the dialog itself disappears (also manually-coded). All OK in FF and Chrome, but with PhoneGap, the dialog is displayed but it is not removed when the dialog-button gets clicked. I am not using any native functions, I am not using PhoneGap native features for JS, just pure web-client-side-JS. But anyway, I am using the event: document.addEventListener("deviceready", myJSCode); //But it does not work... Could anyone help me in this issue? I do not know what I can do, or where to find answers for this. Thank you a lot. If code is needed, just ask for it (it is a small tic-tac-toe game app, but I wanted to do it with PhoneGap... I still hope it was the right choice!)
favorite count: 0
tagged with: cordova
type: UnansweredQuestion
tagged with: android
tagged with: css
has title: Problems with css styles and js events with PhoneGap
answer count: 0
score: 1
upvote count: 1
tagged with: dom
type: Question
has comment: http://stackoverflow.com/comment/38507342
has comment: http://stackoverflow.com/comment/38508696

http://stackoverflow.com/comment/38628667
type: AnswerComment
type: Comment
has text: ... `[].some.call($('.selects'), function(e) { return !!e.value; })` ?? (or with `$.trim()` of course)
comment on: http://stackoverflow.com/a/24871367
score: 0

http://stackoverflow.com/comment/38579637
comment on: http://stackoverflow.com/a/24846152
type: AnswerComment
has text: Awesome. Thanks for everyone's time.
score: 0
type: Comment

http://stackoverflow.com/comment/38544758
comment on: http://stackoverflow.com/q/24827385
has text: thanks @ChrisCirefice, I will keep this in consideration
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24872574
has comment: http://stackoverflow.com/comment/38631436
type: Answer
has body: You can omit curly braces anytime there is only one statement. for (var x in obj) { console.log(x); } can become for (var x in obj) console.log(x); but if you had for (var x in obj) { console.log(x); console.log(x); } it would need the curly braces. This is somewhat inconsistent. For example, it works for for, while and if, but not for try or catch. For consistency, I always use braces.
upvote count: 7
score: 7
accepted answer of: http://stackoverflow.com/q/24872513
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38634875
has comment: http://stackoverflow.com/comment/38632625
answers question: http://stackoverflow.com/q/24872513

http://stackoverflow.com/q/24840261
has comment: http://stackoverflow.com/comment/38568182
has comment: http://stackoverflow.com/comment/38568239
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38568436
tagged with: jquery-ui
has body: I have a Margin or we can say a Specific distance changed from HTML select option tag in future dynamically.. I have created a Range Slider with jQueryUI Slider. What i am trying to do : I want to stop sliding after a specific distance means margin. Need help . JSFIDDLE: http://jsfiddle.net/3j3Um/1/ HTML &lt;div id="slider-range"&gt;&lt;/div&gt; jQuery $("#slider-range").slider({ range: true, min: 0, max: 95, values: [20, 80], slide: function (event, ui) { var getMargin = ui.values[0] - ui.values[1]; $("#margin").val(getMargin); if (getMargin == -30) { alert('stop the sliding'); } } });
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Stop the jQueryUI Slider after a specific difference/margin
score: 0
has answer: http://stackoverflow.com/a/24840712
accepted answer: http://stackoverflow.com/a/24840712
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38568535
tagged with: css

http://stackoverflow.com/q/24757751
has answer: http://stackoverflow.com/a/24757841
has answer: http://stackoverflow.com/a/24758154
upvote count: 2
has answer: http://stackoverflow.com/a/24758045
answer count: 3
has body: I would like to place an image centrally within a div (fiddle). Because I want that div to inherit that div's height from another one that is floating next to it, I had to use this trick. For that reason, the solutions described here don't seem to be working. The requirement is that no other behavior is modified, but the code can be as long as the effect achieved is the same. I am also willing to accept solutions involving javascript, if necessary. Because Sometimes It Takes a Village What about robots the size of tea cups that scoot around on tiny wheels, snapping pictures with miniature cameras and keeping track of where they are in relation to dozens of others? .container { background: green; overflow: hidden; } .logo-div { background: yellow; width: 150px; float: left; padding-bottom: 1000px; margin-bottom: -1000px; } .text-div { background: blue; float: left; max-width: 350px; padding-bottom: 1000px; margin-bottom: -1000px; } .logo { width: 100px; }
tagged with: layout
tagged with: javascript
type: UnansweredQuestion
has title: Align an Image Centrally within a Div
linked to: http://stackoverflow.com/q/4888223
score: 2
downvote count: 0
tagged with: web
favorite count: 0
type: Question
linked to: http://stackoverflow.com/q/2997767
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/q/24806624
has title: How do I prevent event cycles with FRP (and bacon.js)
type: Question
tagged with: bacon.js
tagged with: javascript
has answer: http://stackoverflow.com/a/24901311
answer count: 1
downvote count: 0
has body: I've managed to create a cycle in my bacon-powered application, so I need some advice on how to break it. Let's say we have several properties which carry some state of the application. This state is supposed to be stored via HTML5 History API (pushState) and thus I combine those properties to an object and execute a pushState on it. However, I also need to cover popstate events, so on every popstate (back button, etc.) I split the state object back into single properties and inject them into their original streams. Now I've got myself a cycle: since those property streams are the same streams I got my pushState from in the first place, pushState is called again, duplicating states on the stack and making the back button useless. This is of course my mistake, however, I don't see a good solution apart from splitting each property stream into two and combining them differently in pushState/popState-specific cases. But that seems rather unelegant -- is there any canonical way to avoid this kind of cycles?
favorite count: 0
type: UnansweredQuestion
tagged with: frp
score: 1
upvote count: 1

http://stackoverflow.com/comment/38487559
type: AnswerComment
has text: It should alert 0 as the alert statement is executed well before the click event is triggered.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/24797017

http://stackoverflow.com/comment/38678374
type: QuestionComment
has text: It should be noted that `document.body instanceof HTMLElement === true`
comment on: http://stackoverflow.com/q/24897940
type: Comment
score: 0

http://stackoverflow.com/q/24899168
has comment: http://stackoverflow.com/comment/38684627
type: UnansweredQuestion
downvote count: 2
has title: URL regex passed by regex buddy but failed by Dart
has comment: http://stackoverflow.com/comment/38680653
score: 1
type: Question
has comment: http://stackoverflow.com/comment/38690113
tagged with: perl
has comment: http://stackoverflow.com/comment/38680511
tagged with: javascript
has comment: http://stackoverflow.com/comment/38684492
favorite count: 0
has answer: http://stackoverflow.com/a/24903055
upvote count: 3
has comment: http://stackoverflow.com/comment/38685320
tagged with: dart
answer count: 1
tagged with: regex
has comment: http://stackoverflow.com/comment/38687412
has body: I have the following regex in JavaScript regex (https?|ftp)://([-A-Z0-9.]+)(/[-A-Z0-9+&amp;@#/%=~_|!:,.;]*)?(\?[A-Z0-9+&amp;@#/%=~_|!:‌​,.;]*)? It attempts to validate and empty space/s or a URL. Yet when I attempt to use it in Dart RegExp that uses a Perle flavour regex, it does not validates. Any help is appreciated.

http://stackoverflow.com/a/24758277
has body: Unless you are using a predefined angular filter you can do this with Array.prototype.filter() fourHunderds = $scope.filterErrors.filter(function(item){ return item.StatusCode == '404'; }).length
type: Answer
accepted answer of: http://stackoverflow.com/q/24757747
answers question: http://stackoverflow.com/q/24757747
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/38822668
has text: Ok, but again, it is important to emphasize that this will only work for views that are served from a controller action. If you have a route in your **config/routes.js** that points directly to a view, as I demonstrated in my answer, then this won't work because policies are not applied to views--only to actions.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24969542

http://stackoverflow.com/a/24813540
type: Answer
score: 2
upvote count: 3
answers question: http://stackoverflow.com/q/24799558
downvote count: 1
has body: Solved by myself, it was hard :D It taked me 2h becouse i never used canvas xD so my final solution is here -> http://jsfiddle.net/StartStep/g25J6/7/ var w = this.width; h = this.height, cw = canvas.width, ch = canvas.height, nx = 0, ny = 0, r = h/w; if(h&lt;w) { //horizontal image r = w/h; nh = 400, nw = r*400; nx = -(nw-300)/2; } else { //vertical image nw = 300, nh = r*300; ny = -(nh-400)/2; } The image is centered and croped by matching size. I hope it will help you too. Bay
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24799558

http://stackoverflow.com/a/24880626
answers question: http://stackoverflow.com/q/24880539
upvote count: 0
score: -2
downvote count: 2
has body: change this &lt;a href='javascript:sayThis('".$agent_email."');'&gt; to &lt;a href='javascript:sayThis(\"".$agent_email."\");'&gt;
type: Answer

http://stackoverflow.com/a/24811651
answers question: http://stackoverflow.com/q/24810712
upvote count: 3
score: 3
type: AcceptedAnswer
downvote count: 0
has body: It's probably not the cleanest way, but you can create a new service (or edit the current one to work with several parameters): .factory('ArticlesService2', ['$resource', function($resource) { return $resource('articles/:param1/:param2', { param1: '', param2: '' }, { update: { method: 'PUT' } }); } ]); Then call it in your controller : $scope.findWithParams = function() { $scope.article = ArticlesService2.query({ param1: $scope.aYearFromNow, param2: $scope.aMonthAgo }); }; On the back-end, you'll need to prepare a route : app.route('/articles/:param1/:param2') .get(articles.listWithParams) Add a function to your back-end controller : exports.listWithParams = function(req, res) { Article.find() .where('date') .lt(req.params.param1) .gt(req.params.param2) .sort('-created').populate('user', 'displayName') .exec(function(err, articles) { if (err) { return res.send(400, { message: getErrorMessage(err) }); } else { res.jsonp(articles); } }); }; Should work, haven't tested it though.
accepted answer of: http://stackoverflow.com/q/24810712
type: Answer

http://stackoverflow.com/comment/95063091
type: Comment
score: 1
comment on: http://stackoverflow.com/a/41527364
type: AnswerComment
has text: Please don't just post some tool or library as an answer. At least demonstrate [how it solves the problem](http://meta.stackoverflow.com/a/251605) in the answer itself.

http://stackoverflow.com/a/24766531
score: 3
has comment: http://stackoverflow.com/comment/38429483
has comment: http://stackoverflow.com/comment/38430264
has comment: http://stackoverflow.com/comment/38430171
has comment: http://stackoverflow.com/comment/38429871
type: AcceptedAnswer
downvote count: 1
has body: The following should do it: $('form')[0].submit(); What you have $('form').submit() triggers the submit event thereby firing the submit handler again which in turn prevents default form submission and you're back where you started! CONCEPT VERIFICATION Step 1: Load the demo above and you'll see submit event triggered in the console. Step 2: Now uncomment $('form')[0].submit() and comment out $('form').submit() and click run and viola .. the form is submitted .. by-passing the submit event handler. CONCLUSION: ... see above. UPDATE If you have more than one form on the page the code above can be adjusted to target the relevant form. For instance, to submit the first form on the page: $('form').first()[0].submit(); Or simply use any selectors, such as ID or css, that provides the need level of specificity.
accepted answer of: http://stackoverflow.com/q/24766452
answers question: http://stackoverflow.com/q/24766452
type: Answer
upvote count: 4

http://stackoverflow.com/comment/38592748
type: Comment
score: 0
type: AnswerComment
has text: @BaccouchTaieb That's because javascript doesn't keep on page loads. You have your html set to have the first link active when the page loads.
comment on: http://stackoverflow.com/a/24852964

http://stackoverflow.com/a/24764343
answers question: http://stackoverflow.com/q/24755360
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38451265
has body: Looking at the plugin code, it is only designed for one level deep nesting. This is because the developer chose to remove created subpages each time you click on a parent LI. So when you get to the second level of depth, its parent has been removed from the DOM and you have to click the back button twice to get to the original page. I have made some changes to the plugin code that should solve this problem: In _attachBindings, I have commented out the line that removes previously created subpages: _attachBindings: function() { this._on({ "click": "_handleSubpageClick" }); this._on( "body", { "pagechange": function(){ if ( this.opening === true ) { this.open = true; this.opening = false; } else if ( this.open === true ) { //Don't remove the old LI //this.newPage.remove(); this.open = false; } } }); },... Then in _handleSubpageClick, I check if the subpage already exists in the DOM (via data attribute added when creating the page). If not, we go through the existing code that creates the subpage, and then in the end I store the created subpage id in a data attribute on the parent LI. If it does exist we just navigate to that page. _handleSubpageClick: function( event ) { if( $(event.target).closest( "li" ).children( "ul" ).length == 0 ) { return; } this.opening = true; //see if we already created the subpage var $li = $(event.target).closest( "li" ); var pid = $li.data("nextpageid"); if (pid &amp;&amp; pid.length &gt; 0){ this.pageID = pid; } else { this.newPage = $( this.options.page ).uniqueId(); this.nestedList = $( event.target ).children( "ul" ) .clone().attr( "data-" + $.mobile.ns + "role", "listview" ) .css( "display", "block" ); this.pageName = ( $( event.target.childNodes[0] ).text().replace(/^\s+|\s+$/g, '').length &gt; 0 )? $( event.target.childNodes[0] ).text() : $( event.target.childNodes[1] ).text(); this.pageID = this.newPage.attr( "id" ); // Build new page this.newPage.append( $( this.options.header ).find( "h1" ).text( this.pageName ).end() ).append( …
has comment: http://stackoverflow.com/comment/38458399
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38448655
accepted answer of: http://stackoverflow.com/q/24755360
type: Answer

http://stackoverflow.com/q/24778666
tagged with: javascript
has answer: http://stackoverflow.com/a/24779405
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/24778943
tagged with: jquery
has body: I have hand-made autocomplete ajax form, and here is code. Field with id "city" handles city and suggest cities starting with value of input form $(document).ready(function () { var input_field = $("#city"); $("#city").keypress(function () { setTimeout(function() { var city_name = input_field.val() $.ajax({ type: "GET", url: "<%=cities_autocomplete_path%>", data: {city_start_with:city_name} }).success(function (data) { $("#city_results").empty(); if (data.length==0) $("#city_results").hide(); else { $("#city_results").show() for(var idx in data) $("#city_results").append(' <a >test '); } }); },500); }) }); Problem is that onclick event doesn't work in Chrome, but works fine in Firefox and Opera: $("#city_results").append(' <a >test '); Anybody had same problems?
tagged with: ajax
has title: Onclick event doesn't handle in Chrome, but work fine in Firefox
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38452059
type: Question
has comment: http://stackoverflow.com/comment/38452014

http://stackoverflow.com/comment/38698131
type: QuestionComment
has text: i don't understand, can you explain me why i need to have an access to the server header?
comment on: http://stackoverflow.com/q/24908592
score: 0
type: Comment

http://stackoverflow.com/a/24800230
type: AcceptedAnswer
score: 0
type: Answer
has body: I did it now with a workaround solution (keeping two data structures, allData and filteredData, and filtering a cloned version of allData): //clone data filteredData = jQuery.extend(true, {}, allData); for (var i = 0; i &lt; filteredData.length; i++) { var values = filteredData[i].values; for (var j = 0; j &lt; values.length; j++) { if (values[j].shape!=shape) { filteredData[i].values.splice(j,1); j--; } } } d3.select('#test1 svg').datum(filteredData); chart.update(); Doing it this way, the whole graph gets updated. There are some errors thrown on console, but except some small rendering issues, it seems to work.
accepted answer of: http://stackoverflow.com/q/24786795
answers question: http://stackoverflow.com/q/24786795

http://stackoverflow.com/q/24908794
tagged with: jquery
has answer: http://stackoverflow.com/a/24909051
has comment: http://stackoverflow.com/comment/38698447
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/24909024
tagged with: css
has title: Showing two gifs using CSS
has answer: http://stackoverflow.com/a/24909024
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38698328
has comment: http://stackoverflow.com/comment/38698380
has comment: http://stackoverflow.com/comment/38698295
has answer: http://stackoverflow.com/a/24909054
has comment: http://stackoverflow.com/comment/38698230
has comment: http://stackoverflow.com/comment/38698385
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38698803
score: 0
has body: I was trying to show a gif on my page and succeeded in showing it. But now i want to show two gifs next to each other. I was wondering is it possible to do so. CSS #loader { position: fixed; z-index: 1000; margin-left: 0%; margin-top: 0%; height: 100%; width: 100%; background: rgba( 255, 255, 255, .8 ) url('../Images/loading.gif') 50% 50% no-repeat; } HTML &lt;div id="loader"&gt;&lt;/div&gt; Jquery $(window).load(function () { $('#loader').fadeOut(500); }); Now can i add one more gif in background using url??? I tried following but it does not seem to work #loader { position: fixed; z-index: 1000; margin-left: 0%; margin-top: 0%; height: 100%; width: 100%; background: rgba( 255, 255, 255, .8 ) url('../Images/loading.gif') , url('../Images/ajax-loader.gif') 50% 50% ; }
accepted answer: http://stackoverflow.com/a/24909054
answer count: 3
has comment: http://stackoverflow.com/comment/38698331
has comment: http://stackoverflow.com/comment/38698183

http://stackoverflow.com/a/24893505
has comment: http://stackoverflow.com/comment/38672111
type: Answer
answers question: http://stackoverflow.com/q/24893344
score: 0
has body: It has nothing to do with on() and everything to do with the markup you're appending. Wrap the in a so that it matches your second selector there. http://jsfiddle.net/TJ8Yy/ $('#list').append(' Test Added ')

http://stackoverflow.com/comment/38488683
comment on: http://stackoverflow.com/a/24774532
has text: Alright then, see http://jsfiddle.net/HbR66/ . It behaves exactly the same with or without the function.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/24810489
has comment: http://stackoverflow.com/comment/38513560
has comment: http://stackoverflow.com/comment/38512779
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/38513495
upvote count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38512549
has comment: http://stackoverflow.com/comment/38512570
has comment: http://stackoverflow.com/comment/38513319
favorite count: 0
has comment: http://stackoverflow.com/comment/38512551
has comment: http://stackoverflow.com/comment/38512821
has answer: http://stackoverflow.com/a/24811069
has comment: http://stackoverflow.com/comment/38512473
tagged with: http://stackoverflow.com/tag/html
has body: In the following form, when a country option is selected, it appends ?country=<value> to the URL. I am attempting to create an 'All' option which should append nothing. I have used value='' on the 'All' option, however it still appends ?country= onto the URL when selected. Is it possible to remove '?country=', so that nothing at all is added onto the URL when 'All' is selected? Country All Austria Denmark Poland <input type="hidden" name="date" value="<?php echo $the_date ?>" /> N. B. I also have a hidden date option, so the complete URL may also have an &date=<value> too.
has comment: http://stackoverflow.com/comment/38512647
has comment: http://stackoverflow.com/comment/38512693
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38514477
has comment: http://stackoverflow.com/comment/38512744
tagged with: php
has comment: http://stackoverflow.com/comment/38512633
has title: select form using GET method - is it possible to have an option which appends nothing at all to the URL?
has answer: http://stackoverflow.com/a/24821066
has comment: http://stackoverflow.com/comment/38513206
has comment: http://stackoverflow.com/comment/38512670
score: 1
linked to: http://stackoverflow.com/q/15734265

http://stackoverflow.com/q/24778365
type: UnansweredQuestion
tagged with: fullpage.js
score: 2
has title: fullpage.js - Jump to specific section from external link
upvote count: 2
has answer: http://stackoverflow.com/a/24778884
type: Question
tagged with: javascript
has body: Is there any way to jump directly to a specific section from an external link? At present I have a link with the anchor but fullpage.js loads the page and then scrolls to the anchor. I would like to jump "directly" to the specified anchor.
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/38683975
type: QuestionComment
comment on: http://stackoverflow.com/q/24899780
has text: What do you mean by 'stay in order'? If foo had a, c and e and bar had b, d, and f...what order do you expect the resulting data points to be in?
score: 0
type: Comment

http://stackoverflow.com/comment/38592009
comment on: http://stackoverflow.com/a/24852585
type: AnswerComment
score: 0
type: Comment
has text: Can you explain what's going on in your JS after and including "delay(function() {.......});"? The var url and encodeURI along with the "search/" is confusing me :)

http://stackoverflow.com/q/24809752
has answer: http://stackoverflow.com/a/36738552
type: AnsweredQuestion
has body: I have a reveal.js presentation with approximately 300 slides. The purpose of this presentation is to cycle slides in "kiosk mode" on a monitor behind a conference booth. To create a "kiosk mode" I've got: Reveal.initialize({ controls: false, // hide the control arrows progress: false, // hide the progress bar history: false, // don't add each slide to browser history loop: true, // loop back to the beginning after last slide transition: fade, // fade between slides autoSlide: 5000, // advance automatically after 5000 ms }); This works very well, but I'd like to randomize the slides. The slides are currently just a list of 300 &lt;section&gt; tags in the index document - they aren't being pulled from anywhere external. Currently random: true isn't a configuration option in reveal.js. The display order of fragments can be controlled with data-fragment-index. Is it possible to do something like that with sections? Is there a way to trick reveal.js into randomizing my slides? My preference would be to shuffle them each time around - that is, to show slides 1-300 in random order, and then shuffle them, and show 1-300 again in a different random order. I would also be happy with just jumping to a random slide for each transition, though.
downvote count: 0
score: 49
has title: Randomize slides in reveal.js
favorite count: 0
type: Question
linked to: http://stackoverflow.com/q/1533910
answer count: 2
has comment: http://stackoverflow.com/comment/43504375
tagged with: reveal.js
accepted answer: http://stackoverflow.com/a/36738552
upvote count: 49
has answer: http://stackoverflow.com/a/24810207
has comment: http://stackoverflow.com/comment/56292395
possible better answer: http://stackoverflow.com/a/24810207
has comment: http://stackoverflow.com/comment/43764821
tagged with: javascript
has comment: http://stackoverflow.com/comment/56347690

http://stackoverflow.com/comment/38588084
score: 0
has text: @hex494D49 i just need f7 and f8 but when i used accesskey it needs alt with it.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24850351

flot
tags question: http://stackoverflow.com/q/24901469
tags question: http://stackoverflow.com/q/24764540
type: Tag
tags question: http://stackoverflow.com/q/24866131
tags question: http://stackoverflow.com/q/24794217
tags question: http://stackoverflow.com/q/24879551
tags question: http://stackoverflow.com/q/24761966
tags question: http://stackoverflow.com/q/24790345
tags question: http://stackoverflow.com/q/24813528
tag name: flot
tags question: http://stackoverflow.com/q/24769210
tags question: http://stackoverflow.com/q/24805537

http://stackoverflow.com/comment/38656884
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24886712
has text: Your solution works perfectly ! Thank I will spent more time the to reread the " and ' the next time thanks !!!

http://stackoverflow.com/q/24832481
favorite count: 0
accepted answer: http://stackoverflow.com/a/24833147
tagged with: http://stackoverflow.com/tag/html
tagged with: fancybox
possible better answer: http://stackoverflow.com/a/24832577
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24832577
upvote count: 1
tagged with: fancybox-2
type: Question
has answer: http://stackoverflow.com/a/24833147
has title: Fancybox not opening
answer count: 2
has body: for some reason my fancy box does not show up when clicking on the hyperlink (the page just moves up a few pixels), see http://goo.gl/n6df2y (haven't been able to reproduce that in jsfiddle). Any idea what the issue is? Many thanks, HTML Restez informés! Inscrivez-vous à la newsletter Inscription à la Newsletter Inscrivez-vous à la newsletter pour être tenu au courant des nouveautés du site et de l'agenda des conférences OK X FERMER Pas de spam ici :-) Maximum 1 e-mail envoyé par mois! JS //============== //! Fancybox and cookie //============== function openFancybox() { setTimeout(function () { $(".fancybox").trigger("click"); }, 7000); }; $(document).ready(function () { var visited = $.cookie('visited'); if (visited == 'yes') { return false; } else { openFancybox(); } $.cookie('visited', 'yes', { expires: 0.04 }); $(".fancybox").fancybox({ closeClick: false, showCloseButton: true, helpers: { overlay: { css: { 'background': 'rgba(58, 42, 45, 0.3)' } } }, afterShow: function () { // enables a way to close fancybox $(".non-merci").on("click", function () { $.fancybox.close() }); } }); // fancybox }); // ready //============== //! //============== $(document).ready(function() { $('#subscribe').submit(function() { if (!valid_email_address($("#newsletteremail").val())) { $(".message").html("Email non valide"); } else { $(".message").html("En cours d'ajout..."); $.ajax({ url: 'subscribe.php', data: $('#subscribe').serialize(), type: 'POST', success: function(msg) { if(msg=="success") { $("#newsletteremail").val(""); $(".message").html('E-mail ajouté avec succès. Merci!'); setTimeout("$.fancybox.close()", 2000); } else { $(".message").html('E-mail non valide'); } } }); } return false; }); }); function valid_email_address(email) { var pattern = new RegExp(/^[+a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/i); return pattern.test(email); }
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery

http://stackoverflow.com/comment/38530685
score: 0
comment on: http://stackoverflow.com/a/24757008
type: AnswerComment
has text: @user1960948 I think you would need to go into more detail as to what you actually want to do. Maybe that isn't in the scope of this question and should possibly be a separate question.
type: Comment

http://stackoverflow.com/a/24907445
has comment: http://stackoverflow.com/comment/38706120
upvote count: 2
has comment: http://stackoverflow.com/comment/38706036
has comment: http://stackoverflow.com/comment/38706338
score: 2
answers question: http://stackoverflow.com/q/24906644
has comment: http://stackoverflow.com/comment/38705774
has body: As you're asynchronously set $scope.userFiles in your controller so you need to wait for the $apply from $http that resolved your promise. Assuming you're using Jasmine you could use the asynchronous spec notation and register a $watch function to test your controller (Didn't test the code so you might need to tune it and it also depends on other modifications of the scope variable). it('is now a lot easier', function(done) { scope.$watch('userFiles', function() { expect(scope.userFiles).toBe('resolveData'); // Call done function to tell Jasmine that the spec has completed done(); }); scope.getUserFiles(); }); However, I think you should rather test your service and you can use $httpBackend from ngMock which is overriding $http and enables you to test much more in-depth. There you can test / spy the calls to the mock backend and also use Jasmines done() function to wait for the promise. Here is a simple exmaple: angular.module('mainApp', []) // Simple factory that uses $http for later use of $httpBackend mocking structure .factory('userManager', function($http, $q) { return $http.get('/api/users'); }); And the specs: describe('Simple factory that uses $http for later use of $httpBackend mocking structure', function() { // We need to use the module mainApp for all our tests beforeEach(module('mainApp')); // We use $httpBackend from ngMock module to mock our webservice call ($http will be overriden) // Also we need to inject inside of spec function as we need to use the async spec form with // a done function and this is not available using the inject to proxy the spec function it('should return desired user list', function(done) { inject(function($httpBackend, userManager) { $httpBackend.when('GET', '/api/users').respond({ userList: [ {user: 'User A'}, {user: 'User B'}, {user: 'User C'}, {user: 'User D'}, ] }); $httpBackend.expectGET('/api/users'); // userManager is returning a promise so we need to check asynchronously userManager.getUserList().then(function(result)…
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/38705814

http://stackoverflow.com/q/24878131
tagged with: parsing
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38641481
has comment: http://stackoverflow.com/comment/38641069
upvote count: 3
has title: Capture emoji in javascript
tagged with: emoji
possible better answer: http://stackoverflow.com/a/41164409
type: Question
has comment: http://stackoverflow.com/comment/38640950
accepted answer: http://stackoverflow.com/a/24879620
score: 3
has answer: http://stackoverflow.com/a/41164409
has body: I have to write a module in javascript that can detect emoji and replace each of them with a div tag with the link to an image. (Emojis are strings of the form :) :-) etc ) The problem is I have several hundreds of them and trying to write a regular expression to capture all of them is not a good idea. Is there a way to do this given I have a hashmap with the keys are the emoji strings and the values are the hex values. (all emojis are within a range) Thanks! EDITED: So maybe the way I stated the problem was not clear. Imagine you have a dictionary of 100000 words, each of 4-5 characters. And a stream of lines, each line contains 100 - 150 characters. How would you find the words in the lines?
tagged with: javascript
answer count: 2
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/24879620

http://stackoverflow.com/comment/38686444
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24898160
has text: try removing the success/error callbacks in the parse cloud run instances and see if that changes it. oh, the Parse.Promise.when call should be outside the loop.
score: 0

http://stackoverflow.com/a/24815248
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has body: If all your spans have the same id="like" than only one will work, the rest will be ignored...ids must be unique.. maybe try... HTML.. JS $('.like').on('click',function(){ var id = (window.location.hash); id = id.replace("#", ""); alert(id); }); Alternatively... HTML... JS... $('.like').on('click',function(e){ e.preventDefault(); var id = $(this).attr('id'); alert(id); }); NOTE: again the id's all need to be unique... if this is not possible...change the above to .... and the js will change to.. var id = $(this).attr('data-id');
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/24814987
answers question: http://stackoverflow.com/q/24814987

http://stackoverflow.com/a/24859534
score: 1
accepted answer of: http://stackoverflow.com/q/24859460
answers question: http://stackoverflow.com/q/24859460
has comment: http://stackoverflow.com/comment/38605724
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/38606780
downvote count: 0
has body: If I understood your problem correctly, This should work for you var a = {"Answers": [ {"answerUId":1, "correct":true, "checked":true, "text":"`public`"}, {"answerUId":2, "correct":false, "checked":true, "text":"`static`"}, {"answerUId":3, "correct":false, "checked":false, "text":"`static`"} ] } var checkedAnswers = a.Answers.map(function (answer) { return answer.checked; }) console.log(checkedAnswers); CheckedAnswers will be an array like bellow [ true, true, false ]

http://stackoverflow.com/q/24795045
type: AnsweredQuestion
score: 1
type: Question
has title: Javascript - How to implement a queue without shift()?
has comment: http://stackoverflow.com/comment/38483816
tagged with: javascript
has answer: http://stackoverflow.com/a/24795098
has comment: http://stackoverflow.com/comment/38483896
has body: I am new to JavaScript and have an queue that is implemented using the push() and shift() methods. But the performance decreases once the length of my queue becomes sufficiently large. Is there an alternative to implementing a queue in JavaScript that does not utilise the shift() method to deque ?
has comment: http://stackoverflow.com/comment/38483800
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/38484762
favorite count: 0
has comment: http://stackoverflow.com/comment/38484303
accepted answer: http://stackoverflow.com/a/24795098
upvote count: 1
has comment: http://stackoverflow.com/comment/38483798

http://stackoverflow.com/q/24760249
has answer: http://stackoverflow.com/a/24760717
accepted answer: http://stackoverflow.com/a/24760717
type: AnsweredQuestion
tagged with: forms
type: Question
tagged with: arrays
tagged with: javascript
has title: Passing form fields (...name="array1[]") to Javascript function and change value of other form fields (...name="array2[]")
has body: I have the following document (listed below) that times "Amount 1" by 2 (am1 * 2), and change the value in "Amount 2" to the result (executed by JavaScript). Then the same form has the capability to add fields (Amount 1 & Amount 2) to the form. I would like to have the same functionality (times "Amount 1" by 2 and change the value of "Amount 2") in the other "ADDED" fields. Amount 1 Amount 2 Add Combination Amount 1 Amount 2
score: 0
answer count: 1

http://stackoverflow.com/q/24849220
score: 4
has answer: http://stackoverflow.com/a/38015339
upvote count: 4
has title: AJAX loaded content with lightbox2
answer count: 2
accepted answer: http://stackoverflow.com/a/24849250
downvote count: 0
favorite count: 0
tagged with: ajax
has body: I'm using the Lightbox2 script and the content of my page is loaded via an AJAX request. I don't find any function to attach new images or initialize Lightbox2 after an AJAX request, How can I make that in order to use Lightbox2 for images loaded via AJAX ? Léo
tagged with: lightbox2
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/24849250
possible better answer: http://stackoverflow.com/a/38015339
tagged with: javascript

http://stackoverflow.com/q/24902069
type: Question
answer count: 1
tagged with: javascript
score: 0
has body: I have DOM elements in the following structure: Loading… +− When I click the image itself (the one for the currently displayed slide) the zoom in/out works. However, when I click the + button span on the image I see an error in the Javascript console that says TypeError: $img.data(...) is null function setActive(img) { if ($img && img != $img[0]) { self.state = "enabled-out"; var zoomImg = $img.data("urZoomImg"); zoomImg.transform(0, 0, 1); zoomImg.transitionEnd(); } $img = $(img); } // zoom in/out button, zooms in to the center of the image $(self.button).on(touchscreen ? "touchstart.ur.zoom" : "click.ur.zoom", function() { if (self.img.length > 1) setActive($(self.img).filter($container.find("[data-ur-state='active'] *"))[0]); else setActive(self.img[0]); $img.data("urZoomImg").zoom(); // <---- This is the line throwing the error }); I have indicated where that null TypeError is thrown in the code above. I traced it and found setActive is being sent an undefined img parameter. I suspect I have not gotten the Uranium Zoom interaction's data attributes correct, but why is the + button throwing this error? Correct behavior is like in the examples here: http://uranium.io/interactions/zoom.html
tagged with: moovweb
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24919374
has title: With Uranium.io's zoom interaction, what is required for the zoom in/out buttons to find the image to zoom in/out from?
has comment: http://stackoverflow.com/comment/38713142

http://stackoverflow.com/q/24822906
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/38535648
has answer: http://stackoverflow.com/a/24857153
accepted answer: http://stackoverflow.com/a/24857153
downvote count: 0
has body: I have cgi for upload files, when I use the &lt;form&gt; to upload files, it works great, but it doesn't work if I use ajax to send data...... The form is like this: &lt;form id="confUpdate" enctype="multipart/form-data" method="post" action="upload.cgi"&gt; &lt;input id='upLoad' type='file' name="file"&gt; &lt;input id='btnUpload' type="submit" name="send" value="Upload"&gt; &lt;/form&gt; It can work if I just let the button type='submit'. When I change the type of button 'submit' to 'button', and try javascript: window.onload=function(){ var upfile=document.getElementById("upLoad"); var upform=document.getElementById("confUpdate"); var btnUpload=document.getElementById("btnUpload"); var info=document.getElementById("InfoText"); var xhr; btnUpload.onclick=function(){ var file=upfile.files; var formData=new FormData(); if(file[0].name.split(".")[1]!="bin"){ info.innerHTML="The file should be .bin file."; }else{ info.innerHTML=""; formData.append("file",file[0],file[0].name); } if (window.XMLHttpRequest) { xhr=new XMLHttpRequest(); }else{ xhr=new ActiveXObject("Microsoft.XMLHTTP"); } try{ xhr.open('POST', 'upload.cgi', true); xhr.setRequestHeader("content-type","multipart/form-data"); xhr.onreadystatechange = onReceive; xhr.send(formData); }catch(e){ xhr.abort(); } } function onReceive(){ var xml; var elem; if(xhr.readyState==4){ if(xhr.status==200){ xml=xhr.responseText; info.innerHTML="Uploaded:"+xml; }else{ info.innerHTML="Something is error."; } } } } After I clicking the button, the debug text is show 'Uploaded:', means it's send the file data, but the xml( content of the respond by server side) is empty. I'm not sure it's my server side error or my javascript side error? I guess the file should be name='file'. Any advice will be appreciated!
has comment: http://stackoverflow.com/comment/38600046
has comment: http://stackoverflow.com/comment/38536219
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38536203
score: 1
type: Question
has comment: http://stackoverflow.com/comment/38540484
upvote count: 1
answer count: 1
tagged with: upload
has title: Cannot upload file using ajax
tagged with: javascript

http://stackoverflow.com/q/24756686
tagged with: window-resize
has body: I'm using this plugin for slideshow: http://jquerytools.org/demos/tabs/slideshow.html I want to change slideshow effect on window resize. My code: http://jsfiddle.net/genesiss/5L2CN/5/ var initSlideshow = function() { var effect = 'fade'; if ($(window).width() &lt; 300) { effect = 'default'; } $(".slidetabs").tabs(".images &gt; div", { effect: effect, fadeOutSpeed: "slow", rotate: true }).slideshow({interval: 100}); }; $(function() { initSlideshow(); $(".slidetabs").data('slideshow').play(); $(window).resize(function () { $(".slidetabs").data('slideshow').stop(); $(".slidetabs").tabs('destroy'); initSlideshow(); $(".slidetabs").data('slideshow').play(); }); }); It seems that slideshow effect is always the same - one that is set at first initialization. You can see that by resizing 'Result' window in jsfiddle and noticing that it still has 'fade' efect (two slides on the screen at the same time, one fading away). How could I change slideshow effect after first initialization?
answer count: 0
has comment: http://stackoverflow.com/comment/38410971
type: Question
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/38411661
tagged with: jquery-tools
type: UnansweredQuestion
has title: Jquery tools slideshow - changing effect on window resize
has comment: http://stackoverflow.com/comment/38410941

http://stackoverflow.com/q/24864844
has comment: http://stackoverflow.com/comment/38615618
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38615487
accepted answer: http://stackoverflow.com/a/24865079
has comment: http://stackoverflow.com/comment/38615456
type: Question
has body: I am trying to add at least two possible correct answers and don't seem to be able to. Below is the code for the JavaScript and I can post the html if needed. Is what I am trying to do possible? If so, how should I proceed? var questions = []; questions.push({ q: "Rate your custard making skills from 1-5.", a: "1", b: "2", c: "3", answer: "b" }); questions.push({ q: "what is question two?", a: "answer one.", b: "answer two.", c: "answer three.", answer: "b" }); var i = 0; var answers = []; window.onload = function() { var n = document.getElementById('next'); n.onclick = next; loadNext(); }; function next() { var aa = document.getElementById('aa'); var ab = document.getElementById('ab'); var ac = document.getElementById('ac'); var ans = null; if (i == 0) loadNext(); else { if (aa.checked) ans = "a"; if (ab.checked) ans = "b"; if (ac.checked) ans = "c"; if (ans) { answers.push(ans); loadNext(); } else alert("Please Select an answer."); } }; function loadNext() { var qq = document.getElementById('qq'); var qa = document.getElementById('qa'); var qb = document.getElementById('qb'); var qc = document.getElementById('qc'); if (i &gt;= questions.length) endQuiz(); else { qq.innerHTML = questions[i].q; qa.innerHTML = questions[i].a; qb.innerHTML = questions[i].b; qc.innerHTML = questions[i].c; i++; document.getElementById('aa').checked = false; document.getElementById('ab').checked = false; document.getElementById('ac').checked = false; } }; function endQuiz() { var score = 0; for (var j = 1; j &lt; questions.length; j++) if (answers[j] == questions[j].answer) score++; score *= 2; alert("You Scored: " + score); };
has comment: http://stackoverflow.com/comment/38615426
has title: Troubles with Javascript quiz
has comment: http://stackoverflow.com/comment/38615678
has comment: http://stackoverflow.com/comment/38615804
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/24865079
tagged with: javascript
has comment: http://stackoverflow.com/comment/38615297

http://stackoverflow.com/comment/38643373
type: QuestionComment
comment on: http://stackoverflow.com/q/24879446
score: 0
has text: Could you supply your form html code?
type: Comment

http://stackoverflow.com/comment/38601407
type: QuestionComment
comment on: http://stackoverflow.com/q/24857251
score: 0
has text: @vol7ron No. Front Controller is responsible for instantiating MVC-triad based on `route-match`
type: Comment

http://stackoverflow.com/comment/38680693
has text: @ChrisTavares I can use either.
score: 0
comment on: http://stackoverflow.com/q/24899230
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24871598
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/38628707
has comment: http://stackoverflow.com/comment/38643130
has comment: http://stackoverflow.com/comment/38633146
has comment: http://stackoverflow.com/comment/38632764
has comment: http://stackoverflow.com/comment/38635686
has comment: http://stackoverflow.com/comment/38630174
tagged with: http://stackoverflow.com/tag/html
tagged with: python
has comment: http://stackoverflow.com/comment/38629588
has comment: http://stackoverflow.com/comment/38628763
has comment: http://stackoverflow.com/comment/38646206
has body: I have: I created index.html - the simplest html page &amp; launch my simple http server with python -m SimpleHttpServer 8000. I want: make index.html use javascript which depends on JQuery. Problem: Seems SimpleHttpServer doesn't load JS files. I mean if I write &lt;script src="myScript.js"/&gt; inside index.html - myScript.js won't be loaded by browser. Question: Why browser doesn't download JS files? P.S. I use OSX Mavericks 10.9.4
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/42041564
type: Question
has comment: http://stackoverflow.com/comment/38628519
tagged with: simplehttpserver
tagged with: javascript
has comment: http://stackoverflow.com/comment/38628744
has comment: http://stackoverflow.com/comment/38633813
score: 0
has title: Python SimpleHttpServer howto
has comment: http://stackoverflow.com/comment/38646828

http://stackoverflow.com/q/24886989
has comment: http://stackoverflow.com/comment/38657505
has comment: http://stackoverflow.com/comment/38657856
has body: Having got a comprehensive answer to this question, I found that the variables concerned actually represent object properties. How does this affect things? Can I no longer replace this if (eval(firstvalue) &gt;= eval(secondvalue)) { with this var a = parseInt(firstvalue, 10), b = parseInt(secondvalue, 10); if (a &gt;= b) { // abridged version of the answer linked above.
has comment: http://stackoverflow.com/comment/38657909
has comment: http://stackoverflow.com/comment/38657152
linked to: http://stackoverflow.com/q/24876942
has title: Replacing eval() for object properties in a comparison
answer count: 0
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/38657903
score: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38657067

http://stackoverflow.com/a/24810751
upvote count: 0
downvote count: 2
has comment: http://stackoverflow.com/comment/38513736
score: -2
has comment: http://stackoverflow.com/comment/38513322
has comment: http://stackoverflow.com/comment/38513547
answers question: http://stackoverflow.com/q/24810448
has comment: http://stackoverflow.com/comment/38512952
type: Answer
has body: You can create a custom Handlebar helper function to check for conditional operators. Ember.Handlebars.registerHelper('ifCond', function (temp_v1, operator, temp_v2, options) { var v1,v2; v1 = Ember.Handlebars.get(this, temp_v1, options); v2 = Ember.Handlebars.get(this, temp_v2, options); switch (operator) { case '||': return (v1 || v2) ? options.fn(this) : options.inverse(this); case '&&': return (v1 && v2) ? options.fn(this) : options.inverse(this); case '==': return (v1 == v2) ? options.fn(this) : options.inverse(this); default: return options.inverse(this); } }); You can call it in your templates as Conditional helpers works {{/ifCond}}

http://stackoverflow.com/comment/38771261
type: QuestionComment
comment on: http://stackoverflow.com/q/24899444
score: 0
has text: Good to know. It seems very strange that it doesn't work on just mobile Chrome of all browsers, so I figured there must be some way around it.
type: Comment

http://stackoverflow.com/comment/76045905
type: Comment
score: 2
has text: Are there any documentations about the rules for customizing a context file?
comment on: http://stackoverflow.com/a/43663401
type: AnswerComment

http://stackoverflow.com/q/24904291
tagged with: angularjs
tagged with: android
possible better answer: http://stackoverflow.com/a/24904374
has answer: http://stackoverflow.com/a/24904372
has answer: http://stackoverflow.com/a/24904374
type: AnsweredQuestion
score: 1
upvote count: 1
tagged with: unit-testing
type: Question
has title: Custom Angular window dependency
accepted answer: http://stackoverflow.com/a/24904372
tagged with: javascript
has body: I am developing an Angular application which resides inside an Android WebView. In order to interact with my Android app, I have exposed an object at window scope: window.MyAndroidApp Which has methods such as: window.MyAndroidApp.doStuff(); window.MyAndroidApp.doOtherStuff(); I'm confused as to how I can interact with this object via an Angular controller without referencing it directly, so that I may mock it via unit tests? // How do I define androidFunctions as window.MyAndroidApp so that // I may mock it for unit testing? app.controller("MyCtrl", ["$scope", "androidFunctions", function($scope, androidFunctions) { androidFunctions.doStuff(); androidFunctions.doOtherStuff(); }]);
answer count: 2
downvote count: 0
favorite count: 0

http://stackoverflow.com/a/24932612
has comment: http://stackoverflow.com/comment/38744341
downvote count: 1
has comment: http://stackoverflow.com/comment/38743856
score: 3
has body: I had a similar problem with kendo TreeView, when I wanted to load a tree with 30,000 nodes. The browser would freeze for a long time to load this number of nodes even when loadOnDemand was set to true. So we decided to implement the server-side functionality for expanding nodes, and that's what you should do. You need to have 2 changes in your existing code. Change your tree use server side Expand method. When you call expand, you should make sure the node is expanded. These two steps will be explained below. The thing you should know is, this way your browser doesn't hang at all, but it may take some time to complete the operation, because there will be so many webservice calls to the server. Change your tree to use server side Expand method: Please see Kendo UI's demos for Binding to Remote Data in this link. Note that loadOnDemand should be set to true. In addition the server side Expand web service should be implemented too. When you call expand, you should make sure the node is expanded: In order to do this, there should be an event like Expanded defined in Kendo UI TreeView, but unfortunately there is none, except Expanding event. Using setTimeout in this case is not reliable, because the network is not reliable. So we ended up using a while statement to check that the node's children are created or not. There might be a better solution for this, however this satisfies our current requirement. Here's the change you should make when expanding nodes: if (collapsedItems.length &gt; 0) { currentLevel++; var $tree = $("#treeView"); var treeView = $tree.data("kendoTreeView"); var collapsedItemsLength = collapsedItems.length; for (var i = 0; i &lt; collapsedItemsLength; i++) { var node = $(collapsedItems[i]).closest(".k-item") if (!node.hasChildren) continue; // do not expand if the node does not have children treeView.expand(node); // wait until the node is expanded while (!node.Children || node.Children.length == 0); } ExapandByLevel(level, currentLevel); } You ca…
upvote count: 4
has comment: http://stackoverflow.com/comment/38743501
has comment: http://stackoverflow.com/comment/38767651
type: Answer
has comment: http://stackoverflow.com/comment/38744544
has comment: http://stackoverflow.com/comment/38769744
has comment: http://stackoverflow.com/comment/38746426
answers question: http://stackoverflow.com/q/24752279

html-tag-details
type: Tag
tags question: http://stackoverflow.com/q/24785460
tags question: http://stackoverflow.com/q/24786511
tag name: html-tag-details

http://stackoverflow.com/a/24859062
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24858687
upvote count: 2
answers question: http://stackoverflow.com/q/24858687
type: Answer
has comment: http://stackoverflow.com/comment/38604834
downvote count: 1
score: 1
has body: Add a parameter remote: true to your form tag. I'm on a cell phone now, can't explain better. Google 'Rails form remote true', you'll find a tutorial to follow.

http://stackoverflow.com/a/24890408
score: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24867323
has body: Based on Ravi Hamsa's reply I implemented an object that is injected into each route that keeps the requests and whether or not the route is still relevant. It looks like this: var RouteContext = function RouteContext() { this._xhrs = {}; this.stopped = false; this.manageRequest = function(xhr) { this.xhrs.push(xhr); } this.stop = function() { this.stopped = true; _.invoke(this.xhrs, 'abort'); } } I override the Backbone.Router route method like this: route: function(route, name, callbackFactory) { var callback; if (_.isFunction(callbackFactory)) { var context = new RouteContext(); callback = callbackFactory(context); // When a new route is opened, this route should be stopped and all // corresponding jqXHR's should be aborted. App.mediator.on('tabClicked', function() { context.stop(); }); } else { callback = callbackFactory; } return Backbone.Router.prototype.route.call(this, route, name, callback); } I can now create a new route method with this context like this: var routeFactory = function(routeContext) { // Might do some route initialisation here. return function() { this.reset(routeContext); // This function is the actual function that will be called when a route is triggered. if (routeContext.stopped === false) { myView.renderChart(); } } }; // Register the route on the router. myRouter.route('route', 'name', routeFactory); Because a route can be called multiple times I reset the RouteContext back to it's original state when the route is called again. And in my route I keep checking everywhere I need to do rendering whether the routeContext.stopped is still false. If it is true I don't do the rendering.
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24867323

http://stackoverflow.com/comment/43764821
comment on: http://stackoverflow.com/q/24809752
has text: Opened an issue on GH - this would actually be a useful feature to have :) https://github.com/hakimel/reveal.js/issues/1089
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/38625284
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24869851
has text: the problem is that on the `mouseleave` event of the anchor, the background changes to "whitesmoke", so whatever you do it still be "whitesmoke" when you move the mouse away from the anchor!
score: 0

http://stackoverflow.com/comment/38628664
has text: same problem as your other answer, will not work on 2010
type: Comment
score: 1
comment on: http://stackoverflow.com/a/24863740
type: AnswerComment

http://stackoverflow.com/comment/38613454
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24863232
has text: Excellent, Thanks everyone for your input. Appreciate it.
score: 0

http://stackoverflow.com/a/24873262
has comment: http://stackoverflow.com/comment/38631949
has comment: http://stackoverflow.com/comment/38631918
has comment: http://stackoverflow.com/comment/38632138
answers question: http://stackoverflow.com/q/24872947
has comment: http://stackoverflow.com/comment/38632584
upvote count: 1
has comment: http://stackoverflow.com/comment/38632059
has comment: http://stackoverflow.com/comment/38632639
has comment: http://stackoverflow.com/comment/38632216
has body: Another easy way to do this is to .split() the string based on whatever delimiter you plan on using, .filter() for non-empty elements, and then .join() with the same delimiter: JavaScript var str = "Hi I have |str| way |str||str| too |str||str||str| many breaks"; var x = str.split("|str|").filter(function (d){ return d.length; }).join("|str|"); console.log(x) // returns "Hi I have |str| way |str| too |str| many breaks |str|"; This allows you to avoid making a specific regular expression for each case—no escaping characters—and instead run variables through .split() and .join(). Not sure whether or not this solution is faster. It seems to be faster in non-Chromium browsers. I would surmise that Chrome is efficiently, because of the v8 engine, compiling a regex before running it a million times, making the regex solution faster. fiddle
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/38632386
has comment: http://stackoverflow.com/comment/38632789
score: 1
has comment: http://stackoverflow.com/comment/38632086

http://stackoverflow.com/comment/38647760
comment on: http://stackoverflow.com/q/24881661
type: QuestionComment
has text: whenever your expression will get value other than undefined, it will be evaluated. So instead of false set expression to undefined. So next time, it will be evaluated when a resolve set some data in it.
type: Comment
score: 0

http://stackoverflow.com/a/24800276
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38493939
has body: This is because the default size of canvas width and height is 300 and 150. If you want to draw rectangle more then this size then you have to increase the size of canvas as here &lt;body&gt; &lt;canvas id="myCanvas" width="500" height="550" style="border:1px solid #c3c3c3;"&gt; &lt;script&gt; var canvas = document.getElementById("myCanvas"); var context = canvas.getContext('2d'); context.beginPath(); context.rect(5, 5, 380, 240); context.fillStyle = 'yellow'; context.fill(); context.lineWidth = 7; context.strokeStyle = 'black'; context.stroke(); &lt;/script&gt; &lt;/body&gt; The working fiddle is here fiddle You can also see the below link for reference link
downvote count: 0
answers question: http://stackoverflow.com/q/24799879

http://stackoverflow.com/q/24790271
tagged with: javascript
tagged with: sorting
tagged with: accessibility
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/24807328
type: UnansweredQuestion
has body: I'm trying to use the Google Charts API on a website that must be 100% Section 508 compliant, i.e., accessible to those with disabilities. Google Charts tables have a 'sort' function but in its default state column headers cannot be selected by the keyboard for sorting. I can use some Javascript to inject "tabindex=0" attributes into the column header elements easily enough, and as expected, that makes the column headers focusable...but surprisingly, clicking on the enter key does nothing. Same thing happens if I make the sort arrows inside the column headers focusable - I can focus on it using TAB, but I still can't select it. Does anyone have a solution for this? If there is no straightforward way to create a table that's sortable using only the keyboard, is there a workaround to transform a focus/keypress into an onclick?
has title: Google Charts table sorting via keyboard
type: Question
tagged with: google-visualization

http://stackoverflow.com/q/24900875
tagged with: syntax
has answer: http://stackoverflow.com/a/47071989
has answer: http://stackoverflow.com/a/57966398
has answer: http://stackoverflow.com/a/24900951
has answer: http://stackoverflow.com/a/24900918
has answer: http://stackoverflow.com/a/24900924
accepted answer: http://stackoverflow.com/a/24900924
has answer: http://stackoverflow.com/a/33070926
has answer: http://stackoverflow.com/a/52072811
type: Question
tagged with: ecmascript-6
tagged with: javascript
score: 519
has answer: http://stackoverflow.com/a/55134263
answer count: 14
tagged with: arrow-functions
has title: What's the meaning of "=>" (a fat arrow formed from equal and greater-than signs) in JavaScript?
has answer: http://stackoverflow.com/a/32866539
possible better answer: http://stackoverflow.com/a/24900951
has body: I know that the &gt;= operator means more than or equal to, but I've seen =&gt; in some source code. What's the meaning of that operator? Here's the code: promiseTargetFile(fpParams, aSkipPrompt, relatedURI).then(aDialogAccepted =&gt; { if (!aDialogAccepted) return; saveAsType = fpParams.saveAsType; file = fpParams.file; continueSave(); }).then(null, Components.utils.reportError);
has answer: http://stackoverflow.com/a/43629865
upvote count: 523
favorite count: 0
has answer: http://stackoverflow.com/a/68486864
linked to: http://stackoverflow.com/q/22939130
has answer: http://stackoverflow.com/a/24900930
has answer: http://stackoverflow.com/a/54612452
downvote count: 4
has answer: http://stackoverflow.com/a/24901235
type: AnsweredQuestion

http://stackoverflow.com/a/24814596
has comment: http://stackoverflow.com/comment/38520618
score: 1
has comment: http://stackoverflow.com/comment/38521239
has comment: http://stackoverflow.com/comment/38857470
downvote count: 0
has comment: http://stackoverflow.com/comment/38553199
has comment: http://stackoverflow.com/comment/39976613
answers question: http://stackoverflow.com/q/24802129
has comment: http://stackoverflow.com/comment/38529763
type: Answer
has body: In Polymer ≥0.4.0 you can use the /deep/ combinator: $('#main').on('click', '* /deep/ a[href]', function() { if (e.which == 2 || e.metaKey) return; // don't capture new tab clicks /* stuff */ }); Note: This technique should be used sparingly, as it's potentially mucking about in the implementation of all components, including some parts of the web platform like &lt;video&gt; tags.
upvote count: 1

http://stackoverflow.com/comment/38530355
score: 1
has text: Shouldn't it be `.val()` ?
comment on: http://stackoverflow.com/q/24820051
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24891302
has title: Double dot syntax in JavaScript - What is this expression doing and how is it valid syntax?
type: Question
has comment: http://stackoverflow.com/comment/38666088
tagged with: javascript
has answer: http://stackoverflow.com/a/24891397
has comment: http://stackoverflow.com/comment/38665790
linked to: http://stackoverflow.com/q/18555853
has comment: http://stackoverflow.com/comment/38665823
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/7491915
linked to: http://stackoverflow.com/q/24398347
linked to: http://stackoverflow.com/q/13149282
has body: 14.toString(); // Result -&gt; SyntaxError: Unexpected token ILLEGAL 14..toString(); // Result -&gt; "14" What is placing an extra dot after the number doing, and how is this valid syntax?
has comment: http://stackoverflow.com/comment/38666018
linked to: http://stackoverflow.com/q/4211037
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/13149282
has comment: http://stackoverflow.com/comment/38665764
has comment: http://stackoverflow.com/comment/38665933
has comment: http://stackoverflow.com/comment/38666908
has answer: http://stackoverflow.com/a/24891388

http://stackoverflow.com/comment/38617789
score: 0
type: Comment
type: QuestionComment
has text: What is your problem?
comment on: http://stackoverflow.com/q/24865980

http://stackoverflow.com/comment/38432633
has text: You would use this always when you need to inherit some properties but also must modify some properties of an object without modifying the original object.
type: AnswerComment
comment on: http://stackoverflow.com/a/24767427
score: 0
type: Comment

concurrency
tag name: concurrency
tags question: http://stackoverflow.com/q/24764704
type: Tag

http://stackoverflow.com/q/24862089
has body: I am building a shooter game using html5, canvas, javascript - pixijs. Below is the bullet code. It will skin a bullet - it is limited to only allow 20 bullets max on the screen to save resources. The bullets then get recycled in a reset function. Its working great on the whole. The problem now though - is I have 2 bullet types - standard and missile. Essentially when the bullet gets reset - I need to ensure its skinned properly. I've tried empting the crossection array and rebuilding it - but its almost as if it just clones the bullet and I end up with more objects. var TestProjectileVector = (function (_super) { __extends(TestProjectileVector, _super); function TestProjectileVector(parentScene, x, y, z, localScale, velocity, gravity, vector, projectiletype) { if (typeof x === "undefined") { x = 0; } if (typeof y === "undefined") { y = 0; } if (typeof z === "undefined") { z = 0; } if (typeof localScale === "undefined") { localScale = 1; } if (typeof velocity === "undefined") { velocity = 100; } if (typeof gravity === "undefined") { gravity = 0; } if (typeof vector === "undefined") { vector = MathK.Vector3.zero; } if (typeof projectiletype === "undefined") { projectiletype = "bullet"; } _super.call(this, parentScene, x, y, z, .13); this.verticalAngle = 0; this.horizontalAngle = 0; this.drag = .99; this.isDead = false; this.isRebounding = false; this.doCollisions = true; this.numberOfCrossSections = 6; this.crossSections = []; this.crossSectionSpacing = 7; this.parentScene = parentScene; console.log("BUILD A BULLET"); this.bulletTip = "img/bullet-tip.png"; this.bulletBase = "img/bullet-end.png"; if(projectiletype == "grenade"){ this.bulletTip = "img/bullet-grenade-tip.png"; this.bulletBase = "img/bullet-grenade-end.png"; } this.spr = PIXI.Sprite.fromImage(this.bulletTip); this.spr.anchor.x = this.spr.anchor.y = .5; this.gravity = gravity; this.velocity = velocity; this.alpha = 0; this.xVel = this.velocity * vector.x; this.zVel = this.velocity * vector.z; this.yVel = …
type: UnansweredQuestion
tagged with: pixi.js
type: Question
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/24888017
has comment: http://stackoverflow.com/comment/38626259
has title: pixijs retexturing a bullet
has comment: http://stackoverflow.com/comment/38619916
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24884172

http://stackoverflow.com/comment/38489316
type: Comment
has text: My doubt is that why this question is not up or DOWn voted.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24798021

http://stackoverflow.com/a/24867837
score: 0
has body: This will do the job &lt;script&gt; var days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']; function findDayDate(date, dayInput) { var d = new Date(Date.parse(date)); var day = days[ d.getDay() ]; while(true) { if (day.toLowerCase() === dayInput.toLowerCase()) { break; } else { d.setDate(d.getDate() + 1); day = days[ d.getDay() ]; } } return d; } document.write(findDayDate("2005-07-08", "sunday")); &lt;/script&gt;
type: Answer
answers question: http://stackoverflow.com/q/24866406

http://stackoverflow.com/comment/38539651
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24825049
score: 0
has text: Also tried that. Still gives the same result

http://stackoverflow.com/comment/38485095
has text: use `$('input').on('change')`
comment on: http://stackoverflow.com/q/24795769
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38479495
has text: I would contact Network Solutions, they will probably resolve this issue for you.
comment on: http://stackoverflow.com/q/24792636
score: 3
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/78389881
has text: You got any updates on this ?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24887244

jquery-templates
type: Tag
tags question: http://stackoverflow.com/q/24887651
tags question: http://stackoverflow.com/q/24880454
tag name: jquery-templates

http://stackoverflow.com/q/24760598
score: 0
has comment: http://stackoverflow.com/comment/38418423
has body: I have an input button, which when it is disabled, and someone tries to click it, needs to display an alert. How is it possible to display a javascript message despite being disabled? Tried this with no luck: &lt;input type="submit" onclick="alert('click')" value="Disabled Input Button" disabled/&gt;
accepted answer: http://stackoverflow.com/a/24760702
linked to: http://stackoverflow.com/q/7833854
has comment: http://stackoverflow.com/comment/38418683
possible better answer: http://stackoverflow.com/a/24760632
has title: If a disabled input button is clicked, display message
has answer: http://stackoverflow.com/a/24760632
type: AnsweredQuestion
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/24760702
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/38559580
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24826390
has text: @Oliver: For a start are your headers being sent as expected?
score: 0

http://stackoverflow.com/comment/38410727
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24753997
has text: Yes but jQuery is the better option for this requirement.

http://stackoverflow.com/comment/38673972
comment on: http://stackoverflow.com/q/24895685
has text: Use `getTimezoneOffset()` in JavaScript to get the user's timezone
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38628126
type: Comment
has text: This question appears to be off-topic because it is about whether browsers must be standards-compliant and is not about programming.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24871067

http://stackoverflow.com/comment/38688800
type: AnswerComment
has text: Gotcha. Corrected my answer.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/24901625

http://stackoverflow.com/a/24888250
has body: As it turns out, the code works just fine as long as the jQuery version is greater than 1.8 (which I knew but hadn't noticed that I was using the last version). I replaced jQuery with the latest version and everything is working as expected. However @Bergi is right about async:false being useless or even cause problems. In earlier versions of jQuery the promise/deferred model is "broken" and is not working as expected/should w.r.t. the original promise model ( https://www.promisejs.org/ ). See also: http://api.jquery.com/deferred.then/
accepted answer of: http://stackoverflow.com/q/24887211
upvote count: 2
has comment: http://stackoverflow.com/comment/38659663
answers question: http://stackoverflow.com/q/24887211
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/comment/38548946
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24829423
type: AnswerComment
has text: Thanks for your reply. I tried the window.open option but it did not work in IE and I was not sure how to specify a file name. So I am looking at FileSaver.js and when I included it in my js file, I am getting this message "Refused to execute script from 'https://github.com/eligrey/FileSaver.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. "

http://stackoverflow.com/q/24907524
tagged with: tooltip
tagged with: javascript
answer count: 1
tagged with: highcharts
downvote count: 0
tagged with: jquery
favorite count: 0
has body: I'm wondering how to change the tooltip value from one value to another. The following snippet of the main code shows my attempt, hopefully you can understand what I want from it: chart.tooltip[0].setPointFormat({ pointFormat: '{point.x} m, {point.y} m' Any help would be hugely appreciated :) Here is the main code: function toggleContent(){ document.getElementById("text").value=="Base unit" ? (document.getElementById("text").value="Base unit x1000" ): (document.getElementById("text").value="Base unit"); if(document.getElementById("text").value=="Base unit"){ func2();} else{ func1();} } var divide=1; function func1 () { var chart = $('#container').highcharts(); var data = chart.series[0].data; if (data.length) { for(var i=0;i&lt;data.length;i++) { var point = data[i]; point.update([point.x/=1000,point.y/=1000]); } divide*=1000; chart.yAxis[0].setTitle({ text: 'Surplus of Electrical Cable (km)' }); chart.xAxis[0].setTitle({ text: 'Electrical Cables (km)' }); chart.tooltip[0].setPointFormat({ //This is the snippet line pointFormat: '{point.x} m, {point.y} m' }); } }; var divide=1; function func2() { var chart = $('#container').highcharts(); var data = chart.series[0].data; if (data.length) { for(var i=0;i&lt;data.length;i++) { var point = data[i]; point.update([point.x*=1000,point.y*=1000]); } divide/=1000; chart.yAxis[0].setTitle({ text: 'Surplus of Electrical Cable (m)' }); chart.xAxis[0].setTitle({ text: 'Electric Cables (m)' }); } }; $(function () { $('#container').highcharts({ chart: { type: 'scatter', zoomType: 'xy' }, title: { text: 'Height Versus Weight of 507 Individuals by Gender' }, subtitle: { text: 'MainKey Quantities' }, xAxis: { title: { enabled: true, text: 'Electric Cables (km)' }, startOnTick: true, endOnTick: true, showLastLabel: true }, yAxis: { title: { enabled: true, text: 'Surplus of Electric Cable (km)' }, startOnTick: true, endOnTick: true, showLastLabel: true }, legend: { layout: 'vertical', align: 'left', verticalAlign: 'top', x: 100, y: 70, …
accepted answer: http://stackoverflow.com/a/24907944
has comment: http://stackoverflow.com/comment/38695993
has comment: http://stackoverflow.com/comment/38695969
type: AnsweredQuestion
score: 1
upvote count: 1
has title: Changing charts tooltip
type: Question
has answer: http://stackoverflow.com/a/24907944

http://stackoverflow.com/comment/38461558
has text: @Eirenaios Can't use css3, crazy crossbrowsering ;)
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24783304
type: QuestionComment

http://stackoverflow.com/q/24839627
tagged with: javascript
tagged with: jquery
score: 0
type: UnansweredQuestion
has title: how to find the length of nested json array in javascript jquery
has answer: http://stackoverflow.com/a/24839716
has body: see this is my json response from server { "status": { "statusCode": 200,"title": " needs", "classname": "NeedController" }, "needs": { "Needs": [{needTitle": "Need a book","needDescription": "story book","fromCustomer": "abc","needDate": "2014-05-15T12:57:13Z","needID": 23, "referrals":{"referrals":[{"referredBy":"xyz","referredOn":"2013-11-19T06:56:18Z","rererralId":3,"referralStatus":"declined","needId":3}]}} i want to calculate the length of this referral array. "referrals":{"referrals":[{"referredBy":"xyz","referredOn":"2013-11-19T06:56:18Z","rererralId":3,"referralStatus":"declined","needId":3}]} this is my javascript code function successCallback(responseObj){ alert(JSON.stringify(responseObj));//above response var dataj=(JSON.stringify(responseObj)); $.each(responseObj.needs.Needs,function(i){ alert(responseObj.needs.Needs.referrals.referrals.length);//this is not giving me length. }); }
has answer: http://stackoverflow.com/a/24839707
has comment: http://stackoverflow.com/comment/38567838
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38566975
type: Question
answer count: 2

http://stackoverflow.com/comment/38457254
type: Comment
score: 0
type: AnswerComment
has text: my array is javascript array not php
comment on: http://stackoverflow.com/a/24781355

http://stackoverflow.com/comment/38431576
comment on: http://stackoverflow.com/a/24767287
has text: @rudyherehello okay that is great. Now try using `mysqli_query` instead of `mysql_query` and see if it works. Also, use the `mysqli_error($con)` to see what error are you getting.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/24774741
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/24773307
has body: Sorry, I don't work with angularjs, but these two methods that post using jQuery or even base XMLHttpRequest work well for me: send Server code (nodejs): router.post('/test/:i', function(req, res) { var i = req.params.i; var t = new Date().toISOString(); setTimeout(function(){ res.send({i: i, t: t}); }, 1000); });
type: Answer
score: 2

http://stackoverflow.com/comment/38670195
score: 1
comment on: http://stackoverflow.com/a/24883691
type: AnswerComment
type: Comment
has text: I'm glad I could help :) The `$apply` can accept a function/expression that would be evaluated against the scope, then it will call the `$rootScope.$digest()` afterward. So, if there is no need to pass any code into `$apply()`, running `$scope.$digest()` would be a bit faster than `$scope.$apply()`, since the former will trigger only watchers on the current $scope and its children but the later will trigger watchers on the entire $scope chain ($rootScope). However, almost of the time, the different shouldn't be that much significant, but in some rare performance bottleneck, it should helps.

http://stackoverflow.com/comment/38691064
comment on: http://stackoverflow.com/a/24904384
type: Comment
has text: Thanks a lot. Sometimes it could be so easy :)
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38476187
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24790671
has text: Could you also add the code before adding the image to be able to compare a see your previous result?
type: Comment

http://stackoverflow.com/comment/38742865
type: Comment
has text: @ANILBABU Please refer to the EDIT in the answer above. I hope it helps! :)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24908192

http://stackoverflow.com/a/62137958
downvote count: 0
has body: First, go to the sharing settings for your document and choose "Anyone with a link." It will generate a link in the format https://drive.google.com/file/d/XXX/view?usp=sharing. Now you can use the following URL format: https://drive.google.com/uc?id=XXX Note that I'm seeing an HTTP redirect when I do this, so use curl -L on the command line or otherwise make sure that your HTTP client follows redirect.
type: Answer
score: 34
upvote count: 34
has comment: http://stackoverflow.com/comment/126103858
has comment: http://stackoverflow.com/comment/121091928
answers question: http://stackoverflow.com/q/24834877

http://stackoverflow.com/comment/38416911
comment on: http://stackoverflow.com/q/24759747
score: 0
type: Comment
type: QuestionComment
has text: Don't abuse the semantic label-element!

http://stackoverflow.com/q/24766042
tagged with: javascript
score: 0
has body: Im trying to add percentage to my chart and centralize the labels, but im getting an a problem. I get 0% in all lines and the left labels do not have the full color. How can I fix it? My chart image: https://i.sstatic.net/I58rZ.png My script: &lt;script type="text/javascript"&gt; google.load("visualization", "1", { packages: ["corechart"] }); var dataSet = [ ['year', 'Muito acima', 'Acima', 'Aprox. Igual', 'Abaixo', 'Muito abaixo', ], ['N', 0, 13, 67, 10, 10], ['NE', 0, 7, 40, 20, 33], ['S', 60, 33, 0, 7, 0], ['SE', 0, 13, 53, 33, 0] ]; var dataSet2 = dataSet; google.setOnLoadCallback(drawChart2); function drawChart2() { var sum = new Array(); for (row = 1; row &lt; dataSet.length; row++) { sum[row] = 0; for (col = 1; col &lt; dataSet[row].length; col++) { sum[row] += dataSet[row][col]; } for (col = 1; col &lt; dataSet[row].length; col++) { dataSet2[row][col] = 100 * dataSet[row][col] / sum[row]; } } var data = google.visualization.arrayToDataTable(dataSet2); var view = new google.visualization.DataView(data); var formatter = new google.visualization.NumberFormat({ pattern: '##,##%' }); formatter.format(data, 1); formatter.format(data, 2); formatter.format(data, 3); formatter.format(data, 4); formatter.format(data, 5); view.setColumns([0, 1, { calc: "stringify", sourceColumn: 1, type: "string", role: "annotation" }, 2, { calc: "stringify", sourceColumn: 2, type: "string", role: "annotation" }, 3, { calc: "stringify", sourceColumn: 3, type: "string", role: "annotation" }, 4, { calc: "stringify", sourceColumn: 4, type: "string", role: "annotation" }, 5, { calc: "stringify", sourceColumn: 5, type: "string", role: "annotation" } ]); var options = { title: '', format: '#,#%', fontSize: 12, ticks: [{ v: 13, f: '13%' }], hAxis: { suffix: '%', ticks: [{ v: 0, f: '0%' }, { v: 25, f: '25%' }, { v: 50, f: '50%' }, { v: 75, f: '75%' }, { v: 100, f: '100%' }] }, //Baixo vAxis: { title: '', fontSize: 16, format: '#%', maxValue: 100 }, isStacked: 'true', color: '#000', colors: ['#…
has comment: http://stackoverflow.com/comment/38454639
has title: Google charts error trying to convert to percentage
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38437226
has comment: http://stackoverflow.com/comment/38437222
answer count: 0
type: Question
tagged with: charts
tagged with: google-visualization

http://stackoverflow.com/comment/38632375
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24873036
has text: The order isn't too important, as I can always sort `totals` in the callback function. I followed "JavaScript: The Good Parts" (p.37) for the closure syntax. What are the implications of your first snippet? I haven't come across your suggestion before.
score: 0

http://stackoverflow.com/a/24857928
downvote count: 0
has body: you can use media query for this.. Demo CSS: @media only screen and (max-width: 1600px) { #header { height:200px; } } @media handheld, only screen and (max-width: 940px) { #header { height:150px; } } Updated Demo CSS: #header { background: black; width: 100%; height: auto; display:block; -webkit-transition: .2s height linear; -moz-transition: .2s height linear; -o-transition: .2s height linear; transition: .2s height linear; }
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/24857872
has comment: http://stackoverflow.com/comment/38602748
score: 1
has comment: http://stackoverflow.com/comment/38602935

http://stackoverflow.com/q/24771247
tagged with: ftp
upvote count: 3
tagged with: wordpress
has body: Hello I have a wordpress website set up, but have a separate HTML file project that I would like to upload to my website so that I can link to the page within my portfolio. Simply, I just need the HTML page up and running on my site so that I can link to it, without affecting my existing wordpress site. Should I just upload it to the public_html? I also have a js folder that is required for the page to function, can I upload that to my site directory without worrying about the existing wordpress site being affected? Thank you!
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24771995
score: 3
has comment: http://stackoverflow.com/comment/38438727
has comment: http://stackoverflow.com/comment/38438423
type: Question
has comment: http://stackoverflow.com/comment/38438455
has title: How to upload separate HTML file to wordpress site via FTP client?
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/24771995
tagged with: http://stackoverflow.com/tag/html
tagged with: php

http://stackoverflow.com/comment/38591182
score: 0
type: AnswerComment
type: Comment
has text: it seems the problem was that jquery strips the tags with `$()` using regex fixes it... `var body_html = data.replace(/^[\S\s]*<body[^>]*?>/i, "") .replace(/<\/body[\S\s]*$/i, "");`
comment on: http://stackoverflow.com/a/24851178

http://stackoverflow.com/comment/38590682
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24851178
has text: 100% sure it`s within the body tag, I do have a css file embedded in the html which contains settings for the body.

http://stackoverflow.com/comment/38508648
type: QuestionComment
has text: thank You!! 2 more to answer! :]
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24808026

http://stackoverflow.com/q/24849667
has body: Does jquery have parameterize method like in rails parameterize ? I want to parameterize string using jQuery, example : "Jonh [ Doe ] " =&gt; "john-doe" " John ( Doe )" =&gt; "john-doe" "{ John } Doe / " =&gt; "john-doe" I know that can use toLowerCase() and .replace(), but I want best practice to do it. Now I'm use this script toLowerCase().replace(/\[|\]|\(|\)|\{|\}|\\|\//g, '').replace(/\s/g, '-') or toLowerCase().replace(/[^a-z0-9\s]/gi, '').replace(/[_\s]/g, '-') But the result look like this "{ John } Doe / " =&gt; "-john--doe--"
score: 10
has title: Jquery parameterize string like parameterize method in rails
accepted answer: http://stackoverflow.com/a/24849854
has answer: http://stackoverflow.com/a/48045582
type: AnsweredQuestion
upvote count: 10
possible better answer: http://stackoverflow.com/a/48045582
has comment: http://stackoverflow.com/comment/38586287
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/38586435
downvote count: 0
has comment: http://stackoverflow.com/comment/38586482
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38586513
linked to: http://stackoverflow.com/q/18123501
favorite count: 0
has answer: http://stackoverflow.com/a/24849854

http://stackoverflow.com/comment/38503847
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24805974
has text: use the session storage to manage this http://www.w3schools.com/html/html5_webstorage.asp
score: 0

http://stackoverflow.com/a/24785277
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38466002
answers question: http://stackoverflow.com/q/24784156
upvote count: 1
type: Answer
has body: Assuming all are integers function parseNum(num) { return num.toString().split('').reverse().map(function (val, idx) { return val * Math.pow(10, idx); }).reverse().join(' + '); } Examples parseNum(1568); //1000 + 500 + 60 + 8 parseNum(98345);//90000 + 8000 + 300 + 40 + 5 DEMO
has comment: http://stackoverflow.com/comment/38465827

http://stackoverflow.com/comment/38694471
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24906760
has text: three changes! var content = $(this).find(".content") as well.
score: 0

http://stackoverflow.com/comment/38703620
type: Comment
comment on: http://stackoverflow.com/q/24908698
score: 0
type: QuestionComment
has text: Please show the code you are trying to test and the test itself and explain what you are trying to achieve. You cannot stub a function twice, but you can create different stubs for every call and tell how many times the stub was called.

http://stackoverflow.com/a/24974353
downvote count: 0
score: 1
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/24898291
has body: As from the Tumblr Api documentation there is a limit of 20 posts per request. You can perform multiple requests with an increasing offset. var max_posts_per_page = 20; $.getJSON(api + "info?" + key,function(data) { post_amount = data.response.blog.posts; for (var offset = 0; offset &lt; post_amount; offset += max_posts_per_page) { $.getJSON(api + "posts/text?&amp;filter=text&amp;limit=" + max_posts_per_page + "&amp;offset=" + offset + "&amp;" + key,function(data) { $.each(data.response.posts, function(i, item) { var content = item.body $("#Posts ul").append('&lt;li&gt;' + content + '&lt;/li&gt;') }); }); } });

http://stackoverflow.com/comment/38494310
comment on: http://stackoverflow.com/q/24800864
type: Comment
type: QuestionComment
has text: First of all "can't use the chrome debug because it's with ajax." Use the Network panel. You can inspect each ajax request, its content and the associated response. Also, you should deactivate scrolling while your loading new posts, to prevent user from scrolling up and down and reactivate the loading process. To finish, your console prints are unreadable.
score: 2

alert
tags question: http://stackoverflow.com/q/24793810
tags question: http://stackoverflow.com/q/24815790
tags question: http://stackoverflow.com/q/24889073
type: Tag
tags question: http://stackoverflow.com/q/24750058
tags question: http://stackoverflow.com/q/24873722
tags question: http://stackoverflow.com/q/24773577
tag name: alert
tags question: http://stackoverflow.com/q/24752825

http://stackoverflow.com/a/24895876
answers question: http://stackoverflow.com/q/24895567
score: 0
has body: You can add javascript on checked event if(chkBooking.Checked) { String scriptText = String.Empty; scriptText += "function ShowAlert(){"; scriptText += " alert( " + " document.forms[0].TextBox1.value"; scriptText += ")}"; ClientScript.RegisterClientScriptBlock(this.GetType(), "CounterScript", scriptText, true); } Hope this helps.
has comment: http://stackoverflow.com/comment/38674625
type: Answer
has comment: http://stackoverflow.com/comment/38674451

http://stackoverflow.com/q/24757634
tagged with: handlebars.js
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38414271
has answer: http://stackoverflow.com/a/24776316
tagged with: whitespace
has body: input type="checkbox" class="btn pointCheck" id="GasMeteringVC-VolumeCorrector-Temperature t" value="GasMeteringVC/VolumeCorrector/Temperature t"> Could someone please help me in removing whitespace between Temperature and t. Above is the handlebars code that generates a menu with checkboxes and labels for them. All the values are from the JSON object.
type: Question
has title: Remove whitespace in dynamically generated input id using Handlebars.js
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
type: UnansweredQuestion

http://stackoverflow.com/q/24883358
tagged with: google-maps
has comment: http://stackoverflow.com/comment/38652626
tagged with: javascript
type: UnansweredQuestion
tagged with: google-maps-api-3
favorite count: 0
has comment: http://stackoverflow.com/comment/39063732
has body: Firstly let me say I am not a Java or even web developer. I have pieced together this code via the web and am almost at the finish point - but cannot get over the line. I am mapping journeys for a trucking firm, and want to use a custom marker at the start of each journey, with no marker at the end of the journey. The attached code does all I need for mapping the journey but I can't get the markers to render on the page. What am I missing? var directionsService = new google.maps.DirectionsService(); var num, map, data; var requestArray = [], renderArray = []; // A JSON Array containing some people/routes and the destinations/stops var jsonArray = { "Journey1": ["-38.076600, 176.722100", "-38.279641, 175.897505"], "Journey2": ["-38.279641, 175.897505", "-38.058217, 175.783939"], "Journey3": ["-38.058217, 175.783939", "-37.964919, 175.478964"], "Journey4": ["-37.964919, 175.478964", "-38.323678, 175.152163"], "Journey5": ["-38.323678, 175.152163", "-38.274879, 175.894551"], "Journey6": ["-38.274879, 175.894551", "-38.095284, 176.076530"], "Journey7": ["-38.095284, 176.076530", "-38.075316, 176.716276"], "Journey8": ["-38.075316, 176.716276", "-38.076600, 176.722100"] } // 16 Standard Colours for navigation polylines var colourArray = ['Maroon', 'Green', 'Olive', 'DarkBlue', 'Violet', 'Teal', 'Gray', 'Silver']; var Labelarray = [ 'Kawerau Depot, Ex: CHH Kawerau - Cogen Plant Kinleith - Hogfuel - CHH KINLEITH', 'Cogen Plant Kinleith - TD Haulage Pinedale - Empty', 'TD Haulage Pinedale - Gascoigne Farms Cambridge - Post Peeling - Untreated - GASCOIGNE FARMS LTD', 'Gascoigne Farms Cambridge - Tregoweth Te Kuiti - Empty', 'Tregoweth Te Kuiti - CHH Kinleith - Chip - FLL NETLOGIX LTD', 'CHH Kinleith - Mamaku Sawmill Mamaku - Empty', 'Mamaku Sawmill Mamaku - CHH Kawerau - Chip - FLL NETLOGIX LTD', 'CHH Kawerau - Kawerau Depot - Empty']; // Let's make an array of requests which will become individual polylines on the map. function generateRequests() { requestArray = []; for (v…
type: Question
has answer: http://stackoverflow.com/a/24888355
upvote count: 1
has comment: http://stackoverflow.com/comment/38651555
score: 0
answer count: 1
downvote count: 1
has title: How to Add custom markers to a google directions map at the start only of multiple journeys

http://stackoverflow.com/q/24834471
score: 0
answer count: 2
tagged with: jquery
has title: How to implement simple confirmation message that disappears after some seconds
linked to: http://stackoverflow.com/q/3428766
has comment: http://stackoverflow.com/comment/38570131
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I am trying to show a simple confirmation message of successfully logging out following this but I am not sure how to proceed. This message is going to appear for 5 seconds, after the user clicks the logout button (which simply does the log out and redirects to the home page). This confirmation message, along with the logout button is located at the header. I have the text wrapped in a div, with id="confirmation". The onClick event on a link calls the informUser function which does this: $("#confirmation").show(); setTimeout(function() { $("#myElem").hide(); }, 5000); The css of the div wrapper is this: #confirmation { position: absolute; top: 0; left: 45%; text-align: center; font-size: 1.25em; } Now, I needed to hide this element, I tried with visibility: hidden; but the element never showed up. I tried hiding it using $(document).ready(function() { $("#confirmation").hide("slow"); }); and the element showed up for less than a second and then disappeared (due to document.ready being loaded again).
has answer: http://stackoverflow.com/a/24834666
has comment: http://stackoverflow.com/comment/38557903
has comment: http://stackoverflow.com/comment/38557895
has comment: http://stackoverflow.com/comment/38558060
type: Question
has comment: http://stackoverflow.com/comment/38588511
has answer: http://stackoverflow.com/a/24834664
tagged with: javascript
linked to: http://stackoverflow.com/q/683363

http://stackoverflow.com/q/24755993
type: UnansweredQuestion
has body: I wanted to implement auto-populate city and state from zip code. I found this link : zipautocomplete This link is working super. Now I wanted to copy this code so right clicked and chosen view page source and there I found the html and ajax code. I copied code created index.php on my localhost. I have also copied necessary files like jquery.min.js etc. Now my code is same as that of link but I am not getting same output. Here is code that I have copied : ZIP code autocomplete test Enter a zip code or city and it will start autocompleting with 2 or more chars. Select an item from the list and it will fill in the zip, city and state. ZIP: City: State: When I checked above code on local, actually the code working correctly but it is not picking correct json response. when I enter 2 numbers in zip field then it should show related zipcode which is showing on that website but on my local browswer it is loading all joson_zip.pl file's json data. When I checked "NET" output from firebug tool, I found difference in json response of local output and link output. Can anyone please help me on this ?
upvote count: 1
has answer: http://stackoverflow.com/a/24756067
score: 1
tagged with: http://stackoverflow.com/tag/json
type: Question
has title: Why my code is behaving differently on local and not loading correct json response?
tagged with: javascript
tagged with: jquery
tagged with: ajax
answer count: 2
has answer: http://stackoverflow.com/a/24756260
linked to: http://stackoverflow.com/q/20035101
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/38663520
score: 2
has text: "I am using it on random portions of text throughout the site" Why not give those "random portions of text" a specific class and use that class for the plugin instead of the `article` tag?
comment on: http://stackoverflow.com/q/24890124
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38687515
score: 0
type: Comment
type: QuestionComment
has text: Because I've to pass callback function in controller where I'm calling the function. Please check last controller file code.
comment on: http://stackoverflow.com/q/24881034

http://stackoverflow.com/a/24762717
accepted answer of: http://stackoverflow.com/q/24762462
answers question: http://stackoverflow.com/q/24762462
has body: PHP is server-side and JS is client-side. So JS can't access PHP variables, functions, objects, etc. Besides that PHP is stateless so that means there is no connection between requests. After the request is done by default everything is gone, but there are several ways to store objects or data over multiple requests, including: You can use $_SESSION to store data or objects. For data over a single request you can use $_GET or $_POST. You can either store data with javascript with for example localStorage.
has comment: http://stackoverflow.com/comment/38425634
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/38481236
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24793608
has text: I dont know if you have tried it but in `scenario 1` you can actually use `multiply`. Plz try it.

http://stackoverflow.com/comment/38661633
type: AnswerComment
comment on: http://stackoverflow.com/a/24889258
type: Comment
score: 1
has text: I knew this feature of iOS7+, but see my explanation above: *since the height of document is exactly the same as browser viewport, mobile browser will not hide address bar/navigation menu*, as no scroll takes place on document-level.

http://stackoverflow.com/a/24843252
has body: I'm begging you, never, never, never use it in design Price H e l l o ! UPD without jQuery Hello! Pabam!
has comment: http://stackoverflow.com/comment/38575084
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38574595
type: Answer
answers question: http://stackoverflow.com/q/24842884
has comment: http://stackoverflow.com/comment/38574789
has comment: http://stackoverflow.com/comment/38574746
accepted answer of: http://stackoverflow.com/q/24842884
downvote count: 0
score: 1

http://stackoverflow.com/comment/102766078
type: Comment
comment on: http://stackoverflow.com/a/58193150
score: 0
type: AnswerComment
has text: Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/200264/discussion-between-jgmjgm-and-bergi).

http://stackoverflow.com/a/24815744
has body: Try something like var a = document.getElementsByTagName('a'), ajax; for (var i=0; i&lt;a.length; ++i) { a[i].addEventListener('click', handleAnchor, false); } function handleAnchor(e){ e.preventDefault(); if(ajax) ajax.abort(); ajax = new XMLHttpRequest(); ajax.onload = updateContent; ajax.open("get", this.href, true); ajax.send(); } function updateContent() { // Do something with `this.responseText` }
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38523265
type: Answer
accepted answer of: http://stackoverflow.com/q/24815645
upvote count: 3
has comment: http://stackoverflow.com/comment/38554787
answers question: http://stackoverflow.com/q/24815645
score: 3

http://stackoverflow.com/comment/38436051
type: AnswerComment
has text: Can you please help me out..and on hover to timer or loop stop and on unhover starts again
type: Comment
comment on: http://stackoverflow.com/a/24769363
score: 0

http://stackoverflow.com/comment/38605776
score: 0
type: AnswerComment
has text: @jfriend00 Internally V8 uses different types of array. For example a dictionary when you can pass any value as key or value. And a compact int array when you'll only pass small contiguous integers as keys and only 32 bit integers as values (which is probably the fastest internal storage type for an array).
type: Comment
comment on: http://stackoverflow.com/a/24859070

http://stackoverflow.com/a/24787611
has comment: http://stackoverflow.com/comment/38469978
type: Answer
has comment: http://stackoverflow.com/comment/38470072
has comment: http://stackoverflow.com/comment/38475087
has comment: http://stackoverflow.com/comment/38478219
score: -1
has body: Simply add an onclick event for the DIV that returns false onclick, and a jquery click event, that triggers when you click on the page as follows: HTML Hi ..! Like us then Close x JS $(document).click(function(){ getValue(); });
downvote count: 2
upvote count: 1
answers question: http://stackoverflow.com/q/24787412

http://stackoverflow.com/q/24862633
answer count: 2
downvote count: 0
score: 1
has body: I need to check if Javascript is enabled or not. If it is disabled I need to hide a placeholder. In this placeholder is a widget that is based on JS (jQuery). When Javascript is disabled the user can only see a white box with wasted space. I found out that I can use the &lt;noscript&gt; Tag to display content (for example a &lt;p&gt; with an ID to identify this state) when JS is disabled but I don't know how to implement a function that checks if this ID is shown to the user or not. When the ID is shown it should hide the placeholder. Is there any solution for doing this with C#? Thanks for any help.
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/38611269
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24863323
upvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/24863062
tagged with: c#
has title: Hide placeholder in ASP when Javascript is disabled
has comment: http://stackoverflow.com/comment/38611380
accepted answer: http://stackoverflow.com/a/24863323
has answer: http://stackoverflow.com/a/24863062
tagged with: placeholder
tagged with: javascript

http://stackoverflow.com/comment/38635998
has text: @Beaker: Strange, at zoom 0 you get `Math.pow(1.1, 0)` which is always exactly 1.0, so that should be the same as the original size. Have you checked that the stored original size remains the same?
type: Comment
comment on: http://stackoverflow.com/a/24873915
score: 0
type: AnswerComment

http://stackoverflow.com/a/24803258
accepted answer of: http://stackoverflow.com/q/24803011
has comment: http://stackoverflow.com/comment/38587247
has body: If statement goes inside the function. Also, you need to define the variable as canRun not carRun. Otherwise, you won't be setting a variable with global scope. var canRun = true; $(window).scroll(function() { if (canRun==true){ if($(window).scrollTop() + $(window).height() &gt; $(document).height() - 50) { canRun=false; // do stuff canRun=true; } } } Also, consider the top answer here as an alternative: jQuery - how to treat scroll as single event? It will only allow one function call every 200ms.
has comment: http://stackoverflow.com/comment/38500768
has comment: http://stackoverflow.com/comment/38500952
has comment: http://stackoverflow.com/comment/38500424
has comment: http://stackoverflow.com/comment/38501025
has comment: http://stackoverflow.com/comment/38499259
has comment: http://stackoverflow.com/comment/38500541
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38500021
score: 0
has comment: http://stackoverflow.com/comment/38500669
type: Answer
answers question: http://stackoverflow.com/q/24803011

http://stackoverflow.com/comment/38475851
comment on: http://stackoverflow.com/a/24788135
has text: Great you're right @isherwood! this.title does work (yes, without altering the function). But I'm having difficulty finding the correct way to get data-image to work. It isn't 'this.data-image' is it? Sorry, I've gone surfing around but couldn't find the correct syntax. Also yes it looks like data-image is preferable.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38495759
comment on: http://stackoverflow.com/q/24801633
has text: possible duplicate of [.indexOf function on an array not working in IE7/8 using JavaScript](http://stackoverflow.com/questions/11544983/indexof-function-on-an-array-not-working-in-ie7-8-using-javascript)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24808114
has comment: http://stackoverflow.com/comment/38508595
has comment: http://stackoverflow.com/comment/38508927
has body: You just needed to make some changes to your CSS, here's the fiddle: http://jsfiddle.net/Ls6pb/1/ Here are my edits to you CSS: .wrapper-dropdown-5 { /* Size &amp; position */ position: relative; /*width: 144px;*/ margin: 0 auto; /* Styles */ background: #fff; cursor: pointer; outline: none; transition: all 0.3s ease-out; } span#ddtext:after{ content:" ▾" } /* Little arrow .wrapper-dropdown-5:after { content: ""; width: 0; height: 0; position: absolute; left: 150px; margin-top: -18px; border-width: 9px 9px 0 7px; border-style: solid; border-color: #067ab4 transparent; }*/ .wrapper-dropdown-5 .dropdown { /* Size &amp; position */ position: absolute; top: 30%; left: -38; right: 0; /* Styles */ list-style: none; transition: all 0.3s ease-out; /* Hiding */ max-height: 0; overflow: hidden; } .wrapper-dropdown-5 .dropdown li a { display: block; text-decoration: none; color: #067ab4; padding: 0px 0; transition: all 0.3s ease-out; } /* Hover state */ .wrapper-dropdown-5 .dropdown li:hover a { color: #57a9d9; } .wrapper-dropdown-5.active .dropdown { border-bottom: 0px solid rgba(0,0,0,0.2); max-height: 400px; } div#dd { color: #067ab4; font: 30px tahoma; display: inline-block; margin-top: 45px; } div#textA { display: inline-block; font: 30px tahoma; padding-left: 20px; margin-top: 45px; } div#textB { display: inline-block; font: 30px tahoma; /*padding-left: 40px;*/ margin-top: 45px; } span#ddtext { border-bottom: 1px solid #067ab4; padding-bottom: 5px; padding-left: 0px; }
has comment: http://stackoverflow.com/comment/38508140
has comment: http://stackoverflow.com/comment/38508751
type: Answer
answers question: http://stackoverflow.com/q/24807378
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38509317
has comment: http://stackoverflow.com/comment/38509433
accepted answer of: http://stackoverflow.com/q/24807378
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/24823670
possible better answer: http://stackoverflow.com/a/24823900
tagged with: preload
accepted answer: http://stackoverflow.com/a/24824128
linked to: http://stackoverflow.com/q/476679
has title: Images not preloaded properly
upvote count: 1
type: Question
type: AnsweredQuestion
score: 1
has body: I am having a jQuery script that loads 15 images and their hover versions (the hover versions are used when... hovering, not when the page loads). In both Chrome and Firefox in the Network tab, i see this : images/img1.png images_hover/img1.png This must mean the hover images are preloaded correctly, but... when i actually hover and those images are used, they are being loaded again. Here is the preload code : var prel = new Image(); prel.src = "http://hdodov.byethost15.com/color-game/graphics/parts_hover/" + id + ".png"; I tried using the whole path - http://hdodov.byethost15.com/color-game/graphics/parts_hover/ and the short path too (where the root and the script is) - graphics/parts_hover/. It made no difference. Could this be caused because my images have the same name? They are in different directories though.
tagged with: image
has comment: http://stackoverflow.com/comment/38537813
has answer: http://stackoverflow.com/a/24824128
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/38537776
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24823900
favorite count: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/24902335
tagged with: css
has comment: http://stackoverflow.com/comment/38686809
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38686883
has title: Why I cannot grab tag with :visible selector?
has comment: http://stackoverflow.com/comment/38686792
has comment: http://stackoverflow.com/comment/38686593
has body: As per the DOC, Elements are considered visible if they consume space in the document. Visible elements have a width or height that is greater than zero. I had inspected the option tag, it seems there is no css property set with it in order to ignore its space from the DOM. Though, while i selecting the option tag using :visible selector it is not selecting anything. It sounds mysterious to me. HTML: test test1 test2 test3 test4 JS: console.log($('select option:visible').length); // Length always returns 0 DEMO Can anyone explain credibly, what is going on behind this.?
downvote count: 1
has comment: http://stackoverflow.com/comment/38686630
type: Question
has comment: http://stackoverflow.com/comment/38686758
has comment: http://stackoverflow.com/comment/38686791
has comment: http://stackoverflow.com/comment/38686559
upvote count: 5
has comment: http://stackoverflow.com/comment/38686871
score: 4
has comment: http://stackoverflow.com/comment/38687084
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38686577
has comment: http://stackoverflow.com/comment/38686703
favorite count: 0
duplicate of: http://stackoverflow.com/q/7820824
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/38433458
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24768396
has text: @caramba: what would I use for #view* so div id=view then anything after view?

http://stackoverflow.com/a/24847097
answers question: http://stackoverflow.com/q/24847070
score: 0
has body: You are right. It will call first function from the array with parameter 9. You can open this link and open the browser console and run the example to see the result.
type: Answer

http://stackoverflow.com/comment/38615534
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24864712
has text: yes td dont have id but tr is having id.so kindly please tell me how to here how to take tr id.thank you very much for the replay.bro.
score: 0

http://stackoverflow.com/a/24864074
accepted answer of: http://stackoverflow.com/q/24863795
score: 2
has comment: http://stackoverflow.com/comment/38614954
has comment: http://stackoverflow.com/comment/38616561
answers question: http://stackoverflow.com/q/24863795
has comment: http://stackoverflow.com/comment/38619296
upvote count: 2
has comment: http://stackoverflow.com/comment/38619968
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38620339
has comment: http://stackoverflow.com/comment/38614068
has comment: http://stackoverflow.com/comment/38614491
has comment: http://stackoverflow.com/comment/38614683
type: Answer
has comment: http://stackoverflow.com/comment/38619538
has body: Try javascript:return test() instead of if(!test(this)) return false;, like this &lt;asp:TextBox ID="t" runat="Server" AutoPostBack="true" onchange="javascript:return test()"/&gt; and in JavaScript function test() { var d = document.getElementById('d'), t = document.getElementById('t'); var ddl = ('#d'); var txt = ('#t'); var val = t.value; var len = $(ddl+ ' option[value=' + val + ']').length; if (len &gt; 0) { d.value = t.value = val; return false; } return true; } Update Aspx &lt;asp:DropDownList ID="d" runat="Server" AppendDataBoundItems="true" onchange="javascript:return test('ddl')"/&gt; &lt;asp:TextBox ID="t" runat="Server" AutoPostBack="true" onchange="javascript:return test('txt')" /&gt; JavaScript function test(temp) { var d = document.getElementById('&lt;%= d.ClientID%&gt;'), t = document.getElementById('&lt;%= t.ClientID%&gt;'); var ddl = ('#&lt;%= d.ClientID%&gt;'); var txt = ('#&lt;%= t.ClientID%&gt;'); var val = t.value; if (temp == "txt") { var len = $(ddl + ' option[value=' + val + ']').length; if (len &gt; 0) { d.value = t.value = val; return false; } } else { t.value = d.value; return false; } return true; }
downvote count: 0
has comment: http://stackoverflow.com/comment/38614152

http://stackoverflow.com/a/24842093
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/24841571
has body: The snippet below could help you &lt;?php $string = "asdasd2 34 56 ——————————————-"; $string = preg_replace("/(?:(?=—|\-).)+/", "", $string); echo $string; // asdasd2 34 56 ?&gt; The two expressions below should also replace all kind of hypens [\p{Pd}]+ [\x{2010}-\x{2015}|\x{002D}|\x{2212}|\x{FE58}|\x{FE63}|\x{FF0D}]+ but for some reason I'm getting an error or a string with this weird character (�). That's how I came up with the first solution.
type: Answer
downvote count: 0

http://stackoverflow.com/comment/38646024
type: QuestionComment
has text: just combine ur two scripts into one...
comment on: http://stackoverflow.com/q/24880844
score: 0
type: Comment

http://stackoverflow.com/q/24808800
has comment: http://stackoverflow.com/comment/38510255
has comment: http://stackoverflow.com/comment/38510436
has comment: http://stackoverflow.com/comment/38510356
has comment: http://stackoverflow.com/comment/38509586
has title: Accessing Perl Array in JavaScript
has answer: http://stackoverflow.com/a/24809473
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38509674
tagged with: mason
score: 0
type: Question
tagged with: perl
has comment: http://stackoverflow.com/comment/38524299
answer count: 1
accepted answer: http://stackoverflow.com/a/24809473
has body: I have an array of unknown size in perl generated by some other perl module. Now, precisely I want to find if a value passed to a jquery function exists in the perl array or not. Is there a way I can do an element by element comparison of the input value against each value in perl array? I looked around and looks like I can access perl array in jquery by providing the index but we don't know the size of the array. So I don't know when to stop. My mason code looks something similar to: &lt;%perl&gt; my @testArray = [call to some other perl module to get the values] &lt;/%perl&gt; &lt;script type="text/javascript"&gt; function checkIfValExistsInTestArray(val) { // Code to test if "val" exists in "@testArray". Returns boolean true/false. } &lt;/script&gt;
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/38618568
type: Comment
has text: Your talking about a string terminator in a base64 encoded string? Interesting. I'll check it out. Thanks.
type: AnswerComment
comment on: http://stackoverflow.com/a/24866405
score: 0

http://stackoverflow.com/a/41580747
type: Answer
answers question: http://stackoverflow.com/q/24825030
has body: If can also happen if you set scrollSpeed to zero. editor.setScrollSpeed(0); // no scrolling editor.setScrollSpeed(.5); // scrolling I had used an integer to store the scrollSpeed value and when I was passing it .5 it was converted to 0 since integers can only be whole numbers and this disabled scrolling. I switched to using Number or float that allows decimals and scroll started working again.
score: 0

http://stackoverflow.com/q/24824732
score: 37
possible better answer: http://stackoverflow.com/a/38940507
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/24826338
has title: Test if a data exist in Firebase
favorite count: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/24826338
has answer: http://stackoverflow.com/a/37089808
tagged with: firebase
type: AnsweredQuestion
upvote count: 37
has body: I would like test if a data exist in Firebase before to add it. But I have a problem with my method: I try to list all data with this Javascript code: var theDataToAdd = userName; var usersRef = new Firebase('https://SampleChat.firebaseIO-demo.com/users/'); usersRef.on('child_added', function(snapshot) { var message = snapshot.val(); if (message.name == theDataToAdd) alert ("exist"); }); But if the user doesn't exist, it will be added before, then my code says that he exists. You will say that is normal because my alert is called only when "child_added", but I don't see how do. I have also try with the "value" event but my "message.name" is empty. How can I fix it?
has answer: http://stackoverflow.com/a/38940507
type: Question

http://stackoverflow.com/comment/38435461
score: 0
comment on: http://stackoverflow.com/a/24769527
type: Comment
has text: If all the OP wanted was to output text to the page, document.write would do that. There was no context suggesting a better solution was necessary.
type: AnswerComment

http://stackoverflow.com/q/24805647
has comment: http://stackoverflow.com/comment/38503391
has comment: http://stackoverflow.com/comment/38503671
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38503526
has comment: http://stackoverflow.com/comment/38503329
has comment: http://stackoverflow.com/comment/38503425
has answer: http://stackoverflow.com/a/24805790
has comment: http://stackoverflow.com/comment/38503318
has comment: http://stackoverflow.com/comment/38503216
type: Question
has comment: http://stackoverflow.com/comment/38504550
has comment: http://stackoverflow.com/comment/38503309
has body: I need to pass a reference to the class through to a method so I can access a var: I have tried: p.id = 1; p._initEvents = function(){ $('#file-form').on('valid.fndtn.abide', this.save.bind(this)); }; p.save = function(){ console.log(this.id); } Which just passes a reference to the file form. I have also tried: var self = this; p._initEvents = function(){ $('#file-form').on('valid.fndtn.abide', this.save.bind(self)); } p.save = function(){ console.log(self.id); } Which produces undefined. I know this.id is set correctly. Where am I going wrong?
has comment: http://stackoverflow.com/comment/38503308
tagged with: javascript
has comment: http://stackoverflow.com/comment/38503203
has comment: http://stackoverflow.com/comment/38503296
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38503394
tagged with: jquery
has title: Access this in a method?
has comment: http://stackoverflow.com/comment/38503445

http://stackoverflow.com/comment/38739806
comment on: http://stackoverflow.com/q/24804109
type: QuestionComment
has text: There are may browsers for the IPAD, which one are you refering to?? have you tried it with another browser on the IPAD???
score: 0
type: Comment

http://stackoverflow.com/comment/38652168
type: Comment
comment on: http://stackoverflow.com/a/24884368
score: 0
type: AnswerComment
has text: Nice idea but you need to tweak, as `^[0-9]{0,7}(\.[0-9]{1,2}|[0-9]{0,2})$` matches `.0`

servlets
tags question: http://stackoverflow.com/q/24842754
tags question: http://stackoverflow.com/q/24777242
tags question: http://stackoverflow.com/q/24893032
tags question: http://stackoverflow.com/q/24871661
tag name: servlets
tags question: http://stackoverflow.com/q/24821400
type: Tag

http://stackoverflow.com/a/24834729
type: Answer
accepted answer of: http://stackoverflow.com/q/24833371
upvote count: 2
score: 2
answers question: http://stackoverflow.com/q/24833371
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38614197
has body: You are not going to get the value of the &lt;asp:Label you modified on client side at the code behind. If I'm correct ASP.NET label is rendered as a span element in the client side: I think that only the controls that are rendered as input controls and values changed at client side are updated on viewstate, so your only resort is to stick to the hidden field. You just have to do the other way around. 1.Pass the hidden field to the js function and update the value of the hidden field at the client side in your js function PayPeriodsPayroll like below function PayPeriodsPayroll (hdnObj) { var hdnPayPeriod = document.getElementById(hdnObj); hdnPayPeriod.val('the value you want to set'); } Then in your pageload If Not IsPostBack Then .... Else // update label with the hidden field value if you need it lblPayPeriodStartDt.Text = hdnPayPeriodStartDt.Value End If

http://stackoverflow.com/comment/38531255
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24819244
has text: But the problem is that the final date on which the count will stops is the current year. How to deal with that?

http://stackoverflow.com/comment/38655294
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24886012
has text: Then change it to a `span`

http://stackoverflow.com/q/24871935
has title: How to use Node.js cluster with ZeroMQ reply workers
has body: The basic question is "how to setup a ZeroMQ REPLY socket as a worker?". In effect, how to swap out the default example using an HTTP server with a ZeroMQ REPLY server, eg.: var cluster = require('cluster'), zmq = require('zmq'); if (cluster.isMaster) { cluster.fork(); cluster.fork(); } else { // Using `http.createServer(..).listen(5555);` works perfectly // However, the following does not: var socket = zmq.socket('rep'); socket.bind( "tcp://*:5555", function (err) { console.log(process.pid, err); } ); } The first worker logs 'undefined' (ie. no error), whereas the second worker logs an error: Address already in use. From the "How it works" docs, the bit that seems appropriate is here (emphasis added): When you call server.listen(...) in a worker, it serializes the arguments and passes the request to the master process. If the master process already has a listening server matching the worker's requirements, then it passes the handle to the worker. If it does not already have a listening server matching that requirement, then it will create one, and pass the handle to the worker. How to "match requirements" with a ZeroMQ REPLY socket?
type: Question
tagged with: zeromq
has answer: http://stackoverflow.com/a/24889704
upvote count: 2
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: sockets
tagged with: node.js
score: 2
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/24889704

http://stackoverflow.com/comment/38694605
score: 0
type: Comment
type: QuestionComment
has text: So check the value of `x[i].getElementsByTagName("property")[0].childNodes[0].nodeValue` before writting
comment on: http://stackoverflow.com/q/24906830

http://stackoverflow.com/q/24764423
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/38426588
tagged with: css
has comment: http://stackoverflow.com/comment/38426425
has comment: http://stackoverflow.com/comment/38425879
has answer: http://stackoverflow.com/a/24764550
tagged with: twitter-bootstrap
has title: DateTime picker not working
has comment: http://stackoverflow.com/comment/38426320
type: UnansweredQuestion
has body: Im having MVC5 project and I want to add date picker ,currently its not working since I've error in the JS code,what am I missing here ? I try to add Nuget for datetime picker as follows but its not working. the error in the console is Uncaught TypeError: undefined is not a function Create:93 (anonymous function) Create:93 Any idea what am I missing here? this is all the page code I can share the project if its needed this is very simple project with 3 fields @model TestropDownCreate.Models.TestModel @{ ViewBag.Title = "Create"; } Create @using (Html.BeginForm()) { @Html.AntiForgeryToken() Model @Html.ValidationSummary(true) @Html.LabelFor(model => model.Name, new { @class = "control-label col-md-2" }) @Html.EditorFor(model => model.Name) @Html.ValidationMessageFor(model => model.Name) @Html.LabelFor(model => model.SelectedGender, new { @class = "control-label col-md-2" }) @Html.DropDownListFor(model => model.SelectedGender, Model.Gender) Date // It's there where I'm having the error --> } @Html.ActionLink("Back to List", "Index") @section Scripts { @Scripts.Render("~/bundles/jqueryval") }
has comment: http://stackoverflow.com/comment/38425826
tagged with: razor
type: Question
has comment: http://stackoverflow.com/comment/38428898
has comment: http://stackoverflow.com/comment/38426540
has comment: http://stackoverflow.com/comment/38428316
has comment: http://stackoverflow.com/comment/38426666
answer count: 1

http://stackoverflow.com/q/24836678
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/38653226
has comment: http://stackoverflow.com/comment/38683468
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/38592933
has answer: http://stackoverflow.com/a/24836926
tagged with: angularjs
has body: I have two directives that provide different views on the same set of data. Both of these directives need to rely on central functionality contained in a controller. The controller uses various services to load items, perform searches, etc for the grid or feed views. I would like to share the single controller between the two directives. I realize that I can do this by specifying the controller at a level in the dom above the two directives using ng-controller. However, I cannot get this to work, as both of the directives require a configuration object being passed into them (preferably through an isolate scope) which is used by the central controller. I cannot simply specify the controller within each directive because angularjs controllers are not singletons. By doing this, there would be two instances of the controller and therefore two sets of data, watches, etc. Below is an example situation. HTML Controller: .controller('ListingController', function ($scope) { //Try to use $scope.config here and get errors because it's being passed in on //children dom elements //These items need to be used in the templates provided in the directives sharing //this controller $scope.items = [ {name:'test1'}, {name:'test2'} ]; } ); Directives: .directive('dir1', function() { return { templateUrl: 'someTemplateThatUsesStuffOnControllerScope.html', scope: { config: '=' } } } ) .directive('dir2', function() { return { templateUrl: 'someOtherTemplateThatUsesStuffOnControllerScope.html', scope: { config: '=' } } } ) someTemplateThatUsesStuffOnControllerScope.html {{item.name}} Finally, I'm wanting to use isolate scopes so as to protect other parent scopes from having a possible "$scope.config" overridden by the directives' Hopefully that all makes sense to someone and hopefully there is an answer out there.
type: UnansweredQuestion
has title: AngularJS : Sharing a controller scope between two directives with isolate scopes
upvote count: 2
score: 1
tagged with: angularjs-controller
downvote count: 1
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/38630122
tagged with: javascript

http://stackoverflow.com/comment/38540589
has text: I tried that over and over and over again? It does not help. `Height:100%` fits it to its contents, not the parent!
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24825400

http://stackoverflow.com/q/24843453
tagged with: javascript
score: 0
tagged with: firefox-addon
tagged with: firefox-addon-sdk
has answer: http://stackoverflow.com/a/24844746
has title: Firefox addon-sdk: get element of attached panel
type: Question
type: AnsweredQuestion
has body: I have a very simple firefox plugin - developing with addon-sdk. In tutorial, I found a mention of attached-panel to a toggle button, but I can't find a way to and (for example) onclick callback to button in this panel. This is simplified panel: &lt;body&gt; &lt;table width="100%"&gt; &lt;tr&gt; &lt;td colspan="2" align="center"&gt; &lt;input type="button" id="btnInject" value="Inject!"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; and here's a part of main.js file: var self = require("sdk/self"); var tabs = require("sdk/tabs"); 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": "./icon-16.png", }, onChange: handleChange }); var panel = panels.Panel({ contentURL: self.data.url("popup.html"), onHide: handleHide }); function handleChange(state) { if (state.checked) { panel.show({ position: button }); } } function handleHide() { button.state('window', {checked: false}); } I need to assign onclick function, I've tried panel.getElementById('btnInject').onclick, but getElementById was not found as a function. Also tried a document object, but it wasn`t defined either. Can anyone help me, how to access this element?
accepted answer: http://stackoverflow.com/a/24844746
tagged with: firefox
answer count: 1

http://stackoverflow.com/q/24756248
tagged with: codeigniter
possible better answer: http://stackoverflow.com/a/24757196
has title: codeigniter before submit confirm popup box using javascript
upvote count: 1
has answer: http://stackoverflow.com/a/24757196
tagged with: javascript
answer count: 5
has answer: http://stackoverflow.com/a/24756356
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/24756356
score: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/24788819
favorite count: 0
has body: I need when I click the button for submit view popup box for confirmation and if I press ok, it will continue the submit and if cancel nothing will happen and close the box here is my code, code in the view form <?php foreach($company_data as $row){ ?> Company Details. <?php echo form_open_multipart('site/update');?> <?php form_hidden('id', $row->code);?> Code : <?php echo form_input('code',$row->code);?> Name : <?php echo form_input('name',$row->name);?> Logo : URL : <?php echo form_input('url',$row->url);?> Description : <?php echo $row->description; ?> <input type="submit" name="submit" value="Update" onclick="update(<?php echo $row->name;?>)"/> <?php } ?>
has answer: http://stackoverflow.com/a/41140803
type: Question
has answer: http://stackoverflow.com/a/24774093
tagged with: php

http://stackoverflow.com/comment/38415665
type: QuestionComment
has text: you don't have to Stringify your JSON object as your controller may allready espect JSON content. JSON.stringify is used to print JSON object in the javascript console. Just give a try without this function `$.ajax({..., data : ArtifactsModel, ...`
score: 1
comment on: http://stackoverflow.com/q/24759089
type: Comment

http://stackoverflow.com/comment/112963981
type: Comment
comment on: http://stackoverflow.com/a/24829882
has text: There is a typo in `{redlim}`. Should be `{rdelim}`.
type: AnswerComment
score: 0

http://stackoverflow.com/q/24900447
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38682957
has comment: http://stackoverflow.com/comment/38684072
tagged with: gallery
type: UnansweredQuestion
tagged with: slider
answer count: 0
has body: Hi I'm trying to create a gallery slider using JavaScript, HTML5 and CSS3. At the moment I have my slider working ("id="container") and I also have a list of colour thumbnails ("id="colour") that I click on to change the main image in the slider. What I'm trying to work out is how to highlight the colour thumbnails by overlaying/swapping individual B&W images from a separate table (id="B&W")? I want these B&W images to appear one at a time and act as marker letting the user know how far they've scrolled along in the gallery slider? image slider Left arrow Right arrow 1.description.... Also in JavaScript the B&W thumbnail marker needs to be linked to both the Gallery slider function "slider(num)" and the colour thumbnails function "thumbnail(x)". var Image = ["img1.png", "img2.png","img3.png","img4.png"]; var Description = ["1.description....", "2.description....","3.description....","4.description...."]; var B&W = ["B&W_thumbnails_1.jpg","B&W_thumbnails_2.jpg","B&W_thumbnails_3.jpg","B&W_thumbnails_4.jpg"]; var Image_Number = 0; var Image_Length = Image.length -1; function slider(num){ var Images = document.getElementById('img'); Image_Number = Image_Number + num; if (Image_Number > Image_Length){ Image_Number = 0; } if (Image_Number < 0){ Image_Number = Image_Length; } Images.src=Image[Image_Number]; document.getElementById("description").innerHTML = Description[Image_Number]; return false; } //what will make the individual B&W_thumbnail jpegs appear/disappear in correspondence with both the slider and thumbnail function? //function ?B&W_thumbnails(x){} function thumbnail(x){ var Images = document.getElementById('img'); Image_Number = Image_Number + x; Images.src=Image[x]; document.getElementById("description").innerHTML = Description[x]; } In the future I want to add more images to this gallery slider so I was hoping there was a really simple way in JavaScript to change the position of the thumbnails.
has title: 'Gallery slider' how do you create a thumbnail image marker that corresponds with the gallery image on click using JavaScript?
type: Question
has comment: http://stackoverflow.com/comment/38683593
tagged with: javascript
has comment: http://stackoverflow.com/comment/38683668
tagged with: image

http://stackoverflow.com/a/24879328
answers question: http://stackoverflow.com/q/24878953
has comment: http://stackoverflow.com/comment/38644765
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38643200
score: 0
type: Answer
has body: the selectionchange event on document currently fires first and delete the #icon before click event on it is fired. Do not remove your icon on selectionchange but rather do it on a click event outside the #icon element. For example, replace your click listener on #icon by: $(document).bind("click", function (e) { if(e.target.id=="icon") { $("#footer").remove(); $("body").append(" "); $("#footer-inner p").html(' Close this bar '); } $("#icon").remove(); }); Live example at http://jsfiddle.net/Yr54c/3/
accepted answer of: http://stackoverflow.com/q/24878953

http://stackoverflow.com/comment/38673107
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24842885
has text: you're great man, unfortunately I get an error in that line {onItemSelect: function(item) { although if copy&pasted it :-/ the first version of your code for question 1 was working perfect without this update
score: 0

http://stackoverflow.com/comment/38557589
has text: ` ` is a [doctype declaration](http://ejohn.org/blog/html5-doctype/) it is not an ` ` tag
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24834252
type: Comment

http://stackoverflow.com/q/24809622
tagged with: javascript
has answer: http://stackoverflow.com/a/28746955
type: UnansweredQuestion
has body: I'm trying to retrieve information from the Yelp API for an HTML5/Javascript phone app I'm writing. I've been through quite a number of examples and keep receiving an error message stating: /**/cb({"error": {"text": "Signature was invalid", "id": "INVALID_SIGNATURE", "description": "Invalid signature. Expected signature base string: GET&http%3A%2F%2Fapi.yelp.com%2Fv2%2Fsearch&_%3D1405603996179%26callback%3Dcb%26location%3DSan%252BFrancisco%26oauth_consumer_key%3DXXX%26oauth_consumer_secret%3DXXX%26oauth_nonce%3DFGmffH%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1405603996%26oauth_token%3DXXX%26term%3Dfood" }}) I've used the same code in a jsfiddle and having filled in my OAuth details get a perfect response with an array of 20 locations. So authentication from the web works but from the phone does not, given the same credentials. I suspect it may have something to do with the callback. The project is written uses Apache Cordova through the Intel XDK ide. I've tested both in the emulator and on a device to the same end. The script that works online but not on my phone is available at http://jsfiddle.net/93YKC/ but is really just a sample taken from an online forum I found in my trails. $.ajax({ 'url' : message.action, 'data' : parameterMap, 'dataType' : 'jsonp', 'jsonpCallback' : 'cb', 'success' : function(data, textStats, XMLHttpRequest) { console.log(data); } }); I'm very open to suggestions as I'm contemplating implementing a Restful API to get the information from Yelp and pass it on to my app. This really isn't the way I'd like to get around this and would most likely contravene Yelp's fine print. Stephen
tagged with: http://stackoverflow.com/tag/html
tagged with: oauth
tagged with: intel-xdk
type: Question
tagged with: yelp
has title: Javascript OAuth for Yelp API
score: 0
answer count: 1

http://stackoverflow.com/comment/38661278
has text: can you provide us with the source html?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24889073

http://stackoverflow.com/a/24900998
type: Answer
score: 0
answers question: http://stackoverflow.com/q/24900760
has body: javascript defenition of a class is so flexible that you can do what you are asking for, you just have to test user = function() { this.login = "username"; this.password="123"; } var User1 = new user(); console.log(User1.login + " " + User1.password); you can define another class with the same name, and this will break the first definition user = function() { this.name = "abc"; this.age = 24; } var User2 = new user(); console.log(User2.name+ " " + User2.age);

http://stackoverflow.com/q/24853686
type: Question
has answer: http://stackoverflow.com/a/28275664
tagged with: performance
tagged with: javascript
has title: Javascript TypedArray performance
answer count: 3
has comment: http://stackoverflow.com/comment/41490735
downvote count: 0
accepted answer: http://stackoverflow.com/a/28275664
score: 28
has comment: http://stackoverflow.com/comment/38836066
favorite count: 0
possible better answer: http://stackoverflow.com/a/24855023
upvote count: 28
has answer: http://stackoverflow.com/a/24855023
has comment: http://stackoverflow.com/comment/38836488
tagged with: typed-arrays
has answer: http://stackoverflow.com/a/46976906
type: AnsweredQuestion
has body: Why are TypedArrays not as fast as regular arrays? I want to store some precalculated integer values, and I need the access to the array to be as fast as it can be. http://jsperf.com/array-access-speed-2/2 Preparation code: Benchmark.prototype.setup = function() { var buffer = new ArrayBuffer(0x10000); var Uint32 = new Uint32Array(buffer); var arr = []; for(var i = 0; i &lt; 0x10000; ++i) { Uint32[i] = (Math.random() * 0x100000000) | 0; arr[i] = Uint32[i]; } var sum = 0; }; Test 1: sum = arr[(Math.random() * 0x10000) | 0]; Test 2: sum = Uint32[(Math.random() * 0x10000) | 0]; PS: May be my perf tests are invalid feel free to correct me.

http://stackoverflow.com/q/24769424
has answer: http://stackoverflow.com/a/30947409
type: Question
score: 3
tagged with: javascript
tagged with: jspdf
answer count: 2
downvote count: 0
favorite count: 0
has body: I am having trouble adding an image to a pdf using jspdf. The error I get reads as follows: Error: getJpegSize could not find the size of the image Here is the code: $scope.makePDF = function () { var imgData = 'data:image/jpeg;base64,' + btoa('../img/myImage.jpg'); var doc = new jsPDF(); doc.setFontSize(12); doc.addImage(imgData, 'JPEG', 15, 40, 180, 180);
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38468660
upvote count: 3
has answer: http://stackoverflow.com/a/32380589
tagged with: image-processing
has title: Cannot add image to pdf using jspdf. Returns getJpegSize error

http://stackoverflow.com/a/24883244
answers question: http://stackoverflow.com/q/24882898
score: 0
has body: Is this looking for class="block 01 sel" if it is selected $(".block").click(function(){ $(".block").removeClass("sel"); $(this).addClass("sel"); }); DEMO
type: Answer

http://stackoverflow.com/a/24803871
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24803259
answers question: http://stackoverflow.com/q/24803259
type: Answer
has body: You can probably try $(result_html).appendTo($('.container')); instead of $(".container").append(result_html); For me it works.
score: 3
upvote count: 3

http://stackoverflow.com/comment/38422199
type: Comment
comment on: http://stackoverflow.com/a/24754996
type: AnswerComment
has text: Yep. Your fiddle shows the same solution that I came to: use the primary y-axis before adding a secondary y-axis. Thanks again.
score: 0

file
type: Tag
tags question: http://stackoverflow.com/q/24854866
tags question: http://stackoverflow.com/q/24777570
tag name: file
tags question: http://stackoverflow.com/q/24898195
tags question: http://stackoverflow.com/q/24755057
tags question: http://stackoverflow.com/q/24836801
tags question: http://stackoverflow.com/q/24898337

http://stackoverflow.com/q/24803729
possible better answer: http://stackoverflow.com/a/24804004
has answer: http://stackoverflow.com/a/24804004
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24804545
type: Question
accepted answer: http://stackoverflow.com/a/24804545
has title: When current menu item is selected, others fade
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38499405
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has body: Example: I am in the "Contact" page. I want the "Contact" menu item to be at 100% opacity and the rest at 30% opacity. I am in the "About" page. I want the "About" menu item to be at 100% opacity and the rest at 30% opacity. My menu is this: HTML: Home Contact About CSS: .menu .menu-item-1 {background: url('images/image1.jpg');} .menu .menu-item-1 a {background: url('images/transparent-black-border-1.png') no-repeat; background-position: bottom;} .menu .menu-item-2 {background: url('images/image2.jpg');} .menu .menu-item-2 a {background: url('images/transparent-black-border-2.png') no-repeat; background-position: bottom;} .menu .menu-item-3 {background: url('images/image3.jpg');} .menu .menu-item-3 a {background: url('images/transparent-black-border-3.png') no-repeat; background-position: bottom;} What I want: When the .current-menu-item class appears, that menu item should be at 100 opacity and the others at 30%. Also the .menu .menu-item-1 background image should fade too, not only the a-tag. Can you help me?

http://stackoverflow.com/comment/38502322
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24803800
type: Comment
has text: @user3421202 I think you are little confused you are saying `cover["source"]` not cover[source]. see properly. and `cover["source"]` and `cover.source` are same.

http://stackoverflow.com/comment/38398300
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24749706
has text: Why don't you edit your answer to show how JS can be used to do just that? Without that bit, your answer tends to attract down votes because it is more of a comment than answer as of now.

http://stackoverflow.com/comment/38550327
has text: There is no magic bullet, you have to check for whatever you're expecting. As mentioned above, for EJS or other frameworks where you pass values and they are magically instanciated as variables, you pass an object so you only have to check for one single variable being defined, after that you check for keys in the object, which is much simpler.
score: 2
comment on: http://stackoverflow.com/a/24830473
type: AnswerComment
type: Comment

http://stackoverflow.com/q/24896295
favorite count: 0
upvote count: 1
tagged with: php
has answer: http://stackoverflow.com/a/24896358
has comment: http://stackoverflow.com/comment/38675090
type: AnsweredQuestion
tagged with: mysql
downvote count: 1
type: Question
has body: I get the following error when I try to insert into a mysql database. MYSQL 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 'Condition, Status) VALUES ( '20140715_173221.jpg','rt', 'Vessel', 'hf',' ','New'' at line 1 I can insert fine without fields Condition and Status. here is the form/javascript. Type: Select a Type... Shroud Vessel Collector M150 TC Vanes/HOB/IF Title: Status: Condition: New Cleaned Drained NA Description: File: and my PHP Post file $title=$_POST['Title']; $usertitle=$_POST['UserTitle']; $type=$_POST['Type']; $Description=$_POST['Description']; $files=($_FILES['file']['name']); $Condition=$_POST['Condition']; $Status= $_POST['Status']; $sql="INSERT INTO ImageTable (Title,UserTitle,Type,Description,Condition, Status) VALUES ( '$files','$usertitle', '$type', '$Description','$Condition','$Status')"; if (!mysqli_query($con,$sql)) { die('MYSQL Error: ' . mysqli_error($con)); } If I echo out the $Condition and $Status i see the values selected in the form. Not sure what is going wrong with the insert statement. Thanks in advance
has answer: http://stackoverflow.com/a/24896431
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24896358
has answer: http://stackoverflow.com/a/24896408
has title: mysql insert fails on certain form fields
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/24896408

http://stackoverflow.com/q/24877290
type: AnsweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38639749
favorite count: 0
tagged with: ajax
linked to: http://stackoverflow.com/q/6506873
has answer: http://stackoverflow.com/a/24877339
type: Question
has comment: http://stackoverflow.com/comment/38639518
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has body: I was asked a question by a friend and I honestly for the life of my could not come up with a sure answer. So I pose it to you instead; If I have 2 documents (page.html and form.php), and I have included form.php in my page.html as so: Home <?php include 'form.php'; ?> <FORM CONTENT HERE> <?php echo $result_variable ?> Which has an AJAX form, POSTing to form.php, and a field for results, that prints the PHP variable $result_variable. Now if My PHP page takes the posted data, after the initial document load / include has been completed - then changes the value of $result_variable as a result - will the value of $result_variable be updated within the page.html without the page reloading? For example - if form.php looked something like this; <?php $result_variable = 1; if (!empty($_POST)){ $result_variable = 2; } ?> After the initial pageload (without form submission), $result_variable should yeild 1. Though after the ajax form submission has been completed, the $result_variable has been changed to 2. Will this reflect without reloading page.html? Thanks.
has comment: http://stackoverflow.com/comment/38639644
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/38639573
accepted answer: http://stackoverflow.com/a/24877339
tagged with: javascript
has title: Changing PHP variables after DOM load, will changes reflect?
has comment: http://stackoverflow.com/comment/38639481

http://stackoverflow.com/q/24854006
answer count: 3
tagged with: http://stackoverflow.com/tag/html
score: 0
has title: jAuery selection button
has answer: http://stackoverflow.com/a/24854080
tagged with: css
has answer: http://stackoverflow.com/a/24854166
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38594797
has body: I have table like this And I need do selection 7 buttons and more. with min and max. Like type="checkbox" or type="radio" but with type="button" (to do style button with css/css3) Here is example http://jsfiddle.net/n2RAh/ (now i can select only one)
type: Question
possible better answer: http://stackoverflow.com/a/24854046
accepted answer: http://stackoverflow.com/a/24854080
tagged with: javascript
has answer: http://stackoverflow.com/a/24854046
tagged with: jquery

http://stackoverflow.com/comment/38464070
type: Comment
score: 0
comment on: http://stackoverflow.com/a/24784716
has text: sorry, typo in the jquery. i need to concatenate '|' to all inputs from the form regardless of their name, id or class.
type: AnswerComment

http://stackoverflow.com/a/24777250
has comment: http://stackoverflow.com/comment/38450213
type: Answer
has body: JavaScript runs inside a sandbox that doesn't allow it to read files, you can try with the FileSystem API in HTML5 but that's also considered to become dead as browsers are not interested in supporting it.
score: 0
answers question: http://stackoverflow.com/q/24777201
has comment: http://stackoverflow.com/comment/38450003

http://stackoverflow.com/a/24749412
has body: you could create a helper in CI so that it can be used commonly, and add : function is_weekend($your_date) { $week_day = date('w', strtotime($your_date)); //returns true if Sunday or Saturday else returns false return ($week_day == 0 || $week_day == 6); } and use it if( is_weekend($date) ) { //its weekend do something } else { //its not weekend }
answers question: http://stackoverflow.com/q/24749337
type: Answer
has comment: http://stackoverflow.com/comment/38397806
accepted answer of: http://stackoverflow.com/q/24749337
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38397837
score: 1

http://stackoverflow.com/q/24788389
has comment: http://stackoverflow.com/comment/38471294
tagged with: javascript
has answer: http://stackoverflow.com/a/24788562
score: 4
has comment: http://stackoverflow.com/comment/38471393
favorite count: 0
answer count: 3
has comment: http://stackoverflow.com/comment/38471359
tagged with: regex
upvote count: 4
has title: Efficient string parsing in JS: How to create a substring which does not allocate a new string
has body: I have large messages coming over the websocket that I'd like to parse with a regex (for simplicity). The regex recognizes the format of the header, and upon reading the length field, we then know where the next segment lies, and I can run the regex on that portion. However, since my entire message might be huge (say... 10MB) and consisting of many many segments (say... 1000, where the average segment is a little under 1K in length), then naively slicing the main message to pass it back to re.exec() at the next location seems like it will result in a ton of GC thrashing, if not an allocation of gigabytes just for the raw string content. I wonder if there are any regex related functions which allow me to specify the index to start running the regex at? exec and search don't let me do this.
downvote count: 0
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/24788567
has comment: http://stackoverflow.com/comment/38471291
has answer: http://stackoverflow.com/a/24837148
has comment: http://stackoverflow.com/comment/38471366

http://stackoverflow.com/comment/38609103
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24861403
score: 0
has text: I see what you want to get, but what is wrong with the given code. Did you provide it to us for some particular reason?

cordova
tags question: http://stackoverflow.com/q/24881997
tags question: http://stackoverflow.com/q/24902116
tags question: http://stackoverflow.com/q/24758497
tags question: http://stackoverflow.com/q/24795215
tags question: http://stackoverflow.com/q/24778018
tags question: http://stackoverflow.com/q/24823034
tags question: http://stackoverflow.com/q/24773941
tags question: http://stackoverflow.com/q/24796595
tags question: http://stackoverflow.com/q/24892924
tags question: http://stackoverflow.com/q/24779751
tags question: http://stackoverflow.com/q/24822067
tags question: http://stackoverflow.com/q/24845075
tags question: http://stackoverflow.com/q/24854235
tags question: http://stackoverflow.com/q/24757125
tags question: http://stackoverflow.com/q/24898755
tags question: http://stackoverflow.com/q/24771581
tags question: http://stackoverflow.com/q/24861171
tags question: http://stackoverflow.com/q/24795253
tags question: http://stackoverflow.com/q/24836171
tags question: http://stackoverflow.com/q/24753638
tags question: http://stackoverflow.com/q/24904503
tags question: http://stackoverflow.com/q/24891756
tags question: http://stackoverflow.com/q/24798060
tags question: http://stackoverflow.com/q/24846280
tags question: http://stackoverflow.com/q/24848672
tags question: http://stackoverflow.com/q/24825577
tags question: http://stackoverflow.com/q/24792595
tags question: http://stackoverflow.com/q/24760832
tags question: http://stackoverflow.com/q/24762561
tags question: http://stackoverflow.com/q/24859325
tags question: http://stackoverflow.com/q/24799274
tags question: http://stackoverflow.com/q/24774720
tag name: cordova
tags question: http://stackoverflow.com/q/24819144
tags question: http://stackoverflow.com/q/24865973
tags question: http://stackoverflow.com/q/24906472
tags question: http://stackoverflow.com/q/24842830
tags question: http://stackoverflow.com/q/24782416
tags question: http://stackoverflow.com/q/24752971
tags question: http://stackoverflow.com/q/24822402
tags question: http://stackoverflow.com/q/24787105
tags question: http://stackoverflow.com/q/24779752
tags question: http://stackoverflow.com/q/24845228
tags question: http://stackoverflow.com/q/24855951
tags question: http://stackoverflow.com/q/24888795
tags question: http://stackoverflow.com/q/24892403
tags question: http://stackoverflow.com/q/24852790
tags question: http://stackoverflow.com/q/24820156
tags question: http://stackoverflow.com/q/24885254
tags question: http://stackoverflow.com/q/24905766
tags question: http://stackoverflow.com/q/24790566
tags question: http://stackoverflow.com/q/24861242
tags question: http://stackoverflow.com/q/24825460
tags question: http://stackoverflow.com/q/24789858
tags question: http://stackoverflow.com/q/24870520
tags question: http://stackoverflow.com/q/24801460
tags question: http://stackoverflow.com/q/24799979
tags question: http://stackoverflow.com/q/24824874
tags question: http://stackoverflow.com/q/24758847
tags question: http://stackoverflow.com/q/24855130
tags question: http://stackoverflow.com/q/24885246
tags question: http://stackoverflow.com/q/24898278
tags question: http://stackoverflow.com/q/24821312
tags question: http://stackoverflow.com/q/24823874
tags question: http://stackoverflow.com/q/24837670
tags question: http://stackoverflow.com/q/24866367
tags question: http://stackoverflow.com/q/24798902
tags question: http://stackoverflow.com/q/24851132
tags question: http://stackoverflow.com/q/24805389
tags question: http://stackoverflow.com/q/24825485
tags question: http://stackoverflow.com/q/24762814
tags question: http://stackoverflow.com/q/24873207
tags question: http://stackoverflow.com/q/24864753
type: Tag
tags question: http://stackoverflow.com/q/24831328
tags question: http://stackoverflow.com/q/24878164
tags question: http://stackoverflow.com/q/24876586
tags question: http://stackoverflow.com/q/24838033
tags question: http://stackoverflow.com/q/24819966
tags question: http://stackoverflow.com/q/24844355

http://stackoverflow.com/comment/38529557
type: QuestionComment
comment on: http://stackoverflow.com/q/24818889
has text: actually i want my boxes looks like this, Suresh https://d8e7ec01-a-62cb3a1a-s-sites.googlegroups.com/site/vanyfiles/looks%20like%20this.jpg?attachauth=ANoY7co9tKXkFtsohysfYpFUzthUqmNTu3C3ckkAmBqzTcQnvoxFGWRCkRFEEDxFy8USFh7rMVAuexF8allM9fUTn6KLRY8jLNaHkgZPeGbfCO77xpbXzRoIWPZLbi13A2zzQ9NaXp4sijL80xWtwmlGZxqtqa29zmlhrH4aDR8l3QWiFTTQgSofKjyDCXRf5d5ACVe-OnforWqHElTTIly98C5quOr7Mw%3D%3D&attredirects=1
score: 0
type: Comment

http://stackoverflow.com/q/24834818
tagged with: arrays
tagged with: javascript
tagged with: jquery
answer count: 1
accepted answer: http://stackoverflow.com/a/24834882
downvote count: 0
favorite count: 0
has body: I have a JSON array in localstorage. I want to retrieve this array, and display the values. The storage key is _myobject, and the value is [{"64508":"12:12:2"},{"5292":"12:17:34"}] What I want is to know how I can use JavaScript/jQuery to display/print the values in the following format: Number: 64508 - Time: 12:12:2 Number: 5292 - Time: 12:17:34 Could somebody please direct me on how I could do this?
tagged with: local-storage
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
has answer: http://stackoverflow.com/a/24834882
type: Question
has title: Display JSON Array in HTML

http://stackoverflow.com/comment/38413620
score: 0
comment on: http://stackoverflow.com/q/24758006
type: Comment
type: QuestionComment
has text: Well, your example works fine for me.. it's displaying dataLabel at 51. However, this may be caused by [`dataGrouping`](http://api.highcharts.com/highstock#plotOptions.series.dataGrouping.enabled). Try to disable it and we will see.

http://stackoverflow.com/q/24831284
tagged with: javascript
tagged with: string
has body: I think this is kind of unusual, but this is what I came to. I have a .net application that generates html + js page. I have a thing called Unit that is kind of assembly of different html elements and has artificial events onlaod and onunload. function DisplayableUnit(content, onload_js, onunload_js) { this.onload_js = onload_js; //different functions calls like "f1(); f2();" this.onunload_js = onunload_js; this.content = content; //string of html tags } function loadUnitTo(elem_id, unit) { var elem = document.getElementById(elem_id); if (elem) elem.innerHTML = unit.content; if (unit.onload_js) ;//how to execute it? } Many sites says that eval is bad and unsafe thing. But is that the only choice? I need pure JS solution without any third party things.
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24831356
score: 0
has title: How to execute function calls that passed in JS function as string without eval?
type: Question
tagged with: execute
has answer: http://stackoverflow.com/a/24831356
linked to: http://stackoverflow.com/q/939326
answer count: 1
has comment: http://stackoverflow.com/comment/38553174

http://stackoverflow.com/q/24780406
accepted answer: http://stackoverflow.com/a/24780432
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
tagged with: forms
has comment: http://stackoverflow.com/comment/38455281
type: Question
has body: I am trying to change the innerHTML of a label. I do not have access to the form so cannot edit the HTML. The only identifier that the label has is the "for" attribute. Here is the structure of the input and label: I'd like to change this label text!
has answer: http://stackoverflow.com/a/24780432
tagged with: javascript
has title: Use javascript to change a form label content using the for attribute
tagged with: label
score: 0
answer count: 1
tagged with: jquery

http://stackoverflow.com/q/24896631
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/24896734
type: Question
tagged with: javascript
score: 0
answer count: 1
tagged with: postman
has title: Reading JSON request values in Node.js
tagged with: node.js
type: AnsweredQuestion
has body: I have a web service written in node. I can successfully call this endpoint. Its setup like this: myWebService: function(req, res) { console.log('Request received.'); console.log(req); } I can successfully pass values via the header. However, I'm trying to figure out how to send raw JSON from Postman to the web service. In Postman, I've clicked the "Raw" tab, and selected JSON from the drop down list. I'm passing in some JSON that looks like this: { v1:2, v2:'?', v3:'Some string of text', v4:['value 1', 'value 2'], v5:{param1:"p1Value", param2:3 } } When the request from Postman is received, the request does not have the JSON in it. My endpoint is defined like this: app.post('/api/myWebService', api.myWebService); I know its working because 'Request received' is printing. In addition, I can see the request contents, including the header variables. I'm not sure why the JSON values aren't printing. If I enter key/value pairs into the x-www-form-urlencodded tab, I can see those values in the req.body variable. However, I would like to make this as clean as possible and send pure JSON if possible. What am I doing wrong?
has answer: http://stackoverflow.com/a/24896734

http://stackoverflow.com/a/24790054
answers question: http://stackoverflow.com/q/24769578
type: Answer
has body: have you tried JSON.parse('${line}');? I'm not familiar with your exact case but I believe that will turn a string containing JSON into JSON. Is there any console error?
score: 0
has comment: http://stackoverflow.com/comment/38475042
accepted answer of: http://stackoverflow.com/q/24769578
has comment: http://stackoverflow.com/comment/38474847
type: AcceptedAnswer

http://stackoverflow.com/comment/38469852
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24787641
has text: Seconding @Felix Kling's recommendation. AJAX allows one to reach out to the server for more information including JSON, HTML, etc. which can in turn be used to alter your existing view programmatically.

http://stackoverflow.com/comment/139865764
type: Comment
comment on: http://stackoverflow.com/a/30230740
has text: What is "myDropzone" and where is it defined?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38397821
comment on: http://stackoverflow.com/q/24749444
type: Comment
has text: Can you open the 'Network' tab of your browser's developer tools and look at the response headers after you send the post request?
type: QuestionComment
score: 0

http://stackoverflow.com/q/24890296
tagged with: canvas
tagged with: tiles
has answer: http://stackoverflow.com/a/24890581
answer count: 1
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: HTML5 Canvas tile based map not showing up
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24890581
linked to: http://stackoverflow.com/q/10807230
score: 1
upvote count: 1
type: Question
tagged with: javascript
has body: I am new to html5 canvas game dev and I am having a probably newbie problem. I am making a tile based map that is supposed to turn a 2d array into a map with walls and open space, but whenever I open the game it just doesn't show up... I don't even get errors!? Please help me ( I am using chrome BTW ) pastebin code: http://pastebin.com/5GcQwCVa# // Declares global variables var canvas = document.createElement("canvas"); c = canvas.getContext("2d"), make = {}, maps = {}, width = 800, height = 600; // Creates the requestAnimationFrame variable (function () { var requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame; window.requestAnimationFrame = requestAnimationFrame; }) (); // Modifies the canvas' properties canvas.width = width, canvas.height = height; // 2D arrays that make up maps maps = { one: [ ["w","w","w","w","w","w","w","w"], ["w","o","o","o","o","o","o","w"], ["w","o","w","w","w","w","o","w"], ["w","o","w","o","o","o","o","w"], ["w","o","w","o","w","o","o","w"], ["w","o","w","o","o","w","o","w"], ["w","o","o","o","o","o","o","w"], ["w","w","w","w","w","w","w","w"] ], two: [ ["w","w","w","w","w","w","w","w"], ["w","o","o","o","o","o","o","w"], ["w","o","o","o","o","o","o","w"], ["w","o","o","o","o","o","o","w"], ["w","o","o","o","o","o","o","w"], ["w","o","o","o","o","o","o","w"], ["w","o","o","o","o","o","o","w"], ["w","w","w","w","w","w","w","w"] ] }; // Maps drawing functions make = { map: function ( map2d ) { var i, j, tile, tilesX = 8, tilesY = 8; for (i = 0; i &lt; tilesX; i++) { for(j = 0; j &lt; tilesY; j++) { if (map2d[i][j] === "w") { this.tile(i * 64, j * 64); } } } }, tile: function (x, y, TD) { switch (TD) { case "w": c.rect(x, y, 64, 64); c.fillStyle = wallColor; c.fill(); c.lineWidth = 8; c.strokeStyle = "black"; c.stroke(); break; case "o": c.rect(x, y, 64, 64); c.fillStyle = "white"; c.fill(); c.lineWidth = 8; c.strokeStyle = "white"; c.…

http://stackoverflow.com/a/24839961
answers question: http://stackoverflow.com/q/24839929
score: 0
type: Answer
has body: window.dispatchEvent('onload'); window.dispatchEvent('onunload'); Quoting from the MDN article for .dispatchEvent: Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) apply to events dispatched manually with dispatchEvent().

http://stackoverflow.com/q/24859083
has answer: http://stackoverflow.com/a/24861561
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: jquery
favorite count: 0
type: Question
upvote count: 2
accepted answer: http://stackoverflow.com/a/24861561
has body: I need to implement a service like whenever a next or previous is clicked in pagination the browser should save the state so that while doing browser back it goes back to last accessed page. Currently it is happening like when I enter any url in new tab page and in pagination if I click on next button, further I click browser back button it is going to new tab page. Anybody please suggest how to achieve this. I have tried following public class ShortenLastPagePager extends SimplePager implements ValueChangeHandler&lt;String&gt; { private int pageSize; public ShortenLastPagePager( TextLocation location, Resources resources, boolean showFastForwardButton, int fastForwardRows, boolean showLastPageButton, int pageSize ) { super( location, resources, showFastForwardButton, fastForwardRows, showLastPageButton ); this.pageSize = pageSize; } @Override public void setPageSize( int pageSize ) { this.pageSize = pageSize; } @Override public void setPageStart( int index ) { if ( getDisplay() != null ) { Range range = getDisplay().getVisibleRange(); int myPageSize = 0; index = Math.min( index, getDisplay().getRowCount() ); index = Math.max( 0, index ); myPageSize = Math.min( pageSize, getDisplay().getRowCount() - index ); if ( index != range.getStart() || myPageSize != range.getLength() ) { getDisplay().setVisibleRange( index, myPageSize ); } } } @Override public void nextPage() { if ( getDisplay() != null ) { Range range = getDisplay().getVisibleRange(); setPageStart( range.getStart() + range.getLength() ); } } @Override public void previousPage() { if ( getDisplay() != null ) { Range range = getDisplay().getVisibleRange(); setPageStart( range.getStart() - pageSize ); } } @Override public void lastPage() { int remainder = getDisplay().getRowCount() % pageSize; if ( remainder &gt; 0 ) { setPageStart( getDisplay().getRowCount() - remainder ); } else { if ( getDisplay().getRowCount() / pageSize &gt; 0 ) { setPageStart( getDisplay().getRowCount() - pageSize ); } else { setPageStart(…
has comment: http://stackoverflow.com/comment/38604949
has comment: http://stackoverflow.com/comment/38606842
tagged with: java
answer count: 1
tagged with: gwt
has comment: http://stackoverflow.com/comment/38608142
has title: GWT SimplePager - Add History for every next and previous
tagged with: javascript

http://stackoverflow.com/a/24819919
answers question: http://stackoverflow.com/q/24819768
has body: Try placing your jquery functions in document.ready like: $( document ).ready(function() { $('#priceSliderMin').change(function(event){ $('#priceTextMin').prop('value', parseInt($('#priceSliderMin').prop('value'))); }); $('#priceTextMin').keyup(function(event){ $('#priceSliderMin').prop('value', parseInt($('#priceTextMin').prop('value'))) }) }); Its just a thought... Best of luck
type: Answer
score: 0
has comment: http://stackoverflow.com/comment/38530156

http://stackoverflow.com/comment/38545773
type: Comment
has text: yeah i may have not done it in that example, thought i did, but i have like 3 of them trying different things. When I implemeet your code into the demo I gave it no longer lets me scroll on the iphone. i'm going to look into this, so hopefully you gave me a good step in the right direction.
type: AnswerComment
comment on: http://stackoverflow.com/a/24817968
score: 0

http://stackoverflow.com/comment/38498697
comment on: http://stackoverflow.com/a/24803347
type: AnswerComment
has text: To add to this answer, this is from the angular documentation: "As the name suggests, the isolate scope of the directive isolates everything except models that you've explicitly added to the scope: {} hash object. This is helpful when building reusable components because it prevents a component from changing your model state except for the models that you explicitly pass in."
type: Comment
score: 0

http://stackoverflow.com/q/24881010
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/38648763
score: 1
has title: Copy specific column textbox value to another textbox in Javascript
tagged with: mysql
has body: Table name: editionmaster Columns: name, edition I am fetching all edition in a table using for loop, and below every edition there is a copy button. Times Of India hitwada - Dak +------+ +------+ | copy | | Copy | +------+ +------+ Now I want to copy editionname to another textbox on copy button click but the problem is that it only copies only first column editionname. For example, if I click copy button below timesofindia edition, then it copies only timesofindia and if I click copy button below hitwada then it copies only hitwada to another textbox. Please suggest me. Below is my code: <?php foreach($rows as $row) { ?> <?php echo $row["Edition"]; ?> <?php } ?> Submit <?php foreach($rows as $row){?> copy <?php } ?>
type: Question
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38648163
favorite count: 0

http://stackoverflow.com/comment/38669154
type: AnswerComment
score: 0
has text: Thanks but this doesn't seem to work for me. I was initially following the video course tutorial through the Angular website (actually on Code School) which doesn't use $scope. After trying your method, I don't get the logged result, I just get nothing in the console.
type: Comment
comment on: http://stackoverflow.com/a/24893097

http://stackoverflow.com/comment/38646004
has text: each template is just a view with an ng-controller attribute at the top div. no ng-app or ng-csp. There are situations where I need to inject two templates onto one page, so I can't add ng-app to the templates. It worked when I was using requirejs, but doesn't seem to work now.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24879374

http://stackoverflow.com/comment/38659625
score: 0
type: Comment
type: AnswerComment
has text: try to remove `#` from `<form action="#"`
comment on: http://stackoverflow.com/a/24888141

http://stackoverflow.com/comment/38670396
type: Comment
comment on: http://stackoverflow.com/a/24893079
has text: Now I'm completely lost...
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38567814
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24839512
has text: I see, but my problem is that I am not the one that is writting the string in the code. The string comes from my back-end and I have just the searchId variable with it's appropriate value at that point. I cannot do 'searchId' for obvious reasons. How can I make the quatation on the variable to make your example work? Thanks again for the time!
score: 0

http://stackoverflow.com/comment/38533678
comment on: http://stackoverflow.com/q/24821400
score: 0
has text: ok..first of all do u know how ajax works?
type: QuestionComment
type: Comment

http://stackoverflow.com/q/24770013
answer count: 1
favorite count: 0
has title: Javascript functions within Dojo script run without being called
tagged with: dojo
type: AnsweredQuestion
downvote count: 0
tagged with: onclick
score: 1
has answer: http://stackoverflow.com/a/24770042
accepted answer: http://stackoverflow.com/a/24770042
has body: I am feeling quite stupid about this, but I have a named function within my main Dojo require script that my intention was to run when called by a click event. However, the function runs on loading the page and does not run on the click event. Click Here To Test As soon as the page loads the "test" alert pops up and nothing happens on the click event.
type: Question
tagged with: function
tagged with: javascript
tagged with: esri
upvote count: 1

http://stackoverflow.com/comment/38543562
has text: No, it just breaks out of the loop. It's returning from that inner `function()` within `each()`. The outer `return result;` still holds, but now it will have something useful to return.
comment on: http://stackoverflow.com/a/24826946
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/24777201
has body: can I read the contents of a file from a certain folder using javascript??I have been trying so much research but all gives me the browse but I don't want to browse,I have the file name and folder name, and I want to have the contents of this file only.how could that happen if possible I found this solution,but don't know what is the fs?? function onInitFs(fs) { fs.root.getFile('log.txt', {}, function(fileEntry) { // Get a File object representing the file, // then use FileReader to read its contents. fileEntry.file(function(file) { var reader = new FileReader(); reader.onloadend = function(e) { var txtArea = document.createElement('textarea'); txtArea.value = this.result; document.body.appendChild(txtArea); }; reader.readAsText(file); }, errorHandler); }, errorHandler); } window.requestFileSystem(window.TEMPORARY, 1024*1024, onInitFs, errorHandler);
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/24777393
type: UnansweredQuestion
has title: reading a file from folder using javascript
score: -4
has answer: http://stackoverflow.com/a/24777250
linked to: http://stackoverflow.com/q/5028931
duplicate of: http://stackoverflow.com/q/5028931
type: Question
answer count: 2
downvote count: 4
upvote count: 0

http://stackoverflow.com/comment/38506953
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24807579
score: 1
has text: + 1 but there's no need to unregister with every keypress. OP should just check if it's already set. No need to keep rescheduling it. See http://jsbin.com/cidimuso/1

http://stackoverflow.com/q/24811212
accepted answer: http://stackoverflow.com/a/24811395
has comment: http://stackoverflow.com/comment/38513940
type: Question
has body: Is to make a "splice" in a value of "return" of the "Template" Example: Template.create.values = function () { return [{ 'value1': '1', 'value2': '2', 'value3': '3', }]; }; Template.create.events({ 'click #add': function () { Template.create.values.splice(Template.create.values.length, 0, { 'value1': '1', 'value2': '2', 'value3': '3', }); } }); I'm doing a "each" in "Template.create.events", and automatically change the template?
tagged with: javascript
score: 0
answer count: 1
tagged with: meteor
has title: Splice in MeteorJS
has answer: http://stackoverflow.com/a/24811395
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/q/24811453
linked to: http://stackoverflow.com/q/4597487
has body: I keep hitting internal service 500 error and the reason is Call to a member function move() on a non-object when trying to access the Input::file('uploadname'); method. If I do a var dump using the following code: echo '&lt;pre&gt;'; var_dump(Input::all()); echo '&lt;/pre&gt;'; I get the output that there is data in the field, but when accessing the Input::hasFile('uploadname'); it gives false? Here is the form code: &lt;div id="div123"&gt; &lt;input type="button" value="Upload CV" class="uploadCV"&gt; &lt;/div&gt; &lt;div id="uploadbutton"&gt; &lt;input type="file" name="upload_cv_company_rep" class="cv" id="upload_cv_company_rep"/&gt; &lt;/div&gt; The button is displayed, when you click it, it triggers the input type="file" stuff. It shows the following var_dump in the console: and the code in my controller is: public function uploadUser() { if(Input::hasFile('upload_cv_company_rep')) { Input::file('upload_cv_company_rep')-&gt;move('uploads/'); } else { echo '&lt;pre&gt;'; var_dump(Input::all()); echo '&lt;/pre&gt;'; } } here is the ajax part: $("#upload_employee_form").submit(function(e){ // e.preventDefault(); // alert("hey"); var d = new FormData(document.getElementById('upload_employee_form')); d.append('password', $('.password').val()); d.append('referencecode', $('.ref_code').val()); console.log(d); $.ajax({ url: '/laravel/rsms/public/company-representative-create-user', data: d, type: 'POST', processData: false, success: function(res) { console.log(res); alert("Success!"); }, error: function() { alert("Something went wrong!"); } }); return false; });
has title: Call to a member function move() on a non-object Laravel 4 file upload
answer count: 1
has comment: http://stackoverflow.com/comment/38515861
has comment: http://stackoverflow.com/comment/38524933
has answer: http://stackoverflow.com/a/24813318
tagged with: php
has comment: http://stackoverflow.com/comment/41184395
tagged with: laravel
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24813318
has comment: http://stackoverflow.com/comment/38514676
type: Question
tagged with: laravel-4
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/a/24853165
has body: I think that the main problem is this part: "select each Alphabet and use it in Different Places Like..." so the solution is to use .charAt() function. Click the button to display. Try it
answers question: http://stackoverflow.com/q/24853041
score: 0
has comment: http://stackoverflow.com/comment/38593109
type: Answer

http://stackoverflow.com/comment/38489854
type: Comment
comment on: http://stackoverflow.com/q/24797268
has text: I can see the following: [link](https://dl.dropboxusercontent.com/u/12017775/jsFiddle/2014-07-17%2010_21_55-Edit%20fiddle%20-%20JSFiddle.png). Time changes take no effect. Positioning either.
score: 0
type: QuestionComment

http://stackoverflow.com/a/24812020
has comment: http://stackoverflow.com/comment/38544597
type: Answer
has comment: http://stackoverflow.com/comment/38515540
answers question: http://stackoverflow.com/q/24811645
downvote count: 1
upvote count: 4
has body: This command: gsutil mv gs://my_bucket/olddir gs://my_bucket/newdir will do the job. If you have a large number of files you need to do a multi-processing move, so use this command: gsutil -m mv gs://my_bucket/olddir gs://my_bucket/newdir You can find this information in the docs.
has comment: http://stackoverflow.com/comment/38578838
score: 3

http://stackoverflow.com/q/24885153
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38653558
has comment: http://stackoverflow.com/comment/38653535
type: Question
has body: I am using jquery not to remove html of elements. I don't get jQuery not() work in proper way. It removes all elements from children except the last one that I mentioned. My Html- &lt;body&gt; &lt;div id="edit-save-section"&gt; &lt;button id="edit-button" class="btn btn-info btn-large"&gt; &lt;span&gt;&lt;i class="fa fa-cog"&gt;&lt;/i&gt;&amp;nbsp;EDIT&lt;/span&gt; &lt;/button&gt; &lt;button class="division-twenty btn btn-success btn-large" data-loading-text="Saving..." class="btn btn-primary" id="btn_save"&gt;&lt;span&gt;&lt;i class="fa fa-save"&gt;&lt;/i&gt;&amp;nbsp;SAVE&lt;/span&gt; &lt;/button&gt; &lt;/div&gt; &lt;nav id="menu"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="javascript:;"&gt;Link1&lt;/a&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="javascript:;"&gt;Link2&lt;/a&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="javascript:;"&gt;Link3&lt;/a&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="javascript:;"&gt;Link4&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/nav&gt; &lt;div class="removable-section"&gt; &lt;a href="javascript:;" class=" pull-right span1 handle" rel="tooltip" title="Arrange section" data-placement="left"&gt;&lt;b&gt;&lt;i class="fa fa-arrows fa-2x"&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt; &lt;a class="span1 pull-right remove-section-action" rel="tooltip" title="Remove section" data-placement="left" href="javascript:;"&gt;&lt;b&gt;&lt;i class="fa fa-times fa-2x"&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt; &lt;/div&gt; &lt;div id="allhtml"&gt;&lt;/div&gt; &lt;/body&gt; Clearing html with jQuery- $('#btn_save').click(function () { var notAll = $('body').children().not("#menu", ".removable-section", "#edit-save-section").html(); $('#allhtml').append(notAll); console.log($('#allhtml').html()); }); Somehow I managed removing #menu and .removable-section , But I can't remove #edit-save-section And If i try to change order of these sections like- var notAll = $('body').children().not("#menu","#edit-save-section",".removable-section").html(); Then it acts weird. It doesn't remove from body the last children…
has comment: http://stackoverflow.com/comment/38653717
has comment: http://stackoverflow.com/comment/38653496
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38654571
has answer: http://stackoverflow.com/a/24885902
accepted answer: http://stackoverflow.com/a/24885902
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: jquery not() function not working on all elements
has comment: http://stackoverflow.com/comment/38653536
has comment: http://stackoverflow.com/comment/38653780

forms
tags question: http://stackoverflow.com/q/24774997
tags question: http://stackoverflow.com/q/24821761
tags question: http://stackoverflow.com/q/24837813
tags question: http://stackoverflow.com/q/24892437
type: Tag
tags question: http://stackoverflow.com/q/24767373
tags question: http://stackoverflow.com/q/24794298
tags question: http://stackoverflow.com/q/24780406
tags question: http://stackoverflow.com/q/24827062
tags question: http://stackoverflow.com/q/24879234
tags question: http://stackoverflow.com/q/24851068
tags question: http://stackoverflow.com/q/24818862
tags question: http://stackoverflow.com/q/24793571
tags question: http://stackoverflow.com/q/24865991
tags question: http://stackoverflow.com/q/24879446
tags question: http://stackoverflow.com/q/24837443
tags question: http://stackoverflow.com/q/24824066
tags question: http://stackoverflow.com/q/24845698
tags question: http://stackoverflow.com/q/24816040
tags question: http://stackoverflow.com/q/24816213
tags question: http://stackoverflow.com/q/24760249
tags question: http://stackoverflow.com/q/24843457
tags question: http://stackoverflow.com/q/24763016
tags question: http://stackoverflow.com/q/24790893
tags question: http://stackoverflow.com/q/24792969
tags question: http://stackoverflow.com/q/24799167
tags question: http://stackoverflow.com/q/24865473
tags question: http://stackoverflow.com/q/24787007
tags question: http://stackoverflow.com/q/24829266
tags question: http://stackoverflow.com/q/24827995
tags question: http://stackoverflow.com/q/24850345
tags question: http://stackoverflow.com/q/24837945
tags question: http://stackoverflow.com/q/24833945
tags question: http://stackoverflow.com/q/24846608
tags question: http://stackoverflow.com/q/24770480
tags question: http://stackoverflow.com/q/24843776
tags question: http://stackoverflow.com/q/24861375
tags question: http://stackoverflow.com/q/24845557
tags question: http://stackoverflow.com/q/24765784
tags question: http://stackoverflow.com/q/24893836
tags question: http://stackoverflow.com/q/24816026
tags question: http://stackoverflow.com/q/24804607
tags question: http://stackoverflow.com/q/24827533
tags question: http://stackoverflow.com/q/24787865
tags question: http://stackoverflow.com/q/24777033
tags question: http://stackoverflow.com/q/24784380
tags question: http://stackoverflow.com/q/24749432
tags question: http://stackoverflow.com/q/24784674
tags question: http://stackoverflow.com/q/24809327
tags question: http://stackoverflow.com/q/24846852
tags question: http://stackoverflow.com/q/24797676
tags question: http://stackoverflow.com/q/24829026
tags question: http://stackoverflow.com/q/24858336
tags question: http://stackoverflow.com/q/24900781
tag name: forms
tags question: http://stackoverflow.com/q/24828560
tags question: http://stackoverflow.com/q/24829037
tags question: http://stackoverflow.com/q/24839145
tags question: http://stackoverflow.com/q/24777425
tags question: http://stackoverflow.com/q/24869499
tags question: http://stackoverflow.com/q/24762611
tags question: http://stackoverflow.com/q/24843175
tags question: http://stackoverflow.com/q/24829491
tags question: http://stackoverflow.com/q/24758669
tags question: http://stackoverflow.com/q/24854265
tags question: http://stackoverflow.com/q/24759718
tags question: http://stackoverflow.com/q/24834089
tags question: http://stackoverflow.com/q/24839009
tags question: http://stackoverflow.com/q/24817327
tags question: http://stackoverflow.com/q/24863439
tags question: http://stackoverflow.com/q/24853059
tags question: http://stackoverflow.com/q/24766452
tags question: http://stackoverflow.com/q/24778208
tags question: http://stackoverflow.com/q/24868628
tags question: http://stackoverflow.com/q/24808506

http://stackoverflow.com/q/24757917
upvote count: 2
has comment: http://stackoverflow.com/comment/38417043
type: Question
has answer: http://stackoverflow.com/a/24758317
tagged with: javascript
tagged with: caching
accepted answer: http://stackoverflow.com/a/24758317
has answer: http://stackoverflow.com/a/36741442
answer count: 2
score: 2
downvote count: 0
has title: How to use AngularJS $templateCache.get()?
possible better answer: http://stackoverflow.com/a/36741442
favorite count: 0
tagged with: angularjs
tagged with: templates
has body: I need to cache some HTML files when my Angular controller initializes. According to Angular $templateCache documentation I can add HTML templates to Angular with: $templateCache.get('templateId.html') But I can't get this to work. I've tried to get the template file within the controller and within the module run() function (Plunker). But I can see in the network console that the template is not fetched. app.run(function($templateCache) { $templateCache.get('templ.html'); }); What am I doing wrong?
type: AnsweredQuestion

http://stackoverflow.com/comment/38427957
comment on: http://stackoverflow.com/a/24765495
type: Comment
has text: @simpleclick exactly, and of course the conditional statement continues to check if `self.options.callback.call(self)` returns true.
type: AnswerComment
score: 0

http://stackoverflow.com/a/24983686
score: 1
answers question: http://stackoverflow.com/q/24818862
upvote count: 1
downvote count: 0
has body: &lt;form id="language_form"&gt; &lt;select name="language" id="language"&gt; &lt;option value="en" selected="selected"&gt;English&lt;/option&gt; &lt;option value="sp"&gt;Spanish&lt;/option&gt; &lt;option value="hi"&gt;Hindi&lt;/option&gt; &lt;/select&gt; &lt;input type="submit" value="Submit"&gt; &lt;/form&gt; &lt;!-- Modal markup --&gt; &lt;div class="modal fade" id="language-confirmation"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;span class="sr-only"&gt;Close&lt;/span&gt;&lt;/button&gt; &lt;h4 class="modal-title"&gt;Modal title&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;p&gt;Do you really want to change the website language?&lt;/p&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" data-dismiss="modal" class="btn btn-default" id="accept-language-change"&gt;Yes&lt;/button&gt; &lt;button type="button" data-dismiss="modal" class="btn btn-primary" id="reject-language-change"&gt;No&lt;/button&gt; &lt;/div&gt; &lt;/div&gt;&lt;!-- /.modal-content --&gt; &lt;/div&gt;&lt;!-- /.modal-dialog --&gt; &lt;/div&gt;&lt;!-- /.modal --&gt; &lt;script&gt; var current_language = 'en'; // {{ user.get_profile.language_preference }} var languageChangeAccepted = false; $('#language_form').on('submit', function(e) { var selected_lang = $('#language option:selected').val(); if(current_language != selected_lang &amp;&amp; !languageChangeAccepted){ e.preventDefault(); // ask for confirmation $('#language-confirmation').modal({'show': true}); } }); $('#language').change(function(){ languageChangeAccepted = false; }) $('#accept-language-change').click(function(){ languageChangeAccepted = true; $('#language_form').submit(); }); $('#reject-language-change').click(function(){ languageChangeAccepted = false; }); &lt;/script&gt; FIDDLE
type: Answer

http://stackoverflow.com/comment/38531358
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24820416
has text: No, look at the question "What can i do to get zero[] to work outside the function?" — there are no scoping issues with accessing `zero`, just timing ones caused by Ajax.
score: 0

http://stackoverflow.com/a/68486864
score: 1
answers question: http://stackoverflow.com/q/24900875
upvote count: 1
has body: JavaScript arrow functions are roughly the equivalent of lambda functions in python or blocks in Ruby. These are anonymous functions with their own special syntax and operate in the context of their enclosing scope. This mean they do not have their own "this" but instead access the one from the immediate enclosing function. From the ECMA standard: An ArrowFunction does not define local bindings for arguments, super, this, or new.target. Any reference to arguments, super, this, or new.target within an ArrowFunction must resolve to a binding in a lexically enclosing environment. Typically this will be the Function Environment of an immediately enclosing function. Often you can read "an arrow function expression is a compact alternative to a traditional function expression", this is not a correct. Arrow function are NOT a shorthand for traditional function, they behave differently that traditional function. Syntax // Traditional Function // Create their own scope inside the function function (a){ return a + 100; } // Arrow Function // Do NOT create their own scope // (Each step along the way is a valid "arrow function") // 1. Remove the word "function" and place arrow between the argument and opening body bracket (a) => { return a + 100; } // 2. Remove the body braces and word "return" -- the return is implied. (a) => a + 100; // 3. Remove the argument parentheses (only valid with exactly one argument) a => a + 100;
type: Answer
has comment: http://stackoverflow.com/comment/121068919
has comment: http://stackoverflow.com/comment/121037394
has comment: http://stackoverflow.com/comment/121037291
has comment: http://stackoverflow.com/comment/121037526
downvote count: 0

http://stackoverflow.com/a/24751677
type: Answer
score: 0
answers question: http://stackoverflow.com/q/24751532
has body: You can do it using jQuery and Ajax. Example: $.ajax({ url: "test.php", data: {"test": 123}, type: "POST", success: function(data){ alert(data); } }); //test.php if(isset($_POST['test'])) echo $_POST['test']; In the success function, you can do anything you want with the data variable, which contains the contents of the page where you sent a request to (in this case: 123) A tutorial which might help you: http://blog.teamtreehouse.com/beginners-guide-to-ajax-development-with-php

http://stackoverflow.com/q/24777783
accepted answer: http://stackoverflow.com/a/24777831
has body: I am having a strange issue. I have created a code snippet where the user can create dynamic input elements and remove them as well When I click the remove class then it's not triggering the onclick event. &lt;input type='button' value='Add Button' id='addButton'&gt; &lt;div id="TextBoxesGroup"&gt;&lt;/div&gt; I have created a jsFiddle http://jsfiddle.net/squidraj/b4Cs8/2/
has comment: http://stackoverflow.com/comment/38450755
type: Question
linked to: http://stackoverflow.com/q/203198
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Issue with jquery onclick (not triggering)
score: 0
tagged with: onclick
duplicate of: http://stackoverflow.com/q/203198
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24777831

http://stackoverflow.com/comment/38415814
type: AnswerComment
comment on: http://stackoverflow.com/a/24758846
has text: Thanks for this awesome elaborated guide, I will test it once I get a chance and come back with the results.
type: Comment
score: 0

http://stackoverflow.com/comment/38714846
type: Comment
comment on: http://stackoverflow.com/a/24877226
type: AnswerComment
has text: I think not much different compare to watch. You might want to compare number of listener register in between ng-change and watch. I think is the same.
score: 0

http://stackoverflow.com/q/24751621
linked to: http://stackoverflow.com/q/10429164
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/10429164
accepted answer: http://stackoverflow.com/a/24753392
type: Question
tagged with: javascript
score: 0
has body: I need to embed a Javscript component (e.g. a Stripe pay button https://stripe.com/docs/checkout ) in my ember app, but apparently I can’t simply put a script tag inside the handlebar script tag.. any suggestion on how this can be done please?
answer count: 1
has comment: http://stackoverflow.com/comment/38404201
tagged with: stripe-payments
has answer: http://stackoverflow.com/a/24753392
tagged with: handlebars.js
tagged with: ember.js
has title: Show a JS script component in Ember/handlebars app

http://stackoverflow.com/comment/115887387
score: 0
type: Comment
has text: $('#grid .k-virtual-scrollable-wrap').scroll(function () { console.log("I am scrolling"); }); // You missed the grid name b4 the .k-virtual
type: AnswerComment
comment on: http://stackoverflow.com/a/41287958

http://stackoverflow.com/q/24781228
type: Question
has answer: http://stackoverflow.com/a/26766041
tagged with: javascript
linked to: http://stackoverflow.com/q/25435329
has body: Which is the best way to override or apply patches on a package, that is added to my project by using bower? In my Sass folder I have a vendor_overrides folder, I'm ok with that, but how to handle javascripts? Fork the project and then install that with bower?
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/26766041
upvote count: 8
tagged with: bower
type: AnsweredQuestion
has title: Bower: How to patch a package or apply overrides?
score: 7
downvote count: 1

http://stackoverflow.com/comment/38493851
has text: @GôTô Why don't you add this as an answer instead of a comment?
score: 0
comment on: http://stackoverflow.com/q/24797482
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24839941
score: 0
answers question: http://stackoverflow.com/q/24839881
type: Answer
has body: I don't know why i didn't see the very simple solution before.. the action's interceptors.response function's argument has both the data property wich is the simple jshash/array and the resource property wich is the action's method returned object with all resources already instantiated ! That's all!

http://stackoverflow.com/q/24819753
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24820072
answer count: 4
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24820608
has comment: http://stackoverflow.com/comment/38530032
has answer: http://stackoverflow.com/a/24820073
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38529975
type: Question
possible better answer: http://stackoverflow.com/a/24820034
tagged with: javascript
has comment: http://stackoverflow.com/comment/38530161
has comment: http://stackoverflow.com/comment/38530741
has comment: http://stackoverflow.com/comment/38530854
has answer: http://stackoverflow.com/a/24820034
has comment: http://stackoverflow.com/comment/38530105
has answer: http://stackoverflow.com/a/24820608
downvote count: 0
has title: Highlight text word by word in a sentence on button click using javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has body: Here is the code that I have tried so far but its not working FIDDLE HERE HTML Highlight The fox went over the fence CSS .highlight { background-color:yellow; } JS function highlight(text) { inputText = document.getElementById("inputText") var innerHTML = inputText.innerHTML var index = innerHTML.indexOf(text); if ( index >= 0 ) { innerHTML = innerHTML.substring(0,index) + "" + innerHTML.substring(index,index+text.length) + "" + innerHTML.substring(index + text.length); inputText.innerHTML = innerHTML } }

http://stackoverflow.com/comment/38582578
type: Comment
score: 0
comment on: http://stackoverflow.com/a/24847426
type: AnswerComment
has text: Sorry - I think we're talking at cross purposes: in my first comment, I was saying that ng-model-options doesn't seem to work in this case. I didn't see it in your plnkr, so I was wondering if you found the same? Were you able to get that solution to work in this situation? It certainly would be an elegant approach if it did.

http://stackoverflow.com/comment/38698626
type: Comment
comment on: http://stackoverflow.com/a/24906952
score: 0
type: AnswerComment
has text: @dkoch Typo in the second listing. It was just there for example and you do understand how this is generally not a practical approach I hope.

http://stackoverflow.com/a/24819611
downvote count: 0
score: 1
has body: Yes, it is. For your example, undefined is equal false then null is equal false too and this last value returns from expression. So this is why first approach is equal to if (myVariable === null) { ... }. The second approach is preferable, but if you not a 'JavaScript: The Good Parts' guy, you can stick with if (myVariable == null) { ... } or if (myVariable == undefined) { ... }.
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/24819197

http://stackoverflow.com/comment/38641325
type: Comment
has text: What is the exact problem, is it running `$.stellar` always? Like no matter if it is mobile. Or is it not running it at all?
type: QuestionComment
comment on: http://stackoverflow.com/q/24878285
score: 0

http://stackoverflow.com/q/24883281
tagged with: javascript
score: 0
tagged with: node.js
has answer: http://stackoverflow.com/a/25069792
accepted answer: http://stackoverflow.com/a/25069792
has title: Shared settings location on desktop application
tagged with: node-webkit
type: Question
type: AnsweredQuestion
has body: Background I am trying to write an application with NodeWebKit. This application has TWO parts. First is the service, which will be installed on the user machine, this service will run on boot and watch a directory for changes. Second is the GUI client, this will be the client that will specify which directories to watch. So I was thinking that the GUI client will save a file of the list of the directories specified to be watched and the service will look at that file to know which directories he is going to watch. The idea is that the when the users installs the Client GUI app, it will also install the service and run that service. Question I also need to support cross-platform. How do I know where to save my settings file in OSX and Windows? Should I refactor the architecture?
answer count: 1

http://stackoverflow.com/a/24892622
upvote count: 8
has comment: http://stackoverflow.com/comment/38668520
downvote count: 2
score: 6
type: Answer
answers question: http://stackoverflow.com/q/24892315
has comment: http://stackoverflow.com/comment/38670764
has comment: http://stackoverflow.com/comment/38668494
has body: This should do it: $('input[type=checkbox]').click(function () { $(this).parent().find('li input[type=checkbox]').prop('checked', $(this).is(':checked')); var sibs = false; $(this).closest('ul').children('li').each(function () { if($('input[type=checkbox]', this).is(':checked')) sibs=true; }) $(this).parents('ul').prev().prop('checked', sibs); }); jsFiddle example Latest update handles up and down the hierarchy, and siblings.
has comment: http://stackoverflow.com/comment/38668565
has comment: http://stackoverflow.com/comment/38668509
has comment: http://stackoverflow.com/comment/38668604
has comment: http://stackoverflow.com/comment/38668433
has comment: http://stackoverflow.com/comment/38669514

http://stackoverflow.com/q/24903876
has comment: http://stackoverflow.com/comment/38714315
score: 0
has title: Polyline and Polygon of fabricjs and Closed Line of KineticJS
tagged with: html5-canvas
answer count: 1
tagged with: kineticjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24931435
has comment: http://stackoverflow.com/comment/38730324
type: Question
tagged with: javascript
tagged with: fabricjs
has body: What is the difference between fabric's Polygon and Polyline class? I think except for closed end there is no difference? Also I wanted to draw closed area similar to Kinetic.Line behavior but for FabricJS. I have added a demo for this at http://jsbin.com/hubunu/1/edit For me output of Kineticjs is correct. I want similar in FabricJS.

http://stackoverflow.com/a/24777044
answers question: http://stackoverflow.com/q/24776162
accepted answer of: http://stackoverflow.com/q/24776162
has comment: http://stackoverflow.com/comment/38454459
type: AcceptedAnswer
score: 0
type: Answer
has body: You could use Date.parse, jQuery.each and setInterval to check your list's items' dates periodically. Fiddle: http://jsfiddle.net/9EUGf/2/ It may be a little messy, but should get you started.

http://stackoverflow.com/comment/91842079
type: Comment
has text: I could really use the rest of the example (to actually download the thing as a .json)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24898157

http://stackoverflow.com/comment/38627287
has text: Sorry, I'm not to experienced with the terminology or FireBug for that matter. But yes, the content is located in the body section of the page.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24870799

http://stackoverflow.com/comment/81996088
type: QuestionComment
comment on: http://stackoverflow.com/q/24867060
score: 0
has text: My problem was caused by the shared `config` variable: https://stackoverflow.com/a/47519851/722036
type: Comment

http://stackoverflow.com/a/24761961
score: 7
answers question: http://stackoverflow.com/q/24761331
upvote count: 7
type: Answer
has comment: http://stackoverflow.com/comment/38422485
has comment: http://stackoverflow.com/comment/38421424
has comment: http://stackoverflow.com/comment/38422333
has comment: http://stackoverflow.com/comment/43608381
has comment: http://stackoverflow.com/comment/38421257
downvote count: 0
has body: First of all, great question. I think every new-with-angular developer struggles with the differences with all the given components (controller, directive, service, filter etc.). Let's start with the basic formal definition: Directives are markers on a DOM element that tell AngularJS's HTML compiler to attach a specified behavior to that DOM element. And on the other hand Controller is a JavaScript constructor function that is used to augment the Angular Scope The defined behavior does guide us through some rule-of-thumbs. So for your questions above: In simple words, we user controllers to manage an area (scope) in The HTML template with all the great abilities a controller brings (two-way-binding, scoped behavior, services injections etc.) And we Use directives when we wish to manipulate an existing HTML element or Custom out own, in most scenarios - when we think about reusing This elements. That depends on the context of what ng-click should do. Lets say you have your customized directive for a numeric input that has a customized designed and behavior as you defined in your directive configuration. And you use it in a form that ng-click suppose to pop a modal with optional values and use it in a different place in the application and ng-click will do something else. In this case the function need to be a scope.fucntion. but let's say both location and every other will do exactly the same, this take the function to the directive scope. Answered above :) Each of your options will do, this where "opinion" takes in and less rule-of-thumbs exists. why? because both ways will work when each has it pros and cons. The rule of thumb I can find in the scenario is that if both elements are part of the directive template, I would expect the 'behavious' (the dragging function) to be part of the directive scope. Good luck

http://stackoverflow.com/comment/38487478
type: Comment
type: QuestionComment
has text: [0,3,3,0,43,0].filter(/./.test, /^0$/).length
comment on: http://stackoverflow.com/q/24795543
score: 0

http://stackoverflow.com/comment/38637535
type: Comment
type: QuestionComment
has text: Yes that's what I've done. You can also write some JavaScript wrappers of your own, and then from the Java side you can "inject" them into the global context that subsequent JavaScript code will see.
score: 0
comment on: http://stackoverflow.com/q/24876087

http://stackoverflow.com/q/24886858
type: Question
has title: How to determine the http-request's location/origin (address-bar)?
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has body: So I'm trying to redirect the browser to another webpage when the page he is attempting to load matches my conditions (regex). Currently it looks like this: (came up with it here) function listener(event) { var channel = event.subject.QueryInterface(Ci.nsIHttpChannel); var url = event.subject.URI.spec; if (isToBeRedirected(url)) { // replace url } } exports.main = function() { events.on("http-on-modify-request", listener); } But the problem is, that this will also replace urls to images for example, which are embedded in the page. My question would be, is there a way of varyfying that the http request is made by typing in a url or clicking a link to a page? So simply everytime a url shows up in the address-bar. I thought about reading the url of the current tab and comparing it to the request url, but I wasnt able to find out exactly how yet.
tagged with: firefox-addon
linked to: http://stackoverflow.com/q/24849385
has comment: http://stackoverflow.com/comment/38667755
tagged with: firefox-addon-sdk
upvote count: 1
has answer: http://stackoverflow.com/a/24893387
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24893387
score: 1

http://stackoverflow.com/q/24768300
has answer: http://stackoverflow.com/a/25041170
answer count: 1
tagged with: c#
accepted answer: http://stackoverflow.com/a/25041170
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Getting column widths for RadGrid on client side
score: 2
type: AnsweredQuestion
tagged with: client-side
tagged with: radgrid
favorite count: 0
has body: This RadGrid stuff has been a complete nightmare, but I think I'm almost there. I'm trying to truncate text that's too long and add an ellipsis... The tricky part is that the user can chose which columns they want to show/hide, so the size of the columns will depend on how many columns are being displayed. My idea is to get the current width of the column and determine how many characters to allow in the cell based on that. It seems I'm not able to get the widths on the server side if they're not explicitly set. Can this be done on client side? I've done this, but I'm still getting blanks for the widths: var grid = $find("&lt;%= rgResults.ClientID %&gt;"); var mtv = grid.get_masterTableView(); var columns = mtv.get_columns(); for (var i = 0; i &lt; columns.length; i++) { var element = columns[i].get_element(); alert(element.width); }
type: Question
upvote count: 2

http://stackoverflow.com/comment/38657009
comment on: http://stackoverflow.com/q/24885227
score: 0
type: Comment
type: QuestionComment
has text: Have you include the script tag to refer [require.js](http://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.8/require.js)? It is the one which defines variable `define`.

http://stackoverflow.com/q/24887500
type: AnsweredQuestion
has body: I'm using "grunt-closure-tools". When I try to minify simple JS file, everything works well. But when I try to minify AngularJS library or Bootstrap library, I got next exception: Error: Command failed: build\lib\angular.js:9040 WARNING - Keywords and reserved words are not allowed as unquoted property names in older versions of JavaScript. If you are targeting newer versions of JavaScript, set the appropriate language_in otion. build\lib\angular.js:256: ERROR - Parse error. identifier is a reserved word */ build\lib\angular.js:258: ERROR - Parse error. identifier is a reserved word if (isNaN(msie)) { ................... Gruntfile.js: module.exports = function(grunt) { grunt.initConfig({ pkg : grunt.file.readJSON('package.json'), closureCompiler: { options: { compilerFile: 'lib/google-closure-tools/compiler.jar' }, minify: { files: [ { expand: true, src: ['build/**/*.js', '!build/**/*.min.js'], ext: '.min.js' } ] } } }); grunt.loadNpmTasks('grunt-closure-tools'); grunt.registerTask('closure', ['closureCompiler']); }; Thanks for any help.
tagged with: grunt-plugins
type: Question
has comment: http://stackoverflow.com/comment/38658797
tagged with: javascript
tagged with: gruntjs
score: 0
accepted answer: http://stackoverflow.com/a/24901875
answer count: 1
has comment: http://stackoverflow.com/comment/38658103
has comment: http://stackoverflow.com/comment/38658868
tagged with: angularjs
has answer: http://stackoverflow.com/a/24901875
has title: grunt-closure-tools : ERROR - Parse error. identifier is a reserved word

http://stackoverflow.com/comment/38473339
has text: @Pointy: the button doesn't seem to be submitting, even without the "return false": http://jsfiddle.net/7NDEn/1/ i'm just curoius if it's actually needed or just one of those things we do "just because" or for readability...
comment on: http://stackoverflow.com/q/24789308
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38656285
score: 0
type: AnswerComment
has text: will post the plunker again
type: Comment
comment on: http://stackoverflow.com/a/24862722

http://stackoverflow.com/comment/38563245
type: AnswerComment
has text: Think you would need to use a renderlet to get the bars to be different colors, though. Currently each stack (layer) is assigned a color.
comment on: http://stackoverflow.com/a/24805326
type: Comment
score: 0

eval
tags question: http://stackoverflow.com/q/24763234
tags question: http://stackoverflow.com/q/24790225
tags question: http://stackoverflow.com/q/24869126
tags question: http://stackoverflow.com/q/24901822
type: Tag
tag name: eval
tags question: http://stackoverflow.com/q/24799553

http://stackoverflow.com/comment/38500723
score: 0
type: Comment
has text: Ok, but in this case, it's an AngularJS directive itself that's adding the code to the page. I want to add the div in a way that's completely separate from AngularJS, e.g. a regular ol' jquery "click" method will add the div.
comment on: http://stackoverflow.com/a/24804438
type: AnswerComment

http://stackoverflow.com/a/24890398
has body: function whatBring() { var response = prompt('What brings Little Red Riding Hood in the basket? A: Food - B: Book - C:Carbon'); if (response == 'A') { alert('bene, conosci la storia!'); } else { // All other responses are incorrect. alert('Hint: it's not correct!'); } }
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24890264
upvote count: 1
type: Answer

http://stackoverflow.com/q/24802773
linked to: http://stackoverflow.com/q/5376431
has answer: http://stackoverflow.com/a/24803310
tagged with: javascript
has comment: http://stackoverflow.com/comment/38497842
score: 0
answer count: 2
has title: Selecting a div tag using javascript
has comment: http://stackoverflow.com/comment/38497721
favorite count: 0
has body: some text some text some text and so on How can select all div of "_login_sometext_facebook" using javascript?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24802831
linked to: http://stackoverflow.com/q/12566888
upvote count: 1
has comment: http://stackoverflow.com/comment/38497807
downvote count: 1
type: Question
duplicate of: http://stackoverflow.com/q/12566888

http://stackoverflow.com/comment/38465032
has text: Hmm...if it's the same functionality, although I'm having trouble locating where exactly these snippets belong (remember, I've been adjusting the code, but the original was from a third party), it might have the same problem that hovitya's did. We're discussing it under his answer. :)
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24784932

http://stackoverflow.com/q/24906890
type: Question
tagged with: mongodb
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
has title: MongoDB average of embedded Array as extra field
tagged with: aggregation-framework
accepted answer: http://stackoverflow.com/a/24906952
possible better answer: http://stackoverflow.com/a/41575551
has answer: http://stackoverflow.com/a/41575551
tagged with: node.js
tagged with: mongodb-query
has body: My documents looks like this: { "_id" : "53ce85eda2579da8b40c1f0f", "name" : "Autokino", "tags" : [ "forMen" ], "ratings" : [ { "rating" : 5, "uuid" : "..."}, { "rating" : 4, "uuid" : "..."}, { "rating" : 4, "uuid" : "..."}, { "rating" : 1, "uuid" : "..."}, ] } Now I need the average of ratings.rating (here it should be 3.5). My query looks like this: activities.aggregate([ { $match: { _id: ObjectID(req.params.id) } }, { $unwind: '$ratings' }, { $group: { _id: '$_id', rating: { $avg: '$ratings.rating'}, }}, ]); It works, but what I get is: { "_id" : "53ce85eda2579da8b40c1f0f", "rating" : 3.5 } and this is what I need to get: { "_id" : "53ce85eda2579da8b40c1f0f", "name" : "Autokino", "tags" : [ "forMen" ], "rating" : 3.5 } (The original document without ratings array but with rating average) How can I solve this problem?
upvote count: 1
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/24906952

http://stackoverflow.com/a/24762464
type: Answer
has body: Change your js for: function qtyPlus(fieldId){ var curVal = parseInt(document.getElementById(fieldId).value); if(isNaN(curVal)) { document.getElementById(fieldId).value = 0; } else { document.getElementById(fieldId).value = curVal+1; } } function qtyMinus(fieldId) { var curVal = parseInt(document.getElementById(fieldId).value); if(isNaN(curVal)) { document.getElementById(fieldId).value = 0; } else { if(curVal != 0) { document.getElementById(fieldId).value = curVal-1; } } } Test: http://jsfiddle.net/7dhjT/
score: 0
answers question: http://stackoverflow.com/q/24762341

http://stackoverflow.com/comment/38475650
comment on: http://stackoverflow.com/a/24790413
type: Comment
has text: That's obviously not all it is, otherwise you wouldn't be getting the error. I can read the code you wrote. What is the server response. The FULL server response. And if you're using jQuery, are you sure jQuery isn't autoconverting the data for you.
score: 0
type: AnswerComment

yammer
type: Tag
tags question: http://stackoverflow.com/q/24872220
tags question: http://stackoverflow.com/q/24884267
tags question: http://stackoverflow.com/q/24815485
tags question: http://stackoverflow.com/q/24907341
tags question: http://stackoverflow.com/q/24770919
tag name: yammer
tags question: http://stackoverflow.com/q/24764904

http://stackoverflow.com/a/24824917
has body: You seem to be saving the file correctly, but the object you're trying to attach it to isn't declared properly. The most common pattern (as per the docs) is to declare your class, then create an instance of it, for example if your class is named "Foo": var Foo = Parse.Object.extend("Foo"); var foo = new Foo(); foo.set("file", parseFile); Lastly, you should wait for the save to finish before redirecting: foo.save().then(function() { res.redirect("/administrator"); });
answers question: http://stackoverflow.com/q/24823993
has comment: http://stackoverflow.com/comment/38644597
score: 0
type: Answer

http://stackoverflow.com/q/24831671
has title: Maintaining Namespaces in an Array doesn't work
tagged with: javascript
has answer: http://stackoverflow.com/a/24835299
score: 0
has body: i'm making a chat application divided by several namespaces, in other words i want to divide interests, some of them like to talk 'dogs' other wants to talk about 'cats' and so on... This is my first version, in which i stored each namespace in a variable(it works perfectly) : Server side: var app = require('express')(); var http = require('http').createServer(app); var io = require('socket.io')(http); app.get('/default', function(req, res){ res.sendfile('index1.html'); }); app.get('/dog', function(req, res){ res.sendfile('index2.html'); }); app.get('/', function(req, res){ res.sendfile('index.html'); }); var cns1 = io.of('/default'); //default nsp cns1.on('connection', function(socket){ socket.on('chat message', function(msg){ cns1.emit('chat message', msg); }); }); var cns2 = io.of('/dog'); //dog nsp cns2.on('connection', function(socket){ socket.on('chat message', function(msg){ cns2.emit('chat message', msg); }); }); var cnsindex = io.of('/'); //index nsp cnsindex.on('connection', function(socket){ socket.on('chat message', function(msg){ cnsindex.emit('chat message', msg); }); }); http.listen(3000,function(){ console.log('listening on *:3000'); }); index*.html &lt;script&gt; //on index.html var socket = io.connect('http://localhost:3000/'); //on index2.html //var socket = io.connect('http://localhost:3000/dog'); //on index1.html //var socket = io.connect('http://localhost:3000/default'); $(function(){ $('#bb').click(function (){ socket.emit('chat message', $('#m').val()); $('#m').val(''); return false; }); }); socket.on('chat message', function(msg){ $('#messages').append($('&lt;li&gt;').text(msg)); }); &lt;/script&gt; Each namespaces keeps their messages private. Now, when i wanted to store all Workspaces in an array to avoid repeating events, like that: var app = require('express')(); var http = require('http').createServer(app); var io = require('socket.io')(http); app.get('/default', function(req, res){ res.sendfile('index1.html'); }); app.get('/dog', funct…
answer count: 1
has comment: http://stackoverflow.com/comment/38553363
accepted answer: http://stackoverflow.com/a/24835299
tagged with: node.js
type: AnsweredQuestion
tagged with: socket.io
type: Question
linked to: http://stackoverflow.com/q/1451009

http://stackoverflow.com/q/24899527
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/38681502
has comment: http://stackoverflow.com/comment/38682152
has comment: http://stackoverflow.com/comment/38681428
answer count: 3
has answer: http://stackoverflow.com/a/24899799
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24899922
favorite count: 0
has answer: http://stackoverflow.com/a/24899560
downvote count: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24899560
accepted answer: http://stackoverflow.com/a/24899922
has title: how to multiply 2 text box values with javascript and ouput the answer to a 3rd textbox that is a ko.observable
has comment: http://stackoverflow.com/comment/38682427
type: Question
has body: I have a webpage that has multiple textboxes inside of a table. I need to take a value from one textbox and multiply it with another textbox then display that answer to a third text box that is a ko.observable. I have written the below javascript and I cannot get it to work at all. Absolutely nothing happens. &lt;script type="text/javascript"&gt; function calculateLineTotal(numunit, rate, total) { var rate = document.getElementById(rate).value; var numunit = document.getElementById(numunit).value; var sum = numunit * rate; document.getElementById(total).value = sum; } and the corresponding HTML: &lt;td&gt;&lt;input class="text" type="number" name="NumUnit1" id="NumUnit1" value="0.00" onchange="calculateLineTotal('NumUnit1','Rate1','Total1')"/&gt;&lt;/td&gt; &lt;td&gt;&lt;input class="text" type="number" name="Rate1" id="Rate1" value="0.00" onchange="calculateLineTotal('NumUnit1','Rate1','Total1')"/&gt;&lt;/td&gt; &lt;td&gt;&lt;input data-bind="value: total1" type="number" class="text" name="Total1" id="Total1" value="0.00"/&gt;&lt;/td&gt; I have tried single just simplifying the function to just throw an alert when the first textbox value is changed and nothing even happens then. Again I am a javascript newb so please be kind. Thank you in advance.
has comment: http://stackoverflow.com/comment/38681882
upvote count: 0

http://stackoverflow.com/comment/38408696
score: 0
has text: @LarsKotthoff when i set result= "" on mousesout it does not show me tooltip on mouseover
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24754336

http://stackoverflow.com/a/30253325
answers question: http://stackoverflow.com/q/24796747
has body: If I understand correctly what you want, you would need to use an AngularJS Service. For a good explanation, see this article from the Ionic docs: http://learn.ionicframework.com/formulas/sharing-data-between-views/ In the section "Sharing Data with Services" the answer to your question is right there.
downvote count: 0
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/38483105
type: Comment
comment on: http://stackoverflow.com/a/24794550
type: AnswerComment
has text: @bonCodigo that download page has links to a number of CDN resources. It's a `quick find` resource location
score: 1

http://stackoverflow.com/q/24844039
has answer: http://stackoverflow.com/a/24844101
has comment: http://stackoverflow.com/comment/38576675
linked to: http://stackoverflow.com/q/11583217
has title: check if an object is string in Javascript
has comment: http://stackoverflow.com/comment/38576763
upvote count: 10
has answer: http://stackoverflow.com/a/24844091
type: Question
has comment: http://stackoverflow.com/comment/38577387
answer count: 2
has comment: http://stackoverflow.com/comment/38579362
downvote count: 0
score: 10
tagged with: javascript
has comment: http://stackoverflow.com/comment/38576688
has comment: http://stackoverflow.com/comment/38576651
accepted answer: http://stackoverflow.com/a/24844091
tagged with: string
has body: I was following a tutorial that suggested to check if an object is string and not empty as the following: var s = "text here"; if ( s &amp;&amp; s.charAt &amp;&amp; s.charAt(0)) it is said that if s is string then it has a method charAt and then the last component will check if the string is empty or not. I tried to test it with the other available methods like ( typeof and instanceof ) using some of the SO questions and here and here too !! so I decided to test it in Js Bin : jsbin code here as follow: var string1 = "text here"; var string2 = ""; alert("string1 is " + typeof string1); alert("string2 is " + typeof string2); //part1- this will succeed and show it is string if(string1 &amp;&amp; string1.charAt){ alert( "part1- string1 is string"); }else{ alert("part1- string1 is not string "); } //part2- this will show that it is not string if(string2 &amp;&amp; string2.charAt ){ alert( "part2- string2 is string"); }else{ alert("part2- string2 is not string "); } //part3 a - this also fails !! if(string2 instanceof String){ alert("part3a- string2 is really a string"); }else{ alert("part3a- failed instanceof check !!"); } //part3 b- this also fails !! //i tested to write the String with small 's' =&gt; string // but then no alert will excute !! if(string2 instanceof string){ alert("part3b- string2 is really a string"); }else{ alert("part3b- failed instanceof check !!"); } Now my questions are : 1- why does the check for string fails when the string is empty using the string2.charAt ??? 2- why does the instanceof check failed??
favorite count: 0
has comment: http://stackoverflow.com/comment/38575522
tagged with: instanceof
linked to: http://stackoverflow.com/q/4059147
has comment: http://stackoverflow.com/comment/38576773
linked to: http://stackoverflow.com/q/154059
has comment: http://stackoverflow.com/comment/38576824
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24844101

http://stackoverflow.com/a/24787744
answers question: http://stackoverflow.com/q/24787412
type: Answer
has body: I was once trying to do the same and this is what I used $(document).ready(function(){ $(document).click(function(e){ if ($(e.target).is('#headlineatas,#headlineatas *')) { return; } else { document.getElementById("headlineatas").style.display = 'none'; } }); });
score: 0

http://stackoverflow.com/comment/38649000
type: QuestionComment
comment on: http://stackoverflow.com/q/24882402
type: Comment
has text: @RobSchmuecker I do too! :)
score: 0

http://stackoverflow.com/q/24827048
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/24827072
has answer: http://stackoverflow.com/a/24827158
tagged with: javascript
has body: Does anyone can explain why 2nd click function doesn't work? var $j = jQuery.noConflict(); $j(function(){ $j('#quick-links-toggle').click(function(){ $j('#quick-links-module').slideDown(300); $j(this).text('Hide links'); $j(this).attr('id','quick-links-hide'); }); $j('#quick-links-hide').click(function(){ $j('#quick-links-hide').slideUp(300); }); });
has answer: http://stackoverflow.com/a/24827587
downvote count: 4
has answer: http://stackoverflow.com/a/24827288
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/24827072
answer count: 5
score: -3
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: jQuery SlideDown, slideUp
has answer: http://stackoverflow.com/a/24827078
accepted answer: http://stackoverflow.com/a/24827078
type: AnsweredQuestion

http://stackoverflow.com/q/24759270
upvote count: 0
has answer: http://stackoverflow.com/a/24759599
has body: I have a problem I can not solve probably due to exhaustion. In my page I have two boxes in which pressing the "start" button changes the background color randomly without repetition. At first it worked then I changed some things and it no longer works as before. Sometimes I do not make colors appear in the array equal on the two panes. Here is my code function go(){ var random = Math.floor((Math.random() * colori.length) + 0); var t = Math.floor((Math.random() * colori.length) + 0); var sx = document.getElementById("sx"); var dx = document.getElementById("dx"); var btngo = document.getElementById("go"); document.getElementById("scritta").innerHTML = random; document.getElementById("scrittaU").innerHTML = t; dx.style.backgroud = colori[random]; sx.style.backgroud = colori[t]; if(random == t){ alert("random:"+random+" " +"t"+t); alert(colori.splice(random,1)); random = Math.floor((Math.random() * colori.length) + 0); dx.style.background = colori[t]; sx.style.background = colori[random]; colori.splice(random,1); colori.splice(t,1); } dx.style.background = colori[t]; sx.style.background = colori[random]; colori.splice(random,1); colori.splice(random-1,1); btngo.disabled=true; }
has title: Random array with index
type: Question
tagged with: if-statement
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/38415914
tagged with: random
downvote count: 2
answer count: 1
favorite count: 0
tagged with: colors
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38416102

http://stackoverflow.com/comment/38669802
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24888064
type: Comment
has text: @user2486308 Well, I just copy-pasted the url used on your snippet above. That url obviously doesn't exist (404 = Page not found). You should use your url and everything will work just fine.

http://stackoverflow.com/comment/38545995
has text: @MikeC Added in an edit :)
type: Comment
score: 3
comment on: http://stackoverflow.com/a/24828158
type: AnswerComment

http://stackoverflow.com/a/38463365
answers question: http://stackoverflow.com/q/24908592
has body: This is documented in the Box Developer Docs under the topic CORS. You need to visit your Box Application Configuration page and add the comma separated list of addresses/IPs to the CORS Allowed Origins field. For example: http://127.0.0.1,http://localhost,http://localhost:3000,http://10.0.1.2,http://0.0.0.0,https://example.com
score: 0
type: Answer

http://stackoverflow.com/a/24761736
has comment: http://stackoverflow.com/comment/38420561
score: 0
answers question: http://stackoverflow.com/q/24761578
upvote count: 1
downvote count: 1
type: Answer
has body: You just need to surround file you require with quotes, ex: &lt;?php require("list.php"); ?&gt;

http://stackoverflow.com/comment/38632855
score: 1
comment on: http://stackoverflow.com/q/24873790
type: QuestionComment
type: Comment
has text: Store the original dimensions of the image on page load, and calculate the percentage change based on those figures, not the current size.

http://stackoverflow.com/comment/38563358
type: AnswerComment
comment on: http://stackoverflow.com/a/24837543
score: 0
type: Comment
has text: @buffer There's no down side in it, you are doing the things in a right way. I just tried to explain you how to reflect the changes in the DOM elements and it is completely unnecessary.

charts
tags question: http://stackoverflow.com/q/24879360
tags question: http://stackoverflow.com/q/24793907
tags question: http://stackoverflow.com/q/24770378
tags question: http://stackoverflow.com/q/24760837
tags question: http://stackoverflow.com/q/24815851
tags question: http://stackoverflow.com/q/24866499
tags question: http://stackoverflow.com/q/24828529
tags question: http://stackoverflow.com/q/24866062
tags question: http://stackoverflow.com/q/24760430
type: Tag
tags question: http://stackoverflow.com/q/24879723
tags question: http://stackoverflow.com/q/24897338
tags question: http://stackoverflow.com/q/24876144
tags question: http://stackoverflow.com/q/24827896
tags question: http://stackoverflow.com/q/24766042
tags question: http://stackoverflow.com/q/24772091
tags question: http://stackoverflow.com/q/24843013
tags question: http://stackoverflow.com/q/24887796
tags question: http://stackoverflow.com/q/24839774
tags question: http://stackoverflow.com/q/24760853
tag name: charts
tags question: http://stackoverflow.com/q/24873427
tags question: http://stackoverflow.com/q/24867060
tags question: http://stackoverflow.com/q/24848590
tags question: http://stackoverflow.com/q/24841001
tags question: http://stackoverflow.com/q/24811853
tags question: http://stackoverflow.com/q/24769578
tags question: http://stackoverflow.com/q/24805537

wysiwyg
tags question: http://stackoverflow.com/q/24874029
tags question: http://stackoverflow.com/q/24757765
type: Tag
tag name: wysiwyg
tags question: http://stackoverflow.com/q/24891400
tags question: http://stackoverflow.com/q/24758587

http://stackoverflow.com/a/24860399
has comment: http://stackoverflow.com/comment/38607550
has body: Just use the Array.splice() API to remove the first one element.
accepted answer of: http://stackoverflow.com/q/24860293
answers question: http://stackoverflow.com/q/24860293
upvote count: 1
has comment: http://stackoverflow.com/comment/38607176
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/a/24862414
accepted answer of: http://stackoverflow.com/q/24862347
answers question: http://stackoverflow.com/q/24862347
type: AcceptedAnswer
downvote count: 0
score: 9
type: Answer
has comment: http://stackoverflow.com/comment/38612868
has body: I am wondering if there is an easy way to splice out all elements after a key position in a json array. If it's all elements after a key position, you do this: array.length = theKeyPosition; E.g.: var array = [ "one", "two", "three", "four", "five", "six" ]; var theKeyPosition = 3; array.length = theKeyPosition; // Remove all elements starting with "four" If you don't yet know the key position, in an ES5 environment (and this can be shimmed), you use filter: var array = [ "one", "two", "three", "four", "five", "six" ]; var keep = true; array = array.filter(function(entry) { if (entry === "four") { keep = false; } return keep; }); That's using strings, but you can easily change if (entry === "four") { to if (entry.someProperty === someValue) { for your array of objects.
has comment: http://stackoverflow.com/comment/38610879
upvote count: 9

http://stackoverflow.com/q/24852597
upvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24852819
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38592108
has title: get value of jQuery selectmenu and run javascript onchange
score: -1
has body: I have a Javascript jQuery $(function() { $( "#select" ).selectmenu(); }); And HTML Select Please Repair Destroy And I need to get the value of the selectmenu and run the javascript to change background of #okservice I can't find out where is the problem. Could anybody help me, please?
has answer: http://stackoverflow.com/a/24853662
answer count: 2

http://stackoverflow.com/comment/38449659
has text: Something like that, yes. I would use jQuery's .is()
comment on: http://stackoverflow.com/a/24777236
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/24842342
type: Answer
has body: You can also use the character itself instead of their HexCode. 'asdasd2 -34 56 ——————————————-'.replace(/[—-]/g, "") //output "asdasd2 34 56 "
has comment: http://stackoverflow.com/comment/38572445
answers question: http://stackoverflow.com/q/24841571
score: 0

http://stackoverflow.com/comment/38884473
has text: @Sergio, I'm realized that the miss of a class comment leads to an error
score: 0
comment on: http://stackoverflow.com/q/24908835
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24817982
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/24817845
upvote count: 2
answers question: http://stackoverflow.com/q/24817845
has body: Basically what you're doing is pretty complicated. I've simplified this code a little for you. Instead of triggering a click, use window.open function. Hope it helps, here's the working code HTML: 1 2 3 jQuery: $("#wo_select_shop").change(function() { var shop_number = $("#wo_select_shop").val(); var url = '/estimate_lookups/select_store?shop_number='+shop_number; window.open(url); });

http://stackoverflow.com/q/24808751
tagged with: angularjs
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38663060
type: Question
has body: I have an editable ng-grid in my web application. The grid functions make my life easy and are truly great but I've noticed one minor problem that I don't know how to work around gracefully. Namely, I want to detect when a user has made changes to the grid. Right now, I use... $scope.$on('ngGridEventEndCellEdit', function(evt) { //function goes here! }); ...this works, kind of. The problem is this event is triggered even when the user has NOT made a change to the cell but has only clicked/tabbed into/out-of it. I don't want to have to compare each field in the row from the before and after to detect if a change has been made -- is there a better way? Thanks!
has title: How do I detect cell change in ng-grid NOT just an end to ng-grid event?
has comment: http://stackoverflow.com/comment/38510258
score: 0
tagged with: cell
linked to: http://stackoverflow.com/q/15647981
answer count: 1
tagged with: javascript
tagged with: ng-grid
has answer: http://stackoverflow.com/a/24813171
accepted answer: http://stackoverflow.com/a/24813171

http://stackoverflow.com/q/24811672
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to toggle an image when a class is clicked. So far I have this (below) and it works to change my 'plus.png' to my 'minus.png' but I need it to change back to my 'plus.png' if the class is clicked again. I have the following jQuery: HTML Saftey and Emissions link link Is someone could help me out by adding to what I have, it would greatly be appreciated!
type: AnsweredQuestion
tagged with: toggle
type: Question
has answer: http://stackoverflow.com/a/24811815
has answer: http://stackoverflow.com/a/24811932
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24811773
tagged with: jquery
possible better answer: http://stackoverflow.com/a/24811815
score: 0
has answer: http://stackoverflow.com/a/24812143
has answer: http://stackoverflow.com/a/24811849
has answer: http://stackoverflow.com/a/24811773
has comment: http://stackoverflow.com/comment/38514965
has title: Trying to change an image on click and back again
answer count: 5

http://stackoverflow.com/q/24749469
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/4870328
tagged with: npm
type: Question
accepted answer: http://stackoverflow.com/a/24760692
tagged with: node.js
score: 0
answer count: 1
tagged with: javascript
has title: Node.js: Switch npm script based on context
has comment: http://stackoverflow.com/comment/38397674
has body: Is there a way to configure package.json to run a different npm start script based on context? For example, I would like to run DEBUG=http nodemon app.js when I am developing. But, I would like to run node app.js on production.
has answer: http://stackoverflow.com/a/24760692

http://stackoverflow.com/comment/38493344
type: Comment
comment on: http://stackoverflow.com/a/24800246
has text: @toms: this is actually because i have written this code on click event of anchor tag "". if you want it on checkbox then you can do that. wait i'll update my answer.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38651715
score: 0
comment on: http://stackoverflow.com/q/24883446
type: Comment
type: QuestionComment
has text: The problem in your fiddle is not with `filterHtmlLevels` (well, it has its own problems too, but it's not the root of your current issue). It's with the way you get your selections with `getSel`. The exact same breakup behaviour occurs on selection here: http://jsfiddle.net/NbRc4/

http://stackoverflow.com/a/44361079
answers question: http://stackoverflow.com/q/24791879
downvote count: 0
has body: try this on your library dropzone dropzone.js; but set time out to auto close 2500 success: function(file) { if (file.previewElement) { return file.previewElement.classList.add("dz-success"), $(function(){ setTimeout(function(){ $('.dz-success').fadeOut('slow'); },2500); }); } },
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/38707300
type: Comment
has text: Should this work on a list in the hostweb of an app? It gives me an access denied error when I try a modified version of the second code that refers to an list in the hostweb.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/24904832

http://stackoverflow.com/q/24882655
has comment: http://stackoverflow.com/comment/38649482
has comment: http://stackoverflow.com/comment/38650836
tagged with: javascript
has body: When tested locally the example below works perfectly. It cycles through different jsmovermaps on mouse press, but when I test this on the server it doesn't update the jsmovermap relevant to cursor press. I have uploaded the maps correctly. Any help would be appreciated. Many thanks!!! Ireland Map UPDATE! This is what the console is spitting out after a number of cursor presses. Resource interpreted as Script but transferred with MIME type text/html: "http://jeremiahambrose.com/maptest/Test/jsmovermap23.js".
score: 0
tagged with: arrays
has comment: http://stackoverflow.com/comment/38650281
has comment: http://stackoverflow.com/comment/38650728
tagged with: keycode
has comment: http://stackoverflow.com/comment/38649347
has comment: http://stackoverflow.com/comment/38649922
answer count: 0
type: UnansweredQuestion
has title: Script Change on Keydown Working Locally, but not on Server
has comment: http://stackoverflow.com/comment/38650733
type: Question

http://stackoverflow.com/q/24782201
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24782445
score: 0
type: Question
has body: I am attempting to create a modal that flips. The front modal displays fine however the back modal just displays [object HTMLDivElement] instead of displaying the modal. &lt;script type='text/javascript'&gt; $('#introModal').modal('show'); window.onload = function () { function flip() { var front = document.getElementById('introModal'); var back_content = document.getElementById('backModal'); // Generate or pull any HTML you want for the back. var back; // when the correct action happens, call flip! back = flippant.flip(front, back_content) // this creates the back element, sizes it and flips it around. // call the close method on the back element when it's time to close. } document.getElementById('testbutton').onclick = flip; }; &lt;/script&gt;
has title: flippant.js does not pull html. Displays [object HTMLDivElement] instead
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24782445
answer count: 1
tagged with: flippant

http://stackoverflow.com/comment/38457461
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/24780915
has text: @VMAtm Yes... I had tried a lot! when I set return type to `string` and `return "OK"` nothing changes. (If I just `return "OK";` without changing another value I've got same effect)

http://stackoverflow.com/a/25117497
type: Answer
answers question: http://stackoverflow.com/q/24903884
has body: Using Jquery Set min value and max value in Progress ` $("#progressbar").progressbar({ value: parseFloat($('#hdn_Viewbaguserspace').val()) }); $("#progressbar").progressbar("option", "max", parseFloat($('#hdn_viewbagtotalspace').val()));`
score: 0

http://stackoverflow.com/comment/38568835
type: QuestionComment
comment on: http://stackoverflow.com/q/24840313
has text: Works for me without problems(saved a copy of http://fiddle.jshell.net/sezwj/680/show/ and gave it the extension hta). The only required modification was the path to jquery(the protocol has been ommitted in the fiddle)
score: 0
type: Comment

http://stackoverflow.com/a/24841343
answers question: http://stackoverflow.com/q/24841178
has comment: http://stackoverflow.com/comment/38571018
has comment: http://stackoverflow.com/comment/38570954
upvote count: 1
downvote count: 0
has body: First, don't use onclick. Instead, use: ...&lt;input id="prevButton"&gt;...&lt;/input&gt;... ...&lt;input id="nextbutton"&gt;...&lt;/input&gt;... // In the js &lt;script&gt; $('#prevButton').click(function(){ // Code here }); $('#nextButton').click(function(){ // Code here }); &lt;/script&gt; Then, in your django view, add a JSON string containing links to all the pages in your app to the template context. for page in all_pages: list_of_all_pages.append(page.permalink()) # Something like this jsonlist = json.dumps(list_of_all_pages) # Add this to the template context Back to html: &lt;script&gt; // Roughly like this var listOfPages = JSON.parse(''); var currentPage = 0; $('#prevButton').click(function(){ currentPage--; top.frames['centrale'].location=listOfPages[currentPage]; }); // currentPage++ on the nextButton ... If you want, you can create a separate view to serve the json, then get it using jQuery.getJSON instead of injecting it to the html.
score: 1
has comment: http://stackoverflow.com/comment/38571281
type: Answer

http://stackoverflow.com/a/24852565
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24852288
score: 1
answers question: http://stackoverflow.com/q/24852288
type: AcceptedAnswer
downvote count: 0
has body: There is a cross origin problem ... try using this function function convertImgToBase64(url) { var canvas = document.createElement('CANVAS'); img = document.createElement('img'), img.src = url; img.onload = function() { canvas.height = img.height; canvas.width = img.width; var dataURL = canvas.toDataURL('image/png'); alert(dataURL); canvas = null; }; } I removed the context and I loaded the image in a different way
type: Answer

http://stackoverflow.com/a/24834852
accepted answer of: http://stackoverflow.com/q/24834812
downvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/24834812
has body: This may not be what you want, but if you just want it to look better, I would recommend: console.log(JSON.stringify(products, null, 2)); which would give you [ { "name": "Sample Product Name" }, { "name": "Sample Product Name 2" } ] In the console. If you really just want a space before commas, you could do: console.log(JSON.stringify(products).split('},{').join('}, {')); http://jsfiddle.net/2MeMY/3/
upvote count: 43
type: AcceptedAnswer
score: 41

http://stackoverflow.com/comment/38674125
comment on: http://stackoverflow.com/a/24895581
type: AnswerComment
has text: I know that I can do this in this way, but it's too much code, there must be shorter version. I found some code here [link](http://forum.jquery.com/topic/find-next-div-with-a-certain-class-and-scroll-to) but it doesn't work on my webpage.
type: Comment
score: 0

http://stackoverflow.com/comment/38697480
comment on: http://stackoverflow.com/a/24908043
type: AnswerComment
has text: I am accessing the array on html
score: 0
type: Comment

http://stackoverflow.com/comment/38579606
comment on: http://stackoverflow.com/a/24846158
has text: Yes I was going to comment. You don't actually need to use delimiters on the names, but it works both ways. The only exception I know of is when you set the properties of an element, e.g. `$(' , {id: "some_id", class: "classname"});` the `class` breaks IE, so it needs delimiters there. I avoid having to break that standard (of not using them) with `$(' , {id: "some_id"}).addClass("classname");` I've really gone offtopic.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38635617
type: Comment
comment on: http://stackoverflow.com/q/24874776
type: QuestionComment
has text: So are you saying to just change the last line of code to document.cookie ="beforeNoonCookie=" + beforeNoonField.toString()
score: 0

http://stackoverflow.com/q/24858751
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Reset jquery .click functions on call
linked to: http://stackoverflow.com/q/209029
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24858852
has body: I'm trying to make a kind of quiz script. It's loading questions and keeping score but the "click" tag seems to be added with every new question. Instead of being changed. This leads to strange counting behavior which makes my script unusable. Is there someway that i can "reset" the click function? I've allready tried "overwriting" them but that doesn't seem to work. var vragenArray = ["zero","Bla bla bla?","Boem Boem Boem?","Boing Boing Boing?","Floep Floep Floep?"]; var antA_Array = ["zero","antwoord1_a","antwoord2_a","antwoord3_a","antwoord4_a"]; var antB_Array = ["zero","antwoord1_b","antwoord2_b","antwoord3_b","antwoord4_b"]; var antC_Array = ["zero","antwoord1_c","antwoord2_c","antwoord3_c","antwoord4_c"]; var antD_Array = ["zero","antwoord1_d","antwoord2_d","antwoord3_d","antwoord4_d"]; var juistArray = ["zero","B","C","B","A"]; var aantalVragen = 21; var counterVragen = 0; var score = 0; function laadVraag(){ console.log("laadVraag geladen"); counterVragen++; $("#vraagNummer").text(counterVragen); $("#vraag").text(vragenArray[counterVragen]); $("#antA").text(antA_Array[counterVragen]); $("#antB").text(antB_Array[counterVragen]); $("#antC").text(antC_Array[counterVragen]); $("#antD").text(antD_Array[counterVragen]); $("#score").text(score); $("#correct").text(juistArray[counterVragen]); $("#antA_click").click(function(){ laadVraag(); }); $("#antB_click").click(function(){ laadVraag(); }); $("#antC_click").click(function(){ laadVraag(); }); $("#antD_click").click(function(){ laadVraag(); }); juisteAntwoord(juistArray[counterVragen]); }; function juisteAntwoord(antwoord){ console.log("juisteVraag geladen"); $("#antB_click").click(function(){ score++; laadVraag(); }); }; $(document).ready(function() { laadVraag(); }); Here is a jsFiddle with the current script. http://jsfiddle.net/D7MMa/1/ Hope someone can help me out! :)
has answer: http://stackoverflow.com/a/24858775
upvote count: 5
type: Question
answer count: 2
score: 5
downvote count: 0

http://stackoverflow.com/comment/38593573
comment on: http://stackoverflow.com/a/24851457
score: 0
has text: I think the destination part not yet loaded. Actually i am trying to update the controller which is available only in template not in a view. It may sound silly question, is it possible to access the controller directly not by DOM element?
type: AnswerComment
type: Comment

http://stackoverflow.com/q/24773177
has answer: http://stackoverflow.com/a/24773178
score: 16
type: Question
tagged with: google-docs
tagged with: google-apps-script
tagged with: google-sheets
linked to: http://stackoverflow.com/q/6835835
tagged with: javascript
tagged with: jquery
has title: How to poll a Google Doc from an add-on
answer count: 1
upvote count: 16
linked to: http://stackoverflow.com/q/5173316
favorite count: 0
has body: A documented restriction with document and sheet add-ons is that Apps Script cannot tell what a user does outside of the add-on. This tantalizing tip is given: It is possible to poll for changes in a file's contents from a sidebar's client-side code, although you'll always have a slight delay. That technique can also alert your script to changes in the user's selected cells (in Sheets) and cursor or selection (in Docs). Sadly, this isn't shown in any of the demo code. How can I do it?
accepted answer: http://stackoverflow.com/a/24773178
linked to: http://stackoverflow.com/q/30628894
linked to: http://stackoverflow.com/q/16886550
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/38525779
comment on: http://stackoverflow.com/a/24817338
type: Comment
has text: By dropdown do you mean the select box options?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38609156
type: Comment
type: AnswerComment
has text: my bad about that but it doesn't change the fact that the directive gets executed before the ng-if
comment on: http://stackoverflow.com/a/24861511
score: 0

http://stackoverflow.com/comment/38627710
type: QuestionComment
has text: I believe the info is being posted in the URL, check my edit picture for reference. I hope this is what you guys meant.
comment on: http://stackoverflow.com/q/24870799
score: 0
type: Comment

http://stackoverflow.com/comment/38595025
has text: Can't you just add some margin? What exactly would you like the result for their position to be? I'm confused on what you want to accomplish.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24854058
type: Comment

http://stackoverflow.com/comment/38599981
type: Comment
comment on: http://stackoverflow.com/a/24856163
type: AnswerComment
has text: Yes you're correct. The Nav Menu's I have don't have a class added to the `` element but rather to the parent ` ` element of sub-menu or main-menu
score: 0

http://stackoverflow.com/q/24847591
tagged with: java
has comment: http://stackoverflow.com/comment/38582573
has comment: http://stackoverflow.com/comment/38582513
accepted answer: http://stackoverflow.com/a/24847660
has comment: http://stackoverflow.com/comment/38582522
type: Question
has comment: http://stackoverflow.com/comment/38582310
has comment: http://stackoverflow.com/comment/38582285
tagged with: javascript
has comment: http://stackoverflow.com/comment/38582479
has body: I made a program for the question: Write a program in Java to input first name, middle name and last name. Validate the digital signature that contains first name and last name. If the signature doesn't contain any of these, print "Invalid Signature". Also, print his full name in a single line. The program that I wrote for this is: import java.io.*; import java.io.*; public class TaskPE_4 { public static void main(String args[])throws IOException { BufferedReader read= new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter your first name"); String fn=read.readLine(); System.out.println("Enter your middle name"); String mn=read.readLine(); System.out.println("Enter your last name"); String ln=read.readLine(); System.out.println("Enter your digital signature"); String ds=read.readLine(); ds+=" "; if(fnCheck(fn, ds)&amp;&amp;lnCheck(ln, ds)) System.out.println("Valid Digital Signature"); else System.out.println("Invalid Digital Signature"); System.out.println("Your full name is "+fn+" "+mn+" "+ln+"."); } private static boolean fnCheck(String fn, String ds) { int fnl=fn.length(); int dsl=ds.length(); for(int i=0; i&lt;=(dsl-fnl); i++) if((ds.substring(i, (i+fnl))).equals(fnl)) return true; return false; } private static boolean lnCheck(String ln, String ds) { int lnl=ln.length(); int dsl=ds.length(); for(int i=0; i&lt;=(dsl-lnl); i++) if((ds.substring(i, (i+lnl))).equals(lnl)) return true; return false; } } The output shown is: Enter your first name Rachit Enter your middle name Rachit Enter your last name Bhargava Enter your digital signature Rachit Bhargava Invalid Digital Signature Your full name is Rachit Rachit Bhargava. Please help me debug this program.
has answer: http://stackoverflow.com/a/24847660
tagged with: bluej
has comment: http://stackoverflow.com/comment/38582499
upvote count: 1
answer count: 1
linked to: http://stackoverflow.com/q/1046809
has title: Digital Signature BlueJ Error
favorite count: 0
has comment: http://stackoverflow.com/comment/38582537
has comment: http://stackoverflow.com/comment/38582408
has comment: http://stackoverflow.com/comment/38582364
has comment: http://stackoverflow.com/comment/38582489
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38582437
downvote count: 0
has comment: http://stackoverflow.com/comment/38582580
has comment: http://stackoverflow.com/comment/38582386
score: 1

http://stackoverflow.com/q/24905187
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38691818
has comment: http://stackoverflow.com/comment/38692774
linked to: http://stackoverflow.com/q/12472244
type: Question
has title: Still unable to include angular ui utils
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/24905789
upvote count: 1
has body: Hi i need to use the 'keypress' event from the angular ui utils library. But, I am unable to include angular ui in my project. I have already tried this- How to integrate AngularUI to AngularJS? Although, the jsfiddle posted in comments of that answer works, but it didn't work for me in sublime text. I can't understand why. I request someone to give a proper way to include angular ui and use ui-utils. Please try your method on a local text editor before posting answer.
answer count: 1
downvote count: 1
tagged with: angular-ui

http://stackoverflow.com/q/24821107
has comment: http://stackoverflow.com/comment/38532407
upvote count: 1
has comment: http://stackoverflow.com/comment/38532755
has comment: http://stackoverflow.com/comment/38532878
tagged with: arrays
has answer: http://stackoverflow.com/a/24821668
has comment: http://stackoverflow.com/comment/38532971
favorite count: 0
has answer: http://stackoverflow.com/a/24821286
accepted answer: http://stackoverflow.com/a/24821286
has body: I'm new to Javascript (but fairly proficient in php) and I'm trying to use a set of associative arrays to perform two tasks. First: Populate a dropdown menu (this part is working) var select = document.getElementById('FName'); var options = fNames; for(var i = 0; i &lt; (options.length-1); i++) { var opt = options[i]; var el = document.createElement("option"); el.textContent = opt; el.value = opt; select.appendChild(el); } The 'fNames' variable is an array with a list of strings which I've taken from a php array. I have another array, called 'fDesc' which is indexed to match the 'fNames' array. Something like this: var fNames = ["aName", "bName", "cName"] var fDesc = ["aDesc", "bDesc,", "cDesc"] They're currently separate arrays, not a single multidimensional one. How can I make "aDesc" appear in a text box when "aName" is selected from the pulldown menu?
has comment: http://stackoverflow.com/comment/38532831
has title: Use associative Javascript arrays to populate dropdown, then fill text box
has answer: http://stackoverflow.com/a/24821474
downvote count: 0
score: 1
type: Question
type: AnsweredQuestion
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24821474
answer count: 3

http://stackoverflow.com/a/24760605
answers question: http://stackoverflow.com/q/24760396
score: 0
type: Answer
has body: /([+-]?(?:[0-9]+\.)?[0-9]+)/g http://regex101.com/r/mC0yO2/1

http://stackoverflow.com/comment/38411765
type: QuestionComment
type: Comment
has text: Could you recreate issue on jsFiddle with some random/static data? Looks like your timestamps is string, not a number.
score: 0
comment on: http://stackoverflow.com/q/24755449

http://stackoverflow.com/a/24805235
has comment: http://stackoverflow.com/comment/38502711
has comment: http://stackoverflow.com/comment/38503070
accepted answer of: http://stackoverflow.com/q/24805166
has comment: http://stackoverflow.com/comment/38502504
type: AcceptedAnswer
downvote count: 0
has body: Please see below but here's the issue: you're tripping over the fact that the variable "i" is in the closure and is shared by all those function instances created in the constructor. Now, what you're doing is creating a function for each of the property names (including the property whose name is the text of that "nothing" function, but that's sort-of only tangentially relevant). The last property name that'll turn up in that for ... in loop is the name "nothing" (though there's no guarantee in the language spec that the loop will traverse the property names in any particular order). After that, the loop exits, with the final value of "i" being the string "nothing". Now, later, when you call c.hello(), that little function has access to the variables "i" and "method" from the original call to the constructor function. What's the value of "i"? It's still the string "nothing", so what the hello() function gives you is the value of methods["nothing"], which is the text of that function. Avoiding a for ... in loop will partially solve the problem, but not completely. The .forEach() method however will work, because each of the created functions will have it's own private name that will never change. When you add that property to the Array prototype, it'll turn up as one of the property names in your for ... in loop. Because of that, one of the values of "i" will be "nothing", since after you extend the Array prototype the string "nothing" will be a property name of any array. Your variable "methods" is, of course, an array. Thus in the loop, at some point "i" will be "nothing", and methods["nothing"] is that function. Passing the function to alert() causes its source code to be folded into the alert() text. You can avoid the problem with a test: for (var i in methods) { if (methods.hasOwnProperty(i)) { this[methods[i]] = function() { alert('This is method ' + methods[i]); } } } Better yet, don't use a for ... in loop at all on Array instances - it's never really a good …
answers question: http://stackoverflow.com/q/24805166
has comment: http://stackoverflow.com/comment/38503213
type: Answer
has comment: http://stackoverflow.com/comment/38502890
has comment: http://stackoverflow.com/comment/38503472
has comment: http://stackoverflow.com/comment/38502998
score: 1
has comment: http://stackoverflow.com/comment/38502615
has comment: http://stackoverflow.com/comment/38503277
upvote count: 1
has comment: http://stackoverflow.com/comment/38502921
has comment: http://stackoverflow.com/comment/38502586
has comment: http://stackoverflow.com/comment/38502986
has comment: http://stackoverflow.com/comment/38503136
has comment: http://stackoverflow.com/comment/38502700
has comment: http://stackoverflow.com/comment/38502727
has comment: http://stackoverflow.com/comment/38502646

http://stackoverflow.com/q/24807047
accepted answer: http://stackoverflow.com/a/24807300
tagged with: arrays
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38506138
has title: Jquery create arrays inside an array
possible better answer: http://stackoverflow.com/a/24807270
score: -1
has answer: http://stackoverflow.com/a/24807270
has answer: http://stackoverflow.com/a/24807300
downvote count: 1
has body: I have two sets of checkboxes like so: Toronto New York London Paris Berlin $200,000 to $299,999 $300,000 to $399,999 $400,000 to $499,999 $500,000+ and I have this jquery code that takes the value of what is selected and puts into an opts array: $(':checkbox').change(function() { var opts = $(":checkbox:checked").map(function() { return $(this).val(); }).get(); console.log(opts); }); but this will return the values of checked checkboxes values, regardless of which set of checkboxes they are in, my question is how would I keep these separate, but in the opts array, I am looking for these results: [location[1, 2, 3], price[1, 2, 3]] here is a fiddle: http://jsfiddle.net/6zz5f/1/
type: AnsweredQuestion
type: Question
answer count: 2
upvote count: 0

http://stackoverflow.com/comment/38520414
comment on: http://stackoverflow.com/q/24814462
has text: Then set the target date to October 3, 2014 instead of the current date plus 78 days?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24902243
score: 0
duplicate of: http://stackoverflow.com/q/9851372
tagged with: actionlink
type: Question
has comment: http://stackoverflow.com/comment/38686578
tagged with: hyperlink
tagged with: javascript
has comment: http://stackoverflow.com/comment/38686766
has comment: http://stackoverflow.com/comment/38686617
has comment: http://stackoverflow.com/comment/38686540
tagged with: jquery
has title: hide actual url in status bar when a link or actionlink is mouseovered or clicked
has body: I want to hide the actual url that is displayed in status bar of browser when link or actionlink is mouseovered or clicked. I tried using window.status but it is not working. Also the examples that i saw were for fixed urls to some sites. But the links that i want hide in status bar are like /Home/DownloadFileUsingFileName?FileName=Filename in which Filenamewill be different for different files based on their name. Edit: The duplicate question deals with Hyperlink but i am working with actionlinks. And i want a solution to hide url in status bar when an action link is clicked.
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/9851372
has comment: http://stackoverflow.com/comment/38686660
answer count: 0

http://stackoverflow.com/comment/38604788
has text: I was going to add jsfiddle today but Salathiel Genèse answer is what i was trying to ask.
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24840840

http://stackoverflow.com/comment/38675120
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/24894759
type: Comment
has text: @aggaton Do you mean you are going to replace `enumTable` values with something? `enumTable.enumItem = {blah: 'blah'}`?

access-control
tag name: access-control
type: Tag
tags question: http://stackoverflow.com/q/24853974

http://stackoverflow.com/q/24762771
has comment: http://stackoverflow.com/comment/38422572
has comment: http://stackoverflow.com/comment/38423169
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38423783
has comment: http://stackoverflow.com/comment/38423702
answer count: 0
has comment: http://stackoverflow.com/comment/38423421
score: 1
has comment: http://stackoverflow.com/comment/129077549
upvote count: 1
has comment: http://stackoverflow.com/comment/129050215
type: Question
has comment: http://stackoverflow.com/comment/38422662
tagged with: javascript
has comment: http://stackoverflow.com/comment/38422412
has comment: http://stackoverflow.com/comment/38424625
has body: So, I'm trying to have a button add another dropdown (DD in my code) to the page, and it works just dandy, except when I try to remove (which "works") the remaining node no longer has the parentNode set properly. Here is my code: function insertAfter(newNode, elem) { elem.parentNode.insertBefore(newNode, elem.nextSibling); } function addSwitchMenu() { var lastDD = dropdowns.switches.last(); var newDD = lastDD.cloneNode(); newDD.innerHTML = lastDD.innerHTML; var oldButton = document.getElementById("add-switch"); var newButton = oldButton.cloneNode(); var newBR = document.createElement("br"); oldButton.value = '-'; oldButton.id = 'remove-switch'; oldButton.onclick = function() { var index = dropdowns.switches.indexOf(newDD); dropdowns.switches.splice(index,1); lastDD.parentNode.removeChild(lastDD); oldButton.parentNode.removeChild(oldButton); newBR.parentNode.removeChild(newBR); updateResults(); } dropdowns.switches.push(newDD); console.log(newDD); console.log(lastDD.parentNode); insertAfter(newDD, lastDD); insertAfter(newButton, lastDD); insertAfter(newBR, lastDD); } And basically I call this function, then I call the remove function of the first one, then I call this function once more using the node that was created with the first one. I'm guessing it's something to do with the referencing node being removed, but the new node has a parentNode up until the other node is removed. Why? And how can I fix this?
has comment: http://stackoverflow.com/comment/129076229
has title: parentNode becomes null after removing previous child element
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/38422513

http://stackoverflow.com/q/24798578
type: UnansweredQuestion
has body: At the moment ,this code can create new columns dynamically.I would like to be able to give a unique name to all cells belonging to the mother column.NB:the mother column is the tallest of them all with three columns always.Any thing with less columns is a child. SO all the cells and the contents in the first group must have a unique name identifer like say name="Bx_1name" to identify them from the next mother's contents(BX_2name); Add 1 Name Add 2 Name Add 3 Name Javascript is wellcome too.the functionality must not be changed.it must be just like this; jsfiddle
type: Question
has answer: http://stackoverflow.com/a/24800306
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
has title: how to assign names to new table columns cells dynamically
has answer: http://stackoverflow.com/a/24798651

http://stackoverflow.com/q/24815094
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/24816540
tagged with: javascript
has answer: http://stackoverflow.com/a/24815591
accepted answer: http://stackoverflow.com/a/24815591
has body: I have the following file: var express = require('express'), http = require('http'), app = express(), httpServer = http.createServer(app); app.configure(function () { app.set('port', 3000); app.use(express.static(__dirname + '/public')); }); httpServer.listen(app.get('port'), function () { console.log("Express server listening on port %s.", httpServer.address().port); }); However this gives the follow errors: C:\var\www\stage.mayfieldafc.com&gt;nodemon http.js 18 Jul 01:19:29 - [nodemon] v1.2.1 18 Jul 01:19:29 - [nodemon] to restart at any time, enter `rs` 18 Jul 01:19:29 - [nodemon] watching: *.* 18 Jul 01:19:29 - [nodemon] starting `node http.js` C:\var\www\stage.mayfieldafc.com\http.js:8 app.configure(function () { ^ TypeError: Object function (req, res, next) { app.handle(req, res, next); } has no method 'configure' at Object.&lt;anonymous&gt; (C:\var\www\stage.mayfieldafc.com\http.js:8:5) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:906:3 18 Jul 01:19:29 - [nodemon] app crashed - waiting for file changes before starting... After installing both nodemon and express and I can see both folders inside of node_modules Also when console logging the return of express I see that it has correctly loaded the module. How can I verify my node install? Or better still fix it.
score: 0
tagged with: node.js
possible better answer: http://stackoverflow.com/a/24816540
type: AnsweredQuestion
has title: node.js not functioning correctly, windows 7

http://stackoverflow.com/comment/38686062
score: 1
comment on: http://stackoverflow.com/q/24902061
type: Comment
type: QuestionComment
has text: `console.log(user+"")`

http://stackoverflow.com/q/24851760
has comment: http://stackoverflow.com/comment/61745700
has answer: http://stackoverflow.com/a/24851984
tagged with: google-custom-search
upvote count: 3
downvote count: 2
answer count: 1
has body: This is maybe a stupid question, but I'm a newbie with javascript... I have a static website that uses google custom search (V2). The script provided by Google loads asynchronously and that is good, but there are just a few searches a day, so I'm looking for a solution to load custom search "stuff" only if a user clicks in the search form, to have a faster pageload. I'm using two separate divs, one for the searchbox (hidden on a div to make my custom style) and one for search results (pop-up layout). Search And later in the page Before closing the body tag, I've added the following code provided by Google The website also uses jquery. Is there a way to load the script only if (and when) a user clicks on the search field? I wish to provide this search service to my users, but only if necessary and without harming pageload speed. Thanks in advance. UPDATE: Problem solved using jquery and php. The Google custom search script that I'm using reloads the page adding some GET variables. This is a ugly solution, but I moved the google script to an external .js file and added this code into the page: <?php if(isset($_GET['cx'])) echo " "; else echo" "; ?> In this way, if the user visits the page for the first time the script will load only if he clicks on the form input, speeding up pageload. If the page reloads after search button clicked, the script is loaded automatically and all is working well. Bad solution, but at least a solution!
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38590882
score: 1
has comment: http://stackoverflow.com/comment/38590365
has comment: http://stackoverflow.com/comment/61746278
favorite count: 0
has title: How to load google custom search onclick
type: Question
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/24888987
favorite count: 0
has comment: http://stackoverflow.com/comment/38661047
type: Question
has comment: http://stackoverflow.com/comment/38662106
has comment: http://stackoverflow.com/comment/38661099
score: -1
has comment: http://stackoverflow.com/comment/38661403
has comment: http://stackoverflow.com/comment/38663055
answer count: 2
downvote count: 1
has body: I'm facing a problem for last 2 days with geocode in javascript. I'm getting the location from DB using php. and i passed the data to javascript variable. the data is below. i stored this data in the variable "locations" [['São Paulo, Brazil', 'Sky Ferreira @ Cine Joia - Sao Paulo, Brazil','314','15'],['Rua dos Ingleses, 209 - Morro dos Ingleses', 'Se Essa Rua Fosse Minha - Espetáculo de Brincar','1','31'],['São Bernardo do Campo - São Paulo, Brazil', 'Se Essa Rua Fosse Minha - Espetáculo de Brincar','2','31'],['Cine Joia - Praça Carlos Gomes, Se, São Paulo, Brazil', '::: LOBO + VESPAS MANDARINAS @ CINE JOIA :::','310','11'],['Rio de Janeiro, Centro, Rio, Brazil', '#GRIND - FESTA OFICIAL DE 16 ANOS @ALCA','315','16'],['Rua Vergueiro, Paraíso, São Paulo, Brazil', 'Se Essa Rua Fosse Minha - Espetáculo de Brincar','23','31'],['Clube da Aeronautica, Centro, Rio - Rio de Janeiro, Brazil', '#GRIND - BATALHA POP vs ROCK GARBAGE vs BRITNEY - DOMINGUEIRA MAIS ALTERNATIVA @ ALCA','316','35'],['Santa Catarina, Brazil', 'Nene no Cassino do Chacrinha! Djs Mauro Borges, Nene, Ricardo Motta.','317','36'],['Rua dos Ingleses, 209 - Morro dos Ingleses', 'St. Vincent - Brazilian Tour','308','31'],['Divinópolis - Minas Gerais, Brazil', 'LANCAMENTO OFICIAL DO NOVO CD DO MANEVA 5INCO CABEAS','309','10'],['Santa Catarina, Brazil', 'St. Vincent - Brazilian Tour','321','28'],['Rua Voluntários da Pátria, Santana, São Paulo, Brazil', 'St. Vincent - Brazilian Tour','320','29']] I'm passing the location to for loop to get the latitude and longitude to plot the markers in map. i'm using the following function var markers = {}; function initial_markers(locations){ for(var i=0;i&lt;locations.length;i++){ (function(address,attr_title,i,attr_id,cat_id) { console.log(i); geocoder.geocode({ 'address': address }, function(results) { var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location, icon:"http://maps.google.com/mapfiles/ms/icons/blue.png" }); markers[i] = marker; co…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38661305
has comment: http://stackoverflow.com/comment/38661208
has comment: http://stackoverflow.com/comment/38661698
has title: for loop fails to load the last iteration in geocode using javascript
has answer: http://stackoverflow.com/a/24902023
tagged with: google-maps
has answer: http://stackoverflow.com/a/24889056
upvote count: 0
tagged with: javascript

http://stackoverflow.com/a/24844697
has body: You just need to stash this in the outer function so that the callback can get to the right value: var moduleObj = this; // ... //populate the table names sql.performQuery(('xxxxxx xxxxx = \'BASE TABLE\' ' + 'AND TABLE_SCHEMA=\'' + sql.credentials.database + '\''),function(rows){ for (var index in rows){ moduleObj.tables[rows[index]['TABLE_NAME']] = true; // this fails } }); Also I would very strongly suggest not using a for ... in loop to iterate over the rows returned from the query. I'm not familiar with the API but I'm willing to bet that it's a real JavaScript array. You should use either a plain for loop with an index variable, or else a .forEach() call. Using for ... in for arrays is sort-of a bad practice for a few reasons, not the least of which is that it causes V8 (and maybe other runtimes) to abandon any attempt at serious optimization of a function's code in some cases. One of those cases is when you're using it on an array, apparently.
answers question: http://stackoverflow.com/q/24844682
type: Answer
has comment: http://stackoverflow.com/comment/38576712
has comment: http://stackoverflow.com/comment/38578409
has comment: http://stackoverflow.com/comment/38576660
upvote count: 1
has comment: http://stackoverflow.com/comment/38576684
has comment: http://stackoverflow.com/comment/38577153
score: 1
has comment: http://stackoverflow.com/comment/38577107
has comment: http://stackoverflow.com/comment/38576646
has comment: http://stackoverflow.com/comment/38576637
has comment: http://stackoverflow.com/comment/38576707
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24844682

http://stackoverflow.com/q/24846951
tagged with: sbt
has body: I'm using Play Framework 2.2.x and am having trouble getting JavaScript code coverage of my functional tests with Fluentlenium. I need an sbt plugin for Play that enables getting JavaScript code coverage for functional tests (Selenium,Fluentlenium...) I was told to use JSCover, but that is a very loosely-coupled solution that will require a lot of time to integrate into my current project. Is there a plugin that uses the JSCover library that'd be compatible with Play 2.2.x?
tagged with: javascript
has answer: http://stackoverflow.com/a/24846952
tagged with: playframework
answer count: 1
downvote count: 0
favorite count: 0
has title: Is there a JSCover SBT plugin for Play to get javascript coverage of my functional tests?
tagged with: playframework-2.2
tagged with: fluentlenium
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/comment/38614977
has text: I would stick with the other version that removes "selectedRow" from every element , then add . It helps a lot for clicking really fast and slow browsers. Just all around better IMO
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24864578

http://stackoverflow.com/comment/38470874
comment on: http://stackoverflow.com/q/24788171
score: 0
type: Comment
type: QuestionComment
has text: what what needs to be called to get a `msg` - that should return a promise.

http://stackoverflow.com/a/24786699
type: AcceptedAnswer
downvote count: 0
has body: Even better... when you query for ObjectA class, use the include method so you don't need to fetch ObjectB objects embedded inside. var query = new Parse.Query("ObjectA"); query.include("column-name-which-points-to-ObjectB"); query.find().then(function(results) { // ObjectB objects are fully fetched too. });
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/24786471
accepted answer of: http://stackoverflow.com/q/24786471

http://stackoverflow.com/comment/38485569
score: 2
has text: Not sure what phrases you tried on Google but `htaccess url` gives me some pretty clear tutorials e.g. [this](http://code.tutsplus.com/tutorials/using-htaccess-files-for-pretty-urls--net-6049) which was the first result.
comment on: http://stackoverflow.com/q/24796021
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24897620
has comment: http://stackoverflow.com/comment/38677805
answers question: http://stackoverflow.com/q/24897479
score: 0
has comment: http://stackoverflow.com/comment/38677612
type: Answer
has body: Set the hAxis.viewWindow.min and hAxis.viewWindow.max options: hAxis: { format: '####', viewWindow: { min: 2009, max: 2017 } }

http://stackoverflow.com/a/24856224
score: 2
answers question: http://stackoverflow.com/q/24816324
downvote count: 0
has comment: http://stackoverflow.com/comment/38632452
has comment: http://stackoverflow.com/comment/38599871
accepted answer of: http://stackoverflow.com/q/24816324
has comment: http://stackoverflow.com/comment/38600466
has body: The following solution assumes you are starting with a clean version of the leaderboard example. Step one: Declare a new collection to hold IP address and date information. This can be added just below the definition of Players. IPs = new Meteor.Collection('ips'); Step two: Replace the increment event with a call to our new method givePoints. Template.leaderboard.events({ 'click input.inc': function() { var playerId = Session.get('selected_player'); Meteor.call('givePoints', playerId, function(err) { if (err) alert(err.reason); }); } }); Step three: Define the givePoints method on the server (this.connection only works on the server). You can do this by inserting the following anywhere inside of the Meteor.isServer check or by creating a new file under the /server directory. Meteor.methods({ givePoints: function(playerId) { check(playerId, String); // we want to use a date with a 1-day granularity var startOfDay = new Date; startOfDay.setHours(0, 0, 0, 0); // the IP address of the caller ip = this.connection.clientAddress; // check by ip and date (these should be indexed) if (IPs.findOne({ip: ip, date: startOfDay})) { throw new Meteor.Error(403, 'You already voted!'); } else { // the player has not voted yet Players.update(playerId, {$inc: {score: 5}}); // make sure she cannot vote again today IPs.insert({ip: ip, date: startOfDay}); } } }); The complete code can be seen in this gist.
has comment: http://stackoverflow.com/comment/38601590
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38601190
type: Answer
has comment: http://stackoverflow.com/comment/38630995

http://stackoverflow.com/q/24757690
answer count: 0
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38412977
tagged with: javascript
has comment: http://stackoverflow.com/comment/38412730
has comment: http://stackoverflow.com/comment/38412593
has body: I have to use ffmpeg in my project to convert an audio file from wav t mp3,pcm and vox. my project is javascript/php built can anyone direct me how to use ffmpeg.I've been reading a lot and now that it depends on the command lines.but where to write these command lines.If someone can show me a demo of how to use it i will thankful I have found this function, but don't know how to give it the file to convert. function getFFMPEGWorker() { // regexps for extracting time from ffmpeg logs var durationRegexp = /Duration: (.*?), / var timeRegexp = /time=(.*?) /; var duration; var ffmpegWorker = new Worker('worker.js'); var durationLine; ffmpegWorker.addEventListener('message', function(event) { var message = event.data; console.log(message.type); if (message.type === "ready" &amp;&amp; window.File &amp;&amp; window.FileList &amp;&amp; window.FileReader) { // script loaded, hide loader $('#loading').hide(); } else if (message.type == "stdout") { console.log(message.data); } else if (message.type == "stderr") { console.log(message.data); // try to extract duration if (durationRegexp.exec(message.data)) { duration = timeToSeconds(durationRegexp.exec(message.data)[1]); } // try to extract time if (timeRegexp.exec(message.data)) { var time = timeToSeconds(timeRegexp.exec(message.data)[1]); if (duration) { $("#progress").text("Progress: " + Math.floor(time / duration * 100) + "%"); $("#progress").show(); } } } else if (message.type == "done") { var code = message.data.code; console.log(message.data); var outFileNames = Object.keys(message.data.outputFiles); console.log(outFileNames); if (code == 0 &amp;&amp; outFileNames.length) { var outFileName = outFileNames[0]; var outFileBuffer = message.data.outputFiles[outFileName]; var src = window.URL.createObjectURL(new Blob([outFileBuffer])); $("#downloadLink").attr('href', src); $("#download").show(); } else { $("#error").show(); } $("#converting").hide(); $("#progress").hide(); } }, false); return ffmpegWorker; } // create ffmpeg wo…
downvote count: 0
favorite count: 0
tagged with: ffmpeg
has title: using ffmpeg in my javascript code

http://stackoverflow.com/comment/38597481
type: Comment
type: QuestionComment
has text: May not be related but you should specify the content type header when outputting the search.php json
comment on: http://stackoverflow.com/q/24855252
score: 0

http://stackoverflow.com/comment/38602306
has text: In the above comment you are invoking the function but where is this ``getData`` defined?
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/24857474

http://stackoverflow.com/comment/38418932
has text: We need to see the markup and know the values in order to help.
comment on: http://stackoverflow.com/q/24760838
score: 5
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24884508
answers question: http://stackoverflow.com/q/24884263
has body: There is no usefull way to pause a php script. The neatest way for your job is to print the HTML code containing a placeholder (div) for the map oder ohter data, wait for the coord, send them as a ajax request to your PHP script, and then replace the empty div container (placeholder) with the real data.
has comment: http://stackoverflow.com/comment/38652413
has comment: http://stackoverflow.com/comment/38653240
upvote count: 2
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/q/24857698
accepted answer: http://stackoverflow.com/a/24859240
has comment: http://stackoverflow.com/comment/38602073
has comment: http://stackoverflow.com/comment/38602424
possible better answer: http://stackoverflow.com/a/24957775
has comment: http://stackoverflow.com/comment/38603380
type: AnsweredQuestion
tagged with: performance
has comment: http://stackoverflow.com/comment/38602134
has comment: http://stackoverflow.com/comment/38604812
has comment: http://stackoverflow.com/comment/38604051
has comment: http://stackoverflow.com/comment/38602266
has title: How can I cause a web browser to use 50% CPU
has answer: http://stackoverflow.com/a/24859240
has body: I am working with JavaScript and I want to test the performance of my script when the browser has heavy load. The method I'd like to employ is to have a script run that would cause the browser to use 50% CPU (of a single core of course) and than I would judge whether or not the script's performance is acceptable. My script draws on a canvas at the position of the cursor, so simple numbers from Firefox's and Chrome's developer tools aren't sufficient enough to gauge responsiveness. Currently I know the code below will cause 100% CPU usage, how can I make it only use 50%? &lt;script type="text/javascript"&gt; while (loop = true) { loop = true; } &lt;/script&gt;
type: Question
tagged with: testing
answer count: 2
has comment: http://stackoverflow.com/comment/38602442
has comment: http://stackoverflow.com/comment/38602194
tagged with: javascript
has comment: http://stackoverflow.com/comment/38602521
has comment: http://stackoverflow.com/comment/38604745
has comment: http://stackoverflow.com/comment/38602377
has comment: http://stackoverflow.com/comment/38602175
score: 0
has answer: http://stackoverflow.com/a/24957775
has comment: http://stackoverflow.com/comment/38602985

http://stackoverflow.com/q/24835495
has body: I want to be able to specify the style of a vector individually. So what I did is this: vectorLayer.features[1].style = {fillColor: "#8e0303", pointRadius: Math.random() * 50}; vectorLayer.redraw(); I got this from here: http://jsfiddle.net/DR/Udd4e/31/ However, I want to specify a StyleMap instead of a Style Something like this var my_style = new OpenLayers.StyleMap({ "default" : new OpenLayers.Style({ ... }), "select":new OpenLayers.Style({ ... }), )}; And assign that as the style (stylemap) of the vector. Is that possible? Thanks in advance. Jenia.
tagged with: openlayers
score: 0
has title: Assign stylemap to a individual vector
has answer: http://stackoverflow.com/a/24837439
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24837439
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/24798870
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24800254
has answer: http://stackoverflow.com/a/24800128
tagged with: javascript
has comment: http://stackoverflow.com/comment/38568009
tagged with: webstorm
has comment: http://stackoverflow.com/comment/38567819
has title: post data in node.js
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/24800128
has comment: http://stackoverflow.com/comment/38567956
has comment: http://stackoverflow.com/comment/38516839
has comment: http://stackoverflow.com/comment/38567724
tagged with: node.js
has answer: http://stackoverflow.com/a/24800386
has comment: http://stackoverflow.com/comment/38523876
tagged with: npm
has answer: http://stackoverflow.com/a/24800254
has body: I have a HTML file that includes: sub And in my node app.js file I write this lines for posting: app.post("/post" ,function(req ,res ){ console.log(req.body.user.name); res.send(req.body.user.name); }); But I can't post that data. After searching I found that I have to add this lines to node files: var bodyParser = require('body-parser'); app.use(express.bodyParser()); I install it with "npm install body-parser".But an error occurs. How can I fix this?
type: Question
has comment: http://stackoverflow.com/comment/38567661

http://stackoverflow.com/comment/38402518
score: 2
comment on: http://stackoverflow.com/q/24751987
has text: This is pretty straight-forward javascript. Have you tried anything yet? Are you getting stuck on something? See [What have you tried?](http://mattgemmell.com/what-have-you-tried/)
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38747918
comment on: http://stackoverflow.com/q/24899375
score: 0
type: Comment
type: QuestionComment
has text: @m_downey Yes, you would estimate the start byte of where you think your data will be, and then run until you get a valid MPEG frame. (All the codecs I know of will let you run junk data in until you get a valid frame... they do the stream synchronization for you.) This isn't something that you can readily change though. This would be up to the Chromium developers, or the developers of whatever code Chrome is using to play back MP3. As others have said, that might be system dependent. Browsers have done a decent job of hiding the HTML5 audio implementation from you, but its rough.

http://stackoverflow.com/a/24812106
has body: As I can see the final parameters in the url are not being concatenated properly. 'http://reportserverlink/" &amp; Fields!PDFFileName.Value &amp; ' If you are trying to concatenate a value inside a variable inside a String you should try something like 'http://reportserverlink/?' + foo1 + '&amp;' + foo2
has comment: http://stackoverflow.com/comment/38516895
score: 0
answers question: http://stackoverflow.com/q/24810803
type: Answer

http://stackoverflow.com/comment/38560279
score: 0
has text: You're on vacation; throw away the gizmos and enjoy a few days off the grid! ... Anyway, what you want is probably possible with just Greasemonkey alone, but there's no way for us to see details that may be crucial or to test solutions.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24835559

http://stackoverflow.com/q/24876256
has comment: http://stackoverflow.com/comment/38637641
tagged with: javascript
answer count: 2
downvote count: 3
has answer: http://stackoverflow.com/a/24876285
has answer: http://stackoverflow.com/a/24876287
favorite count: 0
has title: Javascript logic statement - I got 99 problems
has body: ...but a glitch ain't one. Hey there, I am still learning so I apologize for the simple question. I'm just trying out a hypothetical logic statement that would still make sense using javascript. Example: if (problems == 99) { glitch != 1 } Basically, I'd like it to mean "If I have 99 problems, a glitch isn't one of them" in the shortest code I can muster. Any help is really appreciated!!
type: UnansweredQuestion
score: -3
has comment: http://stackoverflow.com/comment/38637957
upvote count: 0
has comment: http://stackoverflow.com/comment/38638262
type: Question

target
tags question: http://stackoverflow.com/q/24759175
type: Tag
tag name: target
tags question: http://stackoverflow.com/q/24825563

http://stackoverflow.com/q/24895374
has answer: http://stackoverflow.com/a/24895694
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24895694
type: Question
tagged with: boolean
has answer: http://stackoverflow.com/a/24895767
accepted answer: http://stackoverflow.com/a/24895767
score: 0
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38674041
has body: I'm setting up some simple booleans that test for mobile layouts and touch devices, but I'm having some difficulty making the code more compact. isTouch tests for touch devices. mobile tests for when the screen width is below 769px. My final if/else statement is to test if I'm on a mobile touch device (iPad, phone, whatever). I can alert the output and everything is expected, but the static_element still appears instead of swiper_element. I know I'm missing something with my booleans. Help a rookie out? $(document).ready(function () { var windowWidth, isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints &gt; 0)), mobile, touchDevice; $(window).on('load resize', function () { windowWidth = $(window).width(); if (windowWidth &lt; 769) { mobile = true; } else { mobile = false; } if (isTouch = true) { touchDevice = true; } else { touchDevice = false; } }); if (touchDevice &amp;&amp; mobile) { $('.static_element').hide(); $('.swiper_element').show(); } else { $('.static_element').show(); $('.swiper-element').hide(); } });
has comment: http://stackoverflow.com/comment/38673936
has title: Unexpected if/else results using booleans
has comment: http://stackoverflow.com/comment/38673860
has comment: http://stackoverflow.com/comment/38673392

http://stackoverflow.com/comment/38653536
type: Comment
type: QuestionComment
has text: Try passing a single string with comma separated selectors (which is what the function expects), rather than three individual strings.
score: 0
comment on: http://stackoverflow.com/q/24885153

http://stackoverflow.com/comment/38595998
has text: Part 2 : probably because you are changing the scope from outside angular and when you do that you need to tell angular using `$apply`
comment on: http://stackoverflow.com/q/24854163
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24869024
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24866131
answers question: http://stackoverflow.com/q/24866131
upvote count: 2
type: AcceptedAnswer
has body: To draw the highlights, flot is still calling the someFunc function and someFunc.calls is still incrementing and controling how the hightlights are drawn. So, after the $.plot I'd just "turn if off": someFunc.calls = 0; somePlot = $.plot($("#placeholder"), [ d1 ], options); someFunc.calls = false; Where someFunc is: function someFunc(ctx, x, y, radius, shadow) { if (someFunc.calls === false) { // we are highlighting, draw it normal ctx.arc(x, y, radius, 0, shadow ? Math.PI : Math.PI * 2, false); } else { // intial draw, do fancy points... someFunc.calls++; if (someFunc.calls % 2 == 0) { ctx.arc(x, y, radius, 0, shadow ? Math.PI : Math.PI * 2, false); } else { ctx.arc(x, y, 0, 0, shadow ? Math.PI : Math.PI * 2, false); } } } Updated fiddle.

http://stackoverflow.com/comment/38575315
comment on: http://stackoverflow.com/q/24843443
type: Comment
type: QuestionComment
has text: just need to make the javascript into jquery
score: 0

http://stackoverflow.com/a/24902087
has comment: http://stackoverflow.com/comment/38707693
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/24894355
has body: You primary issue is that your AJAX call is returning a data object not a data list. Replace: var my_obj_review = data; with: var my_obj_review = data.results; Additionally, this: $(self).parent().find("#see_all_reviews").text(review_text); can be replaced with this: $("#see_all_reviews").text(review_text); In either case, your each loop is going to replace that element with the last item in the list. Are you trying to append reviews to that div? Finally, you may need to initialize your dialogue: $("#see_all_reviews").dialog({ autoOpen: false, show: "blind", hide: "blind" }); Here's your code refactored slightly: $(document).ready(function() { $(".all_reviews").click(function() { var item_id = $(this).attr("name"); $.post('contr/get_reviews', { item_id: item_id }, function (data) { $.each(data.results, function (n, result) { $("#see_all_reviews").text(result.review_text); }); // Above loop equivalent to: $("#see_all_reviews").text(data.results[data.length-1].review_text); }, "json") .error(function(data) { $("#see_all_reviews").text(data.message); }); $("#see_all_reviews").dialog(); }); }); And here's a fully functioning fiddle: http://jsfiddle.net/klenwell/d7r7s/
has comment: http://stackoverflow.com/comment/38811219
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38817626
type: Answer
answers question: http://stackoverflow.com/q/24894355
has comment: http://stackoverflow.com/comment/38691205

http://stackoverflow.com/comment/38459648
has text: Yeah initially I was just trying to get what I wanted to work so just did "for (var i = 0; i <= 36; i++){ eval("var t" + i + "= 0");" but I need to re-factor it i think...
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24781888
score: 0

http://stackoverflow.com/comment/38550563
has text: You can also see that by running `npm root -g`
type: AnswerComment
comment on: http://stackoverflow.com/a/24830607
type: Comment
score: 128

variables
tag name: variables
tags question: http://stackoverflow.com/q/24896824
tags question: http://stackoverflow.com/q/24878585
tags question: http://stackoverflow.com/q/24820416
tags question: http://stackoverflow.com/q/24890107
tags question: http://stackoverflow.com/q/24763421
tags question: http://stackoverflow.com/q/24850454
tags question: http://stackoverflow.com/q/24752557
type: Tag
tags question: http://stackoverflow.com/q/24870392
tags question: http://stackoverflow.com/q/24827611
tags question: http://stackoverflow.com/q/24896284
tags question: http://stackoverflow.com/q/24904830
tags question: http://stackoverflow.com/q/24798835
tags question: http://stackoverflow.com/q/24799560
tags question: http://stackoverflow.com/q/24792987
tags question: http://stackoverflow.com/q/24779419

http://stackoverflow.com/q/24752638
tagged with: javascript
tagged with: jquery
tagged with: fuelux
score: 0
answer count: 1
has body: I've been stuck in this problem. I am using fuelux treeview to display a list of categories and folders. What I want is to display the expanded treeview on page load. I can't seem to achieve this. I have found out that the tree folder must be clicked before the folder items are populated. So i tried to use $('.tree-folder').trigger('click'); to trigger a click so that it may expand automatically. But this doesn't seem to work. I've tried $('.tree-folder').click(); but it wont work too. So how do you automatically trigger a click or just how do you automatically expand the fuelux treeview? Any ideas? Thanks in advance.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38403509
has answer: http://stackoverflow.com/a/26811208
tagged with: treeview
type: Question
has title: How to programmatically expand fuelux treeview folders using jQuery?

http://stackoverflow.com/comment/38617667
has text: this is fired before the form is submitted - you might want to look at `$.ajax`.
score: 1
comment on: http://stackoverflow.com/q/24865991
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24898196
has comment: http://stackoverflow.com/comment/38679334
type: Question
has body: how i get information from array and send it to input? i have a filter, after filtering information i have 2 value (v1,v2) and 2 button - for v1 and v2. I need to do- by pressing the button v1 information from mynewvarv1 go to input whith id='one' - can you help me to write this function? sorry for my english var myvar = [ // filter start {name:'v1',val1:'31',val2:'',val3:true,val4:false,val5:false,val6:false,}, {name:"Срочный на 91 день",val1:'91',val2:'',val3:true,val4:false,val5:false,val6:false,}, {name:"v2",val1:'181',val2:'',val3:true,val4:false,val5:false,val6:false,}, ]; document.getElementById('filterButton').onclick = function(){ var filter = []; filter.push(document.getElementById('val1').options[document.getElementById('val1').selectedIndex].value); filter.push(document.getElementById('val2').value); filter.push(rbvalue('val3')=='1'); filter.push(rbvalue('val4')=='1'); filter.push(rbvalue('val5')=='1'); var filtered_data = []; var data_accepted = true; for(i=0;i<myvar.length;i++){ data_accepted = true; for(j=0;j<filter.length;j++){ if(filter[j]!=='' && filter[j]!=myvar[i][('val'+(j+1))]){ data_accepted = false; } } if(data_accepted){ filtered_data.push(myvar[i]); } } function getmesseg (){ container.innerHTML = ' v1 Try it ' container.innerHTML = ' v2 Try it ' var mynewvarv1 = [ {vaal1:value="12",vaal2:'10.2',vaal3:'9',} ]; var mynewvarv2 = [ {vaal1:value="12",vaal2:'10.2',vaal3:'9',} ]; //what the function this needs??? }; function ab(){ if(filtered_data[i].name == "v1","v2") {getmesseg(); }}; var container = document.getElementById('container'); container.innerHTML = ''; for(i=0;i<filtered_data.length;i++){ container.innerHTML+=filtered_data[i].name+' '; ab(); } }; function rbvalue(html_name){ var undefined,default_value,i,rb_collection = document.getElementsByName(html_name); if(rb_collection!==undefined){ default_value = rb_collection[0].value; } for(i=0;i<rb_collection.length;i++){ if(rb_collection[i].checked){ return rb_collection[i].value; } } ret…
upvote count: 0
has comment: http://stackoverflow.com/comment/38679087
has comment: http://stackoverflow.com/comment/38679532
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/24898671
has comment: http://stackoverflow.com/comment/38679398
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/24898671
has title: get information from array to input
type: AnsweredQuestion
downvote count: 1

http://stackoverflow.com/comment/38680444
type: Comment
has text: Maybe you have misunderstood my question: i need to get the submit button enabled if ONE of the options, checkboxes or textboxes is select/ filled in. Also in the select i need the value to be empty 'cause of the php file. Also, the html file is generated dynamically and can be very huge
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24896370

http://stackoverflow.com/comment/38420061
comment on: http://stackoverflow.com/q/24761367
has text: Yes, chaining causes the promises to resolve sequentially, when I need them to resolve in parallel. My application doesn't need the answers of one promise before executing the next, but I need do all results at once at the end of their execution.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38671676
type: Comment
has text: Well, what you included doesn't have an error.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24894517

http://stackoverflow.com/comment/38636410
type: QuestionComment
score: 4
has text: This happens because arrays in javascript are passed [by reference](http://orizens.com/wp/topics/javascript-arrays-passing-by-reference-or-by-value/), if you want to pass them by value, use `var testArray = testFunction(myArray.slice());`, also, indent your code. (=
comment on: http://stackoverflow.com/q/24875627
type: Comment

http://stackoverflow.com/comment/38476810
comment on: http://stackoverflow.com/q/24791191
type: Comment
type: QuestionComment
has text: @Jnatalzia Why would that be a problem? The function is called from inline handler, it should exist at the time user clicks the button. Multiple syntax errors in the code causes the function being not defined.
score: 0

http://stackoverflow.com/q/24841476
has answer: http://stackoverflow.com/a/24841516
accepted answer: http://stackoverflow.com/a/24841485
has title: Cannot read property 'push' of undefined when combining arrays
type: AnsweredQuestion
upvote count: 86
has answer: http://stackoverflow.com/a/77023191
type: Question
score: 86
has answer: http://stackoverflow.com/a/35789645
has answer: http://stackoverflow.com/a/59298516
has body: When pushing an array's contents to another array I get "Uncaught TypeError: Cannot read property 'push' of undefined" error in this snippet. var order = new Object(), stack = []; for(var i=0;i&lt;a.length;i++){ if(parseInt(a[i].daysleft) == 0){ order[0].push(a[i]); } if(parseInt(a[i].daysleft) &gt; 0){ order[1].push(a[i]); } if(parseInt(a[i].daysleft) &lt; 0){ order[2].push(a[i]); } } Why do I get this error in the second if statement ? Thanks a lot!
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/38864109
possible better answer: http://stackoverflow.com/a/52091530
tagged with: console
has answer: http://stackoverflow.com/a/52091530
has answer: http://stackoverflow.com/a/57455729
has answer: http://stackoverflow.com/a/24841485
answer count: 10
has answer: http://stackoverflow.com/a/66166985
favorite count: 0
linked to: http://stackoverflow.com/q/8925820
has answer: http://stackoverflow.com/a/47224488

http://stackoverflow.com/comment/38746426
comment on: http://stackoverflow.com/a/24932612
type: Comment
has text: @DevendraSoni: Maybe you should try other GUI components rather than Kendo UI.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38585646
type: Comment
comment on: http://stackoverflow.com/a/24849248
score: 0
type: AnswerComment
has text: its states angular.identity is not defined.

http://stackoverflow.com/q/24887497
favorite count: 0
has body: I am using var selectOpt = new Array("Pune","Karad","Kolhapur","Satara","Sangli"); But want to pass array fetch from database.
has comment: http://stackoverflow.com/comment/38659623
has answer: http://stackoverflow.com/a/24889343
type: UnansweredQuestion
tagged with: php
downvote count: 2
has comment: http://stackoverflow.com/comment/38659169
type: Question
has comment: http://stackoverflow.com/comment/38658181
has comment: http://stackoverflow.com/comment/38658624
score: -2
has comment: http://stackoverflow.com/comment/38658157
tagged with: javascript
linked to: http://stackoverflow.com/q/4935632
has comment: http://stackoverflow.com/comment/38658893
has comment: http://stackoverflow.com/comment/38658388
upvote count: 0
answer count: 1
has title: how to pass php array fetch from database to javascript variable

lightbox2
tags question: http://stackoverflow.com/q/24832712
type: Tag
tag name: lightbox2
tags question: http://stackoverflow.com/q/24849220

cors
tags question: http://stackoverflow.com/q/24893762
type: Tag
tags question: http://stackoverflow.com/q/24783675
tag name: cors
tags question: http://stackoverflow.com/q/24818246
tags question: http://stackoverflow.com/q/24767944
tags question: http://stackoverflow.com/q/24776771
tags question: http://stackoverflow.com/q/24897723
tags question: http://stackoverflow.com/q/24869558
tags question: http://stackoverflow.com/q/24777699
tags question: http://stackoverflow.com/q/24876597
tags question: http://stackoverflow.com/q/24889382
tags question: http://stackoverflow.com/q/24776062
tags question: http://stackoverflow.com/q/24884267
tags question: http://stackoverflow.com/q/24907341
tags question: http://stackoverflow.com/q/24766616
tags question: http://stackoverflow.com/q/24900174
tags question: http://stackoverflow.com/q/24887199

http://stackoverflow.com/q/24880815
tagged with: animation
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/24881078
type: AnsweredQuestion
has title: Parent div become wider without animation when child element show/hide with Jquery UI animate function
has answer: http://stackoverflow.com/a/24881229
possible better answer: http://stackoverflow.com/a/24881078
type: Question
has answer: http://stackoverflow.com/a/24881179
has answer: http://stackoverflow.com/a/24881062
has answer: http://stackoverflow.com/a/24881245
tagged with: javascript
answer count: 6
has body: I am having problem that when I try to show/Hide div element with jquery animation it open up smoothly, But its parent does not open up smoothly. Same happens on hiding. Hence my whole page content take a jerk. Demo: http://jsfiddle.net/neDZP/7/ HTML: INDEX A-Z A B C D E E F G H I J K L M O P Q R S T U V W X Y Z This paragraph should be slide down smothly Javascript: $(function() { // slide effect for showing and hiding A-Z header block $('#block-block-48 > .content').hide(); $('#block-block-48 h2').click(function(){ var effect = 'slide'; var options = { direction: 'up' }; var duration = 300; $("#block-block-48 > .content").stop().toggle(effect, options, duration); }); }); css: #block-block-48 { background: none repeat scroll 0 0 #ff0000; } #block-block-48 h2 { background: #035d8e; color: #ffffff; cursor: pointer; font-family: sans-serif; font-size: 16px; margin: 0; padding: 6px 15px 6px 0; text-align: right; text-decoration: none; } #block-block-48 .content { margin: 0; text-align: right; } #block-block-48 ul li { display: inline-block; float: left; list-style: none outside none; margin: 0 0 0 2px; } #block-block-48 ul li a { background: none repeat scroll 0 0 #035d8e; color: #ffffff; display: block; float: left; font-family: sans-serif; font-size: 16px; margin: 0; padding: 0 8px; } #block-block-48 ul { display: inline-block; margin: 5px 0 0; padding: 0; }
score: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/24881162
accepted answer: http://stackoverflow.com/a/24881179

http://stackoverflow.com/q/24780901
accepted answer: http://stackoverflow.com/a/24781089
has title: HTML/Javascript drawing arc in canvas doesn't work - rectangle/line is fine
type: AnsweredQuestion
type: Question
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: Having some trouble with a HTML5/Javascript canvas code snippet. Please see below for the relevant sections. The two squares and the line show up without issue - but the circle/arc does not.. Why is this?! Something wrong with my "arc" code?... Thanks. HTML file: &lt;section id="main"&gt; &lt;canvas id="canvas" width="600" height="400"&gt; Requires modern browser. &lt;/canvas&gt; &lt;!-- START JAVASCRIPT --&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt; &lt;/script&gt; &lt;script src="js/canvas.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function() { CV.initialize(); }); &lt;/script&gt; Javascript file: CV.initialize = function() { console.log('start'); cv = $('#canvas')[0]; canvas = cv.getContext('2d'); canvas.beginPath(); canvas.arc(200, 200, 150, Math.Pi, 0, false); canvas.closePath(); canvas.stroke(); canvas.strokeStyle = "blue"; canvas.strokeRect(10, 10, 50, 50); canvas.fillRect(100, 100, 150, 150); canvas.beginPath(); canvas.moveTo(300,300); canvas.lineTo(400,350); canvas.closePath(); canvas.stroke(); };
answer count: 1
has answer: http://stackoverflow.com/a/24781089

http://stackoverflow.com/q/24877670
has comment: http://stackoverflow.com/comment/38640440
has title: Cannot read property from JSON Array
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38640659
has body: I'm creating a text based game with Javscript and I am having some issues with referencing a JSON array. var cRecipes = []; function craftItem(id){ var n = cRecipes[id].name; var t = cRecipes[id].type; var i1 = cRecipes[id].item1; var a1 = parseInt(cRecipes[id].amount1); var i2 = cRecipes[id].item2; var a2 = parseInt(cRecipes[id].amount2); for (i = 0; i &lt; inventory.length; i++){ if (inventory[i].item == i1 &amp;&amp; inventory[i].amount &gt;= a1){ var inv1 = parseInt(inventory[i].amount) parseInt(inventory[i].amount) -= a1; a1 = 0; } if (inventory[i].item == i2 &amp;&amp; inventory[i].amount &gt;= a2){ parseInt(inventory[i].amount) -= a2; a2 = 0; } } if (a1 == 0 &amp;&amp; a2 == 0){ if (t == "Hat"){ cHat = products[rId].name; command(products[rId].effect); p(n + " crafted"); } else { p("Insufficient items"); } } } function loadCrafting(){ cRecipes = [ {"name":"Mega Fedora", "type":"Hat", "item1": "Euphorite", "amount1":4, "item2":"Essence Of Euphoria", "amount2":2, "effect":""}, {"name":"Mega Fedora 2", "type":"Hat", "item1": "Euphorite", "amount1":4, "item2":"Essence Of Euphoria", "amount2":2, "effect":""}, ]; c(); p("-- Your Crafting --"); back(); for (cr = 0; cr &lt; cRecipes.length; cr++){ p("&lt;span class='choice' id='c"+ cr + "'&gt;" + cRecipes[cr].name +", " + cRecipes[cr].type + ", " + cRecipes[cr].item1 + " x" + cRecipes[cr].amount1 + ", " + cRecipes[cr].item2 + " x" + cRecipes[cr].amount2 + "&lt;/span&gt;"); $("#c" + cr).click(function(){craftItem(cr);}); } } When running the script, I am given the following error. Uncaught TypeError: Cannot read property 'name' of undefined I have used similar methods with other parts of my game and have had no issues so this
has comment: http://stackoverflow.com/comment/38640138
has comment: http://stackoverflow.com/comment/38640325
has comment: http://stackoverflow.com/comment/38640206
answer count: 0
has comment: http://stackoverflow.com/comment/38640344
type: Question
has comment: http://stackoverflow.com/comment/38640544
tagged with: javascript
has comment: http://stackoverflow.com/comment/38640333
score: 0

http://stackoverflow.com/comment/38678840
score: 0
type: AnswerComment
type: Comment
has text: It's easy to use, and the basic pack is free. Look it up and let me know if you have any questions.
comment on: http://stackoverflow.com/a/24897403

http://stackoverflow.com/a/36051623
downvote count: 0
score: 1
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/24907229
has body: Here is one created by the Google Chrome team: https://github.com/GoogleChrome/proxy-polyfill It's not a full implementation, though.

http://stackoverflow.com/comment/38531869
type: Comment
type: QuestionComment
has text: I hope you understood the modification: i deleted the unbind() . Because you already had an IF in the mouseenter event, that worked perfectly. No need to unbind mouseenter . Just check inside it if you want to show or not the blue div. The event is there all the time
comment on: http://stackoverflow.com/q/24806733
score: 0

http://stackoverflow.com/q/24835356
has comment: http://stackoverflow.com/comment/38560038
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38559758
score: 2
downvote count: 0
has title: Javascript variable scope inside an ajax callback
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/38559584
has body: var x = this; $.post(some_url, some_data).always(function(){ var y = x; var some_other_data = { hi: "hi" }; var posting = $.post(some_other_url, some_other_data); posting.done(function (data, b, c) { do_something(); }).fail(function (xhr) { var response = xhr.responseText; //HERE! //y is not defined here! //x is defined here! //if I get rid of var y = x from above, x is not defined anymore! debugger }); }); Could anyone give me insight what is going on with the scopes?
tagged with: javascript
has comment: http://stackoverflow.com/comment/38559684
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/24835489
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/38453304
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24767465
has text: Care about what Lennart said. Only use content script if you need to access the DOM of a page, for popup, and option page, there is a special manifest declaration :) see : https://developer.chrome.com/extensions/manifest
type: AnswerComment

http://stackoverflow.com/comment/38553585
comment on: http://stackoverflow.com/a/24831557
type: AnswerComment
type: Comment
has text: 60*60*1000 is 1 hour. *24 is one day. *2*24 is two days
score: 0

http://stackoverflow.com/q/24859035
answer count: 1
tagged with: c#
tagged with: javascript
type: UnansweredQuestion
has body: This is my javascript code for a datepicker. &lt;script type="text/javascript"&gt; new datepickr("datepick1", { 'dateFormat': 'm/d/y' }); &lt;/script&gt; This works fine for an html textbox like: &lt;input id="datepick1"&gt; But does not work with an asp.net control like: &lt;asp:TextBox ID="datepick1" name="datepick1" runat="server"&gt;&lt;/asp:TextBox&gt; Please help! I am new to asp.net. So not well versed with it.
tagged with: asp.net
has answer: http://stackoverflow.com/a/24859100
type: Question
has title: Unable to use js script from asp.net control textbox
tagged with: datepicker
tagged with: http://stackoverflow.com/tag/html
score: 0

http://stackoverflow.com/comment/38535862
type: Comment
comment on: http://stackoverflow.com/a/24823001
has text: That's it! I'll go through your answer over and over until I actually understand what happened there, but this is exactly what I meant. Thank you!
type: AnswerComment
score: 0

http://stackoverflow.com/q/24764578
duplicate of: http://stackoverflow.com/q/17446646
score: 0
upvote count: 1
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/38425942
tagged with: javascript
has comment: http://stackoverflow.com/comment/38427185
has body: If I create an object in JavaScript and then add a function with the prototype keyword, why can the two names not be different? I have the function named getName and another named whatName. I cannot call whatName without an error. What is the difference between naming a function and an anonymous function? Which is the more preferred way of doing this? Code: Person.prototype.getName = function whatName() { return this.name; }; Code: &lt;script&gt; var Person = function Person(n,f,m,l) { this.name = n; this.lname = l; this.fname = f; this.mname = m; this.callMeth1 = function jjj() { } this.callMeth2 = function () { } this.callMeth3 = function () { } }; Person.prototype.getName = function () { return this.name; }; var test = new Person("Doug"); Person.prototype.sayMyName = function() { alert('Hello, my name is ' + this.getName()); }; test.sayMyName(); &lt;/script&gt; Code: function callMyMeth4 (a,b) { var aaa = a; var bbb = b; } var Person = function Person(n,f,m,l) { this.name = n; this.lname = l; this.fname = f; this.mname = m; this.callMeth1 = function () { } this.callMeth2 = function () { } this.callMeth3 = function () { } this.callMeth3 = callMyMeth4(a,b); };
accepted answer: http://stackoverflow.com/a/24764600
has title: What is the difference in names in an object function prototype?
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/38425899
linked to: http://stackoverflow.com/q/17446646
has comment: http://stackoverflow.com/comment/38425857
has answer: http://stackoverflow.com/a/24764600

http://stackoverflow.com/a/24836812
answers question: http://stackoverflow.com/q/24836801
has comment: http://stackoverflow.com/comment/38562587
downvote count: 0
type: Answer
upvote count: 1
has body: This should work fine—just make sure that the .js file making the call is included in the webpage second. (When the browser is looking through script.js and sees sortCardsByMana(cards, false);, it has no idea what you're talking about—yet!)
score: 1

http://stackoverflow.com/a/24851906
type: Answer
has body: You need to create a reference to the context you want to refer to inside the callback before you call requestAnimationFrame, just like you would with a normal event callback. Var that = this; requestAnimationFrame(function(){ that.doSimething(); });
has comment: http://stackoverflow.com/comment/38611623
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24851740
has comment: http://stackoverflow.com/comment/38591592
has comment: http://stackoverflow.com/comment/38612382
accepted answer of: http://stackoverflow.com/q/24851740
score: 0

http://stackoverflow.com/q/24807916
has answer: http://stackoverflow.com/a/24808849
has answer: http://stackoverflow.com/a/24808632
accepted answer: http://stackoverflow.com/a/24808632
favorite count: 0
tagged with: angularjs
upvote count: 1
possible better answer: http://stackoverflow.com/a/24808656
type: AnsweredQuestion
score: 1
has title: How $q works in angularJs
type: Question
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/q
has answer: http://stackoverflow.com/a/24808656
has body: I like to know how $q works in angular , lets say i a have few lines of code to execute. var app = angular.module('app', []); app.controller('HelloCtrl', function ($q, $scope) { $scope.Title = "Promise Demo"; function asyncGreetings(name) { var deferred = $q.defer(); setTimeout(function() { deferred.notify('About to greet ' + name + '.'); if (name == "binson") { deferred.resolve("Hello " + name); } else { deferred.reject("Greeting not allowed "); } }, 5000); return deferred.promise; }; $scope.CurrentName = ""; var promise = asyncGreetings('binson'); promise.then(function(greeting) { $scope.CurrentName='Success: ' + greeting; }, function(reason) { $scope.CurrentName ='Failed: ' + reason; }, function (update) { $scope.Progress = 'Got notification: ' + update; }); }); This is sample code, here a mock async function asyncGreetings() and will execute after 5 seconds, what i want to show a progress ( a simple alert box or any thing ) until the promises collected to the caller, i think i configured the caller function properly with 3 parameters (success,fails,progress). but the progress handler is not working.. what is the problem here, and how i can solve this.
answer count: 3
downvote count: 0

http://stackoverflow.com/comment/38630434
has text: OK! I understand.. my mistake was the best practice to identify Dom´s components, but I think with ID is enough. Thanks Lorenz!
comment on: http://stackoverflow.com/a/24872468
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38459576
has text: I don't see any error in your fiddle, it is working completly fine...
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24780854

http://stackoverflow.com/comment/38597985
has text: Nashorn should really check the interrupted status of the thread, which should be set by the `Future.cancel(true)` call, but it seems it doesn't do this. You may be able to submit this as a bug.
type: QuestionComment
comment on: http://stackoverflow.com/q/24855182
score: 0
type: Comment

http://stackoverflow.com/comment/46593851
type: QuestionComment
type: Comment
has text: mostly duped http://stackoverflow.com/questions/8869372/how-do-i-automatically-play-a-youtube-video-iframe-api-muted
comment on: http://stackoverflow.com/q/24868226
score: 0

http://stackoverflow.com/q/24754614
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24756471
tagged with: ajax
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/24756471
has title: Setting WebGL vertexAttribPointer after loading mesh: why is a delay required?
has body: I'm writing a web page which renders a 3d-model in a viewport using WebGL, and I'm confused as to why a delay is required after I load a 3d model. The 3d-model is an .OBJ file and I use a library (K3D.js) for loading &amp; parsing .OBJ files. I realize that the file has to be loaded asynchronously into the browser. But as far as I understand, the library handles that part. Here's what the K3D load function looks like: K3D.load = function(path, resp) { var request = new XMLHttpRequest(); request.open("GET", path, true); request.responseType = "arraybuffer"; request.onload = function(e){resp(e.target.response);}; request.send(); } So when K3D finishes loading the file, it presumably executes the function stored in request.onload , which I supply in my Mesh class (in the meshFromOBJ method): Mesh.prototype.meshFromArray = function( vertexArray, normalArray ) { this.vbo = this.gl.createBuffer(); //normals are left out for now this.numVertices = vertexArray.length / 3.0; this.gl.bindBuffer( this.gl.ARRAY_BUFFER, this.vbo ); this.gl.bufferData( this.gl.ARRAY_BUFFER, new Float32Array( vertexArray ), this.gl.STATIC_DRAW ); this.gl.bindBuffer( this.gl.ARRAY_BUFFER, null ); }; Mesh.prototype.meshFromOBJ = function( file ) { var that = this; var loader = function( data ) { var model = K3D.parse.fromOBJ( data ); var array = K3D.edit.unwrap( model.i_verts, model.c_verts, 3 ); var norms = K3D.edit.unwrap( model.i_norms, model.c_norms, 3 ); that.meshFromArray( array, model.c_norms ); } K3D.load( file, loader ); }; In my main script I load the mesh, and set up vertex attribute pointers. I noticed that I had to place an alert between loading the mesh and setting the pointers, or else the browser would throw, amongst others, the vertexAttribPointer: must have valid GL_ARRAY_BUFFER binding error. The relevant section of my script: mesh = new ngl.Mesh( webgl ); mesh.meshFromOBJ( "cow.obj" ); //set the vertex attribute pointer with a delay //otherwise, the mesh doesn't seem to exist yet…
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/38528504
has text: http://www.chrome-allow-file-access-from-file.com/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24818931
score: 0

http://stackoverflow.com/q/24843942
has body: I need to add styling to a before: element dynamically. On my page, I have the following container &lt;p class="stepNode 203"&gt;&lt;/p&gt; I dynamically added styling to the page to set a background image to this element: $('head').append('&lt;style&gt; .stepNode.'+node_id+':before {background: url("'+$(divs[k]).data('image')+'");}&lt;/style&gt;'); produces: &lt;style&gt; .stepNode.203:before {background: url("http://cdn.sheknows.com/articles/2013/04/Puppy_2.jpg");} &lt;/style&gt; But upon inspecting the element, this styling is never applied. Notably, when I change the style to exclude the numerical class, the background is applied properly: &lt;style&gt; .stepNode:before {background: url("http://cdn.sheknows.com/articles/2013/04/Puppy_2.jpg");} &lt;/style&gt; Any ideas how to fix this problem? Do I need to do anything to reapply a style if it's added dynamically?
favorite count: 0
has answer: http://stackoverflow.com/a/24843993
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
downvote count: 0
has title: Applying Styling to :before Element Dynamically
score: 1
has answer: http://stackoverflow.com/a/24844014
accepted answer: http://stackoverflow.com/a/24844014
type: Question
tagged with: javascript
tagged with: jquery
answer count: 3
possible better answer: http://stackoverflow.com/a/24844007
upvote count: 1
has answer: http://stackoverflow.com/a/24844007

http://stackoverflow.com/q/24798208
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: jquery-select2
has body: I'm using select2 on a select that I'm filling with data dynamically (using json and other filters) all with a function called list(). I would like to call list() each time the dropdown is opened to refresh the data. The only way I could make this happen was calling .select2("destroy").select2() My problem is that it's working only when I'm initiating it from another element. Let's say $(".header").click(function() { ... }) It's not working when I call any of the built-in events (select2-opening, select2-open, select2-focus...). Any ideas how I can call it upon opening the dropdown select? EDIT: I was able to solve this by simply calling list() on event "select2-opening". It starts with .empty() and then starts filling up the &lt;select&gt; on which I apply the select2 plugin. EDIT2: A better solution was calling the event "select-focus", which reacts better in real-time.
tagged with: html-select
upvote count: 2
type: UnansweredQuestion
score: 2
has title: Reload data in select2
has answer: http://stackoverflow.com/a/24798334

http://stackoverflow.com/comment/38640797
type: Comment
comment on: http://stackoverflow.com/q/24878012
type: QuestionComment
has text: Might want to take a look at this question http://stackoverflow.com/questions/6777385/asp-net-mvc-3-razor-initialize-a-javascript-array as it discusses essentially the same thing (though with dates instead of strings - but the concepts are the same)
score: 0

http://stackoverflow.com/comment/38695601
type: Comment
type: QuestionComment
has text: But this is not what I want, I want to reorder this list just before any action with moving up or down happens.
comment on: http://stackoverflow.com/q/24907266
score: 0

http://stackoverflow.com/comment/38453367
comment on: http://stackoverflow.com/a/24778672
type: Comment
score: 0
type: AnswerComment
has text: the id values of the SVG file are not visible to JS, although i believe you can change the SVG to make them visible http://stackoverflow.com/questions/16566377/why-is-getelementbyid-failing-for-an-svg

http://stackoverflow.com/comment/38545044
type: QuestionComment
has text: @Quince is that the latest version? I think this bug has only recently come into being
score: 0
comment on: http://stackoverflow.com/q/24815220
type: Comment

http://stackoverflow.com/comment/90746037
comment on: http://stackoverflow.com/a/24909119
score: 1
has text: This answer is flawed if you want a specific time in a specific timezone. Like a store in EST would not be open when it is daytime in AEST. So better to use getUTCHours and base the time off that.
type: AnswerComment
type: Comment

http://stackoverflow.com/q/24779637
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24779808
type: Question
has answer: http://stackoverflow.com/a/24779808
tagged with: javascript
has comment: http://stackoverflow.com/comment/38454200
has answer: http://stackoverflow.com/a/24780044
score: 0
answer count: 3
has title: How to get the CSS-Code and save in a String?
possible better answer: http://stackoverflow.com/a/24780044
tagged with: ajax
has body: I am trying to get the code of a CSS-File and save it into a String for later use. I already found something which could do the trick in another post, but nothing I tried was working. $.ajax({ url: "css/style.css", dataType: "text", success: function(cssText) { } }); Can anyone help and tell me how to get and save the CSS-Code? Thanks
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/24780070

http://stackoverflow.com/a/24902595
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/24900601
has body: You have to include some plugins in order to draw your features. Especially the dateAxisRenderer plugin : Please see a working example here, documentation here and an example here
has comment: http://stackoverflow.com/comment/38688012
upvote count: 1
answers question: http://stackoverflow.com/q/24900601
has comment: http://stackoverflow.com/comment/38687070

http://stackoverflow.com/comment/38676761
type: QuestionComment
comment on: http://stackoverflow.com/q/24896765
score: 0
has text: @Jmh2013 I changed everything to double quotes, and added "type="text/javascript"" to the first script tag. However, it still doesn't work. Is there any way I can more directly show you the effects of my code? Possibly showing you a picture of what's happening?
type: Comment

http://stackoverflow.com/comment/38464962
score: 0
type: AnswerComment
has text: Well, it is now displaying the correct value passed to the end variable, but my occurrences on the end of the function are still undefined. But I think it resolves this question. Now I've got another problem. Thanks for answering my main question, now I've got something else to ask. Thanks!
type: Comment
comment on: http://stackoverflow.com/a/24785138

http://stackoverflow.com/comment/38677871
has text: From what I have read about local storage it seems more reliable and lease HTTP requests sent to the server. But I may be wrong.
type: QuestionComment
comment on: http://stackoverflow.com/q/24897699
type: Comment
score: 0

http://stackoverflow.com/a/24889965
downvote count: 0
has comment: http://stackoverflow.com/comment/38663238
type: Answer
answers question: http://stackoverflow.com/q/24889905
score: 2
has comment: http://stackoverflow.com/comment/38663160
upvote count: 2
has body: The submit button will immediately submit the form it is in, and the browser will leave the page (and the JavaScript execution environment from which the Ajax request is being made). Cancel the default behaviour of the form submission when you want to use JavaScript instead. onclick="sbt(); return false;" (I'd look at using a modern approach to event binding instead of onclick attributes though).

http://stackoverflow.com/q/24772981
answer count: 1
has body: I am trying to load google calender into an iframe in my application. When i am logged into gmail i can access the google calender. However if i i am not logged into my gmail there is an error in the console Load denied by X-Frame-Options:+ the src + does not permit framing What i want is when this error comes up i want an error message shown to the user which reminds them to log into their gmail before accessing the feature. How to catch the error ? Here is my iframe `var link = " "; `
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24953872
has title: Error message : load denied X-Frame-Options
tagged with: x-frame-options
tagged with: java
tagged with: iframe
tagged with: error-handling
type: Question
tagged with: javascript
score: 0

http://stackoverflow.com/comment/38525933
score: 0
type: AnswerComment
type: Comment
has text: How could I pass the email argument, unless assign it into the scope?
comment on: http://stackoverflow.com/a/24817529

http://stackoverflow.com/a/24785812
has comment: http://stackoverflow.com/comment/38466373
answers question: http://stackoverflow.com/q/24785598
type: Answer
has body: You could store them inside a map: var vars = { original: { var1: ..., var2: ..., ... }, updated: { var1: ..., var2: ..., ... } }; You'd end up writing the updated values to vars.updated (so vars.updated.var1) for example. After that you can simply loop over to detect if anything has changed. var changed = false; var keys = Object.keys(vars.original); var i = 0; while(!changed &amp;&amp; i &lt; keys.length) { var key = keys[i]; changed = (vars.original[key] !== vars.updated[key]); i++; } You can also do it in a more functional way using reduce: var similar = Object.keys(vars.original).reduce(function(similar, key) { return similar &amp;&amp; (vars.original[key] === vars.updated[key]); }, true); It's more elegant than looping. Note that this tells you if the objects haven't changed (the while above tells you if they have changed).
has comment: http://stackoverflow.com/comment/38466354
score: 0

http://stackoverflow.com/comment/38401222
comment on: http://stackoverflow.com/q/24751374
score: 0
has text: We can't see the whole HTML, just the total and subtotal part, maybe the problem is right there, check it please.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24869267
tagged with: javascript
favorite count: 0
tagged with: express
has body: I am checking the express.js code and am trying to rewrite it just to learn how to create middlewares (framework). But all the inheritance around the code is confusing me. Relevant codes: express.js application.js request.js response.js On the express.js this code: app.request = { __proto__: req, app: app }; app.response = { __proto__: res, app: app }; keeping in-mind __proto__ is deprecated. @Bergi told me that I can replace such code with: app.request = Object.create(req); app.request.app = app; app.response = Object.create(res); app.response.app = app; But now oddly the application.js again has similar code - i think. // inherit protos this.on('mount', function(parent){ this.request.__proto__ = parent.request; this.response.__proto__ = parent.response; this.engines.__proto__ = parent.engines; this.settings.__proto__ = parent.settings; }); Which is emitted here: mount_app.mountpath = mount_path; mount_app.parent = this; // restore .app property on req and res router.use(mount_path, function mounted_app(req, res, next) { var orig = req.app; mount_app.handle(req, res, function(err) { req.__proto__ = orig.request; res.__proto__ = orig.response; next(err); }); }); // mounted an app mount_app.emit('mount', this); And then even the request.js and response.js have inheritance, seems understandable, though I don't completely understand how they are doing it. //is this exporting http.IncomingMessage.prototype??? var req = exports = module.exports = { __proto__: http.IncomingMessage.prototype }; I am not very good with javascript. I would like find books to read on the topic of inheritance. My questions: What is the point of all this inheritance. Isn't the 1st and 2nd case I pointed out redundant? And how should I rewrite avoiding deprecated __proto__? Background I am actually just trying to write a simple middleware based system. Something I can do: // route app.use('/', function(req,res) { }); Just that simple, but I also want to add more methods to req and res. That is w…
tagged with: node.js
type: UnansweredQuestion
upvote count: 1
score: 1
linked to: http://stackoverflow.com/q/24809786
type: Question
has title: understanding expressjs base code
has answer: http://stackoverflow.com/a/24965522
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/38656055
comment on: http://stackoverflow.com/q/24886450
has text: have you perhaps set the `max-width` css property, thus limiting how far your divs can expand? Also, yeah, a jsfiddle would be nice.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38481433
has text: exactly sir, how will be able to get the coordiante(s) inputted by the user? i also assigned each cell specific ID.
comment on: http://stackoverflow.com/q/24793598
score: 0
type: Comment
type: QuestionComment

bootbox
tags question: http://stackoverflow.com/q/24867283
tags question: http://stackoverflow.com/q/24901400
type: Tag
tag name: bootbox

http://stackoverflow.com/comment/44038448
comment on: http://stackoverflow.com/q/24793242
score: 0
type: Comment
type: QuestionComment
has text: @slebetman: thanks ;) I misread that

http://stackoverflow.com/a/24894030
type: Answer
answers question: http://stackoverflow.com/q/24893965
has comment: http://stackoverflow.com/comment/38671119
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24893965
score: 0
has body: Just declare a flag like clicked that becomes true after pressing the button: var clicked = false; function randomnumber(){ if (clicked) { return; } clicked = true; var myVar = setInterval(function(){randomnumber1()}, 1000); function randomnumber1(){ var x = Math.floor((Math.random() * 99)); document.getElementById("button").innerHTML = x; } } CODEPEN

http://stackoverflow.com/q/24799480
type: Question
has answer: http://stackoverflow.com/a/24799632
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24799660
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/24799660
has answer: http://stackoverflow.com/a/24799646
has comment: http://stackoverflow.com/comment/38492759
has body: Im adding staff members to my CMS but having trouble loading members as i think my code is quite messy. Is it possible to remove "li a.job-desc" & "li a.job-desc1" etc and have one global variable that works for all staff members. Once clicked on each staff member their own description should open and other members close Fiddle here: http://jsfiddle.net/zangief007/BSN5u/14/ HTML: Jon doe 09 548 5554 jon@gmail.com Joe Doe dolor sit amet, consectetur adipisicing elit. Officiis, tempora, libero, ipsa maxime facere ullam harum ad iusto laborum minima magni officia provident aut obcaecati quaerat fugiat labore qui aliquam. Jenny Hill 09 548 5554 jon@gmail.com Jenny Hill dolor sit amet, consectetur adipisicing elit. Officiis, tempora, libero, ipsa maxime facere ullam harum ad iusto laborum minima magni officia provident aut obcaecati quaerat fugiat labore qui aliquam. Peter Small 09 548 5554 jon@gmail.com Peter Small dolor sit amet, consectetur adipisicing elit. Officiis, tempora, libero, ipsa maxime facere ullam harum ad iusto laborum minima magni officia provident aut obcaecati quaerat fugiat labore qui aliquam. JS: $( "li a.job-desc" ).click(function() { $( "p.description" ).fadeToggle( "slow", "linear" ); }); $( "li a.job-desc1" ).click(function() { $( "p.description1" ).fadeToggle( "slow", "linear" ); }); $( "li a.job-desc2" ).click(function() { $( "p.description2" ).fadeToggle( "slow", "linear" ); });
tagged with: css
type: AnsweredQuestion
has title: Dynamic jQuery content loading
possible better answer: http://stackoverflow.com/a/24799632
has comment: http://stackoverflow.com/comment/38492080
has comment: http://stackoverflow.com/comment/38491970

http://stackoverflow.com/comment/38671013
type: QuestionComment
comment on: http://stackoverflow.com/q/24894118
has text: Maybe something is overlapping the image that you can't see?
score: 0
type: Comment

http://stackoverflow.com/comment/38648551
type: AnswerComment
score: 0
type: Comment
has text: It sounds like you are trying to use the map control before it has fully loaded the external files. Make sure the DOM has been loaded before trying to load the map. In the code sample I pointed to I do this by adding the following to the end of my JavaScript file: document.addEventListener('DOMContentLoaded', GetMap, false);
comment on: http://stackoverflow.com/a/24839337

http://stackoverflow.com/q/24835556
linked to: http://stackoverflow.com/q/22539815
linked to: http://stackoverflow.com/q/714942
upvote count: 2
linked to: http://stackoverflow.com/q/13806695
type: Question
has answer: http://stackoverflow.com/a/24842763
linked to: http://stackoverflow.com/q/21631241
tagged with: javascript
has comment: http://stackoverflow.com/comment/131031891
answer count: 2
linked to: http://stackoverflow.com/q/18017980
score: 2
downvote count: 0
possible better answer: http://stackoverflow.com/a/24838126
linked to: http://stackoverflow.com/q/21744724
favorite count: 0
has answer: http://stackoverflow.com/a/24838126
tagged with: promise
accepted answer: http://stackoverflow.com/a/24842763
has comment: http://stackoverflow.com/comment/38560787
has comment: http://stackoverflow.com/comment/38572384
linked to: http://stackoverflow.com/q/6864397
tagged with: asynchronous
linked to: http://stackoverflow.com/q/10344498
tagged with: parallel-processing
has comment: http://stackoverflow.com/comment/38560186
type: AnsweredQuestion
has title: BluebirdJS: Make a function run in parallel
tagged with: bluebird
has body: I'm relatively new to Promises in Javascript, but have recently fell in love with their elegance, particularly in the Bluebird library. This is probably a newbie question, but how could I convert a normally-synchronous function to run asynchronously? If I, for example, wanted to compute Math.random()*RANGE thirty times in-parallel, how exactly could I do that with promises (in either Q or Bluebird)?

http://stackoverflow.com/comment/38568651
type: QuestionComment
score: 0
has text: Yes from screen 1 I start scanning my 1st product barcode after getting the result it navigate to screen 2 where I have option to continue scan or checkout. If user choose continue scan the result should be append below the first result.
comment on: http://stackoverflow.com/q/24838033
type: Comment

http://stackoverflow.com/q/24875736
type: Question
has comment: http://stackoverflow.com/comment/38637205
tagged with: settimeout
tagged with: html5-video
has title: Updating a custom video timeline in Javascript
score: 0
has comment: http://stackoverflow.com/comment/38637169
tagged with: javascript
tagged with: jquery
has body: I have some code that calculates the current position of a video. I've added a custom timeline at the bottom of the video for seeking. The custom timeline is just a long div. I want to display the current position of the video on my timeline with a marker. When the video is playing, the marker should be moving. I've already calculated the marker positioning on the timeline but I need help with updating its position. What is the best way to do this? The simplest way would be the code below which just checks the videos position every tenth of a second and updates the marker accordingly. It could possibly be the best way. But I don't know if this may cause problems as it will be repeating every tenth of a second. I don't know that much about memory management. Will this have a big effect on memory and slow the site down? Your input is much appreciated. var setTimer = function () { setTimeout(function() { updateTimeline() setTimer() }, 100); }
tagged with: memory-management
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/24808086
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24808165
linked to: http://stackoverflow.com/q/1628065
has comment: http://stackoverflow.com/comment/38507988
type: Question
has comment: http://stackoverflow.com/comment/38508010
linked to: http://stackoverflow.com/q/2203762
score: 0
answer count: 1
has title: Loading a page then loading just the div
tagged with: javascript
tagged with: jquery
has body: I am using some JQuery to load a div from another page to the current page, the problem I am having is that the content is the div does not exist until that page has loaded. What I am trying to do is load the page first (So the content goes into the div) and then I want to load the div in the current page. Currently I have something which looks like this: Is what I want to do possible and if it is, any suggestions?

http://stackoverflow.com/a/24885536
has body: try it like this in your HTML {{names.name}} and in your JS $scope.$watch('select', function(newvalue) { angular.forEach($scope.name, function(value, key) { if(value.name == newvalue) { $scope.seller = value.sallers; } }); });
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/24884951
has comment: http://stackoverflow.com/comment/38654480
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38654521
type: Answer
answers question: http://stackoverflow.com/q/24884951

http://stackoverflow.com/q/24846852
favorite count: 0
has comment: http://stackoverflow.com/comment/38583162
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
tagged with: onclick
score: 1
tagged with: forms
type: Question
has answer: http://stackoverflow.com/a/24853062
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24853062
has body: I have a simple JS function that lets the user input their first and last name and onclick displays their full name. Is there a way to include the user's submitted content in the text field when the user saves the page as html and reopens it? function getFullName() { var firstName, lastName, fullName; firstName = document.Application.txtFirstName.value; lastName = document.Application.txtLastName.value; fullName = firstName + " " + lastName; document.Application.txtFullName.value = fullName; }
upvote count: 1
has comment: http://stackoverflow.com/comment/38580939
downvote count: 0
answer count: 1
has title: save page as html along with contents

http://stackoverflow.com/comment/38687447
score: 0
comment on: http://stackoverflow.com/a/24902779
type: Comment
has text: to perform client side validation the best option is to use jquery validation plugin , and it will also perform form submission after validation via ajax you can find here [link](http://jqueryvalidation.org/)
type: AnswerComment

http://stackoverflow.com/comment/38401155
comment on: http://stackoverflow.com/q/24749638
has text: Does the new fiddle solve your issue?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24814956
type: Answer
answers question: http://stackoverflow.com/q/24811850
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
has body: I wasn't able to get your example to work, but I can show you what to do. First you need to create a color scale, which is an ordinal scale. Then you can set the domain to be the array of values of your input (in your case 1, 2, and 3), and the range should be the colors that correspond to those inputs. For example: var color = d3.scale.ordinal() .domain([1,2,3]) .range(['red','green','blue']); Then when you create your path element, you can make the stroke color a function of the label data, using the scale: foreground = svg.append('svg:g') .attr('class', 'foreground') .selectAll('path') .data(data) .enter().append('svg:path') .attr('d', path) .attr('stroke', function(d) { return color(d.label); }); Then just make sure you remove the stroke styling for the foreground from your css so it doesn't override the value your scale provided. Here's an example that uses a subset of the cars data from this example.
accepted answer of: http://stackoverflow.com/q/24811850

http://stackoverflow.com/comment/38653496
comment on: http://stackoverflow.com/q/24885153
score: 3
has text: There isn't anything in the markup called `#edit-save-section`???
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24892520
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38712395
has comment: http://stackoverflow.com/comment/38711044
has body: Yeah check this: https://developer.mozilla.org/en-US/docs/Web/API/Window.matchMedia Syntax mql = window.matchMedia(mediaQueryString) Where mediaQueryString is a string representing the media query for which to return a new MediaQueryList object. Example if (window.matchMedia("(min-width: 400px)").matches) { /* the view port is at least 400 pixels wide */ } else { /* the view port is less than 400 pixels wide */ } And a polyfill like this: https://github.com/paulirish/matchMedia.js/ Old IE: https://github.com/benschwarz/matchMedia.js/tree/IE7-8 If you just care about a simple check here's how you could do it with jQuery, though it is pretty trivial to do it in plain Javascript too this is just easier because of your old IE requirements: var timeout; function onWindowResize() { var width = $(window).width(); if (width &lt;= 480) { console.log('small'); } else if (width &lt;= 767) { console.log('medium'); } else if (width &lt;= 1024) { console.log('large'); } else { console.log('xlarge'); } } $(window).resize(function() { clearTimeout(timeout); timeout = setTimeout(function() { onWindowResize(); }, 50); // Only resize every 50ms - number up to you. });
has comment: http://stackoverflow.com/comment/38697391
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/38698884
upvote count: 2
has comment: http://stackoverflow.com/comment/38695640
has comment: http://stackoverflow.com/comment/38709625
accepted answer of: http://stackoverflow.com/q/24892399
answers question: http://stackoverflow.com/q/24892399
has comment: http://stackoverflow.com/comment/38693582

http://stackoverflow.com/q/24886584
score: 0
tagged with: mouseenter
has comment: http://stackoverflow.com/comment/38656288
type: UnansweredQuestion
has body: I am having issues in mouseleave and mouseenter . I have an image on which when i take my mouse,it shows me the context menu . My problem is I am unable to take my mouse to enter inside the context menu so that i can select options of it.The moment i leave my mouse from image ,the context menu goes off.I want a code in which when i take my mouse over image and the context menu shows ,the context menu does not goes away the moment i try to take my mouse inside the context menu . Here is my code :- var boolMouseEnter = false; function ShowMenuItemsOnMouseEnter() { $("img.showActionMenu").on('mouseenter', function (e) { var itemId = $(this).closest("li").attr("id"); $('#' + itemId).trigger({ type: 'mousedown', button: 2 }). trigger({ type: 'mouseup', pageX: e.pageX-5, pageY: e.pageY-10 }); }); boolMouseEnter = $("#ulPackage,#ulRemoveAll,#ulRemove,#ulSort").is('mouseenter'); $("img.showActionMenu").on('mouseleave', function (e) { if (!boolMouseEnter) { $(document).trigger('click'); } }); } ulPackage,ulRemove,ulRemoveAll,ulSort are all the "ul" ids of the context menus . Thanks in Advance !!
answer count: 0
has title: Cursor not going into context Menu options
tagged with: mouseevent
tagged with: mouseleave
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38657363

http://stackoverflow.com/a/24877928
has comment: http://stackoverflow.com/comment/40010692
score: 0
has body: The first line has single quotes around 'v-on' when there shouldn't be any: &lt;div id='form' v-on="change:updateForm"&gt; Here's a JSFiddle with the working version
type: Answer
answers question: http://stackoverflow.com/q/24843839

angularjs-directive
tags question: http://stackoverflow.com/q/24751073
tag name: angularjs-directive
tags question: http://stackoverflow.com/q/24807121
tags question: http://stackoverflow.com/q/24764387
tags question: http://stackoverflow.com/q/24852092
tags question: http://stackoverflow.com/q/24834992
tags question: http://stackoverflow.com/q/24757601
tags question: http://stackoverflow.com/q/24786796
tags question: http://stackoverflow.com/q/24812778
tags question: http://stackoverflow.com/q/24834125
tags question: http://stackoverflow.com/q/24754594
tags question: http://stackoverflow.com/q/24898969
tags question: http://stackoverflow.com/q/24821208
tags question: http://stackoverflow.com/q/24784373
tags question: http://stackoverflow.com/q/24768915
tags question: http://stackoverflow.com/q/24830116
tags question: http://stackoverflow.com/q/24831441
tags question: http://stackoverflow.com/q/24883326
tags question: http://stackoverflow.com/q/24802668
tags question: http://stackoverflow.com/q/24796382
tags question: http://stackoverflow.com/q/24759702
tags question: http://stackoverflow.com/q/24818387
tags question: http://stackoverflow.com/q/24762229
tags question: http://stackoverflow.com/q/24889311
tags question: http://stackoverflow.com/q/24880686
tags question: http://stackoverflow.com/q/24854463
tags question: http://stackoverflow.com/q/24806578
tags question: http://stackoverflow.com/q/24789119
tags question: http://stackoverflow.com/q/24808913
tags question: http://stackoverflow.com/q/24809835
tags question: http://stackoverflow.com/q/24889628
tags question: http://stackoverflow.com/q/24763738
type: Tag
tags question: http://stackoverflow.com/q/24865134
tags question: http://stackoverflow.com/q/24793547
tags question: http://stackoverflow.com/q/24836678
tags question: http://stackoverflow.com/q/24786256
tags question: http://stackoverflow.com/q/24886419
tags question: http://stackoverflow.com/q/24871287
tags question: http://stackoverflow.com/q/24867439
tags question: http://stackoverflow.com/q/24891671
tags question: http://stackoverflow.com/q/24786085
tags question: http://stackoverflow.com/q/24824005
tags question: http://stackoverflow.com/q/24902540
tags question: http://stackoverflow.com/q/24760296
tags question: http://stackoverflow.com/q/24892988
tags question: http://stackoverflow.com/q/24828463

http://stackoverflow.com/comment/38668925
has text: If I check and uncheck user and roles, why would I want account setting to remain checked?
comment on: http://stackoverflow.com/a/24892809
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/24890534
type: Answer
has body: You should change your success function to something like this: success: function(data){ alert("OK"); $( "#results" ).append( data ); } And also for setting a controller URL in view use: site_url("controller/preview_offer");
answers question: http://stackoverflow.com/q/24879058
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/comment/59727880
comment on: http://stackoverflow.com/a/24872066
score: 0
type: AnswerComment
type: Comment
has text: That's a good and interesting use case - because ng-if adds and removes from the DOM, anything jquery-plugin-ish (like a Bootstrap popover) will need reinitialising. I've tweaked the fiddle to show it working with ko if, as well as the initial applyBindings. Maybe you could have a look at it - does that capture how you solved your problem?

http://stackoverflow.com/q/24789997
has comment: http://stackoverflow.com/comment/38475359
has comment: http://stackoverflow.com/comment/38475816
tagged with: google-chrome
has body: I am building a simple extension for chrome, which has a popup page. The page looks like this: As you can see, the page's text is in Times New Roman, which is what I would get a if I opened a plain webpage in Chrome. Fair enough! But I want to inherit the look and feel of the browser's UI to my extension. At least the font. How could this be done? Edit: It is possible to get the style information from examining a chrome://* page (e.g. Extensions), using "Inspect Element". This is what I already did. Although it looks much better, this is not a generic solution. Chrome's look and feel changes slightly by operating systems. For example, Windows 7: font-family: 'Segoe UI', Tahoma, sans-serif; Windows XP: font-family: Tahoma, sans-serif; So you're guaranteed to break the consistency in some OS.
type: Question
has answer: http://stackoverflow.com/a/24791969
has comment: http://stackoverflow.com/comment/38477157
has comment: http://stackoverflow.com/comment/38475366
tagged with: javascript
has comment: http://stackoverflow.com/comment/38476280
tagged with: google-chrome-extension
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/24791969
favorite count: 0
upvote count: 2
has title: UI Consistency: How do I inherit browser's look and feel in my Chrome extension
tagged with: css
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38475835

http://stackoverflow.com/comment/38448002
comment on: http://stackoverflow.com/a/24775039
type: AnswerComment
has text: Not that I agree with it, for a filter, but the SO wanted whole text matching only.
score: 0
type: Comment

http://stackoverflow.com/comment/38557814
comment on: http://stackoverflow.com/q/24834115
score: 0
type: Comment
type: QuestionComment
has text: http://jsfiddle.net/toulmek/CPAjC/

http://stackoverflow.com/comment/38599325
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24856199
score: 0
has text: `added to the dom?` ehat do yuo want to add?

http://stackoverflow.com/a/24873704
score: 2
upvote count: 2
has body: You can add a query string at the end of file path, for example: Every time you want to change, just increase the version of the file.
answers question: http://stackoverflow.com/q/24871790
downvote count: 0
has comment: http://stackoverflow.com/comment/38677282
type: Answer

http://stackoverflow.com/comment/38448267
comment on: http://stackoverflow.com/a/24776228
type: Comment
has text: Hi, I've tried your code with real image sources: [link](http://jsfiddle.net/n9NzF/3/). In the result, option 2 shows images from first 2 rows and option 3 - images from all 3 rows
score: 0
type: AnswerComment

http://stackoverflow.com/a/24898160
has comment: http://stackoverflow.com/comment/38687217
type: Answer
has comment: http://stackoverflow.com/comment/38684618
has comment: http://stackoverflow.com/comment/38685470
has comment: http://stackoverflow.com/comment/38686167
has comment: http://stackoverflow.com/comment/38684273
has comment: http://stackoverflow.com/comment/38685925
has comment: http://stackoverflow.com/comment/38684995
answers question: http://stackoverflow.com/q/24891526
accepted answer of: http://stackoverflow.com/q/24891526
score: 3
downvote count: 0
has body: The issue here is that inside the each callback, you need to return the promise from your cloud function call if you want to ensure the tasks complete, and have it wait before going to the next object. Simplified and using promises: query.each(function(object) { ... return Parse.Cloud.run(...); }).then(function() { // success }, function(err) { // error }); For looping over a promise-returning function like Parse.Cloud.run: var promises = []; for (i = 0; i &lt; 5; i++) { promises.push(Parse.Cloud.run('...', {})); } Parse.Promise.when(promises).then(function() { // all done }, function(err) { // error });
has comment: http://stackoverflow.com/comment/38686444
has comment: http://stackoverflow.com/comment/38714114
type: AcceptedAnswer
upvote count: 3

http://stackoverflow.com/comment/38547004
score: 0
comment on: http://stackoverflow.com/a/24828474
type: AnswerComment
has text: I did not get what you are saying here. But if you want addEventListener("load")" to be executed on success of AJAX call, put it in the success method.
type: Comment

http://stackoverflow.com/a/24789686
has comment: http://stackoverflow.com/comment/38500690
has comment: http://stackoverflow.com/comment/38501058
has comment: http://stackoverflow.com/comment/38500737
answers question: http://stackoverflow.com/q/24789386
has comment: http://stackoverflow.com/comment/38500823
has body: A slightly different version of what Some Guy came up with var button = document.getElementById('inc'); var span = document.getElementById('val'); var val = 0; var interval = null; var inc = function () { span.textContent = ++val; }; button.addEventListener('mousedown', function () { interval = setInterval(inc,200); inc(); }); document.body.addEventListener('mouseup', function () { window.clearInterval(interval); }); Demo
score: 0
type: Answer

http://stackoverflow.com/comment/86483869
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24770914
has text: @rahulsm How are you verifying that only the value is removed? You can always `someObject.someKeyThatDoesntExist` and get `undefined`. Does it exist in the output from `JSON.stringify(obj)`?

http://stackoverflow.com/a/24828228
upvote count: 13
has body: Bind a change event on all input and then use some condition: $('.upload-block input').change(function() { $('#upload-btn').prop( 'disabled', !($('.upload-block :checked').length &amp;&amp; $('#InputFile').val())); }); Example
score: 13
has comment: http://stackoverflow.com/comment/72642218
accepted answer of: http://stackoverflow.com/q/24828066
has comment: http://stackoverflow.com/comment/39218486
has comment: http://stackoverflow.com/comment/39252713
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24828066
has comment: http://stackoverflow.com/comment/39026001
has comment: http://stackoverflow.com/comment/39029068
type: Answer

http://stackoverflow.com/a/24854195
has comment: http://stackoverflow.com/comment/38596988
has comment: http://stackoverflow.com/comment/38596629
has comment: http://stackoverflow.com/comment/38597404
has body: You could bind that property to the application controller and then use it anywhere you want in the application. For example: App.ApplicationController = Ember.ObjectController.extend({ needs: ['index'], indexResult: Ember.computed.alias('controllers.index.result') }); Now you can use it anywhere within the application you want. Just tell the outlet's controller to need the application controller, then call that property in the template. Like so: App.FooController = Ember.ArrayController.extend({ needs: ['application'], //... }); In the Foo template: {{controllers.application.indexResult}} Or, if you are within the application scope you can just do: {{indexResult}}
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24853897
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/38597553

http://stackoverflow.com/q/24782860
score: 0
answer count: 1
tagged with: css
type: AnsweredQuestion
has title: Composed content css body class with TinyMCE
tagged with: tinymce-4
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/24783213
accepted answer: http://stackoverflow.com/a/24783213
has body: I'm trying to set a composed css class to the content_css parameter of TinyMCE instance. The css: .page.show { background: red; padding: 0 0 10px; } The init JS &lt;script type="text/javascript"&gt; tinymce.init({ selector: "textarea", content_css : "/css/frontend/screen.css", body_class : ".page.show" }); &lt;/script&gt; But it doesn't work, and the project work on composed css class, and I won't duplicate css.

http://stackoverflow.com/q/24885963
answer count: 4
has answer: http://stackoverflow.com/a/24886169
type: Question
has answer: http://stackoverflow.com/a/24886096
has answer: http://stackoverflow.com/a/24886000
tagged with: function
tagged with: javascript
tagged with: jquery
has body: http://jsfiddle.net/vidhyaakrish/AFm89/64/ I am trying to pass an element id (eg.#target-elemet as parameter to scroll_to(element)) function scroll_to(element){ $('html, body').animate({ scrollTop: $(element).offset().top },1000); console.log(element); } scroll_to('"\#target-element\"'); but i am not able to achieve - Can somebody help me?
has title: functions - passing element id as parameter
score: 0
has answer: http://stackoverflow.com/a/24885982
type: UnansweredQuestion

http://stackoverflow.com/a/24757920
has body: It's not bug, it's a feature. angularjs handles ngOptions and ngModel internally, this way it allows you to use any type of object as value in option rather than only strings. This link should help you :) Watch this tutorial this is shortcut for your problem.
answers question: http://stackoverflow.com/q/24757767
upvote count: 0
type: Answer
downvote count: 1
score: -1

http://stackoverflow.com/q/24852111
type: Question
has comment: http://stackoverflow.com/comment/38591219
has body: I wrote some javascript to delegate messages from XBMC to my Dune mediaplayer. So i am starting on windows with a batch file that executes my javascript with Node.js code in it. start.bat: @echo off node \Users\Flo\Desktop\file.js %1 file.js: var http = require("http"); var filepath = process.argv[2].substring(6); filepath = filepath.replace(/\\/g,"/"); var dcmd = "http://dune/cgi-bin/do?cmd=start_file_playback&amp;media_url=storage_name:/" + filepath; http.get(dcmd, function(res) { console.log("Got response: " + res.statusCode); var bodyarr = []; res.on('data', function(chunk){ bodyarr.push(chunk); }); res.on('end', function(){ console.log(bodyarr.join('').toString()); }); }).on('error', function(e) { console.log("Got error: " + e.message); }); Everthing works fine with this setup. But now i want to do this on a Raspbian system with a shell script. start.sh: #!/bin/sh nodejs /usr/local/bin/file.js $1 And i am always getting the error: connect ECONNREFUSED Why? Thanks for any help!
tagged with: windows
score: 1
upvote count: 1
tagged with: node.js
has comment: http://stackoverflow.com/comment/38592040
answer count: 0
downvote count: 0
has comment: http://stackoverflow.com/comment/38591610
tagged with: javascript
type: UnansweredQuestion
has title: Connect ECONNREFUSED message on Debian but works on Windows
favorite count: 0
tagged with: linux
has comment: http://stackoverflow.com/comment/38591991

http://stackoverflow.com/comment/38475056
has text: don't know what directive you are using. Follow the directive on how to set markers from scope and do the same with your data
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24789814

http://stackoverflow.com/tag/csv
type: Tag
tag name: csv
tags question: http://stackoverflow.com/q/24810621
tags question: http://stackoverflow.com/q/24876222
tags question: http://stackoverflow.com/q/24856884
tags question: http://stackoverflow.com/q/24863873
tags question: http://stackoverflow.com/q/24829289
tags question: http://stackoverflow.com/q/24904223
tags question: http://stackoverflow.com/q/24809025
tags question: http://stackoverflow.com/q/24876575

http://stackoverflow.com/q/24796747
has answer: http://stackoverflow.com/a/30282435
has body: I'm developing my first hybrid mobile app with ionic and AngularJS, and there's this one thing I'm trying to figure out: How do we keep the state (as in GUI) between navigations? Let's say my app has a side menu with these item links: Search form All (#/all) Cats (#/cats) Dogs (#/dogs) Err... Cows? (#/cows) Contact (#/contact) Items from 2 to 5 trigger requesting server data in an inifite loading manner. Now let's say from Cats, I go to Dogs and then back to Cats. Since (from my understanding), a brand new Controller instance (and scope) is created with every route change, the app will reload the list of cats from the server. I want the Cats state to be kept, and re-displayed instead. I've been searching for a solution for this (which I believe should be common enough, just I'm not using the correct search terms). All of the results I've found so far suggest listening to state change or route change kinds of events, and store the object array into localStorage. Though, to some extends, this work, I feel it to be clumsy and just not the way to do - for example, HTML has to be compiled, which can be very slow (notice the "inifinite loading" feature I mentioned earlier, which can increase the number of objects to hundreds), and the viewport will revert back to the top of the app. So my question is, how do you guys approach this? Is there any sort of navigation that acts like a browser's back and forward buttons?
tagged with: ionic-framework
score: 0
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/30253325
tagged with: angularjs
type: UnansweredQuestion
has title: ionic and AngularJS: How to retain state between navigations?
type: Question

http://stackoverflow.com/q/24872482
has answer: http://stackoverflow.com/a/24872581
answer count: 1
tagged with: javascript
type: UnansweredQuestion
has title: dynamically set json selector
tagged with: jquery
tagged with: ajax
type: Question
has body: I have an array with an unknown amount of values in the structure of ['someNumber0', 'someNumber1',..]. These numbers need to be passed into my ajax call as data query strings. The catch is I need to name each number first. I am attempting a hack but it is not working as I cannot set the json selector(?) dynamically. var zipArray = $("#enteredValue").val().split(','); var dataObj = {}; var i = 0; zipArray.forEach(function (value) { var queryString = "zip" + i; ++i; dataObj = { queryString: value }; //does not pass the var (querystring) }); console.log(dataObj) $.ajax({ type: 'GET', url: "http://localhost:49528/Proxy.aspx", data: dataObj, dataType: 'json', success: function (json_results) { SucceededCallback(json_results); } }); Suggestions?
has comment: http://stackoverflow.com/comment/38630397
score: 0
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/38567945
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24840135
has text: you may want something like this http://jsfiddle.net/GCwBT/1/

http://stackoverflow.com/comment/38675257
type: AnswerComment
comment on: http://stackoverflow.com/a/24894759
type: Comment
has text: No, like this var foo = getEnum(2); if (foo == enuTable.enuItem) { ... } else { ... }
score: 0

http://stackoverflow.com/comment/38661430
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24889153
score: 0
has text: `Uncaught TypeError: undefined is not a function` is what I got.

http://stackoverflow.com/a/24782133
has body: No need for &amp;rsquo; : simply write a ' character. From javascript you may either escape it like '\'' or enclose it in double quotes like "'".
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/24782002
accepted answer of: http://stackoverflow.com/q/24782002

http://stackoverflow.com/a/24874716
type: Answer
has comment: http://stackoverflow.com/comment/38698399
has comment: http://stackoverflow.com/comment/38637339
has comment: http://stackoverflow.com/comment/38652316
has comment: http://stackoverflow.com/comment/38722672
has body: 1st you want to change date and time to timestamp by this $utime = strtotime(date($db_date)); 2nd take the date value and inserted as a js var var jsdate = '&lt;?php echo $utime?&gt;';
answers question: http://stackoverflow.com/q/24873756
has comment: http://stackoverflow.com/comment/38637887
has comment: http://stackoverflow.com/comment/38637688
score: 0

http://stackoverflow.com/comment/38492756
type: Comment
type: QuestionComment
has text: I really don't understand Why I got a negative point here?
comment on: http://stackoverflow.com/q/24799778
score: 0

http://stackoverflow.com/comment/39126720
type: Comment
comment on: http://stackoverflow.com/a/25102935
type: AnswerComment
score: 0
has text: This is fine example of an answer however you forgot one thing, jsonp can never be cached as the content changes as jQuery create the function name on the fly so the content is ever changing and this would prevent the use offline and i doubt that the interviews wanted to change the browser start up parameters to run his code kind of breaks the point of being a Web Application if people have to change browser start up options to use it...

http://stackoverflow.com/comment/38522908
has text: My question above asks - Subject line should automatically include the name of the article, which is different on each page, in this example: Igneous Rocks
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24815616

http://stackoverflow.com/q/24867293
type: Question
has title: Sails.js AND condition
type: AnsweredQuestion
favorite count: 0
has answer: http://stackoverflow.com/a/24884350
has body: I'm using mongoDb with sails.js and need to make search by address string. For example -"Malibu 98000". row in db look like this { "state" : "CA", "streetNumber" : "120", "streetName" : "Sh", "city" : "Malibu", "zipCode" : "98000" } But I'm not able to perform a waterline query using the "AND" condition. I've already tried it in several ways but most of them return empty or simply, never return. var propertySearchParams = { and : [ or:[ {streetNumber: {like: "%98000%"}}, {zipCode: {like: "%98000%"}} ], or:[ {streetName: {like: "%Malibu%"}}, {city: {like: "%Malibu%"}}, {state: {like: "%Malibu"}} ] ] } How can I specify "Malibu" AND "98000"? Thanks!
upvote count: 2
accepted answer: http://stackoverflow.com/a/24884350
answer count: 1
tagged with: sails.js
tagged with: waterline
tagged with: mongodb
score: 2
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/38670930
type: QuestionComment
score: 1
has text: Could you provide more code?
comment on: http://stackoverflow.com/q/24894118
type: Comment

http://stackoverflow.com/comment/38662455
has text: You aren't going to be able to construct a page as a JS var and also refresh to it without some kind of storage. You'd need to update the current page DOM.
comment on: http://stackoverflow.com/q/24889666
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24772614
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/38443184
has body: Maybe you can try something like: $(this).children("img").attr("src", "mycool_image.jpg"); This will find the direct children -> if you have them nested deeper, you can use find() instead. $(this).find("img").attr("src", "mycool_image.jpg"); EDIT If you want the n-th child img element then you can do: $(this).find("img").eq(2).attr("src", "mycool_image.jpg"); EDIT2 To get the source before changing it simply do (by supplying the correspondent index to eq() of course): var source = $(this).find("img").eq(2).attr("src");
answers question: http://stackoverflow.com/q/24772521
downvote count: 0
has comment: http://stackoverflow.com/comment/38441142
score: 1

http://stackoverflow.com/q/24856219
has answer: http://stackoverflow.com/a/24871409
type: Question
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/24871409
favorite count: 0
linked to: http://stackoverflow.com/q/24912271
has comment: http://stackoverflow.com/comment/38599407
has comment: http://stackoverflow.com/comment/38600483
upvote count: 1
tagged with: knockout.js
has title: Knockout subscribe is blocking the page
type: AnsweredQuestion
has body: I have an observable array with a computed to get the currently selected item of a radio list. self.KOVehicle.SelectedPolicy = ko.computed(function () { return ko.utils.arrayFirst(self.KOVehicle.VehicleDetailsList(), function (veh) { return veh.PolicyId() == self.KOVehicle.SelectedPolicyId(); }); }, self); I'm subscribing to changes on that which will update a dozen or so various bound items on the page. self.KOVehicle.SelectedPolicy.subscribe(function (selectedPolicy) { // show ajax loading spinner and do changes }); Now it all works, except it seems to block the page while it's doing the changes. I don't see the ajax loading spinner unless I open the js debugger and step through it. Any ideas?
score: 1
tagged with: javascript

http://stackoverflow.com/q/24847408
answer count: 2
has comment: http://stackoverflow.com/comment/38581906
score: 5
has answer: http://stackoverflow.com/a/24852610
accepted answer: http://stackoverflow.com/a/24852610
downvote count: 0
has comment: http://stackoverflow.com/comment/38904329
favorite count: 0
possible better answer: http://stackoverflow.com/a/63772128
has body: I write in Fountain markdown http://fountain.io/ in Google Docs. Fountain is used for writing screenplays. I want to make writing in fountain a little friendlier by auto-capitalizing certain elements (on open or with a button, whatever). Here is a correctly formatted screenplay (in fountain): EXT. GAS STATION - DAY Susie steps out of her car and walks toward the station attendant. SUSIE Hey, Tommy. TOMMY Where you been, Sue? Come on in. They walk toward the station entrance together. INT. GAS STATION - NIGHT etc... As you can see there is a ton of CAPS-LOCK and SHIFT business in screenwriting, and it gets tedious. Which is why I want to write in lower-case (ie. int. gas station - day) and have javascript/GAS find that text and uppercase it. Same with when a character speaks: susie Hey, Tommy. would become SUSIE Hey, Tommy. Characters speaking always have an empty line above their name and text on the next line. And scene headings ALWAYS start with either EXT. or INT. I have had some kind help so far on Stackoverflow, but I'm still struggling to get this to work at all. I was given a great regex string that finds character names but GAS has a limited regex implementation. That regex is [\n][\n]([^\n]+)[\n][^\n|\s]/gi. I have had no luck replacing text with regex. My JS skill is newborn baby, but I have completed CodeAcademy's beginner's JS course for what that's worth. I would be grateful for any help in the right direction.
tagged with: regex
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3561493
type: Question
has comment: http://stackoverflow.com/comment/38918478
has answer: http://stackoverflow.com/a/63772128
upvote count: 5
tagged with: javascript
has title: Find and change unknown strings to UPPERCASE in Google Apps Script Document using JS
tagged with: google-apps-script

http://stackoverflow.com/comment/38464367
has text: I will give it a go, and let you know if it works, it shouldn't take more than 5-10 minutes
comment on: http://stackoverflow.com/a/24784043
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38570621
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24841485
score: 1
has text: @d3nm4k no. You have to initialize `order[0]`, `order[1]`, and `order[2]` to have some value (an array I guess). That won't be done for you; why would it?

http://stackoverflow.com/a/24771497
has comment: http://stackoverflow.com/comment/42948014
has body: It's because IIS doesn't know what a .less file is and therefore won't serve it. You need to add the following to your web.config's &lt;system.webServer&gt; section: &lt;staticContent&gt; &lt;remove fileExtension=".less" /&gt; &lt;mimeMap fileExtension=".less" mimeType="text/css" /&gt; &lt;/staticContent&gt;
score: 1
answers question: http://stackoverflow.com/q/24752871
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/comment/38424276
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24763790
has text: You don't have to say `.find('img')` again.
score: 0

http://stackoverflow.com/q/24809025
type: Question
tagged with: firefox
answer count: 1
has body: My requirement is to import a html table to a CSV file. The code below gets called when the Download to CSV button is clicked in my web page. This works fine in chrome however in firefox it does nothing. input.addEventListener('click', function (e) { var fileName = cntrySel.value + '-Data.csv'; var a = document.createElement('a'); var data=$('#output').table2CSV({delivery:'value'}); blob = new Blob([data], { type: 'text/csv' }); //new way var csvUrl = URL.createObjectURL(blob); a.download = fileName; a.href = csvUrl; a.click(); a.setAttribute('onClick',''); e.preventDefault(); }); In firefox debugger, I can see the above function is getting triggered upon click but a.click() does nothing in FF whereas it downloads the csv file in chrome. Any help is appreciated.
tagged with: javascript
has answer: http://stackoverflow.com/a/24809091
linked to: http://stackoverflow.com/q/18303695
score: 0
tagged with: http://stackoverflow.com/tag/csv
accepted answer: http://stackoverflow.com/a/24809091
has title: Triggering a click event in firefox
type: AnsweredQuestion
tagged with: onclick

http://stackoverflow.com/a/24821230
score: 1
has body: Upload the main image in one root folder and call the below function twice with different size. Hope this helps. function createThumbs( $pathToImages, $pathToThumbs, $new_height, $new_width, $filename ) { $info = pathinfo($pathToImages . $filename); if ( strtolower($info['extension']) == 'jpg' ) $img = imagecreatefromjpeg( "{$pathToImages}" ); if ( strtolower($info['extension']) == 'gif' ) $img = imagecreatefromgif( "{$pathToImages}" ); if ( strtolower($info['extension']) == 'png' ) $img = imagecreatefrompng( "{$pathToImages}" ); $width = imagesx( $img ); $height = imagesy( $img ); $tmp_img = imagecreatetruecolor( $new_width, $new_height ); imagecopyresized( $tmp_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height ); if ( strtolower($info['extension']) == 'jpg' ) imagejpeg( $tmp_img, "{$pathToThumbs}{$filename}" ); if ( strtolower($info['extension']) == 'gif' ) imagegif( $tmp_img, "{$pathToThumbs}{$filename}" ); if ( strtolower($info['extension']) == 'png' ) imagepng( $tmp_img, "{$pathToThumbs}{$filename}" ); } Thanks.
downvote count: 0
upvote count: 1
answers question: http://stackoverflow.com/q/24819907
type: Answer

http://stackoverflow.com/comment/38427319
comment on: http://stackoverflow.com/a/24764325
type: AnswerComment
score: 0
type: Comment
has text: Thank you. What must I do if I want to call "xyz" and redefine $foo3 while keeping the default values for $foo1 and $foo2?

http://stackoverflow.com/comment/38553117
has text: php would be almost perfect for that task. use file_get_contents, json_decode, add the data, the save the json_encode of modified array.
comment on: http://stackoverflow.com/a/24831794
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/q/24758417
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24761072
accepted answer: http://stackoverflow.com/a/24761072
has comment: http://stackoverflow.com/comment/38415040
has body: SECOND EDIT: Ok so I have certainly had some help here on this problem, however when I now enter the working model into a class structure in my page is breaks and can't find method. I tried caching the "this" in order to see my methods however I am having no luck... New JS Fiddle: http://jsfiddle.net/goredefex/3QvP9/22/ Also, I am aware the JS Fiddle doesn't work with classes because when I inspect it I can see that it auto adds a $(function() {}); load event without my control. New JS Code (all other code exact same): $(function() { var m = new ImgMarquee("#box"); }); function ImgMarquee(container) { this.setUpImages(container); var total = this.findAndSetContWidth(container); //Make Second Hidden Stage var doppelganger = $(container).clone(); $(container).first().append(doppelganger.html()); //<-- Add In Stage this.animateMarquee(this.animateMarquee, container, total); } //EOC //Calculates Width & Sets Viewer ImgMarquee.prototype.findAndSetContWidth = function(container) { //Set Parameters var imgs = $(container + " a img"), width = 0; //Calculate Width $(String(container)).find(imgs).each(function() { width += $(this).width(); }); //Set Container Width $(container).css({"width":String(width*2)}); return width; }; //end function //Adjusts Height Of Images To Parent Container ImgMarquee.prototype.setUpImages = function(container) { var imgs = $(container + " a img"), gutter = 3; //Attach To All Given Images $(String(container)).find(imgs).each(function() { $(this).css({ "max-height":String($(this).parent().parent().height())+"px", "padding-right":String(gutter) }); }); }; //end function //Adds JQuery Animation To Container ImgMarquee.prototype.animateMarquee = function(recursion, c, t) { $(c).animate({'margin-left':String(-(t))}, { easing:'linear', duration:50000, complete: function() { $(c).css({"margin-left":"0"}); this.animateMarquee(this.animateMarquee, c, t); } } ); }; //end function THIS IS THE ORIGINAL QUESTION: Haven't come across the answer to this yet and…
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/38418747
has comment: http://stackoverflow.com/comment/38415268
has comment: http://stackoverflow.com/comment/38414295
type: AnsweredQuestion
has title: JQuery Animate Function Not Changing Left Absolute Position
type: Question
score: 0
tagged with: jquery-animate

http://stackoverflow.com/q/24849678
has answer: http://stackoverflow.com/a/24849855
has comment: http://stackoverflow.com/comment/38586877
type: UnansweredQuestion
tagged with: soundcloud
tagged with: api
has title: How to test AngularJS when including external APIs?
has comment: http://stackoverflow.com/comment/38594584
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
tagged with: angularjs
linked to: http://stackoverflow.com/q/14773269
type: Question
has comment: http://stackoverflow.com/comment/38589322
has body: I'm using the SoundCloud JavaScript SDK with AngularJS, and trying to run Karma tests on it. I keep getting the error Error: [$injector:modulerr] Failed to instantiate module SoundcloudApp due to: ReferenceError: Can't find variable: SC when I run the tests. The variable SC (provided by the SoundCloud API, when including the script) is used in an AngularJS service: angular.module('SoundcloudApp').provider('SoundCloud', function() { SC.initialize({ clientId: 'SeES8KzD8c44J9IU8djbVg' }); this.$get = function($q) { return { getUser: function(id) { // returns user object with a given id var user = $q.defer(); SC.get('/users/' + id, function (userData, err) { if (err) { user.reject(err.message); } else { user.resolve(userData); } }); return user.promise; } }; }; }); Should I just mock this service? How do I do that?
upvote count: 1
answer count: 1

http://stackoverflow.com/comment/38494045
comment on: http://stackoverflow.com/q/24800619
score: 0
has text: just wondering, if you define `$('[data-toggle=offcanvas]').click(togglesidebar);` wouldn't it just work for all the window sizes? it's another story if you want to trigger it, but the definition works for all window sizes I suppose!
type: QuestionComment
type: Comment

http://stackoverflow.com/a/24771615
answers question: http://stackoverflow.com/q/24771593
has body: You should use Angular native directive ng-checked &lt;input type="checkbox" ng-checked="values.check"/&gt;
score: 0
type: Answer

http://stackoverflow.com/comment/38416443
type: Comment
comment on: http://stackoverflow.com/a/24751707
has text: Thanks, it does solve the error indeed. It does not solve the fact that there is only one AreaOfInterestList for all the elements though. Do you have an idea why?
type: AnswerComment
score: 0

preload
tags question: http://stackoverflow.com/q/24823670
tag name: preload
type: Tag

http://stackoverflow.com/q/24897785
has answer: http://stackoverflow.com/a/24898163
has comment: http://stackoverflow.com/comment/38721645
accepted answer: http://stackoverflow.com/a/24898163
type: AnsweredQuestion
has body: I am trying to make a simple to do list (with no database--everything goes away on a refresh), and when you click the complete button, the task gets a strike through. That works until you add another task, then the strike through disappears. Any ideas? ToDoList.Views.TaskView = Backbone.View.extend({ initialize: function() { this.listenTo(this.model, 'all', this.render); }, tagName: 'li', template: _.template($('#task-template').html()), render: function() { var that = this; var renderedHTML = this.template({task: this.model.toJSON()}); this.$el.html(renderedHTML); return this; }, events: { 'click [data-action="delete"]': 'markAsComplete' }, markAsComplete: function() { this.$el.css('text-decoration', 'line-through'); } }); The template is just a name and a button and that works fine. Thanks!
has comment: http://stackoverflow.com/comment/38678035
type: Question
answer count: 1
tagged with: javascript
tagged with: backbone.js
score: 0
has title: Backbone model reverts to original state

http://stackoverflow.com/comment/38641413
type: Comment
comment on: http://stackoverflow.com/a/24878123
score: 0
type: AnswerComment
has text: @hutingung While you're right that I changed one aspect of the question, I didn't change *the meaning*. You're still asking the same thing, regardless, and all of the answers still apply. Wrapping `document.getElementById` in `jQuery()` just gives you access to jQuery's methods.

http://stackoverflow.com/comment/38633943
comment on: http://stackoverflow.com/a/24874375
type: Comment
has text: Just be aware that [performance.now might now be supported](https://developer.mozilla.org/en-US/docs/Web/API/Performance.now()), especially if it's on an iPhone.
type: AnswerComment
score: 1

http://stackoverflow.com/a/24846158
has comment: http://stackoverflow.com/comment/38579787
has comment: http://stackoverflow.com/comment/38579580
has comment: http://stackoverflow.com/comment/38579542
score: 2
has body: You have colons where you should have commas - it should be: $('.btindex').on('mouseover',function(){$(this).css('background-color','#f2ab1e')}); $('.btindex').on('mouseout',function(){$(this).css('background-color','#f0c911')}); updated fiddle: http://jsfiddle.net/8Hbnk/2/ or you can pass properties in an object to css(), being careful to use camelcase for the property names (e.g. backgroundColor instead of background-color): $('.btindex').on('mouseover',function(){$(this).css({backgroundColor:'#f2ab1e'})}); $('.btindex').on('mouseout',function(){$(this).css({backgroundColor:'#f0c911'})});
downvote count: 0
has comment: http://stackoverflow.com/comment/38579571
has comment: http://stackoverflow.com/comment/38579606
type: Answer
answers question: http://stackoverflow.com/q/24846146
upvote count: 2

http://stackoverflow.com/a/24899294
upvote count: 3
has body: I know this is not quite what you asked for. But, @undefined made a good point in his comment to your post. So instead of just auto forwarding to another page on a mouseover why not (if it's not clear to the user) advise that clicking will take them somewhere else. That's just nicer. Your markup: Lines of text Extra lines of text jQuery: var fetchContent = $('.unique').html(); $(document).ready(function(){ $('.unique').on('mouseenter',function(){ $(this).html('Click here and we\'ll go somewhere else!'); }); $('.unique').on('mouseleave',function(){ $(this).html(fetchContent); }); $('.unique').on('click',function(){ location.href='go-to-your-url'; }); }); Here's a fiddle: http://jsfiddle.net/6b8ku/1/
accepted answer of: http://stackoverflow.com/q/24899175
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24899175
score: 3

http://stackoverflow.com/a/24813729
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24813580
has comment: http://stackoverflow.com/comment/38537827
has comment: http://stackoverflow.com/comment/38525204
accepted answer of: http://stackoverflow.com/q/24813580
type: Answer
has comment: http://stackoverflow.com/comment/38525338
has body: If your aim is to avoid repeating yourself, you could create a method called call which you pass the name of your method and it can call myFunc before calling the given method: var aClass = function () {}; aClass.prototype.method1 = function () { console.log("Called method1"); }; aClass.prototype.call = function (method) { if (typeof this[method] === 'undefined') { throw new Error("Unknown method on aClass"); } this._myFunc(); this[method](); }; aClass.prototype._myFunc = function () { console.log("Called myFunc"); }; new aClass().call('method1'); // Outputs: // Called myFunc // Called method1 Fiddle: http://jsfiddle.net/se9Ya/5/ Note by adding the methods to the prototype rather than the actual object itself all the future 'instances' of aClass will share the same functions, this avoids duplicating function objects in memory. An alternative, and perhaps better way to do this, if you want to bind an arbitrary number of functions dynamically is like so: function bindPreMethodToClassMethods(klass, fn){ var i, originalFn; for(i in klass.prototype){ if(typeof klass.prototype[i] === 'function'){ originalFn = klass.prototype[i]; klass.prototype[i] = function() { fn(); originalFn(); } } } } var aClass = function () {}; aClass.prototype.method1 = function () { console.log("Called method1"); }; bindPreMethodToClassMethods(aClass, function(){ console.log("Called myFunc"); }); bindPreMethodToClassMethods(aClass, function(){ console.log("Called myOtherFunc"); }); new aClass().method1(); // Outputs: // Called myOtherFunc // Called myFunc // Called method1 Fiddle: http://jsfiddle.net/gX2FN/1/ I feel the second approach is better because the semantics are more clear, you still get to call the method1 method as normal.
has comment: http://stackoverflow.com/comment/38539297
score: 0

http://stackoverflow.com/a/24811537
type: Answer
has body: You can use Native Messaging, paired with a native program which will launch the browser. I would write the native application in something like Python.
upvote count: 1
answers question: http://stackoverflow.com/q/24808841
score: 1
has comment: http://stackoverflow.com/comment/38571608
downvote count: 0

http://stackoverflow.com/comment/38581945
comment on: http://stackoverflow.com/q/24847343
has text: @charlietfl No data is received
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38432709
score: 0
comment on: http://stackoverflow.com/q/24766686
type: Comment
type: QuestionComment
has text: It executes without parameters. I need to make a system call with parameters. Regardless, I wrote a batch file despite not wanting to and just got it over with

openlayers-3
type: Tag
tags question: http://stackoverflow.com/q/24774180
tags question: http://stackoverflow.com/q/24806006
tag name: openlayers-3

http://stackoverflow.com/comment/38933526
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25015670
has text: Do you have a real world example, i am unclear what goes into `main.js` file, and how that differs from not having a `packages` config. Also this won't still answer my original question, that is, if this is a optimizer bug, or i am getting something wrong?
type: AnswerComment

http://stackoverflow.com/comment/38698380
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24908794
has text: @Richa okay i got it now.

http://stackoverflow.com/a/24797468
answers question: http://stackoverflow.com/q/24797445
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: The functionality you asking can achieve by Use onkeyup or onkeydown instead. This will then run the function when you type or click on the textbox. You can also then detect the keycode of the event, and prevent the function if you dont want it to run for certain keys. Use the below code $("#search").keydown(function(){ text_changed(); }); $("#search").keyup(function(){ text_changed(); }); Demo Here

http://stackoverflow.com/comment/38698583
score: 0
type: Comment
has text: Kudos! I'd write it myself, but it's good for others who run into the same problem to see the working solution.
comment on: http://stackoverflow.com/a/24908993
type: AnswerComment

http://stackoverflow.com/comment/45886234
comment on: http://stackoverflow.com/a/28622135
score: 0
type: Comment
has text: @cgenco, thanks for sharing. Can you explain why it is insufficient without your `replace` functions? I will be happy to revise my answer.
type: AnswerComment

http://stackoverflow.com/a/24842710
type: Answer
upvote count: 4
has body: As far as I know navigator.geolocation is not a reactive data source. So this won't work without some explicit polling. Another thing that you've got wrong is that your helpers are not functions, so they couldn't be called repeatedly. This might work (not tested): Meteor.setInterval(function() { navigator.geolocation.getCurrentPosition(function(position) { Session.set('lat', position.coords.latitude); Session.set('lon', position.coords.longitude); }); }, 5000); Template.location.helpers({ lat: function() { return Session.get('lat'); }, lon: function() { return Session.get('lon'); } });
answers question: http://stackoverflow.com/q/24835925
downvote count: 0
has comment: http://stackoverflow.com/comment/38575609
has comment: http://stackoverflow.com/comment/38578325
score: 4

http://stackoverflow.com/comment/38415516
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24759007
has text: Just tried this and it doesn't seem to make a difference. I've just added a Plunkr as well: http://plnkr.co/edit/MDmrqaH1VzLBzjd5eHgT?p=preview
score: 0

http://stackoverflow.com/a/24804438
answers question: http://stackoverflow.com/q/24804216
type: Answer
accepted answer of: http://stackoverflow.com/q/24804216
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38500723
has comment: http://stackoverflow.com/comment/38501212
has body: I think you're looking for angulars $compile method: myApp.directive('addonclick', function($compile){ return { restrict: 'A', link: function(scope, element, attrs){ var html = attrs.addonclick; //or something else element.on("click", function(){ $(element).append($compile(html)(scope)); }) }; }; }); EDIT: Try getting the scope first: var scope = angular.element("yourElement").scope(); Then get and call the compile service: var compile = angular.element("yourElement").injector().get("$compile"); //or var compile = angular.injector(["moduleName"]).get("$compile"); $("yourElement").append(compile("&lt;my-directive/&gt;")(scope));
has comment: http://stackoverflow.com/comment/38500995
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38502483

http://stackoverflow.com/q/24780530
has comment: http://stackoverflow.com/comment/38456040
has comment: http://stackoverflow.com/comment/38455731
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24781046
has answer: http://stackoverflow.com/a/24780775
favorite count: 0
has title: html code in javascript function
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/38455646
has body: Heads up before reading. I'm totally new in html and so, so please be patient. I have the following html code and two javascript functions. &lt;HTML&gt; &lt;HEAD&gt; ..... &lt;/HEAD&gt; &lt;BODY&gt; &lt;CENTER&gt; &lt;form id="keyForm"&gt; Όνομα/Επώνυμο:&amp;nbsp;&amp;nbsp; &lt;input type="text" name="keyword"&gt;&lt;br&gt;&lt;br&gt; &lt;input type="button" onClick="resetFunction()" value="Επαναφορά"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;input type="button" onClick="my_search(this.form.keyword.value)" value="Αναζήτηση"&gt; &lt;/form&gt; &lt;p id="results"&gt;&lt;/p&gt; &lt;/CENTER&gt; &lt;script&gt; function resetFunction() { document.getElementById("results").innerHTML = ""; document.getElementById("keyForm").reset(); } &lt;/script&gt; &lt;script&gt; function my_search(kw) { document.getElementById("results").innerHTML = ( &lt;table border="1" style="width:500px"&gt; &lt;tr&gt; &lt;td&gt;ID&lt;/td&gt; &lt;td&gt;Επίθετο&lt;/td&gt; &lt;td&gt;Όνομα&lt;/td&gt; &lt;td&gt;Ημερομηνία πρόσληψης&lt;/td&gt; &lt;td&gt;Τμήμα&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; ); } &lt;/script&gt; &lt;/BODY&gt; &lt;/HTML&gt; I want the "results" to be be table that is described in function "my_search" extended by the actual results produced by the following php code. &lt;?php header("content-type: text/html;charset=utf-8"); $link = mysqli_connect("127.0.0.1","root", "tralalalalala", "mycompany"); if (!$link) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } //printf("Host information: %s&lt;br&gt;", //mysqli_get_host_info($link)); $key = $_POST['keyword']; //Keyword in initialized in html //echo $key; echo "&lt;br&gt;"; $stmt = mysqli_prepare($link, " select e.emp_id, e.first_name, e.last_name, e.hire_date, d.dept_name from employee e, department d where e.dept_id = d.dept_id and (e.first_name like ? or e.last_name like ?)"); $likeKey = "%{$key}%"; mysqli_stmt_bind_param($stmt, "ss", $likeKey, $likeKey); mysqli_stmt_execute($stmt); mysqli_stmt_bind_result($stmt, $id, $f_…
has comment: http://stackoverflow.com/comment/38455636
upvote count: 1
has comment: http://stackoverflow.com/comment/38455513
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38455682
tagged with: javascript
score: 0
answer count: 2

http://stackoverflow.com/a/24799632
has body: use each iterator $("li a").each(function(index,ele){ $(this).click (function(){ $(this).closest("ul").next("p.description").fadeToggle( "slow", "linear" ); }); });
type: Answer
has comment: http://stackoverflow.com/comment/38492376
answers question: http://stackoverflow.com/q/24799480
has comment: http://stackoverflow.com/comment/38492365
has comment: http://stackoverflow.com/comment/38492253
score: 0

http://stackoverflow.com/q/24828781
answer count: 3
has comment: http://stackoverflow.com/comment/38551441
downvote count: 0
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24829141
tagged with: php
has answer: http://stackoverflow.com/a/24829010
has title: Add form fields dynamically with php
has comment: http://stackoverflow.com/comment/38550905
has comment: http://stackoverflow.com/comment/38616252
has answer: http://stackoverflow.com/a/24829178
score: 1
upvote count: 1
type: Question
has body: Referring to this post. Add form fields dynamically populated dropdown list with php I have used his code but will modify it to fit my needs since I pretty much nothing about javascript. I have everything working except when you press the + button it never creates more input boxes. Any help would be great. This my php file <?php session_start(); require_once("dbconfig.php"); ?> Select Species '; <?php $stmt = $dbc->prepare("SELECT species FROM fish"); $stmt->execute(); while($speciesq = $stmt->fetch(PDO::FETCH_ASSOC)) { echo " " . $speciesq['species'] ." "; } ?> Number: Weight: My addfish.js file var rowNum = 0; var ddsel = ' '; var ddopt = ' Select Species '; var ddselc= ' '; ; function addRow(frm) { rowNum ++; $.post("getlist.php", function(data) { var frm = document.getElementById('form1') for (var i=0; i<data.length; i++) { ddopt += ' '+data[i].value+' '; } var row = ' '+ddsel+ddopt+ddselc+'Number: Weight: '; jQuery('#itemRows').append(row); frm.add_qty.value = ''; frm.add_name.value = ''; }, "json"); } function removeRow(rnum) { jQuery('#rowNum'+rnum).remove(); } This is my getlist.php <?php session_start(); include("dbconfig.php"); $stmt = $dbc->prepare("SELECT species FROM fish"); $stmt->execute(); $result = array(); while ($rows = $stmt->fetch(PDO::FETCH_ASSOC)){ $result[] = array( 'value' => $rows['species'], ); } echo json_encode($result); ?>
has comment: http://stackoverflow.com/comment/38547179
has comment: http://stackoverflow.com/comment/38547546
tagged with: javascript
linked to: http://stackoverflow.com/q/21088544

http://stackoverflow.com/comment/38428303
comment on: http://stackoverflow.com/a/24765661
type: Comment
has text: Wow, this is very thorough; thank you, but that minor problem that I mention in my EDIT still remains. It's really weird.
type: AnswerComment
score: 0

http://stackoverflow.com/a/24832112
has comment: http://stackoverflow.com/comment/38555089
upvote count: 3
has comment: http://stackoverflow.com/comment/38555121
has comment: http://stackoverflow.com/comment/38555232
has comment: http://stackoverflow.com/comment/38555021
answers question: http://stackoverflow.com/q/24831718
has comment: http://stackoverflow.com/comment/38555655
type: Answer
has body: Promises bring back the qualities of synchronous code. Given your API is already promisified - You simply return a promise from your function and then use that. module.exports.connect = Promise.method(function(){ // do a bunch of stuff return mongo.connectAsync().then(... }); Note the Promise.method bit isn't required, it just turns thrown errors into rejections to give you throw safety and makes sure you return a promise so it's best practice and guards you against mishaps.
score: 3
has comment: http://stackoverflow.com/comment/38555398
downvote count: 0

http://stackoverflow.com/comment/38479558
type: Comment
comment on: http://stackoverflow.com/q/24792562
has text: There is no specification for the behavior of developer consoles.
score: 0
type: QuestionComment

http://stackoverflow.com/a/24865483
upvote count: 3
score: 3
has comment: http://stackoverflow.com/comment/38616739
has body: My guess would be your select tags are in different scope to your controller. So the ng-model store selected values inside the wrong scope. To avoid this the best practice is to use the dot notation like model.selectedJobLineTypeFSC: And in the controller check for $scope.model.selectedJobLineTypeFSC instead.
downvote count: 0
has comment: http://stackoverflow.com/comment/38616648
type: Answer
answers question: http://stackoverflow.com/q/24865338

http://stackoverflow.com/comment/38501960
type: AnswerComment
has text: All very good points, which should also be included along with the use of `closest` and `find` (the lack of which caused the actual problem).
type: Comment
comment on: http://stackoverflow.com/a/24804964
score: 0

http://stackoverflow.com/a/24791593
has body: You have to have foundation.clearing.js loaded after foundation.js Reference link It states In order to get Clearing to build itself properly, you'll need to have JavaScript properly included.
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/24766310
has comment: http://stackoverflow.com/comment/38520514
accepted answer of: http://stackoverflow.com/q/24766310
score: 0

http://stackoverflow.com/comment/38671051
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24894188
type: Comment
has text: I thought that CSS that got added last time will overwrite anything from before.

rpc
tag name: rpc
tags question: http://stackoverflow.com/q/24770192
type: Tag

http://stackoverflow.com/a/24808390
has comment: http://stackoverflow.com/comment/38508589
has body: Call this function like myval(2) or myval(4) by passing any value you want function myval(x) { if(x===0 || x===1 || x==2) return 0; if(x===3 || x===4 || x==5) return 1; if(x===6 || x===7 || x==8) return 2 }
answers question: http://stackoverflow.com/q/24808222
type: Answer
score: 0

http://stackoverflow.com/a/24758936
has comment: http://stackoverflow.com/comment/38416471
answers question: http://stackoverflow.com/q/24758733
has comment: http://stackoverflow.com/comment/38415260
score: 0
has body: Having understood from @banana's interpretation that it works occasionally, @user3840910 please check your usage of ScriptManager.RegisterStartupScript The third parameter for that method should be an unique identifier for the script being registered. Refer to: http://msdn.microsoft.com/en-us/library/bb359558(v=vs.110).aspx Also @user3840910, it would be a good practice to format your scripts while posting and not miss semicolons at the end of lines in javasript.
type: Answer
has comment: http://stackoverflow.com/comment/38416539

http://stackoverflow.com/comment/38699449
type: Comment
comment on: http://stackoverflow.com/a/24909204
has text: You're welcome. I'm actually still amazed that there is a way to grab comments from HTML :)
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38418211
type: QuestionComment
comment on: http://stackoverflow.com/q/24759772
score: 0
has text: are you sure $(this) is always refering to $('#slider') in the complete callback? Try to remplace it by $('#slider').
type: Comment

http://stackoverflow.com/comment/51903756
has text: @Petr: I couldn't agree more. When This fix was announced in 7.1 we quickly rolled out a new checkout purchase flow which pinned the primary CTA to the bottom of the screen.. this worked and converted great! It felt very "native" and seamless. Which i think is the exact problem. If you think about it, it's not in Apples' best interest for web apps to feel native. It is in fact a direct conflict of interest with their App Store monopoly. This is, IMO, the only valid reason why a feature that makes so much sense was fixed and then intentionally removed. #my2Cents :)
type: Comment
comment on: http://stackoverflow.com/a/26884561
score: 6
type: AnswerComment

http://stackoverflow.com/comment/38458676
comment on: http://stackoverflow.com/q/24777824
type: Comment
type: QuestionComment
has text: may u pls run that program... u'll find what m i want to say.. u jst copy paste...
score: 0

http://stackoverflow.com/comment/38635354
has text: Note, that sometimes a plugin might conflict with your design and is less likely to work properly and adapt itself to it. Sometimes, you can achieve the desired result by custom coding it. I'm never one to back out of a challenge, and also I needed some training in CSS3 transition animations. I wrote a simple code that does exactly the same thing as the plugin, but simplified. I had to re-arrange your CSS and html a bit, but it's not that complicated.
comment on: http://stackoverflow.com/q/24868698
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38644629
type: Comment
type: QuestionComment
has text: here double click means second click until image moved completely, right?
comment on: http://stackoverflow.com/q/24880113
score: 0

http://stackoverflow.com/comment/38575609
score: 0
type: Comment
has text: Thanks again Christian. I was asking for the location only once (the 'if' statement in the getter), but I do like the polling idea. However, I was looking to make _lat.get() the reactive source, not the geolocation API. Geolocation is working, just not the Deps stuff.
comment on: http://stackoverflow.com/a/24842710
type: AnswerComment

http://stackoverflow.com/a/24850625
answers question: http://stackoverflow.com/q/24850113
has body: You just need to put your old js in the polymer elements script tag. The ready function is called when the element is set up. The second argument of Polymer() needs to be an object, not a function. &lt;script&gt; Polymer('my-app', { ready: function () { var navicon = this.$.navicon; var back = this.$.back; var drawerPanel = this.$.drawerPanel; navicon.addEventListener('click', function() { drawerPanel.togglePanel(); }); back.addEventListener('click', function() { window.history.back(); }); } }); &lt;/script&gt; For more information read the awesome polymer docs.
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24850113
has comment: http://stackoverflow.com/comment/38588235
score: 4
has comment: http://stackoverflow.com/comment/38623687
type: AcceptedAnswer
type: Answer
upvote count: 4

gridview
tags question: http://stackoverflow.com/q/24897998
tags question: http://stackoverflow.com/q/24779249
tag name: gridview
tags question: http://stackoverflow.com/q/24887173
tags question: http://stackoverflow.com/q/24887183
type: Tag
tags question: http://stackoverflow.com/q/24902542
tags question: http://stackoverflow.com/q/24893170
tags question: http://stackoverflow.com/q/24858947

http://stackoverflow.com/comment/38634932
score: 0
type: AnswerComment
type: Comment
has text: @CodeMaverick I probably wouldn't have given it a +1 yet either but the stupid downvote swayed me. :P Now it has a proper example.
comment on: http://stackoverflow.com/a/24874717

http://stackoverflow.com/comment/38521593
type: QuestionComment
type: Comment
has text: I think this is good practice. Minimising the use of nested if statements is always good for code readability and length. You can put your "do more operation" sections into separate functions as well and return procedurally through the execution when things go well or wrong
comment on: http://stackoverflow.com/q/24815011
score: 0

http://stackoverflow.com/q/24780854
has title: KnockoutJS + Polymer: bindings break (Outside of Chrome)
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/27232259
has comment: http://stackoverflow.com/comment/38458473
has comment: http://stackoverflow.com/comment/38458165
tagged with: knockout.js
type: Question
tagged with: polymer
has comment: http://stackoverflow.com/comment/39889229
answer count: 2
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25565419
favorite count: 0
possible better answer: http://stackoverflow.com/a/27232259
has body: EDIT: This only appears outside of Chrome I'm using KO to fill in elements using foreach bindings. On the other side of the coin, I've got Polymer loaded up to make use of Google's Material Design styling. The issue is that there seems to be an assertion in the platform.js file (Polymer) that is trying to take over the data-bind even though Polymer doesn't use the data-bind attribute. Wondering if anybody has had any experience using both of these, or any suggestions? Error is below: Error: Unable to process binding "template: function (){return { foreach:sessions} }" Message: Assertion failed JSFiddle: http://jsfiddle.net/Rmp6c/3/ EDIT: So I've setup the debug version, and it appears that inside ShadowDOM/src/wrappers.js on line 31 there is an assert(b) function that is being passed a boolean. This is called 100s of times by a Node.js file, and to fix this looks like it would require a fairly large rewrite. My fix for this has been to use jQuery to insert the DOM element with the foreach binding, and then apply my KO bindings inside a $(document).ready(function() {}); tag. This appears to work on all browsers.
has comment: http://stackoverflow.com/comment/38459607
has answer: http://stackoverflow.com/a/25565419
tagged with: cross-browser
has comment: http://stackoverflow.com/comment/38460422
has comment: http://stackoverflow.com/comment/39889307
upvote count: 3
has comment: http://stackoverflow.com/comment/39924208
has comment: http://stackoverflow.com/comment/38459576

http://stackoverflow.com/a/24756412
type: Answer
has body: // set this somewhere outside of the $.get callback. // no need to pass it in as it will be available in that scope. var data_array = []; $.get('sample0.txt', function(data) { var lines=data.split('\n'); for (var i=0; i&lt;lines.length;i++){ var item=lines[i]; data_array.push([0,item]); // modify data_array here } // no need to return it }); Here's a very reduced test: http://jsfiddle.net/4GMMd/ Also note no -1 after lines.length in your for loop, unless your files end with a blank line that you don't want to read.
score: 0
has comment: http://stackoverflow.com/comment/38420409
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24756251
answers question: http://stackoverflow.com/q/24756251

http://stackoverflow.com/q/24858336
tagged with: forms
has body: I would like to perform a search based on the chosen value from select dropdown list but I am not sure how to use javascript to perform that search. Below is my code. 1 2 3 Google Yahoo Facebook
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
score: 1
has answer: http://stackoverflow.com/a/24858470
favorite count: 0
has title: onclick using Button for select option
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/38603455
has answer: http://stackoverflow.com/a/24858612

http://stackoverflow.com/comment/38503249
has text: @geocodezip I have edited my question, which includes my json file. Could it be that the format of GPSLatitude and GPSLongtitude is different inside the file, that's why nothing happened?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24800687

http://stackoverflow.com/comment/38484737
comment on: http://stackoverflow.com/q/24794976
has text: Rahul, you are incorrect. Chrome and Firefox have the JS option among many in a very accesible and per site basis.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/41634598
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26356871
has text: Though @alireza's answer was correct, this is a very nice and suitable answer for the question.
type: AnswerComment

http://stackoverflow.com/q/24808029
has title: CKEditor key event not updating text properly
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/24823612
tagged with: onkeydown
tagged with: http://stackoverflow.com/tag/html
has body: I have the following code to automatically update the content inside a div when the user types it inside a CKEditor textarea: CKEDITOR.instances.editor.on("key", function(e) { var preview = document.getElementById('some-div'); preview.innerHTML = CKEDITOR.instances.editor.getData(); }); The problem is that if I type in "Hello world", in the div it appears "Hello worl" and the "d" doesn't appear until another key is pressed. And I would want the same content in both places. Thanks in advance!
tagged with: keyevent
upvote count: 3
type: Question
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/24823612
tagged with: javascript
tagged with: ckeditor

http://stackoverflow.com/comment/38658281
has text: what could take so much time ?
comment on: http://stackoverflow.com/q/24883619
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24898264
tagged with: post
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/38679138
answer count: 2
has title: Using jquery ajax vs native xhr
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/24898482
accepted answer: http://stackoverflow.com/a/24898482
tagged with: jquery
score: 4
tagged with: ajax
possible better answer: http://stackoverflow.com/a/24898469
has body: I'm not too familiar with JQuery, and I'm trying to make a post request using jquery ajax. I was previously using xhr, and I'm not totally sure if I'm reworking it correctly. If someone could give me some feedback, that would be greatly appreciated! Here is my original code with xhr: j("#saveButton").click(function() { var ID = j(".selected-list")[0].getAttribute('id'); var subject = j('input').val(); var blurb = j("#blurb_stream").val(); var date = j('datepicker').val(); if(blurb.length != '' &amp;&amp; ID != undefined &amp;&amp; subject.length != ''){ xhr.open("POST", envUrl + "streams/" + ID + "/touches?subject=" + subject + "&amp;body=" + blurb + "&amp;schedule_on=" + date, true); xhr.onreadystatechange = function() { if (xhr.readyState == 4) { console.log('saved!'); } else { alert('not working'); } } xhr.send(); } }); Here is my adjusted code using ajax: j("#saveButton").click(function() { var ID = j(".selected-list")[0].getAttribute('id'); var subject = j('input').val(); var blurb = j("#blurb_stream").val(); var date = j('datepicker').val(); var data = new FormData(); data.append("date", "date"); data.append("ID", "ID"); data.append("subject", "subject"); data.append("blurb", "blurb"); // check this! if(blurb.length != '' &amp;&amp; ID != undefined &amp;&amp; subject.length != ''){ j.ajax({ url: 'envUrl + "streams/" + ID + "/touches?subject=" + subject + "&amp;body=" + blurb + "&amp;schedule_on=" + date', type: "POST", data: data, success: function(){ alert(1); } }); } }
favorite count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24898469

http://stackoverflow.com/a/24773015
has comment: http://stackoverflow.com/comment/38442677
has comment: http://stackoverflow.com/comment/38442421
answers question: http://stackoverflow.com/q/24772281
has comment: http://stackoverflow.com/comment/38442378
has comment: http://stackoverflow.com/comment/38441880
has body: Yes you can with Jquery UI, I created a Demo for you, so just drag the box about center on screen and it will hide. http://jsfiddle.net/JEV5T/ var coordinates = function(element) { element = $(element); var top = element.position().top; var left = element.position().left; $('#results').text('X: ' + left + ' ' + 'Y: ' + top); // If the box position is greater than 133px from left then hide it if (left &gt; 133) { $("#box").hide(); } } $('#box').draggable({ start: function() { coordinates('#box'); }, stop: function() { coordinates('#box'); } }); If you want to hide a different element while moving the box the change the ($("#box").hide();) to the name of the div element. Also you can add another (if) statement to unhide it. Taken from here on how to get the coordinates of a div using JQ UI. http://gabrieleromanato.name/jquery-getting-the-coordinates-of-a-draggable-object/
has comment: http://stackoverflow.com/comment/38442011
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38441724
type: Answer
accepted answer of: http://stackoverflow.com/q/24772281

http://stackoverflow.com/q/24879561
tagged with: angular-routing
downvote count: 0
tagged with: javascript
score: 1
accepted answer: http://stackoverflow.com/a/24880363
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38643851
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38643675
has title: AngularJS 1.2.9 ngRoute "unknown provider $routeProvider error with requireJS
tagged with: requirejs
upvote count: 1
possible better answer: http://stackoverflow.com/a/42687417
type: Question
has answer: http://stackoverflow.com/a/42687417
has answer: http://stackoverflow.com/a/24880363
has body: I'm using angularJS-1.2.9 and angular-route-1.2.9 to set up routes for my application , i'm using requireJS as the dependency loader and modularize the code . I have added the ngRoute dependency into the AngularJS config , but still getting this following error in the chrome console Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to:Error: [$injector:unpr] Unknown provider: $routeProvoider Here is my code main.js require.config({ baseUrl: './js', paths: { angular: 'libs/angular-1.2.9', angularRoute: 'libs/angular-route-1.2.9' }, shim: { 'angularRoute': { deps: ['angular'], exports: 'angularRoute' }, 'angular': { exports: 'angular' } } }); require(['angular', 'angularRoute'], function (angular, angularRoute) { 'use strict'; var app = angular.module('myApp', ['ngRoute']); angular.element(document).ready(function () { angular.bootstrap(document, ['myApp']); }); app.controller('indexController', function ($scope, $http) { console.log('inside index'); }); app.config( function ($routeProvoider) { $routeProvider. when('/', { templateUrl: 'index_content.html', controller: 'indexController' }) }); }); Here are my html files index.html index_content.html inside Index content testing the ang routes Whats the issue here ?? Why is it still giving away the above mentioned error ?? How to fix this ??
answer count: 2

http://stackoverflow.com/comment/38498376
has text: Your if statement to check if `canRun` is true will kind of need to be inside the `scroll` handler function...
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24803011
score: 1

http://stackoverflow.com/comment/38522895
comment on: http://stackoverflow.com/q/24794217
score: 0
type: QuestionComment
has text: The problem with only redrawing is that the amount of visible points is constantly reduced when zooming, and I would like to have the graph always be hoverable and clickable. To do that, I would have to re-init (I believe).
type: Comment

http://stackoverflow.com/q/24799222
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/38491558
has body: I have edit an new CSS Style in my HTML File. Since this changes my Calculator not work, but I dont know why, Firebug show nothing Errors or Warnings. Here is the Code (jsfiddle has shifted the design) --&gt; http://jsfiddle.net/44gU9/
has comment: http://stackoverflow.com/comment/38491602
type: Question
has title: JQuery Calculator not work since new CSS Style
has comment: http://stackoverflow.com/comment/38491506
has comment: http://stackoverflow.com/comment/38491946
has answer: http://stackoverflow.com/a/24799405
tagged with: javascript
tagged with: jquery
answer count: 2
downvote count: 4
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/24799468
has answer: http://stackoverflow.com/a/24799468
favorite count: 0
accepted answer: http://stackoverflow.com/a/24799405
score: -2
has comment: http://stackoverflow.com/comment/38491661

http://stackoverflow.com/comment/38633503
comment on: http://stackoverflow.com/q/24795404
score: 0
has text: Did you check whether all the values you're using there are what you'd expect?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24931312
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24889113
type: Answer
answers question: http://stackoverflow.com/q/24889113
has body: After lots of research I found out that maxThreads="1000" actually solved the problem, however Mozilla only allows 200 sockets. So I had to test again from multiple client machines. Default maximum number of websocket connections allowed in FireFox is 200. Source: https://developer.mozilla.org/en/docs/WebSockets#Gecko_7.0
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/42287686
has comment: http://stackoverflow.com/comment/42282977

http://stackoverflow.com/q/24832213
tagged with: jquery-chosen
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/27491685
has answer: http://stackoverflow.com/a/27491685
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24834289
tagged with: jquery-validate
score: 3
has body: I have the code below http://jsfiddle.net/emamut/CBjmj/4/ $.validator.setDefaults({ ignore: ":hidden:not(select)" }); $('form').validate({ highlight: function(element) { $(element).closest('.form-group').addClass('has-error'); }, unhighlight: function(element) { $(element).closest('.form-group').removeClass('has-error'); }, errorElement: 'span', errorClass: 'help-block', errorPlacement: function(error, element) { if(element.parent('.input-group').length) { error.insertAfter(element.parent()); } else { error.insertAfter(element); } } }); but when select validate the formatting is lost and returns the normal format of Chosen
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/24834289
has title: Bootstrap 3 + Chosen + jquery validate loses format
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
upvote count: 3

http://stackoverflow.com/q/24859463
has comment: http://stackoverflow.com/comment/38605691
has comment: http://stackoverflow.com/comment/38605604
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/38605492
tagged with: javascript
has answer: http://stackoverflow.com/a/24859593
tagged with: jquery
has comment: http://stackoverflow.com/comment/38605588
score: 0
has answer: http://stackoverflow.com/a/24859501
tagged with: http://stackoverflow.com/tag/html
has body: I've been trying to find away of doing this: stackUp = function(a){ var stack = ""; stack += "&lt;div class='stackWrap'&gt;"; stack += "&lt;div class='stackInfo'&gt;&lt;/div&gt;"; stack += "&lt;div class='stackBox'&gt;"; stack += "&lt;/div&gt;"; stack += "&lt;/div&gt;"; for(var i=0;i&lt;a.length;i++){ $(stack).find("stackBox").append(a[i].box); } return $(stack); } all I want to do is to insert each box from a object into "stackBox" div remembered in "stack", can anyone help me with this?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38606752
has title: Insert dom inside another dom as variable
tagged with: dom

http://stackoverflow.com/q/24757047
favorite count: 0
has answer: http://stackoverflow.com/a/24761173
has title: Google Maps: Keep additional info with LatLng while dragging polylines
upvote count: 1
has body: In my JavaScript application, I am trying to edit my paths which are stored in database. To achieve that, I create a google.maps.Polyline with array of google.maps.LatLng. For each LatLng I add id of row stored in database simply as: var latLng = new google.maps.LatLng(item.latitude, item.longitude); latLng.id = id; coords.push(latLng); The result is similar as here: http://www.geocodezip.com/v3_GoogleEx_polyline-simple_editingEvents.html This is working and I can access the id. However once the point is dragged, new LatLng is created and the old one is dropped – and so the original id is lost. How can I keep the id with each point to be able to update the row in the database?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24761173
type: Question
tagged with: google-maps
has comment: http://stackoverflow.com/comment/38411653
answer count: 1
downvote count: 0
tagged with: javascript
score: 1
has comment: http://stackoverflow.com/comment/38412609

http://stackoverflow.com/comment/38656031
has text: Return promise instead of boolean.
comment on: http://stackoverflow.com/q/24886461
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/38415633
comment on: http://stackoverflow.com/a/24759080
score: 0
type: AnswerComment
type: Comment
has text: will not end at the break line ? it can continuously match a long space if the expression requires it, but you need m if you use ^ or $

http://stackoverflow.com/comment/38625013
type: AnswerComment
has text: Understandable. This is further than I've gotten before! Thank you very much!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24869295

http://stackoverflow.com/a/24817680
has body: You'd probably want something more like this function tableCreationForQuoteItem() { var table = $('&lt;table /&gt;'), tr1 = $('&lt;tr /&gt;'), tr2 = $('&lt;tr /&gt;'), th1 = $('&lt;th /&gt;', {text : 'Item'}), th2 = $('&lt;th /&gt;', {text : 'Description'}), th3 = $('&lt;th /&gt;', {text : 'Unit Cost'}), th4 = $('&lt;th /&gt;', {text : 'Tax Rate'}), th5 = $('&lt;th /&gt;', {text : 'Unit Of Measurement'}), td1 = $('&lt;td /&gt;', {text : $('#Quote_quoteitem_name').text()}), td2 = $('&lt;td /&gt;', {text : $('#Quote_description').text()}), td3 = $('&lt;td /&gt;', {text : $('#Quote_unitcost').text()}), td4 = $('&lt;td /&gt;', {text : $('#Quote_taxrate_value').text()}), td5 = $('&lt;td /&gt;', {text : $('#Quote_uom_value').text()}); table.append( tr1.append( th1, th2, th3, th4, th5 ), tr2.append( td1, td2, td3, td4, td5 ) ); $('element').append(table); } FIDDLE
answers question: http://stackoverflow.com/q/24817497
score: 0
type: Answer

http://stackoverflow.com/comment/38570019
type: AnswerComment
comment on: http://stackoverflow.com/a/24837951
type: Comment
has text: You can use "whitespace" to define multiple domain in whitelist. I've updated my answer.
score: 0

http://stackoverflow.com/comment/38400599
type: QuestionComment
comment on: http://stackoverflow.com/q/24751153
score: 0
type: Comment
has text: The for loop is inside of doc ready handler, so it would execute after rendering the final h1.

postback
tag name: postback
tags question: http://stackoverflow.com/q/24863795
type: Tag
tags question: http://stackoverflow.com/q/24782896

http://stackoverflow.com/a/24754986
has body: There is no good reason to do so. Either: the author doesn't understand that object property names are not variables that need declaring they are left over from code that has been deleted they have been put in place in (incorrect) anticipation of those variables being used
answers question: http://stackoverflow.com/q/24754926
type: Answer
downvote count: 0
score: 3
upvote count: 3

http://stackoverflow.com/q/24834812
score: 28
favorite count: 0
possible better answer: http://stackoverflow.com/a/57467694
has answer: http://stackoverflow.com/a/54434746
has answer: http://stackoverflow.com/a/24834852
answer count: 4
type: AnsweredQuestion
downvote count: 0
upvote count: 28
has answer: http://stackoverflow.com/a/57467694
type: Question
tagged with: stringify
has comment: http://stackoverflow.com/comment/38558678
has answer: http://stackoverflow.com/a/79502613
tagged with: arrays
has title: Space in between JSON.stringify output
tagged with: javascript
tagged with: jquery
has body: I am using Jquery to get all products name from page and than put it on array. I am using this code This give me output in this format [{"name":"Sample Product Name"},{"name":"Sample Product Name 2"}] What I am trying to achieve is to have one space in between these two objects after "," so the output will look something like this [{"name":"Sample Product Name"}, {"name":"Sample Product Name 2"}] Any advise? I am struggling from hours and no success. Here is the jsfiddle http://jsfiddle.net/2MeMY/1/
has comment: http://stackoverflow.com/comment/38558663
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/65430287
has comment: http://stackoverflow.com/comment/38558577
accepted answer: http://stackoverflow.com/a/24834852

http://stackoverflow.com/q/24832010
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38558506
has comment: http://stackoverflow.com/comment/38558489
favorite count: 0
answer count: 0
upvote count: 2
type: UnansweredQuestion
has title: HTML 5 Form Validation
has comment: http://stackoverflow.com/comment/38558339
has comment: http://stackoverflow.com/comment/38553329
downvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/38558470
has body: Is there a way to force HTML5 required field validation to execute before the onsubmit event handler is called? Alternatively, is there a way to execute the HTML5 required validation from within the onsubmit event handler? My web form containing several HTML5 &lt;input&gt; elements with required attributes. The form's onsubmit event handler is assigned using the onsubmit="PerformWork();" HTML markup. The field validation works perfectly without the event handler. However, when I add the handler the validation stops working and the event handler is called instead.
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38558774
has comment: http://stackoverflow.com/comment/38553341

http://stackoverflow.com/a/24751618
type: Answer
score: 0
has body: Id attribute must be unique so remove the id from td elements (you don't need it) and leave it only on input elements. Code: Subtotal Tax Total Due Demo: http://jsfiddle.net/IrvinDominin/S2AP6/
accepted answer of: http://stackoverflow.com/q/24751374
answers question: http://stackoverflow.com/q/24751374
type: AcceptedAnswer

http://stackoverflow.com/a/24789838
has comment: http://stackoverflow.com/comment/38507899
has comment: http://stackoverflow.com/comment/38474672
answers question: http://stackoverflow.com/q/24789119
score: 0
has comment: http://stackoverflow.com/comment/38489783
has comment: http://stackoverflow.com/comment/38502531
has body: If the controller is only needed for the templates, then you should add it as a controller in the directive. Otherwise, you need to expose the relevant part of your scope to the directive - it's usually not advisable to expose the whole parent scope. I won't write up all the possibilities here, but I will point you in a good direction for where to learn about directives and scope: http://www.sitepoint.com/practical-guide-angularjs-directives/ http://weblogs.asp.net/dwahlin/creating-custom-angularjs-directives-part-i-the-fundamentals Both of those have a 2 part tutorial which should get you started along the way.
type: Answer

http://stackoverflow.com/comment/66160874
type: Comment
type: AnswerComment
has text: @glad-s-river the code you liked to merges a variable called `cliOptions`, the options set via command line flags, I presume.
score: 0
comment on: http://stackoverflow.com/a/24889514

http://stackoverflow.com/comment/38677779
type: QuestionComment
comment on: http://stackoverflow.com/q/24897699
has text: I was going to use a cookie but I thought best practice might be to store it locally.
type: Comment
score: 0

http://stackoverflow.com/a/24899085
answers question: http://stackoverflow.com/q/24899021
has comment: http://stackoverflow.com/comment/38681328
has comment: http://stackoverflow.com/comment/38680560
has comment: http://stackoverflow.com/comment/38681244
type: Answer
has comment: http://stackoverflow.com/comment/38680393
has comment: http://stackoverflow.com/comment/38680360
has body: The problem with your code is you check the index of the text AFTER you set the text. The check would need to come before you set the text. But there are other ways to do it that do not involove relying of text. Text can change because some people use translation plug-ins built into the browser. Don't rely on text. You can unbind the first click event and than add another one. This will just get rid of the check all together. $(".button").on("click.confirm", function(e) { e.preventDefault(); var btn = $(this); btn.text(btn.attr('title') + ' Sure? click again'); // adds confirm text to link btn.off("click.confirm"); //Bind new click event that does next step... btn.on("click.next", nextStep); }); function nextStep() { alert("hi"); } If you want to do it with a boolean logic, you can use data() to store the state. In this case we will store a boolean true. When we set the message we set it to true, next click the if check will get the true and you can fire the next step. $(".button").on("click.confirm", function(e) { e.preventDefault(); var btn = $(this); if (btn.data("clicked")) { nextStep(); } else { btn.text(btn.attr('title') + ' Sure? click again'); // adds confirm text to link btn.data("clicked",true); } }); If you want to use classes instead of a data attribute it is simple also. Bonus is you can add a stylesheet rule to change the color. $(".button").on("click.confirm", function(e) { e.preventDefault(); var btn = $(this); if (btn.hasClass("clicked")) { nextStep(); } else { btn.text(btn.attr('title') + ' Sure? click again'); // adds confirm text to link btn.addClass("clicked"); } });
upvote count: 2
has comment: http://stackoverflow.com/comment/38680430
has comment: http://stackoverflow.com/comment/38681184
score: 2
has comment: http://stackoverflow.com/comment/38681134
accepted answer of: http://stackoverflow.com/q/24899021
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38680331
has comment: http://stackoverflow.com/comment/38680625

http://stackoverflow.com/comment/38748905
type: Comment
has text: Well there are several ways of doing this, but my approach would be to append a `div` on top of everything else for this.
type: QuestionComment
comment on: http://stackoverflow.com/q/24901162
score: 0

http://stackoverflow.com/a/24784963
has comment: http://stackoverflow.com/comment/38466670
has comment: http://stackoverflow.com/comment/38465229
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/38464671
has comment: http://stackoverflow.com/comment/38465524
answers question: http://stackoverflow.com/q/24784901
has body: If I understand well your question, you can do html = html.split('\n').filter(function(l){ return !/^\s*{title:.*},?\s*/.test(l) }).join('\n');

http://stackoverflow.com/q/24877926
type: UnansweredQuestion
has title: jquery global variable doesn't get updated in ajax function
tagged with: php
has comment: http://stackoverflow.com/comment/38646823
has body: I have following code: &lt;script type="text/javascript"&gt; &lt;!-- PAGER var pag = 1; var loading = false; var pag1 = &lt;?php echo $k1; ?&gt;; var pag2 = &lt;?php echo $k2; ?&gt;; var max_pages_number = &lt;?php echo $max_pages_number; ?&gt;; jQuery('body').on('click',"#registry_show_more",function(){ if(pag &lt; max_pages_number &amp;&amp; !loading) { loading = true; jQuery(this).hide(); jQuery("#spinner").show(); alert(pag1 + ' ' + pag2); //alert 1 jQuery.ajax({ type: 'POST', url: '&lt;?php echo admin_url('admin-ajax.php'); ?&gt;', data: { action: 'registry_paggination', page: pag+1, p1: pag1, p2: pag2, page_size: &lt;?php echo $page_size; ?&gt;, category: &lt;?php echo $kategoria; ?&gt;, category_slug: '&lt;?php echo $kategoria_slug; ?&gt;', filtr: '&lt;?php echo $filtr; ?&gt;', access: &lt;?php echo $access; ?&gt;, }, success: function(data, textStatus, XMLHttpRequest){ pag++; jQuery("#spinner").hide(); if(pag &lt; max_pages_number) { jQuery('#registry_show_more').show(); } if(data) { jQuery("#newpages").append(jQuery("#newpages").html() +data); FB.XFBML.parse(); jQuery('.open-iframe-lightbox').magnificPopup({type:'iframe'}); pag1 = parseInt(jQuery("#p1").attr('value'),10); pag2 = parseInt(jQuery("#p2").attr('value'),10); alert(pag1 + ' ' + pag2); //alert 2 jQuery("#p1").remove(); jQuery("#p2").remove(); } loading = false; }, error: function(MLHttpRequest, textStatus, errorThrown){ jQuery("#spinner").hide(); } }); } }); //--&gt; &lt;/script&gt; Variables pag, pag1, pag2 update after success function. I know it because i use two alerts to check it. But ajax function send default values. For example: initial values: pag = 1; pag1 = 18; pag2 = 2; first alert shows: "18 2" ajax sends: page: 2, p1: 18, p2: 2 //skiping the rest of variables second alert shows(just updated): "35 5" All fine but on the next click: first alert shows: - ok "35 5" ajax sends: - not ok page: 2, p1: 18, p2: 2 //skiping the rest of variables second alert shows(just updated): - ok, because …
type: Question
has comment: http://stackoverflow.com/comment/38655885
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
answer count: 0

http://stackoverflow.com/comment/38548381
type: QuestionComment
type: Comment
has text: HI tired using the chat but never used it before so not sure if you have to be in the room to see the messages, if you have already seen this let me know and i'll delete this comment.
comment on: http://stackoverflow.com/q/24815220
score: 0

http://stackoverflow.com/comment/38540724
comment on: http://stackoverflow.com/q/24823661
score: 0
type: Comment
type: QuestionComment
has text: Thanks for having a look Sebsemillia. If you click one of the projects, you will see that a new window opens and three images appear one on top of the other. However if you resize the screen at all the images all merge into one and start to scroll (this is what should happen on ititial opening of the window). I'll try to get some screen shots. I'm also using chrome, although tested on ffox and IE. When you say it works for you, do you mean the images open and scroll as normal?

mootools
tags question: http://stackoverflow.com/q/24832094
tags question: http://stackoverflow.com/q/24906929
tags question: http://stackoverflow.com/q/24811258
type: Tag
tags question: http://stackoverflow.com/q/24908835
tag name: mootools
tags question: http://stackoverflow.com/q/24887183

http://stackoverflow.com/comment/38602985
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24857698
has text: @Coffee'd Up Hacker: from your question it's not clear what you want to load. Just a CPU core. A browser process. A particular browser tab.

http://stackoverflow.com/comment/38648436
type: AnswerComment
type: Comment
has text: I have never had to create a `RangeChangeHandler` directly - I have always used `AbstractDataProvider#addDataDisplay(HasData<T> display)` to bind the pager to the data provider. This in turn creates and adds a `RangeChangeHandler` and calls `onRangeChanged()` to handle the initial case.
comment on: http://stackoverflow.com/a/24861561
score: 0

http://stackoverflow.com/a/24897585
type: Answer
has body: Use the checked selector http://api.jquery.com/checked-selector/ E.g. $('input[type=checkbox]').click(function() { if ($(this).is(':checked')) { // do something when checked } else { // do something when unchecked } }); Personally I use click events for checkboxes. They seem to work better than change. Further you can access the id or value property of the checkbox that's currently clicked/changed, using this.value and this.id (inside the function "this" refers to the DOM element).
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/24897452
downvote count: 0

http://stackoverflow.com/q/24885914
has comment: http://stackoverflow.com/comment/38657981
has body: I'm trying to figure out how to add my object from a form. Any ideas how I can add a new name and photo_url to the end of my object? Thanks, data = [ {name: "Mark-Paul Gosselaar", photo_url: ""}, {name: "Delta Burke", photo_url: "img/avatars/delta.png"}, {name: "Alf", photo_url: "img/avatars/alf.png"}, {name: "Jaleel White", photo_url: "img/avatars/jaleel.png"}, {name: "Ralph Macchio", photo_url: "img/avatars/ralph.png"}, {name: "Candace Cameron", photo_url: "img/avatars/candace.png"}, {name: "Patrick Duffy", photo_url: "img/avatars/pduff.png"}, {name: "Arnold Schwartzengger", photo_url: "img/avatars/arnold.png"} ]; //MY CODE $(document).ready(function() { var employee = data; var directory = $("#directory"); //SORT THROUGH THE JSON DATA AND REVERSE IT function reverseArr(input) { for (var i = input.length - 1; i >= 0; i--) { var photoPlacement = employee[i].photo_url; //CHECKS TO SEE IF A PHOTO_URL OBJECT HAS SOMETHING IN IT, IF IT DOESN'T THEN INJECTS THE DEFAULT IMAGE if (photoPlacement.length <= 0) { photoPlacement = 'img/default.png' } else { photoPlacement = employee[i].photo_url; } var employeePost = " " + employee[i].name + " "; console.log(employee[i].name); console.log(employee[i].photo_url); directory.append(employeePost); } } var b = reverseArr(employee); //SHOW THE "X" (CLOSE) BUTTON $('.employee').hover( function() { $(this).children("#closeButton").removeClass("close") $(this).children("#closeButton").addClass("showClose") //IF THE "X" (CLOSE) BUTTON IS CLICKED, DELETE PARENT DIV $(this).children("#closeButton").click(function(event) { event.preventDefault(); $(this).parent(".employee").remove(); }) }, function() { $(this).children("#closeButton").removeClass("showClose") $(this).children("#closeButton").addClass("close") } ); //IF FORM BUTTON IS CLICKED, SUBMIT NEW DATA TO JSON OBJECT $(":button").click(function(event) { event.preventDefault(); }); }); This is how my HTML is formatted and need to have whatever name you type in the first input box to …
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38655758
has comment: http://stackoverflow.com/comment/38658683
type: Question
has comment: http://stackoverflow.com/comment/38656123
has comment: http://stackoverflow.com/comment/38656611
has answer: http://stackoverflow.com/a/24887816
tagged with: arrays
has comment: http://stackoverflow.com/comment/38655590
tagged with: javascript
tagged with: jquery
score: 0
linked to: http://stackoverflow.com/q/1184624
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: How to add to my JSON Object using a form
type: UnansweredQuestion

http://stackoverflow.com/q/24804302
tagged with: twitter-bootstrap
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24807435
type: Question
score: 0
has title: How to trigger ONLY one element with twitter collapse
has comment: http://stackoverflow.com/comment/38502372
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I am using twitter Bootstrap for expand-collapse effect and everythings is working but I have a problem when I click on some lement then all my divs with carousel class are expanding, does anyone knows how to solve this here is code example: &lt;div class="description collapse-group"&gt; &lt;!-- This div with class mehr-pfeil I am using as trigger for collapse. If user clicks on it, the content of collapse element should show.--&gt; &lt;div class="mehr-pfeil" onclick=".collapse('toggle');"&gt; &lt;!-- But if user clicks on heading &lt;a&gt; then it shall go directly to article --&gt; &lt;a href="/?id=2500,1111142"&gt; &lt;span&gt;04.07.2014&lt;/span&gt; &lt;span class="orange"&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;Some content &lt;span&gt; &lt;/a&gt; &lt;p class="collapse"&gt;Some content&lt;/p&gt; &lt;/div&gt; &lt;p class="collapse"&gt;Nicht das Erfinden neuer Themen, sondern das Umsetzen bestehender bzw. der in den Klausuren definierten.&lt;/p&gt; &lt;/div&gt; ps. this is just one example of my content which should be triggered with collapse. Just imagine that you have more than one. UPDATE: Also problem appears always when I click on collapse element. For instance, if one element was closed then another opens and vice versa. So I wanted to know how to triger tis action only for one lement with js: This on click event I am currently using: onclick="$(\'#main-content\').find(\'.collapse\').collapse(\'toggle\');"&gt;'."\n";
tagged with: events
has answer: http://stackoverflow.com/a/24807435

http://stackoverflow.com/q/24785859
tagged with: node.js
has comment: http://stackoverflow.com/comment/38466471
has comment: http://stackoverflow.com/comment/38466633
has comment: http://stackoverflow.com/comment/38466399
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38466778
has comment: http://stackoverflow.com/comment/38466962
score: -1
has answer: http://stackoverflow.com/a/24785951
linked to: http://stackoverflow.com/q/4062260
has body: I want to redirect to x url(http://www.google.com for example) when the user hits a button. I already tried using open: var open = require('open'); open('http://www.google.com'); But that opens a new window with the requested url, so the question would be: How can I redirect to a url into the same browser window?
type: Question
answer count: 1
tagged with: url
tagged with: javascript
linked to: http://stackoverflow.com/q/17705024
favorite count: 0
has comment: http://stackoverflow.com/comment/38466329
accepted answer: http://stackoverflow.com/a/24785951
has comment: http://stackoverflow.com/comment/38466498
has comment: http://stackoverflow.com/comment/38466406
has title: node.js - Redirect to url in same window
downvote count: 2
upvote count: 1

http://stackoverflow.com/q/24855559
score: 1
has body: I have an autocomplete div which appears when the user keyup's in a search field. I want the div to disappear when they click outside of the div, so I have tried the following: //SHOW THE DIV WHEN INPUT CLICKED $('#searchbar').focus(function(){ $('#div').show(); }); //HIDE THE DIV WHEN FOCUS LOST $('#searchbar').on("blur", function(){ $('#div').hide(); }); Unfortunately, the div which houses the autocomplete choices contain tags that I want the user to click. As soon as the user clicks a link, the div disappears (because focus from the input field is lost). So is there any way to 'group' the div with the input field so they can both be 'focussed' when the input is active, or div is clicked? Regards, and thank you in advance! EDIT: Here is my HTML gelDB No results. Try searching something else. Here is a graphical example of what I'm doing:
has title: Grouping elements for focus/onblur events?
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24855729
has comment: http://stackoverflow.com/comment/38598139
answer count: 2
has comment: http://stackoverflow.com/comment/38598523
upvote count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/24858323
accepted answer: http://stackoverflow.com/a/24858323
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24855729
has comment: http://stackoverflow.com/comment/38598143
tagged with: css
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/43973756
comment on: http://stackoverflow.com/a/24872758
score: 0
type: AnswerComment
has text: Hello Andrew thanks for your anwser. I asked the question on this post http://stackoverflow.com/questions/27781956/ionic-how-to-keep-fixed-background-while-browsing-the-views
type: Comment

http://stackoverflow.com/comment/38451003
type: AnswerComment
has text: You can't use chrome.tabs in a content script, you have to run it in the background, then communicate the result with the content script. What I do is to send a "whoami" message to background when content script start, the response contain all usefull information I need, and I store it in a global variable like "data"
type: Comment
score: 0
comment on: http://stackoverflow.com/a/24767465

http://stackoverflow.com/comment/38548696
type: Comment
score: 1
has text: load the page with the console open
comment on: http://stackoverflow.com/a/24829062
type: AnswerComment

http://stackoverflow.com/a/24913052
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24907465
has body: Here you have specified datatype as "Json",So the response must be the complete JSON object,other wise the same issue will be occur. In your code,the response does not meets JSON format. Example JSON {"employees":[ {"firstName":"John", "lastName":"Doe"}, {"firstName":"Anna", "lastName":"Smith"}, {"firstName":"Peter", "lastName":"Jones"} ]} Simply copy the above code and paste in Page1.html and try now. [Note:Page1.html page contains only the above code]

http://stackoverflow.com/comment/38489285
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24797767
type: AnswerComment
has text: @JosueEspinosa The `$scope.$watch` is called every time you type a character, and it will update the bindings. So there's an update every time you type a character, but the update is done with whatever message you have received from the server at that point, which with minimal latency will be 1 character short.

http://stackoverflow.com/a/24756568
upvote count: 1
has comment: http://stackoverflow.com/comment/38410709
has comment: http://stackoverflow.com/comment/38411012
type: Answer
answers question: http://stackoverflow.com/q/24756302
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38410896
has body: You can do it this way if you like: var mobile = (/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())); var ev = mobile ? 'touchstart' : 'click'; $('.touch-me').on(ev, function () { console.log('touch me'); });

http://stackoverflow.com/comment/38515898
type: Comment
has text: @KnowledgeSeeker: is it not centered ?
comment on: http://stackoverflow.com/a/24812197
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38576545
has text: http://jsfiddle.net/f7zJ7/ See how it pushes the texts aparts and not hover about the mouse point
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24844577
type: Comment

http://stackoverflow.com/a/24788135
has comment: http://stackoverflow.com/comment/38474084
has comment: http://stackoverflow.com/comment/38477287
has comment: http://stackoverflow.com/comment/38474630
answers question: http://stackoverflow.com/q/24788056
score: 0
has body: Sure, although title isn't a valid property of area. Did you try it? &lt;area onmouseover="ShowPicC(this.title)" title="someotherimage.jpg" ... You may be better off using a data attribute: &lt;area data-image="someotherimage.jpg" ... https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes
type: Answer
has comment: http://stackoverflow.com/comment/38476544
has comment: http://stackoverflow.com/comment/38475851

http://stackoverflow.com/comment/38478292
type: Comment
has text: Do the next and prev week links need to be inside the same form? On my calendar's layout they are not in the same position.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24789725

http://stackoverflow.com/comment/38592018
type: QuestionComment
has text: @MyTitle please check sharedProperties service i suggested.
type: Comment
comment on: http://stackoverflow.com/q/24852454
score: 0

http://stackoverflow.com/a/24865965
has body: SOLUTION using fake drag 'n drop. The problem here is that it only works inside the body element. var fakeDrag = { setup: function(){ fakeDrag.el = document.createElement('span'); fakeDrag.el.style['pointer-events'] = 'none'; fakeDrag.el.style['position'] = 'absolute'; fakeDrag.el.style['display'] = 'none'; fakeDrag.el.textContent = 'dragging'; document.body.appendChild(fakeDrag.el); }, dragging: false, drag: function(event){ if(event.target.classList.contains('drag')){ fakeDrag.dragging = true; fakeDrag.source = event.target; fakeDrag.el.style['display'] = 'inline'; } }, dragmove: function(event){ fakeDrag.el.style['top'] = ++event.clientY+'px'; fakeDrag.el.style['left'] = ++event.clientX+'px'; }, drop: function(event){ if(event.target.classList.contains('drop') &amp;&amp; fakeDrag.dragging){ event.target.textContent = fakeDrag.source.textContent; } fakeDrag.dragging = false; fakeDrag.el.style['display'] = 'none'; } }; fakeDrag.setup();
has comment: http://stackoverflow.com/comment/38745196
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24858164
has comment: http://stackoverflow.com/comment/38750191
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/38662172
has comment: http://stackoverflow.com/comment/38660936

http://stackoverflow.com/a/24866357
type: Answer
score: 24
upvote count: 24
accepted answer of: http://stackoverflow.com/q/24866293
has comment: http://stackoverflow.com/comment/38630902
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24866293
has body: It's not possible to hide the URL From the end user in JavaScript. They can simply open up the Network panel in Chrome, or just turn on Fiddler to see it. In your particular case, the only real way you can hide the URL from the user is to proxy the REST call to your API from your server-side code. If you must use JavaScript, you can always create and use APIKeys and simply monitor their usage and terminate API Keys that are taking up too much bandwidth; but again -- this isn't going to stop someone from being able to use your API, it'll just let you know when you receive an unexpected amount of traffic from unexpected places. You could take it further by cycling API keys every day, so if someone wants to use your API; they have to change their code every day -- but again, this won't stop someone, just slow them down. The only fullproof way is the way I mentioned in my first paragraph -- but that can't be done from client-side JavaScript alone. Update in the age of Single Page Applications What I wrote holds true, even for Single Page Applications (SPA); though you can hide the URL in the address bar by having different routing for your client-side application than your server-rendered pages. The user can still inspect the traffic in their browser's console to check where the requests are going (there's no getting around that), but you can at least display different paths in the address bar.

http://stackoverflow.com/comment/38437671
score: 0
type: AnswerComment
has text: I think your `map()` is extraneous; the extraction of `count` can just as easily be done inside the filter predicate.
type: Comment
comment on: http://stackoverflow.com/a/24770812

http://stackoverflow.com/a/24780817
answers question: http://stackoverflow.com/q/24780048
type: Answer
has comment: http://stackoverflow.com/comment/38456316
has body: You can use $('id_of_div').html("&lt;%= escape_javascript(render("partial",list: @list)) %&gt;"); or $('id_of_div').html("&lt;%= escape_javascript(render("path_to_partial",list: @list)) %&gt;");
score: 0

http://stackoverflow.com/a/24778769
answers question: http://stackoverflow.com/q/24778481
type: Answer
has body: var yourArray = JSON.parse(data); console.log(yourArray); $.each(yourArray, function (index, yourArray) { $('#builder_group').append($('&lt;option/&gt;', { value: yourArray.id, text : yourArray.name, })); }); This solved my problem
score: 0

http://stackoverflow.com/comment/38411857
type: QuestionComment
comment on: http://stackoverflow.com/q/24757285
score: 0
has text: It'll be done server side, so there won't be anything in the source telling you what to do
type: Comment

http://stackoverflow.com/a/24805955
answers question: http://stackoverflow.com/q/24805771
score: 0
has body: Your problem is you're binding all the checkboxes to compare.checkbox if you add $scope.compare.checkbox = []; to the controller and instead use ng-model="compare.checkbox[info.tid] assuming info.tid is a number and is unique you should be able to access the checkbox from the controller by using $scope.compare.checkbox[thetidhere];
has comment: http://stackoverflow.com/comment/38505825
has comment: http://stackoverflow.com/comment/38504089
type: Answer
has comment: http://stackoverflow.com/comment/38518438
has comment: http://stackoverflow.com/comment/38505578

http://stackoverflow.com/comment/38474934
has text: I have also been told to add it to the public_html folder, should I just upload it to the themes folder even though it isn't a wordpress theme?
score: 0
comment on: http://stackoverflow.com/a/24771995
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38595367
comment on: http://stackoverflow.com/a/24854007
has text: But I would like to know if it is necessary to add this code only in .htaccess placed in subdomain folder, in main folder, or both?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/24895720
answer count: 1
tagged with: sharepoint-2010
has title: Simple SharePoint CEWP code for Countdown timer
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 0
has body: I am building a virtual site for a project that is set to go live on 05/28/2014 and wanted to add a very simple Days Until countdown in a Content Editor Web Part. Unfortunately, I cant create any custom WebParts or use JQuery. I am stuck using basic JavaScript or HTML that does not access any external sites (they have very strict security). I am hoping someone might be able to help me create this as I am unable to find anything that fits via Google. An example of what I am hoping the end result will look like is below: Days Until Launch: 249 Days 16 Hours 45 Minutes I appreciate anyones help on this and want to say Thank You in advance
type: Question
has answer: http://stackoverflow.com/a/24920615
tagged with: javascript
linked to: http://stackoverflow.com/q/532553
linked to: http://stackoverflow.com/q/16129157

http://stackoverflow.com/a/24873811
has body: return false; seems to do the trick: http://jsfiddle.net/John_C/kUR3r/1/ $('li', 'ul').click(function (event) { event.preventDefault(); var url = $("a", this).attr("href"); // loader.load(url); $('.target').text(url); return false; });
has comment: http://stackoverflow.com/comment/38633104
score: 1
has comment: http://stackoverflow.com/comment/38633053
upvote count: 1
has comment: http://stackoverflow.com/comment/38633080
type: Answer
answers question: http://stackoverflow.com/q/24873538
downvote count: 0
has comment: http://stackoverflow.com/comment/38633429

http://stackoverflow.com/comment/38493106
score: 0
type: Comment
has text: What is a 'controller prefix' ?
type: AnswerComment
comment on: http://stackoverflow.com/a/24800137

http://stackoverflow.com/a/24900961
score: 1
has body: If you are trying to retrieve a property of an object you can use the . notation, or the [] notation var test1 = { test: 3, b: 3 }; Using . notation test1.test; // -&gt; returns 3 Using [] notation var propertyName = 'test' test1[propertyName]; // -&gt; returns 3
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24900906
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/24900906

http://stackoverflow.com/comment/38685960
comment on: http://stackoverflow.com/q/24901916
score: 0
type: QuestionComment
has text: Didn't you basically ask this same question yesterday?
type: Comment

http://stackoverflow.com/comment/38491777
comment on: http://stackoverflow.com/q/24799274
score: 0
type: Comment
type: QuestionComment
has text: if it is part of angular then angular needs to be above that

http://stackoverflow.com/a/24884712
type: Answer
answers question: http://stackoverflow.com/q/24884486
has body: You just made a little typo. Please add the brackets on line 1 of your function var course = $('.departments').text();
has comment: http://stackoverflow.com/comment/38653105
score: 0

sqlite
tags question: http://stackoverflow.com/q/24891205
type: Tag
tags question: http://stackoverflow.com/q/24897764
tags question: http://stackoverflow.com/q/24846280
tags question: http://stackoverflow.com/q/24892924
tags question: http://stackoverflow.com/q/24767505
tags question: http://stackoverflow.com/q/24842928
tags question: http://stackoverflow.com/q/24817284
tags question: http://stackoverflow.com/q/24807992
tag name: sqlite

http://stackoverflow.com/q/24875804
has comment: http://stackoverflow.com/comment/38637314
tagged with: php
has comment: http://stackoverflow.com/comment/38637254
has body: I have a page that has a drop down list to select an action. this select has a name action_id. The use can have many actions. So, I added a link, when the user clicks it, I generate a new select using javascript and jquery and then add this new select to the DOM. this new select also has a name action_id. Finally I would have many select(s) with the name action_id I created this jsfiddle for you to show you what I mean http://jsfiddle.net/FMQtL/ My question is how to validate each action_id select in my controller when I submit the form? Many thanks Update 1 Usually, I just do this in the controller: Input::get('action_id'); but this time I have many action_id(s)
tagged with: laravel
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38637369
has comment: http://stackoverflow.com/comment/38636713
score: 0
has comment: http://stackoverflow.com/comment/38636583
has answer: http://stackoverflow.com/a/24878009
type: Question
linked to: http://stackoverflow.com/q/4688880
tagged with: javascript
has comment: http://stackoverflow.com/comment/38636696
has comment: http://stackoverflow.com/comment/38636686
tagged with: laravel-4
accepted answer: http://stackoverflow.com/a/24878009
answer count: 1
has comment: http://stackoverflow.com/comment/38637280
has comment: http://stackoverflow.com/comment/38637397
has comment: http://stackoverflow.com/comment/38640405
has title: laravel how to validatate dynamically added elements
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/24877349
answer count: 1
favorite count: 0
has title: Of these functions that find unique items in a list, why one of them not return a 9?
has answer: http://stackoverflow.com/a/24877425
type: UnansweredQuestion
upvote count: 1
has body: I've implemented three different functions to find unique items in a list in order to compare result speed. The speed tests are all successful, but oddly, Method 3 does not include the number 9 in it's list of original list items. Why not? It's safe to say that since the list is made up of 10,000 random number strings between 1 & 11, all of the numbers will always exist, so this result is consistent for tests. Generating List: var ls = []; for (var i = 0; i <= 10000; i++) { ls.push((Math.round((Math.random() * 10) + 1)).toString()); } First Method: var uniques = function uniques(list) { for (var uniqls = [], it = -1, length = list.length, fi = uniques.findindex; ++it < length; (fi(list, list[it]) - it) || uniqls.push(list[it])); return uniqls; }; Object.defineProperty(uniques, 'findindex', { 'configurable': true, 'enumerable': true, 'writable': true, 'value': function (ls, node) { for (var it = -1, length = ls.length; (++it < length) && (node !== ls[it]);); return (length - it) ? it : -1; } }); Third Method: function sortUnique(ls) { var sorted_arr = ls.sort(); var results = []; for (var i = 0; i < ls.length - 1; i++) { if (sorted_arr[i + 1] !== sorted_arr[i]) { results.push(sorted_arr[i]); } } return results; } Test & Time: console.time("M1 loop"); console.log("M1 Unique" + uniques(ls)); console.timeEnd("M1 loop"); console.time("M3 loop"); console.log("M3 Unique" + (sortUnique(ls))); console.timeEnd("M3 loop"); Result: M1 Unique 6,3,2,10,8,7,5,9,4,11,1 M1 loop: 4.000ms M3 Unique 1,10,11,2,3,4,5,6,7,8 M3 loop: 9.000ms
downvote count: 1
type: Question
tagged with: javascript
score: 0

http://stackoverflow.com/comment/38482005
type: QuestionComment
comment on: http://stackoverflow.com/q/24793990
score: 0
has text: so put that in the question then.
type: Comment

http://stackoverflow.com/comment/38475183
type: AnswerComment
score: 0
has text: in some rare cases it will cause problems! believe me I've faced with it!
comment on: http://stackoverflow.com/a/24790313
type: Comment

http://stackoverflow.com/q/24889285
tagged with: touch
tagged with: ipad
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has title: Links being activated when scrolling on touch screen
tagged with: scroll
score: 2
answer count: 0
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I'm building a scrollable navigation panel for a project, and I'm having some issues optimising it for touch screens. I'm using this piece of script in order to use a touch event where necessary: var getUserInputMethod = function() { //same issues using touchend too clickEvent = (Modernizr.touch) ? 'touchstart':'click'; return clickEvent; } $('#navigation li').on(clickEvent, function() { $('#mainContent').load($(this).data('link')); }); However, I can't seem to scroll without selecting a link. Is there a way I can determine between a click/tap and a scroll?

http://stackoverflow.com/q/24778809
answer count: 1
has answer: http://stackoverflow.com/a/24780051
tagged with: javascript
type: AnsweredQuestion
has title: Updating data from the table
tagged with: jquery
tagged with: ajax
type: Question
accepted answer: http://stackoverflow.com/a/24780051
tagged with: http://stackoverflow.com/tag/html
has body: I have this table that receive from the server: (with ajax): $.each(data, function(i, item) { $('#MyTable tbody').append(" "d +" " +data[i].A+ " " +data[i].B +" " + " "); }); C and D are edit text, that the user can change them. after the changing by the user, the data will sent to the server. I have a problem in changing only D column. when changing only D column, in "newData" (from this line of code: "var newData = getUserData();"), I get "...{..."C":"x"}..." and I expected to get "...{..."D":"x"}...". why? ("x" is an exp of data in D column). (the other options working well). function getUserData() { var newData = new Array(); $.each($('#MyTable tbody tr'),function(key,val){ var inputF = $(this).find("input[type=text].changed"); var fileldValues = {}; fileldValues['c'] = $(inputF[0]).val(); fileldValues['d'] = $(inputF[1]).val(); fileldValues['a'] = $($(this).children()[0]).text(); fileldValues['b'] = $($(this).children()[1]).text(); newData.push(fileldValues); }); return JSON.stringify(newData); } function saveNewData(){ var newData = getUserData(); $.ajax({ type: "GET", url: "save", dataType: "json", data: { newData: newData}, contentType : "application/json; charset=utf-8", success : function(data) { }, error : function(jqXHR, textStatus, errorThrown) { location.reload(true); } }); } also I am using this event: $('#MyTable input[type=text]').on('change',function() { $(this).addClass('changed'); })
has comment: http://stackoverflow.com/comment/38454634
score: 0
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/38603446
type: QuestionComment
has text: @jQueryAngryBird but what i am doing wrong here?
comment on: http://stackoverflow.com/q/24858341
score: 1
type: Comment

http://stackoverflow.com/comment/38444086
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24774288
has text: In future questions, please always include your code in the question. If jsfiddle was unavailable your original question would not have been answerable.
score: 0

http://stackoverflow.com/a/24815155
accepted answer of: http://stackoverflow.com/q/24815103
type: Answer
has comment: http://stackoverflow.com/comment/38521746
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38521794
answers question: http://stackoverflow.com/q/24815103
has body: Update your HTML with the code below. Remember by adding "/show" at the end of the JSFiddle URL will lead you the whole page everything in it. Simple NewsTicker - jsFiddle demo Etisalat and Huawei Conduct First 400G Trial Optical Transport Network in Middle East and North Africa Huawei to Deploy Africa's First Smart eLTE Urban Railway Communications System in Ethiopia
score: 0

http://stackoverflow.com/comment/38484703
comment on: http://stackoverflow.com/q/24795193
has text: Have a look at the demoes of History.js on http://balupton.github.io/history.js/demo/ It will show how you can change the browser address dynamically and respond to address changes. On older browsers it changes the address `#` bookmark instead, but `History.js` hides that implementation detail and works on all browsers.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24789801
has body: I am using highcharts.js to plot a simple column graph using my json data, I have done this before but now I'm plotting with a slightly different dataset (filtered and different format) For "processed_json", idea used : http://codeinjs.blogspot.com/2013/07/preprocess-json-data-to-use-in.html Currently, my processed_json is : function plotgraph1(filter1) { var processed_json = new Array(); $j.map(filter1, function(obj, i) { processed_json.push(obj[0], obj[1]); console.log(processed_json) }); ................... } Console prints : ["2014-06-14T18:30:00Z", 4044, "2014-06-15T18:30:00Z", 5030, "2014-06-16T18:30:00Z", 4913, "2014-06-17T18:30:00Z", 4985, "2014-06-18T18:30:00Z", 4778, "2014-06-19T18:30:00Z", 4733, "2014-06-20T18:30:00Z", 3960, "2014-06-21T18:30:00Z", 4221, .......] Opening up gives : 0: "2014-06-14T18:30:00Z" 1: 4044 2: "2014-06-15T18:30:00Z" 3: 5030 4: "2014-06-16T18:30:00Z" 5: 4913 .......... and so on It is storing the date1, metric1 and so on, but I want it to store it in different arrays. Basically, it should be an array of arrays, for each day, a separate array. So that highcharts.js can read it properly. Now it's reading the data but, since all dates are in one array it's skipping a date and showing 28 dates instead of 14 days (which is the selected range); (double basically) Earlier and correct "processed_json" is : [Array[2], Array[2], Array[2], Array[2], Array[2], Array[2], Array[2], Array[2], Array[2], Array[2], Array[2], Array[2], Array[2], Array[2]] 0: Array[2] 0: "2014-04-30T18:30:00Z" 1: 200303 I was trying something like this : var processed_json1 = []; for ( var i = 0; i &lt; processed_json.length; i++) { processed_json1.push(processed_json[i]); } But, clearly this is wrong and I am wasting too much time. Any good direction/suggestion will be highly appreciated to convert my data format to the correct one for highcharts to read it properly.
has answer: http://stackoverflow.com/a/24789933
possible better answer: http://stackoverflow.com/a/24789928
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/24790133
accepted answer: http://stackoverflow.com/a/24789933
type: AnsweredQuestion
tagged with: highcharts
tagged with: arrays
has title: Javascript array of arrays query
tagged with: javascript
has answer: http://stackoverflow.com/a/24789928
type: Question

http://stackoverflow.com/comment/38511725
type: Comment
comment on: http://stackoverflow.com/a/24809983
type: AnswerComment
has text: But how would I reactivate the timeOut in a different place.
score: 0

http://stackoverflow.com/q/24896824
has title: AngularJS is not using the updated values of the $scope variables in my controller
tagged with: scope
score: 0
has answer: http://stackoverflow.com/a/24896895
has body: I've pasted the relevant snippet of my code below. I know the base angularJS is working because the HTML document doesn't display the {{}} variables, but instead, I get a blank. I believe it's because it's getting a null value for the variables. When I do a few console.log expression WITHIN the controller, I can see that the value is updated accordingly, but it is different outside the controller. Code: Range Selection Observer All {{observer}} Host All {{host}} Bug All {{bug}} <!--div ng-repeat="bugItem in bugsJSONList | filter: obSelection | filter: hostSelection | filter: bugSelection" > {{bugItem.bug}} on {{bugItem.host}} , observer {{bugItem.observer}} </div--> {{observer}} Host {{host}} {{bug}} from {{item.start}} to {{item.end}}
answer count: 1
tagged with: variables
tagged with: angularjs
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24896895
type: Question
tagged with: javascript

http://stackoverflow.com/q/24906329
type: Question
has answer: http://stackoverflow.com/a/24906445
has answer: http://stackoverflow.com/a/24906582
upvote count: 0
has answer: http://stackoverflow.com/a/24906667
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24906627
possible better answer: http://stackoverflow.com/a/24906445
has comment: http://stackoverflow.com/comment/38693929
has answer: http://stackoverflow.com/a/24906636
answer count: 7
has title: jquery button active desactive state
accepted answer: http://stackoverflow.com/a/24906582
favorite count: 0
has comment: http://stackoverflow.com/comment/38694392
downvote count: 1
has comment: http://stackoverflow.com/comment/38693698
has answer: http://stackoverflow.com/a/24906463
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38693709
has answer: http://stackoverflow.com/a/24906580
score: -1
has body: I have an issue with the following jQuery code: I have 3 buttons, here is the code : ok choisir Ajouter and i want that when i click on ajouter item the button choisir become active and when i click on choisir the button ok become active here is my js code for now : var boutton = function(bouton) { $('#add').click(function() { $('#choisir').removeAttr('disabled'); }); } thanks it's not reloading anymore but it won't activated the choisir button do you guy have any idea why ?is it understandable tell me if not thanks.

http://stackoverflow.com/q/24851889
tagged with: javascript
has body: Following this angular rails tutorial, getting the error of Asset Filtered error application.html.erb file is Blog <%= stylesheet_link_tag "application", media: "all" %> <%= javascript_include_tag "application", controller_name %> <%= csrf_meta_tags %> <%= yield %> main.js.coffee [created a subdirectory in app/asset/javascript/controllers/main] #= require_self #= require_tree ./controllers/main application.js //= require jquery //= require jquery_ujs //= require underscore //= require angular Its not loading the angular controller created in app/asset/javascript/controllers/main/mainIndexCtrl.js.coffee @IndexCtrl = (@scope) -> $scope.title = "My blog" Showing the error as follows Asset filtered out and will not be served: add Rails.application.config.assets.precompile += %w( main.js ) to config/initializers/assets.rb and restart your server But after changing like this its not showing $scope.title data.
downvote count: 0
answer count: 1
favorite count: 0
tagged with: angularjs
upvote count: 2
has answer: http://stackoverflow.com/a/29486162
type: UnansweredQuestion
tagged with: ruby-on-rails
has title: AssetFilteredError while working on rails with angular
score: 2
tagged with: coffeescript
type: Question

http://stackoverflow.com/comment/38518900
has text: ` `
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24813607

http://stackoverflow.com/q/24872818
has title: used instant variable inside the object define function
score: -1
favorite count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24873022
downvote count: 1
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
has body: i need to used instant variable inside the object define function like that . i need to use Result variable outside the function function Request(params,type,url){ var loginReq = Titanium.Network.createHTTPClient(); loginReq.open(type,url); loginReq.setRequestHeader("Content-Type", "application/json; charset=utf-8"); loginReq.setRequestHeader("enctype", "multipart/form-data"); loginReq.setRequestHeader("Content-Type", "image/png;charset=utf-8"); loginReq.send(params); loginReq.onload = function() { var json = this.responseText; var Result = JSON.parse(json); }; return Result; }; exports.Request = Request; i need to return Result Or use it outside the scope.
accepted answer: http://stackoverflow.com/a/24873022

http://stackoverflow.com/comment/38518068
type: QuestionComment
comment on: http://stackoverflow.com/q/24813234
score: 0
type: Comment
has text: Why don't you use jQuery's `$.getJSON()` to load `ensaio.json` — then you wouldn't have to reload the page every 1s

http://stackoverflow.com/q/24846511
tagged with: javascript
tagged with: iteration
has comment: http://stackoverflow.com/comment/38580206
favorite count: 0
has body: My question may silly, so apologize in advance. My instructions were to build a function that iterated over a queue of functions. The answer is at the bottom....below the puzzlers array. Can someone explain why the command in the for-loop is input = queue.shift()(input);. I understand that I had to use the shift method to empty the queue. This exercise was confusing to me to begin with, but creating input = queue.shift()(input); is still strange to me. any fundamental explanations would be greatly appreciated. If you need more info, please let me know.....thank you in advance. var puzzlers = [ function ( a ) { return 8*a - 10; }, function ( a ) { return (a-3) * (a-3) * (a-3); }, function ( a ) { return a * a + 4; }, function ( a ) { return a % 5; } ]; var applyAndEmpty = function( input, queue ) { var length = queue.length; for(var i = 0; i&lt;length; i++){ input = queue.shift()(input); } return input; }; alert(applyAndEmpty(2, puzzlers));
type: UnansweredQuestion
has title: I don't understand my for loop?
downvote count: 1
upvote count: 3
has comment: http://stackoverflow.com/comment/38581844
type: Question
score: 2
answer count: 1
tagged with: arrays
has answer: http://stackoverflow.com/a/24846532

http://stackoverflow.com/q/24870609
has answer: http://stackoverflow.com/a/24870686
tagged with: angularjs
has title: Setting value in select drop down not working
possible better answer: http://stackoverflow.com/a/24870732
has answer: http://stackoverflow.com/a/24870732
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24870686
type: Question
answer count: 2
tagged with: javascript
has body: I am new to Angular and we are rewriting our app in it. I can't seem to figure out something very basic. I am trying to replace the option value to the Id after the data gets fetched. I created a jsbin to just do it for static data, but I can't seem to get the Id set to the value in the option. JavaScript: angular.module("testApp", []); angular.module("testApp").controller("testController", function ($scope) { $scope.name="hi"; $scope.projects = [{Id:"12345", Name:"crystal"}, {Id:"9987", Name:"emerald"}]; }); http://jsbin.com/dazolelu/1/edit
score: 0

http://stackoverflow.com/comment/52232364
type: QuestionComment
has text: If it's a SailsJS app, then it'll support JST (see my answer below)
comment on: http://stackoverflow.com/q/24773571
score: 0
type: Comment

http://stackoverflow.com/comment/38499736
has text: http://jsfiddle.net/7M8HA/
comment on: http://stackoverflow.com/q/24803816
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/a/24849681
has comment: http://stackoverflow.com/comment/38588519
score: 0
has comment: http://stackoverflow.com/comment/38646300
has comment: http://stackoverflow.com/comment/38624988
type: Answer
has comment: http://stackoverflow.com/comment/38607682
has body: Use this &lt;%- include icon.ejs %&gt; You need a "-" after the ejs open tag and better add a extension to your filename
answers question: http://stackoverflow.com/q/24830383

http://stackoverflow.com/comment/38442027
score: 0
has text: I gave it this way. When i click on the link iam navigated to the page where list of all the controls pages are given inside that folder. but still the function is not getting called.
type: Comment
comment on: http://stackoverflow.com/a/24772896
type: AnswerComment

http://stackoverflow.com/a/24811572
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/24811219
has comment: http://stackoverflow.com/comment/38515300
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38515155
has body: img is not a "form element", it has not form property, not even if it was placed within a form. If the img is a direct child of the form, you can do something like this: &lt;img src=".." onclick="this.parentElement.elements['textbox1'].value = ''; this.parentElement.elements['textbox2'].value = '';" /&gt; A live demo at jsFiddle. If it's not, use document.getElementById instead to refer textareas. However, I'd suggest you to use proper eventhandling, for example addEventListener. Also elem.innerHTML += text; in insertText() may block the textareas from further programmatically edits. Use value instead of innerHTML.

currency
tag name: currency
type: Tag
tags question: http://stackoverflow.com/q/24848642

http://stackoverflow.com/q/24813018
score: 0
has title: Twitter Typeahead.js with ScrollTo not working
tagged with: twitter
accepted answer: http://stackoverflow.com/a/24942422
tagged with: javascript
tagged with: jquery
type: Question
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24942422
answer count: 1
tagged with: datatable
has body: I have a datatable (datatables.net) with dynamically generated rows. I have a "search" box above the datatable. Right now, you can start typing in the box and i have a typeahead give options for choices of which row they want (you start typing a name and the typeahead gives you the bus stop name options, each row is based off of a bus stop in a bus schedule). Then you can select the right name you see. As of now, selecting the bus stop in the search box does nothing. You can select by either pressing enter or clicking on the typeahead result. What I want it to do is use scrollTo (http://flesler.blogspot.com/2007/10/jqueryscrollto.html Version 1.4.1) to scroll to the row with that name in the datatable. here is my code: HTML Search: JAVASCRIPT function addTableSearch(dTable, $container, schedule, stops){ //while the bus schedule and bus schedule stops exist if(schedule !==undefined && schedule.stops !== undefined){ //getting the future stops var notPassed = Fp.filter(schedule.stops, function (stop) { return !stop.passed; }); var selector = $container .typeahead({ source : Fp.pluck(notPassed, 'busStopName'), items : 15 }); $('#bus-tab .dataTables_scrollBody').scrollTo(selector); } addTableSearch(dTable, $('.tblSearch'), schedule.content.get(), schedule.stops); i don't think I can assign "var selector" to be the typeahead, but I can't think of another way to trigger the scrollTo after selecting what you want from the typeahead. Suggestions / help, please?

http://stackoverflow.com/comment/38824367
has text: You are right! I had one other mistake: var thisUrl = encodeURL = "http://www.google.com/"; It should have been: var thisUrl = encodeURI("http://www.google.com/"); It's amazing how something as simple as not capitalizing 1 single letter sets me back countless hours. Thanks so much for your assistance.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/24957785
type: Comment

http://stackoverflow.com/q/24803185
tagged with: canvas
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38500026
score: 4
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24805127
favorite count: 0
has body: I create group with: var text = new fabric.Text(textValue,{left: 20, top: 30, fontSize:25}); var rect = new fabric.Rect({ width : text.get('width') + 40, fill : "#FFFFFF", height : 100, stroke : '#000000', strokeWidth : 1 }); var myGroupObj = new fabric.CustomGroup([ rect,text ], { left : 0, top : 0, }); Now whene I manually resizes my group and I want to get a new heigth. myGroupObj.get('height') I have always last one (100). Somme idea to get new height, please?
has answer: http://stackoverflow.com/a/24805088
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24805088
has title: fabric.js - get New Height after redimensioning
has comment: http://stackoverflow.com/comment/38498635
accepted answer: http://stackoverflow.com/a/24805127
tagged with: fabricjs
type: Question
upvote count: 4
has answer: http://stackoverflow.com/a/51222328
has comment: http://stackoverflow.com/comment/38498340

http://stackoverflow.com/q/24883604
has comment: http://stackoverflow.com/comment/38651028
downvote count: 0
has title: Jquery Remove special symbol
tagged with: javascript
score: 1
tagged with: jquery
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24883635
has comment: http://stackoverflow.com/comment/38650891
has comment: http://stackoverflow.com/comment/38651015
has body: How can I remove £ from a string. I was trying this: price = data.salesPrice; price = price.replace(/\^£/,""); console.log(price); but still I was receiving like this: £22.80. I tried with parseInt but it's return NaN. Any idea please ?
favorite count: 0
has answer: http://stackoverflow.com/a/24883676
has answer: http://stackoverflow.com/a/24883635
type: Question
has comment: http://stackoverflow.com/comment/38651197
upvote count: 1
has comment: http://stackoverflow.com/comment/38650898
has answer: http://stackoverflow.com/a/24883657
has answer: http://stackoverflow.com/a/24883680
accepted answer: http://stackoverflow.com/a/24883676
has comment: http://stackoverflow.com/comment/38650939
answer count: 4

underscore.js
tags question: http://stackoverflow.com/q/24827728
type: Tag
tags question: http://stackoverflow.com/q/24861403
tags question: http://stackoverflow.com/q/24756779
tags question: http://stackoverflow.com/q/24787002
tag name: underscore.js
tags question: http://stackoverflow.com/q/24871791
tags question: http://stackoverflow.com/q/24825948
tags question: http://stackoverflow.com/q/24787920
tags question: http://stackoverflow.com/q/24863390
tags question: http://stackoverflow.com/q/24777530
tags question: http://stackoverflow.com/q/24861647
tags question: http://stackoverflow.com/q/24867414
tags question: http://stackoverflow.com/q/24770792
tags question: http://stackoverflow.com/q/24823000
tags question: http://stackoverflow.com/q/24788451
tags question: http://stackoverflow.com/q/24853362
tags question: http://stackoverflow.com/q/24824519
tags question: http://stackoverflow.com/q/24907178
tags question: http://stackoverflow.com/q/24785238
tags question: http://stackoverflow.com/q/24902019
tags question: http://stackoverflow.com/q/24806821
tags question: http://stackoverflow.com/q/24753456
tags question: http://stackoverflow.com/q/24760617
tags question: http://stackoverflow.com/q/24835704

http://stackoverflow.com/comment/38524455
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24813461
has text: Bergi is correct, use Object.create and you're not re using parent constructor. More information information can be found here: http://stackoverflow.com/questions/16063394/prototypical-inheritance-writing-up/16063711#16063711

http://stackoverflow.com/comment/38655788
comment on: http://stackoverflow.com/q/24886369
score: 0
has text: if you dont calculate anything with this number you can pass it as string
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/73802604
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25071389
type: Comment
has text: @gai-appelbaum : maybe I am missing something; it seems `playlistId` (of `playlistItems.list`) doesn't accept array of `uploads` (received from `channels.list`) either. So what is it you achive by going this round trip than running querying via `search.list` API for each of the channel id ?

http://stackoverflow.com/q/24848550
type: Question
answer count: 2
has title: Bar overlapping in DC bar chart
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/24858918
has comment: http://stackoverflow.com/comment/38602128
favorite count: 0
has comment: http://stackoverflow.com/comment/38593770
tagged with: d3.js
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/22448822
has body: I have a bar chart but each column is overlap like image below : but when i create fiddle in jsfiddle with copy and paste code the chart is not overlap. in my original page i have only styles from twitter bootstrap.even i remove any style in page i have overlap column in bar chart. this is my code : var parseDate = d3.time.format("%Y/%m/%d").parse; var myData = [{ seller: 'Ehtemam', sdate: '2014/10/09', unitprice: 10, quantity: 100 }, { seller: 'Jafari', sdate: '2014/10/09', unitprice: 100, quantity: 106 }, { seller: 'Jamali', sdate: '2014/09/09', unitprice: 105, quantity: 109 }, { seller: 'Asghari', sdate: '2014/08/09', unitprice: 110, quantity: 106 }, { seller: 'Rezaee', sdate: '2014/10/09', unitprice: 150, quantity: 107 }, { seller: 'Akrami', sdate: '2014/08/09', unitprice: 1, quantity: 190 }, { seller: 'Ehtemam', sdate: '2013/07/09', unitprice: 1, quantity: 180 }, { seller: 'Ehtemam', sdate: '2014/06/09', unitprice: 12, quantity: 190 }, { seller: 'Akrami', sdate: '2014/11/09', unitprice: 12, quantity: 150 }, { seller: 'Ehtemam', sdate: '2014/12/09', unitprice: 14, quantity: 140 }, { seller: 'Jafari', sdate: '2013/12/09', unitprice: 56, quantity: 130 }, { seller: 'Asghari', sdate: '2014/12/09', unitprice: 33, quantity: 120 }, { seller: 'Ehtemam', sdate: '2012/11/09', unitprice: 188, quantity: 10 }, { seller: 'Rezaee', sdate: '2014/10/09', unitprice: 100, quantity: 10 }, ]; myData.forEach(function (d) { d.sdate = parseDate(d.sdate); d.year = d.sdate.getFullYear(); }); var data = crossfilter(myData); var sellers = []; for (var d in myData) { if (sellers.indexOf(myData[d].seller) == -1) { sellers.push(myData[d].seller); } } var colorScale = d3.scale.ordinal().range(['#DB0A5B', '#F62459', '#F1A9A0', '#2C3E50', '#26A65B', '#E87E04', '#D35400']); var sellerDimension = data.dimension(function (d) { return d.seller; }); var sellerGroup = sellerDimension.group().reduceSum(function (d) { return d.quantity; }); var sellerChart = dc.barChart('#chart'); sellerChart.height(300…
score: 3
upvote count: 3
has answer: http://stackoverflow.com/a/24854180
tagged with: dc.js

http://stackoverflow.com/comment/38765973
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24858293
has text: @xxstevenxo It is a single continuous stroke for me, try out this [fiddle](http://jsfiddle.net/scribblemaniac/85K7W/) and let me know if it is spotty for you.

http://stackoverflow.com/comment/38582460
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24847468
type: Comment
has text: The filter function should return a true value for each item you want to include. For multiple conditions, make the function more than one line with `if` statements, or use the `||` operator. For example, `return item.get('First_Name') == search || item.get('Last_Name') == search`

http://stackoverflow.com/q/24785238
accepted answer: http://stackoverflow.com/a/24786460
has answer: http://stackoverflow.com/a/24786524
downvote count: 1
tagged with: jquery
favorite count: 0
tagged with: backbone.js
answer count: 4
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/4886632
score: 1
duplicate of: http://stackoverflow.com/q/133973
has answer: http://stackoverflow.com/a/24786537
type: Question
possible better answer: http://stackoverflow.com/a/24786473
has title: this fetch call issue
has body: I have the following code inside a backbone view: var BookView = Backbone.View.extend({ initialize: function() { this.render(); }, render: function() { this.model.fetch({ success : function(model, resp, opt) { alert(this.$el.html() ); //THIS ONE DOESN'T WORK? } }); alert(this.$el.html() ); // THIS ONE WORKS FINE } }); I have two alert(this.$el.html() ); calls, one outside the fetch, and one inside. But for some reason, the one outside the fetch call works, but the one inside the fetch call returns an error: Uncaught TypeError: Cannot read property 'html' of undefined
tagged with: underscore.js
has answer: http://stackoverflow.com/a/24786473
tagged with: javascript
upvote count: 2
linked to: http://stackoverflow.com/q/133973
has answer: http://stackoverflow.com/a/24786460

http://stackoverflow.com/comment/39028237
score: 0
type: AnswerComment
has text: Yes it changes from the first hover to the second. I'll take a look this afternoon.
type: Comment
comment on: http://stackoverflow.com/a/25068377

validation
tags question: http://stackoverflow.com/q/24829266
tags question: http://stackoverflow.com/q/24895053
tags question: http://stackoverflow.com/q/24908004
tags question: http://stackoverflow.com/q/24828502
tags question: http://stackoverflow.com/q/24894341
tags question: http://stackoverflow.com/q/24843839
tags question: http://stackoverflow.com/q/24805925
tags question: http://stackoverflow.com/q/24864079
tags question: http://stackoverflow.com/q/24894857
tags question: http://stackoverflow.com/q/24866939
tags question: http://stackoverflow.com/q/24774367
tags question: http://stackoverflow.com/q/24821391
type: Tag
tag name: validation
tags question: http://stackoverflow.com/q/24883037
tags question: http://stackoverflow.com/q/24848642
tags question: http://stackoverflow.com/q/24781535
tags question: http://stackoverflow.com/q/24829491
tags question: http://stackoverflow.com/q/24758669
tags question: http://stackoverflow.com/q/24799186
tags question: http://stackoverflow.com/q/24828275
tags question: http://stackoverflow.com/q/24838603
tags question: http://stackoverflow.com/q/24808217
tags question: http://stackoverflow.com/q/24837413
tags question: http://stackoverflow.com/q/24854759
tags question: http://stackoverflow.com/q/24867839
tags question: http://stackoverflow.com/q/24777399
tags question: http://stackoverflow.com/q/24772730
tags question: http://stackoverflow.com/q/24832183
tags question: http://stackoverflow.com/q/24881905
tags question: http://stackoverflow.com/q/24905888
tags question: http://stackoverflow.com/q/24777824
tags question: http://stackoverflow.com/q/24855471
tags question: http://stackoverflow.com/q/24793070
tags question: http://stackoverflow.com/q/24780691
tags question: http://stackoverflow.com/q/24771369
tags question: http://stackoverflow.com/q/24754914
tags question: http://stackoverflow.com/q/24898959
tags question: http://stackoverflow.com/q/24817981
tags question: http://stackoverflow.com/q/24843511
tags question: http://stackoverflow.com/q/24826226
tags question: http://stackoverflow.com/q/24787007

http://stackoverflow.com/a/66059450
upvote count: 1
has body: I know this is late but you definitely don't have to use local storage or cookies. I was disheartened by the answer here so I found my own solution. Use a boolean and an embedded if statement. var alerted = false; if (x > y) { y = z; if (alerted === false) { alert("show your message"); alerted = true; } } You can then reset the alerted variable later on if you want to show the alert message again.
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24768067
score: 1

http://stackoverflow.com/q/24870976
tagged with: javascript
linked to: http://stackoverflow.com/q/7306669
accepted answer: http://stackoverflow.com/a/24871163
tagged with: jquery
has body: I have data in the format { "id1":["name1",10,20], "id2":["name2",12,20], "id3":["name3",14,21] } and am reading it in with var dat; $(document).ready(function() { $.getJSON('data.json', function(data) { dat = data.items; console.log(dat); }); }); This is proving problematic to read into properly because I gather (please clarify if I'm wrong) this is a poor json format as it lacks field names. Moreover the ':' seems to create something like a dictionary class and I'm not sure if that is preventing the resulting object from being iterable. If I call it in the console (e.g. dat[0]) I get "undefined", but perhaps there is an additional jquery error here. So the question is how read this in so the data is accessible/iterable? Thanks in advance.
has comment: http://stackoverflow.com/comment/38627345
answer count: 4
has comment: http://stackoverflow.com/comment/38627402
type: AnsweredQuestion
has title: Reading and parsing "bad" json
has answer: http://stackoverflow.com/a/24871306
type: Question
has comment: http://stackoverflow.com/comment/38627295
has comment: http://stackoverflow.com/comment/38662125
has answer: http://stackoverflow.com/a/24871163
has comment: http://stackoverflow.com/comment/38627608
has comment: http://stackoverflow.com/comment/38627477
has answer: http://stackoverflow.com/a/24871432
score: 0
tagged with: http://stackoverflow.com/tag/json
possible better answer: http://stackoverflow.com/a/24871167
has comment: http://stackoverflow.com/comment/38627719
has answer: http://stackoverflow.com/a/24871167

http://stackoverflow.com/comment/139672743
type: AnswerComment
type: Comment
has text: If you use a Map, the order issue is solved. Performing `indexOf` *n* times implies an inferior time complexity.
comment on: http://stackoverflow.com/a/24793128
score: 0

http://stackoverflow.com/q/24908646
type: Question
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/24908716
has body: Hi I am working on java script,i am writing java script function on aspx page and calling that function,the function will return value on button click event,But when i click on button the function is not getting called Here is my code. Java Script Function function CheckAge(age) { if (age &gt; 18) return true; else return false; } Here is on Button Click Event in CSfile try { bool check = false; try { btnAge.Attributes.Add("onClick", "javascript:return CheckAge('" + txtAge.Text + "')"); if (check) Response.Write("You Are Eligible"); else Response.Write("You Are Not Eligible"); } catch (Exception err) { Response.Write(err.Message); } } catch (Exception) { throw; } } Please help me out,can give the code please
type: UnansweredQuestion
score: 0
has title: JavaScript Function on Button Click
has answer: http://stackoverflow.com/a/24909001

http://stackoverflow.com/comment/38512292
type: Comment
has text: i still don't get what the ajax part is for... if you want to execute code after doc fully loaded use `$( window ).load(function() {`
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24810292

http://stackoverflow.com/q/24843839
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/24877928
has comment: http://stackoverflow.com/comment/68433374
tagged with: javascript
has body: I'm trying to use vue.js to do form validation and when the element is valid to submit it via ajax. But I can't get past the validation part. My html: Please choose one Select 1 Select 2 Select cannot be blank {{form.selected_id}} {{validation.selected_id}} My javascript: var app = new Vue({ el: '#form', filters: { selectValidator: function (val) { this.validation.selected_id = !! val return val } }, data: { form: { selected_id: '' }, validation: { selected_id: false } }, methods: { updateForm: function (e) { console.log(this.validation.selected_id) if (this.validation.selected_id) { console.log("make ajax call") } } } }) When looking into the console I see this.validation.selected_id as false instead of what it really is when it's printed out: true Here's a jsfiddle for testing, but it doesn't show the console log.
tagged with: vue.js
tagged with: validation
downvote count: 0
answer count: 1
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
has title: vue.js form validation and ajax submit
has comment: http://stackoverflow.com/comment/60808035
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/68379478
has comment: http://stackoverflow.com/comment/60808036

http://stackoverflow.com/a/24808310
score: 2
answers question: http://stackoverflow.com/q/24808285
upvote count: 2
downvote count: 0
type: Answer
has body: Adding a semi-colon will declare the end of a statement allowing you to call another one. &lt;input id = "test" onclick="func1();func2();"&gt;

http://stackoverflow.com/q/24798431
upvote count: 2
has body: I have an issue regarding with my drilldown charts.. Here is the link: http://jsfiddle.net/sSLnn/3/ chartfunc = function() { var column = document.getElementById('column'); var bar = document.getElementById('bar'); var pie = document.getElementById('pie'); var line = document.getElementById('line'); if(column.checked) { options.chart.renderTo = 'container'; options.chart.type = 'column'; var chart1 = new Highcharts.Chart(options); } else if(bar.checked) { options.chart.renderTo = 'container'; options.chart.type = 'bar'; var chart1 = new Highcharts.Chart(options); } else if(pie.checked) { options.chart.renderTo = 'container'; options.chart.type = 'pie'; var chart1 = new Highcharts.Chart(options); } else { options.chart.renderTo = 'container'; options.chart.type = 'line'; var chart1 = new Highcharts.Chart(options); } } In my chart I can change its type successfully with 4 radio buttons, however when i am in drill down series state then change the type of chart it will load to the original series state.. Is it possible when i change the type of the chart if i am in drill down series state it will change the type and the data will still remains?
type: Question
has title: Change chart type with drilldown series
type: AnsweredQuestion
tagged with: javascript
has answer: http://stackoverflow.com/a/24800660
score: 2
answer count: 1
tagged with: highcharts
downvote count: 0
tagged with: drilldown
favorite count: 0
accepted answer: http://stackoverflow.com/a/24800660

http://stackoverflow.com/comment/38493561
type: QuestionComment
has text: It is unclear what should happen with your text string. Here is an idea: `if (cameraLong === '') return "The coordinates weren't found.";`, so just return the string?
score: 1
comment on: http://stackoverflow.com/q/24800142
type: Comment

http://stackoverflow.com/q/24771635
possible better answer: http://stackoverflow.com/a/24771675
has title: IDs not being recognized when placed in modals
has comment: http://stackoverflow.com/comment/38439583
has answer: http://stackoverflow.com/a/24772046
accepted answer: http://stackoverflow.com/a/24772046
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/24771675
type: Question
answer count: 2
has body: I am creating a registration form where its contents are contained in DIV (hidden), then when the user clicks a button, the modal shows and the content is loaded through the ID of the DIV. However, I am encountering a problem where the button of the DIV is not recognized in my script. I assigned a click event using jquery, but it doesn't work. Probably because the hidden DIV has conflicts with the DIV create in the modal (which will eventually have the same IDs). Here is my script: $('#addCollege').click(function(e){ modal.open({content: $('#addCollegeForm').html()}); e.preventDefault();` }); This is the DIV College: Thanks and I appreciate your help.
upvote count: 1
has comment: http://stackoverflow.com/comment/38439407
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38439233
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/38452695
type: AnswerComment
comment on: http://stackoverflow.com/a/24778589
has text: thanks a lot. this was the right code. Because i need the id of the tr for my ajax-functions. the code works
type: Comment
score: 0

http://stackoverflow.com/q/24892363
has answer: http://stackoverflow.com/a/26683105
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24893383
tagged with: client-side-data
upvote count: 3
has answer: http://stackoverflow.com/a/24893121
has answer: http://stackoverflow.com/a/24892778
accepted answer: http://stackoverflow.com/a/24893121
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has title: How to save form input data to a XML file using Javascript?
has answer: http://stackoverflow.com/a/24892415
answer count: 5
type: AnsweredQuestion
score: 3
linked to: http://stackoverflow.com/q/17087636
downvote count: 0
has body: I want to save these form inputs in a file (e.g XML) in order to be able to use it later in the form again: First name: Last name: Click the "Submit" button and the form-data will be sent to a page on the server called "demo_form.asp". What is the easiest way to achieve this? I can't use PHP or ASP.NET.
type: Question
has comment: http://stackoverflow.com/comment/38668762
possible better answer: http://stackoverflow.com/a/24892415

http://stackoverflow.com/comment/38829150
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24904154
type: Comment
has text: Don't Edit it like that. Now you can up-vote my answer. I'd up-vote yours. Thanks

http://stackoverflow.com/comment/38571214
has text: `var str = "asdasd2 34 56 ——————————————-".replace(/[\u2014\-]/g, ""); str;` in my situation does not work. `[\u2014\-]` also remove all the numbers. I think something else should be added to this regex to keep the numbers.
comment on: http://stackoverflow.com/q/24841571
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/38548796
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24829726
type: QuestionComment
has text: @TheSoundDefense: and `time.time()` does not do the same thing; this function returns the offset from the epoch *for a given `datetime` object*, while `time.time()` only gives you the current timestamp.

http://stackoverflow.com/comment/38476821
comment on: http://stackoverflow.com/q/24790893
score: 0
has text: I see everyone's jsfiddle below works, but there is something wrong with mine that is preventing .submit() and .trigger('click') from working. I'll keep working on it and see what I can figure out. thx.
type: QuestionComment
type: Comment

http://stackoverflow.com/a/24753752
answers question: http://stackoverflow.com/q/24753518
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/38410859
has body: jQuery(document).ready(function{ jQuery(".button").click(function(){ //your action }) if(jQuery('td checkbox').is(':checked')){ //your action } }); Hope this would help you

http://stackoverflow.com/comment/77955218
type: AnswerComment
has text: That's what I wanted too. I have an object and just need to return a promise since that's what the API expects.
type: Comment
comment on: http://stackoverflow.com/a/31312689
score: 0

http://stackoverflow.com/q/24859334
has comment: http://stackoverflow.com/comment/38605471
has comment: http://stackoverflow.com/comment/38605334
has comment: http://stackoverflow.com/comment/38605585
tagged with: arrays
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24859426
has body: I have several checkboxes that you can click on. For every checkbox you click on, an ID, that is connected to the checkbox, is pushed into an array: HTML: &lt;tr ng-repeat="info in test"&gt; &lt;td&gt;{{info.stracka}}&lt;/td&gt;&lt;td&gt;{{info.tid}}&lt;/td&gt; &lt;td&gt;&lt;input type="checkbox" id="{{info.id}}" class="checkboxfisk" ng-click="testa(info.id)"&gt; &lt;/tr&gt; Controller: $scope.testa = function(id) { //När vi klickar i de olika checkboxarna, så fyllas arrayen med dessa $scope.checkboxes.push(id); console.log($scope.checkboxes); }; After this, I'm supposed to send this array containing the ID's to my backend. However, I want to send this Id's in an Object, instead of an array. How can I "push" data, like I do above, into and Object?
accepted answer: http://stackoverflow.com/a/24859764
has comment: http://stackoverflow.com/comment/38605333
has comment: http://stackoverflow.com/comment/38605359
answer count: 3
has comment: http://stackoverflow.com/comment/38605505
has answer: http://stackoverflow.com/a/24859486
linked to: http://stackoverflow.com/q/4215737
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38605383
upvote count: 1
has comment: http://stackoverflow.com/comment/38605356
type: AnsweredQuestion
tagged with: object
has answer: http://stackoverflow.com/a/24859764
has title: Push data into object AngularJS
score: 1
has answer: http://stackoverflow.com/a/24859426
type: Question

http://stackoverflow.com/q/24859552
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24859651
tagged with: php
has answer: http://stackoverflow.com/a/24859641
answer count: 4
possible better answer: http://stackoverflow.com/a/24859598
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24859616
accepted answer: http://stackoverflow.com/a/24859651
upvote count: 3
downvote count: 1
type: Question
has body: I want to concatenate all the values of showFname, showMname, showLname and show the result on showName. My problem is the concatenated names won't show in my showName. HTML &lt;input type="text" id="showFname" name="showFname" /&gt; &lt;input type="text" id="showMname" name="showMname" /&gt; &lt;input type="text" id="showLname" name="showLname" /&gt; &lt;label id="showName"&gt;&lt;/label&gt; JavaScript/jQuery: $(document).ready(function(){ var $emailCodeResult = $('#emailCodeResult'); var showFname = $('#showFname'); var showMname = $('#showMname'); var showLname = $('#showLname'); var showName = $('#showName'); var countTimerShowInfo = setInterval(function(){ showInfo(); showName = showFname + showMname +showLname; }, 500); function showInfo(){ $.ajax({ url:"files/view/profileInfo.php", type:"GET", data: { term : $('#emailCodeResult').val() }, dataType:"JSON", success: function(result) { $("#showFname").val(result.per_fname); $("#showMname").val(result.per_mname); $("#showLname").val(result.per_lname); } }); }; });
tagged with: javascript
score: 2
tagged with: jquery
favorite count: 0
tagged with: ajax
has title: How to concatenate passed values from PHP to AJAX?
has answer: http://stackoverflow.com/a/24859598

http://stackoverflow.com/comment/38996286
comment on: http://stackoverflow.com/q/24903016
has text: what is the version of Jquery that u're using ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24787780
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24787412
has body: If you don't want to block interaction with your page, you can also bind a function to the body of the page. If you aren't blocking propagation of click events, all click events will propagate up to the body of the element, so you can handle removing any given div that way. var clickFunction = function(){ $('#divToDelete').remove(); body.unbind('click', clickFunction); } //Call this when you create #divToDelete $('body').bind('click', clickFunction); Unbinding the function from the body after removing the div will also stop this function from executing every other time you click anything on your page.

http://stackoverflow.com/q/24848762
tagged with: javascript
has title: How to get the url of downloading page in chrome extension?
favorite count: 0
has comment: http://stackoverflow.com/comment/38584575
type: Question
score: 3
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/38584629
has body: I am trying to make a Chrome extension and I have two questions: What I want is to get the URL of the page from which my file is getting downloaded. How to restrict the JavaScript to just act on only some of the URLs and not all? I tried it using content_scripts matches but it didn't work. What to do?
upvote count: 3
tagged with: google-chrome
has answer: http://stackoverflow.com/a/24848846
answer count: 1
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/24848846

http://stackoverflow.com/q/24813782
type: Question
has body: function readImage(inputFiles,$input){ if(inputFiles == undefined || inputFiles.length == 0) return; var inputFile = inputFiles[0]; var reader = new FileReader(); reader.readAsDataURL(inputFile); reader.onload = function(event) { $input.attr("src", event.target.result); var image = new Image(); image.src = event.target.result; image.onload = function() { console.log('height: ' + this.height); ** &lt;=== this * ** console.log('width: ' + this.width); ** &lt;=== and this * ** }; }; } how i can make them global var console.log('height: ' + this.height); console.log('width: ' + this.width); i want when i load an image i can get the height and width from another function like : function getSize(){ return this.height+'|'+this.width; }
has answer: http://stackoverflow.com/a/24814613
has comment: http://stackoverflow.com/comment/38519374
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has title: how to get Hight and Width image javascript
accepted answer: http://stackoverflow.com/a/24814613
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38519406
tagged with: css
has comment: http://stackoverflow.com/comment/38519529
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38519222
has comment: http://stackoverflow.com/comment/38521404

http://stackoverflow.com/comment/38494046
comment on: http://stackoverflow.com/q/24799931
type: Comment
type: QuestionComment
has text: @PratikJoshi Is that more clearer?
score: 0

http://stackoverflow.com/comment/38428315
type: Comment
comment on: http://stackoverflow.com/a/24765354
score: 0
type: AnswerComment
has text: @Oleg Is this why my more complicated scripts were okay in `head`? I did move my script to `body` as a precaution, but now it's a matter of wanting to understand what's going on.

http://stackoverflow.com/q/24751475
has comment: http://stackoverflow.com/comment/38401386
answer count: 1
has body: my datepicker formate date = july-21-2014 11:00 AM i want to convert datepicker to timestamp formate like 2014-07-21T11:00:00. in javascript. for this purpose i have written like var now = new Date(date); var year = now.getFullYear(); var month = now.getMonth()+1; var day = now.getDate(); var hour = now.getHours(); var minute = now.getMinutes(); var second = now.getSeconds(); var convertedDate = year+'-'+month+'-'+day+'T'+hour+':'+minute+':'+second; it's working fine in chrome and firefox but it's failed in internet explore . i am getting date value like NaN-NaN-NaNTNaN:NaN:NaN. please help on this. how to resolve this issue?
tagged with: jquery
has answer: http://stackoverflow.com/a/24860108
type: UnansweredQuestion
tagged with: datepicker
has title: Date Parse issue for ie browser in javascript
linked to: http://stackoverflow.com/q/2182246
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38401381
score: 0

http://stackoverflow.com/comment/102766055
has text: The thing is, I'm having trouble following through the performance part. What do you mean by "promise resolve depth of two"? And how would promises ever have a scheduling time of around 50s, if they were used with proper non-blocking code for concurrent tasks?
type: Comment
comment on: http://stackoverflow.com/a/58193150
score: 1
type: AnswerComment

http://stackoverflow.com/comment/38646200
has text: @user3168736, no need for caps
score: 0
comment on: http://stackoverflow.com/q/24880910
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38620068
comment on: http://stackoverflow.com/a/24867217
has text: Yes,I know for this, but I was thinking that width and height attributes should work just the same.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/24799047
answers question: http://stackoverflow.com/q/24797816
score: 2
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/38491242
has comment: http://stackoverflow.com/comment/38496715
has body: I don't know if skewing is the answer here. The thing is that you are trying to apply a 3d effect on the paper, not a 2d one. I'm not sure that it can be done in pure svg and raphael too, but here's a pure css solution using css3 3d transform (rotateX) and perspective: body { /* the lower the value, the higher the distortion */ perspective: 600px; } #raph-rotate { width: 500px; height: 750px; margin: 0 auto; transform: rotateX(30deg); transform-origin: 50% 100%; } Here's the updated fiddle: http://jsfiddle.net/Tj9bJ/2/
type: Answer

http://stackoverflow.com/comment/126725158
has text: Thanks for this! Just a thought: can't the accepted answer be edited instead of an extra post ?
comment on: http://stackoverflow.com/a/66407939
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/q/24825630
type: UnansweredQuestion
answer count: 4
has answer: http://stackoverflow.com/a/24980891
type: Question
has comment: http://stackoverflow.com/comment/38540851
has body: I want to make a list of JS libraries I have used in my webapp. Can I somehow extract it automatically from the included files? The ones which I include in my head tag? Can I somehow scan particular JS files for licenses?
has title: how to extract the licenses of JS libraries used
tagged with: javascript
has answer: http://stackoverflow.com/a/24867509
score: 4
has answer: http://stackoverflow.com/a/46196606
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/24947372
upvote count: 5

http://stackoverflow.com/q/24777265
tagged with: http://stackoverflow.com/tag/html
has body: i have a simple HTML, where on a tag i have onmouseover="loadQueryResults();" Here is a function: function loadQueryResults(e) { e = e || window.event; var data = []; var target = e.srcElement || e.target; while (target &amp;&amp; target.nodeName !== "TR") { target = target.parentNode; } if (target) { var cells = target.getElementsByTagName("td"); for (var i = 0; i &lt; cells.length; i++) { data.push(cells[i].innerHTML); } } //window.open("racun.php?name="+data) THIS WORKS //window.alert("racun.php?name=" + data) THIS WORKS //document.writeln(data); final=data.toString(); //document.writeln(final); THIS ALSO WORKS stranica="racun.php?name="+final; $( "#DisplayDiv" ).load(stranica); //THIS DOESNT WORK---WHY??? $( "#DisplayDiv" ).load("racun.php"); //THIS however WORKS! } Question is, why when i include arguments in php page i want to load, nothing happens?
tagged with: php
accepted answer: http://stackoverflow.com/a/24778145
has comment: http://stackoverflow.com/comment/38450273
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38449678
has answer: http://stackoverflow.com/a/24778315
type: Question
has title: Load dynamic php generated page in a div
possible better answer: http://stackoverflow.com/a/24778315
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/24778145
tagged with: jquery

http://stackoverflow.com/a/24816683
has body: You can use event delegation to add event handlers to dynamically added elements to $(document).on('s3_upload_failed', '#s3-uploader', function(e, content) { return alert(content.filename + ' failed to upload : ' + content.error_thrown + '.'); }); But you will have to initialize the S3Uploader plugin only after the element is loaded to the dom. So the below part need to get executed after the element is loaded to the dom $('#s3-uploader').S3Uploader({ remove_completed_progress_bar: false, progress_bar_target: $('#uploads_container'), }); You might have to look at the code that is loading the dynamic elements and add a callback handler to it where you can execute this.
type: Answer
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/38560456
accepted answer of: http://stackoverflow.com/q/24816668
answers question: http://stackoverflow.com/q/24816668
upvote count: 3
type: AcceptedAnswer

http://stackoverflow.com/comment/101604185
comment on: http://stackoverflow.com/a/44413726
has text: The most elegant solution
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38556838
type: AnswerComment
type: Comment
has text: I guess I should have said in my comment - I tried `!important` and of course my CSS is after Bootstrap's. Never mind though, in the HTML worked :)
comment on: http://stackoverflow.com/a/24814111
score: 0

http://stackoverflow.com/a/31926485
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/24835704
has body: My solution would be: _.invoke = function(collection, functionOrKey, args) { //invoke when provided a method name if(typeof functionOrKey === 'string'){ return _.map(collection, function(val){ return val[functionOrKey](args); }); } //invoke when provided a function reference return _.map(collection, function(val){ return functionOrKey.apply(val, args); }); };
upvote count: 2
type: Answer

http://stackoverflow.com/a/24794563
has comment: http://stackoverflow.com/comment/38865167
type: AcceptedAnswer
downvote count: 0
has body: Please see: Is there a way to tell crossfilter to treat elements of array as separate records instead of treating whole array as single key? Your example is a slightly simpler example because you don't have an array for "rowchart3" values but the solution could still work for you. The answer includes a jsfiddle that demonstrates how to manually manage the categories in the chart. You would need to change function reduceAdd(p, v) { if (v.topics[0] === "") return p; // skip empty values v.topics.forEach (function(val, idx) { p[val] = (p[val] || 0) + 1; //increment counts }); return p; } to something like function reduceAdd(p, v) { if(v.rowhart3a != "") p[v.rowchart3a] = (p[v.rowchart3a] || 0) + 1; //increment counts if(v.rowhart3b != "") p[v.rowchart3b] = (p[v.rowchart3b] || 0) + 1; //increment counts if(v.rowhart3c != "") p[v.rowchart3c] = (p[v.rowchart3c] || 0) + 1; //increment counts return p; } I hope this helps. -DJ
accepted answer of: http://stackoverflow.com/q/24791496
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/24791496

http://stackoverflow.com/comment/38688964
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24903653
has text: @RajaprabhuAravindasamy , I am sure you are right the OP should not include Jquery library
type: Comment

http://stackoverflow.com/a/24890292
answers question: http://stackoverflow.com/q/24890101
has body: remove your "input" into your .find(); JSFiddle
downvote count: 1
has comment: http://stackoverflow.com/comment/38665501
upvote count: 0
score: -1
type: Answer

http://stackoverflow.com/comment/38472199
comment on: http://stackoverflow.com/q/24788452
score: 0
type: QuestionComment
type: Comment
has text: @G.Mendes Ah the influence of keyword selection; "pass" becomes "access", "object" becomes "library" and you get a whole new list of results. Unfortunately the post you linked to mentioned my original (not working) solution as its top voted answer. That method has not worked for me

http://stackoverflow.com/comment/38651609
type: Comment
has text: First of all, thanks for the help. I did follow your advice and following this example: http://jsbin.com/ucanam/3008/edit I changed my code, it's practically the same has the example, my variables are working fine but the url isn't updating. My code: http://jsbin.com/zuholano/1/edit Note: the console.log displays the correct value for the variable aka the changes that I input to the search.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24878802

http://stackoverflow.com/q/24890124
has comment: http://stackoverflow.com/comment/38768791
tagged with: article
has answer: http://stackoverflow.com/a/24894584
has comment: http://stackoverflow.com/comment/38663775
has comment: http://stackoverflow.com/comment/38663520
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
has title: How can I get JQuery Plugin to not target blog posts?
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38664371
accepted answer: http://stackoverflow.com/a/24894584
possible better answer: http://stackoverflow.com/a/24890294
has answer: http://stackoverflow.com/a/24890294
score: 0
answer count: 2
has body: I am using a JS plugin that allows the overflow of text to be toggled between hidden and not hidden when you click the read more link. Works great, and uses the article tag to trigger it. I am using it on random portions of text throughout the site. The problem is the blog posts are also using the article tag so it's hiding most of the blog posts as well. How can I make it bybass the blog posts? You can see it live on the site here. http://www.gregtregunno.ca/about and http://www.gregtregunno.ca/news This is jquery $(document).ready(function(){ $('#info').readmore({ moreLink: 'More examples and options', maxHeight: 390, afterToggle: function(trigger, element, expanded) { if(! expanded) { // The "Close" link was clicked $('html, body').animate( { scrollTop: element.offset().top }, {duration: 100 } ); } } }); $('article').readmore({maxHeight: 175});});
has comment: http://stackoverflow.com/comment/38663657
has comment: http://stackoverflow.com/comment/38777493
has comment: http://stackoverflow.com/comment/38663297
has comment: http://stackoverflow.com/comment/38669322
has comment: http://stackoverflow.com/comment/38663517
has comment: http://stackoverflow.com/comment/38664171

ruby-on-rails
tags question: http://stackoverflow.com/q/24787309
tags question: http://stackoverflow.com/q/24861295
tags question: http://stackoverflow.com/q/24892640
tags question: http://stackoverflow.com/q/24804506
tags question: http://stackoverflow.com/q/24874835
type: Tag
tags question: http://stackoverflow.com/q/24829288
tags question: http://stackoverflow.com/q/24809870
tags question: http://stackoverflow.com/q/24797676
tags question: http://stackoverflow.com/q/24858695
tags question: http://stackoverflow.com/q/24853024
tags question: http://stackoverflow.com/q/24767014
tags question: http://stackoverflow.com/q/24764693
tags question: http://stackoverflow.com/q/24838870
tags question: http://stackoverflow.com/q/24839210
tags question: http://stackoverflow.com/q/24780048
tags question: http://stackoverflow.com/q/24898151
tags question: http://stackoverflow.com/q/24762638
tags question: http://stackoverflow.com/q/24836352
tags question: http://stackoverflow.com/q/24835510
tags question: http://stackoverflow.com/q/24829747
tags question: http://stackoverflow.com/q/24879598
tags question: http://stackoverflow.com/q/24767498
tags question: http://stackoverflow.com/q/24859840
tags question: http://stackoverflow.com/q/24873750
tags question: http://stackoverflow.com/q/24762448
tags question: http://stackoverflow.com/q/24780768
tags question: http://stackoverflow.com/q/24828784
tags question: http://stackoverflow.com/q/24783095
tags question: http://stackoverflow.com/q/24840055
tags question: http://stackoverflow.com/q/24784279
tags question: http://stackoverflow.com/q/24772505
tags question: http://stackoverflow.com/q/24897829
tags question: http://stackoverflow.com/q/24874199
tags question: http://stackoverflow.com/q/24838584
tags question: http://stackoverflow.com/q/24901314
tag name: ruby-on-rails
tags question: http://stackoverflow.com/q/24857223
tags question: http://stackoverflow.com/q/24803164
tags question: http://stackoverflow.com/q/24866252
tags question: http://stackoverflow.com/q/24828478
tags question: http://stackoverflow.com/q/24899465
tags question: http://stackoverflow.com/q/24852584
tags question: http://stackoverflow.com/q/24824557
tags question: http://stackoverflow.com/q/24762927
tags question: http://stackoverflow.com/q/24817845
tags question: http://stackoverflow.com/q/24814209
tags question: http://stackoverflow.com/q/24844986
tags question: http://stackoverflow.com/q/24789680
tags question: http://stackoverflow.com/q/24819381
tags question: http://stackoverflow.com/q/24771369
tags question: http://stackoverflow.com/q/24803709
tags question: http://stackoverflow.com/q/24858687
tags question: http://stackoverflow.com/q/24850998
tags question: http://stackoverflow.com/q/24851889
tags question: http://stackoverflow.com/q/24816668
tags question: http://stackoverflow.com/q/24764744
tags question: http://stackoverflow.com/q/24864648
tags question: http://stackoverflow.com/q/24867441
tags question: http://stackoverflow.com/q/24792855
tags question: http://stackoverflow.com/q/24900700
tags question: http://stackoverflow.com/q/24845835
tags question: http://stackoverflow.com/q/24777440
tags question: http://stackoverflow.com/q/24787394
tags question: http://stackoverflow.com/q/24752435
tags question: http://stackoverflow.com/q/24784121
tags question: http://stackoverflow.com/q/24837216
tags question: http://stackoverflow.com/q/24873737
tags question: http://stackoverflow.com/q/24765784
tags question: http://stackoverflow.com/q/24830146

web-services
type: Tag
tags question: http://stackoverflow.com/q/24861242
tags question: http://stackoverflow.com/q/24798902
tags question: http://stackoverflow.com/q/24789635
tags question: http://stackoverflow.com/q/24817538
tags question: http://stackoverflow.com/q/24907582
tags question: http://stackoverflow.com/q/24884906
tags question: http://stackoverflow.com/q/24904342
tag name: web-services
tags question: http://stackoverflow.com/q/24867624

http://stackoverflow.com/comment/38523314
type: Comment
comment on: http://stackoverflow.com/a/24816003
score: 0
type: AnswerComment
has text: @user3842025 is very hard to understand the rules based on your existing code

http://stackoverflow.com/a/24893985
answers question: http://stackoverflow.com/q/24884320
has body: I don't think it's good practice, but you can do this: Add a reference to your TextStatus component <TextStatus ref="textStatus" ... /> Then in your TextArea component you can access it like this: onTextChanged : function(event) { this.props.currentLength = event.target.value.length; // You need to add a textLength state to your TextStatus, then this._owner.refs['textStatus'].setState({ currentLength: this.props.currentLength; }); } Your TextStatus become something like this: var TextStatus = React.createClass({ getInitialState: function () { return { currentLength: 0 }; }, render : function() { return ( Caratteri{this.state.currentLength} / {this.props.maxLength} ); } });
score: 0
type: Answer

http://stackoverflow.com/comment/38463928
score: 0
has text: The html spec says you don't need it, but almost browsers will inject it in there for you (Check out the source). http://emberjs.jsbin.com/bunoreso/1/edit
type: Comment
comment on: http://stackoverflow.com/a/24766251
type: AnswerComment

http://stackoverflow.com/q/24887545
has comment: http://stackoverflow.com/comment/38658703
has body: I've been struggling with this issue for the last couple of hours now and have decided to come to stackoverflow for this. I want to clear all of the elements in the body tag, except 1 (this includes it's children). So what I thought I'd do is. 1. Store the element in a variable. 2. Clear the body tag. 3. Re-add the stored element. However, the developer console gives me the following error. Uncaught NotFoundError: An attempt was made to reference a Node in a context where it does not exist. What is it that I'm doing wrong? Also, I'm not using jQuery or any other framework, so native JavaScript would be appreciated. var myBody = null; var myNode = document.getElementsByTagName("body")[0]; while(myNode.lastChild) { if(myNode.lastChild.id !== "c_container") { myNode.removeChild(myNode.lastChild); }else{ myBody = myNode.removeChild(myNode.lastChild); } } myNode.appendChild(myBody); HTML only the parts which matter to the subject: &lt;body&gt; &lt;div id="wrapper"&gt; &lt;div id="left_container"&gt; &lt;div id="c_container"&gt; &lt;!-- content --&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt;
has title: Reuse node removed from DOM
possible better answer: http://stackoverflow.com/a/24888039
has comment: http://stackoverflow.com/comment/38658198
has comment: http://stackoverflow.com/comment/38658709
accepted answer: http://stackoverflow.com/a/24887926
has comment: http://stackoverflow.com/comment/38658531
type: Question
has comment: http://stackoverflow.com/comment/38658876
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38658788
has comment: http://stackoverflow.com/comment/38658197
has comment: http://stackoverflow.com/comment/38658519
has comment: http://stackoverflow.com/comment/38658759
has answer: http://stackoverflow.com/a/24888039
has comment: http://stackoverflow.com/comment/38658430
has answer: http://stackoverflow.com/a/24887926
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38658452
answer count: 2
has comment: http://stackoverflow.com/comment/38658369
has comment: http://stackoverflow.com/comment/38659207
has comment: http://stackoverflow.com/comment/38658634
has comment: http://stackoverflow.com/comment/38658803

http://stackoverflow.com/a/24780166
has comment: http://stackoverflow.com/comment/38456165
type: Answer
has comment: http://stackoverflow.com/comment/38456946
answers question: http://stackoverflow.com/q/24780048
has body: What is in the partial? You could just completely replace the partial &lt;div id=partial&gt; &lt;%= render 'partial' %&gt; &lt;/div&gt; js.erb: $('#partial').html("&lt;%= j render 'partial', list: @list %&gt;"); For looping you should be able to do: I'm assuming it's a number of items that is returned &lt;% @list.items.each do |list_item| %&gt; $('#partial').append("&lt;%= j render 'list_item_partial', list_item: list_item %&gt;"); &lt;% end %&gt; Where the list item partial is just the code to display each list item. To be honest I've not used json much so am not going to be much help, other than that you can make your controller code @list = Profile.find(params[:id]).get_wishlist.to_json
score: 0
has comment: http://stackoverflow.com/comment/38457175

http://stackoverflow.com/a/24778362
type: Answer
score: 3
downvote count: 0
has body: I had to create a custom binding to do it. I haven't done any cross browser testing but I think it will work on all current browsers. &lt;input type="file" data-bind="fileSrc: src" id="file"/&gt; &lt;img data-bind="attr:{src:src}"/&gt; $(function() { ko.applyBindings(new ViewModel()); }); var ViewModel = function () { var self = this; self.src = ko.observable(); }; ko.bindingHandlers.fileSrc = { init: function (element, valueAccessor) { ko.utils.registerEventHandler(element, "change", function () { var reader = new FileReader(); reader.onload = function (e) { var value = valueAccessor(); value(e.target.result); } reader.readAsDataURL(element.files[0]); }); } }; http://jsfiddle.net/5vfKZ/1/
answers question: http://stackoverflow.com/q/24774439
upvote count: 3

http://stackoverflow.com/q/24768385
tagged with: jquery-ui-droppable
type: Question
tagged with: javascript
tagged with: jquery
has title: JQuery multiple droppables and one function to handle each
score: 0
has body: Being new to JavaScript/JQuery I'm having a bit of a problem figuring out how could I implement registering drop function of multiple droppables to one function, for example: $('#droppableLW').droppable({ drop : handleUIDropEvent }); $('#droppableRW').droppable({ drop : handleUIDropEvent }); And obtaining the id of droppable inside handleUIDropEvent method, for instance to achieve this: function handleUIDropEvent(event, ui) { var droppableId = somehowGottaGetIt; if (new String(droppableId).valueOf() == new String("droppableLW").valueOf()) { ... } else { ... } }
accepted answer: http://stackoverflow.com/a/24768938
answer count: 1
tagged with: jquery-droppable
has answer: http://stackoverflow.com/a/24768938
type: AnsweredQuestion

http://stackoverflow.com/a/24906871
answers question: http://stackoverflow.com/q/24905739
has comment: http://stackoverflow.com/comment/38695716
accepted answer of: http://stackoverflow.com/q/24905739
type: Answer
has comment: http://stackoverflow.com/comment/38694814
has comment: http://stackoverflow.com/comment/38695634
downvote count: 0
score: 1
has body: the function returns false before the async call is finisshed !! the best implementation i could reach to is here JSBIN example JS Bin ? and javasScript code is: var is = false; function isPortrait(src) { var img = new Image(); img.src = src; var here = img.onload = function() { alert(img.width+"x"+img.height); if(img.height>img.width) { is = true; } // it is here at this moment where you can get result of the // awaited async function onload() document.getElementById("heading").innerHTML = "is it Portrait ? " + is; }; } isPortrait("http://blogs.smithsonianmag.com/aroundthemall/files/2009/01/npg_portraits_nicholson_jack_2002-244x300.jpg"); Edit [ Another better impleentation using the 'setInterval` var is = false; var notYetLoaded = true; function isPortrait(src){ tryLoadImage(src); var myWaiting = setInterval(function(){ if(notYetLoaded === false){ // use the "is" boolean here document.getElementById("heading").innerHTML = "is it Portrait ? " + is; clearInterval(myWaiting); } }, 1000); } function tryLoadImage(src) { var img = new Image(); img.src = src; var here = img.onload = function() { alert(img.width+"x"+img.height); if(img.height>img.width) { is = true; } notYetLoaded = false; }; } isPortrait("http://blogs.smithsonianmag.com/aroundthemall/files/2009/01/npg_portraits_nicholson_jack_2002-244x300.jpg"); code here: http://jsbin.com/qodefuhe/1/edit I hope that helps :)
has comment: http://stackoverflow.com/comment/38695976
has comment: http://stackoverflow.com/comment/38695836
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/a/25797112
has comment: http://stackoverflow.com/comment/40391321
accepted answer of: http://stackoverflow.com/q/24900018
answers question: http://stackoverflow.com/q/24900018
score: 15
has body: I was having the same problem, and came up with the following solution: Update your myImagePicker function to be (note the new objVals parameter to the oninsert function): function myImagePicker(callback, value, meta) { tinymce.activeEditor.windowManager.open({ title: 'Image Browser', url: '/media/browser/1?type=' + meta.filetype, width: 800, height: 550, }, { oninsert: function (url, objVals) { callback(url, objVals); } }); }; Update your mySubmit function to be (note the objVals parameter that is passed to oninsert): function mySubmit (url, objVals) { top.tinymce.activeEditor.windowManager.getParams().oninsert(url, objVals); top.tinymce.activeEditor.windowManager.close(); return false; } Update the places that you call mySubmit to fill-in the objVals object. For example: mySubmit("https://google.com", { text: "Go To Google", target: '_blank' }); The properties to fill-in for objVals change based on the type of calling dialog, and are (partially) documented here. For the link dialog: mySubmit("https://google.com", { text: "Go To Google", target: '_blank' }); For the image dialog: mySubmit("image.jpg", { alt: "My image" }); For the mediadialog: mySubmit("movie.mp4", {source2: 'movie-alt.ogg', poster: 'movie-image.jpg'});
upvote count: 15
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/57568371
downvote count: 0
type: Answer

http://stackoverflow.com/q/24881517
accepted answer: http://stackoverflow.com/a/24881603
has body: I retrieve a list of pairs from a JSON document. I can retrieve each pair through $.each(result,function(key,value) { alert(key+" "+value); } but for certain cases, I would like to retrieve only each value, put it in an array so I can add it to an autocomplete function : $("#myTextField").autocomplete({source:listOfValues}); But I cannot find how to construct the object "listOfValues". I have almost no experiences in JQuery and JSON. (That's why I assume, my question is quite simple, but I cannot find the solution)
type: AnsweredQuestion
tagged with: jquery-autocomplete
tagged with: jquery
tagged with: key-value
type: Question
has answer: http://stackoverflow.com/a/24881603
score: 0
tagged with: http://stackoverflow.com/tag/json
answer count: 3
possible better answer: http://stackoverflow.com/a/24881597
has answer: http://stackoverflow.com/a/24881597
has answer: http://stackoverflow.com/a/24881620
tagged with: javascript
has title: Get JSON values from a list of pairs as Array (for autocomplete function)

http://stackoverflow.com/a/24801357
type: Answer
has body: Try this: FIDDLE $("h4").each(function(){ if($(this).text() === 'Special Text!!!') { var pid = $(this).parents().attr("id"); alert(pid); } });
score: 0
answers question: http://stackoverflow.com/q/24801047

http://stackoverflow.com/a/24829591
has comment: http://stackoverflow.com/comment/38548645
has comment: http://stackoverflow.com/comment/38549220
has comment: http://stackoverflow.com/comment/38549111
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38549393
has comment: http://stackoverflow.com/comment/38549443
has comment: http://stackoverflow.com/comment/38548600
has comment: http://stackoverflow.com/comment/38548940
has comment: http://stackoverflow.com/comment/38551408
type: Answer
has comment: http://stackoverflow.com/comment/38548745
has body: Twisted, node.js, and every other asynchronous framework behave the exact same way here: If you writing blocking code in your callbacks, the entire event loop is blocked until your callback is done. Asynchronous frameworks are really great for doing I/O-bound work; the event loop never gets blocked waiting for I/O, because it can all be done in a non-blocking way. When there is data ready for reading, the event loop fires off your callback, the callback handles the data, and then the event loop takes control again. When you hear these frameworks being called "async" and "event-driven", it's referring to this non-blocking I/O + event loop model. However, when you actually need to do some kind of processing with the data being sent/received, you need to be careful. Event loops are single-threaded; only one CPU-based operation can happen at a time. That means if you do some expensive calculation that takes 10 seconds in a callback, your event loop is blocked for 10 seconds. There's no extra magic in node.js that avoids this. If you want to be able to do CPU-based operations without blocking your event loop, node.js (and twisted) have mechanisms for sending the CPU-bound work to a sub-process, and then fetching the results when the sub-process is complete. The node.js About page actually mentions this: But what about multiple-processor concurrency? Aren't threads necessary to scale programs to multi-core computers? You can start new processes via child_process.fork() these other processes will be scheduled in parallel. For load balancing incoming connections across multiple processes use the cluster module.
score: 2
accepted answer of: http://stackoverflow.com/q/24829204
has comment: http://stackoverflow.com/comment/38548889
upvote count: 2
has comment: http://stackoverflow.com/comment/38549290
answers question: http://stackoverflow.com/q/24829204
has comment: http://stackoverflow.com/comment/38548578
has comment: http://stackoverflow.com/comment/38548712

http://stackoverflow.com/comment/38541174
has text: I though of that aswell, but his option doesn't have value (even if they should).
type: Comment
score: 0
comment on: http://stackoverflow.com/a/24825809
type: AnswerComment

http://stackoverflow.com/q/24758681
downvote count: 0
accepted answer: http://stackoverflow.com/a/24759007
has comment: http://stackoverflow.com/comment/38414704
favorite count: 0
tagged with: angularjs
type: Question
score: 20
linked to: http://stackoverflow.com/q/29006996
tagged with: checkbox
has answer: http://stackoverflow.com/a/24760973
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/32321935
has comment: http://stackoverflow.com/comment/38414817
answer count: 3
has answer: http://stackoverflow.com/a/24759007
has comment: http://stackoverflow.com/comment/38418077
has title: AngularJS checkbox dynamic ng-true-value expression
possible better answer: http://stackoverflow.com/a/32321935
upvote count: 20
tagged with: javascript
has body: I'm trying to build a calculator for daycare prices in Angular. Every location in the company franchise has separate prices for every day. So my thinking was to build a form, with first a select that allows you to select the location, then a series of checkboxes for the days. I'm having trouble with ng-true-value in the checkboxes selecting the correct prices from my json file. UPDATE: Added Plunkr: http://plnkr.co/edit/MDmrqaH1VzLBzjd5eHgT?p=preview Consider this code: Choose location Select days Ma Di Wo Do Vr First the select sets formData with a location ID, then I want to use this ID to select the day prices for the matching location and set those to ng-true-value. I'm using ng-true-value="{{data.bso[formData.location.ID].prices.monday}}" for this. This doesn't work. When I set the ID manually like ng-true-value="{{data.bso[0].prices.monday}}" it does work. Why is the result of the select not being picked up by ng-true-value? This is my json file: $scope.data = { "bso": [ { "ID": 0, "title": "Locatie 1", "prices": { "monday": 130, "tuesday": 130, "wednesday": 200, "thursday":130, "friday": 130 } }, { "ID": 1, "title": "Locatie 2", "prices": { "monday": 430, "tuesday": 530, "wednesday": 600, "thursday":990, "friday": 730 } } ] };
has comment: http://stackoverflow.com/comment/38415004
has comment: http://stackoverflow.com/comment/38415153
type: AnsweredQuestion

http://stackoverflow.com/q/24898151
has title: JSON response from Google Analytics api
tagged with: javascript
favorite count: 0
tagged with: ruby
type: UnansweredQuestion
upvote count: 1
tagged with: ruby-on-rails
tagged with: google-analytics-api
score: 1
has answer: http://stackoverflow.com/a/24899600
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/33510240
answer count: 2
has body: I am using the google-api-ruby-client to get a response from the Google Analytics api, which is successful, the one thing I am a little confused with though is the response object. I would like to know how to drill down into specific keys and their values or even parse the response to make it more understandable. Below is what I believe is the relevant part of the JSON response "{\"kind\":\"analytics#gaData\",\"id\":\"https://www.googleapis.com/analytics/v3/data/ga?ids=ga:88893966&amp;dimensions=ga:pagePath&amp;metrics=ga:pageviews&amp;filters=ga:pagePath%3D%3D/&amp;start-date=2014-01-01&amp;end-date=2014-07-22\",\"query\":{\"start-date\":\"2014-01-01\",\"end-date\":\"2014-07-22\",\"ids\":\"ga:88893966\",\"dimensions\":\"ga:pagePath\",\"metrics\":[\"ga:pageviews\"],\"filters\":\"ga:pagePath==/\",\"start-index\":1,\"max-results\":1000},\"itemsPerPage\":1000,\"totalResults\":1,\"selfLink\":\"https://www.googleapis.com/analytics/v3/data/ga?ids=ga:88893966&amp;dimensions=ga:pagePath&amp;metrics=ga:pageviews&amp;filters=ga:pagePath%3D%3D/&amp;start-date=2014-01-01&amp;end-date=2014-07-22\",\"profileInfo\":{\"profileId\":\"88893966\",\"accountId\":\"53082810\",\"webPropertyId\":\"UA-53082810-1\",\"internalWebPropertyId\":\"85713348\",\"profileName\":\"All Web Site Data\",\"tableId\":\"ga:88893966\"},\"containsSampledData\":false,\"columnHeaders\":[{\"name\":\"ga:pagePath\",\"columnType\":\"DIMENSION\",\"dataType\":\"STRING\"},{\"name\":\"ga:pageviews\",\"columnType\":\"METRIC\",\"dataType\":\"INTEGER\"}],\"totalsForAllResults\":{\"ga:pageviews\":\"8\"},\"rows\":[[\"/\",\"8\"]]}" which is obtained from # make queries result = client.execute(:api_method =&gt; api_method, :parameters =&gt; { 'ids' =&gt; PROFILE, 'start-date' =&gt; Date.new(2014,1,1).to_s, 'end-date' =&gt; Date.today.to_s, 'dimensions' =&gt; 'ga:pagePath', 'metrics' =&gt; 'ga:pageviews', 'filters' =&gt; 'ga:pagePath==/' }) puts ap(result) Also when I do: puts ap(result.data.rows.inspect) #returns "[[\"/\", \"…
downvote count: 0

http://stackoverflow.com/comment/38591760
type: Comment
has text: Thank you Will, I only can thanks for that because I dont have engouh reputation to vote up your answer.
comment on: http://stackoverflow.com/a/24831660
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38679262
type: QuestionComment
comment on: http://stackoverflow.com/q/24898389
has text: There is another file that loads jquery before this one is executed. I'm sure it works properly as my code works if I simply copy paste the script and place it where the script src tag is between tags.
score: 0
type: Comment

http://stackoverflow.com/comment/38483907
score: 0
type: AnswerComment
type: Comment
has text: Now it showing an Error: Ad adLoadError error: No ads were found in the ad response. At least one ad is required to be able to load or play. errorCode: 1001 in console
comment on: http://stackoverflow.com/a/24784023

http://stackoverflow.com/a/24784758
upvote count: 1
has comment: http://stackoverflow.com/comment/38464287
has comment: http://stackoverflow.com/comment/38465318
score: 1
has comment: http://stackoverflow.com/comment/38464529
has body: Remember, you're setting the variable calculate to the following: return{ rate : function(){ $('#txt_Ra_te').on('input',function(){ alert(calculate.txt_rate); // $('#txt_Amo_unt').val(total_amount); }); }, // End Rate Function discount : function(){ $('#txt_Disc_ount').on('input',function(){ // $('#txt_Net').val(total_net); }); } }; Now take a look at your alert. You're trying to access something that is not defined within that return statement. calculate knows nothing of what's going on inside that function expression. It only knows what is returned from it. To fix, simply remove the calculate. from the alert as you're not accessing something from inside the variable calculate but rather, you're defining a closure. Solution: alert(txt_rate);
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24784582
type: Answer
has comment: http://stackoverflow.com/comment/38465046
answers question: http://stackoverflow.com/q/24784582
has comment: http://stackoverflow.com/comment/38465147

http://stackoverflow.com/comment/38405891
has text: @Mayur, also include what the rendered output looks like (view page source) and copy the script part
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24752529
type: Comment

http://stackoverflow.com/comment/38548868
comment on: http://stackoverflow.com/q/24829688
has text: What is the "area" parameter in your `@Url.Action()`?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24788354
upvote count: 1
downvote count: 0
type: AcceptedAnswer
score: 1
has body: Just add this code to the end of your javascript: $('.link:first').click(); This way, when the page loads, the first button is clicked.. Your javascript code would be something like this: $('.instruction_type').hide(); $('.link').click(function() { $('.instruction_type').hide(); $('.instruction_type[data-link=' + $(this).data('link') + ']').fadeIn({ width: '200px'}, 300); }); $('.link:first').click();
accepted answer of: http://stackoverflow.com/q/24788286
type: Answer
answers question: http://stackoverflow.com/q/24788286

http://stackoverflow.com/q/24821649
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/24822219
tagged with: asp.net-ajax
tagged with: asp.net
favorite count: 0
has title: Disable button on update progress in ASP.net Ajax
tagged with: c#-4.0
accepted answer: http://stackoverflow.com/a/24822219
upvote count: 7
type: AnsweredQuestion
tagged with: c#
has body: Hi i am loading huge data by asp.net Ajax on button click in grid view showing loading message on update prgress ...in update progress time i have to disable my BtnLoadReport Button. &lt;td&gt; &lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt;&lt;/asp:ScriptManager&gt; &lt;/td&gt; &lt;td&gt; &amp;nbsp;&lt;/td&gt; &lt;td&gt; &amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:UpdateProgress ID="updProgress" AssociatedUpdatePanelID="UpdatePanel1" runat="server" oninit="updProgress_Init" onprerender="updProgress_PreRender"&gt; &lt;ProgressTemplate&gt; &lt;span style="color:green; font-style:italic;"&gt;Loading, please wait...&lt;/span&gt; &lt;/ProgressTemplate&gt; &lt;/asp:UpdateProgress&gt; &lt;asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server"&gt; &lt;ContentTemplate&gt; &lt;div id="DemoId"&gt; &lt;asp:Button ID="BtnLoadReport" runat="server" onclick="BtnLoadReport_Click" Text="LoadReport" Width="176px" ClientIDMode="Static" OnClientClick="return clickOnLoadReport();" /&gt; &lt;/div&gt; &lt;asp:GridView ID="GridView1" runat="server" Height="170px" onselectedindexchanged="GridView1_SelectedIndexChanged" Width="438px"&gt; &lt;/asp:GridView&gt; &lt;/ContentTemplate&gt; &lt;Triggers&gt; &lt;asp:AsyncPostBackTrigger ControlID="BtnLoadReport" EventName="Click" /&gt; &lt;/Triggers&gt; &lt;/asp:UpdatePanel&gt; &lt;/td&gt; &lt;td&gt; &amp;nbsp;&lt;/td&gt; &lt;td&gt; &amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; my script to disable button &lt;script type="text/javascript"&gt; var updateProgress = null; function clickOnLoadReport() { // This will disable all the children of the div var prm = Sys.WebForms.PageRequestManager.getInstance(); if (prm.get_isInAsyncPostBack()==false) { var nodes = document.getElementById("DemoId").getElementsByTagName('*'); for (var i = 0; i &lt; nodes.length; i++) { nodes[i].disabled = true; // nodes[i].off("click"); } } } &lt;/script&gt; but it is not disabling my button for long it is disabling it f…
score: 7
tagged with: javascript
type: Question

http://stackoverflow.com/comment/38694554
has text: May i know how are you displaying the error for wrong username or password
type: AnswerComment
comment on: http://stackoverflow.com/a/24903944
score: 0
type: Comment

http://stackoverflow.com/a/24804966
type: Answer
answers question: http://stackoverflow.com/q/24804186
has body: The reason your code fails is that you can't simply subtract the parts from each other. A simple strategy is to convert them to a common unit, do the subtraction, then convert back to a suitable format. Your code looks overly complex, consider the following. It gets the difference between two times by firstly converting them to seconds, gets the difference, then converts back to a time in hh:mm:ss format: // Return seconds given a time in h:m:s format function timeToSecs(t) { var b = t.split(':'); return b[0]*3.6e3 + b[1]*60 + +b[2]; } // Return hh:mm:ss given seconds function secsToTime(s) { function z(n){return (n&lt;10? '0' : '') + n} var sign = s &lt; 0? '-' : ''; s = Math.abs(s); return sign + z(s/3.6e3|0) + ':' + z(s%3.6e3/60|0) + ':' + z(s%60); } // Return the difference between two times in h:m:s format function (t0, t1) { return secsToTime(timeToSecs(t1) - timeToSecs(t0)); } console.log(getTimeDiff('00:05:53', '00:17:31')); // 00:11:38 console.log(getTimeDiff('00:17:31', '00:05:53')); // -00:11:38 console.log(getTimeDiff('08:57:01', '17:23:41')); // 08:26:40
score: 0

http://stackoverflow.com/comment/38681409
type: QuestionComment
has text: Interesting. It is definitely happening to me now. The delay is incredibly obvious. Let me think about it.
comment on: http://stackoverflow.com/q/24899375
score: 0
type: Comment

http://stackoverflow.com/comment/38508833
type: Comment
comment on: http://stackoverflow.com/q/24805540
has text: @Gimby I've worked with Node.js, how would I go approaching it? For example, something simple like just retrieving a file from the tomcat server?
score: 0
type: QuestionComment

http://stackoverflow.com/q/24842016
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/24842163
has comment: http://stackoverflow.com/comment/38571688
type: AnsweredQuestion
downvote count: 2
has body: I have two objects, object 1 and object 2. Object 1 calls a global function which requires object 2 as an argument, yet object 2 calls the same global function with object 1 as an argument. I get the following JSLint message: 'obj1' was used before it was defined: do_something(obj1); The way my code works there will be no actual problems when run, but I am wondering how I can adjust my code so js-lint stops telling me this. I find JSLint useful and this message may interfere with my use of JSLint. My code is similar to the following: var obj1 = { foo: function () { bar(obj2); } }; var obj2 = { foo: function () { bar(obj1); } }; EDIT: The answer below worked perfectly for me. I'm surprised I didn't think of that!
type: Question
accepted answer: http://stackoverflow.com/a/24842163
upvote count: 0
score: -2
tagged with: javascript
has title: Two objects must use each other?
has comment: http://stackoverflow.com/comment/38571678

http://stackoverflow.com/comment/38617697
type: Comment
has text: Hmm, that has almost worked, it still gives 2 points on every option fopr some reason.
comment on: http://stackoverflow.com/a/24865079
score: 0
type: AnswerComment

http://stackoverflow.com/q/24758183
tagged with: javascript
score: -1
upvote count: 0
has answer: http://stackoverflow.com/a/24759185
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/38413898
favorite count: 0
has title: javascript how to detect pressed key and replace with html
has body: i've a text editor and i want to detect character inserted from keyboard and replace it with pressed Key i have tried this $(div).keyup(function (event) { selection = saveSelection(div); //save the pointer position in div }); function replace() { var key = true; restoreSelection(div, selection); //restore the pointer position in div $(div).focus().keydown(function (evt) { if (key) //prevent from repeat { evt.preventDefault(); evt = evt || window.event; var charCode = typeof evt.which == "number" ? evt.which : evt.keyCode; var keyChar = String.fromCharCode(charCode); //this Does'nt work well replaceSelectionWithHtml('' + keyChar + ''); key = false; } }); } and then focus() to strong that created to continue typing ! (How??) i have tried this but not working in this case : restoreSelection( div , selection ); $(div).focus(); 2nd question is when we are writing within strong or em how to blur() from it (closing this tag) and continue writing !? UPDATE : here is a Demo .
has comment: http://stackoverflow.com/comment/38414266
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38413879
downvote count: 1
type: Question

http://stackoverflow.com/comment/38468567
score: 0
type: Comment
type: QuestionComment
has text: Thanks. There is limitation for URL, so I changed it. But now it is fine.
comment on: http://stackoverflow.com/q/24772571

http://stackoverflow.com/q/24858331
possible better answer: http://stackoverflow.com/a/24858724
answer count: 3
has answer: http://stackoverflow.com/a/24874197
tagged with: mysql
has answer: http://stackoverflow.com/a/24858724
has comment: http://stackoverflow.com/comment/38603499
tagged with: javascript
has answer: http://stackoverflow.com/a/24863909
upvote count: 4
has body: I found a tutorial that auto submits the form data but all I want to do is add a submit button to pass the data to ajax. My goal is to have a form with multiple inputs and when the user clicks the submit button it sends it through ajax and updates the page without reloading the page. Also, another key piece is the way it post all the inputs into an array so that when the update script is ran the name attributes from the input fields match the columns in the database. I think I'm close. I've searched and haven't found my exact solution. Thanks in advance. &lt;script type="text/javascript" src="/js/update.js"&gt;&lt;/script&gt; &lt;form method="POST" action="#" id="myform"&gt; &lt;!-- start id-form --&gt; &lt;table border="0" cellpadding="0" cellspacing="0" id="id-form"&gt; &lt;tr&gt; &lt;th valign="top"&gt;Business Name:&lt;/th&gt; &lt;td&gt;&lt;input type="text" name="company_name" class="inp-form" /&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th valign="top"&gt;Address 1:&lt;/th&gt; &lt;td&gt;&lt;input type="text" name="address_1" class="inp-form" /&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th valign="top"&gt;Address 2:&lt;/th&gt; &lt;td&gt;&lt;input type="text" name="address_2" class="inp-form" /&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th&gt;&amp;nbsp;&lt;/th&gt; &lt;td valign="top"&gt; &lt;input id="where" type="hidden" name="customer_id" value="1" /&gt; &lt;button id="myBtn"&gt;Save&lt;/button&gt; &lt;div id="alert"&gt; &lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;!-- end id-form --&gt; &lt;/form&gt; update.js var myBtn = document.getElementById('myBtn'); myBtn.addEventListener('click', function(event) { updateform('form1'); }); function updateform(id){ var data = $('#'+id).serialize(); // alert(data); $.ajax({ type: 'POST', url: "/ajax/update_company_info.php", data: data, success: function(data) { $('#id').html(data); $('#alert').text('Updated'); $('#alert').fadeOut().fadeIn(…
linked to: http://stackoverflow.com/q/60174
has comment: http://stackoverflow.com/comment/38603695
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24874197
has comment: http://stackoverflow.com/comment/38603657
has comment: http://stackoverflow.com/comment/38603725
has comment: http://stackoverflow.com/comment/38623630
downvote count: 0
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/12859942
tagged with: ajax
type: Question
tagged with: php
score: 4
has title: Update form using Ajax, PHP, MYSQL

http://stackoverflow.com/comment/38458476
comment on: http://stackoverflow.com/a/24781219
type: Comment
has text: How can I set those variables in the script like name and id? (that APi requires me to do so.)
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38661672
score: 0
type: Comment
type: QuestionComment
has text: You're a star @DimitarChristoff! Works perfectly. Could you just explain what the last line of the JS is doing so I can fully understand--- this.set('text', grids.match('#ulGrid.hide')[0] ? 'grid' : 'list')
comment on: http://stackoverflow.com/q/24887183

http://stackoverflow.com/a/24838959
answers question: http://stackoverflow.com/q/24838563
score: 0
has body: The first if statement should be like this if ((x != 0) &amp;&amp; (x != 1) &amp;&amp; (x != 2) &amp;&amp; (x != 4) &amp;&amp; (x != 6)) { document.getElementById("output").innerHTML = "Enter a legitimate number!!"; document.getElementById("test1").value = ''; } You should use the &amp;&amp; (logical and) operator instead of || (logical or).
type: Answer

http://stackoverflow.com/comment/38617819
score: 0
type: Comment
type: QuestionComment
has text: Why dont u use aJaX ? Its popular and FREE :) And looks cooler than Page Reloading Submit
comment on: http://stackoverflow.com/q/24865991

http://stackoverflow.com/comment/38546904
comment on: http://stackoverflow.com/q/24828502
score: 0
has text: where you add reference and where you add your code?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38507485
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24807121
has text: I have lots of templates big enough that template: '...' would be awkward, but small enough that separate files seems unnecessary. I want to combine them all into templates.htm.
score: 0

http://stackoverflow.com/comment/38693336
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24900514
has text: Well, it's not harmless, aesthetically. Or when my boss comes round asking why I've added a tooltip to a control. ;)

http://stackoverflow.com/comment/38491043
has text: Mr Java O'Reilly.. I want to meet this guy.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24798961

http://stackoverflow.com/q/24853148
upvote count: 1
type: Question
score: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38617593
tagged with: google-maps
tagged with: jquery-mobile
downvote count: 0
favorite count: 0
has body: I have this problem, which had been working in previous versions, and I dont know what happend since its not working now. The problem is that only the header and footer in jqm is "sliding/showing". I've included the problem visually: My code is: AP AP Username: Password: Version KICK-ASS Menu Exit Version KICK-ASS Same code works without googlemaps.. Any help appreciated.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38619846
has title: Jquery mobile panel with google maps as content does not hide content
answer count: 0

http://stackoverflow.com/comment/38634005
comment on: http://stackoverflow.com/a/24873915
score: 0
type: AnswerComment
type: Comment
has text: The zoom approach seems to work pretty well. With both, if you scroll up and down a lot the image gradually gets smaller and smaller. I think if I set a min/max size for the image, it should keep things from getting too weird. Thank you!

http://stackoverflow.com/comment/38566728
type: Comment
score: 0
comment on: http://stackoverflow.com/q/24839463
has text: instead of passing category can you pass id of that div? Then you can easily hide or show that div.
type: QuestionComment

http://stackoverflow.com/comment/38591873
comment on: http://stackoverflow.com/a/24852432
type: AnswerComment
has text: Inserting empty span didnt work for me .Do i need to compute the width ?
score: 0
type: Comment

http://stackoverflow.com/q/24752984
score: 0
tagged with: http://stackoverflow.com/tag/pdf
answer count: 0
type: UnansweredQuestion
tagged with: scroll
has body: I need display a user guide in pdf format（more than 1 pages）, user have to read all the content, then only can check the checkbox.Below is my aspx code: ASPX: I am using the following javascript to handle scroll,but that is work for parent windows only, not work for iframe. How do I solve this? or have another better approach? Thanks
has comment: http://stackoverflow.com/comment/59978748
has title: Force user scroll the PDF to bottom to enable checkbox
has comment: http://stackoverflow.com/comment/38439117
type: Question
has comment: http://stackoverflow.com/comment/38404937
tagged with: javascript
has comment: http://stackoverflow.com/comment/38405615
tagged with: jquery
has comment: http://stackoverflow.com/comment/38413391
tagged with: asp.net

http://stackoverflow.com/q/24842505
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24846837
has title: Reactjs unexpected infinite loop with render
type: Question
upvote count: 5
tagged with: javascript
tagged with: reactjs
answer count: 2
score: 5
downvote count: 0
has answer: http://stackoverflow.com/a/24842635
favorite count: 0
tagged with: ajax
has body: I using React to implemented Include component. It load content from url. This test works but also produces an unexpected infinite loop with render... why? &lt;script type="text/jsx"&gt; /** @jsx React.DOM */ var Include = React.createClass({ getInitialState: function() { return {content: 'loading...'}; }, render: function() { var url = this.props.src; $.ajax({ url: url, success: function(data) { this.setState({content: data}); }.bind(this) }); return &lt;div&gt;{this.state.content + new Date().getTime()}&lt;/div&gt;; } }); var Hello = React.createClass({ render: function() { return &lt;Include src="hello.txt" /&gt;; } }); React.renderComponent( &lt;Hello /&gt;, document.getElementById('hello') ); &lt;/script&gt;

http://stackoverflow.com/a/24876143
type: Answer
answers question: http://stackoverflow.com/q/24876093
has comment: http://stackoverflow.com/comment/38637248
score: 0
has body: You could use lodash or underscore: var _ = require('lodash'); // or 'underscore' var a = [{id: 123},{id: 234},{id: 345}]; var b = _.pluck(a, 'id'); console.log(b); // [123, 234, 345]

http://stackoverflow.com/q/24876316
type: Question
has title: AngularJS 'PUT' requests. How to submit ONLY the data in form?
tagged with: javascript
has body: I'm trying to update user data, but when I make the 'PUT' request, Angular is sending the entire user $scope rather than just the fields exposed by the form. I'm using a Factory to get and put the data. Here's my edit function $scope.editStudent = function () { Student.edit ({id: $stateParams.studentId}, $scope.Student, function (data) { $location.path('/'); }); }; This doesn't work for me because the server I'm sending to does it's own server-side validation, and if I'm sending the entire student scope there will be some fields that are blank, thus will not pass validation. The server allows me to send just the field I need to update, so I'm looking for an Angular way of doing this. Here's a screenshot to help explain my question:
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/24876980
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/comment/38558188
type: Comment
has text: not really, the cookie only avoids to fire fancybox programmatically after the first time visit (the OP shouldn't remove `return false;`), but the visitor should be able to open the fancybox manually through a link http://jsfiddle.net/SKh9e/
comment on: http://stackoverflow.com/a/24833147
score: 0
type: AnswerComment

http://stackoverflow.com/a/24842503
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/38593717
type: AcceptedAnswer
has body: Two-way binding out-of-the-box is still an unresolved issue: Need two-way Binding support as alternative to alias See also the duplicate of that report: Allow creating two way bindings in QML You can find a "workaround" on Jira, but it is suboptimal. Basiaally, there are two workarounds: alias, but it is "hard", not "soft", which means it cannot be broken up. two-way Binding component usage, but it is breaking a reusable component and it is also tiresome to create two components forth and back. In your specific case, probably the latter applies as myvar is not quite an alias. Try this out: Binding { target: myCppClass property: "myvar" value: comp.object when: comp.completed }
accepted answer of: http://stackoverflow.com/q/24842286
has comment: http://stackoverflow.com/comment/38591999
answers question: http://stackoverflow.com/q/24842286
downvote count: 0
type: Answer

http://stackoverflow.com/a/24847873
score: 0
has comment: http://stackoverflow.com/comment/38590927
has comment: http://stackoverflow.com/comment/38592377
has comment: http://stackoverflow.com/comment/38587751
has body: By using jQuery, you can get all your selected checkboxes with the name="degree" and make test on a switch case like this : &lt;input type="checkbox" name="degree" value="certificate"&gt;Trade School/Certificate&lt;br/&gt; &lt;input type="checkbox" name="degree" value="aa"&gt;Associates Degree&lt;br/&gt; &lt;input type="checkbox" name="degree" value="ba"&gt;Bacholors Degree&lt;br/&gt; &lt;input type="checkbox" name="degree" value="masters"&gt;Masters Degree&lt;br/&gt; &lt;input type="checkbox" name="degree" value="dr"&gt;Doctors Degree&lt;br/&gt; function getPrice() { currentPrice = 0; var inputs = $("input[name=degree]:checked"); for(i=0;i&lt;inputs.length;i++) { switch($(inputs[i]).val()) { case "certificate": currentPrice += 100; break; case "aa": currentPrice += 100; break; case "ba": currentPrice += 100; break; case "masters": currentPrice += 100; break; case "dr": currentPrice += 100; break; } } return currentPrice; }
type: Answer
has comment: http://stackoverflow.com/comment/38592180
answers question: http://stackoverflow.com/q/24847711

http://stackoverflow.com/comment/38613308
comment on: http://stackoverflow.com/a/24863540
has text: I think you can refer these..In fact we use parsing since the data will be returned in an normal format..like a json encoded string..you have to parse it.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/24901499
tagged with: javascript
tagged with: jquery
tagged with: backbone.js
has body: I'm trying to get a click handler to open a Facebook Login window using backbone but the click event is registering as a popup and being blocked by the browser. My click event it calling an external function facebookStatus() which has the FBlogin. Any idea how I can bind the Fblogin to the click event using my setup below? Main.js var MainView = Backbone.View.extend({ el : "#main", model: false, shareModel: false, events: { 'click #fblogin' : 'onClick', }, onClick: function(e) { var self = this; e.preventDefault(); if (typeof (FB) != "undefined") { $(".social-login").html("Por favor espera..."); facebookStatus(self.model); } else { alert("Please wait Facebook APP is ready"); } return false; } }); facebookSDK.js function facebookStatus(model) { var data = new Object(); data.action = "login"; var display = 'popup'; var iOS = ( navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false ); console.log(iOS); if (iOS) { display = 'touch'; FB.login(function(response) { if (response.status=="connected"){ console.log("7"); data.token = response.authResponse.accessToken; model.fetch({data:data,type:'POST'}); } }, {scope: 'user_about_me,user_likes'}); }}; HTML &lt;div id="main"&gt; &lt;div class="social-login"&gt; &lt;a id="fblogin" href="javascript;"&gt; &lt;img src="img/facebooklogin.png"&gt; &lt;/a&gt; &lt;/div&gt; &lt;/div&gt;
tagged with: facebook
type: UnansweredQuestion
score: 0
tagged with: requirejs
has answer: http://stackoverflow.com/a/24902219
has comment: http://stackoverflow.com/comment/38686943
has title: Backbone Popblock click event
type: Question
has comment: http://stackoverflow.com/comment/38685779
answer count: 1

http://stackoverflow.com/comment/38534261
type: Comment
score: 0
type: QuestionComment
has text: Usually in this case it is a scripts issue that is not referenced correctly. Just check if your browser referenced it in your source code
comment on: http://stackoverflow.com/q/24822090

http://stackoverflow.com/q/24842754
has comment: http://stackoverflow.com/comment/38573365
has answer: http://stackoverflow.com/a/24848802
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has title: jQuery js file not loading
tagged with: servlets
has comment: http://stackoverflow.com/comment/38573246
has comment: http://stackoverflow.com/comment/38573401
has body: Why my custom js is loading but jquery-1.11.1.js is not loading, tried placing it in same folder as my custom js(StartPage.js), but still on firebug console its showing not found. title <%@ include file="/html/StartPage.html"%>
has answer: http://stackoverflow.com/a/24842983
has comment: http://stackoverflow.com/comment/38573078
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/38573222
tagged with: spring
has comment: http://stackoverflow.com/comment/38573891
score: 0
tagged with: java

http://stackoverflow.com/q/24833998
has answer: http://stackoverflow.com/a/24834091
tagged with: toggle
type: Question
type: AnsweredQuestion
tagged with: javascript
has body: Hi I have navigation which shows and hides base on clicking the button. I know I could add a button in the hidden div which would close it. However, I want to have the same button show and hide the same div. Any thoughts? I tried reversing #hide and #show, but it then hides the original. Fiddle: http://jsfiddle.net/6xtd8/1/ MENU Home Security Home Automation Business Security Business Automation $(document).ready(function () { // This hides the Nav $("#hide").click(function () { $(".target").hide("slide", { direction: "up" }, 500); $('#show').show(); $('#hide').hide(); }); // This shows nav when button is clicked. $("#show").click(function () { $(".target").show("slide", { direction: "up" }, 500); $('#show').hide(); $('#hide').show(); }); // This animated the toggle. if ($('.target').is(':visible')) {} });
accepted answer: http://stackoverflow.com/a/24834091
answer count: 1
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Mobile Navigation hide/show one button
score: 0

http://stackoverflow.com/a/24820608
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/38531476
has comment: http://stackoverflow.com/comment/38531547
has comment: http://stackoverflow.com/comment/38531720
has body: This is what I came up with :) http://jsfiddle.net/F5NUd/11/ $(document).ready(function () { var i = 0; $('.highlightButton').on('click', function (text) { $inputText = $('#inputText'); words = $inputText.text().match(/\w+/g); if (i &gt;= words.length) { i = 0; } words.splice(i, 0, "&lt;span class='highlight'&gt;"); words.splice(i + 2, 0, "&lt;/span&gt;"); $inputText.html(words.join(' ')); i += 1; }); }); UPDATE: Automatic word switching :) http://jsfiddle.net/F5NUd/15/ $(document).ready(function () { var i, timerId, speed = 100, //speed in ms higlightWord = function (text, index) { var words = text.match(/\w+/g); if (index &gt;= words.length) { return text; } words.splice(index, 0, "&lt;span class='highlight'&gt;"); words.splice(index + 2, 0, "&lt;/span&gt;"); return words.join(' '); }; $('.highlightButton').bind('click', function () { $inputText = $('#inputText'); i = 0; if (timerId) { clearInterval(timerId); } timerId = setInterval(function () { var sentence = higlightWord($inputText.text(), i); if (sentence !== $inputText.text()) { i += 1; } else { clearInterval(timerId); } $inputText.html(sentence); }, speed); }); });
accepted answer of: http://stackoverflow.com/q/24819753
answers question: http://stackoverflow.com/q/24819753
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38531594

http://stackoverflow.com/a/24785075
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38465000
has comment: http://stackoverflow.com/comment/38465052
has comment: http://stackoverflow.com/comment/38465066
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/24785005
answers question: http://stackoverflow.com/q/24785005
has body: If you use an anonymous function, event is auto passed in: el.addEventListener("click", function(event){ //event is passed modifyText("four") //add another param here to pass 'event' along with your param }, false); If you specify a function as the callback, you get the default params, as above (event being the first one) You'll have to pass it along to your function via a second parameter if you want more params.

http://stackoverflow.com/comment/38695919
score: 0
has text: The memory footprint with either IE or Chrome for [my test case](http://goo.gl/4b6Mo8) is reasonable, same as the CPU usage, which doesn't even reach its peaks. Why would it be laggy?
comment on: http://stackoverflow.com/a/24907455
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38491283
has text: Sure, here! :) http://jsfiddle.net/TTr8E/
comment on: http://stackoverflow.com/q/24799069
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/24776363
tagged with: contenteditable
has title: execCommand not working properly in ie
upvote count: 1
type: Question
tagged with: internet-explorer
has answer: http://stackoverflow.com/a/24798547
score: 1
tagged with: rich-text-editor
linked to: http://stackoverflow.com/q/12519938
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/24798547
has body: The problem is with the execCommand, it is not being executed in IE even in IE10 properly . For instance, When I click bold and keeps on typing, in IE it is not making the letters bold, I have to select the text and click bold in order to make it bold. In all other browsers its will make the letters bold when I click bold button and keeps on typing. Here is the link to jsfiddle http://jsfiddle.net/Q65Qt/ Here is the code var oDoc, sDefTxt; function initDoc() { oDoc = document.getElementById("textBox"); sDefTxt = oDoc.innerHTML; if (document.compForm.switchMode.checked) { setDocMode(true); } } function formatDoc(sCmd, sValue) { if (validateMode()) { document.execCommand(sCmd, false, null); oDoc.focus(); } } function validateMode() { if (!document.compForm.switchMode.checked) { return true; } alert("Uncheck \"Show HTML\"."); return false; } function setDocMode(bToSource) { var oContent; if (bToSource) { oContent = document.createTextNode(oDoc.innerHTML); oDoc.innerHTML = ""; var oPre = document.createElement("pre"); oDoc.contentEditable = false; oPre.id = "sourceText"; oPre.contentEditable = true; oPre.appendChild(oContent); oDoc.appendChild(oPre); } else { if (document.all) { oDoc.innerHTML = oDoc.innerText; } else { oContent = document.createRange(); oContent.selectNodeContents(oDoc.firstChild); oDoc.innerHTML = oContent.toString(); } oDoc.contentEditable = true; } oDoc.focus(); } Here is the link to jsfiddle http://jsfiddle.net/Q65Qt/ Please help, Thanks in advance
type: AnsweredQuestion

http://stackoverflow.com/comment/38643676
has text: As I need to make use of a service I created 2 directives
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24862722

http://stackoverflow.com/q/24882402
has body: I have a page that loads pretty fast instead of the image gallery in it. I prefer not to have loading for the entire page , but have a loading "with loading indicator" for a certain div. The gallery will load eventually, but, is there a way to: have a loading for it's certain div( like #gallery, or .gallery) and show a loading gif or such at the center of this div, that disappears automatically when loading is done? After it loads, some certain button with a certain class or id (like #button or .button) clicks automatically? Thank you in advance!
score: -2
tagged with: javascript
tagged with: jquery
tagged with: click
downvote count: 2
has comment: http://stackoverflow.com/comment/38648848
has comment: http://stackoverflow.com/comment/38648749
answer count: 1
tagged with: load
favorite count: 0
has comment: http://stackoverflow.com/comment/38649000
accepted answer: http://stackoverflow.com/a/24883049
has title: Loading for a certain div, with indicator & click on some button when its done
has comment: http://stackoverflow.com/comment/38648827
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24883049
tagged with: loading
upvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/38648816
has comment: http://stackoverflow.com/comment/38648791

http://stackoverflow.com/a/24908687
has body: It IS working, as you can verify by putting a: alert($('.name').data("element")); It's only that the HTML is not modified. If you want to see it in the HTML, too, use the following: $('.name').attr("data-element", "name");
score: 0
answers question: http://stackoverflow.com/q/24908619
type: Answer

http://stackoverflow.com/a/24873276
accepted answer of: http://stackoverflow.com/q/24871938
has comment: http://stackoverflow.com/comment/38668570
answers question: http://stackoverflow.com/q/24871938
has comment: http://stackoverflow.com/comment/38663013
has comment: http://stackoverflow.com/comment/38902564
has comment: http://stackoverflow.com/comment/38664349
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38918997
has comment: http://stackoverflow.com/comment/38633401
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38668783
has comment: http://stackoverflow.com/comment/38633324
has comment: http://stackoverflow.com/comment/38633236
has body: There are really two main groups of path changes or "transitions" that occur in your app. First: Ember will initialize and the router will transition the user into the desired context. This can take several transitions if you have nested resources. If a user returns to a nested resource or reloads the page, Ember is smart and will reload with context. Thus, the auto-transitioning. Second: The user may transition through the app based on whatever UI you cooked up. To address the first of two issues, you will probably need to initialize each route's controller to activate the currentPath property, using the setupController hook. That way on page load the route will do the first setter, then the observer will deal with any user-based path changes. Here is a generic path observer that you can place in your application controller. It will address the second of the two issues: App.ApplicationController = Ember.Controller.extend({ needs: ['super-table', 'users', 'locations'], currentPathDidChange: function () { var path_base = this.get('currentPath').split('.')[0]; this.set('controllers.super-table.currentPath', path_base); // give your super table template the path this.nullifyActiveFlags(); // You can write this yourself... switch(path_base){ // just give me the base resource case 'users': this.set('controllers.users.activePath', true); break; case 'locations': this.set('controllers.locations.activePath', true); break; } }.observes('currentPath'), //... I would probably pull that callback logic out of the observer and into its own method, but this is just pseudo-code to show what is possible. You should also refactor the super table currentPath setter to be a computed alias from within the super table controller. Let me know if there is any additional explanation needed! I've used similar patterns quite a few times and it works very nicely when configured correctly.
has comment: http://stackoverflow.com/comment/38673518
type: Answer
downvote count: 0

http://stackoverflow.com/q/24865338
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24865483
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38616411
has comment: http://stackoverflow.com/comment/38617742
type: Question
tagged with: ng-options
tagged with: angular-ngmodel
has body: HTML I'm getting the result and display it properly; but the selected list is not getting bound to the ng-model and I don't know why. I implemented the same in another place in my project it's working over there. Can anyone please let me know how to do that. Any help will be really appreciated.
tagged with: javascript
has title: ng-model data is not binding for selected ng-option
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/comment/38416871
comment on: http://stackoverflow.com/q/24759792
score: 1
type: Comment
type: QuestionComment
has text: Why not just use an event handler with a condition that fails if there are errors ?

http://stackoverflow.com/q/24847418
has body: I'm trying to implement custom button for Facebook Login by using FB JS SDK. Problem is - when I'm calling function fb_login() console said that function is undefined. How should I change this code? JS Part: An so here is HTML part: Authorize using FB P.S. I read already answers on similar questions (like this one). Solutions offered completely similar to my question, but it's not working.
has answer: http://stackoverflow.com/a/24849051
accepted answer: http://stackoverflow.com/a/24849051
type: AnsweredQuestion
type: Question
score: 0
has title: Custom login button with Facebook Java Script SDK not working
answer count: 1
linked to: http://stackoverflow.com/q/9810335
tagged with: javascript
tagged with: facebook
linked to: http://stackoverflow.com/q/8142159

http://stackoverflow.com/q/24903771
score: 0
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/38689650
type: UnansweredQuestion
upvote count: 1
downvote count: 1
type: Question
tagged with: spring-mvc
has answer: http://stackoverflow.com/a/24904054
has body: How to implement windows authentication in spring based Java-application? I have created authentication using spring security,But i want to use windows credential while user login to my application.
tagged with: java
has title: How to implement windows authentication in spring based Java-application?

http://stackoverflow.com/a/26469483
has comment: http://stackoverflow.com/comment/61694878
score: 16
has body: Its is working. code: $('.firstDiv').slickGoTo(4); Please see below example http://jsfiddle.net/9fnmegqb/ And as of version 1.4+ : $('.firstDiv').slick('slickGoTo', 4)
upvote count: 16
has comment: http://stackoverflow.com/comment/41695650
has comment: http://stackoverflow.com/comment/50892211
has comment: http://stackoverflow.com/comment/41925564
downvote count: 0
has comment: http://stackoverflow.com/comment/41925785
has comment: http://stackoverflow.com/comment/46054732
type: Answer
answers question: http://stackoverflow.com/q/24889858
has comment: http://stackoverflow.com/comment/85020545

http://stackoverflow.com/q/24829726
has body: I'm attempting to create a simple python function which will return the same value as javascript new Date().getTime() method. As written here, javascript getTime() method returns number of milliseconds from 1/1/1970 So I simply wrote this python function: def jsGetTime(dtime): diff = datetime.datetime(1970,1,1) return (dtime-diff).total_seconds()*1000 while the parameter dtime is a python datetime object. yet I get wrong result. what is the problem with my calculation?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38548792
has answer: http://stackoverflow.com/a/24830657
tagged with: gettime
has answer: http://stackoverflow.com/a/24831158
score: 7
linked to: http://stackoverflow.com/q/221294
tagged with: date
has comment: http://stackoverflow.com/comment/38548765
type: Question
has comment: http://stackoverflow.com/comment/38548719
possible better answer: http://stackoverflow.com/a/24830657
answer count: 2
has comment: http://stackoverflow.com/comment/38548796
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24831158
has comment: http://stackoverflow.com/comment/38548801
tagged with: datetime
favorite count: 0
has title: python function to return javascript date.getTime()
tagged with: python
upvote count: 7

http://stackoverflow.com/comment/38675319
type: Comment
type: QuestionComment
has text: @Sid thanks point taken
comment on: http://stackoverflow.com/q/24895982
score: 0

http://stackoverflow.com/comment/38476987
comment on: http://stackoverflow.com/q/24791119
has text: @csanonymus Sorry, I can't give you a link. That's also outside the scope of this question. I just want to know general advice for debugging these sorts of scenarios.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38550132
has text: Code is good... must be other problem
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24830444
score: 0

http://stackoverflow.com/comment/38760366
comment on: http://stackoverflow.com/q/24757216
type: QuestionComment
has text: Sorry, I'm new to history.js and I'm trying to understand. Is there a redirect loop you're asking how to break? What do you want to have happen? What content do you want served at which URLs? What problem are you trying to solve with history.js at all? (That is to ask, can you just not use it?)
score: 0
type: Comment

http://stackoverflow.com/q/24772078
has body: I was just testing this on javascript and noticed that each time I return a variable with a ++, it didn't return the new number. I know the ++ is added after, but shouldn't be added before returning it. When I debugged it, is showing the correct number, but when returning it doesn't. Does the interpreter executes this line after the return? If it's like that why the debugger shows the correct value? This function returns the correct number without the ++. It returns 10. function test(){ var counter=0; for(i=0;i&lt;10;i++){ counter++; } return counter; } This other function, I thought it should return 11, but it doesn't it returns 10. function test1(){ var counter=0; for(i=0;i&lt;10;i++){ counter++; } return counter++; } Demo showing this example.
duplicate of: http://stackoverflow.com/q/3469885
answer count: 3
has title: Why the debugger shows one value and when returning number++ doesn't returns the correct number javascript
possible better answer: http://stackoverflow.com/a/24772101
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/24772102
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/24772102
has answer: http://stackoverflow.com/a/24772103
linked to: http://stackoverflow.com/q/3469885
has answer: http://stackoverflow.com/a/24772101
tagged with: javascript

http://stackoverflow.com/q/24755188
tagged with: javascript
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38408470
has comment: http://stackoverflow.com/comment/38446369
tagged with: angularjs-ng-repeat
has body: Im trying to count an array length from a second query inside a ng-repeat. This is my html: &lt;tbody&gt; &lt;tr ng-repeat="j in jobpositions | filter:searchString | orderBy:'startdate'"&gt; &lt;td ng-init="applications(j.id)"&gt;{{jobapplicationsperjob.length}}&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; Here is the function: $scope.applications = function(jid){ var JobapplicationsPerJob = $resource('/ats/services/jobapplicationsperjob/:jid'); $scope.jobapplicationsperjob = JobapplicationsPerJob.query({jid:jid}); console.log($scope.jobapplicationsperjob); } This is the console.log: [$promise: Object, $resolved: false] 0: f $promise: Object $resolved: true length: 1 __proto__: Array[0] [$promise: Object, $resolved: false] $promise: Object $resolved: true length: 0 __proto__: Array[0] [$promise: Object, $resolved: false] $promise: Object $resolved: true length: 0 __proto__: Array[0] As you can see, it twice returns a value of 1 but in the HTML it's always 0.
answer count: 0
type: UnansweredQuestion
type: Question
has title: How do I trigger function inside ng-repeat
tagged with: angularjs-ng-init
score: 0
has comment: http://stackoverflow.com/comment/38408921
has comment: http://stackoverflow.com/comment/38410166

http://stackoverflow.com/q/24824603
has answer: http://stackoverflow.com/a/24824665
has title: How can i run ajax on php codeigniter
favorite count: 0
has body: I'm trying to use javascript code on my codeIgniter project. But I didn't execute it. I tried too many ways for solve it: I called the external js code, it didn't work. I put in my view page it dind't work as well. I think the problem is simple but I can't see it. What do you think about this problem? view.php <?php include("/external/css/style.css"); ?> New Customer Customer Add list Customer Name: Customer Phone: Address: . . . conroller.php public function verifyUser() { $userName = $_POST['customerID']; $phone = $_POST['phone']; $address = $_POST['address']; if($userName=='' && $phone=11){ $status = array("STATUS"=>"true"); } echo json_encode ($status) ; } What's wrong??
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38538884
tagged with: php
has answer: http://stackoverflow.com/a/24824668
score: 1
has comment: http://stackoverflow.com/comment/38538921
tagged with: codeigniter
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/42665273
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
answer count: 3

http://stackoverflow.com/comment/38400595
score: 2
has text: @MilindAnantwar I think you're missing the point of what is being asked here.
comment on: http://stackoverflow.com/q/24751153
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38524427
score: 0
type: Comment
type: QuestionComment
has text: `get(0)` returns a `DOM` object, not a `jQuery` object, but also, since `$this` is the subject of an `.each`, no reason to use `get` since `$this` is only a single element anyway.
comment on: http://stackoverflow.com/q/24816646

http://stackoverflow.com/comment/38429433
comment on: http://stackoverflow.com/a/24765971
type: Comment
has text: Given that `ii` is supposed to be a Javascript variable, the first line *is* nonsense
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38440108
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/24772164
has text: what do you mean by cover text, the value of input should be that ?

http://stackoverflow.com/comment/45955994
has text: add :if (scope.src) elem.attr('src', "'"+scope.src+"'"); to support ng-include
type: AnswerComment
comment on: http://stackoverflow.com/a/28842957
score: 0
type: Comment

http://stackoverflow.com/comment/38603130
has text: I am beginner and have no idea about this..
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24858188

http://stackoverflow.com/comment/38600210
has text: Thanks! I tried your code and it works.But why didn't my version work? I'm still learning JS, and I haven't learn reverse() method
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24856599

http://stackoverflow.com/q/24785544
has answer: http://stackoverflow.com/a/24786124
accepted answer: http://stackoverflow.com/a/24786124
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38466643
possible better answer: http://stackoverflow.com/a/24785709
tagged with: css
tagged with: onclick
has body: I made 2 bars which should behave identically when you click to minimize / restore. While the footer bar works 100% as it should, the restore button in the header doesn't show after minimizing + restoring for the 1st time. Interestingly, it's still functional, but the restore button is invisible and mainly outside of the screen. I don't know why that happens. http://jsfiddle.net/YMeRQ/ $('.minimize').click(function(){ $(this).animate({'z-index':'-1', 'opacity':'0'}, {duration : 200}); $(this).parent('.bar').animate({'height':'20px'}, {duration : 200}); $(this).siblings('.restore').animate({'z-index':'10000', 'opacity':'1'}, {duration : 200}); }); $('.restore').click(function(){ $(this).parent('.bar').animate({'height':'40px'}, {duration : 200}); $('#restore-h') &gt; $(this).animate({'z-index':'-1', 'bottom':'1px', 'opacity':'0'}, {duration : 200}); $('#restore-f') &gt; $(this).animate({'z-index':'-1', 'top':'1px', 'opacity':'0'}, {duration : 200}); $(this).siblings('.minimize').animate({'z-index':'10000', 'opacity':'1'}, {duration : 200}); });
has comment: http://stackoverflow.com/comment/38466548
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24785709
tagged with: javascript
type: Question
score: 0
answer count: 2
tagged with: jquery
has title: div inside header / near page top / doesn't show after 2 click events, while it's footer twin works - jquery

http://stackoverflow.com/a/24891274
answers question: http://stackoverflow.com/q/24891143
has body: If you're not rendering that HTML from a different place somehow (which I haven't seen happening thus far) then there's no difference, just make sure you're not declaring it twice by accident (once in the $routeProvider and another in the HTML).
upvote count: 1
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/comment/38494412
score: 0
type: Comment
type: QuestionComment
has text: If I add the margin when I see the menu with the toggle button the last item in the list is 5px close to the bottom respect the first one
comment on: http://stackoverflow.com/q/24800494

http://stackoverflow.com/a/24997899
downvote count: 0
has body: Check out the structure of the cssmin task --> cssmin module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), concat: { css: { src: [ 'static/css/*' ], dest: 'combined.css' }, js : { src : [ 'static/js/*' ], dest : 'combined.js' } }, cssmin : { combine: { files: { 'combined.min.css': ['combined.css'] //&lt;---- Looks like it was a error in the usage of grunt-contrib-cssmin } } }, uglify : { js: { files: { 'combined.js' : [ 'combined.min.js' ] } } } }); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-cssmin'); grunt.registerTask('default', [ 'concat:css' , 'cssmin:css' , 'concat:js' , 'uglify:js' ]); };
answers question: http://stackoverflow.com/q/24867928
type: Answer
has comment: http://stackoverflow.com/comment/38866242
has comment: http://stackoverflow.com/comment/38873162
has comment: http://stackoverflow.com/comment/38866668
has comment: http://stackoverflow.com/comment/38866430
score: 1
upvote count: 1

http://stackoverflow.com/comment/38457975
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24781552
has text: ill make them actual links

http://stackoverflow.com/comment/38576437
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/24836016
has text: Yes, I answered you (since the bottom line question was "What am I doing wrong?"). And I even explained you how to solve it (by coding it yourself, using `findText` and then built-in string `replace`). There's no easy way. Just to clarify, asking for ready programs/functions is not a programming doubt, which is StackOverflow's scope. If you attempt to code it yourself and get stuck, then you should open a new question.

http://stackoverflow.com/q/24867928
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/24949239
has answer: http://stackoverflow.com/a/24997899
has comment: http://stackoverflow.com/comment/38621523
tagged with: gruntjs
has answer: http://stackoverflow.com/a/25009218
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Grunt CSS minifier call stack exceeded
type: Question
accepted answer: http://stackoverflow.com/a/25009218
has comment: http://stackoverflow.com/comment/38780540
score: 1
has body: First time using grunt. Been able to concat and minify some javascript. When I attempt to do the same thing with CSS I get the following error: λ git master* → grunt cssmin Running "cssmin:css" (cssmin) task &gt;&gt; RangeError: Maximum call stack size exceeded Warning: CSS minification failed. Use --force to continue. Aborted due to warnings. Why could this be happening? package.json { "name" : "Thing", "title" : "Concatentation + Minification", "version" : "1.0.0", "devDependencies": { "grunt": "0.4.5", "grunt-contrib-concat": "0.5.0", "grunt-contrib-cssmin" : "0.10.0", "grunt-contrib-watch" : "0.6.1", "grunt-contrib-uglify" : "0.5.0" } } Gruntfile.js module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), concat: { css: { src: [ 'static/css/*' ], dest: 'combined.css' }, js : { src : [ 'static/js/*' ], dest : 'combined.js' } }, cssmin : { css:{ src: 'combined.css', dest: 'combined.min.css' } }, uglify : { js: { files: { 'combined.js' : [ 'combined.js' ] } } } }); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-cssmin'); grunt.registerTask('default', [ 'concat:css' , 'cssmin:css' , 'concat:js' , 'uglify:js' ]); };
possible better answer: http://stackoverflow.com/a/24949239

http://stackoverflow.com/comment/38419237
type: Comment
has text: You don't have the breaker. It will increase `fileCounter`, and increase, and increase...
comment on: http://stackoverflow.com/a/24760976
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38623810
type: AnswerComment
has text: @frenchie Thanks. I tried it. But it's so weird that it won't show the ad:( if I just paste ' ...' directly to inside of that shows fine:(
type: Comment
comment on: http://stackoverflow.com/a/24868619
score: 0

http://stackoverflow.com/q/24833926
tagged with: regex
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/24836016
accepted answer: http://stackoverflow.com/a/24836016
upvote count: 3
type: Question
tagged with: google-apps-script
tagged with: javascript
has body: I know there are many similar questions and answers out there but I have had no luck. I simply want to run a regex on a Google Doc and have it replace what it finds with Uppercase. I have a working regular expression, and a simple string replace works, but I can't get a regex of any kind to work. What am I doing wrong? function searchAndReplace() { var bodyElement = DocumentApp.getActiveDocument().getBody(); var regExp = new RegExp(/[\n][\n]([^\n]+)[\n][^\n|\s]/gim); bodyElement.replaceText(regExp, '$1'.toUpperCase()); }
has title: Google Apps Script/Javascript search and replace with regex not working
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/a/70577655
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24765710
has body: You can use this method const splitCode = (strValue, space) =&gt; { let outPutArray = []; let temp = ''; for(let i= 0; i&lt; strValue.length; i++){ let temp2 = ''; for(let j= i; j&lt;space.length+i;j++){ temp2 = temp2+strValue[j]; } if(temp2 === space){ outPutArray.push(temp); i=i+space.length-1; temp = ''; }else{ temp = temp+strValue[i]; } } return outPutArray.concat(temp) }

http://stackoverflow.com/q/24871304
has comment: http://stackoverflow.com/comment/38627979
type: Question
has answer: http://stackoverflow.com/a/24871374
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24871367
accepted answer: http://stackoverflow.com/a/24871374
has answer: http://stackoverflow.com/a/24871367
answer count: 2
downvote count: 0
favorite count: 0
has title: Javascript function doesn't break on return?
tagged with: return
tagged with: break
has body: I know you are supposed to be able to break out of an each statement by returning, which is what I'm trying to do, but I must be doing something wrong and it seems so simple I can't find it. I have code like this function create() { var test = hasThing(); if (test) { $('#myForm').submit(); } else { alert('you suck!') } } function hasThing() { $('.selects').each(function() { if (this.value != "") { return true; } }); return false; } I have set breakpoints on "return true;" and hit it but var test is always false because for some reason the .each() loop continues and the hasThing() function continues. I've tried switching things around so that I return false in the .each() just in case for some reason that mattered but it didn't change anything. I don't get it. Seems counter to how the documentation says it should work.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38627867
score: 7
tagged with: loops
upvote count: 7

http://stackoverflow.com/comment/38519442
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24813881
has text: Yes through ng-repeat
score: 0

http://stackoverflow.com/a/24870218
upvote count: 1
has body: First of all, there seems to be a missing quotation mark after defining your search_text_# id id='search_text_"+(find_match_id)+" onkeyup='findmatch(" Should have a single quote here _________^ id='search_text_"+(find_match_id)+"' onkeyup='findmatch(" Second, the .click() function is only initialized on your very first button, you create other buttons but never assign a new click handler to it. You will have to find the button and assign a click handler to it right after your append. You can also use a wider scoped 'bind' method to just bind all buttons current or future to your callback, it would look something like this: $('body').on('click', '[id^="btn"]', function() { .. your append logic .. }); the selector syntax 'id^=' implies that the id should start with the following value, so any element starting with the id 'btn' will be handled by this click handler.
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24870072
score: 1

http://stackoverflow.com/q/24883619
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38658281
has comment: http://stackoverflow.com/comment/38664329
has answer: http://stackoverflow.com/a/24891750
has comment: http://stackoverflow.com/comment/38664906
type: Question
tagged with: canvas
tagged with: javascript
has title: Drawing on lots of canvas elements without losing responsiveness
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38666485
has body: I am drawing on a lot of canvas elements one after the other. The functions are computationally expensive. If there are 15 canvas elements, the page doesn't show anything until all the canvas drawings have finished. This results in people getting messages on their browser about the script taking too long to execute. Also during this process the page remains unresponsive. I want suggestions on how to solve the following 2 problems - 1) I want to show a canvas as soon as it is completely drawn. I don't want the user to wait for drawings to finish on 15 canvas elements. 2) I want to make the page responsive while the computation is happening.

http://stackoverflow.com/comment/38489156
has text: This question should be closed because it was caused by a problem that can no longer be reproduced.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24797809
score: 0

http://stackoverflow.com/comment/38480546
has text: Stephen I agree with you, on the long run having variables with descriptive names improves code readability and maintainability. Please read the comment I left under @Code-Apprentice's question. In there I suggested a scenario where the use of a variable might not be necessary.
comment on: http://stackoverflow.com/a/24793020
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/24810621
has answer: http://stackoverflow.com/a/24811097
has body: How to convert this CSV object to array or JSON . Thanks var obj = 3;ID;NAME;
has title: How to decode CSV to Array? Javascript
favorite count: 0
has answer: http://stackoverflow.com/a/24810734
tagged with: http://stackoverflow.com/tag/csv
has comment: http://stackoverflow.com/comment/38512695
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38512712
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/24810737
has comment: http://stackoverflow.com/comment/38513803
accepted answer: http://stackoverflow.com/a/24810734
type: Question
has comment: http://stackoverflow.com/comment/38513934
tagged with: javascript
score: -4
has comment: http://stackoverflow.com/comment/38512681
downvote count: 4
answer count: 3
possible better answer: http://stackoverflow.com/a/24811097
has comment: http://stackoverflow.com/comment/38513856
upvote count: 0

http://stackoverflow.com/comment/38455656
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24776340
score: 0
has text: I tried that before. `testfun(function(){that});` seems to work since I don't get any error in firebug, but printing `arguments.toString()` shows only `{}`

http://stackoverflow.com/q/24818970
has answer: http://stackoverflow.com/a/24819114
score: 2
downvote count: 0
has title: Accented chars are not retrieved correctly
tagged with: google-chrome
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/24820527
tagged with: javascript
tagged with: jquery
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has body: I encountered this strange issue today. We have an email field in our page, and if a user enters: specialcharacter123@eñe.es Then only in case of Chrome I am getting specialcharacter123@xn--ee-zja.es : I tried: jQuery('#email').val() And document.getElementById('email').value Both gave me same results. ( It is working fine in Safari ). Also I already have this in the page: &lt;meta charset="utf-8" /&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; I am unable to get any clue what's wrong here.
favorite count: 0
has answer: http://stackoverflow.com/a/63757364
type: UnansweredQuestion

http://stackoverflow.com/comment/38466950
type: Comment
comment on: http://stackoverflow.com/a/24778335
has text: Ah yeah sorry I just copied you example for the bulk of the code in my example. Glad you fixed it.
type: AnswerComment
score: 0

http://stackoverflow.com/q/24853481
answer count: 2
accepted answer: http://stackoverflow.com/a/24853539
tagged with: function
tagged with: javascript
has answer: http://stackoverflow.com/a/24853769
has comment: http://stackoverflow.com/comment/38594452
possible better answer: http://stackoverflow.com/a/24853769
has comment: http://stackoverflow.com/comment/38593723
tagged with: variable-assignment
has body: Is there a shortcut for myVar = myFunction(myVar); ? Similar to myVar+=2; instead of myVar=myVar+2; Thanks!
has comment: http://stackoverflow.com/comment/38593715
has title: Replacing a variable with function(variable)
score: 0
has answer: http://stackoverflow.com/a/24853539
type: AnsweredQuestion
type: Question

http://stackoverflow.com/a/24768527
score: 3
downvote count: 0
has body: The example you copied from was not complete. The script at the bottom is defining an element called note-list, but they omitted the part where they began the element's definition. See this jsbin for a working version of your code. Two takeaways: Polymer('note-list', ... is only useful if you also create a polymer-element definition. To use Polymer's declarative event handling you must use the on-[event] syntax (notice the dash) and use handlebars {{ }} around the handler name in the attribute value.
has comment: http://stackoverflow.com/comment/38433351
accepted answer of: http://stackoverflow.com/q/24754803
answers question: http://stackoverflow.com/q/24754803
type: AcceptedAnswer
upvote count: 3
type: Answer

http://stackoverflow.com/q/24873261
has body: Scenario I have these two Cloud Functions that I want to use in my application. They check for the online status of the user and I want to set a boolean key "isOnline" for each user to YES if the user is online and to NO if they are not. var moment = require("moment"); Parse.Cloud.define("registerActivity", function(request, response) { var user = request.user; user.set("lastActive", new Date()); user.save().then(function (user) { response.success(); }, function (error) { console.log(error); response.error(error); }); }); Parse.Cloud.define("getOnlineUsers", function(request, response) { var userQuery = new Parse.Query(Parse.User); var activeSince = moment().subtract("minutes", 2).toDate(); userQuery.greaterThan("lastActive", activeSince); userQuery.find().then(function (users) { response.success(users); }, function (error) { response.error(error); }); }); Problem I am not the best with Javascript, and because of that I need some help getting my head around what is happening/what I'm supposed to do. Questions 1) When do I call "registerActivity" and "getOnlineUsers" inside my Xcode project? 2) Is "response.success(users)" just an array of PFUser Objects? 3) If "2)" is true, then how do I set the bool key "isOnline" for all of the users in the "response.success(users)" to YES if they are in the array?
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
has title: Parse iOS SDK: Calling Cloud Functions From Xcode
tagged with: cloud
tagged with: ios
has answer: http://stackoverflow.com/a/24878972
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
tagged with: parse-platform
accepted answer: http://stackoverflow.com/a/24878972

http://stackoverflow.com/comment/38498456
has text: Can you post example of wrong `baseUrl` resolving?
comment on: http://stackoverflow.com/q/24782877
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38639110
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24811958
score: 0
has text: The standard setting on all browsers (best of my knowledge) is to allow 3rd parties to store data. **If this setting is not allowed, no workaround exists.** You can look at cookies, JStorage, doesn't matter. The browsers will not allow any data saves. This is a lock-down mode.

http://stackoverflow.com/q/24832905
tagged with: hashtag
type: Question
tagged with: anchor
has comment: http://stackoverflow.com/comment/38596014
has comment: http://stackoverflow.com/comment/38595746
has title: Showing specific anchors for each pictures of a lightbox in URL bar
accepted answer: http://stackoverflow.com/a/24854718
has comment: http://stackoverflow.com/comment/38595646
score: 0
has comment: http://stackoverflow.com/comment/38612029
has comment: http://stackoverflow.com/comment/38602480
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24854718
tagged with: http://stackoverflow.com/tag/html
has body: I have a lightbox where each pictures has an anchor. But the anchor doesn't show the specific ID for each pictures, it appears like this in the URL bar : www.mywebsite.com/gallery.php#example/1 www.mywebsite.com/gallery.php#example/2 www.mywebsite.com/gallery.php#example/3 So, I wonder if it's possible to show in the URL bar the specific ID : www.mywebsite.com/gallery.php#bird www.mywebsite.com/gallery.php#dog www.mywebsite.com/gallery.php#cat Any ideas ? Thanks. Html Script $('#my-gallery li a').iLightBox({ skin: 'dark', path: 'horizontal', fullViewPort: 'fill', infinite: true, linkId: 'example', overlay:{ opacity: 1, blur: false }, controls: { thumbnail: false }, styles: { nextOffsetX: -45, prevOffsetX: -45 } });
type: AnsweredQuestion

http://stackoverflow.com/comment/38528192
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24818441
has text: This would be not much different from nested `if`

http://stackoverflow.com/comment/38518751
comment on: http://stackoverflow.com/a/24813354
score: 0
type: AnswerComment
type: Comment
has text: if his current script works the first time around, it's serving *something* so i'd bet on iframes working.

http://stackoverflow.com/comment/38483139
comment on: http://stackoverflow.com/a/24794573
has text: @Nolo— *isNaN* returns true for any non–number value (e.g. `isNaN('foo') === true`), it doesn't just test for the *NaN* value.
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/comment/38626562
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24870492
has text: I'd use native promises and use `Promise.all` which has semantics which are a lot better.
score: 0

http://stackoverflow.com/comment/38466471
type: Comment
comment on: http://stackoverflow.com/q/24785859
score: 0
type: QuestionComment
has text: @WilliamBarbosa I've tried that one but says window is not defined

http://stackoverflow.com/q/24766310
upvote count: 1
type: Question
score: 1
has body: I am currently trying to add a clearing light box to a nested small box grid, but the lightbox does not load at all.The page continues to load as if I had not made any changes. I have gone through and tried some CSS solutions to no avail. I also made sure I was calling the correct JS files. I am using foundation 5.3 and I have added my current code. Any direction would be greatly appreciated. <!--[if IE 8]> <![endif]--> <!--[if gt IE 8]><!--> <!--<![endif]--> Foundation 4 Our Featured Artists Each Featured Artist has an opportunity to speak at the conference to share his or her vision, perspective, and techniques with conference attendees. It is truly an honor to be a CAC Featured Artist and many past students artists who were featured at CAC have gone on to brilliant careers in art.
accepted answer: http://stackoverflow.com/a/24791593
has title: Zurb Data clearing not working on small block grid
tagged with: zurb-foundation
tagged with: lightbox
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24791593

http://stackoverflow.com/a/25668010
has body: You should enable file access from within pages. Use this setting: webView.getSettings().setAllowFileAccessFromFileURLs(true); Edit: This setting is valid from SDK version 16.
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/24850692
upvote count: 2

http://stackoverflow.com/comment/38463970
has text: not clear with your this part `how does the form know`? however if you want explanation then its as follows.. when you submit your form `onsubmit` calls your JS function `validate()` if value returned is true then form is submitted else its not. Form doesn't have any idea about what you are doing in the JS function. You have to write code as per your requirement in order to return your value on form submit.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24784292
type: Comment

http://stackoverflow.com/comment/38570569
score: 0
type: AnswerComment
type: Comment
has text: @blex According to the jQuery docs, that will only work in some browsers in the best case.
comment on: http://stackoverflow.com/a/24841376

parallel-coordinates
tags question: http://stackoverflow.com/q/24826932
tags question: http://stackoverflow.com/q/24811850
tags question: http://stackoverflow.com/q/24834293
tag name: parallel-coordinates
type: Tag

http://stackoverflow.com/a/24827602
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/24827446
downvote count: 0
has comment: http://stackoverflow.com/comment/38592064
has comment: http://stackoverflow.com/comment/38545844
has body: If it doesn't have to be automated, try using built-in Developer tools to measure the response each upload/download takes: IE 8: http://msdn.microsoft.com/en-us/library/dd565628(v=vs.85).aspx Firefox 3.6 (using Firebug): https://addons.mozilla.org/en-US/firefox/addon/firebug/ These work similarly to the Chrome browser Developer Tools, and can help track response times of live sites
type: Answer
has comment: http://stackoverflow.com/comment/38545072

http://stackoverflow.com/comment/38673685
comment on: http://stackoverflow.com/a/24889908
score: 0
type: AnswerComment
type: Comment
has text: Thanks, just wanted to make sure, seeing as though it's rather weird. Also, I'm using Identities 2.0, which defaults to a string ID (which is why I'm trying to get it in quotes)

http://stackoverflow.com/a/24793656
upvote count: 1
answers question: http://stackoverflow.com/q/24792969
score: 1
accepted answer of: http://stackoverflow.com/q/24792969
has body: The behavior will change according to the webproxy. Some web proxies try to parse the URL's included in the Javascript code on the page however it fails when there is no semicolon at the end of the line. You have a missing semicolon at document.Form1.action = "http://translation.babylon.com/" I added a semicolon and the proxies you mentioned worked fine with the jsFiddle Demo: http://jsfiddle.net/UXCb9/28/ With Proxy: http://www.superbproxy.com/browse.php?u=http://jsfiddle.net/UXCb9/28/
downvote count: 0
has comment: http://stackoverflow.com/comment/38481746
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/38440913
comment on: http://stackoverflow.com/a/24772432
has text: @Ivory, please tell me what am I missing here?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38565322
has text: @Grundy yes of course
comment on: http://stackoverflow.com/q/24838604
score: 0
type: Comment
type: QuestionComment

dialog
tag name: dialog
tags question: http://stackoverflow.com/q/24771681
type: Tag
tags question: http://stackoverflow.com/q/24861078
tags question: http://stackoverflow.com/q/24785153

http://stackoverflow.com/comment/38617259
has text: @NickDugger that's what `onbeforeunload` is for. It executes when the user closes the tab (That's how _Do you really want to leave this page?_ messages work.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24865561

http://stackoverflow.com/comment/38659810
type: QuestionComment
type: Comment
has text: @ShovanSahu But if it's client side, the user can modify it to make more requests. The browser is always in the hands of the enemy.
comment on: http://stackoverflow.com/q/24887079
score: 0

http://stackoverflow.com/comment/38500667
score: 0
has text: The above code return NaN
type: Comment
comment on: http://stackoverflow.com/a/24804307
type: AnswerComment

http://stackoverflow.com/q/24887406
score: 0
answer count: 2
has body: I've looked far and wide but couldn't figure this out: How can I use two modifiers, say i and g, with String.prototype.match()? I have this: var spChar = string.match(/[.:hm]/g); How can I add the i modifier too?
accepted answer: http://stackoverflow.com/a/24887439
tagged with: regex
possible better answer: http://stackoverflow.com/a/24887431
has title: Two modifiers with String.prototype.match()
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24887431
has answer: http://stackoverflow.com/a/24887439
type: Question
tagged with: javascript

http://stackoverflow.com/q/24872078
upvote count: 1
accepted answer: http://stackoverflow.com/a/24872468
type: AnsweredQuestion
score: 1
type: Question
downvote count: 0
tagged with: javascript
has body: I am working in a project based in Sencha 2.3.1 but It´s not working the button with ItemID but it´s correctly working with the ID property.. What is the mistake?? Thanks!!
tagged with: extjs
has title: What´s the difference in between id and itemID in Sencha Touch?
has answer: http://stackoverflow.com/a/24872468
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/38630042
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24872120
score: 1
has text: will have an easier time using angular-ui directives for bootstrap. Easy to pass data to modalController http://angular-ui.github.io/bootstrap/ You would select record the same way you are doing, but have form scope in modalController

http://stackoverflow.com/comment/38600421
has text: Can you show a relevant parts of the html code?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24856729

http://stackoverflow.com/comment/48571919
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24896557
type: AnswerComment
has text: From IE9 forward and for all other browsers you use createEvent() and dispatchEvent() rather than createEventObject and fireEvent(). The leading 'on' in the event name is also dropped. See http://stackoverflow.com/a/2490876/921640

http://stackoverflow.com/a/24805269
has body: Instead of document.write, add the text to a div element: function q() { var div = document.getElementById("elementId"); div.innerHTML = "this selection has no data"; }
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24805119
answers question: http://stackoverflow.com/q/24805119
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38541631
has comment: http://stackoverflow.com/comment/38505590
type: Answer
has comment: http://stackoverflow.com/comment/38550211
score: 1
upvote count: 1

http://stackoverflow.com/comment/38580531
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24846691
score: 0
has text: Brilliant that solves that just need to work out why Ajax won't put an alert back to page without refreshing. At the moment it goes to the email.php as a page when submit button is clicked

http://stackoverflow.com/q/24780058
score: 1
type: Question
downvote count: 0
tagged with: javascript
has title: mailto launches the default mail client outlook but then current tab closes
upvote count: 1
has body: I am using IE8. var ClientContactsTable = document.getElementById("clientContacts"); var TableRow = ClientContactsTable.insertRow(1); var Email=TableRow.insertCell(0); Email.setAttribute("className","CellValueWrap"); Email.innerHTML='My Name'==''?"&amp;nbsp;":"&lt;a class='ReportLink' target='_blank' href='mailto:"+'me@gmail.com'+"'&gt;"+"My Name"+"&lt;/a&gt;"; alert(Email.innerHTML); When I am clicking on My Name - it launches Outlook, asks for permission (whether you want to launch the outlook client or not), once I do Allow it launches Outlook and then the tab which was running my app displays the address as me@gmail.com with blank content. then I have to do a back to go to my app page. this is surely disappointing for my users. This issue does not happen in Firefox. How to avoid it? I tried both target='_blank' as well as _self but both causing same problem
tagged with: mailto
favorite count: 0
type: UnansweredQuestion
tagged with: anchor
answer count: 0

http://stackoverflow.com/q/24825044
has comment: http://stackoverflow.com/comment/38541953
possible better answer: http://stackoverflow.com/a/42218140
has answer: http://stackoverflow.com/a/42218140
linked to: http://stackoverflow.com/q/2219526
tagged with: google-chrome
tagged with: google-chrome-storage
accepted answer: http://stackoverflow.com/a/24825955
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38542002
has answer: http://stackoverflow.com/a/24825955
has title: Why do I get a QUOTA_BYTES_PER_ITEM error for strings that are not too long?
type: Question
has comment: http://stackoverflow.com/comment/38540821
answer count: 2
upvote count: 1
tagged with: javascript
favorite count: 0
tagged with: google-chrome-extension
has body: I've got an object that represents playlist in my extension and I need to save it to chrome.storage.sync. I know about 4096 QUOTA_BYTES_PER_ITEM, that means key.length + JSON.stringify(val).length must be less than 4096. but my object is 3956 (val stringify length + ket length), and I still can't write it to the storage. What am I doing wrong? My object JSON stringification result: {"playlist":{"state":{"tracks":[{"artist":"In Flames","title":"Delight And Angers (Instrumental)"},{"artist":"Marilyn Manson","title":"Coma Black"},{"artist":"Red Hot Chili Peppers","title":"Can't Stop"},{"artist":"Jack Johnson","title":"Better Together (Hawaiian Version)"},{"artist":"Joel Nielsen","title":"Surface Tension 2"},{"artist":"Katatonia","title":"Deliberation"},{"artist":"Rev Theory","title":"Hell Yeah"},{"artist":"Die drei Friseure ","title":"Parikmaher"},{"artist":"In Flames","title":"Drenched in Fear"},{"artist":"In Flames","title":"A New Dawn"},{"artist":"Before The Dawn","title":"The First Snow/Winter Within"},{"artist":"Corey Taylor &amp; James Root","title":"Zzyzx Road"},{"artist":"In Flames","title":"Ropes"},{"artist":"In Flames","title":"Come Clarity"},{"artist":"Jack Johnson","title":"Better Together"},{"artist":"In Flames","title":"Crawl Through Knives"},{"artist":"Ленинград","title":"День Рождения.а я вот день рожденье не буду справлять!"},{"artist":"Ellen McLain","title":"Still Alive"},{"artist":"Richard Cheese","title":"People Equals Shit "},{"artist":"Papa Roach","title":"Last Resort"},{"artist":"Killswitch Engage","title":"The End of Heartache"},{"artist":"Sonic Syndicate","title":"Denied"},{"artist":"Trivium","title":"Pull Harder On The Strings Of Your Martyr"},{"artist":"Bon Jovi","title":"Last Man Standing"},{"artist":"Jelonek","title":"Beast"},{"artist":"Gorillaz","title":"Feel Good Inc"},{"artist":"Five Finger Death Punch","title":"Falling In Hate"},{"artist":"Metallica","title":"The Memory Remains (Live)"},{"artist":"Richard Z. Kruspe","title":"Wake up"},{…

http://stackoverflow.com/a/24847271
has comment: http://stackoverflow.com/comment/38581636
upvote count: 3
has comment: http://stackoverflow.com/comment/38581770
has body: I wrote a quick not-so-quick solution. The one problem you might want to consider is whether a property from an object in the second array should override the same property, if present, in the second object it's being compared to. Solution 1 This solution is of complexity O(n²). Solution 2 is much faster; this solution is only for those who don't want to be Sanic the Hedgehog fast. JavaScript var mergeByKey = function (arr1, arr2, key) { // key is the key that the function merges based on arr1.forEach(function (d, i) { var prop = d[key]; // since keys are unique, compare based on this key's value arr2.forEach(function (f) { if (prop == f[key]) { // if true, the objects share keys for (var x in f) { // loop through each key in the 2nd object if (!(x in d)) // if the key is not in the 1st object arr1[i][x] = f[x]; // add it to the first object // this is the part you might want to change for matching properties // which object overrides the other? } } }) }) return arr1; } Test Case var arr = [ {'key':1, 'property1': 'x'}, {'key':2, 'property1': 'y'} ], arr2= [ {'key':2, 'property2': 'a'}, {'key':1, 'property2': 'b'} ]; console.log(mergeByKey(arr, arr2, "key")); Results /* returns: Object key: 1 property1: "x" property2: "b" __proto__: Object and Object key: 2 property1: "y" property2: "a" __proto__: Object */ fiddle Solution 2 As Vivin Paliath pointed out in the comments below, my first solution was of O(n²) complexity (read: bad). His answer is very good and provides a solution with a complexity of O(m + n), where m is the size of the first array and n of the second array. In other words, of complexity O(2n). However, his solution does not address objects within objects. To solve this, I used recursion—read: the devil, just like O(n²). JavaScript var mergeByKey = function (arr1, arr2, key) { var holder = [], storedKeys = {}, i = 0; j = 0; l1 = arr1.length, l2 = arr2.length; var merge = function (obj, ref) { for (var x in obj) { if (!(x in ref || x instanceof Object))…
has comment: http://stackoverflow.com/comment/38581831
type: Answer
has comment: http://stackoverflow.com/comment/38582022
has comment: http://stackoverflow.com/comment/38581779
has comment: http://stackoverflow.com/comment/38581911
score: 3
has comment: http://stackoverflow.com/comment/38581977
downvote count: 0
has comment: http://stackoverflow.com/comment/38582009
accepted answer of: http://stackoverflow.com/q/24847190
has comment: http://stackoverflow.com/comment/38581871
has comment: http://stackoverflow.com/comment/38581806
answers question: http://stackoverflow.com/q/24847190
has comment: http://stackoverflow.com/comment/38581789
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38581596

http://stackoverflow.com/comment/38504743
has text: Those events don't exist in kendo grid, so you can't just simply attach it to the grid definition like that. Also, there is a very big difference between "on" and "after" scroll, please clarify which one you want.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24773562

http://stackoverflow.com/a/24774402
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38448325
has body: The code itself works fine as you can see in this fiddle: http://jsfiddle.net/f7bwK/ But I'm noticing that you're not putting &lt;script&gt; tags around your code, is that just because you copy pasted it here, or did you really forget them? Your code should (at least) be something like: &lt;input id="execute" type="button" value="Get Details"&gt; &lt;script type="text/javascript"&gt; require([ "dojo/dom","dojo/on","dojo/domReady!" ], function( dom,on ) { function execute () { alert("here");} on(dom.byId("execute"), "click", execute); }); &lt;/script&gt; If you just didn't copy these, then verify if Dojo is loaded or not. Also, try and see if moving the execute() function above the on() function solves the problem. If these solutions do not solve your problem, open your browser console (usually F12 or Ctrl+Shift+I) and see if any error occurs.
answers question: http://stackoverflow.com/q/24774196
accepted answer of: http://stackoverflow.com/q/24774196
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38444916
type: Answer
has comment: http://stackoverflow.com/comment/38445201
has comment: http://stackoverflow.com/comment/38445262

http://stackoverflow.com/a/24792580
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24790005
answers question: http://stackoverflow.com/q/24790005
has body: I would go across this by importing jquery in the head so Then for your javascript Then for your process.php <?php file_put_contents("audio.txt", $_POST['url']); ?> and finally in your javascript add This will keep on playing the sound over and over for whoever has the page open. To avoid the complexities of checking who is online I suggest just adding another input box to clear the sound HTML: Javascript: in clear.php <?php file_put_contents("audio.txt", ""); ?>
type: Answer

http://stackoverflow.com/comment/38492284
has text: The "code" above is generated by a tool which convert svg files to raphael code :) At the moment I only want to try some effects. Later i'll put it in pretty looking OOP style :)
score: 0
comment on: http://stackoverflow.com/a/24799661
type: Comment
type: AnswerComment

http://stackoverflow.com/a/24804307
score: 1
has comment: http://stackoverflow.com/comment/38500923
upvote count: 1
answers question: http://stackoverflow.com/q/24804186
has comment: http://stackoverflow.com/comment/38500667
type: Answer
has body: try this would be helpful var diff = ( new Date("1970-1-1 " + Outtime) - new Date("1970-1-1 " + Intime) ) / 1000 / 60 / 60;
downvote count: 0

http://stackoverflow.com/comment/38677590
type: Comment
has text: Sorry about delay in replying. I tested what you have suggested and it does not seem to like the "&" signs.
comment on: http://stackoverflow.com/a/24876476
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38728289
comment on: http://stackoverflow.com/q/24887824
type: Comment
type: QuestionComment
score: 0
has text: The structure when testing locally is the same, there is a main index file and then a dist folder where the actually js files sit.

http://stackoverflow.com/q/24818216
has title: Separate properties for different animations on same object
score: 0
has answer: http://stackoverflow.com/a/24818843
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: animation
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24818843
has body: I am trying to move two wheel images towards each other using the following code: HTML: &lt;body&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"&gt;&lt;/script&gt; &lt;img class="leftwheel" src="http://exchangedownloads.smarttech.com/public/content/b3/b37268f0-9252-4c12-bb12-b5e68f582410/previews/medium/0001.png"/&gt; &lt;img class="rightwheel" src="http://exchangedownloads.smarttech.com/public/content/b3/b37268f0-9252-4c12-bb12-b5e68f582410/previews/medium/0001.png"/&gt; &lt;/body&gt; CSS: body{ background:#fff; } body &gt; img{ width:200px; } .leftwheel { float:left; -webkit-animation: rotationLeft 2s infinite linear; animation: rotationLeft 2s infinite linear; -moz-animation: rotationLeft 2s infinite linear; } @-webkit-keyframes rotationLeft { from {-webkit-transform: rotate(0deg);} to {-webkit-transform: rotate(359deg);margin-left:25%;} } @-moz-keyframes rotationLeft { from {-moz-transform: rotate(0deg);} to {-moz-transform: rotate(359deg);margin-left:25%;} } @keyframes rotationLeft { from {transform: rotate(0deg);} to {transform: rotate(359deg);margin-left:25%;} } .rightwheel { float:right; -webkit-animation: rotationRight 2s infinite linear; animation: rotationRight 2s infinite linear; -moz-animation: rotationRight 2s infinite linear; } @-webkit-keyframes rotationRight { from {-webkit-transform: rotate(0deg);} to {-webkit-transform: rotate(-359deg);margin-right:25%;} } @-moz-keyframes rotationRight { from {-moz-transform: rotate(0deg);} to {-moz-transform: rotate(-359deg);margin-right:25%;} } @keyframes rotationRight { from {transform: rotate(0deg);} to {transform: rotate(-359deg);margin-right:25%;} } DEMO Now the problem is, I want both the wheels to move towards each other, meet(collide) at the center and the movement should stop while the rotation still continues. But I have set the animation repeat as infinite since i want infinite rotation of the wheel. Can I achieve what I want just by using CSS? If not what are the javas…
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/24861840
has comment: http://stackoverflow.com/comment/38626724
answers question: http://stackoverflow.com/q/24852092
score: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/38611401
type: Answer
upvote count: 1
has body: You can try this: Usages (in main html) One Two Three footer Directive JS app.directive('datagrid', function(){ return { restrict: 'EA', scope: true, transclude: true, templateUrl: '../../datagrid.html', link: function(scope, element, attr){ var header = element.find('header').html(); element.find('header').remove(); element.find('thead').html(header); } }; }); You can write same code for footer. datagrid.html I hope this will help you.

http://stackoverflow.com/a/24787166
type: Answer
score: 1
upvote count: 1
has body: Removing the in class did not work for me in my case(though normally it should). I was just looking for the answer to this question yesterday. I used this to make the accordion default to close: $( document ).ready(function() { $('.collapse').collapse({ toggle: false }); }); See also this question on: Jquery accordion not collapse by default
downvote count: 0
answers question: http://stackoverflow.com/q/24785622

http://stackoverflow.com/comment/38602148
has text: @torazaburo - Yes, and what would you expect it to return in that case? In regular JS code, asking for a multi-level property when one of the higher level properties doesn't exist is a run-time error which is also what would happen here. The code can obviously be modified to return `undefined` or whatever other behavior the OP wants, but no behavior like that was specified or asked for so I'm unsure what the OP wants (if anything) in that regard).
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24857693

http://stackoverflow.com/comment/38627719
type: QuestionComment
has text: when in doubt, validate your json in jsonlint.com...passes fine there
score: 1
comment on: http://stackoverflow.com/q/24870976
type: Comment

reserved-words
tag name: reserved-words
type: Tag
tags question: http://stackoverflow.com/q/24785746

ecmascript-harmony
tag name: ecmascript-harmony
type: Tag
tags question: http://stackoverflow.com/q/24768166
tags question: http://stackoverflow.com/q/24804758

http://stackoverflow.com/comment/38481402
type: QuestionComment
score: 0
has text: What do you mean with "the value inputted"? do you mean the coordinates of selected cells?
comment on: http://stackoverflow.com/q/24793598
type: Comment

http://stackoverflow.com/q/24814969
tagged with: javascript
has answer: http://stackoverflow.com/a/24815241
score: 0
answer count: 1
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/38521564
has title: Node.js server won't start on windows 7 64-bit
type: Question
has body: It seems I have something very wrong with my set up, I currently have node -v //v0.10.29 installed on my windows 7 64Bit machine. // Include http module. var http = require("http"); http.createServer(function (request, response) { request.on("end", function () { response.writeHead(200, { 'Content-Type': 'text/plain' }); response.end('Hello HTTP!'); }); }).listen(8080); This is the file I have running via node http.js. There is nothing else in the folder other than this file. Running this little badboy: node-inspector &amp; node --debug http.js the following is returned in the cmd: Node Inspector v0.7.4 Visit http://127.0.0.1:8080/debug?port=5858 to start debugging. I can navigate to http://127.0.0.1:8080 and also the suggested url, navigating with debug?etc gives me a console, similar to chrome's developers tools. Navigating to the url without the params gives me Cannot GET / with the request 404'in With said headers: Remote Address:127.0.0.1:8080 Request URL:http://127.0.0.1:8080/ Request Method:GET Status Code:404 Not Found Request Headersview source Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Accept-Encoding:gzip,deflate,sdch Accept-Language:en-GB,en;q=0.8 Cache-Control:no-cache Connection:keep-alive Host:127.0.0.1:8080 Pragma:no-cache User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Chrome/35.0.1916.153 Safari/537.36 Response Headersview source Connection:keep-alive Content-Type:text/html Date:Thu, 17 Jul 2014 23:07:13 GMT Transfer-Encoding:chunked X-Powered-By:Express So how can i connect to a simple http server in node.js and windows 7

http://stackoverflow.com/a/24764290
type: Answer
has body: I think the problem arose because you were changing the class entirely instead of just adding a class; at least, it fixed the problem for me. Here's a jsfiddle I created from yours that works fine by changing the behaviour to something more like jQuery's .addClass() method - I set .className = 'txt txtError' instead of just changing it to txtError.
score: 0
answers question: http://stackoverflow.com/q/24764094

http://stackoverflow.com/a/24770556
has body: Try changing dataType to json. Even though it should infer, it's better to be explicit. $.ajax({ url: "WebForm1.aspx/OnSubmit", type: "POST", data: file, dataType: "json", contentType: "plain/text; charset=utf-8", processData: false, error: function (msg) { console.log(msg.d); alert("error"); }, success: function (msg) { console.log(msg.d); alert(file); } });
answers question: http://stackoverflow.com/q/24770212
score: 0
type: Answer

http://stackoverflow.com/a/24789477
downvote count: 0
has body: You need to use the success callback of load() so that you call your new code after the new html has been inserted $("#list").load("B.html", function(){ /* new html exists now , do what is needed to it here*/ ));
has comment: http://stackoverflow.com/comment/38476565
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38476515
answers question: http://stackoverflow.com/q/24789418
type: Answer
accepted answer of: http://stackoverflow.com/q/24789418
score: 2

http://stackoverflow.com/q/24865563
has comment: http://stackoverflow.com/comment/38617378
has answer: http://stackoverflow.com/a/24866274
accepted answer: http://stackoverflow.com/a/24866274
has title: Backbone view event handling lost after first click
type: Question
has comment: http://stackoverflow.com/comment/38617141
tagged with: javascript
tagged with: event-handling
tagged with: jquery
has comment: http://stackoverflow.com/comment/38617516
has body: I am fairly new to javascript and have a simple page which displays a shopping cart summary in the top right corner. When the update button is clicked the first time, the collection and view are updated as expected. However, subsequent clicks have no effect and there is no errors in the console. The event handling appears to be lost after the first click. I have noticed other similar problems posted on SO which point to the solution of invoking delegateEvents on the view object after .html() has been invoked. I have tried this but it has made no difference. My backbone view is: MyApp.View.Item = Backbone.View.extend({ events: { 'click #update-btn' : 'update', 'click #reset-btn' : 'reset' }, initialize: function(){ console.log('item view initialize invoked'); this.collection = new MyApp.Collection.Items(); this.listenTo(this.collection, 'add', this.display); var source = $("#cart-template").html(); this.template = Handlebars.compile(source); }, render: function(){ console.log('render invoked'); var html = this.template(this.collection); this.$el.html(html); // this.delegateEvents(); &lt;-- Tried this return this; }, display: function() { $('#cart-summary').html(this.render().el); }, update: function(e) { console.log('update invoked'); e.preventDefault(); var newItem = new MyApp.Model.Item(); newItem.setName('blah'); newItem.setPrice(20); this.collection.addItem(newItem); }, reset: function(e) { console.log('reset invoked'); e.preventDefault(); } }); My collection is MyApp.Collection.Items = Backbone.Collection.extend({ initialize: function(){ this.items = 0; this.total = 0; }, addItem: function(item) { console.log('addItem invoked'); this.items++; this.total += item.getPrice(); this.trigger('add'); } }); I am using backbone 1.1.2, jquery 2.1.1 and Chrome 35.0.1916.153. Thanks in advance.
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38617653
tagged with: backbone.js
possible better answer: http://stackoverflow.com/a/24866165
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24866165

http://stackoverflow.com/comment/38662097
type: QuestionComment
has text: I tested it on two client machines as you said and last 2 users from second machine cannot connect. So I guess you are right about the server configuration
comment on: http://stackoverflow.com/q/24889113
score: 0
type: Comment

http://stackoverflow.com/comment/38597309
type: AnswerComment
comment on: http://stackoverflow.com/a/24854367
score: 0
type: Comment
has text: @ThomasJunk: That's what he does, and which does obviously not work.

http://stackoverflow.com/q/24793907
type: Question
tagged with: charts
tagged with: highcharts
tagged with: tooltip
tagged with: javascript
tagged with: jquery
downvote count: 0
answer count: 1
has body: I am new to Highcharts. in this demo: http://www.highcharts.com/demo/3d-scatter-draggable/gray when the mouse move on one point, it shows up a tootip (popup) with default format as below: Reading x:0 y:4 z:9 I want to change and customize the information content being displayed in the tooltip and want to customize so that it displays content as below: Reading longitude:0 latitude:4 depth:9 So, can anyone can help me on this issue of customizing the content of tooltip? Thank you in advance.
has answer: http://stackoverflow.com/a/24795627
favorite count: 0
has title: Highcharts - how to set custom content in point tooltip (popup) on 3D scatter chart or how to customize point tooltip information?
upvote count: 2
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24795627

asp.net-mvc-3
tags question: http://stackoverflow.com/q/24779726
tags question: http://stackoverflow.com/q/24764732
tags question: http://stackoverflow.com/q/24881840
tag name: asp.net-mvc-3
type: Tag
tags question: http://stackoverflow.com/q/24770422

http://stackoverflow.com/a/24814854
has body: btw, you have two class="" inside each element. you can check if element is visible by $('#some_id').is(":visible")
has comment: http://stackoverflow.com/comment/38645260
score: 0
answers question: http://stackoverflow.com/q/24814677
type: Answer

http://stackoverflow.com/a/24765386
score: 0
accepted answer of: http://stackoverflow.com/q/24764693
answers question: http://stackoverflow.com/q/24764693
has body: Here's a possible solution: &lt;script type="text/javascript"&gt; $(document).ready(function() { var isEdit = false; $('input').change(function() { isEdit = true; }); function checkIsEdit() { if(isEdit) return "You have modified some content. Please save this form."; } window.onbeforeunload = checkIsEdit; $(document).submit(function(){ isEdit = false; }); }); &lt;/script&gt; (Based on http://www.webstuffshare.com/2010/03/code-snippet-jquery-confirm-before-exit/)
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/24825489
score: 0
has comment: http://stackoverflow.com/comment/38540518
has comment: http://stackoverflow.com/comment/38542955
has comment: http://stackoverflow.com/comment/38540531
type: Answer
has comment: http://stackoverflow.com/comment/38540595
has body: Use this. This will work as you want $('input').width('10px').keydown(function(){ $('#a').remove(); $(this).after('&lt;span id="a"&gt;'+$(this).val()+'&lt;/span&gt;'); $(this).width($('#a').width()); });; ** Use same font in field and HTML page.
answers question: http://stackoverflow.com/q/24825395

http://stackoverflow.com/comment/38451265
type: Comment
comment on: http://stackoverflow.com/a/24764343
has text: If you don't mind I would like to publish this in the Github forum @ezanker
type: AnswerComment
score: 0

http://stackoverflow.com/q/24787309
has answer: http://stackoverflow.com/a/24790632
score: 1
has comment: http://stackoverflow.com/comment/38474279
type: Question
has comment: http://stackoverflow.com/comment/38474304
answer count: 1
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24790632
tagged with: haml
has comment: http://stackoverflow.com/comment/38471846
has comment: http://stackoverflow.com/comment/38474807
favorite count: 0
tagged with: backbone.js
has title: Rendering a dropdown Menu in Backbone
has body: I am new to Backbone and am trying to stumble my way through it. At the moment I have a view that renders a json hash into a dropdown menu. When I inspect the element in the browser I can actual view the UL element with all of the JSON rendered into a list, yet nothing visually appears in the browser. It should be noted that I am using twitter bootstrap to build the dropdown menu. Any help is much appreciated. App.Views.FilterView = Backbone.View.extend({ initialize: function(){ _.bindAll(this, 'render'); this.$button = this.$('.dropdown'); this.listenTo(this.collection, 'sync', this.render); }, render: function(){ html = _.template(this.template()); this.$el.html(html); }, template: function() { var criteria = initial_data.criteria_hash.servers.criteria; var list = ""; for(var i = 0; i &lt; criteria.length; i++){ list += "&lt;li role=\"presentation\"&gt;" + criteria[i] + "&lt;/li&gt;"; } return "&lt;ul class='criteria-list dropdown-menu' role=\"menu\"&gt;" + list + "&lt;/ul&gt;"; } }); Here is the HAML: %h2.beta Reports .criteria-container .dropdown %button.btn.btn-default.dropdown-toggle{"data-toggle" =&gt; "dropdown"} Search Criteria %span.caret
upvote count: 1
tagged with: ruby-on-rails
type: AnsweredQuestion

http://stackoverflow.com/q/24809336
has comment: http://stackoverflow.com/comment/43580634
type: UnansweredQuestion
upvote count: 4
downvote count: 0
type: Question
tagged with: protractor
linked to: http://stackoverflow.com/q/20959748
tagged with: javascript
score: 4
has body: I have a button that once clicked sends out an AJAX call in Angular's $promise format. When the login is successful, a $scope variable is changed and an element that looks like: &lt;section id="logged-in-section" ng-if="auth.user !== null"&gt; // Section to display if logged in &lt;/section&gt; is displayed. I am currently testing the above with the following: loginButton.click(); browser.sleep(2000); expect($("#logged-in-section").isDisplayed()).toBeTruthy(); browser.sleep(2000) idles the browser for two seconds before Protractor checks to see if logged-in-section has been displayed. If I take out browser.sleep(2000), the test fails since there is a lag between hitting the login button and the response returned from the server. What's the syntax to chain the login button to the expect statement so that Protractor is only checking for #logged-in-section after the $promise is returned?
has answer: http://stackoverflow.com/a/27950667
has title: AngularJS Protractor - How Do You Test an AJAX Login Call?
answer count: 1
tagged with: jasmine
favorite count: 0

http://stackoverflow.com/comment/38515253
score: 0
comment on: http://stackoverflow.com/q/24811719
type: Comment
type: QuestionComment
has text: If only you would have visited [the jQuery documentation](http://api.jquery.com) and typed the word ***height*** into the search, you'd have found your answer.

http://stackoverflow.com/comment/38588377
score: 0
type: Comment
type: AnswerComment
has text: Hey, I have updated the code to construct the html of the code without using outerHTML. Here is the [demo](http://jsfiddle.net/breWL/3/) for it. Hope this solves your &nbsp; problem.
comment on: http://stackoverflow.com/a/24848018

http://stackoverflow.com/comment/38410060
score: 0
type: Comment
type: QuestionComment
has text: Given the way variables work in JS, I don't think that would be possible at all (For instance, what about anonymous functions etc.). If you can explain why you need it, maybe we can suggest an alternative approach
comment on: http://stackoverflow.com/q/24756096

http://stackoverflow.com/q/24829694
has answer: http://stackoverflow.com/a/24830497
possible better answer: http://stackoverflow.com/a/24830181
has title: How do you filter JSON based on which checkbox is clicked?
has comment: http://stackoverflow.com/comment/38549624
tagged with: javascript
tagged with: jquery
has body: I have a simple JSON object in my javascript, and I want to filter it when a button is clicked. I looked around and found this. So far I have this: $scope.myFunc = function(a) { for(meal in $scope.mealTypes){ var t = $scope.mealTypes[meal]; if(t.on && a.type.indexOf(t.name) > -1){ return true; } } }; $scope.mealTypes = {Breakfast: false, mainMeal:false}; This is my HTML: Then I aim to iterate the array and display the checked button pressed (I wish to display the names): {{ reciepe.type }} remove Json: $scope.reciepes = [ { "type": "Breakfast", "title": "Chili con carne", "description": "A spicy and fragrant chili with ground beef, kidney beans, tomatoes, onions and garlic. Best served over rice with a dollop of sour cream and some cheese on top.", "ratings": 4, "ingredients": [ { "vegetable": "40ml" } ], "method": [ { "1": "In a medium sized stock pot, heat the oil over medium heat. Saute onions, chile peppers andgarlic until soft." } ] }, { "type": "Main Meal", "title": "Main Meal", "description": "A spicy and fragrant chili with ground beef, kidney beans, tomatoes, onions and garlic. Best served over rice with a dollop of sour cream and some cheese on top.", "ratings": 4, "ingredients": [ { "vegetable": "40ml" } ], "method": [ { "1": "In a medium sized stock pot, heat the oil over medium heat. Saute onions, chile peppers andgarlic until soft." } ] }] Basically I aim to display the checkbox value on a div when it's pressed and filter the array. How should I do this?
score: 0
tagged with: angularjs
answer count: 3
accepted answer: http://stackoverflow.com/a/24830497
tagged with: checkbox
tagged with: angularjs-ng-repeat
linked to: http://stackoverflow.com/q/15868248
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24830181
has answer: http://stackoverflow.com/a/24830201

http://stackoverflow.com/a/24770911
answers question: http://stackoverflow.com/q/24770887
downvote count: 0
has body: jsonObject is an array, so you need to reference the array elements. Try delete jsonObject[0].YYY
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/80901970
type: Comment
comment on: http://stackoverflow.com/a/24855023
has text: Writing pre-calced int32 values to typed array is fast. The array does not contain holes (yeah, holes are fast but…). The array is preallocated. So creating and initialization typed array is fast. But when you try to read from Uint32Array the value should be converted to double (see my answer below). You should use Int32Array (on x64) or Int16Array (on x86) (see my answer below again).
type: AnswerComment
score: 0

http://stackoverflow.com/a/24799095
has comment: http://stackoverflow.com/comment/38491713
accepted answer of: http://stackoverflow.com/q/24798830
has comment: http://stackoverflow.com/comment/38491241
has body: Using bottom top left right you must define position. In your case remove bottom from #darkBlue #anotherPanel and add to #darkBlue height: calc(100% - 100px) DEMO Update If you don't want to use calc then add margin-bottom:-100px; to #darkBlue DEMO
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24798830
type: Answer

http://stackoverflow.com/comment/38478865
type: Comment
has text: differentiate between the socket's connection, the socket's object and the handle to the object. whether you want to keep a handle or not depends on your needs; think of the spec as addressing browsers, not you. it is saying "don't garbage collect if there are event listeners, an open connection, etc". but obv browsers don't always implement recommendations so you might want to test this.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24789415

http://stackoverflow.com/q/24834929
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24835149
tagged with: iframe
type: Question
has body: I need to load a url in an iframe on page load (which is working), then grab the whole url of that loaded iframe, then once the url is saved as a variable i want to find any text between "target" and "/" (example url http://www.example.com/user/target09576/index.php i wish to find the 09576) then redirect the whole page using the found text (09576) as part of the redirect url. I know, bad explanation and not a great solution, but any help would be appreciated. $(document).ready(function() { var iframe = $('#wmif'); var url = '&lt;? echo "".$redirectlocation.""; ?&gt;'; iframe.attr('src', url); var searchurl = iframe.contentWindow.location; var rep = /(.*target\s+)(.*)(\s+\/.*)/; var target = searchurl.replace(rep, '$2'); window.location = 'http://example.com/go/index.php?target='+target; }); well the iframe loads the new location ok, but it doesn't do any of the rest.
tagged with: javascript
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/24835252
has comment: http://stackoverflow.com/comment/38558753
tagged with: jquery
has title: jquery find and replace iframe src
accepted answer: http://stackoverflow.com/a/24835149
tagged with: http-redirect
has answer: http://stackoverflow.com/a/24835252

http://stackoverflow.com/comment/38542422
type: AnswerComment
has text: But the second modal - the one not opening - is just a static form. The problem seems to be that the link to the second modal is dynamically generated on the first modal (dropdown menu) so maybe it is not available in the DOM?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24825313

http://stackoverflow.com/comment/38515317
has text: The reasoning being that the variables are then initialized only once, and not once per loop cycle.
score: 1
comment on: http://stackoverflow.com/a/24811914
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38604731
score: 3
has text: Got it. I found out that the problem is in curl. when passing multiple parameters, it need to put single quotes around the url. Thanks for the help guys! Sorry for not mentioning I am using curl..
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24857907

http://stackoverflow.com/q/24827782
favorite count: 0
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/24846655
has answer: http://stackoverflow.com/a/24846655
has title: Preventing a function from running if a parallel function has already failed (using jQuery $.when())
upvote count: 1
has answer: http://stackoverflow.com/a/24828044
tagged with: jquery-deferred
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38579323
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24828044
has body: I have a rather convoluted series of asynchronous functions that I am chaining with the help of jQuery Deferreds. Essentially I have two parallel streams of functions, followed by functions that should be executed serially when the parallel streams have both finished. Here's an example (they are AJAX calls in real life): function makeOmelette() { $.when( crackEggs().then(beatEggs), washTomatos().then(chopTomatos) ).then(mixEggsAndTomatos).then(fryEggsAndTomatos).done(function() { msg('Omelette is ready!'); }).fail(function() { msg('Oh no, omelette fail!'); }); } The done() and fail() handlers at the end deal with success or failure. I would like the fail() handler to execute as soon as anything goes wrong, anywhere in the chain, and for all further execution to stop. Mostly, this works - apart from one case. If there is a failure when cracking eggs, then the tomatos are still washed and chopped - even if the failure has already occurred by the time either of those tasks have started. Similarly, if there is a failure when washing tomatos, this doesn't stop the crackEggs and beatEggs functions from running. You can see an example here. My concern about this is that, in my real life code, I don't want the browser to be making AJAX calls to the server, which could potentially change state, if there is no point because the overall process has already failed. Is there a way to do what I want? I suppose I could attach fail handlers to each of the parallel tasks individually, but I wondered if there was a less verbose/repetitive way. Thanks!
score: 1
has comment: http://stackoverflow.com/comment/38898806

http://stackoverflow.com/a/24904624
upvote count: 2
answers question: http://stackoverflow.com/q/24904530
downvote count: 1
type: Answer
has body: This is the regex you are looking for: /(?=(\d{3}))/g
score: 1

http://stackoverflow.com/comment/38496180
type: AnswerComment
has text: But, it doesn't. The line `console.log(val1 == val2);` outputs false to the console...
type: Comment
comment on: http://stackoverflow.com/a/24782338
score: 0

http://stackoverflow.com/comment/38697537
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24908144
has text: Your jsfiddle code doesn't work.

http://stackoverflow.com/comment/38427553
comment on: http://stackoverflow.com/q/24765389
score: 0
type: Comment
type: QuestionComment
has text: You have to be careful when using a textbox to get a date. Entered as 2014-07-22 and 2017-07-20 the funciton works fine. You should use jQuery and the datepicker widget.

http://stackoverflow.com/a/24825238
score: 0
has body: I think you should use delegate or other tools like on. I perfer delegate. You have to give that element a second command so that it is clickable. Like: $(selector).delegate(this,"click",function(){ //Do something as you wish }); See this delegate link for more documentation.
type: Answer
answers question: http://stackoverflow.com/q/24825151

http://stackoverflow.com/comment/46054732
comment on: http://stackoverflow.com/a/26469483
type: AnswerComment
type: Comment
has text: Quick note: As of version 1.4, the methods to invoke actions have changed. The equivalent code line for this answer as of 1.4 woud be: `$('.firstDiv').slick('slickGoTo', 4)`
score: 7

http://stackoverflow.com/q/24769776
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/8275658
possible better answer: http://stackoverflow.com/a/24769809
has comment: http://stackoverflow.com/comment/38435913
type: Question
duplicate of: http://stackoverflow.com/q/8275658
answer count: 2
has title: What's the purpose of passing in global variables into a self-invoking function when it has access to global variables in javascript?
accepted answer: http://stackoverflow.com/a/24769917
has comment: http://stackoverflow.com/comment/38435957
has comment: http://stackoverflow.com/comment/38436136
has body: What's the purpose of passing in global variables into a self-invoking function when it has access to global variables in javascript? For example, (function(window, undefined){ console.log('Hello World!'); })(window, undefined); What's the purpose of referencing the window as an argument to this self-invoking function when it has access to the global window object without passing it in?
score: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/24769917
has answer: http://stackoverflow.com/a/24769809

http://stackoverflow.com/comment/38681014
type: AnswerComment
score: 0
type: Comment
has text: text can change outside of your control. Translation plugins/services change text.
comment on: http://stackoverflow.com/a/24899213

http://stackoverflow.com/comment/38486378
type: QuestionComment
has text: i tried it but not worked :(
score: 0
comment on: http://stackoverflow.com/q/24796280
type: Comment

http://stackoverflow.com/comment/38619854
comment on: http://stackoverflow.com/q/24867006
score: 0
type: Comment
has text: Could you please explain the Reason for negative voting??
type: QuestionComment

http://stackoverflow.com/comment/38643929
type: Comment
type: QuestionComment
score: 2
has text: None of the examples you mention have required prefixes since [Firefox 16](https://www.mozilla.org/en-US/firefox/16.0/releasenotes). It might just be that the properties you're using simply haven't required prefixes for quite some time. Off the top of my head the only property that still requires a prefix is `-moz-box-sizing`, which was only unprefixed in Firefox 30 a couple of months back.
comment on: http://stackoverflow.com/q/24878850

http://stackoverflow.com/q/24777530
tagged with: underscore.js
type: Question
has answer: http://stackoverflow.com/a/24777577
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24777577
has title: removing a pipe sign from text with javascript
score: 0
answer count: 1
has body: I have some text that I am rendering using underscore and it contains pipe character that I am trying to remove. This is what I have tried &lt;script type="text/html" id="activityDescriptionTmpl"&gt; &lt;%= formatInput(container.CurrentActivity.ProcessActivityDescription) %&gt; &lt;/script&gt; this is what the text looks like This is the text with pipe character at the end| This id a javascript function I created formatInput = function (input) { var arr = []; var finalInput = ''; if (input.indexOf('|') &gt; 0) { arr = input.split('|'); for (var i = 0; i &lt; arr.length; i++) { if ($.trim(arr[i]).length &gt; 0) finalInput += $.trim(arr[i]) + '&lt;br /&gt;'; } } else { finalInput = input; } return finalInput; }; But in this case I get the errorcannot read property 'indexOf' undefined Is there perhaps a better way of just removing this pipe character
type: AnsweredQuestion

http://stackoverflow.com/comment/38462514
type: QuestionComment
has text: @Quentin - ok, how can I bypass this? May be use iframe or something else (One of variants - use "proxing" script, eg: PHP script, which will get data from selected url and return it to user, but it is the worst way, I need to to all on the user-side)?
comment on: http://stackoverflow.com/q/24783015
score: 0
type: Comment

http://stackoverflow.com/q/24854737
answer count: 1
tagged with: knockout.js
tagged with: kendo-grid
has answer: http://stackoverflow.com/a/24864032
has body: I want to achieve a two-way binding between a Kendo Window and Kendo Grid. I am unable to achieve the two-way data binding. The built in popup for the Kendogrid is able to do this. I tried the following; HTML Snippet TextBox 1 :&lt;input type="text" placeholder="user name" value = '#= user_name #' /&gt;&lt;br /&gt; TextBox 2 :&lt;input type="text" placeholder="user name" data-bind="value:user_name" /&gt; TextBox 1 displays the value, but is not bound two-way TextBox 2 shows no value at all JS SNIPPET kendo.bind($("#item"), viewmodel); wnd = $("#wnd").kendoWindow({ title: "Phone Details", modal: true, visible: false, resizeable: false, width:300 }).data("kendoWindow"); temp = kendo.template($("#template").html()); function show(e){ e.preventDefault(); var dataItem = this.dataItem($(e.currentTarget).closest("tr")); wnd.content(temp(dataItem)); kendo.bind($("#item_instance"), dataItem); wnd.center().open(); }; I have captured my issue here http://jsfiddle.net/BlowMan/Bfh24/7/ Any help will be very much appreciated
tagged with: javascript
has title: Kendo Window Data bind not working
has comment: http://stackoverflow.com/comment/38607143
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
tagged with: kendo-ui
accepted answer: http://stackoverflow.com/a/24864032
type: Question
tagged with: kendo-window
has comment: http://stackoverflow.com/comment/38608152
upvote count: 1

http://stackoverflow.com/comment/38596674
has text: The function is not called "func". I'm using func = "doNothing" as a test, and function = doNothing(d){ } is defined in the root.
comment on: http://stackoverflow.com/a/24845274
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/41277297
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25585778
has text: @JamieHutber True, but I'm confident once a person can understand how something works, they can intuitively do it in their specific project. Also, the way in which you include a jQuery plugin will differ on a project-by-project basis since every plugin is different & the way in which you include it could change.

http://stackoverflow.com/q/24886782
tagged with: codeigniter
type: Question
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38658053
type: UnansweredQuestion
has title: codeigniter form submission using ajax and display return data in a div
has answer: http://stackoverflow.com/a/24886872
tagged with: php
has body: I need to submit form data using ajax and get auto increment id of submitted record and display it on a div here is my code controller <?php class Form_controller extends CI_controller{ function index(){ $this->load->view('submit_form'); } public function insert_into_db(){ $this->load->model('form_model'); $this->form_model->insertQ(); } } view Email: Question: model <?php class Form_model extends CI_Model{ function insertQ(){ $email = $this->input->post('email'); $qText = $this->input->post('qText'); $this->db->insert('questions', array('email' =>$email, 'text' => $text)); } } I have tried several times,but couldn't fix it,I'm new to codeigniter as well ajax

http://stackoverflow.com/comment/38696975
type: QuestionComment
type: Comment
has text: Works perfectly fine for me when testing in Firefox and Chrome, but it is a horrible code.
comment on: http://stackoverflow.com/q/24908083
score: 0

http://stackoverflow.com/a/24777382
score: 0
answers question: http://stackoverflow.com/q/24777311
has body: You can also use document.getElementsByName() or you can apply one common class to all check box and use jquery like $('.class_name'). Hope this help :)
type: Answer

http://stackoverflow.com/comment/38479079
type: Comment
comment on: http://stackoverflow.com/a/24791902
has text: This is great, thanks, the only thing that I need to figure out how to do with this is how to make it so that the hover area of the container is just the link, and not the size of the whole table.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38456513
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24780915
has text: It's static field of the class that being re-created for each new request. Web pages are stateless, they don't store their data anythere. Try to debug your static constructor for this class.

http://stackoverflow.com/comment/38588511
type: QuestionComment
comment on: http://stackoverflow.com/q/24834471
has text: @Arius Unfortunately it's a stupid request by the teacher at the university. :(
score: 0
type: Comment

http://stackoverflow.com/comment/56347690
type: QuestionComment
has text: what are some of the alternatives to reveal.js?
score: 0
comment on: http://stackoverflow.com/q/24809752
type: Comment

http://stackoverflow.com/a/24832662
answers question: http://stackoverflow.com/q/24832613
has body: json is an array containing an object, that object contains an array with two objects where the keys are the names, you can use Object.keys to get those names. Object.keys(json[0].users[0]) FIDDLE
downvote count: 0
score: 1
upvote count: 1
type: Answer

http://stackoverflow.com/q/24826160
type: Question
has answer: http://stackoverflow.com/a/24826452
has comment: http://stackoverflow.com/comment/38546180
has comment: http://stackoverflow.com/comment/38542824
has answer: http://stackoverflow.com/a/24826378
has title: When I search my site and hit the enter key, the search performs correctly, but hitting the button, it does not
answer count: 2
linked to: http://stackoverflow.com/q/15305389
tagged with: javascript
linked to: http://stackoverflow.com/q/1566713
has comment: http://stackoverflow.com/comment/38542783
has body: For example, if I search my site for "4486043", then hit enter, I get a search result. If I click the button next to the search bar, it searches for "Search this website...", which is the default text of the textbox. HTML/PHP function tf_common_themes_get_search() { $partner_id = tf_partner_get_partner_id(); $search_text = "Search this website..."; $email_updates = ""; if ("creative_habitat" == THEME_NAME) { $search_text = "search"; $email_updates = ' '; } elseif ("watertown_daily" == THEME_NAME) { $search_text = "Search this website..."; } return ' '; } Javascript: var searchtext = ""; function hidetext(id){ if(searchtext == ""){ searchtext = id.value; id.value = ""; } } function showtext(id){ if(searchtext != ""){ id.value = searchtext; searchtext = ""; } } function checkfield(id){ var search=null; if(document.getElementById(id)) search=document.getElementById(id).value if (search != "" && search!=" "){ document.search.submit(); } return false } I have a JSFiddle here: http://jsfiddle.net/allisonc/zY6h2/
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
score: 0

http://stackoverflow.com/a/44413726
score: 6
type: Answer
upvote count: 6
has body: Another inline way: I agree to the terms and would like to continue
answers question: http://stackoverflow.com/q/24755802
has comment: http://stackoverflow.com/comment/101604185
downvote count: 0

http://stackoverflow.com/comment/38570779
has text: Thanks. Technically you answered my question why my function doesn't work. But I still don't have a solution to finding and replacing the strings I'm interested in in google apps script. Should I open another question for that?
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/24836016
type: Comment

http://stackoverflow.com/comment/38596279
comment on: http://stackoverflow.com/a/24845415
type: Comment
has text: Hope I got this right this time: added a section to explain the need of routes and how they are used to render a view.
score: 0
type: AnswerComment

http://stackoverflow.com/a/24825336
type: Answer
answers question: http://stackoverflow.com/q/24825055
score: 0
has body: I did something similar recently, where I had an interval running every few seconds and, when some event occurred, I stopped the process altogether. I'm assuming you're using Javascript, so something like the below. You can check "someVar" in the timer call if you wish, up to you... var someVar = false, intervalId; $(function () { // Attach event handler to button $('#ButtonId').click(function (e) { if (!someVar) { e.preventDefault(); someVar = true; //Start interval intervalId = setInterval(CheckStatus, 3000); } else { // Stop the interval! clearInterval(intervalId); someVar = false; } }); }); function CheckStatus() { // I used MVC, but you can use whatever you need to generate the URL var checkUrl = '@Url.Action("CheckStatus", "SomeController", new { intervalId = "_intervalId_" })'.replace('_intervalId_', intervalId).replace(/&amp;amp;/g, "&amp;"); $.ajax({ url: checkUrl, type: 'GET', contentType: 'application/json; charset=utf-8', success: function (data) { // do something with the status - data.Status perhaps? }, error: function () { //handle error } }); }

http://stackoverflow.com/a/24972658
has body: There is a labelAttr property on the dijit/form/Select which you can use to change the name of the label attribute. For example: new Select({ store: myStore, labelAttr: "name" // Now the name attribute will be used }, "mySelect"); If you also like to change the attribute used for the ID (it's not necessary in this case, but you asked how to specify that one as well), then you should look at the idProperty of the dojo/store/Memory, for example: var myStore = new Memory({ idProperty: "id", data: [{ "id":1, "name":"Item 1" }, { "id":2, "name":"Item 2" }, { "id":3, "name":"Item 3" }] }); A full example can be found on JSFiddle: http://jsfiddle.net/NvKgH/
type: Answer
upvote count: 3
score: 3
accepted answer of: http://stackoverflow.com/q/24903892
answers question: http://stackoverflow.com/q/24903892
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/24775780
type: Question
score: 3
has comment: http://stackoverflow.com/comment/38447144
tagged with: javascript
has comment: http://stackoverflow.com/comment/38447428
has comment: http://stackoverflow.com/comment/38447038
has comment: http://stackoverflow.com/comment/38447423
has comment: http://stackoverflow.com/comment/38447816
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has body: I have 2 instances of jQuery.contexMenu on one page (fiddle example). The first one is triggered on right click, the second one on left. When I perform a right click on the first div (without clicking on any menu item), and an other right click on the second div, the second context menu also appears, but it shouldn't. I have the same problem when I start with the second div, with left click...
tagged with: contextmenu
has title: 2 jQuery.contextMenu on a page with different trigger
upvote count: 3
has answer: http://stackoverflow.com/a/25679176

http://stackoverflow.com/a/24750742
answers question: http://stackoverflow.com/q/24750623
has comment: http://stackoverflow.com/comment/38399915
has comment: http://stackoverflow.com/comment/108511544
has comment: http://stackoverflow.com/comment/58913821
accepted answer of: http://stackoverflow.com/q/24750623
upvote count: 49
has body: $("#table tr").click(function(){ $(this).addClass('selected').siblings().removeClass('selected'); var value=$(this).find('td:first').html(); alert(value); }); $('.ok').on('click', function(e){ alert($("#table tr.selected td:first").html()); }); Demo: http://jsfiddle.net/65JPw/2/
score: 49
has comment: http://stackoverflow.com/comment/58949419
has comment: http://stackoverflow.com/comment/58950291
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38400029
has comment: http://stackoverflow.com/comment/58917961
type: Answer

http://stackoverflow.com/comment/38648383
score: 0
has text: Also, I have used this exact same code for another grails application which works perfectly, but in this app, it's consistently giving me this error, is there any way out?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24874861

http://stackoverflow.com/a/24763528
upvote count: 1
has body: console.log always returns undefined If you did return arg instead of returning what console.log returns, then you'd be good.
downvote count: 0
answers question: http://stackoverflow.com/q/24763484
type: Answer
score: 1

http://stackoverflow.com/q/24848533
favorite count: 0
has comment: http://stackoverflow.com/comment/38584133
has comment: http://stackoverflow.com/comment/38584407
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/38584069
has title: Scripts in body tag aren't loading
type: Question
has comment: http://stackoverflow.com/comment/38584396
has comment: http://stackoverflow.com/comment/38584112
score: -2
has comment: http://stackoverflow.com/comment/38584094
has answer: http://stackoverflow.com/a/24848749
has comment: http://stackoverflow.com/comment/38584431
has body: I'm trying to load up angular inside my body tag but for some reason nothing is getting loaded, when I check the resources panel it only contains files from the head. If I move all this stuff to the head It shows up in resources and its loaded, but when in the body, it's unloaded. What's going on here? why is this not being loaded into the page? I'm using gulp and gulp-webserver but that shouldn't be the cause.
has comment: http://stackoverflow.com/comment/38584075
has comment: http://stackoverflow.com/comment/38584229
upvote count: 0
has comment: http://stackoverflow.com/comment/38584350
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38584164
tagged with: angularjs

http://stackoverflow.com/comment/38557396
type: AnswerComment
has text: +1 for noting the click handler will replace the existing one. Suggest adding that you can avoid this by "namespacing" it, e.g. `.on("click.zoom", function(d) { zoom(d); });`
type: Comment
comment on: http://stackoverflow.com/a/24834120
score: 2

http://stackoverflow.com/comment/38685531
score: 0
type: Comment
has text: Thank you for pointing that out!! Ironically I missed out reading "notes" from that page.
comment on: http://stackoverflow.com/a/24889831
type: AnswerComment

http://stackoverflow.com/comment/50510662
type: AnswerComment
comment on: http://stackoverflow.com/a/24787140
type: Comment
has text: what if I want more than 1 item to be show at a time ? something like `< item1 item2 item3 >`, like split in 4, and every time the user hits <, > it moves a shift to the side.
score: 2

http://stackoverflow.com/comment/38604750
type: Comment
has text: Wow, its such a beautiful solution. Thank you for it.
type: AnswerComment
comment on: http://stackoverflow.com/a/24841197
score: 0

http://stackoverflow.com/comment/38699448
score: 0
comment on: http://stackoverflow.com/q/24887183
type: Comment
type: QuestionComment
has text: agreed I'd like to vote for the correct answer @DimitarChristoff

http://stackoverflow.com/a/24814983
type: AcceptedAnswer
downvote count: 0
upvote count: 1
type: Answer
has body: Javascript does not have access to things at the pixel level in the browser rendering engine. I think your only shot would be a tool like HTML 2 Canvas which implements a whole browser rendering engine in pure javascript. You can then save the image in the canvas element. HTML 2 Canvas This script allows you to take "screenshots" of webpages or parts of it, directly on the users browser. The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot, but builds the screenshot based on the information available on the page. (Note the part where it says it may not be 100% accurate, rendering webpages is pretty complicated) In fact the answer you linked to is only relevant here because it links through to an article that mentions HTML 2 Canvas for just this purpose, taking screenshots to stream for screensharing.
accepted answer of: http://stackoverflow.com/q/24814807
answers question: http://stackoverflow.com/q/24814807
score: 1

http://stackoverflow.com/comment/38597586
comment on: http://stackoverflow.com/q/24855252
score: 0
has text: I promise you, there *are* tutorials on this stuff.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38675832
has text: @brainbowler, so how would i add this to an functional if statement? Statement will be added to my question above.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24896335
type: AnswerComment

http://stackoverflow.com/q/24897452
type: Question
has comment: http://stackoverflow.com/comment/38677261
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/24897520
has comment: http://stackoverflow.com/comment/38677309
has body: I have many checkboxes that I would like to add the values of to an array in a session variable. problem is I don't know what the ID of checkbox will be. the checkboxes will look like this: &lt;input type="checkbox" value="102" name="tags[]" id="tag102" class="checkbox" /&gt; &lt;input type="checkbox" value="103" name="tags[]" id="tag103" class="checkbox" /&gt; &lt;input type="checkbox" value="104" name="tags[]" id="tag104" class="checkbox" /&gt; &lt;input type="checkbox" value="105" name="tags[]" id="tag105" class="checkbox" /&gt; The first step is that I'm trying to detect if they have been clicked with this little bit, but I'm not getting anything, no errors and no entry in the console. $('input[type=checkbox]').change(function() { console.log("box was clicked"); alert("box clicked..."); }); What am I doing wrong. The script is loaded in a document ready function. the latest jquery &amp; bootstrap3 are loaded before this. UPDATE Looks like something is interfering with the checkbox: // type ahead search var allclients_ajaxUrl = '[[~41]]'; $('#searchusers').select2({ minimumInputLength: 2, ajax: { url: allclients_ajaxUrl, dataType: 'json', data: function (term, page) { return { q2: term }; }, results: function (data, page) { return { results: data }; } } }); Not sure how or why that would be messing up the select boxes.
has title: How to detect if a checkbox has been clicked with jquery
tagged with: jquery
favorite count: 0
answer count: 5
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24897585
has answer: http://stackoverflow.com/a/24897561
has answer: http://stackoverflow.com/a/24897545
has comment: http://stackoverflow.com/comment/38677422
upvote count: 0
has answer: http://stackoverflow.com/a/24897542
downvote count: 1

http://stackoverflow.com/a/24866947
downvote count: 0
score: 1
has body: You can use the following regular expression /^([^/]+)*\/([^/]+)*\/inc\/([^/]+)*\/([^/]+)*/ The full code would then be var regex = /^([^/]+)*\/([^/]+)*\/inc\/([^/]+)*\/([^/]+)*/; var input = "your input string"; if(regex.test(input)) { var match = input.match(regex); alert(match); // Then you will have all the data you want in the match array } else { alert("No matches found!"); } Check the match variable then to retrieve all the data you want.
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24866857
answers question: http://stackoverflow.com/q/24866857
type: Answer
has comment: http://stackoverflow.com/comment/38619780

http://stackoverflow.com/comment/38603574
has text: @user3754380 but...man, you can't...it's like asking to draw 2 perpendicular lines that never touch each other...
type: AnswerComment
comment on: http://stackoverflow.com/a/24858396
score: 0
type: Comment

http://stackoverflow.com/comment/38519383
type: AnswerComment
comment on: http://stackoverflow.com/a/24813920
has text: Wouldn't that be a memory leak?
type: Comment
score: 0

http://stackoverflow.com/comment/38606024
type: AnswerComment
comment on: http://stackoverflow.com/a/24859651
type: Comment
has text: it shows [object Object][object Object][object Object]
score: 0

http://stackoverflow.com/q/24854235
tagged with: javascript
tagged with: iphone
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24862231
downvote count: 0
score: 1
favorite count: 0
tagged with: angularjs
type: Question
has body: I own an AngularJS app (angular v1.2.19) that I converted into iOS app using Cordova/PhoneGap. However, it seems that the resolve property (see below) is taking into account but the associated page is displayed BEFORE the promise is resolved, leading to some ugly flickering. Flickering in this case is: the form only displays fieldset and legend + buttons for 1 second, and then the whole data (input etc..) are displayed. $routeProvider .when('/page/meetings/123/edit', { templateUrl: "edit.html", controller: "EditCtrl" resolve: { activities: ['Activities', function (Activities) { return Activities.getList().then(function(response) { return response.data; }); }] } } } ) //page is displayed before activities are fully loaded. Does a known bug regarding resolve property exist with Cordova? Or a configuration I should add? It works well in a browser, but in the iOS app, I don't manage to make Angular resolve the promise before the page is rendered. I don't figure out why this only occurs with iOS app and not web browser. When I remove the resolve section, the page displays without flickering, although I don't have activities populated. Maybe just a performance reason? Indeed, I tested the path /page/meetings/123/edit in my Ipad 3 (named "new Ipad") from a page where there isn't a lot of content, and it shows the page AFTER promises are resolved => fine. The strange thing is that when I put the same link on a heavy page..listing several items, the targeted page (edit page) still flickers, displaying no form for about 1 second and then displays the whole. To make things more strange, the exact same code on Iphone 4s involve flickers no matter where is the /page/meetings/123/edit link (heavy or light page). On the contrary, web mobile version (Safari) on the iPhone 4s and Ipad is perfect. Really don't figure out why.
tagged with: cordova
upvote count: 1
has title: AngularJS/Cordova/Phonegap Ipad 3 and Iphone 4s not fast enough?
has answer: http://stackoverflow.com/a/24862231
answer count: 1
tagged with: ios

http://stackoverflow.com/comment/38731518
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24885517
score: 0
has text: Thanks for the quick reply Lars. Any quick pointers on how/where to update the internal variables that retain the changes.

http://stackoverflow.com/comment/57568371
type: Comment
comment on: http://stackoverflow.com/a/25797112
type: AnswerComment
score: 0
has text: @Lason S: in this case you should accept the answer

http://stackoverflow.com/comment/38608051
type: Comment
type: QuestionComment
has text: Are you looking for [this](http://codepen.io/anon/pen/qaLkF) output?
comment on: http://stackoverflow.com/q/24860699
score: 0

string
tags question: http://stackoverflow.com/q/24795031
tags question: http://stackoverflow.com/q/24867242
tags question: http://stackoverflow.com/q/24878585
tags question: http://stackoverflow.com/q/24800142
tags question: http://stackoverflow.com/q/24782179
tags question: http://stackoverflow.com/q/24814735
tags question: http://stackoverflow.com/q/24844039
tags question: http://stackoverflow.com/q/24850819
tags question: http://stackoverflow.com/q/24758284
tags question: http://stackoverflow.com/q/24793366
tag name: string
tags question: http://stackoverflow.com/q/24887749
tags question: http://stackoverflow.com/q/24874643
tags question: http://stackoverflow.com/q/24872947
tags question: http://stackoverflow.com/q/24857544
type: Tag
tags question: http://stackoverflow.com/q/24907695
tags question: http://stackoverflow.com/q/24866857
tags question: http://stackoverflow.com/q/24801633
tags question: http://stackoverflow.com/q/24772306
tags question: http://stackoverflow.com/q/24873647
tags question: http://stackoverflow.com/q/24831284
tags question: http://stackoverflow.com/q/24833951
tags question: http://stackoverflow.com/q/24798972
tags question: http://stackoverflow.com/q/24901063
tags question: http://stackoverflow.com/q/24889394
tags question: http://stackoverflow.com/q/24827629
tags question: http://stackoverflow.com/q/24819610
tags question: http://stackoverflow.com/q/24773085
tags question: http://stackoverflow.com/q/24805250
tags question: http://stackoverflow.com/q/24785325
tags question: http://stackoverflow.com/q/24854630
tags question: http://stackoverflow.com/q/24750173
tags question: http://stackoverflow.com/q/24760932

http://stackoverflow.com/comment/38687317
type: QuestionComment
comment on: http://stackoverflow.com/q/24902641
score: 0
has text: `e[i].style.display = u ? "block" : "none";`
type: Comment

http://stackoverflow.com/a/35789645
downvote count: 0
answers question: http://stackoverflow.com/q/24841476
type: Answer
has body: answer to your question is simple order is not a object make it an array. var order = new Array(); order.push(/item to push/); when ever this error appears just check the left of which property the error is in this case it is push which is order[] so it is undefined.
upvote count: 1
score: 1

http://stackoverflow.com/a/24904384
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/24904296
score: 1
has body: Try this for i in {1..5} do echo "Welcome $i times" node process.js done
accepted answer of: http://stackoverflow.com/q/24904296
has comment: http://stackoverflow.com/comment/38691064
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/38573871
score: 1
has text: @Nathan : where i can see JavaScript console ?
comment on: http://stackoverflow.com/q/24843175
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24863081
has comment: http://stackoverflow.com/comment/38612713
accepted answer of: http://stackoverflow.com/q/24852092
has comment: http://stackoverflow.com/comment/38613450
type: Answer
answers question: http://stackoverflow.com/q/24852092
has comment: http://stackoverflow.com/comment/38613005
has body: I just had to use an arg $transclude in the controller of the directive. // declaration of DataTable directive .directive('datagrid', function () { return { restrict: 'E', templateUrl: 'datagrid.htm', scope: true, transclude: true, link: function ($scope, $el, $attr) { var dtData = { id: $attr.id, url: $attr.url }; if ($scope['datagrid'] === undefined) $scope['datagrid'] = []; $scope['datagrid'].push([$attr.id, dtData]); }, controller: function ($scope, $transclude) { $transclude(function (clone, scope) { console.log($(clone).find('header')); // don't work $.each(clone, function (i, e) { if ($(e).is('header')) console.log(e); //works }); }); } }; }); From this I believe that I can accomplish my goal. Only questions that are still there are if this is a good way to do this, will that confuse other users of my plugin and why the hell can't I select the "header" element with the jQuery find method? :) Thank you all for the help. Hope I will soon finish the rest of the goal so I can post it here. There shouldn't be any more problems to accomplish it.
score: 0
has comment: http://stackoverflow.com/comment/38613557
type: AcceptedAnswer

http://stackoverflow.com/q/24770101
has comment: http://stackoverflow.com/comment/38436461
has comment: http://stackoverflow.com/comment/38436460
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38436608
has answer: http://stackoverflow.com/a/24770175
tagged with: http://stackoverflow.com/tag/json
has title: rendering JSON response urls
type: Question
downvote count: 4
upvote count: 0
has body: I am having trouble handling a JSONP response to an ajax call to a website. My intention is to have the the results (url's) of the news items displayed on a page so when a user clicks on each link, he or she would be directed to the page containing the story. However, that is not happening. Though I was able to display the result as an unordered list. Instead when I click on the links, I get directed to a local folder with a file not found message. Here is my code: $(document).ready(function(){ $.ajax({ url:"http://api.nytimes.com/svc/news/v3/content/all/all/.jsonp", data: {"api-key":"uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu"}, dataType: 'jsonp', type: 'GET', success:function(mydata){ $.each(mydata.results, function(i, value){ $("ul").append('&lt;li&gt;'+'&lt;a href=""&gt;'+mydata.results[i].url+'&lt;/a&gt;'+ '&lt;/li&gt;'); $("ul li a").attr("href", "mydata.results[i].url"); }); //alert("Success"); }, error:function(){ alert("Error"); }, }); });
tagged with: javascript
tagged with: jquery
score: -4
tagged with: ajax
accepted answer: http://stackoverflow.com/a/24770175
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/38436558

http://stackoverflow.com/q/24895476
score: 0
has comment: http://stackoverflow.com/comment/38687430
has answer: http://stackoverflow.com/a/24903308
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38685513
linked to: http://stackoverflow.com/q/20419574
tagged with: cordova
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/11388018
tagged with: cross-platform
type: Question
has title: Saving the canvas image to device library using phonegap FILE API
answer count: 1
tagged with: javascript
tagged with: phonegap-plugins
has body: Is it possible to store the the canvas image to device library using phonegap FILE API

http://stackoverflow.com/a/24846209
has body: Try this: (([0-1]?[0-9])|2[0-3]):[0-5][0-9] ?(am|pm|AM|PM)
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24846148

http://stackoverflow.com/comment/38403387
type: QuestionComment
has text: Are You sure it's attr?
score: 0
comment on: http://stackoverflow.com/q/24752565
type: Comment

http://stackoverflow.com/a/24824451
has comment: http://stackoverflow.com/comment/38538656
score: 2
upvote count: 2
downvote count: 0
has body: This can mostly be achieved by the Builder pattern. This is useful when there is a lot of information required to create the object.
answers question: http://stackoverflow.com/q/24824238
type: Answer

http://stackoverflow.com/comment/38411661
type: QuestionComment
type: Comment
score: 0
has text: An advice: avoid using such poorly documented plugins ! Always use jquery plugins that provide a variety of demos and code snippets and whose help is readily available !
comment on: http://stackoverflow.com/q/24756686

http://stackoverflow.com/q/24851068
tagged with: javascript
has body: I have written a large page including a form as my first JavaScript project. I've gotten some help here, so thanks. I am very happy with what I have so far, but I have one last problem I need to deal with. The code I will submit here is a tester. I have a couple of functions attached to an onClick new window. What happens is user submits form and their info appears in a new window. (My original page is more complicated, of course.) There is one function called askForHelp which shows an alert in the new window if a specific value is entered for 'state' and a very simple validateForm which shows an alert on the parent?? window if values are left blank. The problem is b/c i have all the functions running onClick, and I realize they run concurrently, the new window opens no matter what the user does (with the alerts showing in their various places). Based on other similar questions here, I tried adding a return false and return true statements to my conditionals, but this hasn't done anything. Now I know there are much better ways to do what I am doing here, and that my form validation is basic and weak, but as my first foray into programming, it was very important for me to understand everything I am doing, which I do, as of now. Can anyone show me how to fix this so the new window only opens if the form validates? I would prefer no jquery or no radical chances to the code, if possible. I appreciate everyone's input. Here is the code: test State: Zip:
has comment: http://stackoverflow.com/comment/38599713
score: 0
answer count: 2
tagged with: new-window
has title: form validation javascript stop new window from opening
accepted answer: http://stackoverflow.com/a/24851311
has comment: http://stackoverflow.com/comment/38594837
type: AnsweredQuestion
tagged with: forms
has answer: http://stackoverflow.com/a/24853968
type: Question
has answer: http://stackoverflow.com/a/24851311
possible better answer: http://stackoverflow.com/a/24853968

http://stackoverflow.com/q/24857950
has body: I’m submitting a form post using Angularjs (1.2.20) to Microsoft ASP.Net MVC 4: public ActionResult Save2(FormCollection customer) { //TODO: Do some stuffs... return new HttpStatusCodeResult(HttpStatusCode.OK); } However, the FormCollection is empty. I know that the data is being sent because if I change it to the following code below (using strongly type CustomerVm), it works as expected. public ActionResult Save1(CustomerVm customer) { //TODO: Do some stuffs... return new HttpStatusCodeResult(HttpStatusCode.OK); } I’m using FormCollection so that I can add ASP.Net anti-forgery token in the data (instead of headers). Below is my custom javascript code. Also you can find the entire code (Visual Studio) here
has title: ASP.NET MVC 4 FormCollection is Empty using Angularjs $Http.post
has answer: http://stackoverflow.com/a/24858298
type: Question
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24858298
answer count: 1
tagged with: asp.net
favorite count: 0
tagged with: angularjs
upvote count: 1
tagged with: asp.net-mvc-4
type: AnsweredQuestion
tagged with: asp.net-mvc
score: 1

http://stackoverflow.com/comment/38629278
score: 0
type: Comment
has text: This helps out with a few things however, I think I asked the question wrong. I am looking to run this on a website (not my own) and have it parse out data and check for new items (AJAX). I am wondering how to use it and how I can use JS on this website (can I run it through the console?)
comment on: http://stackoverflow.com/a/24871618
type: AnswerComment

npm
tags question: http://stackoverflow.com/q/24798870
tags question: http://stackoverflow.com/q/24830586
tags question: http://stackoverflow.com/q/24763863
tags question: http://stackoverflow.com/q/24874704
type: Tag
tags question: http://stackoverflow.com/q/24869959
tags question: http://stackoverflow.com/q/24830643
tags question: http://stackoverflow.com/q/24749469
tag name: npm
tags question: http://stackoverflow.com/q/24769087
tags question: http://stackoverflow.com/q/24822612

http://stackoverflow.com/q/24810004
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3698200
has answer: http://stackoverflow.com/a/24810983
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/24810110
score: 1
has comment: http://stackoverflow.com/comment/38511738
has comment: http://stackoverflow.com/comment/38511631
possible better answer: http://stackoverflow.com/a/24810276
has title: How do I load values into input text fields once the page is loaded?
has answer: http://stackoverflow.com/a/24810165
has answer: http://stackoverflow.com/a/24810276
has answer: http://stackoverflow.com/a/24810230
downvote count: 0
has body: Right now I'm trying out the following code, but nothing will appear in any of my input text boxes on page load. HTML: &lt;body onload="test()"&gt; &lt;input type="text" id="line0"&gt;&lt;/input&gt; &lt;br&gt; &lt;input type="text" id='line1'&gt;&lt;/input&gt; &lt;br&gt; &lt;input type="text" id='line2'&gt;&lt;/input&gt; &lt;/body&gt; Javascript: function test() { var value = "test|some|thing"; var valueArray = value.split("|"); for (var lineNumber=0; lineNumber &lt; valueArray.size(); lineNumber++) { line = "line" + lineNumber; document.getElementById(line).value = valueArray[lineNumber]; } } JFiddle: http://jsfiddle.net/mWL9m/1/ In my actual code, I will be bringing in a value from outside the function, but that isn't really important. Right now I'm just using the test value value. I've looked at several different threads, but all seem to be focused on onclick rather than onload.
tagged with: javascript
linked to: http://stackoverflow.com/q/14202601
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/5468350
answer count: 5
accepted answer: http://stackoverflow.com/a/24810165
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/24873915
has comment: http://stackoverflow.com/comment/38634005
has comment: http://stackoverflow.com/comment/38635998
answers question: http://stackoverflow.com/q/24873790
type: Answer
accepted answer of: http://stackoverflow.com/q/24873790
score: 0
has body: What you have for shrinking is the same as: height *= 0.9; width *= 0.9; and for enlarging: height *= 1.1; width *= 1.1; The reason that one is not the reverse of the other is that 1 / 1.1 is not 0.9 but 0.9090909090909. The reverse of increasing by 10% is not decreasing by 10%, but by about 9.1%. If you use 1 / 1.1 instead of 0.9, they will resize by the same rate. That is naturally the same as dividing by 1.1 to shrink: height /= 1.1; width /= 1.1; Rory McCrossan has a point in calculating the size from the original size, that way you avoid accumulating rounding errors. Having a variable zoom that is an integer value, starting at zero for original size, and increasing by one for each 10% step, you get: height = originalHeight * Math.pow(1.1, zoom); width = originalWidth * Math.pow(1.1, zoom);
type: AcceptedAnswer

http://stackoverflow.com/comment/38494661
type: Comment
type: QuestionComment
has text: could you please do this in the fiddle
comment on: http://stackoverflow.com/q/24800968
score: 0

http://stackoverflow.com/comment/38650481
comment on: http://stackoverflow.com/q/24883139
type: QuestionComment
score: 0
has text: Every documentation says I need to modify the plugin. that code is of 1200 + line
type: Comment

http://stackoverflow.com/q/24850998
answer count: 1
tagged with: jquery
tagged with: ajax
tagged with: ruby
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38588963
tagged with: ruby-on-rails
has body: If you click on a photo on Facebook or Instagram, the photo with enlarge (probably) using AJAX and then are appended parameters about the photo to the URL. How does it work? I would need something similar for menu items, but not sure under which term to search this.
type: Question
has title: Rails and AJAX - how to add parameters after call?
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/24851062

http://stackoverflow.com/comment/38489381
score: 0
type: QuestionComment
has text: I guess try using location.href, replace() removes the URL of the current document from the document history, meaning that it is not possible to go back?
type: Comment
comment on: http://stackoverflow.com/q/24798060

http://stackoverflow.com/comment/38521443
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24814987
type: QuestionComment
has text: no it is not refreshing

http://stackoverflow.com/comment/38628288
type: QuestionComment
type: Comment
has text: @JeremyS. yes it is shown
comment on: http://stackoverflow.com/q/24869542
score: 0

http://stackoverflow.com/q/24880842
has title: Call prototype based javascript function
has answer: http://stackoverflow.com/a/24890504
tagged with: javascript
tagged with: prototype
has body: I want to call function this.createVertexTemplate('text;spacingTop=-5;', 30, 20, 'Text', 'Text', true) but I'm beginner for prototype based JavaScript can any one guide me how can I call above function. my code is Here Sidebar.prototype.addGeneralPalette = function(expand) { this.addPalette('general', mxResources.get('general'), expand || true, mxUtils.bind(this, function(content) { //myT.appendChild(this.createVertexTemplate('text;spacingTop=-5;', 30, 20, 'Text', 'Text', true)); content.appendChild(this.createVertexTemplate('swimlane;whiteSpace=wrap', 200, 200, 'Container', 'Container', true)); content.appendChild(this.createVertexTemplate('whiteSpace=wrap', 120, 60, '', 'Rectangle', true)); content.appendChild(this.createVertexTemplate('rounded=1;whiteSpace=wrap', 120, 60, '', 'Rounded Rectangle', true)); content.appendChild(this.createVertexTemplate('text;spacingTop=-5;', 30, 20, 'Text', 'Text', true)); content.appendChild(this.createVertexTemplate('ellipse;whiteSpace=wrap', 80, 80, '', 'Circle', true)); content.appendChild(this.createVertexTemplate('ellipse;shape=doubleEllipse;whiteSpace=wrap', 80, 80, '', 'Double Ellipse', true)); content.appendChild(this.createVertexTemplate('shape=ext;double=1;whiteSpace=wrap', 120, 60, 'Double Rectangle', 'Double Rectangle', true)); content.appendChild(this.createVertexTemplate('shape=ext;double=1;rounded=1;whiteSpace=wrap', 120, 60, 'Double\nRounded Rectangle', 'Double Rounded Rectangle', true)); content.appendChild(this.createVertexTemplate('shape=process;whiteSpace=wrap', 120, 60, '', 'Process', true)); content.appendChild(this.createVertexTemplate('shape=parallelogram;whiteSpace=wrap', 120, 60, '', 'Parallelogram', true)); content.appendChild(this.createVertexTemplate('shape=trapezoid;whiteSpace=wrap', 120, 60, '', 'Trapezoid', true)); content.appendChild(this.createVertexTemplate('shape=document;whiteSpace=wrap', 120, 80, '', 'Document', true)); content.appendChild(this.createVertexTemplate('triangle;whiteSpace=wrap', 6…
answer count: 1
accepted answer: http://stackoverflow.com/a/24890504
has comment: http://stackoverflow.com/comment/38646909
type: AnsweredQuestion
score: 0
type: Question
tagged with: performance

http://stackoverflow.com/comment/38440874
comment on: http://stackoverflow.com/a/24772432
score: 0
type: AnswerComment
type: Comment
has text: that answer was different from my question

http://stackoverflow.com/q/24791119
has comment: http://stackoverflow.com/comment/38476987
has title: How to figure out why my webpage from crashing Google Chrome?
tagged with: javascript
upvote count: 2
tagged with: browser
has body: I am building a page that displays a list of images when you click a button and binds some JavaScript functions to allow you to perform some actions on those images. The html exists on page load, but is hidden until the button is clicked. For some users of the application, Google Chrome consistently crashes when they click to display this list. I have a hunch that Chrome is only crashing for users that have the most images. I'm guessing that Chrome is crashing when it tries to load so many images at the same time. I believe this is a browser bug (Chrome should be smart enough not to request so many images that it crashes), but until Chrome fixes this behavior, I'm going to have to adapt my code. It's possible that adding some sort of pagination will fix this problem, however, the solution isn't really my question. The problem is that I don't have any data to back up my assumption. I'd like to know how to debug/profile this scenario so I can see if that is the reason it is crashing.
tagged with: profiling
favorite count: 0
type: UnansweredQuestion
score: 2
answer count: 0
downvote count: 0
tagged with: google-chrome
type: Question
tagged with: debugging

http://stackoverflow.com/comment/38456926
type: Comment
has text: Where do you want the percentage signs to appear? I already see some in your `options` variable... If you actually want it in your "chart" then you'll need to post the relevant code...
comment on: http://stackoverflow.com/a/24781062
score: 0
type: AnswerComment

http://stackoverflow.com/q/24837487
tagged with: textarea
tagged with: events
linked to: http://stackoverflow.com/q/24607730
has title: Ace Editor Javascript: How to disable all extra commands that aren't default in textarea?
tagged with: ace-editor
type: Question
has answer: http://stackoverflow.com/a/24840630
tagged with: editor
has body: I want to use Ace Editor for event handling purposes, but do not want the extra functionality and commands (toggle lines, multiple cursors, etc.), but only the default commands. Is there a quick way to do this? My current approach is to create an array of the standardCommands in a textarea (not sure yet how to do that) and then to remove them from all commands like this: //Returns the set difference of this array and arr array Array.prototype.diff = function(arr) { return this.filter(function(i) {return arr.indexOf(i) &lt; 0;}); }; //Removes all Ace Editor commands which are not in the standardCommands array function removeSpecialCommands(editor) { var commands = Object.keys(editor.commands.commands); //gets all commands var specialCommands = commands.diff(standardCommands); //gets extra ace cmnds editor.commands.removeCommands(specialCommands); //removes those commands } However going through every command is not easy as many can't be called directly on the editor. So I'm not sure which commands are the standard ones. Is there a simpler way to get just the standard textarea commands (tab, insert, delete, movecursor with home, pgup, arrow keys, etc.)?
has comment: http://stackoverflow.com/comment/38568863
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/24840630
tagged with: javascript
has comment: http://stackoverflow.com/comment/38574977
has comment: http://stackoverflow.com/comment/38576831
type: AnsweredQuestion

http://stackoverflow.com/q/24785494
answer count: 2
accepted answer: http://stackoverflow.com/a/24785759
tagged with: javascript
tagged with: jquery
has body: I want to load some html from server, I store the loaded html in a string then I want to modify the values of certain tags and elements within that string before appending it : here is how I'm trying to do it : script of test1.html : .... test2.html old value
tagged with: http://stackoverflow.com/tag/html
score: 0
possible better answer: http://stackoverflow.com/a/24786152
has answer: http://stackoverflow.com/a/24785759
has comment: http://stackoverflow.com/comment/38465572
has answer: http://stackoverflow.com/a/24786152
type: AnsweredQuestion
has title: process html string before insertion
type: Question

http://stackoverflow.com/comment/38468959
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24786897
has text: "Not allowed to load local resource" is security warning.
score: 0

http://stackoverflow.com/comment/38984672
comment on: http://stackoverflow.com/a/25038802
type: AnswerComment
score: 0
type: Comment
has text: I like your answer anyway since it partially answers the question nicely and gives a good overview for future visitors :)

http://stackoverflow.com/q/24841330
upvote count: 0
tagged with: utf
type: Question
has comment: http://stackoverflow.com/comment/38570365
type: AnsweredQuestion
score: -1
has comment: http://stackoverflow.com/comment/38570292
has comment: http://stackoverflow.com/comment/38570800
tagged with: encoding
answer count: 1
has title: How to fix jquery ajax response with � (quotation mark block)
linked to: http://stackoverflow.com/q/553463
tagged with: javascript
has body: When I try to get html back from a ajax request I get multiple �. Why is this and how to correct it? $.ajax ({ type: 'POST', url: Generic.ajaxSluice, dataType: "html", data: { param: paramArr }, success:function(response) { console.log(response); } }); This code gives me this response in the console: [["������������������������...����������������������0", "../upload/images/Untitled-2.png"], ["1", "../upload/images/j.png"], ["2", "../upload/images/peppe.png"], ["�����������������������������������������"]]
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/38574861
has answer: http://stackoverflow.com/a/24841376
accepted answer: http://stackoverflow.com/a/24841376
downvote count: 1
tagged with: utf-8

http://stackoverflow.com/q/24756246
has answer: http://stackoverflow.com/a/24756315
score: 0
answer count: 1
has title: Angularjs get Json from $routeParams
tagged with: http://stackoverflow.com/tag/json
has body: I have a controller which will save address data and will change the location (using $location.path("/checkout/"+ $scope.checkOutAddress);)to the next page with the json response as parameter by $routeProvider.when('/checkout/:checkOutAddress', { templateUrl : 'partials/checkOut.html', controller : 'myController' }); In the checkout controller trying to get the value using the below code mCommerceApp.controller('myController', function($scope,$sessionStorage,$location,$routeParams,MCommerceService) { $scope.checkOutAddress=$routeParams.checkOutAddress; console.log($scope.checkOutAddress); }); So now the problem is I am not able to get the json value. It is coming as an object. The browser log displays [object Object]. Any help how to get the $routeparama as json? Thanks.
tagged with: javascript
type: UnansweredQuestion
type: Question
tagged with: angularjs

http://stackoverflow.com/q/24803195
possible better answer: http://stackoverflow.com/a/24803940
has title: Viewport JQuery - change document ready to if element is in viewport
has body: While working on a bigger project I made a box with different content. The box is 1000px width and shows 5 (out of 50) pictures. The box pages swtich from the first 5 to the next 5 and so on every 8 seconds (already wrote this with jQuery animated). Now my problem is, that the Box is in the middle of my page, so when visitors stay at the top and scroll down like 30 seconds later they miss the first pictures in my Box. So my plan is it to start the paging of my box at the very moment the visitor can see the box (viewport). i made a test page for that THIS BOX THIS BOX THIS BOX .box { border:2px solid black; height: 400px; width: 200px; margin: 0 auto; margin-top:10px; } http://jsfiddle.net/H9xr8/ so far Iam using jQuery(document).ready(function(){ getThemenCount(); moveThemenAnimate(); }); My plan is to switch from the document ready to a if element is in viewport kind of thing I've aleasy tried to find different ways but i cant seem to get it working. http://jsfiddle.net/moagrius/wN7ah/ is only working with different classes and with clicks. What i want to do (and what i cant get working) is that i want to start my animation script in the very Moment the Box gets in the viewpoer of the visitor. So that he will see my pictures in the box starting from picture 1. is there any possibility to get this to work like I planed it? somehow I cant find out how to set the jQuery expression + the script to work from itself only if i use classes and clicks (like in the fiddle above)
score: 1
has answer: http://stackoverflow.com/a/24803940
type: Question
accepted answer: http://stackoverflow.com/a/24803974
tagged with: javascript
tagged with: jquery
answer count: 2
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/24803974
upvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/comment/38544224
type: QuestionComment
has text: @FlorianGl err, is it possible to have a more comprehensive answer with some explanation?
comment on: http://stackoverflow.com/q/24827323
type: Comment
score: 1

http://stackoverflow.com/comment/38610833
comment on: http://stackoverflow.com/a/24855017
score: 0
type: AnswerComment
type: Comment
has text: I appreciate your comments and have made note of them, but I think my problem is a little more complex. Please see my updated code if you get the chance. Thanks again...

http://stackoverflow.com/q/24753463
tagged with: pinterest
has comment: http://stackoverflow.com/comment/38405261
upvote count: 9
has answer: http://stackoverflow.com/a/24754309
has answer: http://stackoverflow.com/a/24754862
has title: Show Pinterest hover buttons only on images with specified class
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24754862
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
type: Question
accepted answer: http://stackoverflow.com/a/24754309
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/56703885
score: 9
answer count: 3
has body: A client wants to have pinit buttons on hover over certain images on the site. I looked at the documentation on Pinterest's site and could only find how to set all images to pinit ones, with the option to turn off some images with a CSS class. But that would mean that 95% of all the images on the site would have to have a nopin class. Is there a way I can apply a class to images like "pinthis" so that ONLY them ones have the pinit buttons attached. I noticed that you can do something like this on Wordpress but this is a custom built site. Thanks in advance! Edit: This is the code I have put in the header tags as described in the Pinterest developer link above: &lt;script type="text/javascript" src="//assets.pinterest.com/js/pinit.js" data-pin-hover="true"&gt;&lt;/script&gt; This basically sets all images on the page to have pinit buttons, but I need them to only applied to images with a specific class

http://stackoverflow.com/comment/38472903
has text: @SamMonk yes I think that's a great idea for handling when a date is already present and the form is submitted. But how would it work the other way round? I.e. when there is an event type selected first. Also, how would it work if both a date and type exist and a new type or new date is selected?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24789111
type: QuestionComment

http://stackoverflow.com/a/64026524
type: Answer
score: 8
has body: For as far as i am aware the MediaStream.stop method is deprecated. If you want to stop a MediaStream you should stop and close it's tracks. Thwn doing this the "Chrome bar" you mention will disapear once all tracks bound to the shared screen are stopped. This can be achieved through the following code. "this.screenStream" is the MediaStream object of the shared screen. var tracks = this.screenStream.getTracks(); for( var i = 0 ; i < tracks.length ; i++ ) tracks[i].stop();
has comment: http://stackoverflow.com/comment/124793209
downvote count: 0
answers question: http://stackoverflow.com/q/24858071
upvote count: 8

http://stackoverflow.com/a/24849101
type: Answer
accepted answer of: http://stackoverflow.com/q/24849074
answers question: http://stackoverflow.com/q/24849074
has comment: http://stackoverflow.com/comment/38585337
has comment: http://stackoverflow.com/comment/38586101
upvote count: 1
has body: $ is a function. output is populated (and thus $('outputBlock') is executed) when BUILD.builder is created. If you use the second statement, $('outputBlock') is executed when buildExpenseTable is called. Most probably, BUILD.builder is initialized before the page has been entirely loaded and the DOM has been built, so BUILD.builder.output will be empty. Note that, further, the way you do it will cause $('#bearer'), $('#description'), etc. to be executed only once, namely at the time BUILD.builder is created; thus any subsequent changes to the DOM are ignored. That's probably not what you want? You can solve the problem by doing this: BUILD.builder = { bearer : function () { return $("#bearer") }, desc : function () { return $("#description") }, amount : function () { return $("#amount") }, output : function () { return $("#outputBlock") }, buildExpenseTable : function (){ BUILD.builder.output ().append($(BUILD.protoType.expenseDiv(BUILD.builder.bearer ().value))); } } If you are absolutely sure that you really want a "once-and-forever" initialization, put the initialization of BUILD.builder into a $(document).ready (...) handler, yet I would rather not do that. Second mistake: You probably won't find bearer, as you did not indicate the object where to look for it.
score: 1
has comment: http://stackoverflow.com/comment/38585303
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38585493
has comment: http://stackoverflow.com/comment/38585235

http://stackoverflow.com/comment/38660149
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24888456
has text: `$&` may be what you need, but it's unclear what you're asking.
score: 0

http://stackoverflow.com/q/24867441
has comment: http://stackoverflow.com/comment/38621979
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
has body: I have problems getting a form to work when I use JavaScript with it. Without the remote option set to true all works fine but as soon as I set it, change the controller and create the needed JS files it produces an POST .. 500 Internal Server Error when clicking on the submit button. Furthermore the reply-preview shows me a Rails Error Page saying NoMethodError in Vocabs#create and undefined method &gt; for nil:NilClass in a related partial (which works fine before using JS) The form (vocabs/_new_form.html.erb) looks like this: &lt;%= form_for @vocab, remote: true do |f| %&gt; &lt;%= render 'fields', f: f %&gt; &lt;%= f.submit "Add", class: "btn btn-large btn-primary" %&gt; &lt;% end %&gt; The vocab_controller's create action like this: def create @user = current_user @vocab = current_user.vocabs.build(vocab_params) @vocabs = @user.vocabs.paginate(page: params[:page]) respond_to do |format| format.html { if @vocab.save flash.now[:success] = "Vocab created!" redirect_to root_url else flash.now[:error] = "Vocab not saved!" render 'new' end } format.js end end The create.js.erb like this: $('#new_vocab').remove(); Of course I want to do more than just to remove the form but as I didn't even manage to do that I wanted to keep it simple. _fields.html.erb: &lt;%= render 'shared/error_messages', object: f.object %&gt; &lt;div class="field"&gt; &lt;%= f.label :nl_word, @user.native_language %&gt; &lt;%= f.text_field :nl_word %&gt; &lt;%= f.label :fl_word, @user.foreign_language %&gt; &lt;%= f.text_field :fl_word %&gt; &lt;%= f.label :tag, "Your Tag" %&gt; &lt;%= f.text_field :tag%&gt; &lt;%= f.label :importance, "Importance" %&gt; &lt;%= f.select(:importance, options_for_select( StaticData::IMPORTANCE_SEED, :selected =&gt; f.object.importance)) %&gt; &lt;/div&gt; I hope I could explain myself good enough to get some help here. I tried for hours to find the solution to the problem myself and was looking for similar questions here without finding any and without getting anyw…
has comment: http://stackoverflow.com/comment/38620563
tagged with: ruby
downvote count: 0
tagged with: ruby-on-rails
tagged with: form-for
has comment: http://stackoverflow.com/comment/38620368
type: AnsweredQuestion
score: 1
tagged with: javascript
has title: Form_for doesn't work with JS/JQuery
has answer: http://stackoverflow.com/a/24931096
has comment: http://stackoverflow.com/comment/38620583
accepted answer: http://stackoverflow.com/a/24931096
has comment: http://stackoverflow.com/comment/38620855
type: Question

grunt-contrib-copy
type: Tag
tags question: http://stackoverflow.com/q/24807970
tag name: grunt-contrib-copy

http://stackoverflow.com/comment/38612454
has text: Thanks @MindaugasVečkys . . I understood where I was going wrong :)
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24862496
type: Comment

http://stackoverflow.com/q/24846393
type: Question
has comment: http://stackoverflow.com/comment/38579997
has answer: http://stackoverflow.com/a/24846486
score: -1
has body: Is it possible to pull off the curvy line attached below without using images and only using css and/or javascript? Sorry it's tiny and light gray.. It hurts my soul to attach an image for this little guy! Thanks for reading.
has comment: http://stackoverflow.com/comment/38580004
has answer: http://stackoverflow.com/a/24846431
has answer: http://stackoverflow.com/a/24846536
tagged with: javascript
answer count: 6
has answer: http://stackoverflow.com/a/24846596
downvote count: 6
has comment: http://stackoverflow.com/comment/38580012
favorite count: 0
has answer: http://stackoverflow.com/a/24846429
upvote count: 5
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24846441
has title: Make a curvy line with css or javascript?
tagged with: css
has comment: http://stackoverflow.com/comment/38580104
has comment: http://stackoverflow.com/comment/38580053

http://stackoverflow.com/q/24899311
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38683069
has comment: http://stackoverflow.com/comment/38684321
tagged with: javascript
downvote count: 0
has title: Postgres syntax error. Node. Javascript
favorite count: 0
tagged with: postgresql
type: UnansweredQuestion
has body: I am trying to enter a set of asn prefix data to a database and I keep getting a postgres syntax error. This problem has completely stumped me. Here is the code where I pull a list of as numbers and pass them into an array. They are then fed into a loop that scrapes the website for the table that contains the prefix data. Every single As number works until number 81. var request = require('request'); var cheerio = require('cheerio') var pg = require('pg'); var squel=require('squel'); var conString="postgres://postgres:Password@localhost:5433/postgres" var client = new pg.Client(conString); var newArr = []; client.connect(function (err,data){ if(err) console.log("'Error connecting to PG'", err); else{ var query = squel.select().field("asnumber").from('"asntable"').limit(130); // console.log(query.toString()); client.query(query.toString(), function (err,res){ if (err) throw err; var x = JSON.stringify((res.rows)); var y = x.split(","); for (i in y){ newArr.push(Number(y[i].replace(/\D/g,''))) } console.log(newArr); for (apn in newArr) { var options = { url : 'http://bgp.he.net/AS'+newArr[apn]+'#_prefixes', headers: { 'User-Agent' : 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36' } }; request(options, (function(apn) { return function(err, resp, body) { var $ = cheerio.load(body); var x = $('#table_prefixes4'); console.log("*"+x.text()); $('#table_prefixes4 tr').each(function(index, prefix) { $(this).find('.nowrap').each(function(){ event = $(this).text().trim(); nextevent = $(this).next().text().trim(); console.log(apn+","+event+","+nextevent) var intoquery = squel.insert().into("secondastable").set("asnumber",newArr[apn]).set("prefixes",event).set("description",nextevent); console.log(intoquery.toString()) client.query(intoquery.toString()); }); }); }})(apn)) } }); } }); The problem is that I can find no discernible difference between the previous 0-80 and 81. Here is the error it gives me. er…
tagged with: node.js
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/38682391

http://stackoverflow.com/comment/54278161
score: 0
has text: If you try the download with the chrome dev tools open does it show any errors? I'm wondering if you are essentially sending the file as a 404 error page.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24803215

http://stackoverflow.com/q/24769552
possible better answer: http://stackoverflow.com/a/24769596
has comment: http://stackoverflow.com/comment/38435654
type: Question
has comment: http://stackoverflow.com/comment/38435736
has answer: http://stackoverflow.com/a/24770038
accepted answer: http://stackoverflow.com/a/24770038
has comment: http://stackoverflow.com/comment/38436175
answer count: 2
has answer: http://stackoverflow.com/a/24769596
has comment: http://stackoverflow.com/comment/38436000
tagged with: javascript
tagged with: jquery
score: 4
has body: i have problem. i don't no how to fix that problem HTML Code: &lt;div class="image"&gt; &lt;a href="#"&gt; &lt;img src="images/image1.jpg" id="mainimg-1"&gt; &lt;/a&gt; &lt;/div&gt; &lt;div class="otherthumbnailcontainer"&gt; &lt;div class="thumbnailimages" id="thumbnailcont-1"&gt; &lt;img src="images/image1.jpg" id="thumbnail-1" onMouseOver="changeimage('images/image1.jpg','mainimg-1','thumbnail-1','thumbnailcont-1');" class="thumbsmallimg selectedthumb"&gt; &lt;img src="images/image2.jpg" id="thumbnail-2" onMouseOver="changeimage('images/image2.jpg','mainimg-1','thumbnail-2','thumbnailcont-1');" class="thumbsmallimg"&gt; &lt;img src="images/image3.jpg" id="thumbnail-3" onMouseOver="changeimage('images/image3.jpg','mainimg-1','thumbnail-3','thumbnailcont-1');" class="thumbsmallimg"&gt; &lt;img src="images/image4.jpg" id="thumbnail-4" onMouseOver="changeimage('images/image4.jpg','mainimg-1','thumbnail-4','thumbnailcont-1');" class="thumbsmallimg"&gt; &lt;img src="images/image5.jpg" id="thumbnail-5" onMouseOver="changeimage('images/image5.jpg','mainimg-1','thumbnail-5','thumbnailcont-1');" class="thumbsmallimg"&gt; &lt;/div&gt; &lt;/div&gt; Here is code: function changeimage(thumburl,mainimgid,thumbnailimg,thumbmaindiv) { $('#'+mainimgid).attr("src", thumburl); // $('#'+thumbnailimg).add("thumbsmallimg selectedthumb"); $('#'+thumbnailimg).removeClass("selectedthumb").addClass('thumbsmallimg'); // $('#'+thumbnailimg).toggleClass("selectedthumb"); } Now what i would like to do on the website page is completely load the first image with these two class "thumbsmallimg selectedthumb" but when mouse goes over on another image the class "selectedthumb" will switch from one image to another. EDIT: http://jsfiddle.net/nZMpW/ Check this link. its like a product image gallery when you hover mouse on down image its come in big image. but first down image is selected if you move on another image its come in big image but is not select. css this ":hover" option only work when you …
favorite count: 0
has title: How to change Class From jquery but remove that class from another object
tagged with: http://stackoverflow.com/tag/html
upvote count: 4
has comment: http://stackoverflow.com/comment/38435529
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/a/24794635
type: Answer
accepted answer of: http://stackoverflow.com/q/24794543
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has body: You can seek class "dropdown-open". Might be: if ($(".dropdown-open").length &gt; 0) { // A dropdown is opened } else { // No opening dropdown }
answers question: http://stackoverflow.com/q/24794543

http://stackoverflow.com/a/24831160
has body: I would suggest adding a check for errors by checking: $_FILES["photo"]["error"], which may tell you if there is an issue with the photo upload. You also have to remember that when uploading photos with PHP that it is uploaded with a randomly generated name that you typically need to move to the final location before you do anything else with it. This is typically what you need to do in order to have access to the photo once it has been uploaded. if (file_exists("upload/" . $_FILES["photo"]["name"])) { echo $_FILES["photo"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["photo"]["tmp_name"], "upload/" . $_FILES["photo"]["name"]); echo "Stored in: " . "upload/" . $_FILES["photo"]["name"]; }
answers question: http://stackoverflow.com/q/24830924
score: 0
type: Answer

http://stackoverflow.com/a/24901764
upvote count: 2
has comment: http://stackoverflow.com/comment/38685723
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/38686111
has body: What mongoose does when your application starts and it itself initializes is scan your schema definitions for the registered models and calls the .ensureIndexes() method for the supplied arguments. This is the "by design" behavior and is also covered with this statement: When your application starts up, Mongoose automatically calls ensureIndex for each defined index in your schema. While nice for development, it is recommended this behavior be disabled in production since index creation can cause a significant performance impact. Disable the behavior by setting the autoIndex option of your schema to false. So your general options here are: Don't "drop" the collection and call .remove() which leaves the indexes intact. Manually call .ensureIndexes() when you issue a drop on a collection in order to rebuild them. The warning in the document is generally that creating indexes for large collections can take some time and take up server resources. If the index exists this is more or less a "no-op" to MongoDB, but beware of small changes to the index definition which would result in creating "additional" indexes. As such, it is generally best to have a deployment plan for production systems where you determine what needs to be done.
downvote count: 0
answers question: http://stackoverflow.com/q/24901570

http://stackoverflow.com/comment/38435859
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24769649
has text: sorry for the mistype - rough day
score: 0

http://stackoverflow.com/q/24822631
has answer: http://stackoverflow.com/a/24822761
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/10876558
type: Question
tagged with: polymer
has comment: http://stackoverflow.com/comment/38535171
has comment: http://stackoverflow.com/comment/38535149
has comment: http://stackoverflow.com/comment/38535094
tagged with: javascript
has answer: http://stackoverflow.com/a/24831957
accepted answer: http://stackoverflow.com/a/24831957
possible better answer: http://stackoverflow.com/a/24822761
has comment: http://stackoverflow.com/comment/38535543
has body: I created an array of 2 images and tried to display them, but instead of the images I got the text: object HTMLImageElement I am sure my images are in the right directory which I am currently working with. &lt; template is="auto-binding"&gt; &lt;section flex horizontal wrap layout&gt; &lt;template repeat="{{item in items}}"&gt; &lt;my-panel&gt;{{item}}&lt;/my-panel&gt; &lt;/template&gt; &lt;/section&gt; &lt;script&gt; (function() { addEventListener('polymer-ready', function() { var createImage = function(src, title) { var img = new Image(); img.src = src; img.alt = title; img.title = title; return img; }; var items = []; items.push(createImage("images/photos/1.jpeg", "title1")); items.push(createImage("images/photos/2.jpeg", "title2")); CoreStyle.g.items = items; addEventListener('template-bound', function(e) { e.target.g = CoreStyle.g; e.target.items = items; }); }); })(); &lt;/script&gt; What am I missing here?
answer count: 3
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has comment: http://stackoverflow.com/comment/38535222
score: 8
favorite count: 0
has answer: http://stackoverflow.com/a/24822960
upvote count: 8
has title: object HTMLImageElement showing instead of image
has comment: http://stackoverflow.com/comment/38535606
has comment: http://stackoverflow.com/comment/122773002

http://stackoverflow.com/q/24890255
has comment: http://stackoverflow.com/comment/38663561
has answer: http://stackoverflow.com/a/24890705
has comment: http://stackoverflow.com/comment/38663817
tagged with: node.js
has answer: http://stackoverflow.com/a/24890718
upvote count: 1
has comment: http://stackoverflow.com/comment/38663708
has comment: http://stackoverflow.com/comment/38664093
tagged with: loops
has comment: http://stackoverflow.com/comment/38663629
has answer: http://stackoverflow.com/a/24891930
has body: I have a function which contains another function call inside a for loop. outerFunction(){ for (var j = 0; j &lt; geoAddress.length; j++) { innerFunction(j); } } I need to wait till all the calls to innerFunction is complete. If I need parallel execution of these functions, how to achieve this in JavaScript?
has title: Wait until all the function calls inside for-loop ends its execution - Javascript
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38664589
answer count: 4
downvote count: 0
score: 1
tagged with: asynchronous
favorite count: 0
has answer: http://stackoverflow.com/a/24890758
type: Question

http://stackoverflow.com/comment/39093273
type: QuestionComment
comment on: http://stackoverflow.com/q/24822872
score: 0
has text: For DCEF3: See module ceflib.pas, function CefLoadLib, parameter JavaScriptFlags.
type: Comment

http://stackoverflow.com/q/24903506
score: 0
duplicate of: http://stackoverflow.com/q/7410949
has comment: http://stackoverflow.com/comment/38688688
tagged with: getelementsbyname
type: Question
tagged with: internet-explorer
tagged with: javascript
has comment: http://stackoverflow.com/comment/38688790
has comment: http://stackoverflow.com/comment/38689035
has body: This is my js function which run succesfully on chrome, safari, firefox. But on ie isn't working. How to solve it? function submitThis(name){ var form= document.getElementsByName(name)[0]; form.submit(); return true; }
has comment: http://stackoverflow.com/comment/38688818
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38688983
linked to: http://stackoverflow.com/q/7410949
linked to: http://stackoverflow.com/q/278719
tagged with: cross-browser
has title: getElementsByName is not working on ie
answer count: 0

http://stackoverflow.com/comment/38462149
comment on: http://stackoverflow.com/a/24780173
type: AnswerComment
type: Comment
score: 0
has text: @JoaoEvangelista Through the Network Analyzer from the Browser, I notice only the text input fields are sent to server, none of the file input fields are listed there. I expected all the fields should be here. I ever knew only fields with the atribute `name` are sent to server, which is what's happening here. Do you have any idea why this is happening?

http://stackoverflow.com/q/24766826
accepted answer: http://stackoverflow.com/a/24766850
type: Question
upvote count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/24766861
answer count: 4
linked to: http://stackoverflow.com/q/122102
has answer: http://stackoverflow.com/a/29816099
has title: How to update object properties within a loop?
has answer: http://stackoverflow.com/a/24767012
has body: I have found a behavior I did not expect when trying to use a loop in order to change the value set for a property in an object. Basically, I declare my object outside the loop. Then I loop on an array of numeric values, which values are used to update the object property. Inside the loop, I store the current object state inside an external array. The result is that instead of having an array containing a series of objects with different numeric values, I end up having the same numeric values in each object stored. Here is the fiddle http://jsfiddle.net/fAypL/1/ jQuery(function(){ var object_container = []; var numeric_values = [1, 2 , 3, 4]; var my_object = {}; jQuery.each(numeric_values, function(index, value){ my_object['value'] = value; object_container.push(my_object); }); jQuery.each(object_container, function(index, value){ jQuery('#content').prepend(value['value']); }); }); I would expect to get 1 2 3 4 as values stored in each object, however, what I get is 4 4 4 4, which does not make sense to me. Any hint on this behavior is more than welcome, thanks
tagged with: object
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24766861
has answer: http://stackoverflow.com/a/24766850

http://stackoverflow.com/a/24813611
has comment: http://stackoverflow.com/comment/38519167
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38518876
has comment: http://stackoverflow.com/comment/38520025
has comment: http://stackoverflow.com/comment/38520100
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/38519342
accepted answer of: http://stackoverflow.com/q/24813461
downvote count: 0
answers question: http://stackoverflow.com/q/24813461
has comment: http://stackoverflow.com/comment/38520138
has body: JS is a Prototype-based language. Objects aren't made and don't behave exactly the same as in Object Oriented languages. What this means is that when you call... Fruit.prototype = new Plant("Orange", "Orange"); You are defining that the Fruit "class" (though there aren't classes) is exactly the same as a Plant with with name => "Orange" and color => "Orange". Everything is copied, including the constructor. Besides the problem of all Fruit now being oranges, one way to fix this would be to include this line... function Fruit(type, isOrganic) { this.type = type; this.isOrganic = isOrganic; } Fruit.prototype = new Plant("Orange", "Orange"); Fruit.prototype.constructor = Fruit; // &lt;--- Add this Which makes Fruit use the Fruit() function as the constructor. Which is also passed down to all objects constructed with it.
score: 4

http://stackoverflow.com/q/24847384
tagged with: node.js
favorite count: 0
has comment: http://stackoverflow.com/comment/38591034
has comment: http://stackoverflow.com/comment/38592652
upvote count: 1
has comment: http://stackoverflow.com/comment/38597518
has comment: http://stackoverflow.com/comment/38583316
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38621172
has comment: http://stackoverflow.com/comment/38592677
has comment: http://stackoverflow.com/comment/38581797
has comment: http://stackoverflow.com/comment/38590922
type: Question
has comment: http://stackoverflow.com/comment/38598491
tagged with: mongodb
has answer: http://stackoverflow.com/a/24873723
has comment: http://stackoverflow.com/comment/38582264
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/38588147
tagged with: mongoose
tagged with: javascript
score: 1
tagged with: express
accepted answer: http://stackoverflow.com/a/24873723
has comment: http://stackoverflow.com/comment/38592668
has body: I have uploaded a site to Openshift...I have had to make many changes...including learning about version-ing and nvm (Node Version Manager). I had to go through a lot of npm version stuff just to make the requests happen (namely, the server used express version 3.2.5, while I was using 4.2.0, locally). Anyway, now I am on this weird problem where the mongoose function - Model.findById() simply doesn't seem to be able to find an object that is clearly in the database by the _id attribute. The flow is like this (and you can see it for yourself here - http://hackabox-eamonbenproject.rhcloud.com - my project): When I try to load a post on the page where you can view all the post info...the GET request happens, a route is called by express here: app.get('/api/posts/:id', api.showinfo); That api.showinfo function is this currently (although I have tried many different things): exports.showinfo = function(req, res, next) { var postId = req.params.id; Post.findById(postId, function (err, post) { console.log("what did u find?" + post); res.send({ postinfo: post.postinfo }); //res.json(post); }); }; That console.log("what did u find?" + post) outputs null, which means that something with mongoose's findById function is going wrong. I have logged to make sure that postId is the correct id...so that isn't the problem. I have also tried changing res.send({ postinfo: post.postinfo }); to res.json(post), res.send(post.postinfo), res.send({ profile: post.postinfo }) - with no luck. Does anyone know why findById might not be finding anything...the post.postinfo refers to my Mongoose virtual schema which looks like this: PostSchema .virtual('postinfo') .get(function() { return { '_id': this._id, 'posttitle': this.posttitle, 'content': this.content, 'username': this.username, 'date': this.date }; }); I thought using it with res.send how it is used in the user auth system in my seed might work - it is used there like this - and it works fine: exports.show = function (req, res, next) { …
has comment: http://stackoverflow.com/comment/38605061
has comment: http://stackoverflow.com/comment/38592129
has title: Very weird Mongoose/MongoDB issue when running MEAN site on Openshift
has comment: http://stackoverflow.com/comment/38592355

http://stackoverflow.com/comment/38581731
type: AnswerComment
type: Comment
score: 0
has text: Thanks for your response; I've added all the code. Please take a look.
comment on: http://stackoverflow.com/a/24847315

http://stackoverflow.com/a/43495024
has body: In order to solve that problem with Angular you can use the Event $locationChangeStart. $scope.$on('$locationChangeStart', function (event, next, current) { var answer = confirm("Are you sure you want to navigate away from this page"); if (!answer) { event.preventDefault(); } });
answers question: http://stackoverflow.com/q/24875603
type: Answer
score: 0

http://stackoverflow.com/a/24888283
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38692164
has body: OK still not really sure what you exactly want but have a look here: $(document).ready(function () { $(".navigation li").click(function () { activeSection = $(this).index(); scrollMeToSection(); }); var activeSection = 0; var wheel = true; function scrollMeToSection() { $('body').animate({ scrollTop: ($(window).height() * activeSection) }, '1000', 'swing', function () { // can do something when finishes animating here. }); } $(window).on('mousewheel DOMMouseScroll', function (event) { console.log(event); event.preventDefault(); event.stopPropagation(); if (wheel) { wheel = false; var goingUp = event.originalEvent.deltaY &gt; 0 ? false : true; if (activeSection === 0 &amp;&amp; goingUp) { wheel = true; return; } activeSection = goingUp ? (activeSection - 1) : (activeSection + 1); if (activeSection == $('.section').length) { activeSection = $('.section').length - 1; } scrollMeToSection(); setTimeout(function () { wheel = true; }, 1000); } }); }); Demo:http://jsfiddle.net/robschmuecker/yYJ3z/ This works on mousewheel scroll but not on scroll-bar scroll (which is a more than somewhat complex process to manage).
has comment: http://stackoverflow.com/comment/38661218
has comment: http://stackoverflow.com/comment/38694396
has comment: http://stackoverflow.com/comment/38666002
has comment: http://stackoverflow.com/comment/38694885
type: Answer
has comment: http://stackoverflow.com/comment/38666321
has comment: http://stackoverflow.com/comment/38694441
upvote count: 3
accepted answer of: http://stackoverflow.com/q/24884120
has comment: http://stackoverflow.com/comment/38694481
answers question: http://stackoverflow.com/q/24884120
has comment: http://stackoverflow.com/comment/117488022
score: 3
has comment: http://stackoverflow.com/comment/38692742
has comment: http://stackoverflow.com/comment/38694819
has comment: http://stackoverflow.com/comment/38661396
has comment: http://stackoverflow.com/comment/39393458
has comment: http://stackoverflow.com/comment/38694311

http://stackoverflow.com/a/24872237
has comment: http://stackoverflow.com/comment/38663840
answers question: http://stackoverflow.com/q/24870925
has comment: http://stackoverflow.com/comment/38632176
type: Answer
downvote count: 1
has comment: http://stackoverflow.com/comment/38630881
has comment: http://stackoverflow.com/comment/38663474
score: -1
has body: I just noticed I don't need this code in my js file any more var my12proddate = JSON.parse(sessionStorage.getItem('my12prodDate')); I commented it out and it worked . Thanks for your effort..
has comment: http://stackoverflow.com/comment/38649547
upvote count: 0
has comment: http://stackoverflow.com/comment/38664069
has comment: http://stackoverflow.com/comment/38630447

http://stackoverflow.com/q/24905906
possible better answer: http://stackoverflow.com/a/24906257
accepted answer: http://stackoverflow.com/a/24906205
tagged with: jquery-ui
has answer: http://stackoverflow.com/a/24906257
type: Question
has body: I'm trying to order elements from one list into two lists. However, when I drop the element and append it to the target div, the position is very strange (almost random). // contains generated words, draggable Word Word 2 ... // made droppable // made droppable The drop function: $('.target').droppable({drop: function(e,ui) { $(this).append(ui.draggable); }}); The following fiddle shows the problem with one target. http://jsfiddle.net/YZ8vJ/12/ I'm clueless why this is happening, and I haven't found an answer on SO or on the internet...
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: jQuery append wrong position
favorite count: 0
answer count: 3
has answer: http://stackoverflow.com/a/24906205
has answer: http://stackoverflow.com/a/24906008
score: 2
upvote count: 2
type: AnsweredQuestion

http://stackoverflow.com/comment/38628052
has text: @Dismissile:I think default value is HttpGET
type: Comment
score: 1
comment on: http://stackoverflow.com/a/24871324
type: AnswerComment

http://stackoverflow.com/comment/38418119
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24760122
has text: You were right, but when the cusor is in between some words, then still :-) will append at last. So how can I solve this?
score: 0

http://stackoverflow.com/comment/38572663
has text: No there isn't, when you have a nested object you can't just check the outer most property if you don't know if all the properties you're using are defined, you have to check each property that could potentially be undefined, and that's why it helps to know what you're expecting, and to check for that only, and not everything. You probably could use a try/catch to catch the error, but that's even worse and shouldn't be done.
type: Comment
comment on: http://stackoverflow.com/a/24842492
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38681876
comment on: http://stackoverflow.com/a/24897692
has text: Not to be too literal, but there's no such thing as associative arrays. There are Arrays and there are Objects. Arrays are Objects. Objects have properties. There's almost never a good reason to set properties (that aren't numeric) on Arrays. Arrays are meant to be used with numeric indexes and the specific methods provided (`push`, `pop`, etc.) that manipulate the internal representation of data (reflected in the `length` property). I think your solution is ideal, but `contacts` should be an object literal (`{}`), not an array (`[]`)
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38580956
type: Comment
has text: Please share a pen or fiddle.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24846940

http://stackoverflow.com/a/24897403
upvote count: 1
has comment: http://stackoverflow.com/comment/38677834
has comment: http://stackoverflow.com/comment/38678578
has comment: http://stackoverflow.com/comment/38678764
has body: I think using ng-src would solve your problem using angular. Plain src is evaluated before angular gets to it. See the docs. That said, I'm not sure why you would need to do this. Could you explain more what the problem is?
type: Answer
has comment: http://stackoverflow.com/comment/38678469
has comment: http://stackoverflow.com/comment/38677909
downvote count: 0
has comment: http://stackoverflow.com/comment/38678840
score: 1
answers question: http://stackoverflow.com/q/24897168

http://stackoverflow.com/a/24838623
downvote count: 0
score: 2
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/24838589
has body: It isn't. !! is useful when you are passing an object into a function that (like jQuery's toggle()) checks to see if its argument is a boolean, or when the function might stash its argument and thereby prevent the object from being collected. The case you cite is neither of those. Use a bare if.

http://stackoverflow.com/q/24829634
tagged with: d3.js
has answer: http://stackoverflow.com/a/24829832
has comment: http://stackoverflow.com/comment/38548692
has comment: http://stackoverflow.com/comment/38548567
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24829776
linked to: http://stackoverflow.com/q/10865025
has body: I have the following snippet of code which intends to update the value of the array "end" each time the if statement evaluates as true(in this case it equals to three). However, the array just gets superseded by the last update and all previous values are deleted. How can it be appended with the new set of values? d.forEach(function (d) { if (d.state_type=="end") { end=d.user_ids; } });
score: 0
has answer: http://stackoverflow.com/a/24829776
has comment: http://stackoverflow.com/comment/38549409
has title: Updating array after each iteration
accepted answer: http://stackoverflow.com/a/24829902
type: Question
has comment: http://stackoverflow.com/comment/38548820
has comment: http://stackoverflow.com/comment/38548647
tagged with: javascript
answer count: 3
has comment: http://stackoverflow.com/comment/38548667
has answer: http://stackoverflow.com/a/24829902

http://stackoverflow.com/comment/38799127
type: QuestionComment
score: 0
has text: You can view the created users by visiting your account dashboard and going to Simple Login -> Email/Password. There will be a list of simple login creds. But as David said, you need to store your own profiles in order to read them from Firebase.
comment on: http://stackoverflow.com/q/24845337
type: Comment

http://stackoverflow.com/a/24843226
accepted answer of: http://stackoverflow.com/q/24843092
answers question: http://stackoverflow.com/q/24843092
has body: Making an array is making this a bit harder than you need it to be if you need the IDs to match. If you want to reference it by the ID, you can simply use a vanilla JS object &lt;script&gt; var examples = {}; &lt;/script&gt; &lt;?php foreach($examples as $example):?&gt; &lt;script type="text/javascript"&gt; var example&lt;?php echo $example['id']?&gt; = { id : '&lt;?php echo $example['id']?&gt;', another : '&lt;?php echo $example['another']?&gt;', }; //here I would like to give key $example[id] examples['' + &lt;?php echo $example['id']?&gt;] = example; &lt;/script&gt; &lt;?php endforeach;?&gt; &lt;script&gt; for (var k in examples) { somefunction(examples[k]); } &lt;/script&gt; This will let you set arbitrary string keys and loop through just like an array.
score: 2
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/38574438
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/68257973
type: Answer
score: 2
has body: Create a listener folder, put all event handlers in separate files, and then with some tricks you can include all that listeners. in listener/index.js : module.exports = (io) =&gt; { const fs = require('fs'); const path = require('path'); const listenersPath = path.resolve(__dirname); io.on('connection', (socket) =&gt; { fs.readdir(listenersPath, (err, files) =&gt; { if (err) { process.exit(1); } files.map((fileName) =&gt; { if (fileName !== 'index.js') { require(path.resolve(__dirname, fileName))(io, socket); } }); }); }); }; and then in different files, you can handle listeners. listener/login.js: module.exports = (io, socket) =&gt; { socket.on('login', (data) =&gt; { // handle the event }); } in your app.js file: const initListeners = require('./listeners/index'); const server = app.listen(3000); const io = require('socket.io')(server); initListeners(io); you can also do this for the event emitters.
answers question: http://stackoverflow.com/q/24815106
downvote count: 0
upvote count: 2

http://stackoverflow.com/q/24755646
answer count: 2
has comment: http://stackoverflow.com/comment/38409514
has comment: http://stackoverflow.com/comment/38412694
has comment: http://stackoverflow.com/comment/38410596
downvote count: 0
has comment: http://stackoverflow.com/comment/38415816
tagged with: javascript
has comment: http://stackoverflow.com/comment/38414582
has comment: http://stackoverflow.com/comment/38409303
tagged with: jquery
has comment: http://stackoverflow.com/comment/38414627
tagged with: ajax
has comment: http://stackoverflow.com/comment/38409742
has comment: http://stackoverflow.com/comment/38414128
has comment: http://stackoverflow.com/comment/38410964
has comment: http://stackoverflow.com/comment/38414005
has comment: http://stackoverflow.com/comment/38410422
has answer: http://stackoverflow.com/a/24760429
favorite count: 0
has comment: http://stackoverflow.com/comment/38408862
has comment: http://stackoverflow.com/comment/38408818
has comment: http://stackoverflow.com/comment/38415194
has comment: http://stackoverflow.com/comment/38413966
has answer: http://stackoverflow.com/a/24757688
upvote count: 1
has comment: http://stackoverflow.com/comment/38412928
tagged with: php
has comment: http://stackoverflow.com/comment/38416005
has comment: http://stackoverflow.com/comment/38414268
type: AnsweredQuestion
tagged with: internet-explorer
possible better answer: http://stackoverflow.com/a/24757688
has comment: http://stackoverflow.com/comment/38416354
has comment: http://stackoverflow.com/comment/38417786
score: 1
has comment: http://stackoverflow.com/comment/38410228
has comment: http://stackoverflow.com/comment/38414485
has title: AJAX 'success' Calling before AJAX has executed in IE
accepted answer: http://stackoverflow.com/a/24760429
has comment: http://stackoverflow.com/comment/38413828
has comment: http://stackoverflow.com/comment/38410915
has comment: http://stackoverflow.com/comment/38414439
type: Question
has body: A Brief Description Another Internet Explorer issue to add to the list... I have a button on my page that closes the current tab/window, but before doing so it executes an AJAX request to 'delete the document session'. Very simple stuff: MN.ajax({ url: url, dataType: "JSON", errorText: 'There was a problem deleting the session, please retry later', success: function(data){ // Close the tab/window window.open(window.location, '_self').close(); } }); Ignore the MN.ajax(), this is just a wrapper function for $.ajax(), it works the same but with a few extra bits such as 'errorText' The Issue The above code works in every browser apart from IE. In IE, it closes the window/tab before the AJAX request has actually been executed. The AJAX request should delete a record from my database but no record is deleted unless I comment out the line window.open(window.location, '_self').close(); Possible Solution I have not tested this, but I assume that if I wrap the close window with a setTimeout then it should work. However, what I would like to know is why!!? Why on earth would it execute the 'success' function before the AJAX request has actually completed? What I have tried... One other thing I have tried is to put the 'close window' code into the complete call back instead of the success callback, but this made absolutely no difference... Update Here is the full containing function: /** * Close the Document */ MN.closeDocument = closeDocument; function closeDocument(document_reference,session_id){ // Show the loading dialog MN.loadingDialog('Closing Document...',function(){ // Execute the autosave function to save the session MN('#document-modify-form').autosave('save',function(){ MN.ajax({ url: '//api.example.net/document/session/'+document_reference+'/', dataType: "JSON", errorText: 'There was a problem getting the documents session', success: function(data){ // Only close if there are no changes switch(data.status){ // There is no session or no changes case 'no_session': ca…

http://stackoverflow.com/a/24813171
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24808751
score: 1
answers question: http://stackoverflow.com/q/24808751
has body: If you just want to detect when the user starts editing a cell : $scope.$on('ngGridEventStartCellEdit', function(evt) { //function goes here! }); (note the Start instead of End) More details here Otherwise, ForgetfulFellow's link should have your solution : cellEditableTemplate = "&lt;input ng-class=\"'colt' + col.index\" ng-input=\"COL_FIELD\" ng-model=\"COL_FIELD\" ng-change=\"updateEntity(row.entity)\"/&gt;" The ng-change will be called on each keystroke.
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/38665365
comment on: http://stackoverflow.com/a/24877495
has text: You would just download both versions of the file (via [`/files (GET)`](https://www.dropbox.com/developers/core/docs#files-GET) with the `rev` parameter) and then diff them. E.g., Python has a built-in library for diffing: [`difflib`](https://docs.python.org/2/library/difflib.html).
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38637680
type: AnswerComment
comment on: http://stackoverflow.com/a/24855132
type: Comment
has text: @user3646217 The last time I needed to store dataUrl's in Phonegap they didn't have the DATA_URL option, so that's a nice new feature. I think your question is then more of a Parse question, which I have never used. If you control the backend you can easily convert a dataUrl to a file by stripping of the dataUrl wrapper and base64 decoding the results, however I haven't used parse before but a little googling and find this: https://www.parse.com/questions/export-html5-canvas-image-to-parse-through-rest-api-or-javascript-sdk which may do what you need.
score: 0

http://stackoverflow.com/a/24852307
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 6
has comment: http://stackoverflow.com/comment/38591454
has comment: http://stackoverflow.com/comment/38591526
has body: Try this: var express = require('express'); var path = require('path'); var app = express(); app.use(express.static(path.join(__dirname, 'public'))); express.static is the method you're looking for, not app.static, though they would seem identical. Also, see this for an example of an application using both socket.io and express. Note that they only use the http server for socket.io, not serving the web pages.
score: 6
has comment: http://stackoverflow.com/comment/38591378
has comment: http://stackoverflow.com/comment/38591503
has comment: http://stackoverflow.com/comment/38591322
answers question: http://stackoverflow.com/q/24852222
accepted answer of: http://stackoverflow.com/q/24852222

http://stackoverflow.com/a/24875458
answers question: http://stackoverflow.com/q/24871791
type: Answer
has body: If you are using jQuery, jQuery automatically converts HTML to an element. This would be a shorter way: var element = $(interpolated).get(0); See http://api.jquery.com/get/ and http://api.jquery.com/jQuery/#jQuery2 So the whole process would be like this: var html = $('#item-foo').html() var interpolated = _.template(html, {prop: "and_values"}); var element = $(interpolated).get(0); And could be cleaned up to this: var interpolated = _.template( $('#item-foo').html() , { prop: "and_values" }); var element = $(interpolated).get(0);
score: 0

http://stackoverflow.com/comment/38430786
comment on: http://stackoverflow.com/q/24767153
score: 1
has text: http://stackoverflow.com/questions/13104494/does-javascript-pass-by-reference
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24810159
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38513439
has comment: http://stackoverflow.com/comment/38515439
has comment: http://stackoverflow.com/comment/38512715
type: Answer
has comment: http://stackoverflow.com/comment/38515393
has comment: http://stackoverflow.com/comment/38515328
has comment: http://stackoverflow.com/comment/38513834
has comment: http://stackoverflow.com/comment/38514351
accepted answer of: http://stackoverflow.com/q/24809503
score: 1
has comment: http://stackoverflow.com/comment/38513353
has comment: http://stackoverflow.com/comment/38514961
answers question: http://stackoverflow.com/q/24809503
upvote count: 1
has comment: http://stackoverflow.com/comment/38515179
has comment: http://stackoverflow.com/comment/38512368
has body: You need to split out the code that does the Ajax call into it's own function. Then, you can call it both from a click and a setInterval like below. Edit: This is a snippet taken from my fiddle. Essentially, it wires up each box as it's own chat container, and has an interval timer on each that only updates when the box is visible. $(document).ready(function () { var box = $('.box')[0]; //single copy of the target box $('.contact').click(function () { var id = $(this).closest('.contact').attr('id'); // load the user id if ($(".chat-windows").find("#" + id + "-window").exists()) { if($(".chat-windows").find("#" + id + "-window").is(":visible")) { //Do nothing, because the window is already there } else { $(".chat-windows").find("#" + id + "-window").fadeIn(200).css("display", "inline-block"); } } else { //This is a new box, so show it var newBox = box.cloneNode(); var windows = $(".chat-windows"); $(newBox).find(".chat-header").text(id); $(newBox).prop("id", id + "-window"); //var username = $(this).find('.username').attr('id'); windows.append($(newBox)); $(newBox).fadeIn(200).css("display", "inline-block"); updateChat({ ContactID: id }); setInterval(function() { if($(newBox).is(":visible")) { updateChat({ContactID: id}); } else { //do nothing so we aren't updating things that aren't seen and wasting time } // end if/else }, 10000); // fire every 10 seconds for this box } // end if/else }); $(document).on("click", ".close-chat", function(e) { $(e.currentTarget).parent().fadeOut(100)[0].removeNode(); }); }); //Global prototype function to determine if selectors return null $.fn.exists = function () { return this.length !== 0; }; // end function exists function updateChat(args) { //Do your Ajax here /*$.ajax({ url: 'ajax/chat.php', type: 'POST', data: { 'id': args.ContactID }, async: false, cashe: false, success: function (data) { $('#chat').html(data); } });*/ $("#" + args.ContactID + "-window").find(".messages").append("&lt;li&gt;" + "My Message" + "&lt;/li&gt;"); } …

http://stackoverflow.com/q/24793505
has comment: http://stackoverflow.com/comment/38481027
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38481071
has comment: http://stackoverflow.com/comment/38481057
has body: I was reviewing my techniques on handling links, and I stumbled upon an article that says the "target" attribute for links are NOT supported anymore, and not just links, but also forms and any other tags that use the "target" attribute. So my search for an easy alternative has been in vain because the proposed solutions are not as easy as they may seem, others even require some sort of javascript or php, like, come on it's just a single word in CSS for crying out loud. Now my question is this, is there some sort of easy, and I mean a very EASY alternative to this problem, it has to be purely CSS or HTML based, with the required effort no more than what it originally took to create it. PS: I'm still a beginner so pardon my lack of development aptitude.
upvote count: 1
tagged with: php
tagged with: css
has comment: http://stackoverflow.com/comment/38481614
has comment: http://stackoverflow.com/comment/38480988
score: 1
has answer: http://stackoverflow.com/a/24793557
has answer: http://stackoverflow.com/a/24795449
has comment: http://stackoverflow.com/comment/38481056
has title: Any formal alternatives for the deprecated "target" attribute?
has comment: http://stackoverflow.com/comment/38481042
type: Question
has comment: http://stackoverflow.com/comment/38483361
answer count: 2
has comment: http://stackoverflow.com/comment/38481017
has comment: http://stackoverflow.com/comment/38481038
has comment: http://stackoverflow.com/comment/38483381
has comment: http://stackoverflow.com/comment/38481007
has comment: http://stackoverflow.com/comment/38481692
tagged with: javascript
has comment: http://stackoverflow.com/comment/38482122
has comment: http://stackoverflow.com/comment/38480989
has comment: http://stackoverflow.com/comment/38482085
has comment: http://stackoverflow.com/comment/38481103
has comment: http://stackoverflow.com/comment/38481075
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
linked to: http://stackoverflow.com/q/1379585
has comment: http://stackoverflow.com/comment/38482855
favorite count: 0

http://stackoverflow.com/comment/41140506
type: Comment
score: 1
type: AnswerComment
has text: Can anyone give an update on this? How do we indicate 'scrollwheel: false' to an iframe src??! Plzz help... :(
comment on: http://stackoverflow.com/a/24769003

http://stackoverflow.com/a/24865325
has comment: http://stackoverflow.com/comment/38629694
upvote count: 2
type: AcceptedAnswer
has body: You're misusing the asynchronous API. See this answer for a general description of the problem. In your case, it should sufficient to move the logic into your first callback: chrome.browserAction.onClicked.addListener(function (tab) { chrome.windows.getCurrent(function(win) { var currentWidth = 0; var currentHeight = 0; var width = 440; var height = 220; // You can modify some width/height here alert(win.top); currentWidth = win.left / 2; currentHeight = win.top / 2; var left = (screen.width / 2) - (width / 2) - currentWidth; var top = (screen.height / 2) - (height / 2) - currentHeight; chrome.windows.create( { 'type': 'popup', 'width': width, 'height': height, 'left': left, 'top': top }, function (window) { chrome.tabs.executeScript(window.tabs[0].id, { code: 'document.write("hello world");' }); } ); }); // Here, currentWidth/currentHeight is not assigned yet });
has comment: http://stackoverflow.com/comment/38631072
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24862664
answers question: http://stackoverflow.com/q/24862664

http://stackoverflow.com/a/24788917
score: 1
type: Answer
has body: You're passing a string as your data. Try passin selected_builder without the surrounding ', like this: data: selected_builder,
upvote count: 1
answers question: http://stackoverflow.com/q/24788878
downvote count: 0

http://stackoverflow.com/comment/38605588
type: Comment
type: QuestionComment
has text: Still the same thing, stack does not remember the html i have inside a[x].box
comment on: http://stackoverflow.com/q/24859463
score: 0

slick.js
tag name: slick.js
type: Tag
tags question: http://stackoverflow.com/q/24889858
tags question: http://stackoverflow.com/q/24802405

http://stackoverflow.com/a/24839667
has comment: http://stackoverflow.com/comment/38567085
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/24839567
downvote count: 0
has body: Since the button does not yet exist you can use jQuery.on to delegate an event handler. $("body").on('click', 'button', function(){ var value = $(this).siblings(".title").text(); value += $(this).siblings(".date").text(); alert(value); }); Also your fiddle does not work since you are using both jQuery and MooTools but only loading MooTools. Added after seeing authors page: The var value = $(this).siblings(".title").text(); selector will not work. I would recommend adding an event class (as in calendar event) to the wrapper and using: var value = $(this).parents(".event").find(".title").text();
has comment: http://stackoverflow.com/comment/38567438
has comment: http://stackoverflow.com/comment/38567230
type: Answer

evaluation
tags question: http://stackoverflow.com/q/24844424
tag name: evaluation
type: Tag

http://stackoverflow.com/q/24773142
type: Question
linked to: http://stackoverflow.com/q/2870371
has answer: http://stackoverflow.com/a/24777706
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/24773190
answer count: 3
has answer: http://stackoverflow.com/a/24773627
has body: I have an array that i pass from javascript to php and in php page i am trying to put it in session to be used in the third page. The code is as below JavaScript: var table_row = []; table_row[0] = [123,123,123]; table_row[1] = [124,124,124]; table_row[2] = [125,125,125]; var jsonString = JSON.stringify(table_row); $.ajax({ type: "POST", url: "test1.php", dataType: "json", data: {myJSArray: jsonString}, success: function(data) { alert("It is Successfull"); } }); test1.php &lt;?php session_start(); $check1 = $_POST['myJSArray']; $_SESSION['array']= $check1; echo $check1; ?&gt; test2.php &lt;?php session_start(); $test = $_SESSION['array']; echo $test; ?&gt; on submit i call the function in javascript and the form takes me to test2.php. It is giving error on test2.php page Notice: Undefined index: array in C:\xampp\htdocs\test\test2.php on line 13 Any suggestions please do let me know.
downvote count: 0
tagged with: jquery
has title: javascript array in php using Ajax on submit not working
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/38441925
type: UnansweredQuestion
tagged with: php
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/38441962

http://stackoverflow.com/a/24900248
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/38691497
score: 86
accepted answer of: http://stackoverflow.com/q/24898012
has comment: http://stackoverflow.com/comment/38852870
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24898012
has comment: http://stackoverflow.com/comment/38710282
has body: If your state is an object: getInitialState: function() { return { x: 0, y: 0 }; } you can use setState to set individual keys on that object: this.setState({ x: 1 }); // y still == 0 React does no intelligent merging of your state; for example, this does not work: getInitialState: function() { return { point: { x: 0, y: 0 }, radius: 10 }; } this.setState({point: {x: 1}}); // state is now == {point: {x: 1}, radius: 10} (point.y is gone) [Edit] As mentioned by @ssorallen, you can use the immutability helpers to get the effect you're after: var newState = React.addons.update(this.state, { point: { x: {$set: 10} } }); this.setState(newState); See this JSFiddle for an example: http://jsfiddle.net/BinaryMuse/HW6w5/
upvote count: 86

http://stackoverflow.com/comment/41719184
comment on: http://stackoverflow.com/q/24767897
score: 0
has text: @Ninjakornjaca - did jquery toggle not work for you ?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38531982
type: AnswerComment
comment on: http://stackoverflow.com/a/24820961
has text: Murphy's law: *There is always one more problem* - `$container` is also created outside the scope of the function using it.
score: 0
type: Comment

http://stackoverflow.com/comment/38634689
type: Comment
type: AnswerComment
score: 1
has text: @Ian - I had considered that as well. I will edit it in.
comment on: http://stackoverflow.com/a/24874757

http://stackoverflow.com/comment/38484725
type: Comment
has text: @flybird: No, OP did ask for a *queue*, not a [deque](https://en.wikipedia.org/wiki/Double-ended_queue).
type: AnswerComment
comment on: http://stackoverflow.com/a/24795098
score: 0

http://stackoverflow.com/comment/39373443
score: 0
has text: Yes, please check this http://www.outcomes.somee.com/stories/tyler-yarde.aspx
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24843157

http://stackoverflow.com/q/24900360
upvote count: 3
duplicate of: http://stackoverflow.com/q/8528869
downvote count: 1
type: Question
score: 2
has comment: http://stackoverflow.com/comment/38682898
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24900407
linked to: http://stackoverflow.com/q/17145723
has body: i try to user switch (range of number) but it seems not work? can you help me check it where is the problem? JSFIDDLE case (tot&gt;10 &amp;&amp; tot&lt;110): $total.html(tot); $risk.html('小'); break; case (tot&gt;110 &amp;&amp; tot&lt;310): $total.html(tot); $risk.html('大');
has comment: http://stackoverflow.com/comment/38682772
duplicate of: http://stackoverflow.com/q/17145723
has title: how to use switch case(range of number) in jquery?
favorite count: 0
linked to: http://stackoverflow.com/q/1616724
linked to: http://stackoverflow.com/q/8528869
has answer: http://stackoverflow.com/a/24900407
type: AnsweredQuestion

http://stackoverflow.com/a/24828546
has body: You can add an option to a select input with append. Option 1 Add option var x = 2; $("button").click(function(){ $("select").append(" Option "+x+" "); x++; }); If you somehow save your option to x with ajax (I don't know how, never used ajax before), then execute append on your select, it will be added to the list without needing to be refreshed.
answers question: http://stackoverflow.com/q/24828396
score: 0
type: Answer

http://stackoverflow.com/q/24882436
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/24887051
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38650343
accepted answer: http://stackoverflow.com/a/24887051
tagged with: arrays
has comment: http://stackoverflow.com/comment/38649744
tagged with: jquery
has answer: http://stackoverflow.com/a/24882668
has body: I am creating a Weekly Timeslot.So far I have completed all the functionalities.But I need to compare the times.I don't know how to do.Please help.. Day of Week Office Hours Lunch Time Day off <?php $days = array( "1" => "SUN", "2" => "MON", "3" => "TUE", "4" => "WED", "5" => "THU", "6" => "FRI", "7" => "SAT"); foreach($days as $key => $value){ $val=$value; $obj = data($val); ?> <?php echo $value ;?><input type ="hidden" name ="day[<?php echo $key ?>]" value=<?php echo $value; ?> class="day_week"/> From <input type = "text" name="wk_from[<?php echo $key ?>]" id="office_hours_from_<?php echo $key; ?>" class ="working_from" value="<?php echo $obj['office_hour_from']; ?>" style="width:6em"> To <input type = "text" name="wk_to[<?php echo $key ?>]" id="office_hours_to_<?php echo $key; ?>" class ="working_to" value="<?php echo $obj['office_hour_to']; ?>" style="width:6em"> From <input type = "text" name="lunch_from[<?php echo $key ?>]" id="lunch_hours_from_<?php echo $key; ?>" class ="break_from" value="<?php echo $obj['break_hour_from']; ?>" style="width:6em"> To <input type = "text" name="lunch_to[<?php echo $key ?>]" id="lunch_hours_to_<?php echo $key; ?>" class ="break_to" value="<?php echo $obj['break_hour_to']; ?>" style="width:6em"> <?php if($obj['day_off']==1){ ?> <input type = "checkbox" name ="day_off[<?php echo $key ?>]" value="1" id="<?php echo $key; ?>" checked="checked" class="check_day_off"> <?php }else{ ?> <input type = "checkbox" name ="day_off[<?php echo $key; ?>]" value="1" id="<?php echo $key; ?>" class="check_day_off"> <?php } ?> <input type ="hidden" name="doc_id" value="<?php echo get_current_user_id; ?>"> <!-- <input type = "checkbox" name ="day_off[]" value" id="<?php //echo $key; ?>" class="check_day_off"?>--> <?php } ?> In this I have to compare the TO time of OfficeHours must be greater than From time.How can I do this comparision for each day.will that be done in jquery?Please Help.thanks in Advance..
has title: jQuery compare Array input field
tagged with: php
possible better answer: http://stackoverflow.com/a/24882668
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38650113
has comment: http://stackoverflow.com/comment/38649314

http://stackoverflow.com/comment/38421695
type: QuestionComment
has text: events[i] exists the problem is the participants variable. Yes i mean lenght-1 @kapa.
comment on: http://stackoverflow.com/q/24762348
score: 0
type: Comment

http://stackoverflow.com/comment/38510089
type: QuestionComment
has text: Are you clicking the image input before the page is done loading?
score: 0
comment on: http://stackoverflow.com/q/24809097
type: Comment

http://stackoverflow.com/comment/38524259
has text: Specifically for the selective x-axis showing; I want it only for the last graph of the set. I was thinking something like `if (symbol = symbols[symbols.length-1])` as the condition, but `symbols` the array isn't accessible once inside the array... how can I check if the passed symbol is the last one of the array?
type: Comment
comment on: http://stackoverflow.com/a/24812425
score: 0
type: AnswerComment

http://stackoverflow.com/q/24794408
tagged with: python
has body: I am making a (quite frankly) somewhat tenuous form. As such, I want it to save every time they input something into a data field. However, I don't want to save them as a user to the site until the form is complete and validated. This is what I imagine the javascript side to contain $('input').blur(function() { $.post(endpoint, form); }); however, what I currently have for the endpoint is something like this: @auth.route('/register', methods=['GET', 'POST']) def register(): """ register a new user using the form """ form = RegistrationForm() if form.validate_on_submit(): new_user = User( email=form.email.data.lower(), first_name=form.first_name.data.title(), last_name=form.last_name.data.title(), username=form.username.data.lower(), password=form.password.data ) db.session.add(new_user) flash('successfully registered!', 'success') return redirect(url_for('auth.login')) return render_template('user/register.html', form=form) this works well to register a user, but how do I simply save their form data for later use if they revisit without making them a user?
has comment: http://stackoverflow.com/comment/38502739
has answer: http://stackoverflow.com/a/24797116
type: Question
has title: auto-saving the contents of a WTForm
tagged with: javascript
tagged with: jquery
tagged with: flask
has comment: http://stackoverflow.com/comment/38504371
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38505170
tagged with: python-3.x
type: UnansweredQuestion

http://stackoverflow.com/comment/133759004
score: 2
has text: Brilliant! Works out of the box on v18.15.0 with no additional flags. Prints an "experimental feature" warning, but is working perfectly.
type: AnswerComment
comment on: http://stackoverflow.com/a/74816406
type: Comment

http://stackoverflow.com/a/24802701
answers question: http://stackoverflow.com/q/24802638
has comment: http://stackoverflow.com/comment/38498384
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38498557
has body: try this : One two jQuery : $(function(){ $('#selectOption').focus(function(){ alert('clicked'); }); }); Demo
has comment: http://stackoverflow.com/comment/38498550
has comment: http://stackoverflow.com/comment/38498626
has comment: http://stackoverflow.com/comment/38498541
downvote count: 0

weinre
type: Tag
tags question: http://stackoverflow.com/q/24904503
tag name: weinre

http://stackoverflow.com/q/24807258
type: Question
has comment: http://stackoverflow.com/comment/38506511
has comment: http://stackoverflow.com/comment/38506583
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/24807579
answer count: 2
has comment: http://stackoverflow.com/comment/38507123
has comment: http://stackoverflow.com/comment/38506711
has comment: http://stackoverflow.com/comment/38506749
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/24807712
has body: I made a demo which is here. All you have to do is start typing in the text field, make sure you have the console open. So as you type, you'll instantly see the OMG Saved, and the counter in the console will go nuts. Now click the button, watching the console you should see something like 11 or some other value, but you'll also see the counter reset and continues going. I do not want this. I want the counter to stop, I have clicked a button and while the page hasn't refreshed, the counter should stop if I understand these docs on setInterval(). the app I am developing which uses code very similar to this, does not refresh as most single page apps don't. So it is imperative that I have control over this setInterval. So my question is: How do I reset the counter such that, until I type again in the input box OR if the input box element cannot be found the flash message does not show up, the interval is set back to 0. update The following is the JavaScript code, which is run on the link provided above. var ObjectClass = { initialize: function() { $('#flash-message').hide(); }, syncSave: function() { $('#content').keypress(function(){ SomeOtherClass.autoSave = setInterval( function(){ $('#flash-message').show(); $('#flash-message').delay(1000).fadeOut('slow'); }, 500); }); }, listenForClick: function() { $('#click-me').click(function() { console.log(SomeOtherClass.autoSave); clearInterval(SomeOtherClass.autoSave); }); } }; var SomeOtherClass = { autoSave: null }; ObjectClass.initialize(); ObjectClass.syncSave(); ObjectClass.listenForClick();
has answer: http://stackoverflow.com/a/24807712
has title: clearInterval not working as I expect it too
has comment: http://stackoverflow.com/comment/38506715
has comment: http://stackoverflow.com/comment/38506432
has comment: http://stackoverflow.com/comment/38506315
accepted answer: http://stackoverflow.com/a/24807579
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38506653
has comment: http://stackoverflow.com/comment/38506770
has comment: http://stackoverflow.com/comment/38506486
upvote count: 1
has comment: http://stackoverflow.com/comment/38506731
downvote count: 1
has comment: http://stackoverflow.com/comment/38506550

http://stackoverflow.com/a/37852742
has body: You may change the PATH variable to C:\Program Files\nodejs' instead of C:\Program Files\nodejs\node_modules\npm\bin.
type: Answer
answers question: http://stackoverflow.com/q/24835915
score: 0

http://stackoverflow.com/q/24895155
score: 2
tagged with: audio
has comment: http://stackoverflow.com/comment/38673184
has comment: http://stackoverflow.com/comment/38673030
type: Question
has comment: http://stackoverflow.com/comment/38709068
upvote count: 2
has title: creating an equalizer with javascript audio api
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38673010
has body: I made and equalizer for a dj app using javascript audio API that was working for a couple months and then suddenly stopped working. The code hasn't changed so I am at a bit of a loss explaining what went wrong. I am manipulating the audio in real time and here is what is actually going on. HTML &lt;!-- this is the equalizer --&gt; &lt;div id="fx" style="display: none;"&gt; &lt;div class="lmhdiv"&gt; &lt;!-- when the range value is changed onmousemove call the equalizer function and pass in lo mid or hi --&gt; &lt;input id="lo" class="lmh" onmousemove="eq('lo');" type="range"&gt; &lt;input id="mid" class="lmh" onmousemove="eq('mid');" type="range"&gt; &lt;input id="hi" class="lmh" onmousemove="eq('hi');" type="range"&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- this is the audio --&gt; &lt;audio id="leftdisc" controls="" name="media" autoplay="" format="mpeg"&gt;&lt;source id="song" src="http://www.example.com/song.m4a" audio.type="audio/ogg"&gt;&lt;/audio&gt; Javascript //This block resets the equalizer when a new song comes on // Resets the equilizer function reset(){ mediaElement = document.getElementById('leftdisc'); document.getElementById('hi').value=50; document.getElementById('mid').value=50; document.getElementById('lo').value=50; sourceNode = context.createMediaElementSource(mediaElement); lofilter = context.createBiquadFilter(); midfilter = context.createBiquadFilter(); hifilter = context.createBiquadFilter(); // Low-pass filter. See BiquadFilterNode docs http://www.html5rocks.com/en/tutorials/webaudio/intro/ lofilter.type = 3; // high-pass filter. See BiquadFilterNode docs http://www.html5rocks.com/en/tutorials/webaudio/intro/ midfilter.type = 4; hifilter.type = 4; lofilter.frequency.value = 800; // Set cutoff to 440 HZ midfilter.frequency.value = 3000; // Set cutoff to 440 HZ hifilter.frequency.value = 5000; // Set cutoff to 440 HZ sourceNode.connect(lofilter); sourceNode.connect(midfilter); sourceNode.connect(hifilter); lofilter.connect(context.destination); …
has answer: http://stackoverflow.com/a/24896586
answer count: 1
tagged with: web-audio-api
has comment: http://stackoverflow.com/comment/38673081
favorite count: 0
tagged with: html5-audio
type: UnansweredQuestion

http://stackoverflow.com/a/24823612
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/24808029
has body: I solved it handling the key event in a different way. You can see it below: CKEDITOR.instances.editor.on('contentDom', function() { CKEDITOR.instances.editor.document.on('keyup', function(event) { var preview = document.getElementById('some-div'); preview.innerHTML = CKEDITOR.instances.editor.getData(); }); });
accepted answer of: http://stackoverflow.com/q/24808029

http://stackoverflow.com/a/24854425
has comment: http://stackoverflow.com/comment/38596270
type: AcceptedAnswer
downvote count: 0
has body: Have a look at below demo Live DEMO surround it by word boundary otherwise pineapple will be matched by apple \b(apple banana kiwi|apple banana|apple|banana|kiwi)\b Matches apple banana and kiwi pineapple juice 2 need apple banana pineapple milkshake 1 apple pineapple lower prices 1 only apple banana kiwi pineapple lovers 1 kiwi pineapple apple banana sales 2 EDIT If you change the order then the result will be something different \b(apple|banana|apple banana kiwi|apple banana|kiwi)\b Live DEMO apple banana and kiwi pineapple juice 3
has comment: http://stackoverflow.com/comment/38595801
score: 1
type: Answer
has comment: http://stackoverflow.com/comment/38596256
answers question: http://stackoverflow.com/q/24854401
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24854401

http://stackoverflow.com/comment/38412500
type: Comment
type: QuestionComment
has text: The type of the Content property you binding for must be a string. Check the type of the Content prop (it is binded to one of the sampleDataGroups i suppose).
comment on: http://stackoverflow.com/q/24757473
score: 0

http://stackoverflow.com/comment/62391476
has text: This still doesn't work for me. And your demo plays sound.
comment on: http://stackoverflow.com/a/24869361
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43418652
type: QuestionComment
has text: Made me wait a few days before "answering my own question" and I forgot @IsaacGregson
comment on: http://stackoverflow.com/q/24769919
score: 0
type: Comment

http://stackoverflow.com/comment/38568305
type: Comment
comment on: http://stackoverflow.com/a/24839762
has text: where should i put this and how can i display it sir?
score: 0
type: AnswerComment

http://stackoverflow.com/q/24882468
tagged with: dynamics-crm-2013
type: Question
has answer: http://stackoverflow.com/a/25167899
score: 1
has answer: http://stackoverflow.com/a/25430165
tagged with: dynamics-crm-2011
has comment: http://stackoverflow.com/comment/38712826
answer count: 2
upvote count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38702522
favorite count: 0
has title: Opening entity from external iframe CRM 2013
downvote count: 0
has body: We have a CRM 2011 solution with several custom ASP.NET MVC-based views and forms that are displayed in iframes on entities in CRM. Currently we're doing some analysis on upgrading to CRM 2013, and we've run into a problem with opening entity windows. We have mostly used window.open throughout the solution, both in JavaScripts on the CRM side of things, and in the custom ASP.NET MVC application. The URL passed to window.open is in the following format: http://crm.contoso.com/Contoso-Org/main.aspx?etn=opportunity&amp;pagetype=entityrecord&amp;id={...} The problem is that this seems to remember the context when it's opened in CRM 2013, so it just reopens the entity it was opened from. We solved this on the CRM end by using Xrm.Utility.openEntityForm instead, but it doesn't seem as if that is possible for the custom application, as we don't have access to the Xrm library from inside the iframe. The URL is correct, and if it's copy pasted into a new tab, it correctly loads the desired entity. When loaded with window.open though, it just reopens the same entity. Some suggestions have pointed to appending a histKey parameter consisting of a randomly generated number to the opened URL. However, this does not work consistently - sometimes it opens the correct entity, sometimes it just reopens the current entity - nor is it officially documented anywhere. Has anyone come across a solution to this?
type: UnansweredQuestion

http://stackoverflow.com/q/24908083
has comment: http://stackoverflow.com/comment/38697006
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
has body: Trying to write test from javascript in a span but firebug show's an error InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable -----updated question------- <xsl:for-each select="ColumnName"> <xsl:apply-templates /> </xsl:for-each>
score: 1
has title: appending text in a span tag using javascript
type: Question
has comment: http://stackoverflow.com/comment/38697083
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38696975
has comment: http://stackoverflow.com/comment/38697056

http://stackoverflow.com/comment/38518664
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24813338
type: AnswerComment
has text: Thanks for answering. I tried using your solution, but it still isn't removing the element from the array. I'll put up the details in the question.

http://stackoverflow.com/comment/38554465
type: QuestionComment
has text: can you tell what do you want in answer?
comment on: http://stackoverflow.com/q/24832613
score: 0
type: Comment

http://stackoverflow.com/q/24899026
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/24899819
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I am trying to create submenus within Bootstrap 3 (which we all know have been removed) and I would like to display the 2nd and 3rd levels of the menu on a click instead of a hover. For some reason every time I click on 2nd level or third level it simply closes the dropdown menu as if it is toggling the regular bootstrap open/close function. I need to work in a manor... 1.) Click on Top level - display down-drop items 2.) Click on item from drop-down - displays 2nd level items 3.) Click on item from 2nd level - displays 3rd level items basically i want to activate this css class .dropdown-submenu:hover>.dropdown-menu{display:block;} on a click instead of a hover. Currently i have tried the following Link To Fiddle http://jsfiddle.net/Tenacity/ejLDg/1/ Preferably can you should your solution on the fiddle. Feel free to rip this entire example apart to achieve a solution as i'm completely stuck. Thanks in advance. The HTML Toggle navigation Your Logo Here Top Level To 2nd 2nd to 3rd 3rd level The CSS .dropdown-submenu{position:relative;} .dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px;} .dropdown-submenu:hover>.dropdown-menu{display:block;} .dropdown-submenu>a:after{display:block;content:" ";float:right;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#cccccc;margin-top:5px;margin-right:-10px;} The JS $(document).ready(function() { $('.dropdown-submenu').on('click', function(){ $(this).parent().addClass('open'); $(".btn-navbar").click(); alert("clicked"); }); }); Thanks in advance :D
tagged with: twitter-bootstrap
upvote count: 3
has title: Submenus In Bootstrap 3 Adding Click Open Functions
type: Question
has comment: http://stackoverflow.com/comment/61348092
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/24899819
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/38444560
type: Comment
type: QuestionComment
has text: Did you add SplashScreen plugin?
comment on: http://stackoverflow.com/q/24771581
score: 0

http://stackoverflow.com/comment/103087170
type: AnswerComment
has text: This is the better answer
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24762975

http://stackoverflow.com/q/24759914
score: 0
answer count: 1
has title: Adding to database field on submit
has answer: http://stackoverflow.com/a/24760247
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38417395
has comment: http://stackoverflow.com/comment/38417125
type: Question
has body: In a div on my page called total_records is a database field binding which counts up the total records submitted. i use jquery for the submission so the page doesn't refresh when i click on the button. But i'm only able to get the total records submitted when i refresh the page or press F5. i know there a way out to add 1 to the binding on the page on button click but i don't know how. this is the jquery i use for the submission $(document).ready(function(){ $("#form2").on('submit',function(event){ $("#comment_loader").fadeIn(); //show when submitting event.preventDefault(); data = $(this).serialize(); $.ajax({ type: "POST", url: "insert.asp", data: data }).success(function(msg) { $('#new_entry').html(msg); $("#comment_loader").fadeOut('fast'); $("#msg_div").append(" Your comment has been saved "); setTimeout(function() { $(".messages").fadeOut(function(){ $(".messages").remove(); }); }, 3000); $("input[type=text]").val(""); }); }); });
tagged with: javascript
tagged with: jquery
tagged with: ajax

http://stackoverflow.com/comment/38462722
score: 0
has text: use \" instead if ': onclick='currentimage(\"+images[1]+\")'
comment on: http://stackoverflow.com/q/24784047
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38485893
comment on: http://stackoverflow.com/a/24795656
score: 0
type: AnswerComment
has text: Thanks @ Mohammadreza. and the code in the .asp file will be like that?! : `<%WritePLC("CNCProgram.Zeropoint.Z","paramZabs");%>` or `<%WritePLC("CNCProgram.Zeropoint.Z","?paramZabs");%>`
type: Comment

http://stackoverflow.com/q/24848924
tagged with: wordpress
type: Question
has comment: http://stackoverflow.com/comment/38585518
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/38585456
has body: Backstory I've been creating a wordpress theme based on twitter bootstrap. I would like to put in some front end validation for the forms. This would be for the comments form and eventually the contact form. Useful links BootstrapValidator Bootstrap Where I have got to I've got the front end validation working. However when I try to submit the form nothing happens. If I remove the Javascript code from my functions.php the form will submit, but there will be no front end form validation. Here is my code Comments form in comments.php Please note that is will submit if I delete my code in functions.php &lt;?php if ('open' == $post-&gt;comment_status) : ?&gt; &lt;div id="respond"&gt; &lt;h3&gt;&lt;?php comment_form_title( 'Add a comment', 'Leave a Reply to %s' ); ?&gt;&lt;/h3&gt; &lt;div class="cancel-comment-reply"&gt; &lt;small&gt;&lt;?php cancel_comment_reply_link(); ?&gt;&lt;/small&gt; &lt;/div&gt; &lt;?php if ( get_option('comment_registration') &amp;&amp; !$user_ID ) : ?&gt; &lt;p&gt; You must be &lt;a href="&lt;?php echo get_option('siteurl'); ?&gt;/wp-login.php?redirect_to=&lt;?php echo urlencode(get_permalink()); ?&gt;"&gt;logged in&lt;/a&gt; to post a comment. &lt;/p&gt; &lt;?php else : ?&gt; &lt;form action="&lt;?php echo get_option('siteurl'); ?&gt;/wp-comments-post.php" method="post" id="commentform" class="form-simple"&gt; &lt;?php if ( $user_ID ) : ?&gt; &lt;p&gt; Logged in as &lt;a href="&lt;?php echo get_option('siteurl'); ?&gt;/wp-admin/profile.php"&gt;&lt;?php echo $user_identity; ?&gt;&lt;/a&gt;. &lt;a href="&lt;?php echo wp_logout_url(get_permalink()); ?&gt;" title="Log out of this account"&gt;Log out &amp;raquo;&lt;/a&gt; &lt;/p&gt; &lt;?php else : ?&gt; &lt;div class="row"&gt; &lt;div class="form-group"&gt; &lt;div class="col-lg-12"&gt;&lt;label class="control-label" for="author"&gt;Name&lt;/label&gt;&lt;/div&gt; &lt;div class="col-lg-5"&gt;&lt;input class="form-control" name="author" id="author" value="" size="22" tabindex="1" type="text"&gt;&lt;…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38585412
tagged with: php
tagged with: twitter-bootstrap-3
has title: Validate a wordpress comments form using bootstrapValidator
answer count: 0
has comment: http://stackoverflow.com/comment/38585371

http://stackoverflow.com/comment/38493114
type: AnswerComment
score: 0
type: Comment
has text: Sorry, i'm not sure what are you trying to achieve, you are going through "selectRadio" each time a checkbox is selected, there you can code the logic that you want. Best.
comment on: http://stackoverflow.com/a/24799925

http://stackoverflow.com/comment/38517879
has text: hopefully, dats the other way round. But you did it :)
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24811505
score: 0

http://stackoverflow.com/q/24894237
tagged with: http://stackoverflow.com/tag/html
tagged with: local-storage
possible better answer: http://stackoverflow.com/a/24894657
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24894463
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/24894463
has title: Call specified keys from localstorage with javascript
tagged with: javascript
tagged with: jquery
has body: I would like to know if anybody knows how to call specified keys from localstorage like so: List of Keys: _#12345 _this is a random key _random123 _#54321 Ideal script: MyScript { Find all keys that start with "_#" then print value of key (ignore other keys) }
has answer: http://stackoverflow.com/a/24894657
score: 0

http://stackoverflow.com/comment/38738896
type: Comment
has text: @ahua, you need to store your just created id into hidden input inside any of your two tabs. I've just updated my answer, try it.
comment on: http://stackoverflow.com/a/24907500
score: 0
type: AnswerComment

http://stackoverflow.com/a/24818410
has comment: http://stackoverflow.com/comment/39230035
has comment: http://stackoverflow.com/comment/39201768
has comment: http://stackoverflow.com/comment/38532242
has comment: http://stackoverflow.com/comment/39237299
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38716373
answers question: http://stackoverflow.com/q/24816455
has comment: http://stackoverflow.com/comment/39200929
has comment: http://stackoverflow.com/comment/39199890
has comment: http://stackoverflow.com/comment/39199701
accepted answer of: http://stackoverflow.com/q/24816455
has body: Just use the pointWidth option on plotOptions for your series and set it to 1 or 2. See the fiddle: Example EDIT: with Highstocks, same thing, use pointWidth: Highstock example
has comment: http://stackoverflow.com/comment/39200804
type: Answer
has comment: http://stackoverflow.com/comment/38691095
has comment: http://stackoverflow.com/comment/39201396
has comment: http://stackoverflow.com/comment/38691147

printing
tags question: http://stackoverflow.com/q/24880643
tags question: http://stackoverflow.com/q/24851121
tags question: http://stackoverflow.com/q/24764424
tag name: printing
tags question: http://stackoverflow.com/q/24881055
type: Tag
tags question: http://stackoverflow.com/q/24823264
tags question: http://stackoverflow.com/q/24760557
tags question: http://stackoverflow.com/q/24862607

http://stackoverflow.com/q/24842286
tagged with: javascript
tagged with: pointers
downvote count: 0
answer count: 1
has body: I created quite a complicated UI structure. The type bool is here just as an example Complicated { property bool object function modify() { object = true } // complicated and long stuff here } And I put it into the UI like this (myvar is some boolean variable, say, exposed from C++ and myvar == false) Column { // some UI elements Complicated { id: comp; object: myvar } // more UI elements } Nothing has happened yet, so still myvar == false comp.modify() is called Now comp.object == true but myvar == false What should I do so that comp.modify() modifies myvar? In C++ I'd use pointers, but there are no pointers in QML/JS? I'm using Qt5 Thanks!
favorite count: 0
has title: Assign a variable to a property and modify the real object in QML
tagged with: qt
tagged with: c++
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/24842503
upvote count: 1
accepted answer: http://stackoverflow.com/a/24842503
type: Question
tagged with: qml

http://stackoverflow.com/q/24885104
has comment: http://stackoverflow.com/comment/38653599
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24885273
has comment: http://stackoverflow.com/comment/38653503
linked to: http://stackoverflow.com/q/24949516
has answer: http://stackoverflow.com/a/24886322
has comment: http://stackoverflow.com/comment/38653543
downvote count: 1
possible better answer: http://stackoverflow.com/a/24885225
type: Question
has answer: http://stackoverflow.com/a/24885225
score: 3
has body: HTML PAGE: <div id="d" one two SPLIT HERE end Pseudo CODE: var element = $("#d"); elemnet.split("img").such that = split_one = one two split_two = split here end split_three = Name of img class i.e = select image HTML PAGE may containg one or more image class inside a div?
has comment: http://stackoverflow.com/comment/38653442
upvote count: 4
answer count: 3
accepted answer: http://stackoverflow.com/a/24886322
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Splitting a html page based on tag

http://stackoverflow.com/q/24828917
score: 2
type: AnsweredQuestion
downvote count: 0
has title: fancybox ensure fancybox-image isn't cached
tagged with: image
tagged with: caching
tagged with: fancybox-2
type: Question
upvote count: 2
has body: I'm running into issues where fancybox is loading a cached image. I would like to ensure that the image is not cached before it appears on the page, but I haven't been success with trying to accomplish this through its various callbacks (beforeShow, afterShow, afterLoad, beforeLoad). This is what I currently have: $(".fancybox").fancybox({ helpers: { overlay: { locked: false } }, beforeShow: function(){ if($('.fancybox-image').length&gt;0){ console.log($('.fancybox-image').attr('src')); clearCacheImages('fancybox'); } } }); function clearCacheImages(source){ if(source == "all"){ // console.log('loading all images'); jQuery('img').each(function(){ jQuery(this).attr('src',jQuery(this).attr('src')+ '?' + (new Date()).getTime()); }); }else if(source=="fancybox"){ // console.log('loading fancybox image: ' + $('.fancybox-image').attr('src')); $('.fancybox-image').attr('src',$('.fancybox-image').attr('src')+ '?' + (new Date()).getTime()); } } When I click the next button in the fancybox slideshow, it shows the previous image rather than the first. Anyone know how and when to ensure that the fancybox image isn't cached?
has answer: http://stackoverflow.com/a/24831293
accepted answer: http://stackoverflow.com/a/24831293
tagged with: javascript
tagged with: jquery
favorite count: 0
answer count: 1

http://stackoverflow.com/q/24868628
has title: Can not submit a form via JS after Parsley validation
has body: After Parsley says the form is valid, the modal dialog is being shown to the user with the Accept/Decline button. Once Accept is clicked, the form is supposed to be submitted, however it doesn't happen. // Show the modal dialog before signing up. $('form#new_user').on('submit', function(e) { if ($('input#user_nda_accepted').val() !== 'true') { return false; } }); $.listen('parsley:form:validated', function(formInstance) { if (formInstance.isValid()) { $('body').addClass('modal--open'); } }); // Submit the form on Accept, hide the modal on Decline. $('.js-nda-accept').on('click', function(e) { e.preventDefault(); $('input#user_nda_accepted').val('true'); $('form#new_user').off('submit.Parsley').trigger('submit'); }); $('.js-nda-decline').on('click', function(e) { e.preventDefault(); $('input#user_nda_accepted').val('false'); $('body').removeClass('modal--open'); });
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38623131
has comment: http://stackoverflow.com/comment/38622787
answer count: 0
tagged with: forms
type: Question
tagged with: parsley.js
has comment: http://stackoverflow.com/comment/38622915
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38623474
tagged with: jquery

http://stackoverflow.com/comment/38524078
type: Comment
score: 1
has text: @Shelby115: Yes, it would help. Actually it's not even so uncommon to have a `function makeFoo() { return new Foo(); }` that can - in contrast to `Foo` - be used without `new`. Notice that constructor names should always be capitalized.
type: AnswerComment
comment on: http://stackoverflow.com/a/24813649

http://stackoverflow.com/comment/38439599
has text: I see, thank you, what about angularJS?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24771772
score: 0

http://stackoverflow.com/comment/38522725
comment on: http://stackoverflow.com/a/24814782
type: AnswerComment
score: 0
type: Comment
has text: Well, I meant I don't manually type in the string, it's automatically generated, sorry about tht

http://stackoverflow.com/q/24864559
type: AnsweredQuestion
has body: I'm trying to make a system, to make the user select a table row by itself, then press the delete button to delete it. So i made this: $("#container tbody tr").click(function () { $(this).addClass("selectedRow"); }); function delete() { var check = confirm("Are you sure you want to delete this?"); if (check) { $(".selectedRow").remove(); } } $("#delete-btn").click(delete); And for the CSS: #container tbody tr.selectedRow { background-color: red; } So i'm trying to achieve, when i click a table row inside the tbody that it gives the selectedRow class to it, but it removes the class of any other element in that same container. How do i make it so that i can only select one tr (table row)? My own try: $("#container tbody tr").click(function () { $(this).addClass("selectedRow"); $(this).parent().removeClass("selectedRow"); }); But that didnt work
has answer: http://stackoverflow.com/a/24864590
has title: jQuery add class and remove it for all the elements who doesnt have it
accepted answer: http://stackoverflow.com/a/24864587
type: Question
has answer: http://stackoverflow.com/a/24864709
has answer: http://stackoverflow.com/a/24864636
downvote count: 0
tagged with: javascript
answer count: 6
tagged with: jquery
has answer: http://stackoverflow.com/a/24864581
score: 1
tagged with: css
favorite count: 0
possible better answer: http://stackoverflow.com/a/24864581
has answer: http://stackoverflow.com/a/24864587
upvote count: 1
has answer: http://stackoverflow.com/a/24864578

http://stackoverflow.com/comment/38569465
comment on: http://stackoverflow.com/q/24840936
type: Comment
has text: Please add a http://jsfiddle.net demonstration of your problem.
type: QuestionComment
score: 0

http://stackoverflow.com/comment/38624934
has text: I believe so, yes. That is at least present in a lot of its documentation
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24869295

http://stackoverflow.com/q/24769444
possible better answer: http://stackoverflow.com/a/24770026
has answer: http://stackoverflow.com/a/24770026
accepted answer: http://stackoverflow.com/a/24770128
has body: I'm searching a way to replace all html comments from a string like browser does. (multilined and unclosed) For example, I actually use /(&lt;\!--[\s\S]*?--&gt;)/gim but if the html comment is unclosed, it does not replace it. Normally, if the comment tag is not closed, comment tag gets everything after open tag... Is there a way to adapt the regexp (or any other regexp) to do the stuff ? (in JavaScript)
has answer: http://stackoverflow.com/a/24792340
type: Question
tagged with: javascript
has title: JavaScript RegExp replace HTML comments
has comment: http://stackoverflow.com/comment/38435162
linked to: http://stackoverflow.com/q/1732348
score: 0
has comment: http://stackoverflow.com/comment/38449560
answer count: 3
has comment: http://stackoverflow.com/comment/38435188
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24770128
tagged with: regex
type: AnsweredQuestion

http://stackoverflow.com/a/24824154
accepted answer of: http://stackoverflow.com/q/24818166
answers question: http://stackoverflow.com/q/24818166
type: Answer
score: 3
upvote count: 3
has body: Apart from your own answer, you can explicitly check the status through the status function: casper.start("http://www.example.com/", function() { test.assert(this.status().currentHTTPStatus == 200); }); or even easier by using the tester module as you already do this: casper.start("http://www.example.com/", function() { test.assertHttpStatus(200); });
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/24797565
has title: How to extend absolutely positioned child divs beyond centred parent div with overflow?
has body: I've read and tried a lot of "how to extend child div beyond parent div" posts (a few hours worth), and been live testing in Firebug as well but I can't figure out how to extend child divs beyond a parent div where there are several positioning and overflow constraints. Goals (in reference to code snippet below) Make the first valid alert display beyond form_container. Scroll valid alert when scrolling ie don't make it 'fixed'. Constraints form_container must be centred. form_container must have overflow-y: auto. The actual implementation is complex, so I've simplified the structure below: test test valid alert filler filler valid alert filler filler filler What I've Tried As mentioned, I've tried many approaches such as wrapping the parent div and applying different overflow and position properties at various levels, but to lessen the complexity of this post, the barebones demo on jsFiddle is probably more useful and consists of the above HTML and the CSS below: #form_container { background:salmon; height:100px; overflow-y:auto; margin:auto; width:200px; position:absolute; left:0; right:0; } .message_container { position:absolute; } .valid_alert { position:absolute; background:limegreen; top:-25px; white-space: nowrap; } jsFiddle http://jsfiddle.net/rwone/LZxNm/ I'm open to any suggestions which satisfy the goals and constraints, for example either refactoring the HTML structure or even using Javascript/jQuery wizardry. Edit: For reference, adding some of the mechanisms of jQuery's offset() as discovered through the Firebug console which, just as an idea, could possibly be used in a solution: var myDiv = $("#my_div"); // create jQuery object myDiv.offset(); // find the current offset Object { top=119, left=510.51666259765625} var currentOffset = myDiv.offset(); // assign the current offset to a jQuery variable currentOffset; // view the value of the jQuery variable Object { top=119, left=510.51666259765625} new_top = currentOffset['top'] + 10; // create a new value…
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38488934
type: Question
has comment: http://stackoverflow.com/comment/38496750
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38489526
score: 0
tagged with: css

http://stackoverflow.com/comment/38853313
has text: This won't be possible. Then, you would have to spawn a child through the [child_process](https://github.com/ariya/phantomjs/wiki/Api-reference-childprocess) module. It may be possible to write it like an evaluate call which will be sandboxed.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24883847
type: Comment

http://stackoverflow.com/comment/38559267
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24835138
has text: i didn't catch the part about updating array. Might have to add a watch and empty the element when array changes

http://stackoverflow.com/a/26215505
upvote count: 1
type: AcceptedAnswer
type: Answer
has body: GridX, from version 1.3, has build-in HTML escaping, which is activated by parameter encode: true to the grid structure: var structure = [ { id: 'name', field: 'name', name: 'Name', encode: true}, { id: 'city', field: 'city', name: 'City', encode: true}, { id: 'score', field: 'score', name: 'Score} ]; var grid = Grid({ id: 'grid', cacheClass: Cache, store: store, structure: structure });
accepted answer of: http://stackoverflow.com/q/24881033
downvote count: 0
answers question: http://stackoverflow.com/q/24881033
score: 1

http://stackoverflow.com/q/24846617
has answer: http://stackoverflow.com/a/24846660
favorite count: 0
has answer: http://stackoverflow.com/a/24846682
accepted answer: http://stackoverflow.com/a/24846682
downvote count: 5
has title: Javascript regex replacement of single character between alphanumeric strings.
possible better answer: http://stackoverflow.com/a/24846653
tagged with: regex
answer count: 4
type: AnsweredQuestion
score: -4
linked to: http://stackoverflow.com/q/22937618
type: Question
has comment: http://stackoverflow.com/comment/38580588
has answer: http://stackoverflow.com/a/24846653
tagged with: javascript
has body: I need to do a string substitution/replacement via regex and I just can't figure it out. The string is in the following format: http[s]://assets.example.com/images/[8 or 9 alphanumberic chars]m/[ 8 or 9 different alphanumeric chars].jpg The character I want to replace is the m in the middle of the 2 alphanumeric strings. Here's an example of what I'm trying to do. http://assets.example.com/images/11233434m/23435436.jpg and I want to change it into http://assets.example.com/images/11233434l/23435436.jpg I'm familiar with str.replace, I just can't come up with a regex that works, without replacing incorrect characters (like the last m in example.com/)
has comment: http://stackoverflow.com/comment/38580495
has answer: http://stackoverflow.com/a/24846662
upvote count: 1
has comment: http://stackoverflow.com/comment/38580465

restful-architecture
type: Tag
tags question: http://stackoverflow.com/q/24893509
tag name: restful-architecture

http://stackoverflow.com/q/24837413
favorite count: 0
upvote count: 1
has answer: http://stackoverflow.com/a/24844129
has comment: http://stackoverflow.com/comment/38569713
type: AnsweredQuestion
type: Question
has title: How can we stop the data being send whenever there in invalid popover message in the form of bootstrap?
answer count: 1
accepted answer: http://stackoverflow.com/a/24844129
downvote count: 0
has comment: http://stackoverflow.com/comment/38582393
tagged with: javascript
tagged with: jquery
has body: The problem in this form is whenever the empty field is entered it shows a popover "saying this field is required", but the message is posted into the database. How can I stop this until all of the popover is made valid? Login EmailAddress: Login
tagged with: validation
score: 1

http://stackoverflow.com/q/24801047
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24801242
has comment: http://stackoverflow.com/comment/38494641
downvote count: 0
accepted answer: http://stackoverflow.com/a/24801141
tagged with: jquery
favorite count: 0
has body: i have a simple question about JQuery... I have a main containing some divs, which have dynamical ids. each child div has a tag in it. These h4 does not have any id, nor class, nor name. They just have some text in it. Here is what i'm talking about : Sometext01 Sometext02 Special Text!!! Sometext04 I would like to get the parent div's id of the h4 which text is "Special text!!!" (so, here, in this example, it is div03). But, unfortunately, these ids are auto generated (by Sugarcrm, for those who know), and i can't know by advance the id's name. So that is why i have to pass by the h4. I know i can use the jQuery function below to pass through all h4 allMyH4.each() And i know i can use the jQuery function below to find the parent of my desired h4 myFoundH4.parent() But i'm getting some trouble on searching the h4 by their text() (or html() ) Could you please help me on that? Thanks a lot EDIT few hours later : Thanks to @Bhushan , i could do what i really wanted. It just has a restriction : my user MUST not change h4 texts NOR giving several h4 the same name containing my string. For another solution, try @rory too, it did not work for me, but it had been tested by others, and it seems to be better than contains.
has comment: http://stackoverflow.com/comment/38494644
type: Question
has comment: http://stackoverflow.com/comment/38494713
tagged with: http://stackoverflow.com/tag/html
has title: Jquery finding a specific H4 with no id nor name nor class
has answer: http://stackoverflow.com/a/24801098
has comment: http://stackoverflow.com/comment/38494601
upvote count: 2
has answer: http://stackoverflow.com/a/24801357
possible better answer: http://stackoverflow.com/a/24801139
has answer: http://stackoverflow.com/a/24801141
tagged with: each
has answer: http://stackoverflow.com/a/24801139
tagged with: javascript
answer count: 5

http://stackoverflow.com/q/24839931
type: Question
has comment: http://stackoverflow.com/comment/38567684
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38567676
favorite count: 0
has answer: http://stackoverflow.com/a/24840066
answer count: 3
has comment: http://stackoverflow.com/comment/38567785
has body: I have this regex: (@"^[^/;\\'-]+$) Which not allowed apostrophe or hyphen in this regex. Also I have to check that there will not allowed double quotes and double dash in this regex. I want to modify this regex.
tagged with: regex
has comment: http://stackoverflow.com/comment/38567515
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/38567518
has title: Regular expression are not working
score: 1
has answer: http://stackoverflow.com/a/24840391
has answer: http://stackoverflow.com/a/24840062

http://stackoverflow.com/q/24786085
type: AnsweredQuestion
score: 3
upvote count: 3
has title: Manually applying the ngModel directive
has answer: http://stackoverflow.com/a/24808480
has answer: http://stackoverflow.com/a/24787863
type: Question
tagged with: angularjs-directive
possible better answer: http://stackoverflow.com/a/24787623
tagged with: angular-ngmodel
has answer: http://stackoverflow.com/a/24787623
downvote count: 0
tagged with: javascript
has body: My directive needs to use ngModel. I need to do this dynamically from within another directive as I want to do some funky stuff with scopes and abstract this away from the person writing the HTML. My first thought was to use the $set function provided by the attrs argument in the link function, that works to modify the HTML but the directive itself does not get compiled. We can then combine this with the $compile provider, and it works. attrs.$set('ngModel', someVar); $compile(element)(scope); The problem is that this creates infinite recursion if I do not (and I can not) replace the elements tag as the directive gets reapplied and recompiled indefinitely. However I can fiddle with the priorities and get that to work: module.directive('input', [ '$compile', function($compile) { return { restrict: 'E', scope: {}, priority: 100, // Set this high enough to perform other directives terminal: true, // Make sure this is the last directive parsed link: function(scope, element, attrs) { var key = 'example'; attrs.$set('ngModel', key); $compile(element, null, 100)(scope); } }; } ]); This works fine, but it just feels wrong: I now have to ensure that all other directives on the element are capable of being recompiled as they will all get compiled twice. I have to make sure that nobody uses a higher priority. So this got me thinking why can't I just inject the ngModelDirective and force compile it against my element? module.directive('input', [ 'ngModelDirective', function(ngModel) { return { restrict: 'E', scope: {}, priority: 100, // Set this high enough to perform other directives terminal: true, // Make sure this is the last directive parsed require: '?^form', link: function(scope, element, attrs, formCtrl) { var key = 'example'; attrs.$set('ngModel', key); var ngModelFactory = ngModel[0]; var ngModelLink = ngModelFactory.compile(element); ngModelLink.call(this, scope, element, attrs, [ngModelFactory.controller, formCtrl]); } }; } ]); See: https://github.com/angular/angula…
accepted answer: http://stackoverflow.com/a/24808480
answer count: 3
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/q/24884171
tagged with: c#
has comment: http://stackoverflow.com/comment/38684587
tagged with: javascript
tagged with: jquery
has body: I am looking for a way to maintain the GridView TextBox values which are set by jQuery across postbacks. I searched a lot on Google but could not find a solution. function CalculateTaxes() { var taxvaluesum = 0; $(".taxvalue").each(function () { //add only if the value is number if (!isNaN(this.value) &amp;&amp; this.value.length != 0) { taxvaluesum += parseFloat(this.value); } else { $(this).val('0') } }); //$('.totaltaxvalue').val(taxvaluesum.toFixed(2)); $('.totaltaxvalue').attr("value", taxvaluesum.toFixed(2)); var finalamt = parseFloat($('.totaltaxvalue').val()) + parseFloat($('#ContentPlaceHolder1_Gridview1_txtftrvalue').val()); $('.finalamount').attr("value", finalamt.toFixed(2)); //$('.finalamount').val(finalamt.toFixed(2)); } $(document).on('blur', ".taxvalue", function (e) { CalculateTaxes(); var roundedvalue =parseFloat($(this).val()).toFixed(2); $(this).val(roundedvalue); $(this).siblings('input[type="hidden"]').val(roundedvalue); alert($(this).siblings('input[type="hidden"]').val()); });
has title: How to maintain/access textbox values across postbacks which are set by Javascript/Jquery?
has comment: http://stackoverflow.com/comment/38652215
score: 0
has answer: http://stackoverflow.com/a/24993553
answer count: 1
tagged with: asp.net
has comment: http://stackoverflow.com/comment/38652415
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38652605
has comment: http://stackoverflow.com/comment/38656718
has comment: http://stackoverflow.com/comment/38652270
type: Question

http://stackoverflow.com/comment/38582513
has text: this is an assignment given to me by my teacher. he is going to check it and will surely ask me this question. please answer my question how will the functions get the digital signature and i'll select your answer.
score: 0
comment on: http://stackoverflow.com/q/24847591
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38664296
comment on: http://stackoverflow.com/q/24873004
has text: Do you want one event to happen after 250 ms and when it's done another event to fire after 600 ms?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38431961
comment on: http://stackoverflow.com/q/24767799
score: 0
type: QuestionComment
type: Comment
has text: How is the validation done?

http://stackoverflow.com/comment/38484040
has text: are u referring asking about Javascript? if so, it is case sensitive
comment on: http://stackoverflow.com/q/24795108
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24811899
has answer: http://stackoverflow.com/a/24825852
has comment: http://stackoverflow.com/comment/38519716
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/38515321
linked to: http://stackoverflow.com/q/4599169
has comment: http://stackoverflow.com/comment/38518034
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38515531
accepted answer: http://stackoverflow.com/a/24825852
has body: So here is my problem, and I'm sure it's something very simple. I'm relatively new to Web Development and I'm running into a little problem that I just can't figure out. I have this code in an MVC view. . . @{ var data = ""; var count = 1; foreach (var item in ViewModel.Data) { data += count.ToString() + "," + item.Reading.ToString() + "\n"; count++; } } I want to pass this 'data' variable to a very tiny script in order to create a graph using Dygraph. This is what I currently have, and believe should work, it doesn't though. &lt;script type="text/javascript"&gt; g = new Dygraph(document.getElementById("readingGraph"), @data,{ labels: ["Sample Number", "Reading"] }); &lt;/script&gt; I know the script itself will work. If I hard-code some CSV values into a string where @data is, the graph pops up and everything is fine. With the @data there, the graph doesn't load and the script won't run at all (I placed an alert('hi') in there to see if it would pop-up, it didn't). In addition, I know the string is being 'built' correctly because I have set break points in Visual Studio and checked. Any help at all would be great guys. Thanks in advance.
linked to: http://stackoverflow.com/q/5614941
tagged with: razor
has title: Passing C# variable using MVC/Razor for use with Dygraph
tagged with: asp.net-mvc-4
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24817089
tagged with: dygraphs
has answer: http://stackoverflow.com/a/24817089

http://stackoverflow.com/comment/38427725
type: Comment
has text: Did you try changing `$(this).window.open("page.html");` to `window.open("page.html");`...
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24765478

http://stackoverflow.com/q/24780692
linked to: http://stackoverflow.com/q/2753732
score: 2
answer count: 0
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: blur
has body: I am making a blur in Firefox using :"filter: url(blur.svg#blur);" which is in a CSS file, I want to change a value in blur.svg using javascript. I saw this How to access SVG elements with Javascript and this Dynamically modifying an SVG filter with javascript but the first creates a object of svg in the html and the second the filter exists in the html which i do not want, I was hoping I can access it without doing that. Thanks in advance for anyone who tries to help.
tagged with: filter
type: Question
has title: change values in standalone svg with javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
upvote count: 2
tagged with: css
linked to: http://stackoverflow.com/q/19129298

http://stackoverflow.com/q/24848583
has title: Mobiscroll: Auto Scroll to specific value on load (custom wheels)
tagged with: javascript
has answer: http://stackoverflow.com/a/24848673
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: mobiscroll
has body: I couldn't find in the mobi doc how to set auto wheel scroll on load. I have 2 custom wheels like this: var whl1 = {'1_Value1':'1_Value1', '1_Value2':'1_Value2', '1_Value3':'1_Value3', '1_Value4':'1_Value4', '1_Value5':'1_Value5', '1_Value6':'1_Value6', '1_Value7':'1_Value7'}; var whl2 = {'2_Value1':'2_Value1', '2_Value2':'2_Value2', '2_Value3':'2_Value3', '2_Value4':'2_Value4', '2_Value5':'2_Value5'}; I want '1_Value4' from the first wheel and '2_Value5' from the second wheel to be the default value on load. Here is a jsFiddle for test - http://jsfiddle.net/3bScd/225/ Any help would be greatly appreciated :)
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/comment/38689896
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24904120
has text: Can you post a jsfiddle with `meter` tag demo.

http://stackoverflow.com/comment/38638874
type: Comment
has text: I'm still trying to get my hear around this, it's still ignoring the count and I can't console log during where the count is being incremented.
comment on: http://stackoverflow.com/a/24874061
type: AnswerComment
score: 0

http://stackoverflow.com/comment/69641005
comment on: http://stackoverflow.com/a/24898081
score: 1
type: AnswerComment
has text: Only works in Chrome on Windows 7. Not in firefox or IE.
type: Comment

http://stackoverflow.com/comment/118888978
comment on: http://stackoverflow.com/a/56024284
score: 0
type: Comment
has text: would be nice to support any number of chars.
type: AnswerComment

http://stackoverflow.com/comment/38554073
has text: Looking for the same answer provided here, http://stackoverflow.com/questions/18381944/ng-options-and-unique-filter-not-displaying-angular-js ?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24832192
score: 0

http://stackoverflow.com/a/24901045
has comment: http://stackoverflow.com/comment/38685596
has comment: http://stackoverflow.com/comment/38685580
has comment: http://stackoverflow.com/comment/38686023
score: 2
downvote count: 0
has body: In OBJECT inline styling: Insert: position:absolute; Change to: Note: Try to avoid inline styling. z-index only works on positioned elements (position:absolute, position:relative, or position:fixed). JSFiddle Demo
upvote count: 2
has comment: http://stackoverflow.com/comment/38685796
has comment: http://stackoverflow.com/comment/38685817
answers question: http://stackoverflow.com/q/24901013
has comment: http://stackoverflow.com/comment/38685842
has comment: http://stackoverflow.com/comment/38685675
has comment: http://stackoverflow.com/comment/38685733
type: Answer
has comment: http://stackoverflow.com/comment/38685961

http://stackoverflow.com/a/24814519
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/38520845
has body: set this string var target_date = new Date().getTime() + (39000*3600*48); // to timestamp of october // year, month, day, hours, minutes, seconds, milliseconds var target_date = new Date(2014, 10, 3, 0, 0, 0, 0);
has comment: http://stackoverflow.com/comment/38522400
accepted answer of: http://stackoverflow.com/q/24814462
type: AcceptedAnswer
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/24814462

http://stackoverflow.com/comment/38605334
type: Comment
type: QuestionComment
has text: For storing data in object, you need to have key. Can this key be random ?
comment on: http://stackoverflow.com/q/24859334
score: 0

http://stackoverflow.com/comment/135391557
type: Comment
comment on: http://stackoverflow.com/a/74069606
has text: Ran into this with things like `C^(combined)`. Yes, double quotes "work" (i.e., `C^("combined")`, but they change the rendering of the superscript from italics to regular, which ruins the visual, it's especially noticeable with `C^(comb"in"ed)`
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38444252
type: Comment
type: QuestionComment
has text: @user3824049 Take a look at my answer
comment on: http://stackoverflow.com/q/24773067
score: 0

http://stackoverflow.com/q/24757216
downvote count: 0
tagged with: javascript
has body: I'm having problems with history.js, which I don't know how to address. On the website I'm working on we're using history.js to move between pages - if you click on any link history.js loads URL via AJAX, updates the URL and creates transition effect for content. However, we've got also index page with items; if you click on an item, history.js is not used - the content is loaded via ajax and displayed within the popup. There's also a situation where user can open the URL of the item (for example in new tab, or from search), in that case user should be redirected to the index page with hash of item URL, which will tell JS to run event of clicking on a link that has the hash URL. However, history.js kicks in and redirects to the item URL. To reiterate: user comes to /items/ URL left clicks on item (/item-[id]/ URL), which opens content in popup fine (AJAX request) right clicks on item and opens the link in new tab lands on /item-[id]/ (not AJAX request), and is redirected to /items/#/item-[id]/ via header redirect. history.js kicks in as soon as it's loaded and redirects user to /item-[id]/ I'm using HTML5 version of history.js (which I think shouldn't behave like this, dunno though) which redirects as soon as history.js is loaded (no other scripts on the page). Is there any other way to address this issue besides changing the redirect to /items/?/item-[id]/, which (I think) should resolve the issue. To illustrate the issue: a.html b b.html a Using native.history.js, which is pure HTML5 version of history.js without any framework bindings found here: https://github.com/browserstate/history.js/blob/master/scripts/bundled-uncompressed/html5/native.history.js It illustrates the point without any redirects. As soon as you click on any link, you're redirected by history.js to URL after the hash.
favorite count: 0
has comment: http://stackoverflow.com/comment/38711804
has answer: http://stackoverflow.com/a/24962312
accepted answer: http://stackoverflow.com/a/24962312
has comment: http://stackoverflow.com/comment/38705306
has comment: http://stackoverflow.com/comment/38714270
has comment: http://stackoverflow.com/comment/38760554
has comment: http://stackoverflow.com/comment/38785635
has answer: http://stackoverflow.com/a/24955442
upvote count: 2
tagged with: http-redirect
tagged with: php
tagged with: history.js
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38760366
has comment: http://stackoverflow.com/comment/38715742
has title: history.js and header redirection
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/24955442
has comment: http://stackoverflow.com/comment/38714133

http://stackoverflow.com/comment/38630794
has text: In order for `this` in `init` to refer to the object that holds `prT`, you need to invoke `init` in a way that properly sets its `this` value. Since you're not showing how `init` is invoked, I have no idea what the issue is.
score: 0
comment on: http://stackoverflow.com/q/24872720
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38481011
comment on: http://stackoverflow.com/q/24793134
score: 0
type: Comment
type: QuestionComment
has text: A [FrameElement](http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-97790553) doesn't have a `.document` property, but a `.documentElement` property.

http://stackoverflow.com/comment/38425977
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24764424
type: Comment
has text: Thanks Parchment, only I'm not too sure what you mean by post the links? can I upload the images to SO?

http://stackoverflow.com/comment/38681838
type: Comment
comment on: http://stackoverflow.com/a/24899560
type: AnswerComment
score: 0
has text: ok so if I use parsefloat as instructed, the function does not work. If I do not use parsefloat it works but only one time. For example if I try to run the function again on another set of text boxes on the same page it says Uncaught SyntaxError: Unexpected token ILLEGAL. Did I say you guys are awesome? If I didn't, You are all AWESOME! Thank you all sooo much for your assistance.

http://stackoverflow.com/comment/38564821
type: QuestionComment
has text: gmail and hotmail both accept those inputs. you can right-click view source.
comment on: http://stackoverflow.com/q/24837647
type: Comment
score: 0

http://stackoverflow.com/a/24865378
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24865277
has body: You can simply hide by adding the following css ol.bjqs-markers { display: none; }

http://stackoverflow.com/a/24772101
answers question: http://stackoverflow.com/q/24772078
type: Answer
has body: function test1(){ var counter=0; for(i=0;i&lt;10;i++){ counter++; } return ++counter; } By moving the ++ in front, it affects the variable before it's returned.
score: 0

http://stackoverflow.com/q/24845254
type: Question
has comment: http://stackoverflow.com/comment/38577921
linked to: http://stackoverflow.com/q/1181700
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/24682716
has comment: http://stackoverflow.com/comment/38577903
score: 12
has title: Modify text in a contenteditable div without resetting the caret (cursor) position
has comment: http://stackoverflow.com/comment/38577833
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/24862437
favorite count: 0
upvote count: 12
tagged with: contenteditable
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38591778
tagged with: regex
has body: I am trying to replace any instances of /any thing in here/ with &lt;b&gt;/any thing in here/&lt;/b&gt; on the fly, as changes are made in a contenteditable div. My current implementation works, but at every keypress the caret is moved to the beginning of div making the implementation unusable. Is there some way to keep the caret position while replacing the div's contents? $('.writer').on('keyup', function(e) { $(this).html($(this).html().replace(/\/(.*)\//g, '&lt;b&gt;\/$1\/&lt;\/b&gt;')); });
downvote count: 0
has comment: http://stackoverflow.com/comment/38577795

http://stackoverflow.com/comment/38663808
type: AnswerComment
has text: I can't use this version, because i must use in `onclick` event `.next()` on node. So, i can't use event. If you are intrested, i want do some hint areas, that show when you click on input. http://jsfiddle.net/uniqalien/95khM/
comment on: http://stackoverflow.com/a/24871781
type: Comment
score: 0

http://stackoverflow.com/comment/38655326
has text: Updating...got what you are looking for
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24885864

http://stackoverflow.com/a/34795861
has body: The site you provided uses the following Javascript to determine which width/height values to show: height = screen.height; width = screen.width; res = document.getElementById ('resolutionNumber'); res.innerHTML = width + " X " + height; If all you care about is ensuring that these values change, you can do the following before their code is executed: screen = new function() { this.width = 1; this.height = 2 } If you care about other attributes of the screen object, you'll need some extra Javascript to preserve those. To see this in action, load their page, then use Firefox or Chrome dev tools to put a debugger in their Javascript (line 116, where it says height = screen.height;), execute the above override, then press play! If you want to do this for every page you visit, you'll need to incorporate this into a Chrome or Firefox Extension (I've made custom Chrome extensions, super easy).
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/24752810
type: Answer
upvote count: 1

http://stackoverflow.com/comment/38566116
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24838457
type: AnswerComment
has text: Agreed, @dfsq. Don't really know what can it be. If you have any other idea, I'll be glad to listen. Thanks for you help, my friend.

http://stackoverflow.com/comment/38538160
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24821312
has text: i tried utf-8. still problem in displaying characters. in my code above i used `euc-kr` since it is for korean according to some online resources. still no luck.
type: Comment

http://stackoverflow.com/a/24841100
has body: okay thanks @tbd, echo out the method are brilliant. works like a charm echo "&lt;script type=\"text/javascript\"&gt;" ; echo "function keyNav( e )"; echo "{ "; echo "if( !e )"; echo"{ e = window.event; }" ; echo "goBack = 37;" ; echo "goNext = 39;" ; echo "switch( e.keyCode )"; echo "{"; echo "case goBack: window.location.href='?p=".$back."\ ' break;"; echo "case goNext: window.location.href='?p=".$next."\ ' break;"; echo "}"; echo "}"; echo "document.onkeydown = keyNav;"; echo "&lt;/script&gt;"; too much echo i dont know if there is any more simple way, but this one already good enough for me, thanks.
score: 0
answers question: http://stackoverflow.com/q/24835912
type: Answer

http://stackoverflow.com/comment/38649031
has text: yeah sorry, I just fixed that.... now it seems to be embedding the entire second page into the first though o_O
type: AnswerComment
comment on: http://stackoverflow.com/a/24881916
score: 0
type: Comment

http://stackoverflow.com/a/24991836
type: Answer
has body: /* fade */ ... -webkit-animation: fadeOut .7s both ease; ... "... it's just working in FireFox and Safari. For some reason Chrome doesn't add the class ".owl-fade-out" in the "div.owl-item" ..." http://owlgraphic.com/owlcarousel/#customizing
score: 0
answers question: http://stackoverflow.com/q/24851722

http://stackoverflow.com/a/24901417
type: Answer
has body: Try this on your js (assuming that you pass the values of userID to $userID): &lt;script&gt; var userID = &lt;?php if(isset($_POST['userID'])){ switch (($_POST['userID'])){ case 'getUSerID': echo json_encode($userID); break; } } ?&gt;; &lt;/script&gt; Using json_encode() requires: PHP 5.2.0 or greater $userID encoded as UTF-8 (or US-ASCII, of course) Since UTF-8 supports full Unicode, it should be safe to convert on the fly.
score: 0
answers question: http://stackoverflow.com/q/24901334

http://stackoverflow.com/comment/38509379
comment on: http://stackoverflow.com/a/24790467
has text: Thanks David. This also works perfectly. How can we take only first of the page in case there are multiple in the page?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/24782214
tagged with: javascript
upvote count: 3
tagged with: playframework
answer count: 1
favorite count: 0
has body: I'm currently developping a Java application, using Play! Framework 2. In some page, I need to generate a PDF file on my server, then send it to the browser and display it, on an iframe or an embed tag. I'm sending the file to the client-side using Play! result mechanism : File resultFile = new File(outputFilePath); response().setHeader("Content-Length", Long.toString(resultFile.length())); return ok(resultFile).as("application/pdf"); On the client-side, I receive the file, and use createObjectUrl in order to get an URL to pass to my iframe window.URL = window.URL || window.webkitURL; var file = new window.Blob([result], { type: 'application/pdf' }); var fileUrl = window.URL.createObjectURL(file); $("#displayDoc").attr("data", fileUrl); The result of all of this is quite weird : the iFrame is displayed, shows as many pages as there is in my document, but all the pages are empty. And I get this error on the Dev Tools plugin of Chrome : resource interpreted as document but transferred with mime type application/pdf chrome Does anybody have an idea of what's going on? Thanks! Lauris
type: UnansweredQuestion
tagged with: iframe
tagged with: pdf-generation
score: 3
has answer: http://stackoverflow.com/a/24782856
downvote count: 0
type: Question
has title: Display generated PDF file on iFrame with Java server-side

http://stackoverflow.com/q/24908619
has answer: http://stackoverflow.com/a/24908687
type: AnsweredQuestion
tagged with: custom-data-attribute
has answer: http://stackoverflow.com/a/24908661
type: Question
possible better answer: http://stackoverflow.com/a/24908661
accepted answer: http://stackoverflow.com/a/24908678
has body: I am trying to add a data attribute with a value to a li, but for some reason its not working. Iv done this before on divs but for some reason its not working correctly now. Here is my jsfiddle http://jsfiddle.net/76MDE/1/ Here is my code. cool $('.name').data("element", "name");
has title: Adding data attribute value not working
tagged with: javascript
tagged with: jquery
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38697855
favorite count: 0
tagged with: jquery-data
has answer: http://stackoverflow.com/a/24908664
has comment: http://stackoverflow.com/comment/38697905
has answer: http://stackoverflow.com/a/24908678
upvote count: 1
answer count: 4

http://stackoverflow.com/comment/38678780
has text: You're changing `nonCheckMarkImage` each time, then you ask it to throw `nonCheckMarkImage`'s id. That's going to be the last element you created. Try `alert(this.id)` like I said before.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24897646
score: 1

http://stackoverflow.com/a/24900548
has comment: http://stackoverflow.com/comment/38683178
upvote count: 2
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/24900117
answers question: http://stackoverflow.com/q/24900117
score: 2
has body: It seems like the issue lies in the typeaheadLabel function which gets evaluated while calculating the model value and often the item comes as null. You could add some defensive null checks on the label function so that value evaluation doesn't get broken, because this is what typeahead actually matches the value of the model as :- Snippet From TypeAhead return { itemName:match[3], source:$parse(match[4]), viewMapper:$parse(match[2] || match[1]), //&lt;-- here if the function evaluation is undefined which is in your case it will take the value of ticker propery as modelValue modelMapper:$parse(match[1]) }; WorkAround1:- $scope.typeaheadLabel = function(item) { if(!item || !item.ticker) return; return item.ticker.toUpperCase() + ' (' + item.assetClass + ') - ' + item.description; }; Plnkr Another way i would suggest is to add a displayName property in the viewModel itself. Ex:- WorkAround 2: $scope.assets = [{ "assetClass": "stock", "ticker": "spy", "description": "S&amp;P" },{ "assetClass": "stock", "ticker": "asd", "description": "A&amp;D" }].map(typeaheadLabel); function typeaheadLabel(item) { item.displayName = item.ticker.toUpperCase() + ' (' + item.assetClass + ') - ' + item.description; return item; }; and specify displayName as alias asset.ticker as asset.displayName for asset in assets Plnkr2

http://stackoverflow.com/comment/38633892
comment on: http://stackoverflow.com/a/24832315
has text: Hi SiKing, I know I can get the text by using the getText method, but the test case specifies the text must be selected and then copied to another textarea
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/24869398
tagged with: function
tagged with: setinterval
tagged with: javascript
has comment: http://stackoverflow.com/comment/38624467
type: Question
tagged with: while-loop
has comment: http://stackoverflow.com/comment/38624471
has body: I've created start() function which counts from 1 onwards. I want it to do something after some time pass, for example 5 seconds. How to achieve that? I've tried with if (timecounter == 5) but that doesn't work. If I put while (timecounter &lt; 5) {continue} and then the if statement from above, I get into infinite loop. function start() { setInterval(function () { timecounter = timecounter + 1; document.getElementById('demo').innerHTML = timecounter; }, 1000); var clickArea = document.getElementById('clickBox'); document.getElementById('boxText').style.color = 'white'; clickArea.addEventListener("click", function () { counter += 1; }); if (timecounter === 5) { alert('this'); } //Doesn't work } Thanks.
has comment: http://stackoverflow.com/comment/38624477
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/24869617
has title: Setting function with setInterval() to act at some value
has answer: http://stackoverflow.com/a/24869617
has answer: http://stackoverflow.com/a/24869577
tagged with: if-statement
accepted answer: http://stackoverflow.com/a/24869577
type: AnsweredQuestion

http://stackoverflow.com/a/24828684
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38547830
type: Answer
answers question: http://stackoverflow.com/q/24828515
score: 0
accepted answer of: http://stackoverflow.com/q/24828515
has comment: http://stackoverflow.com/comment/38546967
has body: edited to fit OP requirements Move your contenteditable on Add outline: 0 to your HTML : Click here to edit Click here Click here CSS : #notes { position: absolute; } [contenteditable] { outline: none; } Updated JSFiddle EDIT To alternate colors, use this code : HTML Click here to edit Click here Click here CSS #notes { position: absolute; } [contenteditable] { outline: none; } li { list-style-image: url('http://i61.tinypic.com/2nb9jxs.png'); } li:nth-child(3n+1) { list-style-image: url('http://i61.tinypic.com/2m5xb1f.png'); } li:nth-child(3n+2) { list-style-image: url('http://i61.tinypic.com/2qb5342.png'); } Another JSFiddle !
has comment: http://stackoverflow.com/comment/38547061
has comment: http://stackoverflow.com/comment/38548354

http://stackoverflow.com/comment/38414271
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24757634
has text: You need to give us more context. From what I see, the value of `{{name}}` is `Temperature t`. If you want your handlebars template model to be whitespace-free, then you have to clean your model variables before rendering...
score: 0

http://stackoverflow.com/a/24821812
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/24821761
downvote count: 0
has body: Change this: &lt;input bs-form-control required type="text" ng-model="product.code" label="Prodotto" label-class="col-xs-3 col-sm-2 col-lg-1" class="col-xs-9 col-sm-10 col-lg-11" placeholder="Cod. Phonix" /&gt; You have to remove the src from the ng-model in your input field.
score: 1
has comment: http://stackoverflow.com/comment/38538577
has comment: http://stackoverflow.com/comment/38533669
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24821761

http://stackoverflow.com/q/24868429
has comment: http://stackoverflow.com/comment/38622296
has comment: http://stackoverflow.com/comment/38622465
has comment: http://stackoverflow.com/comment/38623378
has comment: http://stackoverflow.com/comment/38622304
has title: Does automatic semi-colon insertion in JS affect for loops with the first { on a new line?
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/24868471
tagged with: semantics
has body: Will JS auto semi-colon insertion place a semi-colon at the end of for(...) like I've placed in the following example or is it safe to break the bracket onto a new line with for loops? for(...); { ... } I've found plenty of info saying what is affected, but nothing specific to my question, which leads me to believe it may not be affected, but I would like to find a concrete answer. Personally, I prefer not to break onto a new line with brackets like this but the question has been raised ;)
has answer: http://stackoverflow.com/a/24868471
upvote count: 3
has comment: http://stackoverflow.com/comment/38622363
tagged with: automatic-semicolon-insertion
type: Question
type: AnsweredQuestion
score: 3

http://stackoverflow.com/comment/38653104
has text: That sounds almost exactly what I suggest in the final section of this answer, the only difference is that you are doing it on a schedule instead of on demand. You won't get cross origin problems if you make the request to the third party server from your *server*. You won't get cross origin problems if you make the request from the browser to the same site as is hosting the HTML page.
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24884845

http://stackoverflow.com/comment/38432543
has text: Put the delete query code in another page, and when the user confirms (use `if (confirm("Press OK to delete."))`), then you can redirect them to the page with your delete code.
type: Comment
score: 1
comment on: http://stackoverflow.com/q/24768095
type: QuestionComment

http://stackoverflow.com/q/24855946
linked to: http://stackoverflow.com/q/802854
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24856018
type: Question
has comment: http://stackoverflow.com/comment/38598828
answer count: 2
upvote count: 0
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/24855998
tagged with: http://stackoverflow.com/tag/html
has body: there. I was trying to create a link in current html page. But the page seems to change only when I click the "submit" button in chrome. The link won't appear in the page.Could anyone tell me what I did wrong? The code looks like this: Link Generator ASIN:
accepted answer: http://stackoverflow.com/a/24856018
has title: creating a link in html with js
has answer: http://stackoverflow.com/a/24855998
downvote count: 3
score: -3

http://stackoverflow.com/q/24844524
type: Question
upvote count: 4
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/24844794
has answer: http://stackoverflow.com/a/24845130
score: 3
has body: I need some help. I want to make an image appear where the mouse is located over a div. There is no code that I can show as I've failed many times at achieving this. Thanks.
tagged with: http://stackoverflow.com/tag/html
has title: Popup Image when hovering over a div (Jquery)
tagged with: css
answer count: 4
possible better answer: http://stackoverflow.com/a/24844794
accepted answer: http://stackoverflow.com/a/24845130
has answer: http://stackoverflow.com/a/24844674
downvote count: 1
has answer: http://stackoverflow.com/a/24844577
type: AnsweredQuestion

http://stackoverflow.com/comment/38666794
comment on: http://stackoverflow.com/q/24891860
has text: What does the rendered HTML look like for that element?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24893838
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38670578
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
has answer: http://stackoverflow.com/a/24893989
downvote count: 1
type: Question
has title: Remove double quotes from Json object
tagged with: javascript
tagged with: jquery
has body: I have json object.when i do JSON.stringify it looks like below { "bindto": {}, "data": { "type": "line", "columns": "[['SO_Lat',1361.213042,7494.897354000001],['SO_Long',1361.213042,7494.897354000001]]", } } I want to convert column field without double quotes and send it back to server my final output will be like this { "bindto": {}, "data": { "type": "line", "columns": [['SO_Lat',1361.213042,7494.897354000001],['SO_Long',1361.213042,7494.897354000001]], } } Please help
score: 0
has comment: http://stackoverflow.com/comment/38670528
accepted answer: http://stackoverflow.com/a/24893989
answer count: 1
has comment: http://stackoverflow.com/comment/38670465
has comment: http://stackoverflow.com/comment/38670383
favorite count: 0
has comment: http://stackoverflow.com/comment/38670381

http://stackoverflow.com/comment/38669792
has text: Not sure what I'm being thanked for, but you're welcome :)
comment on: http://stackoverflow.com/a/24844348
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/24834252
answers question: http://stackoverflow.com/q/24834183
has comment: http://stackoverflow.com/comment/38557561
has comment: http://stackoverflow.com/comment/38557589
has comment: http://stackoverflow.com/comment/38557684
has comment: http://stackoverflow.com/comment/38557519
has comment: http://stackoverflow.com/comment/38557577
score: 0
type: Answer

http://stackoverflow.com/comment/38674951
type: Comment
has text: I guess my question isn't clear sorry about that. I want to know how to use JavaScript to achieve the same effect i.e. stop the user from highlighting the text.
comment on: http://stackoverflow.com/q/24896205
score: 0
type: QuestionComment

http://stackoverflow.com/comment/38579144
score: 0
type: Comment
has text: when a js.erb file is rendered by rails, the code inside executes immediately. is it right to add an event listener when the entire file is already set to execute?
type: AnswerComment
comment on: http://stackoverflow.com/a/24845910

http://stackoverflow.com/q/24806495
has body: I am putting the downloaded json object into an angular $scope, but I found that angular adds some framework dependent properties inside it. I want to send the modified object back to server, is there a convenient way I can remove angular properties and get the plain object without angular scope properties like $$hashkey? EDIT: The possible duplicate question does not provide the answer I needed. Calling angular.toJson gives me a plain string "$SCOPE", while calling angular.copy throws an error. I guess they are not designed to work with the $scope object itself?
type: AnsweredQuestion
has title: How to get plain object from $scope in angularjs?
type: Question
has comment: http://stackoverflow.com/comment/38505025
has answer: http://stackoverflow.com/a/24881948
tagged with: javascript
score: 4
linked to: http://stackoverflow.com/q/18826320
upvote count: 4
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/38505947
has comment: http://stackoverflow.com/comment/38505888
has comment: http://stackoverflow.com/comment/38506060
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/24881948
has comment: http://stackoverflow.com/comment/38507632

http://stackoverflow.com/comment/88364072
comment on: http://stackoverflow.com/a/24902197
type: Comment
has text: **WARNING**: The example has an **infinite recursion!** when calling `fibonacci(x)`
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38659198
type: AnswerComment
comment on: http://stackoverflow.com/a/24887800
type: Comment
has text: @frosty: Only until you hit `0`, which would yield the empty string.
score: 0

http://stackoverflow.com/q/24885735
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/24906561
has title: how to append a method to a angularjs controller from a different js file
score: 2
upvote count: 2
type: UnansweredQuestion
has body: I have an angularjs site and I want to make a CMS layer that will be combined with my normal site. I only want it's business-logic to be loaded if I am an admin and go to a specific link. For example, if I enter as an admin, on every item a "X" button will appear so I can delete it from the DB. If I enter as a regular user I won't be able to even know there is another layer, even if I check the resources. What is the best way to append a controller or module retroactively? One idea I thought about is attaching a controller to the view that will actually be empty, but if I enter a specific link - a different js file will be loaded which will contain the actual code for the controller.
type: Question
tagged with: content-management-system
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/24831416
has body: You can use the clippy library https://github.com/mojombo/clippy to add a copy to clipboard button. This can help remove the formatting.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24831286

http://stackoverflow.com/comment/38510558
type: AnswerComment
comment on: http://stackoverflow.com/a/24809238
has text: Whilst inspecting the element you can still trigger other events (like `mouseout`), so it doesn't solve the problem in the first place. You have to be quite careful when selecting it. But it is an alternative approach.
type: Comment
score: 1

webrtc
tags question: http://stackoverflow.com/q/24772208
tags question: http://stackoverflow.com/q/24857637
type: Tag
tag name: webrtc
tags question: http://stackoverflow.com/q/24858071
tags question: http://stackoverflow.com/q/24824956
tags question: http://stackoverflow.com/q/24847640
tags question: http://stackoverflow.com/q/24777002

http://stackoverflow.com/comment/38468496
type: Comment
has text: Try : file://///154.66.111.123/ but browsers have different level of security (Try to drag'n'drop file on your browser).
comment on: http://stackoverflow.com/a/24786897
type: AnswerComment
score: 0

http://stackoverflow.com/a/27084418
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24804338
has body: At the top of your script code, use jQuery.noConflict() to release the $ back for other scripts to use, in this case the prototype.js code. See the jQuery noConflict docs for details: http://api.jquery.com/jquery.noconflict/. (begin personal opinion) I don't recommend simply assigning jQuery to another short alias. These JavaScript aliases that everybody wants to use are just like really short, bad variable names. Most developers would recommend avoiding variable names like 'x' and 'y' in most cases, especially if the variable has a very large scope. Using '$' or 'j' for jQuery makes your source shorter, but is that really that important. Just run the code through a minimizer before using it in production. (end personal opinion)

http://stackoverflow.com/a/24850093
downvote count: 0
type: Answer
upvote count: 3
accepted answer of: http://stackoverflow.com/q/24846957
has body: For this, you need nested selections. The idea is that instead of appending a single element per data item, you append several. In code, it looks like this: // append a `g` element for each data item to hold the circles var groups = svg.selectAll("g.circle").data(locations) .enter().append("g").attr("class", "circle"); // now select all the circles in each group and append the new ones groups.selectAll("circle") // the d in this function references a single data item in locations .data(function(d) { return d.coords; }) .enter().append("circle") .attr("cx", function(d) { return d[0]; }) .attr("cy", function(d) { return d[1]; }); It works the same for update and exit selections.
answers question: http://stackoverflow.com/q/24846957
score: 3
type: AcceptedAnswer

http://stackoverflow.com/q/24889450
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/38662085
has title: Setting CSS Properties Dynamically
type: Question
has comment: http://stackoverflow.com/comment/38662043
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/24889652
has comment: http://stackoverflow.com/comment/38662351
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/38662262
has body: So I'm having an issue. I have to design a css button that can be customized by a user on the fly, with a few customization options. They have to be able to add text, change the button colour, change the button size and change how round the borders are. The thing is, my javascript functions to change the borders and the size of the button aren't working. They also make the other functions not work, oddly enough. I was told to avoid using jQuery. The Javascript for the size changing function: function aBc() { var a = document.getElementById("buttontest"); if(document.getElementById("smallS").checked) { a.style.width = 100px; } else if(document.getElementById("mediumS").checked) { a.style.width = 150px; } else if(document.getElementById("largeS").checked) { a.style.width = 200px; } else if(document.getElementById("hugeS").checked) { a.style.width = 300px; } } The Javascript for the border changing function: function changeCorners() { var bordertest; bordertest = document.getElementById("buttontest"); if (document.getElementById("none").checked) { bordertest.style.borderRadius = 0px; } else if (document.getElementById("small").checked) { bordertest.style.borderRadius = 10px; } else if (document.getElementById("medium").checked) { bordertest.style.borderRadius = 20px; } else if (document.getElementById("large").checked) { bordertest.style.borderRadius = 30px; } else if (document.getElementById("total").checked) { bordertest.style.borderRadius = 40px; } } The HTML for everything: Button Text: Text Color: How Round: Square Small Roundness Medium Roundness Large Roundness Completely Round Background Color: Shadow Color: Button Size: Small Medium Large Extra Large

http://stackoverflow.com/comment/38684553
type: Comment
comment on: http://stackoverflow.com/a/24901035
has text: it does not go to my controller
type: AnswerComment
score: 0

http://stackoverflow.com/q/24766113
tagged with: javascript
score: -1
has title: User typing text onto a Canvas
tagged with: canvas
has answer: http://stackoverflow.com/a/24766939
upvote count: 0
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/38430058
has body: Is there a way to put user typed text over a canvas and keeps on expanding as the user types? I'm trying to create a website that allows the user to input various comments in the form of bullet notes as a way to "comment" on a certain image/picture. In short, I'm trying to recreate what power-point does with it's bullet system as you can see here: http://i60.tinypic.com/k4z8f7.png Making a textbox's position absolute works, but it's very ugly and isn't really what I want. I'm fine with a solution that doesn't use a canvas as well.
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24766939
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38430070
has comment: http://stackoverflow.com/comment/38429798

http://stackoverflow.com/comment/38483177
has text: However for certain reasons, `cdnjs.cloudflare.com` can't be used. Hope you understand. So using [pure Google CDN I created this.](http://plnkr.co/edit/Ir9EDHRtV37eDCkDnWJl?p=preview). Infact I found a duplicate for this. I just didn't know the exact jargon to look for what I needed. So the bottom line is that it's a Google, Microsoft CDN. Thanks for the clarification though.
comment on: http://stackoverflow.com/a/24794519
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/60012923
score: 3
has body: You can't access a file like that for security reasons. But you can access a file without uploading it using javascript. one way to do that is using file input field. Add a file input field to the page Add onchange event listener to the input Get the file Create the url using URL.createObjectURL function sample code let input = document.querySelector("#input"); input.addEventListener("change", (e)=&gt;{ let file = input.files[0]; let url = URL.createObjectURL(file); // A valid URL that you can use on the page })
downvote count: 0
answers question: http://stackoverflow.com/q/24786848
type: Answer
upvote count: 3

http://stackoverflow.com/comment/38416627
score: 0
comment on: http://stackoverflow.com/q/24758733
type: Comment
type: QuestionComment
has text: yes my Issue is yet not resolved

http://stackoverflow.com/q/24794699
type: Question
has answer: http://stackoverflow.com/a/24794727
possible better answer: http://stackoverflow.com/a/24794736
has comment: http://stackoverflow.com/comment/38483307
has answer: http://stackoverflow.com/a/24794736
tagged with: javascript
has comment: http://stackoverflow.com/comment/38483195
accepted answer: http://stackoverflow.com/a/24794944
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has body: My math all seems to be correct, but I'm returning a NaN. The Javascript: // This section calculates how much the user will have to spend until the average age of life expectancy. function updatespending() { var age = parseFloat(document.forms[0].CurrentAge.value); var value = parseFloat(document.forms[0].NetWorth.value); if(document.forms[0].sex.value == "male") {var yearsleft = Math.round (76 - age);} else if(document.forms[0].sex.value == "female") {var yearsleft = 81 - age;} document.forms[0].AnnualSpending.value = Math.round (value / years left); The HTML code: How much will you have to live off of if you liquidate all of your assets? Sex: Male Female Current Age: Annual Spending Available: $ This is, of course, all encompassed in a form. If I remove the == and put a = , it will return whatever the first if statement says. Anything else returns a NaN. Any help would be greatly appreciated.
has comment: http://stackoverflow.com/comment/38483146
has answer: http://stackoverflow.com/a/24794944
has title: Javascript Math returning NaN
type: AnsweredQuestion

http://stackoverflow.com/q/24790446
has body: I'm working on something that creates a form based on choices you give it (text/textfield/dropdown). When I create 2 dropdowns at once I am not sure how to write in a way that the computer can tell the 2 elements aren't the same, specifically when adding new inputs in my dropdown creator it can't tell multiple dropdowns apart. Here's the Javascript function I'm using for it $('#submit').on('click', function() { $("select").each(function() { switch($(this).val()) { case "text": $("#form").append(' Remove '); break; case "note": $("#form").append(' Remove '); break; case "dd": $("#form").append(' Remove '); $("#ddCreator").append(' Add Another Field Submit '); break; } }); $('#inputDiv').empty(); $('#ddAddInput').on('click', function() { $("p[class*='ddP']").append(' '); }); $('#ddSubmit').on('click', function() { $("input[name*='ddText']").each(function() { $('#ddFinal').append(' '+$(this).val()+' '); }); $('#ddCreator').empty(); $('#ddFinal').removeAttr('id'); }); }); The problem is with the ddAddInput function because it doesn't specify between multiple p class="ddp" elements but I'm not really sure what I should be putting instead. Hope this question makes sense. Here's the fiddle I'm currently working on http://jsfiddle.net/me74Z/15/
has answer: http://stackoverflow.com/a/24790945
type: Question
tagged with: javascript
has title: Changing similar appended elements separately
answer count: 1
accepted answer: http://stackoverflow.com/a/24790945
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
score: 0

http://stackoverflow.com/q/24812264
answer count: 1
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
has title: svg hover and click on mobile
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24816541
score: 1
has body: On desktop onmouseover it changes color to green and then I click it changes to red but in mobile devices both event goes at the same time. Is it possible to make on tap changes to green color then on 2nd tap it goes to red color? <?xml version="1.0" encoding="UTF-8" standalone="no"?> <g> <rect id="rect1" x="160" y="10" width="60" height="60" fill="blue" onmouseout="evt.target.setAttribute('fill','blue');" onclick="evt.target.setAttribute('fill','red');" onmouseover="evt.target.setAttribute('fill','green');"/> </g> fiddel thanks!
upvote count: 1
accepted answer: http://stackoverflow.com/a/24816541
type: Question
tagged with: javascript

http://stackoverflow.com/comment/38663910
type: Comment
has text: Wrap is nice for a simple wrapper, but say I want it to be part of a larger template.
type: AnswerComment
comment on: http://stackoverflow.com/a/24890348
score: 0

http://stackoverflow.com/comment/38489223
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24792167
has text: @ryan Is there any difference between x.setAttribute('onclick') & x.onclick ? It changed nothing to the execution process. Btw, thanks for the console.log() advice. I think I'll use it untill code is fully ready.

http://stackoverflow.com/q/24768446
downvote count: 4
has answer: http://stackoverflow.com/a/24768541
score: -2
tagged with: javascript
has title: Can I have two external .js scripts in one html page?
has comment: http://stackoverflow.com/comment/38433219
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24768756
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24768553
has comment: http://stackoverflow.com/comment/38433279
has body: I have two different functions that I want to work on the same html page. Both are changing two different images onclick. I have the javascript in an external file. The script calling the .js file is in the head of the html, although I also tried in the body unsuccessfully. Here is the html code: &lt;img id="avoir" onclick="changeImage()" src="images/avoir.gif" width="700" height="394"&gt; &lt;img id="aller" onclick="changeImage()" src="images/aller.gif" width="700" height="394"&gt; Here is the link to the .js file: &lt;script src="avoir.js"&gt;&lt;/script&gt; &lt;script src="aller.js"&gt;&lt;/script&gt; Here is the code in the .js file: for the first image: $(document).ready(function changeImage() { var image = document.getElementById('aller'); if (image.src.match("allerchart")) { image.src = "images/aller.gif"; } else { image.src = "images/allerchart.gif"; } } For the second image: $(document).ready(function changeImage() { if (image.src.match("avoirchart")) { image.src = "images/avoir.gif"; } else { image.src = "images/avoirchart.gif"; } } I am a web developer student and not too familiar with javascript. What is currently happening is that the second image changes on click, and nothing happens to the second one. Thanks for any suggestions.
has comment: http://stackoverflow.com/comment/38433359
type: Question

http://stackoverflow.com/comment/38480392
comment on: http://stackoverflow.com/q/24793142
has text: I tested the example. It works. It just does not work the data we provide but why?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38573384
comment on: http://stackoverflow.com/a/24842758
has text: Thanks Braj. That really worked with tomcat. Hope this helps for others as well.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38616021
type: Comment
comment on: http://stackoverflow.com/a/24847503
score: 0
type: AnswerComment
has text: Okay I got it. My apologies for not realizing! Is there any shortcut way to restore whatever changes I made inside the if statement to default?

http://stackoverflow.com/q/24792280
has title: How do I convert json file into HTML without adding them into an element first?
has comment: http://stackoverflow.com/comment/38479277
possible better answer: http://stackoverflow.com/a/24792777
answer count: 2
has answer: http://stackoverflow.com/a/24794385
has answer: http://stackoverflow.com/a/24792777
has comment: http://stackoverflow.com/comment/38482642
downvote count: 0
has comment: http://stackoverflow.com/comment/38479230
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38478797
has comment: http://stackoverflow.com/comment/38479233
has body: on jQuery's website there is a documentation says, $.getJSON( "ajax/test.json", function( data ) { var items = []; $.each( data, function( key, val ) { items.push( "&lt;li id='" + key + "'&gt;" + val + "&lt;/li&gt;" ); }); $( "&lt;ul/&gt;", { "class": "my-new-list", html: items.join( "" ) }).appendTo( "body" ); }); For those who have used this method know that it adds all the json attributes into the the variable called "iteams" and then it converts the "items" into html by adding the string into a new unordered list with a class called "my-new-list". Now, say if I do not want to add a new unordered list with a class called "my-new-list", instead I want to convert the new variable into string and add into an existed HTML element, say with a class called "curtain," how do I go about the do that? Here is my try: var items = []; var first = '&lt;div class="panel"&gt;&lt;div class="panel-gallery"&gt;&lt;img src="', second = '" Alt=""&gt;&lt;/div&gt;&lt;/div&gt;'; $.each( data, function( url ) { items.push( first + url + second ); html: items.join( "" ).appendTo( ".curtain" ); }); Apparently that will give me an error on the line: html: items.join( "" ).appendTo( ".curtain" );
accepted answer: http://stackoverflow.com/a/24794385
upvote count: 1
has comment: http://stackoverflow.com/comment/38479266
type: Question
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/q/24789984
tagged with: highcharts
has body: First off, the fiddle to my question is here: http://jsfiddle.net/pfifas/aTh7F/ The problem I want to display the sum of the values of all series at each point on the horizontal axis as stack labels above each stack. Because I have negative stacks and I do not want to display positive and negative totals above and beneath separately, I set up a formatter function manually (lines 42 through 50 in the fiddle). The stack labels that I want should be the sum over all values at a given point, i.e. the sum of the positive stacks minus the sum of all negative stacks. E.g. if the data series at the first point is data: [1,-2,3,4] I would like the stack label to display a "6" above the stacked bar. My formatter function works fine with data series of the sort data: [1,-2,3,4] But once I add a date variable to each series like data: [ [Date.UTC(2010, 0, 1), 4], [Date.UTC(2010, 3, 1), 15], [Date.UTC(2010, 6, 1), 17], [Date.UTC(2010, 9, 1), 10] ] the stack labels are not displayed anymore. I think I am making a mistake with the indexing of the array in the formatter function. How do I have to change the indexing to achieve the correct result? On a different note, where can I learn more about which variables are available inside the formatter environment and how to handle them in highcharts? Edit: In response to Onkloss answer, I should highlight that this issue is related to setting the axis to type 'datetime', not to whether the array of data is multidimensional (as the previous question title was suggesting).
tagged with: javascript
score: 0
answer count: 2
has title: How to get proper stack labels with 'datetime' axis?
has comment: http://stackoverflow.com/comment/38486212
favorite count: 0
has answer: http://stackoverflow.com/a/24796598
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38475417
possible better answer: http://stackoverflow.com/a/24791988
downvote count: 1
has answer: http://stackoverflow.com/a/24791988
type: Question
accepted answer: http://stackoverflow.com/a/24796598

http://stackoverflow.com/q/24781177
tagged with: jquery
has answer: http://stackoverflow.com/a/24781341
type: UnansweredQuestion
tagged with: draggable
tagged with: css
linked to: http://stackoverflow.com/q/19462462
has body: Following problem: I have some draggable elements and a list with droppables below. When I'm on top of the page everything works as expected but when I scroll a bit down the distance between the scrollbar and the upper arrow of the browser scrollbar is added between the cursor and the draggable element when dragging. How to fix this? I created a fiddle but since jsfiddle uses relative boxes with a scrollbar each you won't see the bug. But maybe someone had the same problem already... http://jsfiddle.net/LP9ZQ/2/ Code: HTML: Draggable Element 1 Draggable Element 2 Bla1 Bla2 Bla3 Bla4 CSS: #header{ width:600px; height:200px; } .bold{ font-weight: bold; cursor: copy; } body{ overflow:auto; } #content_box{ width:600px; height:300px; } .drag_box{ position: relative; float: left; width: 265px; margin-right: 31px; margin-bottom: 20px; } .clone img{ width:90px; } .drag_box img{ width:90px; } .draggable{ cursor: move; } #droppables_wrapper{ width:600px; height:200px; } Javascript/jQuery: $(".draggable").draggable({ opacity: 0.7, helper: "clone", zIndex: 10000, appendTo: "body", revert: true, revertDuration: 200, start: function(e, ui) { $(ui.helper).addClass("clone"); } }); $(".droppable").droppable({ accept: '.draggable', hoverClass: "bold", drop: function (event, ui) { var clip_id = ui.draggable.attr("id"); var clip_title = ui.draggable.children("p").html(); alert("The Clip " + clip_title + " (ID: " + clip_id + ") has been added to this room"); } });
type: Question
tagged with: jquery-ui
has title: Cursor position and draggable position are not the same when not dragging at the top of the page
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/comment/38656845
score: 0
type: Comment
has text: "Also, the variable don't need a '$'" -- The "$" is a valid character for an identifier and often is used to differentiate between variables that are jQuery objects and those that are not. It is good practice to detail what a variable is with good names -- so why not include it?
type: AnswerComment
comment on: http://stackoverflow.com/a/24886844

http://stackoverflow.com/comment/38541172
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24825346
score: 0
has text: i already try this but problem is when i use this nothing will be appearing bcoz it remove svg element always selecting any value from drop down..

http://stackoverflow.com/comment/38514327
comment on: http://stackoverflow.com/a/24811118
has text: here is a screen shot with the constructor property: http://puu.sh/afDvJ/b133d375d9.png
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38431725
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/24766897
has text: Thanks, req.body.id work. So simple...

constructor
tags question: http://stackoverflow.com/q/24842651
tag name: constructor
tags question: http://stackoverflow.com/q/24890589
type: Tag
tags question: http://stackoverflow.com/q/24794276
tags question: http://stackoverflow.com/q/24835434

http://stackoverflow.com/q/24782456
tagged with: javascript
has body: I have the following button and when clicked it's invoking a function, Is there a way to know in the controller that this button was clicked ? $("#RemoveFile").on("click", RemoveFile); <p >Remove File
tagged with: jquery
tagged with: asp.net
has comment: http://stackoverflow.com/comment/38459487
possible better answer: http://stackoverflow.com/a/24782526
answer count: 4
favorite count: 0
tagged with: asp.net-mvc-4
has answer: http://stackoverflow.com/a/24782526
has answer: http://stackoverflow.com/a/24782640
upvote count: 1
has answer: http://stackoverflow.com/a/24782937
has comment: http://stackoverflow.com/comment/38459590
linked to: http://stackoverflow.com/q/24753952
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38459735
tagged with: asp.net-mvc
accepted answer: http://stackoverflow.com/a/24782937
score: 1
has answer: http://stackoverflow.com/a/24782508
has comment: http://stackoverflow.com/comment/38459612
has title: check if button was clicked in the controller
downvote count: 0

google-chrome-devtools
tags question: http://stackoverflow.com/q/24899700
tags question: http://stackoverflow.com/q/24756853
tags question: http://stackoverflow.com/q/24790002
type: Tag
tag name: google-chrome-devtools
tags question: http://stackoverflow.com/q/24776606
tags question: http://stackoverflow.com/q/24895921
tags question: http://stackoverflow.com/q/24754028

http://stackoverflow.com/comment/38458688
has text: Wow, that code is horrible to read.
score: 3
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24782002

http://stackoverflow.com/a/24767716
downvote count: 1
score: 0
answers question: http://stackoverflow.com/q/24767668
type: Answer
has body: There are multiple ways, but one them is, make an if-else: $('#button').click(function () { if($('#mydiv').text()=="ko") $('#mydiv').text('ok'); else $('#mydiv').text('ko'); }); DEMO
upvote count: 1

http://stackoverflow.com/comment/38438142
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24771098
has text: Just wrap it in a function.

http://stackoverflow.com/comment/38497263
type: Comment
has text: fixed it using ARequestInfo.RawHTTPCommand to send the file required. Thanks for help @mjn
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24756911

http://stackoverflow.com/comment/38623131
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24868628
has text: ... and I presume that the value of that input field is the string `"true"` (which I agree it should be, or at least I think it should). Maybe the HTML5 validation stuff is in a state that prevents the form from being submitted.

http://stackoverflow.com/q/24907939
upvote count: 1
has title: Error transitioning using jQuery addClass
type: Question
has body: I have a simple input[type="text"] and I want to transition its width when clicking on it. I mean I want to slide it on the left like this: demo I don't know why this isn't working. Here is my fiddle: demo &lt;input type="text" id="menu" /&gt; This is my css. #menu { width:32px; position:absolute; right:50%; transition: width .8s; } .slide { width:180px; } This is my JS. $("#menu").click(function() { $(this).addClass("slide"); });
has answer: http://stackoverflow.com/a/24907976
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24907998
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/24907973
favorite count: 0
has comment: http://stackoverflow.com/comment/38697105
possible better answer: http://stackoverflow.com/a/24907973
accepted answer: http://stackoverflow.com/a/24907998
has answer: http://stackoverflow.com/a/24908034
tagged with: css
answer count: 4
type: AnsweredQuestion
tagged with: css-transitions

http://stackoverflow.com/a/24911628
accepted answer of: http://stackoverflow.com/q/24908049
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24908049
upvote count: 2
type: Answer
score: 2
downvote count: 0
has body: Blur was the key for my issue ! Mobiscroll has a method called onBeforeShow that gets called before the mobiscroll appears. In this method I used blur() on the input type i used the mobiscroll on ! My code below: var options = { preset: this.preset, theme: 'wp light', mode: 'scroller', display: 'bottom', timeWheels: "HHii", dateFormat: "dd-mm-yy", timeFormat: "HH:ii", lang: 'nl', // TODO: Deduce from application language. onBeforeShow: (html, inst) =&gt; { this.findControl().blur();} }; this.findControl().mobiscroll(options);

http://stackoverflow.com/comment/38566436
score: 0
type: Comment
has text: You may find [Socket.IO](http://socket.io/get-started/) useful. This is easy-to-use Node.js framework for real-time messaging. It uses websockets with AJAX and JSONP fallback.
type: QuestionComment
comment on: http://stackoverflow.com/q/24839250

http://stackoverflow.com/a/24866644
accepted answer of: http://stackoverflow.com/q/24863143
type: AcceptedAnswer
type: Answer
has body: I figured out what my remaining problem was, it was due to the ordering of the data bindings. The enable data bind needed to be placed after the checked binding since it has a dependency on it via $element.checked which makes sense now after realising it!! I changed my rebind function slightly to the below: var gridResult = $("#cartGrid table"); if (gridResult.length &gt; 0) ko.applyBindings(this, gridResult[0]); Each refresh brings in a new table but at least now if I add any more bindings to other elements in the results from the grid, they will work as expected.
answers question: http://stackoverflow.com/q/24863143
score: 0

http://stackoverflow.com/q/24842674
has answer: http://stackoverflow.com/a/24843860
answer count: 1
type: UnansweredQuestion
has title: Getting reference to control dropped on after dragdrop
score: 0
type: Question
has body: I am trying to drag and drop so that when the drop takes place, I can access data about the control that was dragged and the control that is dropped on. But the alert in this function: function onDragEnd(e) { if (!e) e = event; var callee = e.target || e.srcElement; alert(callee.innerHTML); if (event.srcElement.tagName=='A') { var srcCell = callee.parentElement; } else { var srcCell = callee; } } shows information about the what is being dragged, not the control dropped on. How can I get a reference to the whatever is being 'dropped on'? Fiddle at: http://jsfiddle.net/4Dg63/3/ Don't want to use jquery for this.
tagged with: javascript

http://stackoverflow.com/a/24828508
type: Answer
has body: You have to change your code like this $('.code-example &gt; button').on('click', function(e) { var code = $(this).parent().find('pre').html(); eval(code); });
score: 3
downvote count: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24828415
upvote count: 3
answers question: http://stackoverflow.com/q/24828415

http://stackoverflow.com/comment/60586490
type: Comment
has text: As an addition: $event object will be available in squareRotate() to indicate coordinates.
score: 0
comment on: http://stackoverflow.com/a/24854812
type: AnswerComment

http://stackoverflow.com/comment/38461097
score: 1
has text: @QF_Developer Yes, [`oninput`](https://developer.mozilla.org/en-US/docs/Web/Events/input) is native to _Firefox_ and all other modern browsers. `oninput` is fired on any change to input's value on real time, including dropped values and clipboard actions.
comment on: http://stackoverflow.com/q/24781535
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24814507
type: Question
has comment: http://stackoverflow.com/comment/38520920
downvote count: 0
tagged with: javascript
has body: I'd like to be able to extract text data located on other page within the same server in order to make the page source looks more organized. I included a text from the server using the following html tag. &lt;text id='sampleText' src='data/sampleText.txt'&gt;&lt;/text&gt; I went to the address to clarify if the path is working. After making sure that it's there, then I wrote the javascript to grab it. document.getElementById("sampleText").value //return: "" .innerHTML doesn't work either. Is there a way to grab the text via javascript? Or is it my html tag that is wrong? Perhaps both?
has answer: http://stackoverflow.com/a/24814647
favorite count: 0
has comment: http://stackoverflow.com/comment/38520448
answer count: 3
has comment: http://stackoverflow.com/comment/38521103
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38520771
has title: How to grab text from text src?
has answer: http://stackoverflow.com/a/24814590
has comment: http://stackoverflow.com/comment/38521100
accepted answer: http://stackoverflow.com/a/24814590
has answer: http://stackoverflow.com/a/24814574
upvote count: 1
linked to: http://stackoverflow.com/q/1981815
has comment: http://stackoverflow.com/comment/38520509
possible better answer: http://stackoverflow.com/a/24814647
has comment: http://stackoverflow.com/comment/38520671
type: AnsweredQuestion
score: 1

http://stackoverflow.com/q/24842698
score: 3
downvote count: 0
tagged with: firefox-addon-sdk
favorite count: 0
accepted answer: http://stackoverflow.com/a/44864003
possible better answer: http://stackoverflow.com/a/30013206
has answer: http://stackoverflow.com/a/30013206
type: AnsweredQuestion
upvote count: 3
type: Question
has answer: http://stackoverflow.com/a/44864003
linked to: http://stackoverflow.com/q/12735606
has title: Firefox addon sdk/tabs: "ready" event doesn't fire on all page loads?
tagged with: javascript
has answer: http://stackoverflow.com/a/24847344
answer count: 3
has body: I am listening to page loads using sdk/tabs: require('sdk/tabs').on('ready', function(tab) { console.log(tab.url); } ); It works as expected during normal navigation, but on some pages with script navigation the "ready" event doesn't fire. For example, load a Flickr photo page: https://www.flickr.com/photos/42559357@N04/14696401803 and navigate to other photos using GUI navigation (arrows at the sides or icons at the bottom of the photo). The tab URL changes, but the listener is never called. Is this normal? Is there any way to track such page loads? ETA: I noticed that sdk/context-menu does not suffer from the same problem, which gave me an idea for a workaround: var cm = require("sdk/context-menu"); cm.Item({ label: "dummy", contentScript: 'self.on("context", function (node) {' + ' self.postMessage(document.URL);' + ' return false;' + '});', onMessage: function (pageUrl) { console.log(pageUrl); } }); The function under onMessage will be triggered whenever the context menu is opened on a page, and tricky page changes like the ones described above will not confuse the script: it will accurately log the current URL. As it happens, a context menu customized to a page URL is what I am aiming at, so this will probably work for me (I'll add URL filtering and a way to make sure that the payload is only delivered once per page). But I would still like an answer to the original question. ETA2: page-mod has the same problem as tabs: the following will listen to new page openings on Flickr, but not when new pages are loaded via Flickr UI: var pageMod = require("sdk/page-mod"); pageMod.PageMod({ include: '*.flickr.com', contentScriptWhen: 'start', contentScript: 'self.port.emit("pageOpened", document.URL);', onAttach: function(worker) { worker.port.on("pageOpened", function(pageUrl) { console.log(pageUrl); }); } });

http://stackoverflow.com/a/24856558
score: -1
answers question: http://stackoverflow.com/q/24851404
has body: basic javascript, now everything seems crystal clear. Just one line to include jquery in the index.scala.html to include jquery plugin.
type: AcceptedAnswer
downvote count: 1
type: Answer
upvote count: 0
accepted answer of: http://stackoverflow.com/q/24851404

http://stackoverflow.com/a/24950009
upvote count: 1
answers question: http://stackoverflow.com/q/24805874
type: Answer
has body: You can use angular method like this, HTML Part, &lt;input type="file" ng-file-select="onFileSelect($files)" /&gt; In your controller write this, $scope.onFileSelect = function ($files) { var file = $files[0]; // upload file to server $scope.upload = $upload.upload({ url: 'http://www.yourdomain.com/yourpath', file: file }).success(function(data, status, headers, config) { // file is uploaded successfully }).error(function (data) { // file upload failed }); };
downvote count: 0
score: 1

http://stackoverflow.com/comment/38559108
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24835114
has text: @Fosco interesting. The filter can't perform the operation either. Neither does 'starts with' on 'data' work.
score: 0

http://stackoverflow.com/q/24803011
answer count: 4
has answer: http://stackoverflow.com/a/24805048
linked to: http://stackoverflow.com/q/18144159
score: 0
has comment: http://stackoverflow.com/comment/38498376
has comment: http://stackoverflow.com/comment/38499299
has answer: http://stackoverflow.com/a/24803258
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38499237
accepted answer: http://stackoverflow.com/a/24803258
type: Question
has answer: http://stackoverflow.com/a/24804678
possible better answer: http://stackoverflow.com/a/24803743
has answer: http://stackoverflow.com/a/24803743
tagged with: javascript
tagged with: jquery
has body: I want to prevent jQuery .scroll function to run while doing what's inside the .scroll function. The reason is because it may run twice and cause problems for me. $(window).scroll(function() { if($(window).scrollTop() + $(window).height() > $(document).height() - 50) { // do stuff } I tried: var carRun = true; if (canRun==true){ $(window).scroll(function() { if($(window).scrollTop() + $(window).height() > $(document).height() - 50) { canRun=false; // do stuff canRun=true; } } and It didn't fix the problem. Edit: These are tests of things I tried and aren't working for me: No.1: var canRun = true; $(window).scroll(function() { if (canRun == true){ if( $(window).scrollTop() + $(window).height() > $(document).height() - 50 ) { canRun = false; // Are there more posts to load? if (pageNum <= max) { console.log(max); // Show that we're working. $('#loadmoreLink').text('Loading posts...'); $('.pbd-alp-placeholder-'+ pageNum).load(nextLink + ' .post', function() { // Update page number and nextLink. console.log("The number of the next page to load: " + pageNum); pageNum++; console.log("The number of the next page to load after increment: " + pageNum); nextLink = 'http://www.example.com.br/page/' + pageNum + '/'; console.log("The link of the next page: " + nextLink); // Add a new placeholder, for when user clicks again. $('#pbd-alp-load-posts') .before(' '); console.log("--------END AJAX-------------"); // Update the button message. if(pageNum <= max) { $('#pbd-alp-load-posts a').text('Load More Posts'); } else { $('#pbd-alp-load-posts a').text('No more posts to load.'); } } ); } canRun = true; } } }); No.2: var canRun = true; $(window).scroll(function() { if( ($(window).scrollTop() + $(window).height() > $(document).height() - 50 ) && (canRun == true ) ) { canRun = false; // Are there more posts to load? if (pageNum <= max) { console.log(max); // Show that we're working. $('#loadmoreLink').text('Loading posts...'); $('.pbd-alp-placeholder-'+ pageNum).load(nextLink + ' .post…
tagged with: jquery-events
has title: Prevent jQuery .scroll function to run while doing what's inside the .scroll function

http://stackoverflow.com/q/24771311
has body: I'm working on a "todo app" Backbone client side. After I make a delete request in TodoView, it will be redirected to the index page(showing the whole list). The problem is that after redirecting, the deleted todo is still in the list. However it disappears after refreshing. Is it because the todo list renders faster than the DELETE request being done? In the todoView I listen to the 'delete' button: events: { 'click .red-button' : 'delete', }, delete: function() { this.model.destroy({ success: function(model, res) { $('.body-container').empty(); //redirecting to the index page--the todo list navigate(''); //equals to Backbone.Router.prototype.navigate(url, {trigger: true}) } }) }, I overrode sync for todo model. The 'delete' method is like: case 'delete': request .del(this.url()) .end(function(res) { console.log('deleting......'); }); options.success(); break;
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/38633951
tagged with: javascript
has comment: http://stackoverflow.com/comment/38461526
has title: page renders before DELETE request is done
has comment: http://stackoverflow.com/comment/38594980
has comment: http://stackoverflow.com/comment/38461051
has comment: http://stackoverflow.com/comment/38439788
has comment: http://stackoverflow.com/comment/38633839
has comment: http://stackoverflow.com/comment/38438778
favorite count: 0
tagged with: backbone.js
has answer: http://stackoverflow.com/a/24771485
upvote count: 1
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/24771485
tagged with: httprequest
type: Question

http://stackoverflow.com/comment/38673414
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24894857
has text: Your question is very lacking in code, please read [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve).
score: 0

http://stackoverflow.com/comment/38414268
type: QuestionComment
has text: well I guess for testing purposes you could just try an `alert` instead of `console.log`
score: 0
comment on: http://stackoverflow.com/q/24755646
type: Comment

http://stackoverflow.com/q/24750939
has comment: http://stackoverflow.com/comment/38400340
type: UnansweredQuestion
type: Question
tagged with: c#
tagged with: asp.net-mvc
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/24751085
score: 0
answer count: 2
tagged with: javascript
has title: Converting C# array to json in javascript
has body: I am converting my C# array to json in javascript on MVC view as below var selectedPatientGroups = JSON.parse('[@(Model.SelectedPatientDiscountGroups != null ? string.Join(",", Model.SelectedPatientDiscountGroups) : string.Empty)]') if Model.SelectedPatientDiscountGroups = string[]{ "abc","cd" } then I will get converted json object as var selectedPatientGroups = [abc,cd] but as json object I am expecting as ["abc","cd"] I need best solution for this.
linked to: http://stackoverflow.com/q/13278459
has comment: http://stackoverflow.com/comment/38400337
has answer: http://stackoverflow.com/a/24751022

http://stackoverflow.com/q/24816609
type: Question
tagged with: algorithm
has comment: http://stackoverflow.com/comment/38524481
tagged with: javascript
has answer: http://stackoverflow.com/a/24816752
score: 4
has title: Matrix based Game Design
upvote count: 4
has comment: http://stackoverflow.com/comment/38524922
tagged with: matrix
downvote count: 0
answer count: 1
favorite count: 0
has body: Hello there, StackOverflow! I am in the process of writing a JavaScript edition of the popular game Pentago as a side project before I have to return to classes in the fall. I am, unfortunately, entirely stumped in regards to how to proceed from my current progress with this project. My Approach When I began writing this project, I assumed that the best approach for this game would be to instantiate four matrices and put them in a list. Each matrix would represent one section of the Pentago board. I found that this approach caused me a great deal of headaches when considering my approach to how I would iterate over the matrices and determine whether or not a row of 5 game tokens had been placed. Re-evaluation of my approach I then decided to get an outside perspective on how I could approach this problem to make it simpler to solve. What was suggested was that I use one matrix instead of four. This, however does seem to make rotating each section a bit more difficult, but not unreasonably so. My question... This having all been said, what I really need to know is how I should approach determining if a player has won the game after having placed a 'token' in a certain position. Here is what I think I know: The function that will determine if the game is over will be executed after a player has rotated a quadrant. Given this, I will know which player placed that last token. I will only need to consider tokens placed by that player. I must iterate over the matrix from the position in the matrix that the last token was placed from, and determine if a token is adjacent to it. Then, recursively perform this action on every adjacent token until I have found five adjacent tokens either diagonally, vertically, or horizontally. What follows is the code that I have already written for this game. I would really appreciate any help that I can get on this part of the project... it has really stumped me! Thanks! Code so far https://github.com/jakenewby/pentagojs/tree/master/www/ap…
accepted answer: http://stackoverflow.com/a/24816752
has comment: http://stackoverflow.com/comment/38524447
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38526308
has comment: http://stackoverflow.com/comment/38524366
has comment: http://stackoverflow.com/comment/38524551
has comment: http://stackoverflow.com/comment/38524494
has comment: http://stackoverflow.com/comment/38524347

http://stackoverflow.com/a/24817627
score: 2
downvote count: 0
has body: I don't know if this is the answer you are looking for, but life gets easier when you use the 'request' package (https://www.npmjs.org/package/request) Here is what the code would look like using the request module: var request = require('request'); request('http://xyznet/v2_resmgr/providers/pools', function (error, response, body) { if (!error &amp;&amp; response.statusCode == 200) { console.log(body) // Print the body of the response. } }) Update: I coded something a little closer to your post. The code below does not use the "request" module and it contacts the server every 3 seconds. setInterval(function () { http.get('http://echo.jsontest.com/key/value', function (response) { var responseBody = ''; response.on('data', function (chunk) { responseBody += chunk; }); response.on('end', function () { console.log(responseBody); var object = JSON.parse(responseBody) }); }); }, 3000);
answers question: http://stackoverflow.com/q/24817111
accepted answer of: http://stackoverflow.com/q/24817111
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38527763
type: Answer

http://stackoverflow.com/comment/38471393
comment on: http://stackoverflow.com/q/24788389
type: Comment
type: QuestionComment
score: 1
has text: JavaScript provides no way to control how string values are managed. You might want to look into using typed arrays, though a 10MB string might exceed the size browsers are willing to allow.

http://stackoverflow.com/comment/38509482
comment on: http://stackoverflow.com/q/24808895
type: QuestionComment
type: Comment
score: 1
has text: Because you are trying to make arithmetic calculations with **DOM elements**. You have to get the *value* of the inputs instead.

http://stackoverflow.com/comment/38582408
type: QuestionComment
has text: no I know that but what they try to do? if your ds is consist of fn and ls, I think it is easier way to check it? did i get the point of ds right?
score: 0
comment on: http://stackoverflow.com/q/24847591
type: Comment

http://stackoverflow.com/comment/38662719
type: Comment
comment on: http://stackoverflow.com/a/24889812
score: 0
type: AnswerComment
has text: I am a bit confused about the code you gave 'cause I am a newbie. Could you elaborate it a bit more?

http://stackoverflow.com/q/24753521
has answer: http://stackoverflow.com/a/24753889
accepted answer: http://stackoverflow.com/a/24753933
type: Question
possible better answer: http://stackoverflow.com/a/24753885
tagged with: object
has answer: http://stackoverflow.com/a/24753885
has body: I have a function that is supposed to assign an object inside a two dimensional array. Somehow, the assignment overwrites the previous object in the array. var markersN = {}; var markersNArray = [] function addMarkerN(lat, lng, id, name, key) { markersN[key] = {}; var newMark = new google.maps.Marker({ /*marker properties*/ }); markersNArray.push(newMark); //This pushes every object to a one dimensional array just fine markersN[key][id] = newMark; //This replaces the previous object in the markersN[key] array } This is how I call the function: for(var j=0; j&lt;sekolah[i].nonlat.length; j++){ addMarkerN(sekolah[i].nonlat[j], sekolah[i].nonlon[j], j, sekolah[i].nonname[j], sekolah[i].key); } This is how I want the array to be: Array ( [0] =&gt; Array ( [0] =&gt; { /*marker object*/ } [1] =&gt; { /*marker object*/ } ) ) This is how it resulted: Array ( [0] =&gt; Array ( [1] =&gt; { /*marker object*/ } ) ) Am I doing something wrong here? How can I prevent the function from overwriting the previous object in the array? Thank you.
score: 0
tagged with: arrays
tagged with: javascript
has title: Javascript multidimensional array: object gets replaced
has comment: http://stackoverflow.com/comment/38405363
has answer: http://stackoverflow.com/a/24753933
tagged with: multidimensional-array
answer count: 3
type: AnsweredQuestion

task
type: Tag
tag name: task
tags question: http://stackoverflow.com/q/24775704

http://stackoverflow.com/q/24888498
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/38660193
answer count: 1
has body: I want to get the alert clear when I press the button clear. But I want it on the way that the button sets q = 11, then is q < 12 and it will alert clear. What am I doing wrong? clear
has comment: http://stackoverflow.com/comment/38660296
has comment: http://stackoverflow.com/comment/38660209
has comment: http://stackoverflow.com/comment/38660132
has answer: http://stackoverflow.com/a/24888621
has comment: http://stackoverflow.com/comment/38660112
downvote count: 9
has comment: http://stackoverflow.com/comment/38660259
tagged with: javascript
has comment: http://stackoverflow.com/comment/38660324
score: -8
has title: What am I doing Wrong? HTML and Javascript
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
accepted answer: http://stackoverflow.com/a/24888621

http://stackoverflow.com/q/24885345
tagged with: javascript
favorite count: 0
tagged with: autodesk
upvote count: 3
tagged with: maya
has comment: http://stackoverflow.com/comment/38683670
answer count: 0
has comment: http://stackoverflow.com/comment/110248155
downvote count: 0
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/38751376
has body: I'm building a tool to control maya with it and I'm trying to connect to maya's commandport through node webkit to send commands but with no success. I opened the port from maya with mel: commandPort -n "127.0.0.1:6000"; string $p = `commandPort -q "127.0.0.1:6000"`; if ($p == 1) {print "CommandPort Opened \n";} if ($p == 0) {print "CommandPort Closed \n";} And here is the code inside my html UI: &lt;script&gt; var net = require('net'); var maya = new net.Socket(); maya.connect(6000, '127.0.0.1', function() { console.log('Connected'); maya.write('polySphere -r 1 -sx 20 -sy 20 -ax 0 1 0 -cuv 2 -ch 1;'); }); &lt;/script&gt; The console in node webkit shows that its connected but nothing happens inside maya. I just got started with this whole node webkit thing and its pretty cool!!! I need your help to solve this problem. Thank you all in advanced for any help :)
score: 3
type: Question
has title: how to connect to maya's commandport with node webkit?
tagged with: webkit
has comment: http://stackoverflow.com/comment/42107316

http://stackoverflow.com/q/24872726
has answer: http://stackoverflow.com/a/24872849
tagged with: angularjs
tagged with: filter
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/38630939
has title: Unknown Provider for angular when creating filter in angularJS
score: 0
answer count: 1
tagged with: javascript
has body: My filter ($index % 4 == 0)is throwing a Error: [$injector:unpr] Unknown provider: (FilterProvider <- (Filter Question: How do I make this filter work so that I can create a wraping div with a class of .row; for every 4 inner items? HTML: //Create a div with a class of .row for every 4 images //creates a div with a class of c4-sm which means 25% width css: .c4-sm{ @include span(4); } .row:after { content: ""; display: table; clear: both; }

http://stackoverflow.com/comment/38530462
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24820035
has text: it gets the time when the page opens and then current_date gets the date every second.It computes the difference between the times; when the time interval is greater than the delay time given the program stops.

http://stackoverflow.com/comment/38556802
type: QuestionComment
has text: Actually, since Felix noted it in his answer, I removed the fix to keep that answer consistent with the Q. @LeonidBeschastny
comment on: http://stackoverflow.com/q/24831995
score: 0
type: Comment

http://stackoverflow.com/a/24862255
score: 3
has body: Issue: Bug happens when using a predefined symbol path. // Define a symbol using a predefined path (an arrow) // supplied by the Google Maps JavaScript API. var lineSymbol = { path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW }; JSFiddle demo Solution: Create your own symbol path and problem will not appear anymore. // Define your custom symbol path var lineSymbol = { path: 'M -2,0 0,-2 2,0 z', strokeColor: '#F00', fillColor: '#F00', fillOpacity: 1 }; JSFiddle demo Quite an easy fix but it's still a bug so I think it's a good thing that you created a bug report. Edit: We got a feedback from Google. The jsfiddle shows a symbol that's too big. https://developers.google.com/maps/documentation/javascript/3.exp/reference#Symbol The documentation for the 'scale' parameter says: after scaling, the symbol must lie inside a square 22 pixels in size centered at the symbol's anchor.
has comment: http://stackoverflow.com/comment/38611602
has comment: http://stackoverflow.com/comment/38611279
downvote count: 0
answers question: http://stackoverflow.com/q/24853312
type: Answer
upvote count: 3

http://stackoverflow.com/q/24878449
has answer: http://stackoverflow.com/a/24878623
type: AnsweredQuestion
upvote count: 1
has body: I want those images to be visible when i hover them over the text. But according to this it works but it selects the first one only as there is same id for every images. Does anyone knows to fix this problem.Thanks in advance. New to web page dev. So please explain in details. Thanks. jQuery UI Selectable - Default functionality Item 1 Item 2 Item 3 Item 4 Item 5
has answer: http://stackoverflow.com/a/24883355
type: Question
has answer: http://stackoverflow.com/a/24878634
accepted answer: http://stackoverflow.com/a/24883355
score: 1
has comment: http://stackoverflow.com/comment/38641778
has comment: http://stackoverflow.com/comment/38641620
possible better answer: http://stackoverflow.com/a/24878537
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24878537
favorite count: 0
has title: HTML image pop up while hover
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4

http://stackoverflow.com/comment/38597348
score: 0
has text: "The text stringified as requested in comments" --- so? Is the stringified value expected?
comment on: http://stackoverflow.com/q/24855142
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24844844
has comment: http://stackoverflow.com/comment/38577074
type: Answer
has comment: http://stackoverflow.com/comment/38577428
score: 3
has comment: http://stackoverflow.com/comment/38576983
downvote count: 0
has body: Simple fix... you're not indexing the array properly var words = ['petrol', 'leaded', 'rate', 'crime', 'behalf']; function chooseWord () { var wordsLength = words.length; for (var i = 0; i &lt; wordsLength; i++) { return words[i]; // index using the 'i' value, not the word length } } however, since you return at each call to the function, this will get you the same word every time. Try something like this instead: var words = ['petrol', 'leaded', 'rate', 'crime', 'behalf']; var nextIndex = 0; function chooseWord () { if ( nextIndex &gt;= words.length ) { // make sure it doesn't get higher than the length. nextIndex = 0; } nextIndex++; return words[nextIndex-1]; } Test with: alert(chooseWord()); alert(chooseWord()); alert(chooseWord()); alert(chooseWord()); Each time you call, you will get a new word. Example output using this test: petrol leaded rate crime
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24844821
upvote count: 3
has comment: http://stackoverflow.com/comment/38577067
answers question: http://stackoverflow.com/q/24844821
has comment: http://stackoverflow.com/comment/38577383

http://stackoverflow.com/a/24939664
type: AcceptedAnswer
has body: This script worked great. &lt;script&gt; var nodeList = document.getElementsByClassName('contents'); for(var i=0;i&lt;nodeList.length;i++) { var obj = nodeList[i]; obj.addEventListener('touchmove', function(event) { var touch = event.targetTouches[0]; // Place element where the finger is event.target.style.left = touch.pageX + 'px'; event.target.style.top = touch.pageY + 'px'; event.preventDefault(); }); } &lt;/script&gt;
accepted answer of: http://stackoverflow.com/q/24778624
type: Answer
answers question: http://stackoverflow.com/q/24778624
score: 0

http://stackoverflow.com/comment/38398812
comment on: http://stackoverflow.com/q/24750058
score: 0
type: QuestionComment
type: Comment
has text: @RajaprabhuAravindasamy He does't show any code with in the loop .. that s y i said like that ...

http://stackoverflow.com/comment/38905349
comment on: http://stackoverflow.com/a/24959407
has text: https://gist.github.com/thinkingsites/9a4b4fe05a86c5dad210 It's leveraging packages I was already using, so it makes use of JQDeferred to implement when. The primary difference in functionality is that I Can pass an array, or a list of arguments as the promise list, but that's nothing fancy, I just often have need to pass in dynamic arrays of promises.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/24889624
has comment: http://stackoverflow.com/comment/38665172
has comment: http://stackoverflow.com/comment/38664578
has comment: http://stackoverflow.com/comment/38665229
has comment: http://stackoverflow.com/comment/38664679
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/38665259
answer count: 3
linked to: http://stackoverflow.com/q/24857334
upvote count: 0
has answer: http://stackoverflow.com/a/24889771
tagged with: google-chrome-extension
tagged with: jquery
favorite count: 0
tagged with: parsing
has answer: http://stackoverflow.com/a/24889672
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: How to load a url and check the event of clicking of link?
has comment: http://stackoverflow.com/comment/38665563
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38665332
has body: I am trying to load a url then check for a particular text of anchor and now I want to set an event of clicking of that anchar tag.How can I do it?So far my code: $.get(y, function(data) { console.log(data); $(data).find('a').each(function() { console.log($(this).text()); if($(this).text().indexOf("Full Text as PDF")&gt;=0) { alert($(this).text());} }); P.S: I am trying to do this in a chrome Extension. UPDATED CODE: chrome.tabs.onActivated.addListener( function(activeInfo){ chrome.tabs.get(activeInfo.tabId, function(tab){ y = tab.url; $.get(y, function(data) { console.log(data); $(data).find('a').each(function() { console.log($(this).text()); if($(this).text().indexOf("Full Text as PDF")&gt;=0) { alert($(this).text()); $(this).on("click", function() { console.log("link clicked"); alert("link clicked"); }); } }); }); }); });
has answer: http://stackoverflow.com/a/24889894

http://stackoverflow.com/a/24784803
accepted answer of: http://stackoverflow.com/q/24784509
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38464291
has comment: http://stackoverflow.com/comment/38467618
answers question: http://stackoverflow.com/q/24784509
upvote count: 2
type: Answer
score: 2
has body: The setInterval function takes a function to call and a delay in milliseconds. You cannot have a delay of 0 milliseconds; there is a minimum delay in place (which according to the specs is 4ms). Take a look at the documentation for more. // To call a function every second: var timer = setInterval(myFunction, 1000); // This doesn't throw an error as the 0 is being overridden by a default minimum: var timer = setInterval(myFunction, 0); If you want to call the function initially and ALSO every second after that, you should call the function when you set the interval: var timer = setInterval(myFunction, 1000); myFunction(); Here's what the Mozilla docs say about the minimum delay: "In fact, 4ms is specified by the HTML5 spec and is consistent across browsers released in 2010 and onward. Prior to (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2), the minimum timeout value for nested timeouts was 10 ms." Regarding the slowness on IE8, the setInterval "lag" is probably being caused by IE8 being too slow to keep up with what the function is trying to do. At each time interval, the function is called, but IE8 is queue is being overloaded as a result -- to the point that IE8 can't keep up. Increasing the delay would mask this issue I'd imagine. As Vasile says on this Google Code forum: "When a new call is triggered if the previous call is not ended then the new call is queued and will wait for it's time to be executed; and here is the problem... (the timer will slow down when the queue will grow and the performance will go down over time)" Note that this is a common problem for low delays in IE8; check this post for more on this specific issue. Also, a quick point to note about setInterval delays is that inactive tabs are occasionally treated differently: "In (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2) and Chrome 11, timeouts are clamped to firing no more often than once per second (1000ms) in inactive tabs..." See this related SO post for more.
has comment: http://stackoverflow.com/comment/38464188
has comment: http://stackoverflow.com/comment/38464522
has comment: http://stackoverflow.com/comment/38465323

http://stackoverflow.com/comment/38659528
has text: here your textarea id like 3 and 3. and you are retirving it like $('textarea#'+jid).val();
score: 0
comment on: http://stackoverflow.com/q/24888120
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/121037394
has text: @Bergi yes you right. I wanted to say "a syntax to accept argument", but this was misleading. I think it's self explanatory with the code snippet now.
comment on: http://stackoverflow.com/a/68486864
type: AnswerComment
score: 1
type: Comment

http://stackoverflow.com/q/24785622
has answer: http://stackoverflow.com/a/67161312
has answer: http://stackoverflow.com/a/30830415
answer count: 5
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24787166
linked to: http://stackoverflow.com/q/10145101
tagged with: css
has body: I have a single accordion item that I am using for a read more / less link on a page. The purpose of this is to click it to read more, and a few paragraphs will follow. I have this working, but I need it to stay closed when the page loads, at the moment the page loads with the item open. What can I add to fix this? Read More / Less more info. More titles more content
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/24787334
type: Question
tagged with: javascript
score: 0
has title: Bootstrap - Cant get my Accordion to stay closed on default?
linked to: http://stackoverflow.com/q/27988776
has answer: http://stackoverflow.com/a/24785964
tagged with: accordion

http://stackoverflow.com/q/24850841
has comment: http://stackoverflow.com/comment/38589040
has comment: http://stackoverflow.com/comment/38588533
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38588696
answer count: 0
type: Question
has title: How do i change my text everytime when i click on the link in JavaScript?
tagged with: javascript
has body: I would like to create a text generator however when i click on the link it can only generate some sample text which is stored in array once. I have tried using more than one string but i cant get it to work. Here is the code: HTML: Text generate 2 - copy Generate JS: var heading = document.getElementById('head'); var paragraph = document.getElementById('para'); var head = ["Sample heading one"]; var para = ["Sample paragraph one"]; document.getElementById("link").onclick = function visible() { if (heading.style.display = "none") { heading.style.display = "block"; } else { heading.style.display = "block"; } if (paragraph.style.display = "none") { paragraph.style.display = "block"; } else { paragraph.style.display = "block"; } heading.innerHTML = head; paragraph.innerHTML = para; } JS Bin
has comment: http://stackoverflow.com/comment/38588981
score: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/38688728
type: AnswerComment
has text: @BiAiB Like Andy said, I was referring to the controller declarations only.
comment on: http://stackoverflow.com/a/24891277
score: 0
type: Comment

http://stackoverflow.com/comment/38624482
comment on: http://stackoverflow.com/a/24868516
has text: @Jonathan so everything working as the enablejsapi=1 right? My Demo too?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/24845736
tagged with: css
has answer: http://stackoverflow.com/a/24845847
answer count: 4
type: AnsweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/38578836
type: Question
accepted answer: http://stackoverflow.com/a/24845757
has title: Selected state to div
tagged with: javascript
has body: Is it possible to add a selected state to a div. i.e add border to div that is clicked? Only display one at a time Fiddle here: http://jsfiddle.net/sPLDh/4/ HTML: John doe Peter Pan Sally Hills John Doe is Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sollicitudin molestie ipsum ut fermentum. Duis adipiscing purus gravida, elementum neque nec, mollis tortor. Peter Pan is Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sollicitudin molestie ipsum ut fermentum. Duis adipiscing purus gravida, elementum neque nec, mollis tortor. Sally Hills is Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sollicitudin molestie ipsum ut fermentum. Duis adipiscing purus gravida, elementum neque nec, mollis tortor. Betty Boo Sm Hunt Paula Walls Betty Jones Doe is Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sollicitudin molestie ipsum ut fermentum. Duis adipiscing purus gravida, elementum neque nec, mollis tortor. Sam Hunt is Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sollicitudin molestie ipsum ut fermentum. Duis adipiscing purus gravida, elementum neque nec, mollis tortor. Paula Walls is Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sollicitudin molestie ipsum ut fermentum. Duis adipiscing purus gravida, elementum neque nec, mollis tortor. CSS: .people{ width:500px; } .person{ width:33%; margin:0 auto; float:left; } .people p{ display:none; } JS: $('.person img').click(function() { var index = $('.person img').index(this); $('.people p:visible').fadeOut('fast','linear').promise().done(function() { $('.people p:eq('+index+')').fadeIn('fast','linear'); }); });
has answer: http://stackoverflow.com/a/24845774
has comment: http://stackoverflow.com/comment/38578832
has answer: http://stackoverflow.com/a/24846458
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/24845774
has comment: http://stackoverflow.com/comment/38578803
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24845757

http://stackoverflow.com/comment/38675945
type: Comment
has text: [http://jsfiddle.net/zVS3t/7/](http://jsfiddle.net/zVS3t/7/) : Link to your code. What's wrong with it?
comment on: http://stackoverflow.com/a/24896215
type: AnswerComment
score: 0

http://stackoverflow.com/q/24784615
has body: I have the following directive in my project: app.directive('eventSessionsList', function() { return { restrict: 'AEC', scope: { input: '=data' }, templateUrl: 'directives/event-sessions-list.html' }; }); The template looks like this: {{ session.date }} {{ session.length }} hr session @ {{ session.venue }} When I try to load the page it crashes with no errors (tested in both Safari and Chrome).
answer count: 2
upvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/47339136
tagged with: angularjs
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24784616
downvote count: 0
has title: Angular directive crashing browser
score: 1
type: Question
possible better answer: http://stackoverflow.com/a/47339136
has answer: http://stackoverflow.com/a/24784616
tagged with: javascript

http://stackoverflow.com/comment/38511319
comment on: http://stackoverflow.com/q/24808720
score: 0
type: Comment
has text: @AliHamze If a question is edited after it's closed, it enters the Reopen Votes review queue, where members with >3K rep consider whether the edit justifies reopening the question. I just gave you a reopen vote. If four other reviewers agree, it will be reopened.
type: QuestionComment

http://stackoverflow.com/comment/38685559
type: Comment
has text: I think setTimeout not suitable function in this example. But I think it's best )
comment on: http://stackoverflow.com/a/24901761
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38438633
has text: `XMLHttpRequest` is cross browser, if you want something that handles all browsers (including old versions of IE, etc.) use jQuery or some other framework that handles this abstraction for you.
comment on: http://stackoverflow.com/q/24771222
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24855771
has body: Your code errors with "Uncaught TypeError: undefined is not a function" on line histChart.refresh I modified example of ProjectCumulativeFlow to filter by Release. Full code is in this github repo. Instead of extending Rally.app.App, I extended Rally.app.TimeboxScopedApp. SnapshotStore may filter by Release, but requires ObjectID. Here is the find: find: { _TypeHierarchy: { '$in' : [ 'HierarchicalRequirement', 'Defect' ] }, Release: this.getContext().getTimeboxScope().record.data.ObjectID, Children: null, _ProjectHierarchy: this.getContext().getProject().ObjectID } To update the app after Release selection check if the chart already exists (if yes, destroy it): onScopeChange: function() { if (this.down('#mychart')) { this.down('#mychart').destroy(); } this.add({ xtype: 'rallychart', itemId: 'mychart', storeType: 'Rally.data.lookback.SnapshotStore', storeConfig: this._getStoreConfig(), calculatorType: 'Rally.example.CFDCalculator', calculatorConfig: { stateFieldName: 'ScheduleState', stateFieldValues: ['Defined', 'In-Progress', 'Completed', 'Accepted'] }, chartConfig: this._getChartConfig() }); },
has comment: http://stackoverflow.com/comment/38921669
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24833885
answers question: http://stackoverflow.com/q/24833885
type: Answer

http://stackoverflow.com/a/24755387
type: Answer
score: 2
downvote count: 0
has body: You can use arguments.callee.name, like this function abcd() { console.log("name of the function using", arguments.callee.name); }; abcd(); # name of the function using abcd Note: arguments.callee.name will work only with the functions defined with a name. It will not work with anonymous functions. For example, if you had defined your function, like this var abcd = function () { console.log("name of the function using", arguments.callee.name); }; abcd() would just print name of the function using. Because arguments.callee.name would be an empty string in this case.
answers question: http://stackoverflow.com/q/24755316
upvote count: 2
accepted answer of: http://stackoverflow.com/q/24755316
type: AcceptedAnswer

http://stackoverflow.com/q/24801610
downvote count: 1
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/38495616
has comment: http://stackoverflow.com/comment/38495695
has comment: http://stackoverflow.com/comment/38496268
tagged with: typography
type: Question
has title: JQuery .css() ignoring previous changes
answer count: 1
has answer: http://stackoverflow.com/a/24801751
tagged with: javascript
tagged with: jquery
has body: I have a color picker and a typography selector that change the color and font of a text. In order to do so, I have the following JQuery code: // Title color $(".pick-a-color").on("change", function() { $(".preview-header-text").css("color", "#" + $(this).val()); }); // Title typography $(".form-control").change(function() { $(".preview-header-text").css("font-family", $(this).val()); }); The problem is that if I first change the typography and then the color, the typography also changes and resets to the default typography. It doesn't happen the other way round, if I change the color and then the typography, the color doesn't reset to the default color.
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38495594
tagged with: css
favorite count: 0
upvote count: 2
accepted answer: http://stackoverflow.com/a/24801751
has comment: http://stackoverflow.com/comment/38495696

http://stackoverflow.com/comment/38545731
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24827926
has text: Yeah, I forgot the name of that. Hold on i'm going to edit my question. But yes, I am asking how to route to another .HTML page using `ng-route`

http://stackoverflow.com/comment/38580941
type: Comment
type: QuestionComment
has text: yes, it work good when loaded not in an iframe.
comment on: http://stackoverflow.com/q/24794950
score: 0

http://stackoverflow.com/comment/38620100
comment on: http://stackoverflow.com/a/24867256
score: 0
type: AnswerComment
has text: i need in separate file, how to call $segmentData
type: Comment

http://stackoverflow.com/q/24786274
linked to: http://stackoverflow.com/q/10996067
has body: I am a developer for a web application. In this application there is a certain scenario where there are multiple position:fixed elements, and canvases and a overflow:scroll element. In this scenario, scrolling is super slow on firefox when smooth scrolling is enabled. From the user's perspective the solution is simply to disable smooth scrolling. However, as a developer I can't ensure that the user has done this. Is there anywhere that I can tell firefox to not to use smooth scrolling for my website from javascript (or html)? Or is there any other known workaround for this?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/38505074
has title: Javascript workaround for slow scrolling with smooth scrolling in firefox
has answer: http://stackoverflow.com/a/38465743
type: Question
possible better answer: http://stackoverflow.com/a/38465743
tagged with: firefox
downvote count: 0
tagged with: javascript
favorite count: 0
upvote count: 8
answer count: 3
has comment: http://stackoverflow.com/comment/38630693
has comment: http://stackoverflow.com/comment/38467210
has comment: http://stackoverflow.com/comment/64195210
has answer: http://stackoverflow.com/a/38501877
score: 8
has comment: http://stackoverflow.com/comment/64440894
has comment: http://stackoverflow.com/comment/64437612
tagged with: scroll
accepted answer: http://stackoverflow.com/a/38501877
has comment: http://stackoverflow.com/comment/64244520

http://stackoverflow.com/q/24787819
has comment: http://stackoverflow.com/comment/38470851
has title: Displaying "No Results Found" in autocomplete
has comment: http://stackoverflow.com/comment/38470884
duplicate of: http://stackoverflow.com/q/4718968
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38470264
has comment: http://stackoverflow.com/comment/38470302
has comment: http://stackoverflow.com/comment/38471098
linked to: http://stackoverflow.com/q/4718968
tagged with: autocomplete
has comment: http://stackoverflow.com/comment/38470244
linked to: http://stackoverflow.com/q/4141945
type: Question
has comment: http://stackoverflow.com/comment/38471073
score: 0
has comment: http://stackoverflow.com/comment/38470308
answer count: 1
has answer: http://stackoverflow.com/a/24790783
tagged with: javascript
tagged with: jquery
has body: I need to display no results found if the search term by the user doesn't matches any result from the database. I have gone through various questions on here, but none helped me. &lt;script&gt; $(function() { function log( message ) { $( "&lt;div&gt;" ).text( message ).prependTo( "#log" ); $( "#log" ).scrollTop( 0 ); } $( "#birds" ).autocomplete({ source: "search.php", minLength: 2, select: function( event, ui ) { log( ui.item ? "Selected: " + ui.item.value + " aka " + ui.item.label : "Nothing selected, input was " + this.actor ); window.location.href = './company.php?id=' + ui.item.indexid + '&amp;name=' + ui.item.label; } }); }); &lt;/script&gt; Any suggestion would be helpful.

http://stackoverflow.com/comment/38515357
has text: Yes, it is a bit confusing. to me has-dropdown should mean the dropdown is active... Also, where one wants to maintain the same style, but if one removes the anchor tag, you're dealing with a different style. Could be better documented and maybe have has-dropdown p or span inherit has-dropdwon a styles...
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24773484

http://stackoverflow.com/comment/38461815
has text: And if you wish to fix the Menu item also, then Add position fixed to it as well and also set a z-index, so that it doesn't goes below the lower scrollable content.
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/24783406

http://stackoverflow.com/comment/38624002
comment on: http://stackoverflow.com/q/24869126
has text: @Pointy - I have read that 'eval() is evil' in number of online forums but I don't know how is it an evil? What problem does it create? In fact, some javascript obfuscators use the `eval()` a number of times while minifying the js.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24832110
favorite count: 0
tagged with: twitter-bootstrap-3
possible better answer: http://stackoverflow.com/a/26898581
linked to: http://stackoverflow.com/q/19843732
accepted answer: http://stackoverflow.com/a/24832847
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26898581
has title: Button toggle horizontal with bootstrap
has answer: http://stackoverflow.com/a/74951733
upvote count: 10
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24832847
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has body: I'm trying to get a button to expand/collapse horizontally other elements(share buttons) and inline using the bootstrap framework I'm failing at two things: The button doesn't expand the other elements inline and after the actual + button When it collapse back the elements in it breaks the line and stack on top of each other I prepared a fiddle: http://jsfiddle.net/g7qCZ/ Here is my html code: + Star Star Star Star And my css: #demo.width { height: auto; -webkit-transition: width 0.35s ease; -moz-transition: width 0.35s ease; -o-transition: width 0.35s ease; transition: width 0.35s ease; }
tagged with: css
score: 10

jquery-animate
tags question: http://stackoverflow.com/q/24846534
tag name: jquery-animate
tags question: http://stackoverflow.com/q/24776205
tags question: http://stackoverflow.com/q/24783304
type: Tag
tags question: http://stackoverflow.com/q/24883837
tags question: http://stackoverflow.com/q/24827415
tags question: http://stackoverflow.com/q/24758417
tags question: http://stackoverflow.com/q/24852510

http://stackoverflow.com/q/24900847
has comment: http://stackoverflow.com/comment/38685742
type: Question
has body: I'm starting using OO concepts in Javascript. So, I have several "class" js files simulating each one an OO object. Each class is defined in a single file, like myClass1.js, myClass2.js, etc. Each class looks like: // FILE myproject.classlib.myClass1 // "Class" function myClass1(param1, param2){ // Properties this.prop1 = param1; this.prop2 = param2; } /// "Methods" myClass1.prototype.doSomething = function(){ alert('myClass1 Hello world. prop1=' + this.prop1); alert('myClass1 Hello world. prop2=' + this.prop2); } Now I need to build a module to control usage scope of these classes and organize them into "libraries". Something that would allow me to use something like: var instance1 = new myProject.myClassLibrary1.myClass1('a', 'b'); var instance2 = new myProject.myClassLibrary1.myClass2('c', 'd'); var instance3 = new myProject.myClassLibrary2.myClass1('e', 'f'); var instance4 = new myProject.myClassLibrary2.myClass2('g', 'h'); instance1.doSomething(); /// prop1=a prop2=b instance2.doSomething(); /// prop1=c prop2=d instance3.doSomething(); /// prop1=e prop2=f instance4.doSomething(); /// prop1=g prop2=h How to I define my original class code definition so that it belongs to myClassLibraryN and to myProject ? How can I make use of this library as the second code?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24901039
accepted answer: http://stackoverflow.com/a/24902196
has title: how to build modules simulating a class library and controlling scope usage
has answer: http://stackoverflow.com/a/24902196
tagged with: javascript
has answer: http://stackoverflow.com/a/24900907
score: 0
possible better answer: http://stackoverflow.com/a/24901039
answer count: 3

http://stackoverflow.com/comment/38525602
type: QuestionComment
comment on: http://stackoverflow.com/q/24817379
score: 1
has text: Have you tried something like `eval("contact.send(email)");`?
type: Comment

http://stackoverflow.com/q/24904296
type: Question
possible better answer: http://stackoverflow.com/a/24914750
answer count: 2
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/24904384
tagged with: shell
tagged with: unix
tagged with: node.js
has title: Rund NodeJS file in shellscript loop
has body: My shellscript looks like for i in {1..5} do echo "Welcome $i times" exec node nodefile.js done and the nodefile.js looks like console.log 'running nodefile' When I call the ./shellscript.sh there will only be displayed "Welcome x times" and "running nodefile" once. Whats missing there? Is there anything that I have to return in nodefile or something else?
accepted answer: http://stackoverflow.com/a/24904384
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24914750
tagged with: loops

http://stackoverflow.com/q/24838136
answer count: 1
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/38567548
tagged with: parallax
favorite count: 0
has comment: http://stackoverflow.com/comment/38693407
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/38568506
has body: I've a small bit of parallax on a site I'm working on, it's working almost fine but the foreground divs are a bit jumpy when I scroll down the page. Near the top of the page I have a div called #top-banner, it has a fixed background image, sitting within this div are two more within a row, the fisrt div / column has an image of a model & the second div has just text. Below the #top-banner div is a div with a background image of a waterline, the desired effext is to have the waterline to cover the #top-banner as the user scrolls down, to make it seem as if the model, text & background are being covered by water. I've got it working by using jQuery to change the css bottom property to make it seem that the two columns divs are moving down the page beneath the waterline at a similar speed to the scroll when the user scrolls down the page. I've set the speeds/increments to be slightly different to create a parallax effect. It's working pretty well but is a bit jumpy, I've also tried to use the jQuery animate function but that is even more jumpy. HTML Lorem Ipsum More Ipsum CSS #hp-top-banner { background: url(bg.png); height: 600px; background-attachment: fixed; background-origin: initial; background-clip: initial; background-size: cover; overflow: hidden; width: 100%; position: relative; } #hp-water-line { background: url(water-line.png) no-repeat transparent; min-height: 92px; margin: 0 auto; width: 100%; position: relative; top: -15px; background-size: cover; } JS $(document).ready(function(){ function parallax(){ var prlx_effect_1= -((window.pageYOffset / 4) *2.25 ); $('.prlx-1').css({"position": "relative","bottom":prlx_effect_1, "transition": "0s ease-in-out"}); // jQ('.prlx-1').css({"position": "relative"}); // jQ('.prlx-1').animate({"bottom":prlx_effect_1},"fast"); var prlx_effect_2= -(window.pageYOffset / 5 ); $('.prlx-2').css({"position": "relative","bottom":prlx_effect_2, "transition": "0s ease-in-out"}); } window.addEventListener("scroll", parallax, false); …
has answer: http://stackoverflow.com/a/26717139
has title: parallax scrolling is a bit jumpy
has comment: http://stackoverflow.com/comment/38577122
type: Question
tagged with: javascript
score: 4
upvote count: 4
has comment: http://stackoverflow.com/comment/38569843
has comment: http://stackoverflow.com/comment/38574159

http://stackoverflow.com/q/24864571
tagged with: javascript
has body: I am experiencing an issue with my WordPress site - it uses a ScrollTop function to scroll to each section break. What I am experiencing is that when scrolling, it doesn't scroll to the right location. I've look all over the code, and can't determine what is causing the issue. You can see the basic code below for ScrollTop, nothing too different. var hash = this.hash; // animate jQuery('html, body').stop().animate({ scrollTop: jQuery(this.hash).offset().top, }, 1000, 'swing', function(){ // when done, add hash to url // (default click behaviour) window.location.hash = hash; }); I've attempted offsetting the scroll, but each section seems to have different overscroll. I've removed all CSS padding and margins which hasn't changed the issue. Has anyone experienced a similar issue with scrolling before? The strange aspect is, that if you click the same link again, it figures it out and scrolls to the right section ID. You can find a link to my website here. I've currently got an issue with FadeIn which I'm working on, so ignore that part of it. Would it be a good assumption that the scroll and fadeIn are conflicting each other? The FadeIn on some sections does in fact increase the length of the Div.
type: Question
has comment: http://stackoverflow.com/comment/38615677
score: 0
has title: Issue with ScrollTop function - Over scrolling
answer count: 1
has answer: http://stackoverflow.com/a/24865288
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: UnansweredQuestion

http://stackoverflow.com/comment/38554557
score: 1
comment on: http://stackoverflow.com/q/24832535
type: Comment
type: QuestionComment
has text: You should show the relevant HTML code, not code that generates it. You should explain how the stars are presented (somehow with CSS presumably). The code should contain the attribute you have tried, and you should explain what you expected it to do and how that failed. “Not working” is not a problem description.

http://stackoverflow.com/q/24763626
tagged with: angularjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38423965
has comment: http://stackoverflow.com/comment/38425008
has answer: http://stackoverflow.com/a/24764342
type: Question
has body: Im working on a simple todo app tutorial online based on: http://ionicframework.com/docs/guide/building.html What if I wanted a database where instead of a fixed list like in the example, there would be a store where users can input their list dynamically, with room for edit and comments on their tasks outstanding? a paragraph of text user name noted timestamp It would then appear as a todo list that upon clicking, would open up to be editable and able to add more comments to it? I have followed a couple of tutorials but all of them use fixed data sets. I did some research and got the below snippets, my understanding of Angular is still weak so am not exactly clear how the codes work. Something isnt working and Im not sure why. Can anyone explain and help? Specifically on params and how id comes into play, as well as the convention of url routing, like #/something.html etc. The tutorial has firebase back end but if you have any better suggestions (like server and back end language), please let me know. Ive seen tutorials using JSON but again, not sure how that works. For app.js .state('bucket.list.detail',{ url: '/list/:itemId', views: { 'bucket-list-detail':{ templateUrl: 'templates/bucket-list-detail.html', controller: 'DetailController' } } }) For controller.js .controller('DetailController', function($rootScope, $scope, $stateParams, $window, $firebase){ $scope.item = items.get($stateParams.itemId); }) For the view file, bucket-list-detail.html (I just typed in some trash lines to test the code) &lt;p&gt;{{ item.item }}&lt;/p&gt; &lt;p&gt; &lt;a class="button button-small icon ion-arrow-left-b" href="#/bucket/list"&gt; Main List &lt;/a&gt; &lt;/p&gt;
tagged with: javascript
has title: Angular JS/ Html queries on Ionic
score: 0
answer count: 1

http://stackoverflow.com/comment/38504351
comment on: http://stackoverflow.com/a/24803974
score: 0
type: AnswerComment
has text: Thank you for your help. thats a realy nice code. i like the idea with the throttling. its working perfect on my page
type: Comment

http://stackoverflow.com/comment/38555066
has text: the second block will not work as input/select/textarea have a `innerHTML` property, and you are not doing a typeof call so you would actually be testing the property's value is not the string "undefined" instead of testing existance
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24832876

http://stackoverflow.com/comment/44310172
type: QuestionComment
comment on: http://stackoverflow.com/q/24765957
score: 1
has text: Q: What is developer's worst nightmare? A: That while you are searching for solution of a problem, you find a StackOverflow question asking exactly the same thing you are looking for. The question was asked one year ago and no one yet answered! I don't think it is impossible. Mega.nz has already implemented it. I am still trying to figure out how they did that.
type: Comment

http://stackoverflow.com/q/24856552
tagged with: javascript
has body: I have a page that is using my ClientController and template to show a table of information that is retrieved from the server. For each collection of data I'd like to have 2 table rows, one that is always showing, and another which only shows when the first one is clicked. I've simplified the code as there is a bit more going on here, but nothing that I would have thought would affect this. My HTML looks like {{session.test_name}} view {{session.session_id}} {{session.session_ID}} and more details in my controllers.js i have .controller('ClientController', ['$scope', function($scope) { $scope.showID = function(sessionID){ $scope.sessionID = sessionID alert($scope.sessionID) } }]) the alert pops-up with correct ID but the table rows aren't showing as I would have expected.
tagged with: ng-switch
has answer: http://stackoverflow.com/a/24857550
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/24857550
type: AnsweredQuestion
has title: ng-switch inside ng-repeat what am I missing?
score: 0
type: Question
answer count: 1

http://stackoverflow.com/a/24751085
answers question: http://stackoverflow.com/q/24750939
has body: Why not use the built-in JSON serializer? var selectedPatientGroups = @Html.Raw(Json.Encode(Model.SelectedPatientDiscountGroups));
upvote count: 1
score: 1
downvote count: 0
type: Answer

http://stackoverflow.com/comment/38437202
score: 0
comment on: http://stackoverflow.com/q/24770546
type: Comment
type: QuestionComment
has text: Are you trying to concatenate all the strings in the array into one string, or are you trying to concatenate the elements of the array into one array?

http://stackoverflow.com/q/24880066
type: Question
tagged with: javascript
has title: Vertical alignment of Raphael canvas broken in Twitter bootstrap tab
tagged with: raphael
accepted answer: http://stackoverflow.com/a/24932651
answer count: 1
tagged with: angular-ui
has body: I just filed a bug for Twitter bootstrap tab element. I am asking here to see if somebody has ideas for a workaround until this bug is fixed. The problem: The layout in the tabs seems to behave different whether the tab is active or hidden initially. When drawing SVG elements (in this case, with Raphael.js), the vertical alignment is different, depending on the initial tab state (active or not). Here is a JSFiddle demonstrating the issue. Explanation: the following Raphael instructions should draw a text horizontally and vertically centered into a circle (should look like a Billard ball). paper.circle(13, 13, 10.5); paper.text(13, 13, "10"); This works in many cases, but if you draw the same on a canvas in an inactive bootstrap tab and then switch to it, you can see that here the alignment is broken. See my fiddle. Maybe there's a quick workaround? Can I "reset" the viewport in the hidden tab somehow? BTW: I stumbled across this problem using angular-ui, that's why this question is tagged with angular as well. But the problem seems to lie within Bootstrap.
tagged with: angularjs
type: AnsweredQuestion
tagged with: twitter-bootstrap
score: 0
has answer: http://stackoverflow.com/a/24932651

http://stackoverflow.com/q/24843950
has answer: http://stackoverflow.com/a/24844010
score: 0
answer count: 1
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: innerhtml
has body: I have a Chrome extension in which I'm fetching tab title and url, and putting them into one single line. Same as Chrome History. I want to separate them visually, dark title, lighter url. and for that I'm using this code nodeTitle.innerHTML = tabs[j].title + "&lt;span id='url'&gt;" + ' - ' + tabs[j].url + "&lt;/span&gt;" ; CSS for #url is set and everything works fine, unless page title have some actual HTML code/tag in it, and title get messed (ofc. innerHTML works as it supposed to). example page...look at title innerText doesn't help in this situation, because I need &lt; span > treated as it is. Is there any way to cancel HTML execution for that first part (which can be any variable) or I have to separate them into two different elements and style them? (and I'm really trying to avoid that) ...maybe check for tags and insert space if any exist??!... relized while writing this question, span tag in pointy brackets :)
type: Question
has title: prevent execution of innerHTML
tagged with: javascript

http://stackoverflow.com/comment/38410306
type: Comment
comment on: http://stackoverflow.com/a/24753935
has text: Hi, apologies, I found the problem in some JS which I didn't think to include in my original post. I still don't understand exactly what is wrong with the code that has caused the problem, so I've updated my post with the good and bad code in the hope that someone can tell me.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38625912
has text: @uhsarp that doesn't make sense, servers can make http requests just like browser can or use curl requests
type: QuestionComment
comment on: http://stackoverflow.com/q/24869165
score: 0
type: Comment

http://stackoverflow.com/comment/38491786
has text: I tried to move angular.min.js in the head section without resoluts
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24799274
score: 0

http://stackoverflow.com/comment/38571453
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/24841925
has text: [Data attributes](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes)

http://stackoverflow.com/comment/38501051
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24804194
has text: X-Token is no proprietary (?) It's just an http header fixed to all ajax http request of my webapp. The value is an auth key, retrieved from login request and stored in a cookie. Thks for your reply, I'm looking for sending cookie value automatically and I hope this will work.
score: 0

http://stackoverflow.com/comment/38633201
type: QuestionComment
type: Comment
score: 1
has text: You can't compare by reference, which is what you're doing in your code. See http://stackoverflow.com/questions/7837456/comparing-two-arrays-in-javascript
comment on: http://stackoverflow.com/q/24873809

http://stackoverflow.com/a/24903427
downvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/24903388
upvote count: 0
has comment: http://stackoverflow.com/comment/38688747
has comment: http://stackoverflow.com/comment/38688705
score: -1
has comment: http://stackoverflow.com/comment/38688687
has body: you can try below code: Use position:fixed for that. #foodInfo{position:fixed;}

http://stackoverflow.com/q/24792947
tagged with: javascript
tagged with: jquery
tagged with: callback
has answer: http://stackoverflow.com/a/24793511
tagged with: ajax
tagged with: scope
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38480379
accepted answer: http://stackoverflow.com/a/24793682
linked to: http://stackoverflow.com/q/750486
has title: Unable to access global array in AJAX callback
type: AnsweredQuestion
has body: I'm trying to access a global array inside the $.getJSON callback. For some reason I can access the array for actually calling the ajax request, but it is undefined within the callback. JS var toprint = [ {name: "Name", year: "2014", call: "http://api.call.com"}, // etc..... ] for(var i = 0; i &lt; toprint.length; i++){ $.getJSON( toprint[i].call, function( data) { // toprint[i].call accessed fine // some code... // toprint[i] undefined below jsonPrint = "&lt;div class='col'&gt;&lt;h3&gt;" + toprint[i].name + "&lt;/h3&gt;" + toprint[i].year + "&lt;ul&gt;"; // some code... }); } I am getting the error: TypeError: toprint[i] is undefined Which is weird, because according to other SO questions I've read I'm supposed to be able to access global variables inside AJAX callbacks.
type: Question
has answer: http://stackoverflow.com/a/24793682
possible better answer: http://stackoverflow.com/a/24793511

http://stackoverflow.com/comment/38529959
has text: @user3777766 Can you try to type just http://127.0.0.1:8020 in your browser and let me know if it prints any server name?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24819737
type: Comment

http://stackoverflow.com/comment/38655548
has text: @T.J.Crowder I have img in a and ing has src
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24885910

http://stackoverflow.com/a/24809347
score: 6
upvote count: 6
has comment: http://stackoverflow.com/comment/38510492
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24809189
type: Answer
accepted answer of: http://stackoverflow.com/q/24809189
has body: You'll notice that this inside of your success callback refers to window (the global object). Your success callback is being called with window as the context because functions that are not members of other functions are invoked with the window object as the context for the function. If you want this to refer to your controller instance you must bind that context to the function. You can use angular.bind to accomplish this. .controller('testController') { $http.get(data).success(angular.bind(this, function(data) { this.Stuff = data; })); }

http://stackoverflow.com/a/24771859
has comment: http://stackoverflow.com/comment/38439621
type: AcceptedAnswer
downvote count: 0
has body: User innerHTML to output: http://jsfiddle.net/z4hjv/ Name: Comment: Click me function myFunction() { var commentName = document.getElementById("name_input").value; var commentValue = document.getElementById("comment_input").value; document.getElementById("comment_result").innerHTML = commentName + commentValue; }
type: Answer
accepted answer of: http://stackoverflow.com/q/24771772
upvote count: 1
answers question: http://stackoverflow.com/q/24771772
score: 1

rendr
tags question: http://stackoverflow.com/q/24770098
type: Tag
tag name: rendr

http://stackoverflow.com/q/24835510
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
tagged with: ruby
upvote count: 1
tagged with: ruby-on-rails
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/24835546
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Ruby on Rails / Javascript - How to tell if content was generated dynamically?
has body: I have a Rails application that uses a CMS to render content in the view pages. I'd like to be able to know if a certain HTML tag has content that was generated by the CMS. For example, in my index.html.haml, I could have: %p= @instance_variable.content If I hover over the &lt;p&gt; tag in the front-end pages, I'd like to have a popup of some sort telling me it has content generated by a CMS. Can this be done automatically? I don't want to have to go through every view template and have to manually populate each tag with a data-cms="true". Is this possible? How do I go about doing this? Where do I begin?
accepted answer: http://stackoverflow.com/a/24835546

http://stackoverflow.com/q/24888285
linked to: http://stackoverflow.com/q/18375506
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
score: 0
has title: JSON Schema + JSON Editor: Table with togglable columns
answer count: 1
has answer: http://stackoverflow.com/a/24989884
type: UnansweredQuestion
has body: I'm using JSON Schema (http://json-schema.org/) and jdorn's JSON Editor (https://github.com/jdorn/json-editor) for a project, and I can't quite figure out if a particular functionality is supported or not. Basically, I'm trying to get a tabular input, which is working well based on an array with format: "table" . However, I'm also trying to make some of those columns to be toggled (displayed or not) based on another input. So for example, either a series of boolean properties or a unique enum array would results in something like "Show column B? Yes/No, Show column C? Yes/No?, etc...", and as the user toggled those inputs, the columns in the table would change. JSON Editor documentation details how to make the value of one field depend on another, but not the availability of that field. It makes a passing reference to JSON Schema's dependencies property, which looks promising, but I find JSON Schema's documentation to be even more difficult to use. So, does anyone know if this is supported functionality, either through pure JSON Schema, or through a JSON Editor extension?
tagged with: jsonschema
type: Question

http://stackoverflow.com/q/24888741
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/24888900
has answer: http://stackoverflow.com/a/24888870
has title: Very weird issue with characters and undefined
has body: OK, check this one : Visit this page here: http://efluo.net/ Open the JavaScript console TEST 1: Copy-paste this (and press enter) : window.DB["ar,i&gt;í"] It will show something like this : Object {rootChange: "í", subjuntivo: Array[4], rootFind: "i", gerundio: "$ando", indicativo: Array[5]…} TEST 2: Now, copy-paste this one (It looks the exact same thing, well wait!) : window.DB["ar,i&gt;í"] And the response is : undefined OK, so could you please explain to me what's going on and how it is to be resolved (convert the second one, to the first one)?
has comment: http://stackoverflow.com/comment/38660644
has comment: http://stackoverflow.com/comment/38660819
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38660813
has comment: http://stackoverflow.com/comment/38660940
downvote count: 3
type: Question
has comment: http://stackoverflow.com/comment/38660740
has comment: http://stackoverflow.com/comment/38660712
possible better answer: http://stackoverflow.com/a/24888870
tagged with: javascript
tagged with: jquery
score: -1
has answer: http://stackoverflow.com/a/24888926
accepted answer: http://stackoverflow.com/a/24888900
upvote count: 2
answer count: 3

http://stackoverflow.com/q/24769645
answer count: 1
linked to: http://stackoverflow.com/q/18329011
downvote count: 0
accepted answer: http://stackoverflow.com/a/25467447
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/18309471
has comment: http://stackoverflow.com/comment/38435634
linked to: http://stackoverflow.com/q/18794407
tagged with: http://stackoverflow.com/tag/html
has body: I would like to know if there is a method to programmatically take screenshots of a flash object (e.g. TwitchTV video player) and store it temporarily on the server side. I have done some research on the topic but it seems that it is impossible to do so due to the limitations of Javascript. Is there a workaround for this? Thanks
type: AnsweredQuestion
upvote count: 3
has answer: http://stackoverflow.com/a/25467447
type: Question
score: 3
tagged with: flash
tagged with: javascript
has title: Taking a screenshot of an Adobe flash player on a web page

remote-debugging
tag name: remote-debugging
tags question: http://stackoverflow.com/q/24885532
type: Tag

http://stackoverflow.com/comment/38436654
has text: Thanks @Dested, I know that way but in this case I have two variables for representing separated attributes in order to give access to users for example: user.readWrite and user.readOnly and a single variable is not so useful for me. Have you any other idea? Thanks a lot
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24770087
type: Comment

http://stackoverflow.com/a/24843551
answers question: http://stackoverflow.com/q/24843104
has body: I'm sorry, but as it always happens to me, I thought pretty simple fix to problem. As @lan mentioned, getJSON is asynchronus, I thought, that then I should do all fucntions, while I have response, not after I get it. Here's my modified script. Commentaries included. $(document).ready(function() { $(function() { $('.btn#population').bind('click', function() { $( ".faction" ).each(function(x) { //Here will answers be shown. var answers = $(this).find('input[name="total"]'); $.getJSON('/_population', { faction: $(this).attr('id'), houses: $(this).find('input[name="houses"]').val(), level: $(this).find(':radio:checked').val(), space: $(this).find('.space').prop( "checked" ), senate: $(this).find('.senate').prop( "checked" ) }, function(data) { //Gathered data is stored directly in response function. var totals = []; //I guess ,can be done by merge too, but for now, I'll leave it like that. $.each(data, function(i, item){ item.forEach(function(number){ totals.push(number); }); }); //Here previously gathered answer input fields are used for purpose. answers.each(function(y,val) { $(this).val(totals[y]); }); }); }); return false; }); }); });
score: 0
type: Answer

http://stackoverflow.com/comment/38648791
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24882402
has text: yes, all of that is possible, you just need to use iFrames and jQuery

http://stackoverflow.com/comment/38574170
type: QuestionComment
has text: @shiplu.mokadd.im I guess that depends on whether this code runs at all. Since the code doesn't seem to be final, I agree.
comment on: http://stackoverflow.com/q/24843241
score: 0
type: Comment

http://stackoverflow.com/a/24872264
has body: The problem is you use the "controller as" feature, new in Angular 1.2. However this is not supported in NetBeans right now. If you want to get the code completion, your ng-controller directives should look like ng-controller="StoreController" and all the properties that should be exposed to the page would have to be defined via $scope app.controller("StoreController", ["$scope", function($scope) { $scope.products = gems; }]); Note that this is (afaik) not an obsolete or even hacky way, it is 100% valid and correct code. With Angular 1.2, it is up to you if you want to use $scope or this Update: Support for controller as is now part of NetBeans daily builds (download here) and will be in upcoming NetBeans 8.1
upvote count: 4
answers question: http://stackoverflow.com/q/24872040
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/24872040
score: 4

http://stackoverflow.com/a/24845730
has body: A slick solution is to change UIWebViews as loads occur. Setup properties for your webView and a new "offscreen" web view where the loads will occur... @property(nonatomic, weak) IBOutlet UIWebView *webView; // assume you have this @property(nonatomic, strong) UIWebView *offscreenWebView; Initialize the offscreen web view to have the same frame and delegate as the initial web view... self.offscreenWebView = [[UIWebView alloc] initWithFrame:self.webView.frame]; self.offscreenWebView.delegate = self; Implement the delegate. When the delegate asks to start a load, answer NO and instead start the load in the offscreen web view... - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { // It's advisable to present some "busy" UI here, like an activity indicator [self.offscreenWebView loadRequest:request]; return NO; } When the load is finished, swap the onscreen and offscreen web views... - (void)webViewDidFinishLoad:(UIWebView *)webView { // remove the busy UI here if (webView == self.offscreenWebView) { // swap them on the parent [self.view addSubview:self.offscreenWebView]; [self.webView removeFromSuperview]; // swap our pointers to them UIWebView *temp = self.offscreenWebView; self.offscreenWebView = self.webView; self.webView = temp; } }
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/24839384
answers question: http://stackoverflow.com/q/24839384
score: 0

http://stackoverflow.com/q/24752275
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
upvote count: 1
downvote count: 1
has title: "Uncaught TypeError: undefined is not a function " jQuery each function issue
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24752294
has answer: http://stackoverflow.com/a/24752382
has body: This is a pretty basic question. I have this block of code which I thought was OK but its throwing up an error... Uncaught TypeError: undefined is not a function Here is the code in question $('.colourbox').each(function(i){ // select visible children var visibleDivs = $(this).children('div').length; // use whatever width calculation you'd like... var targetWidth = 300 / visibleDivs.length - 1; // apply the width to the divs visibleDivs.width(targetWidth); }); Thanks

http://stackoverflow.com/comment/38486474
comment on: http://stackoverflow.com/q/24796461
score: 0
type: Comment
type: QuestionComment
has text: First off, why are you calling another script on the response? Why not do it all in `upload.php` in order to reduce 1 request? Another one, i don't see where the `fileName` variable comes from, are you having any error? What's the output from console?

http://stackoverflow.com/comment/38632764
type: Comment
comment on: http://stackoverflow.com/q/24871598
score: 0
type: QuestionComment
has text: @vaidik no, there isn't any errors at console or network tabs.

http://stackoverflow.com/a/63757364
answers question: http://stackoverflow.com/q/24818970
downvote count: 0
type: Answer
has body: According to w3.org about input type=email – e-mail address input control: Value: Any string that matches the following [ABNF] production: 1*( atext / &quot;.&quot; ) &quot;@&quot; ldh-str 1*( &quot;.&quot; ldh-str ) …where atext is as defined in [RFC 5322], and ldh-str is as defined in [RFC 1034]. That is, any string which matches the following regular expression: /^[a-zA-Z0-9.!#$%&amp;’+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)$/ Source: https://www.w3.org/TR/2012/WD-html-markup-20120329/input.email.html As you can see from the regular expression above, the value entered must not contain non-ascii characters. This is problematic because email addresses do sometimes contain non-ascii. All Chrome has done is (stupidly) punycode encode the domain part of the email address so that it can meet the requirements of the w3c. What they should have done is left it alone since it goes without saying that form validation should either accept the user's input or reject it, but never change it.
score: 2
upvote count: 2

http://stackoverflow.com/comment/38529732
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24814111
has text: Note that the min-width CSS in question is being removed in Bootstrap v3.2.1.
score: 0

http://stackoverflow.com/q/24864080
tagged with: javascript
tagged with: kwicks
has answer: http://stackoverflow.com/a/24864182
score: 0
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/38614031
has body: how to make Kwicks height to 100%? I would have full screen slider. demo: http://devsmash.com/projects/kwicks/2.2.x/examples/responsive
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Full screen height in Kwicks
type: Question

http://stackoverflow.com/q/24904447
score: 1
has title: Event Delegation in Polymer
upvote count: 1
has body: Is there any way to add event delegation from outer body elements into shadow elements? For instance, I want a special function to fire whenever someone clicks an anchor with class="special". Normally (in jquery): $('body').on('click', 'a.special', myFunction); However, this doesn't seem possible using the shadow DOM, at least with everything I've tried. Do I really need to add these handlers to every instance of a.special as they appear in some template?
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/24915843
tagged with: event-delegation
downvote count: 0
type: UnansweredQuestion
type: Question
tagged with: polymer

http://stackoverflow.com/q/24879624
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38643986
has answer: http://stackoverflow.com/a/24879950
score: 0
has body: I come from java background,and quite new to javascript while using Extjs4.2 . What troubled me a lot is ,undefined function or variable error,like the example following. Say I use listeners in tree store to listen tree node expand event like below : //define a model Ext.define('Person', { extend: 'Ext.data.Model', fields: [ { name: 'id', type: 'int' }, { name: 'name', type: 'string' } ] }); //create a tree store var store = Ext.create('Ext.data.TreeStore', { model: 'Person', root: { name: 'People', id : -1, expanded: false }, proxy: { type: 'ajax', api: { create: 'createPersons', read: 'readPersons', update: 'updatePersons', destroy: 'destroyPersons' }, reader : { type : "json", root : "children" } }, listeners : { 'beforeexpand' : function(node,eOpts){ console.log("requesting child of node "+node.get("id")); }, 'expand' : function(node, eOpts ) { console.dir(this); //why getById undefined console.info(this.getNodeById("1").get("name")); } } }); My problem is : Since console.dir(this) print (in expand callback function) show : $className "Ext.data.TreeStore" alias ["store.tree"] getNodeById function(a) $extIsFunction true $isFunction 1 $name "getNodeById" $owner A() __proto__ function() $extIsFunction true $isFunction 1 we know ,here 'this' refer to Ext.data.TreeStore . And I looked up the API doc ,also found the getNodeById method,its declaration is : getNodeById( id ) : Ext.data.NodeInterface Returns the record node by id Parameters id : Object Returns Ext.data.NodeInterface But why I still get the error ? : TypeError: this.getNodeById(...) is undefined --&gt;console.info(this.getNodeById("1").get("name"));
answer count: 1
has comment: http://stackoverflow.com/comment/38643977
has title: Why function is undefined even it listed in the object by using console.dir?
type: UnansweredQuestion
tagged with: extjs4.2
has comment: http://stackoverflow.com/comment/38644634

http://stackoverflow.com/comment/38649979
comment on: http://stackoverflow.com/q/24882728
has text: @DarkBee thanks, this is what I was afraid of. JS it is then.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38515125
comment on: http://stackoverflow.com/q/24811219
type: Comment
type: QuestionComment
has text: @user3715740 Since this is an interesting question, you could consider changing the title to something more self-describing
score: 0

http://stackoverflow.com/a/24763353
has body: $(window).scroll(function(){ if ($(window).scrollTop() == $(document).height() - $(window).height()){ //do something } });
type: Answer
score: 0
answers question: http://stackoverflow.com/q/24763248

http://stackoverflow.com/q/24800042
type: Question
has body: I'm building a one page website with slides that load in the different content. These are controlled by the navigation which has some switchclass jquery added to the links so each link you click switches the class of the body and therefore a different slide loads. The problem I have is that from the blog when you open a post in full there is no way of displaying that post within the same page as the rest of the site. The CMS I'm using (Business Catalyst) opens the post in a new page which I have styled up to look like the rest of the site. So my problem is that now the nav links on that page need to work their switchclass jquery magic on the target page when going back to the index page.... This is the jquery that is currently running the links.. $(document).ready(function(){ $(".home a").click(function(){ $("body").switchClass("default about training charities coaching blog contact", "home", 500, "swing"); }); }); any help greatly appreciated.
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Need to apply jquery switch class to a target page
favorite count: 0
type: UnansweredQuestion
answer count: 0
score: 1
upvote count: 1

http://stackoverflow.com/q/24853010
favorite count: 0
has body: I am attempting to use Grunt to pre-compile my .hbs templates for my Ember app. Grunt item being used: https://www.npmjs.org/package/grunt-ember-templates I have gotten Grunt to work just fine, and the single templates.js file is being compiled: Ember.TEMPLATES["dashboard/dashboard"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) { this.compilerInfo = [4,'&gt;= 1.0.0']; helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {}; data.buffer.push("&lt;script type=\"text/x-handlebars\" data-template-name=\"dashboard\"&gt; Dashboard &lt;/script&gt;"); }); And here is the routes file: App.Router.map(function() { this.route('dashboard', { path: '/dashboard' }); }); And here is the index.php file: &lt;body&gt; &lt;script type="text/x-handlebars"&gt; {{outlet}} &lt;/script&gt; &lt;/body&gt; However, when I got to the path of localhost/app/#/dashboard, the "Dashboard" text does not get displayed. Am I missing something obvious? I tried googling for the resolution, but couldn't find anything. I did try placing "dashboard/dashboard" as the template name in this.route(templatenamehere), ... but that produced the following error: "Cannot read property 'ember_meta' of undefined TypeError: Cannot read property 'ember_meta' of undefined" Thanks in advance
has comment: http://stackoverflow.com/comment/38593082
type: UnansweredQuestion
tagged with: handlebars.js
tagged with: ember.js
answer count: 0
downvote count: 0
score: 1
type: Question
tagged with: javascript
tagged with: gruntjs
upvote count: 1
has title: Emberjs grunt template compiler

http://stackoverflow.com/comment/38562843
type: Comment
has text: Hi Sir Thanks a lot , i working but how can we use it for multiple words ??
comment on: http://stackoverflow.com/a/24817138
score: 0
type: AnswerComment

http://stackoverflow.com/q/24765478
score: 0
linked to: http://stackoverflow.com/q/24767059
has comment: http://stackoverflow.com/comment/38427600
type: Question
tagged with: hyperlink
tagged with: javascript
has body: So far, I've created a function that has a counter that accumulates whenever "Link" is clicked on and resets whenever you click outside of "Link". When the counter==2, you are redirected to the link's page and the counter resets. It's probably a silly mistake or something because I'm new to jQuery but for some reason my counter never resets, so when you click on the link, then outside of it, then back on it, you are redirected, which shouldn't happen. Here's my Bootply. HTML: Link 1 2 jQuery: $(document).on("click", "span", function() { if(typeof $(this).data('clicks') == 'undefined') { $(this).data('clicks', 1); } else { $(this).data('clicks', $(this).data('clicks')+1); } if ($(this).data('clicks')==2){ $(this).data('clicks', 0); $(this).window.open("page.html"); } }); $(document).click(function(event) { if(!$(event.target).closest("span").length) { $(this).data('clicks', 0); } }); Suggestions? EDIT: Using the suggestions, below, it works almost perfectly. It seems that clicking slightly below "Link," enabling the menu to drop, then clicking on "Link" results in moments where that second click doesn't register, thus you aren't redirected. Is there a way to fix this minor bug? It must have something to do with the target of the event. EDIT #2: I managed to get it to work by adding (poor markup, ik): if (counter==1 && $('.dropdown-menu').is(":visible")) { window.open("accomplishments.html"); resetCounter(); } right above if (shouldOpen()) { window.open("accomplishments.html"); resetCounter(); }
answer count: 2
has answer: http://stackoverflow.com/a/24765661
has title: Issues with jQuery function
tagged with: jquery
has comment: http://stackoverflow.com/comment/38427725
has comment: http://stackoverflow.com/comment/38427646
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/24765611
accepted answer: http://stackoverflow.com/a/24765661
has answer: http://stackoverflow.com/a/24765611
type: AnsweredQuestion
tagged with: twitter-bootstrap-3

http://stackoverflow.com/a/24815918
type: Answer
has body: Even though you have posted what looks like the whole page, it's impossible to test as we don't know where is e.g. dojoConfig specified. I believe it's in gw-app-config.js file, but what else is in there? In regards of your problem, the first thing I've noticed is that your meta tags are not on top of hierarchy, they should be right after the head tag. That would be the first advice to test. Please see this link and the second answer, that might not be the same problem as yours, but similar X-UA-Compatible is set to IE=edge, but it still doesn&#39;t stop Compatibility Mode
has comment: http://stackoverflow.com/comment/38848303
has comment: http://stackoverflow.com/comment/38673559
answers question: http://stackoverflow.com/q/24794930
score: 0

http://stackoverflow.com/comment/38558190
type: QuestionComment
score: 0
has text: thank you that was the problem
comment on: http://stackoverflow.com/q/24834647
type: Comment

http://stackoverflow.com/comment/38765666
comment on: http://stackoverflow.com/a/24880940
score: 0
type: AnswerComment
has text: you're welcome, glad it helped, and thank you for asking such an interesting question! ;)
type: Comment

http://stackoverflow.com/a/24756750
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/24755779
score: 1
has body: Unfortunately, JavaScript's regex engine is severely limited. You can't do that in a single regex. The best solution probably would be to do txt = subject.match(/[A-Z]/ig); // or /[A-Z]+/ig, if CC should be a single match and discard the first match.
accepted answer of: http://stackoverflow.com/q/24755779

http://stackoverflow.com/comment/38628553
type: Comment
has text: Yeh, it needs you to be logged into Facebook as a user. If you go into Facebook and log in first and then click on the link, it should work. Once it redirects, then you will see the problem. This first set of code you are seeing is not really relevant.
comment on: http://stackoverflow.com/a/24870680
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38495770
has text: svg is simply vector graphics format. granted you can actually generate the image that way, but it doesn't solve the problem of parsing text out of images.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24796550
type: Comment

http://stackoverflow.com/comment/38460765
comment on: http://stackoverflow.com/q/24782106
has text: @DGibbs I've attempted to recity what you have suggested. i've removed the 1.11 library, and moved jPages to the bottom. I'me not to sure about the scripts above the 1.11 reference, they are from another dev, and pulled in when the aspx default page is constructed. With regards to the developer console in chrome i notice no red 'x' or errors. although in the network tab a 404 not found is fired for `jquery.min.map ajax.aspnetcdn.com/ajax/jQuery`
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38452601
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24778941
has text: You should just select the appropriate option on the CKEditor download page... http://ckeditor.com/download

http://stackoverflow.com/q/24885900
possible better answer: http://stackoverflow.com/a/24886156
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/24886167
tagged with: fadein
tagged with: fadeout
has body: $(window).load(function() { $(".screenLoading").fadeOut('slow'); }) setInterval("loadCont()", 500); //Loaded function loadCont(){ $('.container').fadeIn('slow'); return; } function loadLogin() { $('.container').fadeOut('slow', function() { $('.log').fadeIn('slow'); }); } I have the javscript code above and am trying to mimic the effect at http://orinukas.com/SoduBendrija/ . When I click on the right upper link named 'Nariams', the content with headings and paragraph should fade out and the Sign Up form should fade in. When I click on that link, content fades, sign up form fades in and content fades in too. I don't want content to fade in.
has answer: http://stackoverflow.com/a/24886156
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24886167
type: Question
has title: Javascript Fade
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/38440264
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24771681
score: 0
has text: well you can make it shut up by focus()ing something else just before you call confirm(), but then how do they get back? Un-intuitively, UL/LIs are pretty good for long stretches of content (there's a list mode in most AT), and a little CSS can make them look like P tags (list-style:none;display:block;etc). even simple anchored headers in each P and a sub-page navigation section allow the user to resume to a mid-point of a long passage, somewhat like DVD chapters allow after an accidental eject...

http://stackoverflow.com/a/24802544
upvote count: 1
has body: Just make a new sub selection on the initial update selection and edit its attributes. nodes.select('text').text(function (d) { return d.text }); nodes.select('circle').style('fill', function (d) { return d.color; }); jsfiddle.net/2kqLC/3
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/24802227
answers question: http://stackoverflow.com/q/24802227
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38497507

http://stackoverflow.com/a/24776549
answers question: http://stackoverflow.com/q/24776492
type: Answer
has body: You can achieve using JSON. Once you pass the jSON data to javascript, you can access it easily. &lt;script type="text/javascript"&gt; var initialize = function() { &lt;?php //generate json object $jsonObj = ... echo "var javascript_json_object=".jsonObj; ?&gt; //use javascript to access the javascript_json_object variable window.onload = initialize; &lt;/script&gt;
has comment: http://stackoverflow.com/comment/38466620
has comment: http://stackoverflow.com/comment/38451971
score: 0

http://stackoverflow.com/q/24908693
favorite count: 0
upvote count: 2
type: UnansweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/38698095
has comment: http://stackoverflow.com/comment/38698298
type: Question
has answer: http://stackoverflow.com/a/26483925
has answer: http://stackoverflow.com/a/24909061
has body: I have made a JavaScript function which is attached to the cancel button on of a form. The issue I am finding is that when the cancel button is pressed the page/form reloads losing the data in the text fields. function cancelConfirm(){ var confirmCancel = confirm("Are you sure you wish to cancel?"); if(confirmCancel==true) { alert("byebye"); } else { return false; } }; I was just wondering how can you prevent the page from reloading after the cancel button on the confirm has been clicked? Thanks for any help you can give
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/64850565
answer count: 3
has title: Javascript confirm Stop page refresh after cancel

http://stackoverflow.com/a/24810862
score: 1
has comment: http://stackoverflow.com/comment/38637235
has comment: http://stackoverflow.com/comment/38543312
has comment: http://stackoverflow.com/comment/38581868
has body: I wrote that article. Really glad you guys are finding it useful. It seems there a bunch of people complaining about bookmarklets not working properly in IE11. One thing I'd test is how IE11 handles same origin policy. Check out this link, and see if you can temporarily disable same origin policy. Then test. Obviously it won't solve the problem, but it could lead you in the right direction. Hope that helps a bit. Let me know.
upvote count: 1
answers question: http://stackoverflow.com/q/24788349
has comment: http://stackoverflow.com/comment/38637239
type: Answer
downvote count: 0

http://stackoverflow.com/q/24902540
has body: Im following this book on directives and decided to try their code on read-only scopes. However, im getting weird results. What should happen is: At the beginning the #appTitle should read "Hello World" and the #newDirTitle should read "Directive of Hello World" (it doesnt) After user clicks on #newAppTitle, #appTitle would change to App 2.0 and #newDirTitle should read "Directive of App 2.0" (it doesnt) When #newDirTitle is clicked, only the directive's title must change (it doesnt) I've also noticed that fiddling angular version down to 1.1.1 solves the issue. While I do accept that some minor version changes might affect the overall behavior, i dont understand why, for instance, case 3 stopped working or why in case 1 the title still reads the original app title ("Hello World") value instead of scoped title read-only value ("Directive of Hello World"). Could anyone please explain? Below is the code: HTML {{ title }} Upgrade Me! {{ title }} Bob it! JS var demoApp = angular.module('demoApp', []); demoApp.controller("AppController", function($scope) { $scope.setAppTitle = function(t) { $scope.title = t; }; }); demoApp.directive("myScopedDirective", function() { return { scope: { title: '@msdTitle' }, link: function(scope, element, attrs) { scope.setDirectiveTitle = function(t) { scope.title = t; }; } }; }); JSFIDDLE Click here to view
tagged with: angularjs
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/24902844
has title: Angular read-only scope acts weird
type: Question
tagged with: angularjs-directive
answer count: 2
accepted answer: http://stackoverflow.com/a/24902844
possible better answer: http://stackoverflow.com/a/24903263
has answer: http://stackoverflow.com/a/24903263
tagged with: javascript

http://stackoverflow.com/comment/38500275
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24804186
score: 1
has text: You tagged the question with jquery however the code you provided has no jquery. Are you looking for a solution with only pure js or can jquery be there too? Although it doesn't look like jquery is needed at all

http://stackoverflow.com/a/24857693
answers question: http://stackoverflow.com/q/24857544
upvote count: 1
has comment: http://stackoverflow.com/comment/38602173
has body: There were a couple problems with your #3 option: First obj = obj[0]; was just going to have obj === "obj" which isn't going to help you at all. You need to actually get window["obj"] to get the top level object. Second, you were traversing the for loop one too many times and going off the end of the path array. Making changes in both these areas will make it work if obj is at the top level scope: var obj = { foo: { bar: 'baz' } }; var deep_value = function(path, baseObj){ baseObj = baseObj || window; var obj = path.split('.'); obj = baseObj[obj[0]]; for (var i=1, path=path.split('.'), len=path.length; i&lt;len; i++){ obj = obj[path[i]]; }; return obj; }; alert(deep_value('obj.foo.bar')); Working demo: http://jsfiddle.net/jfriend00/jGb5p/ Here's a bit of a cleaned-up version: var obj = { foo: { bar: 'baz' } }; var deep_value = function(path, baseObj){ baseObj = baseObj || window; var pieces = path.split('.'); // get root level object var obj = baseObj[pieces[0]]; for (var i = 1, len = pieces.length; i &lt; len; i++){ obj = obj[pieces[i]]; } return obj; }; console.log(deep_value('obj.foo.bar')); Working demo: http://jsfiddle.net/jfriend00/7J4Jb/
has comment: http://stackoverflow.com/comment/38602148
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24857544
has comment: http://stackoverflow.com/comment/38602407
type: Answer
has comment: http://stackoverflow.com/comment/38602104
has comment: http://stackoverflow.com/comment/38602132
score: 1

http://stackoverflow.com/comment/38678254
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24894451
has text: How does it matter if it was created with new?

http://stackoverflow.com/comment/38548430
score: 1
type: AnswerComment
has text: @user3163380 Ideally most of your code will be separate from your HTML. This is best achieved through the use of a template engine and a development pattern such as MVC. In the mean time, your code where you access `$_POST` should be placed on whatever script receives POST data. That is, if your form action is `post-to-me.php`, then `post-to-me.php` should have the code where you assign `$_POST` to `$_SESSION['lastFormData']`. The code where you echo out values into HTML should exist wherever you need to output your input elements.
type: Comment
comment on: http://stackoverflow.com/a/24829170

http://stackoverflow.com/q/24869627
has body: I'm using expressjs with node to create my web app but it's not working as supposed to. Something really strange happens here, if I go to the first link in the browser, it works as supposed to but if I go to the second link it doesn't get executes the callback and returns null. And as you might see they're identical! First API code Snippet (First Link): /** * GET /workspace/friends/list * JSON friend list API */ app.get('/workspace/friends/list', passportConf.isAuthenticated, function (req, res) { var userFriends = []; //console.log(req); for (var i = 0; i &lt; req.user.friends.length; i++) { if (req.user.friends[i].verified) { userFriends.push(req.user.friends[i]); } } res.json(userFriends); }); Second API code Snippet (Second Link): /** * GET /workspace/friends/sentRequests/ * JSON friends requests list API */ //TODO: Fix API app.get('/workspace/friends/sentRequests', passportConf.isAuthenticated, function (req, res) { var userFriends = []; //console.log(req); for (var i = 0; i &lt; req.user.friends.length; i++) { if (!req.user.friends[i].verified) { userFriends.push(req.user.friends[i]); } } res.json(userFriends); }); Note: I must also add that if I uncomment the console.logs in both I get a log from the first but not the second one. How is this even possible? Has anyone encountered something similar before? And how could I fix it?
has comment: http://stackoverflow.com/comment/38625112
tagged with: javascript
tagged with: express
tagged with: get
score: 0
has answer: http://stackoverflow.com/a/24871864
answer count: 1
has comment: http://stackoverflow.com/comment/38625015
tagged with: rest
tagged with: node.js
accepted answer: http://stackoverflow.com/a/24871864
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38624769
type: Question
has title: Strange occurrence in ExpressJS: Callback function isn't called

http://stackoverflow.com/q/24818110
tagged with: knockout.js
type: Question
has comment: http://stackoverflow.com/comment/38539126
has answer: http://stackoverflow.com/a/45884032
tagged with: umbraco
tagged with: javascript
upvote count: 13
tagged with: jquery
has body: I just got thrown into the Umbraco ASP.NET CMS for my latest project, I'm not sure if this is how it across the board but for my setup Knockout.js is doing all the templating. I'm not too keen on knockout.js but so far it's been pretty straight forward except for when I start adding in some jQuery stuff, the problem I'm having is jQuery is firing before knockout has finished populating the page with all the elements. The only solution that's worked for me thus far is all my jQuery stuff is wrapped in the setTimeout() function, which obviously is no good. What's the most efficient way to make jQuery and Knockout work together so jQuery doesn't before knockout is done?
answer count: 3
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38527735
score: 13
has title: jQuery document ready with Knockout.js
downvote count: 0
has answer: http://stackoverflow.com/a/24818182
has answer: http://stackoverflow.com/a/24872066

http://stackoverflow.com/comment/38493748
comment on: http://stackoverflow.com/q/24799526
type: QuestionComment
type: Comment
has text: Sadly guys entering the ID manually is a requirement, otherwise I am aware of auto-numbering plugins.
score: 0

http://stackoverflow.com/comment/38479622
type: Comment
comment on: http://stackoverflow.com/a/24790069
has text: This is perfect, I didn't know about existence of data-input, many thanks ! +1
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38508736
has text: Just to let you know I managed to solve this (see [my answer](http://stackoverflow.com/a/24808480/718728)). +1 For pointing out the stuff about the directive specific linkages. I would of struggled without knowing that beforehand.
comment on: http://stackoverflow.com/a/24787623
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38480299
has text: Just float two divs on top of each other and fade one on hover.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24793139
score: 2

http://stackoverflow.com/a/24837917
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: There are many situations where you get JSON text that was automatically built by some library. Throughout the programming languages, there are many libraries that build JSON text (one example is here). Whenever libraries add some additional object or array wrappings, you might want to get rid of them maybe because you send the JSON to the server and your code there crashes because it expects a primitive value instead of an object (or an array). Or, if your JSON is a server response, you don't want the resulting Javascript code having to differ between object/array or not object/array. In all these cases, flattening is helpful as it will save you time. You will have to implement less if/elses, and you can reliably expect your data structure to be as flat as possible. The other approach to improve code for the scenario mentioned is to write the code in a maximally robust way so there is no way for it to crash by superfluous wrappings ever. So always expect some wrappers and get its contents. Then, flattening is not needed. You see, it depends on what is building the JSON and what is parsing it. The building may be out of your scope. This leads also to data model questions. I've worked with XML code that needed to be parsed quite a different way if there were 0 entries of X, or if there were &gt;0 entries of some X. Having a wrapper that is allowed to have 0 or more entries of X will make live easier. These are data model decisions. In all cases where the JSON represents an object structure that I've combined manually, I expect it not to change. So flattening something I've designed in detail would be disturbing. Standard operations as far I've seen them do not need flattening (e.g. JSON.stringify(), json_encode() etc.)
score: 9
accepted answer of: http://stackoverflow.com/q/24833379
upvote count: 9
answers question: http://stackoverflow.com/q/24833379

http://stackoverflow.com/a/24900746
has comment: http://stackoverflow.com/comment/38683524
accepted answer of: http://stackoverflow.com/q/24900481
type: Answer
answers question: http://stackoverflow.com/q/24900481
type: AcceptedAnswer
score: 0
has body: The trick is to make your markup structure a little more meaningful, and your CSS styling a little more generalized. This allows you to leverage common indexes between the links and the tabs below, as well as to define the style using a single CSS class. Then you can easily scale the solution for any number of links and panels: jsFiddle HTML Print 1 Print 2 First Div Second Div CSS /* #content, #SideNav, #pieces Same As Before */ .panel { display: none; position:absolute; top: 0px; right: 0px; } JS $(function () { $("a[id^='link']").click(function (e) { e.preventDefault(); var index = this.id.replace("link", ""); $(".panel").hide(); $("#panel" + index).show(); }); });

http://stackoverflow.com/comment/38597415
score: 0
type: Comment
type: QuestionComment
has text: @zerkms ``fullName`` value is different.
comment on: http://stackoverflow.com/q/24855142

html-select
tags question: http://stackoverflow.com/q/24899765
tags question: http://stackoverflow.com/q/24815921
tags question: http://stackoverflow.com/q/24798208
tags question: http://stackoverflow.com/q/24809661
tags question: http://stackoverflow.com/q/24888130
tags question: http://stackoverflow.com/q/24786246
tag name: html-select
type: Tag
tags question: http://stackoverflow.com/q/24878669

http://stackoverflow.com/comment/38617081
has text: @machineaddict my 1st comment answered the question, this was just a followup. Regarding noscript redirect, as a user i would rather see a js required message than have a form that doesnt work for no apparent reason
comment on: http://stackoverflow.com/q/24865473
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38568436
comment on: http://stackoverflow.com/q/24840261
has text: What do you mean by "Margin or we can say a Specific distance changed from HTML select option tag in future dynamically"? the distance of slide from another element with respect to it's position in window, or something else?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24764023
answers question: http://stackoverflow.com/q/24763738
type: Answer
has body: You can use ngInit like this:
score: 0

http://stackoverflow.com/comment/38490394
type: QuestionComment
comment on: http://stackoverflow.com/q/24798531
score: 0
has text: Thank you for your reply but now I just get the returned value of 0 no matter what....
type: Comment

http://stackoverflow.com/comment/38505787
type: QuestionComment
comment on: http://stackoverflow.com/q/24806954
score: 0
has text: I'm not following, if you click the link. Your page refreshes thus being at the top of the page. Unless you're want to do something other than loading the "myApp/Select/1" page
type: Comment

http://stackoverflow.com/q/24798459
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/24798622
accepted answer: http://stackoverflow.com/a/24798622
has body: In Knockout JS example @ http://knockoutjs.com/examples/gridEditor.html In the view model we have code as below self.addGift = function() { self.gifts.push({ name: "", price: "" }); }; and var viewModel = new GiftModel([ { name: "Tall Hat", price: "39.95"}, { name: "Long Cloak", price: "120.00"} ]); The problem is the anonymous JSON object. Is there any way I can pass an instance of class and get this working? like using new Gift() self.addGift = function() { self.gifts.push(new Gift()); }; and var viewModel = new GiftModel([ new Gift(){ name: "Tall Hat", price: "39.95"}, new Gift(){ name: "Long Cloak", price: "120.00"} ]);
type: AnsweredQuestion
has title: How to use an instance of prototype object instead of JSON in knockoutjs
tagged with: http://stackoverflow.com/tag/json
tagged with: knockout.js
type: Question
tagged with: javascript

http://stackoverflow.com/comment/38666697
score: 0
type: Comment
type: QuestionComment
has text: how fix it in jquery.tmpl.js templating engine @DanielA.White
comment on: http://stackoverflow.com/q/24887651

http://stackoverflow.com/comment/38649605
comment on: http://stackoverflow.com/q/24882728
type: QuestionComment
has text: @Jim22150 I believe it is not working. At least without refreshing the page. When page is rendered, `php` job is done. What you see in your browser and what `php` does are in fact somehow isolated things. `AJAX` is the tool that you're looking for to join them.
type: Comment
score: 0

http://stackoverflow.com/a/24776344
type: Answer
has comment: http://stackoverflow.com/comment/52242824
has body: $(document).ready(function(){ $(".item_add").click(function(e){ e.preventDefault(); //jQuery (&lt; 1.7): //This will disable just the div $("#procurselect").attr('disabled','disabled'); //OR //This will disable everything contained in the div $("#procurselect").children().attr("disabled","disabled"); //jQuery (&gt;= 1.7): //This will disable just the div $("#procurselect").prop('disabled',true); //OR //This will disable everything contained in the div $("#procurselect").children().prop('disabled',true); }); });
answers question: http://stackoverflow.com/q/24776145
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/comment/38639374
has text: Add `console.log(source);` as the first line in your click handler to make sure you actually have the source element.
score: 0
comment on: http://stackoverflow.com/q/24877015
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38648671
has text: Why don't users get the difference between `blockquote` highlighting and `code` highlighting
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/24882346

http://stackoverflow.com/comment/38697966
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24908638
has text: Btw, for me its showing video in FF and Chrome (over Linux)
score: 0

http://stackoverflow.com/a/24787056
type: Answer
has comment: http://stackoverflow.com/comment/38546284
has comment: http://stackoverflow.com/comment/38468628
has comment: http://stackoverflow.com/comment/38472187
has comment: http://stackoverflow.com/comment/38469579
has body: You're not cancelling the submit and that's why it takes place no matter if there are errors or not. You need to cancel the default behavior for the submit button when there are errors } else { alert('Show errors'); return false; // &lt;-- This should do the trick };
has comment: http://stackoverflow.com/comment/38468734
score: 0
answers question: http://stackoverflow.com/q/24787007
has comment: http://stackoverflow.com/comment/38468836

http://stackoverflow.com/a/24853960
has body: You can use prop method of jQuery to set the value of height and width. And also you can use position method to set the position. And then you can add input or change event listener to track the required value ... $("#mywidth,#myheight ,#my-x ,#my-y").on("change input",function(){ var coordinateX = $("#my-x").val(); var coordinateY = $("#my-y").val(); var height = $("#myheight").val(); var width = $("#mywidth").val(); if(coordinateX !=0 &amp;&amp; coordinateY !=0 &amp;&amp; height!=0 &amp;&amp; width!=0){ $("#basicShapes").css({position:"absolute", left:coordinateX,top:coordinateY}); $("#v-27").prop("width", width); $("#v-27").prop("height", height); } }); And here is the Working Fiddle P.S I am not good at CSS , so you need to work the CSS part for making the input form relative to the rectangle. Good Luck.
score: 0
answers question: http://stackoverflow.com/q/24853488
type: Answer

http://stackoverflow.com/a/24893408
accepted answer of: http://stackoverflow.com/q/24893289
answers question: http://stackoverflow.com/q/24893289
has body: One way would be to count the number of successful onSuccess() calls, and hide your loading image when they are all complete: &lt;script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.1.min.js"&gt;&lt;/script&gt; &lt;script type = "text/javascript"&gt; function GetSQLTable() { //alert($("#&lt;%=fieldGroupReferences.ClientID%&gt;")[0].value) var str = $("#&lt;%=fieldGroupReferences.ClientID%&gt;")[0].value var res = str.split(","); var numSucceeded = 0; for (var i = 0; i &lt; res.length; i++) { $("#LoadingImage").show(); var div = document.createElement('div'); div.id = "div" + i document.body.appendChild(div); //alert(res[i]); $.ajax({ type: "POST", url: "Default3.aspx/GetSQLTable", data: '{username: "' + $("#&lt;%=fieldUserName.ClientID%&gt;")[0].value + '", terminalname: "' + $("#&lt;%=fieldTerminalName.ClientID%&gt;")[0].value + '", terminalip: "' + $("#&lt;%=fieldTerminalIP.ClientID%&gt;")[0].value + '", mappingid: "' + res[i] + '", usergroup: "' + $("#&lt;%=fieldUserGroup.ClientID%&gt;")[0].value + '"}', contentType: "application/json; charset=utf-8", dataType: "json", success: OnSuccess(i,res.length), failure: function (response) { //alert(response.d); alert('there was an error loading the webpage') } }); } function OnSuccess(i,totalrows) { return function (response) { if (response.d != "") { document.getElementById('div' + i).innerHTML = document.getElementById('div' + i).innerHTML + '&lt;br&gt;' + '&lt;br&gt;' + response.d; numSucceeded++; if (numSucceeded === totalrows) { $("#LoadingImage").hide(); } } } } } window.onload = GetSQLTable &lt;/script&gt;
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/38674467

http://stackoverflow.com/comment/38490794
has text: I don't see any transitions in your code. Where are you adding those?
comment on: http://stackoverflow.com/q/24797044
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38490755
has text: please send me a link to the version of jquery you used
comment on: http://stackoverflow.com/a/24757389
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/24846043
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24845979
type: Answer
upvote count: 1
score: 1
has body: Your problem stems from declaring jQuery.noConflict() By doing so you are no longer able to directly access jQuery using $ If you need noConflict you can fix your code by changing: jQuery.noConflict() $(function() { To jQuery.noConflict() jQuery(function($) {/* "$" argument allows using "$" inside the ready handler*/ Working demo of your code Learn how to use browser console to check for errors. You should be seeing errors for "$" is not defined or similar depending on browser
accepted answer of: http://stackoverflow.com/q/24845979

http://stackoverflow.com/comment/38681615
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/24899637
has text: It's quite a common issue with CSS animation. One minute, I'll write up an answer
type: Comment

http://stackoverflow.com/comment/38698998
has text: The above code i pasted is the modification of yours. I added `which` to only numbers
type: Comment
comment on: http://stackoverflow.com/a/24908651
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38492376
score: 0
type: AnswerComment
has text: this will open the closest ul next descriotions
type: Comment
comment on: http://stackoverflow.com/a/24799632

http://stackoverflow.com/a/24802659
type: Answer
answers question: http://stackoverflow.com/q/24802616
upvote count: 1
has body: You are replacing using a regular expression. In a regular expression, '+' has special meaning. However, you don't want that special meaning, you want the literal character. As such, you must escape the '+' str = str.replace(/\+/gi, ' ');
downvote count: 0
score: 1

http://stackoverflow.com/q/24818931
has comment: http://stackoverflow.com/comment/38528273
tagged with: javascript
tagged with: jquery
score: 0
has body: is there a possibility to use (for an offline website) a absolute path, going via c:\? at the moment i'm using $.get('sps_com/sendNP01.asp'... but i need to use $.get('c://temp_sps/sps_com/sendNP01.asp'
answer count: 1
type: AnsweredQuestion
has title: Use local full path with $.get
has comment: http://stackoverflow.com/comment/38528361
has comment: http://stackoverflow.com/comment/38528504
has answer: http://stackoverflow.com/a/24819086
accepted answer: http://stackoverflow.com/a/24819086
type: Question

http://stackoverflow.com/comment/38607340
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24860160
has text: I am working with a south african map so each provice has a specific ID but when I click on another province the data for the previus province still appear on the screen and I want to see only a clicked provice data only on the screen

http://stackoverflow.com/comment/38640702
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24877898
has text: How about storing them in an array?

http://stackoverflow.com/q/24830234
has comment: http://stackoverflow.com/comment/38550219
has body: I am relatively new to web dev. I have an HTML5 application with multiple pages, where each has animation (driven by a ticker). I managed to implement dynamic page loading via Ajax and php for the pages but there is a big problem. The scripts don't terminate when I dynamically load a different page (clicking on link to different page). Is there a way to completely wipe out everything that was loaded/initiated when dynamically switching pages? As if I simply switched to a new page altogether? Right now the php just loads the page and then I replace the existing HTML in the target div with the freshly loaded page. Thanks for any help.
score: 0
has comment: http://stackoverflow.com/comment/38550414
answer count: 0
tagged with: javascript
type: UnansweredQuestion
has title: Stop a dynamically loaded script when switching to a new page via Ajax
tagged with: execution
has comment: http://stackoverflow.com/comment/38549845
tagged with: ajax
type: Question

http://stackoverflow.com/comment/38512052
has text: Would you mind telling me how to do that? I tried using some custom filters a while back, and it didn't work because I wasn't able to use my ng-model value variable to check.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24809807
type: QuestionComment

http://stackoverflow.com/q/24838455
type: Question
has comment: http://stackoverflow.com/comment/38564863
possible better answer: http://stackoverflow.com/a/24838464
tagged with: arrays
tagged with: javascript
linked to: http://stackoverflow.com/q/17832583
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/24838562
duplicate of: http://stackoverflow.com/q/17832583
has title: Dynamically making javascript array of object value
tagged with: ajax
tagged with: php
has comment: http://stackoverflow.com/comment/38565048
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24838464
has answer: http://stackoverflow.com/a/24838562
has body: We can create a javascript array like bellow var array = { name:"jhon", desg:"manager" }; We can send the object directly as data with an $ajax request, and all value can be accessed using $_POST array. Ex : $_POST['name'] will return 'jhon'. Now I have a for loop where I want to make the array dynamic. Something like : for(var i=0; i&lt;8; i++){ array.push(a+id:"me"+id); } Now I will send array in $ajax request and in request handler I will be able to retrieve data in $_POST array. Ex : $_POST['a0'] will return 'me0'. I tried many way but failed, do you have any way to solve this.

http://stackoverflow.com/comment/38671689
type: QuestionComment
has text: I understand that, But is there a way to track down where that incorrect file path is coming from? I have used find in every file and can't seem to find anywhere that it is referenced.
comment on: http://stackoverflow.com/q/24894388
score: 0
type: Comment

http://stackoverflow.com/a/24776584
has comment: http://stackoverflow.com/comment/38449064
has body: Your problem comes from the fact that tmplData is an array, not an object, so when your template looks for {{backgroundColor}}, that is a backgroundColor of array, which doesn't exist. To solve this, either pick the first item in the array to pass to Mustache.render ie: Mustache.render(self._dashboardTemplate(), tmplData[0]) Or put a loop into your template to render each array item like: var template = '{{#.}}&lt;div id="layoutContainer" style="background-color:{{backgroundColor}}"&gt;&lt;/div&gt;{{/.}}'; See this question: Can mustache iterate a top-level array? for details about rendering a top level array.
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24776142
answers question: http://stackoverflow.com/q/24776142
type: Answer
has comment: http://stackoverflow.com/comment/38451317
downvote count: 0
score: 1

http://stackoverflow.com/comment/38647005
type: Comment
comment on: http://stackoverflow.com/a/24865567
score: 0
type: AnswerComment
has text: How to access other properties then.. I mean e.g. `start`, `end` and other possible properties inside Xtemplate ?, I am sorry, if its annoying but understanding this taking bit of time

http://stackoverflow.com/a/24843469
downvote count: 0
has comment: http://stackoverflow.com/comment/38574567
has comment: http://stackoverflow.com/comment/38574933
has comment: http://stackoverflow.com/comment/38574758
upvote count: 2
has comment: http://stackoverflow.com/comment/38575102
has comment: http://stackoverflow.com/comment/38575254
has comment: http://stackoverflow.com/comment/38575362
has body: Try to make anonymous function for success and other for error. Then create another function which will be called by async when data is available. function overrideLocalStore(lat, log) { alert("lat"+lat+" long"+long); localStorage.setItem("deviceLatitude", lat); localStorage.setItem("deviceLongitude", log); } intel.xdk.geolocation.getCurrentPosition( function(p) { alert("geolocation success"); if (p.coords.latitude != undefined) overrideLocalStore(p.coords.latitude, p.coords.longitude); }, function() { alert("geolocation failed"); getLocation(); } ); // Use whatever you need alert(localStorage.getItem("deviceLatitude")); alert(localStorage.getItem("deviceLongitude"));
type: Answer
answers question: http://stackoverflow.com/q/24843009
score: 2

http://stackoverflow.com/a/41579593
type: Answer
score: 7
upvote count: 7
answers question: http://stackoverflow.com/q/24812120
downvote count: 0
has body: I know this is an old question but, I had the same problem (except using webdriver.io) and the solution was that the [Object object] is actually a Promise object (rather than the String I was expecting -- I was looking at the wrong version of the API). ...getText().then((text)=&gt;{ console.log(text);}); should work.

http://stackoverflow.com/comment/38663748
comment on: http://stackoverflow.com/q/24888214
score: 0
type: Comment
type: QuestionComment
has text: This is the only loc that is added for this: app.use(passport.authenticate('facebook-token'));

http://stackoverflow.com/a/24898995
has body: As pointed out in comment, if you want to access a property named 'id' of an object, you can do it in two ways: object.id object['id'] if the name of the property is stored inside a string though, you have to access like this var modifier = 'id'; object[modifier]
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24898905
type: Answer
has comment: http://stackoverflow.com/comment/38681318
answers question: http://stackoverflow.com/q/24898905
upvote count: 1
score: 1

http://stackoverflow.com/q/24758817
has answer: http://stackoverflow.com/a/62901665
has answer: http://stackoverflow.com/a/29773435
has answer: http://stackoverflow.com/a/24759094
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/38414942
has title: JavaScript Number.toLocaleString() with 4 digits after separator
has comment: http://stackoverflow.com/comment/94566843
has body: Is there a way to get number.toLocaleString() with 4 digits after the comma? Example: var number = 49.9712; document.getElementById('id').innerText = number.toLocaleString(); Result: 49,9712 But now it always returns number with 2 digits after comma: 49,97
accepted answer: http://stackoverflow.com/a/29773435
answer count: 4
type: AnsweredQuestion
tagged with: numbers
type: Question
score: 86
tagged with: format
upvote count: 86
possible better answer: http://stackoverflow.com/a/40138485
tagged with: javascript
has answer: http://stackoverflow.com/a/40138485
has comment: http://stackoverflow.com/comment/38415010

http://stackoverflow.com/comment/38564953
score: 0
has text: All you should need to do is select all the paths(?) and filter the one for the current state. There's no need to append new elements.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24837575

http://stackoverflow.com/a/24908013
downvote count: 0
has body: $(".list1").click(function() { var text = $(this).closest("li").text(); $('&lt;li/&gt;', {html: text}).addClass("ui-selectee").appendTo('ul.seclist').append("&lt;img src='cancel.jpg' class = 'list2 ui-selectee'/&gt;"); this.style.visibility = 'hidden'; }); $('ul').on('click', '.list2', function(e) { $(this).parent('li').remove(); var liTwo = $(this).closest("li").text(); var listItems = $("#firstlist li"); listItems.each(function(li) { var liOne = $(this).text(); if(liTwo.match(liOne)){ document.getElementById(liOne.trim()).style.visibility = 'visible'; } }); });
has comment: http://stackoverflow.com/comment/38774388
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38774419
has comment: http://stackoverflow.com/comment/38773745
accepted answer of: http://stackoverflow.com/q/24906865
type: Answer
answers question: http://stackoverflow.com/q/24906865
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/38773610
has comment: http://stackoverflow.com/comment/38773437

http://stackoverflow.com/comment/38652236
type: QuestionComment
has text: Thanks @Laid Livnat. How to send the token and Id to the Webservice? How to Send the Data and the Header confidential Data like id and token?
comment on: http://stackoverflow.com/q/24867624
score: 0
type: Comment

http://stackoverflow.com/comment/38618049
score: 0
has text: Set up your IDE to show all characters and remove the character. OR delete the line and retype it.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24866085

http://stackoverflow.com/a/25027298
score: 0
type: Answer
has body: You did not have the proper syntax for controllerAs. Neither $scope nor controller as is the "standard" either, as the other answer suggests. Both work. See the below example using your code, though I am not sure you intended for the submit button to not call a method ... but that is easy to extend. HTML LOGIN LOGIN Angular JS app.controller('LoginController', function(){ var vm = this; vm.email = ''; vm.loginCheck = function(){ console.log(vm.email); }; });
answers question: http://stackoverflow.com/q/24893076

http://stackoverflow.com/comment/38588767
type: Comment
comment on: http://stackoverflow.com/a/24850940
has text: Four > I changed the code to make it simple I mischanged that Foo must be ddlFoo. I'll edit to correct that now.
score: 0
type: AnswerComment

http://stackoverflow.com/q/24814004
favorite count: 0
has comment: http://stackoverflow.com/comment/38519747
has comment: http://stackoverflow.com/comment/38519681
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38522493
has answer: http://stackoverflow.com/a/24814303
tagged with: css
has body: So basically I have css that causes an element to get bigger (increase height) when it hovers. I want to be able to have a function that allows you to click the element, disable the hover functionality (by setting the height back to it's normal state with .css()), fire a different segment of code, and then set the hover height back to normal when done. Since .css() doesn't have a callback functionality, I'm kind of stumped regarding how to do this. Here's a jsfiddle that kind gives the layout of what I want to do. http://jsfiddle.net/lennox02/99KB2/3/ And here's the lines of code in question //this fires first, disabling the hover height of 200px; $(".single-item:hover").css({"height":"100px"}); //the code I want to fire, fires second $("#6").html("Hello"); //after the code finishes firing, put the hover height back to how it was $(".single-item:hover").css({"height":"200px"});
upvote count: 1
type: Question
has title: How to make jquery CSS manipulation synchronous (i.e. without callbacks)?
tagged with: javascript
tagged with: jquery
answer count: 1
downvote count: 0
score: 1
tagged with: asynchronous
tagged with: callback

http://stackoverflow.com/comment/38634945
type: QuestionComment
comment on: http://stackoverflow.com/q/24874687
type: Comment
has text: @TravisJ: Well, I would probably point them at [this answer](http://stackoverflow.com/a/23799448/157247), which has a thorough polyfill for it. But as it's my answer, that could seem to be self-serving... :-) (Actually, let me CW it...done, now it's a CW.) And no, I don't think we can ignore IE8, I would always mention `attachEvent` (in fact, I edited it into the first `addEventListener` answer here).
score: 3

http://stackoverflow.com/a/24890435
upvote count: 2
downvote count: 0
answers question: http://stackoverflow.com/q/24873427
type: Answer
score: 2
has body: I figured it out after leaving it and coming back to it the next day. I had read somewhere that chart.stack() without any arguments passed removes all of the stacked groups on top of the original group. I thought I would have to do something like this because if I didn't then an additional stack would be added on top, something I don't want. But that turned out to be WRONG, if you call chart.stack() without any arguments it returns the groups that are stacked, however, if nothing is there to receive the return it attempts to add a new group to the stack, an undefined group. I simply removed stackedLine.stack() and my chart updated with the correct data. I also removed stackedLine.x(...) because setting the domain again would not allow for the chart to be zoomed more than once and that sort of defeats the purpose of using on('zoomed") in the first place.

http://stackoverflow.com/comment/38595193
score: 0
type: QuestionComment
type: Comment
has text: Not necessarily, for instance if you're dealing with an existing data store. I am aware that there are workarounds, my question is whether this is possible with mongo (which you answered btw)
comment on: http://stackoverflow.com/q/24853340

http://stackoverflow.com/comment/38673860
type: QuestionComment
comment on: http://stackoverflow.com/q/24895374
score: 0
has text: @p.s.w.g Which if block? So, it should be `if (isTouch == true) { ... }`?
type: Comment

http://stackoverflow.com/comment/38528755
score: 0
type: Comment
type: QuestionComment
has text: @ Anto King can you tell me at which line should i use debbuger....
comment on: http://stackoverflow.com/q/24818956

http://stackoverflow.com/comment/38415004
score: 0
has text: Use an `ng-change` to see if the model is being updated at all. Does the `formData` object exist in your scope? `ng-select` uses a child scope.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24758681

http://stackoverflow.com/q/24867770
has answer: http://stackoverflow.com/a/24867816
type: Question
tagged with: javascript
tagged with: tinymce-4
score: 0
answer count: 1
tagged with: jquery
has title: What does this mean? "Failed to load resource: the server responded with a status of 405 (Method Not Allowed)"
type: UnansweredQuestion
tagged with: http-status-code-405
has body: I am using TinyMCE and the spell check option doesnt work. When I tried to check in developer tools - console - the error which it throws is: Failed to load resource: the server responded with a status of 405 (Method Not Allowed) Was just wondering what does this mean? The respective JS file very well exists in the folder. Not sure why this problem occurs.

http://stackoverflow.com/a/24795271
type: Answer
has body: Anjith and Orion are both right but ya'll have a typo: the variable in your definition is called myOtherUrl but inside your concatenated string it is myOtherurl. Variables are case-sensitive. your variable will be parsed as a variable if you leave your double quotes around it so it's good as is
score: -1
answers question: http://stackoverflow.com/q/24795145
downvote count: 1
upvote count: 0
has comment: http://stackoverflow.com/comment/38484742

http://stackoverflow.com/q/24812899
answer count: 3
favorite count: 0
has answer: http://stackoverflow.com/a/24812947
upvote count: 1
has answer: http://stackoverflow.com/a/24812972
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24812936
has body: I have this JQuery code and a link below the JS code. It doesn't seem to work if the link is below the JS code, but it works if the JS code is below the link. How can I get it working with the JS code above the link? I need to do it this way because I have the JS code in a file that I include using PHP include. &lt;div id="EditPage" class="EditPagePopup"&gt; &lt;iframe id="EditPageFrame" width="100%" height="80%" src=""&gt;&lt;/iframe&gt; &lt;a id="JQueryClose"&gt;&amp;#215;&lt;/a&gt; &lt;/div&gt; &lt;script&gt; $("a#EditPageLink").click(function (e) { alert("f"); e.preventDefault(); $("#EditPageFrame").attr("src", $(this).attr("value")); $("a").removeClass("active"); $(this).addClass("active"); JQueryPopup('#EditPage'); }); &lt;/script&gt; &lt;a id="`EditPageLink`" href="#" value="editcustomer.php?seq='.$customer["sequence"].'"
type: Question
accepted answer: http://stackoverflow.com/a/24812947
linked to: http://stackoverflow.com/q/143486
possible better answer: http://stackoverflow.com/a/24812936
has comment: http://stackoverflow.com/comment/38517444
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38517209
has comment: http://stackoverflow.com/comment/38517257
has title: Does Javascript / JQuery code need to be below other HTML code?
score: 0

http://stackoverflow.com/q/24868908
accepted answer: http://stackoverflow.com/a/24868956
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38623368
score: -3
type: Question
downvote count: 4
answer count: 1
has comment: http://stackoverflow.com/comment/38623311
has title: How can I combine a field from an array into another array of the same length?
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/24868956
has comment: http://stackoverflow.com/comment/38623273
has body: I have two javascript arrays: var ar1 = [ {"x":1,"y":"xxxxx"}, {"x":3,"y":"yyyyy"} ]; var ar2 = [ {"a":1,"b":"bbbbb"}, {"a":3,"b":"bbbbb"} ]; How can I use a forEach a function to take the "b" field of the second array ar2 and add it to the ar1 array so that the ar1 array now has three fields. Note that these arrays are always the same length. }
has comment: http://stackoverflow.com/comment/38623279
upvote count: 1

http://stackoverflow.com/q/24857575
has title: jQuery Functional Looping : Why does Shakira repeats the kisses as new person kissed her?
accepted answer: http://stackoverflow.com/a/24857600
has comment: http://stackoverflow.com/comment/38601925
type: Question
score: -6
has comment: http://stackoverflow.com/comment/38601828
tagged with: javascript
has comment: http://stackoverflow.com/comment/38601846
upvote count: 0
has comment: http://stackoverflow.com/comment/38601862
answer count: 1
has body: See the demo of my question here: jsFiddle Question Demo Link Is not this unfair? When first Kisser (any one of A, B, C or D) kisses Shkira, she gives one kiss. And, she gives 2 kisses when Second. 3 to the third and so on. JQuery: $(document).ready(function(){ var kisses = 0; $("#main").delegate(".kisser","click",function(){ $("#inner").css("display","block"); $("#hint").css("display","none"); foo(); }); function foo(){ $("#innerClicker").click(function(){ kisses++; $(".results").html("Kissed &lt;h1&gt;" + kisses + "&lt;/h1&gt; times. &lt;br /&gt;"); $("#inner").css("display","none"); $("#hint").css("display","block"); }); } });
tagged with: jquery
has answer: http://stackoverflow.com/a/24857600
favorite count: 0
downvote count: 6
type: AnsweredQuestion

http://stackoverflow.com/comment/38618918
comment on: http://stackoverflow.com/q/24866406
has text: Have a look at [Moment.js](http://momentjs.com/) if you're going to be using dates throughout your application. If it's just for 1 thing then it may be unnecessary though. [This section](http://momentjs.com/docs/#/get-set/day/) in particular may be of use to you
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24816193
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/24811376
has body: David is right. A single product example would be helpful. It's hard to understand what you are trying to do. But my best guess is this: In your template try &lt;td&gt;{{categoryName}}&lt;/td&gt; &lt;td&gt;{{subcategoryName}}&lt;/td&gt; And in your js Template.Products.categoryName = function() { var _category = Categories.findOne({_id: this.category}); return _category ? _category.name : ""; } Template.Products.subcategoryName = function() { var _subcategory = Subcategories.findOne({_id: this.subcategory}); return _subcategory ? _subcategory.name : ""; }
accepted answer of: http://stackoverflow.com/q/24811376

http://stackoverflow.com/q/24832875
accepted answer: http://stackoverflow.com/a/24832966
linked to: http://stackoverflow.com/q/16836428
upvote count: 1
type: AnsweredQuestion
score: 1
has body: The view has 2 divs. One div displays textbox. The other displays text based on the Model.Flag value. On$post when I debug I get the inner and outer html as desired (with the second div text). But the view returned has only text box value and not the other div value. Since the variable (jq) has the correct data, can some one say if I have to rewrite the HTML on success of $.post by something like document.write ? The view is: &lt;% using (Html.BeginForm()) { %&gt; &lt;div&gt; The test message is &lt;%= @Html.TextBox("Testname",Model.Testname) %&gt; &lt;/div&gt; &lt;% if (Model.Flag) { %&gt; &lt;div&gt; Print this as true &lt;/div&gt; &lt;%} %&gt; &lt;input type ="button" value ="ClickChange" id="btnChange" /&gt; &lt;% } %&gt; $(function() { $("#btnChange").click(function() { alert("clicked"); $.post("/Display/DisplayAgain/", { Testname: $("#Testname").val() }, function(data) { alert("success"); var jq = jQuery(data); }); }); }); The controller is: public ActionResult FirstDisplay() { TestWierd.ViewModels.DisplayViewModel dispModel = new TestWierd.ViewModels.DisplayViewModel(); return View("Details",dispModel); } public ActionResult DisplayAgain(TestWierd.ViewModels.DisplayViewModel dispModel) { dispModel.Flag = true; return View("Details", dispModel); } I understand that $,post would refresh the entire view but this is not happening. Is my understanding incorrect. When I debug the view I get Model.Flag as true and when I add watch to the variable jq by debugging javascript, I get the inner HTML and outer HTML with the desired HTML i.e. with the textbox and its value as entered by user and the HTML "Print this as true", but on the browser I only see texbox with its value but not the other div with text "Print this as true". Am I doing something wrong. Can I not use $.post to check the model value and display text? Will it only have to be server side to refresh the view. Please help.
type: Question
tagged with: asp.net-mvc
downvote count: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/24832966
has title: $.post does not refresh the View MVC Asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/38554993

http://stackoverflow.com/comment/38456894
type: Comment
type: QuestionComment
has text: I see that you've specified a suffix in your code that apparently does this. Again, what's not working? I've edited your question since you're not actually attempting to convert anything.
score: 0
comment on: http://stackoverflow.com/q/24780882

http://stackoverflow.com/q/24787329
type: UnansweredQuestion
has body: My following code is: http://jsfiddle.net/j67AM/ some random text more random text random text sdads sdads sdads sdads sdads sdads sdads sdads sdads sdads sdads sdads sdads sdads sdads sdads sdads sdads CSS : #container { border: 1px solid black; height: 300px; width: 500px; overflow: auto; white-space: nowrap; } What would be the best approach in JavaScript to remove every div that is not visible? and to then add the div if it becomes visible. For example if I were to add 3000 div in the "data" then it will more than likely "lag" the page so I'm trying to come up with a solution that will only render the content that is visible inside the container. Thanks
type: Question
has comment: http://stackoverflow.com/comment/38470903
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38469223
tagged with: visibility
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: How do I add and remove children in div based on position?
has comment: http://stackoverflow.com/comment/38469227
answer count: 0

http://stackoverflow.com/q/24771997
answer count: 0
has title: Javascript for loop, length isnt correct, length became the numbers of letters
score: 1
has comment: http://stackoverflow.com/comment/38439873
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38439916
tagged with: javascript
has comment: http://stackoverflow.com/comment/38439909
downvote count: 0
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/38439840
type: UnansweredQuestion
has body: I am echoing a while loop results from php into Javascript, Javascript is picking it up in AJAX success function and displaying it in html. The problem i am facing is, the number of times the for loop is repeating itself is the number of letters, characters, i am not sure why, i attached an image to display what i mean Thanks for your time! I tried echoing it directly in php and echoing it in JSON format, both ways is creating the same problem. $result=mysqli_query($con,"SELECT * FROM list WHERE Listingid = '$Listingid' AND Status ='Bird'"); while($row = mysqli_fetch_array($result)) { $output[] = $row; } if (!empty($output)){ echo json_encode( $output );} else{ echo json_encode( [] ); } Javascript &lt;script&gt; function gup( name ) { name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS = "[\\?&amp;]"+name+"=([^&amp;#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( window.location.href ); if( results == null ) return null; else return results[1]; } var frank_param1 = gup( 'Listingid' ); $("#display12").append(frank_param1); console.log(frank_param1) $.ajax({ type: "POST", url: "interestedwaiting.php", data: {"data":frank_param1}, success: function(data2){ for(var i=0; i&lt;data2.length; i++) { console.log(data2) var html1 = "&lt;div class=two&gt; Listingid : " + data2[i] + "&lt;/div&gt;"; $('#display12').append(html1); }} }); &lt;/script&gt;
tagged with: php
has comment: http://stackoverflow.com/comment/38439906

cordova-3
tags question: http://stackoverflow.com/q/24903580
tag name: cordova-3
tags question: http://stackoverflow.com/q/24870520
type: Tag
tags question: http://stackoverflow.com/q/24757125

http://stackoverflow.com/comment/38681279
comment on: http://stackoverflow.com/q/24899364
has text: Ajax is ASYNCHRONOUS. You read the data BEFORE it comes back from the server! That is why you have the success callback! The logic that relies on the data needs to be called when the response is returned.
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38440839
comment on: http://stackoverflow.com/q/24772208
has text: from `/usr/local/bin/ it's running or not.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/38418561
type: Comment
type: QuestionComment
has text: Is that what you are trying to do? http://jsfiddle.net/upsidown/q8XS6/
comment on: http://stackoverflow.com/q/24759763
score: 0

http://stackoverflow.com/comment/38574496
type: Comment
has text: However using JS is a requisite
comment on: http://stackoverflow.com/a/24843605
score: 1
type: AnswerComment

http://stackoverflow.com/q/24755259
upvote count: 0
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38408369
has comment: http://stackoverflow.com/comment/38408182
has comment: http://stackoverflow.com/comment/38408423
has body: I'm trying to figure out how to convert a span tag to an input box and vice versa on a web app I'm building. I can convert the span tag to an input box and back but for some reason if you click the span tag a second time it does not convert it to an input box. I can only assume this is because of the binding and unbinding of handlers in jQuery but I cannot work out the best way to handle this functionality. Any ideas? $('[content-editable]').click(function(){ var edit_box = $(this); $(edit_box).html('&lt;input type="text" content-editing value="' + $(edit_box).html() + '"&gt;'); $(edit_box).find('input').select(); setTimeout(function(){ $('body').on('click', function(){ $(edit_box).html($(edit_box).find('input').val()); }); }, 500); }); ps. The timeout was added to stop the input box becoming a span tag directly after clicking it. My JS Fiddle: http://jsfiddle.net/AaxT9 - For some reason in JS Fiddle it does not convert it back to span tag after clicking the body but it does in my web app.
downvote count: 1
has title: Convert to input box from span tag and vice versa
type: Question
has answer: http://stackoverflow.com/a/24756477
has answer: http://stackoverflow.com/a/24757049
has comment: http://stackoverflow.com/comment/38408206
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/38408385
has comment: http://stackoverflow.com/comment/38412887
has comment: http://stackoverflow.com/comment/38408509
answer count: 2

http://stackoverflow.com/a/24836615
answers question: http://stackoverflow.com/q/24836573
type: Answer
score: 0
has comment: http://stackoverflow.com/comment/38597734
has comment: http://stackoverflow.com/comment/38581128
type: AcceptedAnswer
has body: I suggest you turn off the event trigger right after it's been triggered, and turn it back on after you populated the DOMs.
accepted answer of: http://stackoverflow.com/q/24836573

http://stackoverflow.com/q/24851186
score: 2
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24851614
has comment: http://stackoverflow.com/comment/38589262
has answer: http://stackoverflow.com/a/24851352
type: Question
has comment: http://stackoverflow.com/comment/38589520
has answer: http://stackoverflow.com/a/24851601
has body: I have a view as follwing, &lt;li ng-repeat="img in people.images"&gt; &lt;img ng-src="{{img}}" ng-click="setImage(img)"&gt; &lt;/li&gt; Its working. But my doubt here is, the attribute ng-click should have been set the img inside doubly braces to be executed as in ng-src as ng-click="setImage({{img}})". Its shown below, &lt;li ng-repeat="img in people.images"&gt; &lt;img ng-src="{{img}}" ng-click="setImage({{img}})"&gt; &lt;/li&gt; But the later is not working. How the expression is parsed here and how does ng-click vary from ng-src? I really confused here. Any help highly appreciated.
has title: Angular : How does ng-click directory parses the expression without doubly curly brace?
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38589594
upvote count: 2
answer count: 3
has comment: http://stackoverflow.com/comment/38589282
has comment: http://stackoverflow.com/comment/38589390
has comment: http://stackoverflow.com/comment/38589226

http://stackoverflow.com/q/24809915
has answer: http://stackoverflow.com/a/24809983
type: Question
type: AnsweredQuestion
score: 1
tagged with: timeout
accepted answer: http://stackoverflow.com/a/24809987
has title: how to reuse setTimeout
has body: I have a setTimeout as so: window.setTimeout(ground, 2000); it works just fine, but I need to be able to call that timeout repeatedly and be able to cancel it so I would need to change the code to something more like this: var timeOut = window.setTimeout(ground, 2000); and then I can cancel it with this: window.clearTimeout(timeOut); I would like to reuse timeOut at a different place. How would I do that? *ground is the name of a function that works at the end of the timeout. Thank you.
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38511455
answer count: 3
has answer: http://stackoverflow.com/a/24809987
favorite count: 0
has comment: http://stackoverflow.com/comment/38511948
possible better answer: http://stackoverflow.com/a/24810010
has answer: http://stackoverflow.com/a/24810010
upvote count: 1

http://stackoverflow.com/comment/38589669
type: QuestionComment
comment on: http://stackoverflow.com/q/24851135
has text: You've just revealed my mind about security. Thank you so much Ian.
type: Comment
score: 0

http://stackoverflow.com/q/24798500
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38490261
tagged with: css
has answer: http://stackoverflow.com/a/24798845
has comment: http://stackoverflow.com/comment/38490863
has comment: http://stackoverflow.com/comment/38491197
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38492721
tagged with: content-management-system
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38492804
has comment: http://stackoverflow.com/comment/38490777
has body: I am creating a staff members page where it has 3 staff members in a row 33% each of the row and once clicked on a member it displays there description below. The description is 100% of the container. My problem is, once clicked on image it pushes the next two staff members down. The staff members will be loaded via a CMS, there nothing can be hard coded. JS Fiddle here: http://jsfiddle.net/zangief007/BSN5u/1/ HTML: Jon doe 09 548 5554 jon@gmail.com Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officiis, tempora, libero, ipsa maxime facere ullam harum ad iusto laborum minima magni officia provident aut obcaecati quaerat fugiat labore qui aliquam. Jon doe 09 548 5554 jon@gmail.com Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officiis, tempora, libero, ipsa maxime facere ullam harum ad iusto laborum minima magni officia provident aut obcaecati quaerat fugiat labore qui aliquam. Jon doe 09 548 5554 jon@gmail.com Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officiis, tempora, libero, ipsa maxime facere ullam harum ad iusto laborum minima magni officia provident aut obcaecati quaerat fugiat labore qui aliquam. JS:
tagged with: jquery
has title: Dynamic content loaded from CMS. Staff job description to show once clicked on

http://stackoverflow.com/q/24890569
tagged with: refactoring
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38664373
score: 0
has comment: http://stackoverflow.com/comment/38665147
type: UnansweredQuestion
has title: Categorizing a number in javascript
has body: This is more of a best-practice question than anything else really. I've written a function that takes a number and returns a value depending on where that number lies on a pre-defined scale. That's probably a little confusing so I've put the code below and added a jsfiddle (although you might be better off in the dev console). var getSize = function(number){ var sizes = { 100 : 'url_t', 240 : 'url_s', 320 : 'url_n', 500 : 'url_m', 640 : 'url_z', 800 : 'url_c', 1024 : 'url_l', }, result = sizes[100]; for (var size in sizes){ if(number &lt; size){ result = sizes[size]; break; } result = sizes[1024]; } return result; }; getSize(10) // returns url_t getSize(130) // returns url_s getSize(2000) // returns url_l getSize(600) // returns url_z It works and it's fairly performant, it's just a bit icky. I've tried to come up with a better solution but it just feels ickier. Is there anything I'm missing that would make this a bit nicer? I was playing about with putting the sizes in an array so they're a little more JSON ish but then I got lost. Help us pets :(
answer count: 0

eclipse
tag name: eclipse
tags question: http://stackoverflow.com/q/24782074
tags question: http://stackoverflow.com/q/24861242
tags question: http://stackoverflow.com/q/24779752
type: Tag

http://stackoverflow.com/comment/38530241
score: 1
comment on: http://stackoverflow.com/q/24819907
type: QuestionComment
has text: I want one image upload in different folder with difference size.
type: Comment

http://stackoverflow.com/q/24838248
tagged with: touch
linked to: http://stackoverflow.com/q/11204460
has comment: http://stackoverflow.com/comment/38571593
answer count: 0
type: UnansweredQuestion
tagged with: android
tagged with: three.js
has comment: http://stackoverflow.com/comment/38566318
score: 0
has title: Touchmove and webgl controls conflict
type: Question
has comment: http://stackoverflow.com/comment/38570797
has body: I have been using and modifying the nice distance measuring tool created by Markus Schuetz for point clouds, but which also works for meshes. Demo: http://potree.org/demo/distance_measure/examples/distance_measure.html Github: https://github.com/potree/potree/tree/master/examples However, I would also like to enable it for use on mobile devices. I think the main addition is that the current function is only: function onDocumentMouseMove(event) { event.preventDefault(); mouse.x = (event.clientX / window.innerWidth ) * 2 - 1; mouse.y = -(event.clientY / window.innerHeight ) * 2 + 1; } And therefore there needs to be a further function for touchmoves, such as: function onDocumentTouchMove(event) { event.preventDefault(); mouse.x = (event.touches[0].pageX / window.innerWidth ) * 2 - 1; mouse.y = -(event.touches[0].pageY / window.innerHeight ) * 2 + 1; } As well as an accompanying listener: document.addEventListener('touchmove', onDocumentTouchMove, false); However, this does not seem to be sufficient. On Android KitKat at least, this does successfully allow the moving of the ‘start’ and ‘end’ landmarks, but the touchmoves are still creating conflicts with the webgl model panning/rotating. I had been hoping that event.preventDefault(); would avoid this issue (and as an alternative I have also tried using event.stopPropagation) Do I also need to add touchStart and touchEnd functions to make this work properly?
tagged with: javascript

http://stackoverflow.com/comment/38475708
type: Comment
has text: @eg_dac the answer provided is magnitudes smaller and likely more efficient that using what jQuery does. It might not be what the OP uses at the end of the day but it is helpful, correct, and might teach the OP something else (not to mention anyone else who stumbles here).
score: 2
type: AnswerComment
comment on: http://stackoverflow.com/a/24790522

http://stackoverflow.com/q/24861773
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24878113
type: AnsweredQuestion
has body: I'm using SetRowData to set some row data in a jqGrid jqColModel = gJqGrid.jqGrid('getGridParam','colModel'); rowData = gJqGrid.jqGrid('getRowData', rowid); for (var i=0; i&lt;newData.length; i++){ rowData[jqColModel[i+1].name] = newData[i]; } gJqGrid.jqGrid('setRowData', rowid, rowData); This is working as expected. The jqGrid row is being updated with the values from the newData object. I'm then trying to get all the modified cells using jqRows = gJqGrid.jqGrid('getChangedCells', 'dirty'); but this doesn't seem to be working. I'm trying to batch up all the changes and create a custom save event My grid definition is as below $(gJqSel_Table).jqGrid({ caption : 'jqGrid' , datatype : 'local' , loadonce : true , data : formattedLineData , colNames : customColNames , colModel : customColModel , autoencode : true , rowNum : 1000 , keys : true , sortable : false , hidegrid : false , multiselect : false , altRows : false , height : '100%' , autowidth : true , shrinkToFit : true , cellEdit : gSettings.editMode , cellsubmit : 'clientArray' , afterEditCell : function (rowid) { var $editControl = $("#" + rowid).find("input, select, textarea"); if ($editControl){ $editControl.on('paste', function(e) { GridPaste(e, rowid); }); } } }); Can someone provide some guidance about how I can use a JSON object to set all the cell values of a row flag each cell in the row as dirty so that the getChangedCells method knows that the values have changed?
type: Question
has answer: http://stackoverflow.com/a/24878113
tagged with: jqgrid
tagged with: javascript
score: 0
has title: SetRowData and DirtyCells
answer count: 1

http://stackoverflow.com/q/24870462
downvote count: 3
has body: Any idea what's wrong with this? var p = document.createElement('p'); p.innerHTML = 'test'; document.body.appendChild(p); http://jsfiddle.net/Qaym3/
type: Question
tagged with: jsfiddle
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24870546
has answer: http://stackoverflow.com/a/24870546
has comment: http://stackoverflow.com/comment/38626514
answer count: 3
upvote count: 0
has answer: http://stackoverflow.com/a/24870545
favorite count: 0
has answer: http://stackoverflow.com/a/24870566
score: -3
has title: Why won't jsfiddle let me access document.body?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24870545

http://stackoverflow.com/q/24878313
tagged with: razor
has comment: http://stackoverflow.com/comment/38643213
answer count: 0
has comment: http://stackoverflow.com/comment/38642830
has comment: http://stackoverflow.com/comment/38643207
has title: Get variable to scope to other view
type: Question
has comment: http://stackoverflow.com/comment/38643391
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/38642996
has comment: http://stackoverflow.com/comment/38643025
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38643088
has comment: http://stackoverflow.com/comment/38642914
has body: I am trying to allow visibility of variables that are populated in one view to also be used in another view. How do I accomplish this? The code for the two variables used in the 1st view and what I am trying to get in the 2nd view as below: Calendar View @using (Html.BeginForm("Update", "Calendar")) { Enter The Number Of Days To Display @Html.TextBoxFor(model => model.Date, new {id = "Date" }) @Html.LabelFor(model => model.DaysToBeViewed) @Html.EditorFor(model => model.DaysToBeViewed) } Update view // Convert both dates to milliseconds var Date_milSec = model.Date.getTime(); var AddedDays_milSec = model.DaysToBeViewed.getTime(); I would like to take the variable 'Date' that is init in the Calendar view and use it to populate a TextBox on the Update View page. I have an Calendar.cshtml and an Update.cshtml. Am I doing this right?
type: UnansweredQuestion

http://stackoverflow.com/q/24815315
has answer: http://stackoverflow.com/a/24815372
score: 0
has body: I'm using YDN-DB (an abstraction on top of IndexedDB) as a local database. I have an object store called 'conversations', and in that store, there's an index called 'participants' where there is a string containing id's for different users in the conversation. For example: Example Conversation #1: id: 1234343434353456, participants: '171e66ca-207f-4ba9-8197-d1dac32499db,82be80e2-2831-4f7d-a8d7-9223a2d4d511' Example Conversation #2: id: 4321343434356543, participants: 'd7fa26b3-4ecc-4f84-9271-e15843fcc83f,171e66ca-207f-4ba9-8197-d1dac32499db' To try to perform a partial match on an index, I tried using ydn-db-fulltext as a solution. The full text catalog looks like this: { name: 'participants', lang: 'en', sources: [ { storeName: 'conversations', keyPath: 'participants', weight: 1 } ] } I see that the catalog is generated, but there seems to be a problem doing exact matches. For example, if I query using only part of the key in the participants index, I get back a primary key from the catalog: db.search('participants', 'd7fa26b3').done(function(results) { if(results.length == 0) console.debug('No results found...'); console.debug(results); // there is 1 object here! var primaryKey = results[0].primaryKey; // primaryKey exists! }); However, when using any value past the '-', the search request returns 0 results: db.search('participants', 'd7fa26b3-4ecc-4f84-9271-e15843fcc83f').done(function(results) { if(results.length == 0) console.debug('No results found...'); console.debug(results); // there are 0 objects in the array var primaryKey = results[0].primaryKey; // primaryKey throws undefined since there are 0 results! }); This makes sense, when reading the documentation, in that '-' and '*' are reserved characters that remove a phrase and match a prefix respectively: Query format is free text, in which implicit and/or/near logic operator apply for each token. Use double quote for exact match, - to subtract from the result and * for prefix search. I tried putting double…
tagged with: ydn-db
tagged with: indexeddb
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24831602
has title: How do I select a record by matching an index based on a partial string that contains '-' characters?
type: Question
answer count: 2
tagged with: ydn-db-fulltext

http://stackoverflow.com/a/24830346
score: 0
answers question: http://stackoverflow.com/q/24830192
type: Answer
has body: When highScore is declared inside the loop, its value gets reset to zero in each iteration. That is why in the end you see the value of highScore as 44 which is the last element in your array. Keep it declared above the loop to make it work. That way the previous value assigned would be persisted and not reset to 0.

http://stackoverflow.com/comment/47124857
has text: in express 4, now use : app.use(bodyParser.urlencoded({ extended: true }));
score: 15
comment on: http://stackoverflow.com/a/24800648
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38599939
type: QuestionComment
has text: @sarbbottam so you say that it's not possible with pure css?
comment on: http://stackoverflow.com/q/24856476
score: 0
type: Comment

draggable
tags question: http://stackoverflow.com/q/24781177
tags question: http://stackoverflow.com/q/24844428
tags question: http://stackoverflow.com/q/24895306
type: Tag
tag name: draggable
tags question: http://stackoverflow.com/q/24815171

http://stackoverflow.com/q/24805921
tagged with: email
tagged with: jquery
has body: Lets say I have a list of users I want to email. The mailto: lets me open up email and it inserts their email address. I want this to be dynamic. mailto:1@1.com mailto:2@2.com mailto:3@3.com mailto:4@4.com Example: I click on user 1 &amp; 4 and send and email out. Next time, I click on 2 &amp; 3 and send another email out. Problem: Right now, every time I click on a user, it opens up a new window. I would be sending out separate emails to user to 1 &amp; 4. What function would I have to use so it does not open up a new email window every time I click on an email. If I click all the users 1 to 4, I want all 4 emails addresses to be in the same window so I am sending out 1 email to all 4 users. Not the other way around.
possible better answer: http://stackoverflow.com/a/24806079
has answer: http://stackoverflow.com/a/24806058
has comment: http://stackoverflow.com/comment/38503711
tagged with: php
type: AnsweredQuestion
score: 0
has title: mailto: add users dynamically to same email
type: Question
accepted answer: http://stackoverflow.com/a/24806058
has answer: http://stackoverflow.com/a/24806029
linked to: http://stackoverflow.com/q/13765286
tagged with: javascript
linked to: http://stackoverflow.com/q/9278363
answer count: 3
has answer: http://stackoverflow.com/a/24806079

http://stackoverflow.com/q/24880325
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/24889625
tagged with: angularjs
has title: Protactor js testing work flow
upvote count: 1
type: AnsweredQuestion
tagged with: protractor
score: 1
has body: I've recently started getting into Angular (with node.js), and many of the tutorials suggest using Protactor, which looks amazing. One thing has me confused though. I'm used to tests where test data is built before the test, the test is run, and the data is destroyed. With protractor it seems you start your server, and have your tests run against that server. In the tutorials I've seen, this server is usually the dev environment (populated by seed data I assume). In my experience, the dev database changes as you play around and tweak your app. Furthermore, a protractor test might delete an object, meaning that for the test to be re-run the object would have to be built again. When using Protractor, what is the standard practice for creating a test environment with before/after hooks for populate. Bonus points if you can point me to some good resources that answer my question.
type: Question
tagged with: testing
has answer: http://stackoverflow.com/a/24889625
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/24845835
has answer: http://stackoverflow.com/a/24845910
has body: Generically in pure js or jquery, or in the context of rails, how do you obtain the DOM element that was clicked? Usually you do something like this, allowing you to use $(this).whatever_method $(#something).on('click', function() { $(this).do_something; }_; But in my case, I have a link in my html that is remote: true, and in my controller I render a js.erb file. In such a scenario, all of the javascript code in the js.erb file gets executed. There is no place for a click listener, since the only reason this js.erb file is executing is because something was already clicked. but I do want to select the DOM element that was clicked. How do I do this? I don't want to simply select it manually, since that is not very dynamic or reusable (plus, I'd have to inject logic to select the right one anyway). html &lt;%= link_to "text", send(some_path, @votable, vote_type: "#{s.name}"), remote: true, class: "option" %&gt; &lt;%= link_to "text", send(some_path, @votable, vote_type: "#{s.name}"), remote: true, class: "option" %&gt; controller def action render 'shared/vote' end /views/shared/vote.js.erb // how to obtain the link that i clicked in the html file (i.e. the first `".option"` link rather than the second. // would using `$(this)` here, work? it seems wrong.
has comment: http://stackoverflow.com/comment/38579081
linked to: http://stackoverflow.com/q/3031452
type: Question
has comment: http://stackoverflow.com/comment/38579184
has answer: http://stackoverflow.com/a/24849312
accepted answer: http://stackoverflow.com/a/24849312
has answer: http://stackoverflow.com/a/24846693
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38579465
has comment: http://stackoverflow.com/comment/38579171
score: 0
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/38579154
favorite count: 0
has comment: http://stackoverflow.com/comment/38579066
has comment: http://stackoverflow.com/comment/38579123
has title: How to obtain the clicked DOM element?
has comment: http://stackoverflow.com/comment/38579527
possible better answer: http://stackoverflow.com/a/24846693
tagged with: ruby-on-rails
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38579131
has comment: http://stackoverflow.com/comment/38579335

http://stackoverflow.com/comment/38692759
has text: No, this is too much to add an `ng-focus` to every input, specially that I would want to use that (maybe) for other functionalists. Worst comes worst, I'll just have a directive for input
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/24905803
type: Comment

http://stackoverflow.com/a/24903091
has body: try this jsfiddle:- $(".dropdown-menu").find("li a").click(function(){ $('.selectedLi').removeClass('selectedLi'); $(this).addClass('selectedLi'); }); $("#call").click(function(){ BusinessLogic(); }); function BusinessLogic() { var text = $('.dropdown-menu').find("li a.selectedLi").text(); alert("selected Value:"+text); } click here to see working example: http://jsfiddle.net/BtkCf/147/
type: Answer
answers question: http://stackoverflow.com/q/24902507
score: 0

http://stackoverflow.com/q/24835298
has comment: http://stackoverflow.com/comment/39059003
tagged with: ember-cli
favorite count: 0
has comment: http://stackoverflow.com/comment/38559872
type: UnansweredQuestion
has body: Using a newly-created app in the Ember CLI 0.39, once I added new templates, I started getting this error message: Uncaught SyntaxError: Duplicate data property in object literal not allowed in strict mode This line, in the concatenated source, is causing the issue: ;eval("define(\"app/templates/mytemplate/new\", \n [\"ember\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.Handlebars.template(...)});// #sourceURL=app/templates/mytemplate/new.js); Any help would be appreciated.
has answer: http://stackoverflow.com/a/25663082
score: 2
downvote count: 0
type: Question
upvote count: 2
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/28595669
has comment: http://stackoverflow.com/comment/39058464
has title: Ember CLI: Uncaught SyntaxError: Duplicate data property in object literal not allowed in strict mode
tagged with: ember.js

http://stackoverflow.com/q/24773996
tagged with: animation
type: AnsweredQuestion
type: Question
has title: how to queue animation slide when it is looped using jquery
has answer: http://stackoverflow.com/a/24774100
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/24774100
has body: here i am trying to make animation in which 1st image should slide and next second image and then third image and so on but now all of them are being animated at a time any help what to do.?

http://stackoverflow.com/q/24885066
has title: parsley - hide/show block based on value of a li
answer count: 1
tagged with: parsley.js
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24889322
tagged with: javascript
tagged with: jquery
has body: I have a form and i am using parsley for validation: HTML JQUERY $(document).ready(function () { $('#credirentierform').parsley().subscribe('parsley:form:validated', function (formInstance) { var searchvalue="Erreur"; $("div[name='sub_part']").each(function() { if ($(this).html().indexOf("Erreur") >-1){ this.style=""; } else { this.style="none"; }; }); }); }); Basically, at the submission of the form Parsley will add the following: Erreur My query code is supposed to go through each div with name="sub-part" and if Erreur is found, the style="block" otherwise style="none". However, it does not behave that way. It seems that my code does look into the entire page and not within the section defined by name="sub-part". What am i missing? thanks
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 0

http://stackoverflow.com/a/24833114
downvote count: 0
answers question: http://stackoverflow.com/q/24833046
type: Answer
score: 2
upvote count: 2
has body: You can't do data.query.pages.-1 for the same reason you can't do var -1;: -1 is not a valid identifier. But that's not a problem. foo.bar // Access member bar of object foo is just a shortcut for foo["bar"] // Access member bar of object foo so you can do data.query.pages["-1"] You could even do data["query"]["pages"]["-1"]

http://stackoverflow.com/comment/38450026
comment on: http://stackoverflow.com/q/24777282
score: 0
has text: @VinodLouis, Thank you for your advice, but there is another problem here is that I'm receiving blank arguments `ng-click="fiche.submitEdit(qualif0, qualif1, commentaire)"`.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24857011
has comment: http://stackoverflow.com/comment/38600871
has comment: http://stackoverflow.com/comment/38600883
has answer: http://stackoverflow.com/a/24857167
tagged with: django
tagged with: python
type: AnsweredQuestion
tagged with: django-templates
tagged with: django-views
downvote count: 0
score: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38600949
has title: Pass an id from a template to a view in django
accepted answer: http://stackoverflow.com/a/24857167
upvote count: 1
answer count: 1
has body: I´m having some problems with this. I have a form like this: &lt;form action="/" method="post"&gt; {% csrf_token %} &lt;input type="button" name="_mail" value="Enviar Mail" id="buttonId"&gt; &lt;/form&gt; it´s just a buttom. Then in my views i have this code: def verFactura(request, id_factura): fact = Factura.objects.get(pk = id_factura) cliente = Cliente.objects.get(factura = fact) template = 'verfacturas.html' iva = fact.importe_sin_iva * 0.21 total = fact.importe_sin_iva + iva extra_context = dict() extra_context['fact'] = fact extra_context['cliente'] = cliente extra_context['iva'] = iva extra_context['total'] = total if "_mail" in request.POST: send_templated_mail(template_name='receipt', from_email='imiguel@exisoft.com.ar', recipient_list =['ignacio.miguel.a@gmail.com'], context=extra_context) return HttpResponseRedirect('../facturas') else:(if i don´t write this else i get an error) return render(request,template, extra_context) return render(request,template, extra_context) And a member of SO suggested to use javascript to handle the click event like this: &lt;script type="text/javascript"&gt; $(document).ready(function(){ $('#buttonId').click(function(){ alert("Email enviado"); }); }); i know nothing about javascript but i was hoping that with only this i could call the IF statement in the view. But obviously this part of the code never gets call and i don´t recieve any email. So, can anyone tell me where is my mistake? i have a feeling that the part of the If statement is wrong but i don´t why I would really appreciate the help. Thank you
favorite count: 0

http://stackoverflow.com/q/24857126
has comment: http://stackoverflow.com/comment/38607697
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/24863086
has body: I am implementing a Radial Reingold–Tilford Tree (http://bl.ocks.org/mbostock/4063550) but along with the basic example with that pan and zoom, drag and also collapsible clickable node. I have been able to implement most of it. However one more thing I need is drag and drop of different node to other node. I have been able to implement that too, but while dragging I want to show the link/temporary connector too but it is becoming a hassle to implement at a radial view. I am at a loss at what to do after this. This is my present working code. http://jsfiddle.net/rabimba/d6DVn/1/ The portion I need to first calculate it correctly while the draglistener should be relCoords = d3.mouse($('svg').get(0)); if (relCoords[0] &lt; panBoundary) { panTimer = true; pan(this, 'left'); } else if (relCoords[0] &gt; ($('svg').width() - panBoundary)) { panTimer = true; pan(this, 'right'); } else if (relCoords[1] &lt; panBoundary) { panTimer = true; pan(this, 'up'); } else if (relCoords[1] &gt; ($('svg').height() - panBoundary)) { panTimer = true; pan(this, 'down'); } else { try { clearTimeout(panTimer); } catch (e) { } } d.x0 += d3.event.dy; d.y0 += d3.event.dx; var node = d3.select(this); node.attr("transform", "translate(" + d.y0 + "," + (d.x - 90 )+ ")"); updateTempConnector(); }) Then I can start working on the connectors. I have commented as much as possible.
answer count: 1
tagged with: d3.js
has title: How to make Drag and Drop of nodes work inside a Radial Reingold–Tilford Tree in D3?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38603405
has comment: http://stackoverflow.com/comment/38603015
type: Question

http://stackoverflow.com/q/24859427
has comment: http://stackoverflow.com/comment/38605457
answer count: 2
has answer: http://stackoverflow.com/a/24859496
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24859529
has title: Javascript Regex split (val(number)=)
has answer: http://stackoverflow.com/a/24859529
favorite count: 0
possible better answer: http://stackoverflow.com/a/24859496
has comment: http://stackoverflow.com/comment/38605516
score: -3
tagged with: regex
type: AnsweredQuestion
upvote count: 0
downvote count: 3
has body: This is my data var result= Val1=08182014&amp;sydney-holistic-dental-centre-14750975&amp;2000&amp;Dentist&amp; Val2=08182014&amp;nine-dragons-restaurant-12494711&amp;2000&amp;Restaurant&amp; Val3=08182014&amp;mr-switch-electrical-14251034&amp;2000&amp;Electricians&amp; Val4=08182014&amp;laser-sight-13604978&amp;2000&amp;Doctors&amp; Val5=08182014&amp;lube-mobile-the-mobile-mechanics-14755685&amp;2000&amp;Mechanics&amp; Val6=08182014&amp;mr-h2o-plumbing-services-14223825&amp;2000&amp;Plumbers&amp; Val7=08182014&amp;philippe-xavier-hairdressers-14887853&amp;2000&amp;Hairdressers&amp; Val8=08182014&amp;gerard-malouf-partners-12372365&amp;2000&amp;Solicitors&amp; Val9=08182014&amp;beauty-grace-13817412&amp;2000&amp;Beauty_Salons&amp; Val10=08182014&amp;rapid-construction-pty-ltd-15093518&amp;2000&amp;Builders I want to parse my data and format is &lt;date&gt;&amp;&lt;business&gt;&amp;&lt;post_code&gt;&amp;&lt;category&gt;. I want to skip val1,val2 etc and just to get 08182014&amp;sydney-holistic-dental-centre-14750975&amp;2000&amp;Dentist which is &lt;date&gt;&amp;&lt;business&gt;&amp;&lt;post_code&gt;&amp;&lt;category&gt;. What should i do to skip Val1=,val2-,val3= etc and put in the array. After that i can loop through my array and split it by (&amp;). i want to make an array like (08182014&amp;sydney-holistic-dental-centre-14750975&amp;2000&amp;Dentist, 08182014&amp;nine-dragons-restaurant-12494711&amp;2000&amp;Restaurant , etc)
type: Question

http://stackoverflow.com/comment/38680779
score: 0
has text: Also a great solution!
comment on: http://stackoverflow.com/a/24899283
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38680561
score: 2
type: Comment
type: QuestionComment
has text: On mouseover? Users won't like this.
comment on: http://stackoverflow.com/q/24899175

http://stackoverflow.com/comment/38406731
comment on: http://stackoverflow.com/a/24753627
has text: can you post sample html structure where you want to add this li tag, may be jsfiddle is better.
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/38453782
score: 0
type: Comment
has text: @j809 well, it's easy to fix someone's downvote :)
comment on: http://stackoverflow.com/a/24779461
type: AnswerComment

http://stackoverflow.com/a/24769524
answers question: http://stackoverflow.com/q/24769465
type: Answer
has body: You can use filter() for this: var data = "[code] code [code]"; data = data.match(/\[+code\]+/g) // gives us ["[code]", "code", "[code]"] .filter(function(x) { return !x.match(/\[\[code\]\]/); }); // data is now ["[code]", "[code]"] Felix's method also works nicely.
score: 0

http://stackoverflow.com/a/24767416
answers question: http://stackoverflow.com/q/24767325
accepted answer of: http://stackoverflow.com/q/24767325
has comment: http://stackoverflow.com/comment/38431407
has comment: http://stackoverflow.com/comment/38431594
has comment: http://stackoverflow.com/comment/38431522
has comment: http://stackoverflow.com/comment/38431213
type: AcceptedAnswer
downvote count: 0
has body: They (probably) are uniform! The probability of getting 0 is the same as the probability of getting 18446744073709551615, but there are 4611686018427387904 numbers in that range with no leading zeroes, and only one with 64 of them. You should expect to see each bit count appearing approximately twice as much as the previous one, which your test agrees with.
score: 3
type: Answer
has comment: http://stackoverflow.com/comment/38433160
has comment: http://stackoverflow.com/comment/38431433
has comment: http://stackoverflow.com/comment/38431738
has comment: http://stackoverflow.com/comment/38431168
upvote count: 3
has comment: http://stackoverflow.com/comment/38431371

http://stackoverflow.com/comment/38510604
has text: I've seen the function this.addChildAt(this.backdrop, 0); Does the 0 represent the z-index? Could I maybe load in the new graphic behind then after a call back - fade out the old frame?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24762682
score: 0

http://stackoverflow.com/comment/38432431
type: Comment
has text: I can have the uid as hidden but in the test_javascript.js i want to get the value of the uid from cgi as var uid = demo or something... I think it can be done with simple javascript but i am so new on javascript, i couldnt think of any process
comment on: http://stackoverflow.com/a/24767390
score: 0
type: AnswerComment

dojo
tags question: http://stackoverflow.com/q/24903892
tags question: http://stackoverflow.com/q/24870233
tags question: http://stackoverflow.com/q/24805202
tags question: http://stackoverflow.com/q/24907473
tags question: http://stackoverflow.com/q/24794930
type: Tag
tags question: http://stackoverflow.com/q/24774196
tags question: http://stackoverflow.com/q/24827843
tags question: http://stackoverflow.com/q/24904313
tags question: http://stackoverflow.com/q/24802756
tags question: http://stackoverflow.com/q/24796464
tags question: http://stackoverflow.com/q/24779878
tags question: http://stackoverflow.com/q/24834442
tags question: http://stackoverflow.com/q/24842789
tags question: http://stackoverflow.com/q/24770013
tags question: http://stackoverflow.com/q/24892585
tags question: http://stackoverflow.com/q/24891841
tags question: http://stackoverflow.com/q/24808925
tags question: http://stackoverflow.com/q/24905888
tags question: http://stackoverflow.com/q/24797324
tags question: http://stackoverflow.com/q/24881033
tags question: http://stackoverflow.com/q/24833175
tag name: dojo
tags question: http://stackoverflow.com/q/24763177
tags question: http://stackoverflow.com/q/24813001
tags question: http://stackoverflow.com/q/24774912

http://stackoverflow.com/q/24809345
tagged with: parse-platform
has body: Ok this should be a relatively simple one. Apologies i am an iOS developer usually trying to understand Javascript. I have a PFFile that is being saves into a PFObject from iOS. I now need to send the URL of the image to a web service, which i am trying to do using an afterSave method on Cloud Code. I have the object being fetched, and i can see the file contained within it. But i can't work out how to access the URL value. I have tried various approaches, and i'm sure it's me not understanding how to access the value on an object, nested in another object. I've listed what i mostly tried below. I have everything else working apart from this so help would be greatly appreciated. Thanks Gareth var image = request.object.get("userPhoto") console.log(image); var imageURL = image.url var imageURL = image.'url' var imageURL = image.(url) var imageURL = image.('url') console.log(imageURL);
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24811157
accepted answer: http://stackoverflow.com/a/24811157
type: Question
has title: Parse Cloud Code - Get URL of PFFile
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/q/24908686
tagged with: jquery
has answer: http://stackoverflow.com/a/24908861
favorite count: 0
has comment: http://stackoverflow.com/comment/38698149
possible better answer: http://stackoverflow.com/a/24908928
tagged with: php
linked to: http://stackoverflow.com/q/7024040
has body: I have a javascript variable called "list". I need to send it as a POST data to another page and open that page in a new tab (with the POST data present). This code: jQuery.post('datadestination.php', list); sends the data all right, but ofcourse it opens the page in the same tab. I saw some solutions to similar problems using invisible form and things like that, but I could not get them to work. Is there any simple solution?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24908993
has comment: http://stackoverflow.com/comment/38698031
accepted answer: http://stackoverflow.com/a/24908861
type: Question
tagged with: javascript
score: 22
linked to: http://stackoverflow.com/q/7013109
upvote count: 22
answer count: 3
has title: jQuery open page in a new tab while passing POST data
has answer: http://stackoverflow.com/a/24908928
downvote count: 0

http://stackoverflow.com/comment/38568992
type: QuestionComment
comment on: http://stackoverflow.com/q/24840310
type: Comment
score: 0
has text: it seems you have an array of objects so `myObject` is actually an array `myObject[0].btn_col_preset_title` would get you `btn_col_preset_title` from the first object in the array

http://stackoverflow.com/q/24848100
has title: D3.js error when running line-area graph and donut chart on same page
downvote count: 0
favorite count: 0
tagged with: d3.js
type: UnansweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/38586936
has body: I keep coming across an error that says "Uncaught TypeError: Cannot read property 'map' of undefined" with d3.v3.js. Here is my donut chart code: function pieChart ( dataurl, selector ) { var margin = {top: 20, right: 20, bottom: 20, left: 20}; width = 400 - margin.left - margin.right; height = width - margin.top - margin.bottom; var radius = Math.min(width, height) / 2; var color = d3.scale.ordinal() .range(["#3399FF", "#5DAEF8", "#86C3FA", "#ADD6FB", "#D6EBFD"]); var arc = d3.svg.arc() .outerRadius(radius) .innerRadius(radius - 20); var pie = d3.layout.pie() .sort(null) .startAngle(1.1*Math.PI) .endAngle(3.1*Math.PI) .value(function(d) { return d.value; }); var donut = d3.select("#portfolio") .append('svg') .attr("width", '100%') .attr("height", '300px') .attr('viewBox','0 0 '+Math.min(width,height) +' '+Math.min(width,height) ) .attr('preserveAspectRatio','xMinYMin') .append("g") .attr("transform", "translate(" + ((width/2)+margin.left) + "," + ((height/2)+margin.top) + ")"); d3.json("data/donut.json", function(error, json) { json.forEach(function(kv){ kv.Data.forEach(function(d){ d.value = +d.value; }); // // console.log(json); // json.Data.value.forEach(function(d) { // d.value = +d.value; // console.log(d.value); // }); var path = donut.selectAll(".arc") .data(pie(kv.Data.value)) .enter().append("g") .attr("class", "arc"); g.append("path") .style("fill", function(d) { return color(d.Data.label); }) .transition().delay(function(d, i) { return i * 500; }).duration(500) .attrTween('d', function(d) { var i = d3.interpolate(d.startAngle+0.1, d.endAngle); return function(t) { d.endAngle = i(t); return arc(d); } }); }); }); }; It won't display the donut chart and tags the error to the d3.v3.js file in console. Here are the lines it's giving me errors on: d3.layout.pie = function() { var value = Number, sort = d3_layout_pieSortByValue, startAngle = 0, endAngle = 2 * π; function pie(data) { var values = data.map(function(d, i) { return +value.call(pie, d, i); Any help …
answer count: 0
upvote count: 2
type: Question
tagged with: javascript

http://stackoverflow.com/a/24842960
answers question: http://stackoverflow.com/q/24842928
score: 0
has body: I'm going to assume that executeSql is asynchronous, since it accepts a callback function. The body of the function you're giving it is executed at some point in the future, long after console.log as run. You need to refactor your code so that your console.log (and whatever other logic you want to include) are run by the callbacks passed to executeSql.
type: Answer

http://stackoverflow.com/a/24847310
downvote count: 0
type: Answer
score: 12
has body: Don't use the old window.onload event model. That is not very flexible &mdash; as you've noticed &mdash; and not necessary for browser support any more. jQuery makes this easy; change window.onload = function to $(function) in each JS file. Pure JS solution: change that to window.addEventListener('load', function).
has comment: http://stackoverflow.com/comment/45060424
answers question: http://stackoverflow.com/q/24846846
has comment: http://stackoverflow.com/comment/44938053
upvote count: 12

http://stackoverflow.com/q/24879234
accepted answer: http://stackoverflow.com/a/27481861
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24882936
upvote count: 2
has answer: http://stackoverflow.com/a/27481861
answer count: 2
downvote count: 1
possible better answer: http://stackoverflow.com/a/24882936
has body: I have developed a quiz module in which whenever the user clicks on submit button, the button gets disabled and then redirected to next question. Now the problem is sometimes the submit button doesn't respond for about 4-5 or more clicks and then suddenly submits the form which results in skipping of 4-5 questions. Have tried using document.form.submit and even jQuery('#question_form').submit(). But still few users report the same problem. I am unable to create the same scenario for myself. In my view page I have: &lt;form id="question_form" style="text-align:center;" name="question_form" method="post" action="/exam/259/calc_current_score?name=question" accept-charset="UTF-8"&gt; &lt;!-- some fields to be submitted --&gt; &lt;input type="submit" value="Submit" onclick="changeButtonText(event,this.form);" name="submit_button" id="submit_button" class="exam-btn-primary"&gt; &lt;/form&gt; &lt;script type="text/javascript"&gt; function changeButtonText(e,form){ //if validation is true then it submits the form like this error_notification.style.display="none"; form.submit(); jQuery('#submit_button').css({'background-color':'#C3CACD'}); form.submit_button.disabled=true; return true; //else if the validation fails then 'submit button' is not disabled e.preventDefault(); } &lt;/script&gt; So, the main problem is that even when the user clicks on the submit button after selecting an option neither the form gets submitted (which would eventually redirect to the next page) nor the button gets disabled (also the color of the button changes when validations are successful) so they keep clicking and this mostly happens in Google Chrome. I don't know that is it because of slow net connection or the resources are taking longer time to load. Users report that sometimes they have to click multiple number of times in order to submit the question's answer, and whenever they click multiple number of times the questions get skipped. For example if they click x times on submit button they…
favorite count: 0
tagged with: ruby-on-rails-3
has comment: http://stackoverflow.com/comment/38642994
has comment: http://stackoverflow.com/comment/38726355
has comment: http://stackoverflow.com/comment/38643600
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42022611
score: 1
tagged with: forms
has comment: http://stackoverflow.com/comment/38643020
has comment: http://stackoverflow.com/comment/38642928
has title: Form submit button is not working sometimes
type: Question

http://stackoverflow.com/q/24822853
tagged with: grails
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I have a Grails application. When user press a download button the audio clip is downloaded. &lt;g:link action="download" id="${sessionsInstance?.id}" class="btn btn-xs"&gt; &lt;i class="glyphicon glyphicon-edit"&gt;&lt;/i&gt; &lt;g:message code="com.ef.session.download" default="Download" /&gt; &lt;/g:link&gt; Currently, I have specified path in code and download the file in that path. But I want that when user press download button a Save As popup window should be generated allowing user to specify the path where user wants to store that file not the one specified in code. Such As: Kindly guide me that how may I achieve this as I am dealing with this for the first time. Thanks in Advance.
type: UnansweredQuestion
tagged with: gsp
tagged with: savefiledialog
has answer: http://stackoverflow.com/a/24823699
has title: Implementing 'Save As' popup window when user try to download file
type: Question
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/24823413

http://stackoverflow.com/comment/38414439
has text: @Alnitak The alert actually worked, but the script executed at url did not get called...
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24755646

http://stackoverflow.com/q/24864745
has comment: http://stackoverflow.com/comment/38616589
has comment: http://stackoverflow.com/comment/38644358
type: Question
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38615911
has comment: http://stackoverflow.com/comment/38615776
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38615683
has comment: http://stackoverflow.com/comment/38616381
has title: JavaScript Apostrophe escape with code behind call (C#/VB)
tagged with: asp.net
favorite count: 0
type: UnansweredQuestion
has body: I am struggling with apostrophe in JavaScript call. Problem is, that casual solutions like replacing apostrophe with \', &amp;#39; \u0027 are not working because I am creating JavaScript action dynamically. Example: HTML Part: &lt;img onmouseover="ShowNote('&lt;%= instance("note") %&gt;')"&gt; Code behind part: instance("note") = "John's room is awful"; The thing is, that once aspx.net reaches &lt;%= instance("note") =>' part it replaces it with it's representation leading to creating this in source code: &lt;img onmouseover="ShowNote('John's room is awful')"&gt; And this is not working as expected. Is there any way to resolve this? As mentioned above. None of the replacement is working.
has comment: http://stackoverflow.com/comment/38615080
upvote count: 1
has comment: http://stackoverflow.com/comment/38624324
has comment: http://stackoverflow.com/comment/38615164
answer count: 0
score: 1

http://stackoverflow.com/a/24921262
score: 0
has comment: http://stackoverflow.com/comment/38772943
answers question: http://stackoverflow.com/q/24902568
type: Answer
has comment: http://stackoverflow.com/comment/38775351
has body: Class name is not unique on the page. It will return an array. Use ID. You can see an answer here: tell application "Safari" activate tell document 1 do JavaScript "document.getElementById('button-id').click();" end tell end tell You didn't post the entire button code, so don't see the ID.

http://stackoverflow.com/comment/38427635
score: 0
type: AnswerComment
has text: With more complex code, I've been able to have an empty body tag or to omit it entirely, and have it run fine. This very simple code works in an html file only if I put the script in the body, unlike previous files I've worked with.
type: Comment
comment on: http://stackoverflow.com/a/24765354

http://stackoverflow.com/a/25663485
downvote count: 0
answers question: http://stackoverflow.com/q/24806006
has body: This is how the request is formated with json as the return format. This works well in ol3. map.on('singleclick', function(evt) { bounds = map.getView().calculateExtent(map.getSize()) var params = { request: "GetFeatureInfo", exceptions: "application/vnd.ogc.se_xml", bbox: bounds.join(','), x: parseInt(evt.pixel[0], 10), y: parseInt(evt.pixel[1], 10), info_format: 'application/json', query_layers: getLayers(), feature_count: 70, buffer: 5, srs: 'EPSG:27700', layers: getLayers(), styles: '', width: map.getSize()[0], height: map.getSize()[1] }; $.ajax({url: GeoServerURL, data: params, type: 'POST', dataType: 'json', success: function (response) { //I couldn't get the response to be read as a GML file so changed it to geoJSON Results = response; if (response.features.length === 0) { return; } setPopup(response,evt,0); } }); });
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/24800511
answer count: 7
linked to: http://stackoverflow.com/q/29960764
favorite count: 0
has answer: http://stackoverflow.com/a/72918989
possible better answer: http://stackoverflow.com/a/46399026
has answer: http://stackoverflow.com/a/46399026
has answer: http://stackoverflow.com/a/61515195
has answer: http://stackoverflow.com/a/66880496
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40054815
has comment: http://stackoverflow.com/comment/40111756
has title: How can I easily get access to form data in Express js?
type: Question
upvote count: 102
accepted answer: http://stackoverflow.com/a/24800648
score: 101
has body: I have a POST request with very simple and small amount of form data. How can I most easily access it? Many tutorials/posts etc talk about bodyParser, but this is no longer bundled with Express. Other places (blogs etc) recommend using urlencoded directly, but now this is not available either. Trying to find accurate information on these frameworks or technologies is doing my head in. Can someone please tell me the recommended (up to date) way to get POSTed form data in Express?
tagged with: javascript
has answer: http://stackoverflow.com/a/69689301
tagged with: node.js-connect
tagged with: express
has comment: http://stackoverflow.com/comment/40090781
linked to: http://stackoverflow.com/q/30126189
has answer: http://stackoverflow.com/a/44393295
has answer: http://stackoverflow.com/a/24800648
downvote count: 1

http://stackoverflow.com/comment/38513075
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24810513
has text: Oh no I stand corrected. I didn't see your example link. Thanks for the code!

http://stackoverflow.com/a/24866274
has body: First, when you are creating the view, you should set your el to #chart-summary. MyApp.View.Item = Backbone.View.extend({ el: '#cart-summary' (your other stuff) }); and try changing display function as follows display: function() { this.render(); },
has comment: http://stackoverflow.com/comment/38618419
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24865563
answers question: http://stackoverflow.com/q/24865563
has comment: http://stackoverflow.com/comment/38618743
upvote count: 2

http://stackoverflow.com/q/24832316
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/24895382
tagged with: javascript
has title: Get full file path including file's name from an uploaded file in C#
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has body: I have this web application project which requires a better user-interface and I am doing it by C#. I already have my html file with JS done but I need some data from user. In my JS embedded in HTML file, I used the code below to find the file on local driver and get the data from that excel file and then put all these data into an array. var excel = new ActiveXObject("Excel.Application"); var excel_file = excel.Workbooks.Open(file1); var excel_sheet = excel.Worksheets("Sheet1"); However, the "file1" you see above seems to require a full name path,say "C:\test.xls" in my case. I am new to C# and just built a button on my form design, by clicking the button, I seem to be able to browse my local file. private void button1_Click(object sender, EventArgs e) { int size = -1; DialogResult result = openFileDialog1.ShowDialog(); // Show the dialog. if (result == DialogResult.OK) // Test result. { string file = openFileDialog1.FileName; try { string text = File.ReadAllText(file); size = text.Length; } catch (IOException) { } System.Diagnostics.Process.Start(file); } Console.WriteLine(size); // &lt;-- Shows file size in debugging mode. Console.WriteLine(result); // &lt;-- For debugging use. } So, my question: How can I get this kind of full file path of an uploaded file in C# ? And furthermore, it would be awesome if some one can tell me how to get this value into my javascript or HTML! Thank you in advance
type: Question
tagged with: c#
has answer: http://stackoverflow.com/a/24832480
has comment: http://stackoverflow.com/comment/38553957

http://stackoverflow.com/q/24790208
has body: I have the following code for table using displaytag in my jsp page &lt;display:table id="xyz" name="XYZ"&gt; &lt;display:column title="Col1" property="name"&gt;&lt;/display:column&gt; &lt;display:column title="Col2" format="{0,date,MM-dd-yyyy}" property="date1"/&gt; &lt;/display:table&gt; Now i want to add another column dynamically(say date2) which should happen only if the resultset returned from database contains date2 column in it. Is there any way to accomplish this?
tagged with: spring
has answer: http://stackoverflow.com/a/24795233
type: Question
tagged with: javascript
tagged with: displaytag
has title: Adding a new column in a table(grid) using displaytag
score: 0
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/comment/38499336
has text: I took the scroller and moved it up and down and got a lot of outputs from the console.logs inside.
score: 0
comment on: http://stackoverflow.com/q/24800864
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38657040
score: 0
comment on: http://stackoverflow.com/q/24886892
type: QuestionComment
type: Comment
has text: @adeneo - with a statement like that, I think a link to the exact part of their policy that you are violating is required.

http://stackoverflow.com/comment/38459909
has text: See what the value of this is if you put it in your Controller Action/Method... string s = Request.Cookies["username"];
comment on: http://stackoverflow.com/a/24782557
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/134764228
score: 1
has text: This solution appears to be more type safe as well. With filter().map() typescript didn't seem to be able to figure out what was excluded properly.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/55260552

http://stackoverflow.com/a/24785138
answers question: http://stackoverflow.com/q/24785008
upvote count: 1
type: AcceptedAnswer
has body: The issue is your toString method. It isn't what you think. Just pass end to alert() instead. alert(end); The toString() you were using was window.toString. I don't know if that's a standard method, but it's basically a shortcut for Object.prototype.toString. When calling Object.prototype.toStirng, it expects its this value to be some object for which it will return its internal Class property. Because you didn't set the this value, it returned [object Undefined] since you're in strict mode. If you had done this instead: toString.call(end) it would have returned [object String], which would have been correct, but not what you wanted.
type: Answer
has comment: http://stackoverflow.com/comment/38464962
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/24785008

http://stackoverflow.com/comment/38429016
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24766146
has text: Can you post an example showing your issue. The reason someone probably made angular-masonry is because a directive was probably needed which is common with jquery plugins.
type: Comment

http://stackoverflow.com/comment/38661412
type: Comment
score: 0
has text: Any errors in console?
type: QuestionComment
comment on: http://stackoverflow.com/q/24889073

http://stackoverflow.com/comment/38541763
type: QuestionComment
comment on: http://stackoverflow.com/q/24826019
score: 0
has text: Because i tried to it without it but it did not respond
type: Comment

http://stackoverflow.com/comment/38463483
type: Comment
comment on: http://stackoverflow.com/a/24784410
type: AnswerComment
has text: $scope.selectedDpt always returns originally initialized value, which is $scope.departaments[0], even though it should return $scope.departaments[1]
score: 0

http://stackoverflow.com/q/24900781
has answer: http://stackoverflow.com/a/24900820
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/24900830
type: Question
tagged with: forms
has comment: http://stackoverflow.com/comment/38683805
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/24900819
score: 0
has answer: http://stackoverflow.com/a/24900829
has title: Stopping Form Submission
tagged with: submit
has body: So, I have a form, i.e. &lt;form method="post" action="url" blah blah blah"&gt; &lt;input type="text" name="dollars" id="dollars"&gt; &lt;input type="text" name="cents" id="cents"&gt; &lt;input id="checkout" type="submit"&gt; &lt;/form&gt; However, if "dollars and cents" don't meet certain criteria, I want the form to stop and not submit, so I have put in the following jQuery: $(document).ready(function () { $('#checkout').click(function () { //set variables var dollars = $('#dollars').val(); var cents = $('#cents').val(); if (dollars &lt; 5 || cents &lt; 5) { alert("You can't do that."); return false; } }); }); While the alert works fine, the form still submits. What can I do to make the form not submit?
has answer: http://stackoverflow.com/a/24900808
answer count: 5
type: UnansweredQuestion

http://stackoverflow.com/q/24903212
answer count: 2
tagged with: difference
tagged with: function
has answer: http://stackoverflow.com/a/24903384
downvote count: 1
tagged with: javascript
has body: I want to know the difference between declaration of this two function in angular controller function demo() { }; scope.demo = function() { }; Whether this two function are similar in performance or not?,Which one is the better option? I know only one difference that watch can be applied to a function which is in the scope means angular directive or element can't call javascript function.
tagged with: angularjs
upvote count: 4
has comment: http://stackoverflow.com/comment/38688482
tagged with: angularjs-controller
type: UnansweredQuestion
favorite count: 0
type: Question
score: 3
has answer: http://stackoverflow.com/a/24903489
has title: Difference of function(javascript) vs scope.function(angular function) defined in controller

http://stackoverflow.com/comment/38656653
comment on: http://stackoverflow.com/q/24884927
score: 2
has text: I think the query params are not available by default on 1.6.0. Now they are only available on the beta builds 1.7.x-beta
type: QuestionComment
type: Comment

http://stackoverflow.com/q/24867438
type: Question
answer count: 2
has body: For example in my collection classes I call a method called test to artificially populate my collections. I want this method to be accessible to all my collections. I'm sure there are multiple ways to do this but which way is de-facto? FYI, the this is the method: test: function () { var models = [], Model = this.model; _.times(8, function (n) { models.push(new Model({id: (n + 1)})); }); this.set(models); }
tagged with: javascript
score: 0
has title: How can I create super classes in Backbone?
tagged with: backbone.js
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24867546
has answer: http://stackoverflow.com/a/24867616

http://stackoverflow.com/comment/38481289
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24793142
has text: I noticed the following. It now works if I run this on my desktop pc but if I run this command inside the app on Android it does only add the root node
score: 0

http://stackoverflow.com/comment/38592530
comment on: http://stackoverflow.com/a/24851457
has text: Thanks for ur reply..But its not working, `Uncaught TypeError: Cannot read property 'addItem' of undefined`
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/q/24813234
has comment: http://stackoverflow.com/comment/38541133
has comment: http://stackoverflow.com/comment/38518237
has comment: http://stackoverflow.com/comment/38518816
has comment: http://stackoverflow.com/comment/38519113
has comment: http://stackoverflow.com/comment/38518409
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/38519402
has comment: http://stackoverflow.com/comment/38518212
has title: Update multiple div from json file every sec without page flicker
has comment: http://stackoverflow.com/comment/38518068
has comment: http://stackoverflow.com/comment/38518089
tagged with: javascript
has comment: http://stackoverflow.com/comment/38519549
tagged with: jquery
has comment: http://stackoverflow.com/comment/38519021
has comment: http://stackoverflow.com/comment/38541357
has comment: http://stackoverflow.com/comment/38518143
has comment: http://stackoverflow.com/comment/38518267
has comment: http://stackoverflow.com/comment/38518449
has comment: http://stackoverflow.com/comment/38518653
has comment: http://stackoverflow.com/comment/38519246
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38519155
upvote count: 1
has answer: http://stackoverflow.com/a/24813354
has comment: http://stackoverflow.com/comment/38519266
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has comment: http://stackoverflow.com/comment/38518598
has comment: http://stackoverflow.com/comment/38550646
has comment: http://stackoverflow.com/comment/38519535
has answer: http://stackoverflow.com/a/24813916
has comment: http://stackoverflow.com/comment/38518253
has comment: http://stackoverflow.com/comment/38519377
favorite count: 0
has body: I wrote the script below to get values from a Json file that is stored inside a industrial automation equipment. The script is inside a HTML page that is stored in a PC and replaces Div contents based on its ID. Note: I can't run any code on the industrial equipment. This is not a "real server". It just stores Json files and update its values based in real sensors. Script inside index.html ensaio.json file callback({ 'Inicia': ':="ENSAIO".CMDS.LIBERA:', 'Rearme': ':="ENSAIO".CMDS.RESET:', 'Nro_Serie': ':="ENSAIO".Nro_Serie:', 'Modelo': ':="ENSAIO".Modelo:', 'Nro_Ensaio': ':="ENSAIO".Nro_Ensaio:', 'Pronto': ':="ENSAIO".Pronto:', 'Data': ':="ENSAIO".Data:', 'Hora': ':="ENSAIO".Hora:', 'SP_Pelotas': ':="ENSAIO".SP_Pelotas:', 'PV_Pelotas': ':="ENSAIO".PV_Pelotas:', 'Status': ':="ENSAIO".Status:' }); When I open index.html in a browser I can view all values on the places that I really want, but I need a way to get this values refreshed. I tried to refresh the page using the script below, but div values flickers every time. How can I update div contents from the Json file every second without flickering the page? Very important Information: I can't enable cross-domain requests on this "server". More information about creating pages for this equipment here! http://www.dmcinfo.com/latest-thinking/blog/articletype/articleview/articleid/8567/siemens-s7-1200-web-server-tutorial--from-getting-started-to-html5-user-defined-pages Thanks! I tryed to do this script below. Ensaio.json Content callback({ 'Inicia': '0', 'Rearme': '0', 'Nro_Serie': '010', 'Modelo': 'CPT001', 'Nro_Ensaio': '138', 'Pronto': '0', 'Data': '18-07-2014', 'Hora': '10-02', 'SP_Pelotas': '40', 'PV_Pelotas': '1', 'Status': 'ENSAIO', 'Nome': 'Test', 'Descricao': 'Test1' });
has comment: http://stackoverflow.com/comment/38519331
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38519363
has comment: http://stackoverflow.com/comment/38518012
has comment: http://stackoverflow.com/comment/38517932
has comment: http://stackoverflow.com/comment/38550971
has comment: http://stackoverflow.com/comment/38518724
has comment: http://stackoverflow.com/comment/38518711
has comment: http://stackoverflow.com/comment/38549818

http://stackoverflow.com/comment/38651103
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24883674
has text: Those are two different things. You want `propA` and `propB` properties of the *same* object or different?

http://stackoverflow.com/comment/38659583
type: Comment
type: QuestionComment
has text: [Promises!](http://spion.github.io/posts/why-i-am-switching-to-promises.html)
comment on: http://stackoverflow.com/q/24886220
score: 0

selector
tags question: http://stackoverflow.com/q/24855298
type: Tag
tag name: selector

http://stackoverflow.com/a/24899560
has comment: http://stackoverflow.com/comment/38681838
answers question: http://stackoverflow.com/q/24899527
has comment: http://stackoverflow.com/comment/38681610
type: Answer
has comment: http://stackoverflow.com/comment/38681592
has body: Use parseFloat(...), i.e. var rate = parseFloat(document.getElementById(rate).value); var numunit = parseFloat(document.getElementById(numunit).value)); var sum = numunit * rate; Also there is a typo in one call to your function, i.e. "caclulateLineTotal" instead of "calculateLineTotal" Also, don't set the total variable again, i.e. don't do var total = parseFloat(document.getElementById(total).value); Also, note that your second call to calculateLineTotal, i.e. for element Rate1 is missing a closing ' after Rate1 should be &lt;input class="text" type="number" name="Rate1" id="Rate1" value="0.00" onchange="calculateLineTotal('NumUnit1','Rate1','Total1');"/&gt;
has comment: http://stackoverflow.com/comment/38681693
has comment: http://stackoverflow.com/comment/38681441
has comment: http://stackoverflow.com/comment/38681896
has comment: http://stackoverflow.com/comment/38681406
score: 0
has comment: http://stackoverflow.com/comment/38681993

http://stackoverflow.com/a/24801541
accepted answer of: http://stackoverflow.com/q/24801263
answers question: http://stackoverflow.com/q/24801263
has comment: http://stackoverflow.com/comment/38495910
upvote count: 1
downvote count: 1
has body: I hope this is what your looking for $(document).ready(function(){ function update() { var tasks_time = $('#tasks_time').slider('value'); $("#curr-tasks_time").text(tasks_time); if( tasks_time == '1') { $('.para').css("color","red"); } if( tasks_time == '2') { $('.para').css("color","blue"); } } $( "#tasks_time" ).slider({ range: "min", value: 1, min: 1, max: 10, slide: function() { update(); } }); }); Fiddle : http://jsfiddle.net/EAaLK/1070/
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38495504
type: Answer

http://stackoverflow.com/a/24764012
score: 0
answers question: http://stackoverflow.com/q/24763738
type: Answer
has body: Assuming for whatever reason you "need" to do this in the view, you could use the init to set a variable to the return of your get function, and set the model to that value &lt;div ng-controller="MyCtrl"&gt; &lt;input ng-model="whatever.value" ng-init="whatever = get(true)" /&gt; {{var1}} {{whatever}} &lt;/div&gt; function MyCtrl($scope) { $scope.var1 = { value: "hello" }; $scope.var2 = { value: "hello2" }; $scope.get = function (bool) { return (bool) ? $scope.var1 : $scope.var2; }; } http://jsfiddle.net/dPn3A/ Otherwise, just do it in the controller.

drupal
type: Tag
tags question: http://stackoverflow.com/q/24785534
tags question: http://stackoverflow.com/q/24785644
tag name: drupal
tags question: http://stackoverflow.com/q/24762209
tags question: http://stackoverflow.com/q/24759930

http://stackoverflow.com/comment/38561361
has text: Unfortunately, it seems like this is caused by a bug in WebKit-based browsers (see [this answer](http://stackoverflow.com/a/18427979/406249)). I tried Safari, Chrome, and Firefox, and the issue only appeared on Chrome and Firefox. Unfortunately, there is not much you can do besides not adding styles, waiting for a fix, or removing the extra HTML. If you would like to remove the extra HTML, you may find [Working around Chrome's contenteditable span bug](http://www.neotericdesign.com/blog/2013/3/working-around-chrome-s-contenteditable-span-bug) helpful.
type: Comment
score: 1
comment on: http://stackoverflow.com/q/24836165
type: QuestionComment

http://stackoverflow.com/a/24861752
score: 0
accepted answer of: http://stackoverflow.com/q/24861003
type: Answer
has body: You have a lot of mistakes in your code. I've modified your Javascript and HTML, please make a comparison of both the old one and the new one to see what was modified and for you to know what you have been doing wrong. rock = 1 paper = 2 scissors = 3
has comment: http://stackoverflow.com/comment/38611930
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24861003

http://stackoverflow.com/comment/38686725
comment on: http://stackoverflow.com/q/24901802
type: Comment
type: QuestionComment
score: 0
has text: @ Manwal its not working

http://stackoverflow.com/q/24838910
tagged with: innerhtml
has answer: http://stackoverflow.com/a/24839185
has comment: http://stackoverflow.com/comment/38565768
has answer: http://stackoverflow.com/a/24838949
has comment: http://stackoverflow.com/comment/38565750
type: Question
has comment: http://stackoverflow.com/comment/38565856
answer count: 2
has comment: http://stackoverflow.com/comment/38565782
tagged with: function
has body: Can i pass a function to innerHTML ?? I thought of passing a function name data() to the innerHTML. Is it possible ?? I want a button to be created and that button should display a table when clicked. Try it
has title: Passing function to innerHTML
tagged with: javascript
score: 0
type: UnansweredQuestion

http://stackoverflow.com/a/24822450
has comment: http://stackoverflow.com/comment/38534900
has comment: http://stackoverflow.com/comment/38534965
has body: Try like this: DEMO CSS: ol.c {list-style-type:upper-roman;} ol.d {list-style-type:lower-alpha;} li{position: relative;} li:before{position: absolute; left: -13px; content: ')'; background:white;} Output will be like this: vi) Test vii) Test viii) Test Updated Fiddle Demo CSS: ol { counter-reset: listCounter 4; list-style-type:none; } ol.c li:before { content:"(" counter(listCounter, upper-roman)") "; } Output will be like this: (vi) Test (vii) Test (viii) Test Hope this helps
has comment: http://stackoverflow.com/comment/38538466
answers question: http://stackoverflow.com/q/24822087
has comment: http://stackoverflow.com/comment/38541610
has comment: http://stackoverflow.com/comment/38535284
upvote count: 2
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/a/24899875
accepted answer of: http://stackoverflow.com/q/24899637
type: Answer
answers question: http://stackoverflow.com/q/24899637
has comment: http://stackoverflow.com/comment/38682419
upvote count: 1
has comment: http://stackoverflow.com/comment/38682090
has body: First some notes about your CSS in general: Only put the prefixes of the vendor inside of the prefixed keyframe animation, meaning only -webkit-transform in your @-webkit-keyframes etc. You can reuse a keyframe by separating the values by a comma, so you can have 0%, 50%, 100% { ... do something ... } instead of having three separate ones Since you're not viewing the back at all, backface-visibility is not needed. On the same note, visible is the default value so you don't have to state it most of the time Avoid !importants as they are hard to change later. Always opt for using selector specificity over them Always put the unprefixed properties after the prefixed ones, so -webkit-animation should come before animation because you want things to be as standard across browsers as possible Try to keep your code clean looking, it really does help later on and also helps others working with you or after you Now for your actual problem: The perspectivefunction is only supported in Webkit browsers. The perspective function is the one inside of a transform, like so: -webkit-transform: perspective(n) As a result, you should apply perspective by instead using the perspective property on the parent instead. In this case that would mean the body element, but a more specific parent would generally be better. Here's a cleaned up version of your code with it working As KingKing noted in his comment below, you can also fix this by applying perspective(0) rotate3d(0,1,0,0) on the parent. Demo of that, but it's more preferable to use the more standard perspective property. For others looking later, your problem may not be exactly the same. Most CSS rendering issues are caused by the lack of hardware acceleration, which you can force using transform: translateZ(1px) (with prefix) or in the future by using the will-change property
has comment: http://stackoverflow.com/comment/38682518
score: 1
has comment: http://stackoverflow.com/comment/38682107
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/124787264
type: AnswerComment
comment on: http://stackoverflow.com/a/47449302
type: Comment
has text: How would I set it to just the date, rather than the date and time? What's the best way of removing the time element?
score: 1

http://stackoverflow.com/a/24829047
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38548017
has comment: http://stackoverflow.com/comment/38548263
has body: You should use an iframe and keep the audio player outside of it, so the user does not navigate the entire page but only in the iframe Basic example:
type: Answer
accepted answer of: http://stackoverflow.com/q/24828989
answers question: http://stackoverflow.com/q/24828989
has comment: http://stackoverflow.com/comment/38547793
score: 0

http://stackoverflow.com/a/48773975
score: 3
downvote count: 0
has body: I can't comment above but instead of using JS to set the height on every window resize (if you have a flexible width), just use CSS instead. .container { position: relative; padding-top: 56.26%; } .video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #f00; } &lt;div class="container"&gt; &lt;div class="video"&gt;&lt;/div&gt; &lt;/div&gt;
answers question: http://stackoverflow.com/q/24807549
upvote count: 3
has comment: http://stackoverflow.com/comment/129958894
type: Answer

http://stackoverflow.com/comment/38434734
has text: Async isn't anything in the Firebase docs. Could you share what you're doing with the Async code? I imagine you're just creating a Firebase reference from a root location.
comment on: http://stackoverflow.com/q/24768379
score: 2
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38582523
has text: you're welcome, please accept the answer by clicking the check-mark beside my answer, if this answer is in fact what you were looking for. ;)
comment on: http://stackoverflow.com/a/24847651
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/128423431
score: 4
type: AnswerComment
has text: These config properties can also be included in `jest.config.js` if you have a lot of configs that you don't want cluttering up the `package.json` file. See Jest docs: https://jestjs.io/docs/configuration
type: Comment
comment on: http://stackoverflow.com/a/64730192

http://stackoverflow.com/comment/38403800
type: AnswerComment
score: 0
type: Comment
has text: Periods is the field to determine the deposit period i.e., 365 days/730 days/1095 days/1460 days & 1825 days.
comment on: http://stackoverflow.com/a/24752737

http://stackoverflow.com/q/24815616
upvote count: 0
has answer: http://stackoverflow.com/a/24815705
favorite count: 0
has comment: http://stackoverflow.com/comment/38522692
has comment: http://stackoverflow.com/comment/38522467
type: UnansweredQuestion
score: -3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38522641
has comment: http://stackoverflow.com/comment/38523140
has comment: http://stackoverflow.com/comment/38522908
has body: I am managing a web site that has hundreds of html pages, and each page is devoted to a different article. I would like to include an email link on each page, and I would like to use an external js script so that it is not necessary to change each individual page. Perhaps there is something that may be placed on the pages around the name of the article ? I am using the following code, and I would like to know how to modify it so that when the email link is clicked, the email message Subject line should automatically include the name of the article, which is different on each page, in this example: Igneous Rocks Please let me know if this is possible, and what code to use, thanks. Email link to this page Igneous rocks etc, etc...
downvote count: 3
type: Question
has title: Automatically pre-populate different Subject Line in mailto from text in different html pages with external js
tagged with: javascript
has answer: http://stackoverflow.com/a/24815704
has comment: http://stackoverflow.com/comment/38523078
answer count: 2

http://stackoverflow.com/comment/38441924
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24769991
type: AnswerComment
has text: does not work, this is the console output Server running at 8124 ad: undefined http.js:853 throw new TypeError('first argument must be a string or Buffer'); ^ TypeError: first argument must be a string or Buffer at ServerResponse.OutgoingMessage.write (http.js:853:11) at IncomingMessage.<anonymous> (/home/overflow/Scrivania/nodeweather/app.js:15:13) at IncomingMessage.EventEmitter.emit (events.js:117:20) at _stream_readable.js:920:16 at process._tickCallback (node.js:415:13)

http://stackoverflow.com/comment/38577780
comment on: http://stackoverflow.com/a/24843848
type: Comment
has text: Semi-colons are required for separating statements and method calls (like the call to `keypress`), but not for function definitions. JS interpreters don't mind if you leave it out at the end of a line, but if your JS file were minified (as many are when deployed to a Prod server), then whitespace is removed to reduce file size. Then your code would produce syntax errors because of the lack of semi-colon(s).
type: AnswerComment
score: 0

http://stackoverflow.com/comment/84086487
type: Comment
score: 1
has text: Actually, it worked with `browser.get('')` but only after adding `browser.ignoreSynchronization = true;` inside `onPrepare`.
comment on: http://stackoverflow.com/a/31181058
type: AnswerComment

http://stackoverflow.com/a/24839265
type: Answer
upvote count: 5
has body: Placing logic in HTML using directives in angular is a good way. You cannot take full advantage of angular without placing logic in HTML. Controllers should contain view logic, but shouldn’t actually reference the DOM (referencing the DOM should only be done through directives). ref Two things to remember or the best practices for AngularJS are Treat the scope as read-only in views Treat the scope as write-only in controllers ref Since you are placing logic in HTML, if you treat it as read-only, you can check conditions or extract data using functions in scope, but the original data model isn't disturbed whatever you do in HTML. Also tying dom elements to specific directives are the most powerful features of angular. When you use a datepicker, in jQuery, you could do as follows: &lt;div id="datepicker"&gt;&lt;/div&gt; then in JS: jQuery('#datepicker').datepicker({ start:'today', end:'tomorrow', showTime:true }) You can do this in angular way as follows This way even when a designer or someone who reads HTML will be able to read what and even you can pass the options from the element's attributes itself. &lt;div date-picker start="today" end="tomorrow" show-time="true"&gt;&lt;/div&gt; AngularJS's importance itself is declarative syntax and can contain expressions as attribute values like you posted. That is not at all a bad practice. Indeed it is common and good practice all developers do. Using logic in HTML in angularjs saves a lot of code writing by ourselves. All the heavylifting is done by angular behind the scenes. See some best practices about AngularJS
score: 5
downvote count: 0
answers question: http://stackoverflow.com/q/24838964

http://stackoverflow.com/comment/38699196
comment on: http://stackoverflow.com/q/24909155
score: 0
type: Comment
has text: Your question is unclear. Please improve it.
type: QuestionComment

http://stackoverflow.com/q/24799366
has title: Why does "../" on location.href gives different results?
tagged with: maven
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24799424
type: Question
tagged with: alfresco-share
tagged with: javascript
has body: I am trying to open a jnlp-file with simple href in javascript from Alfresco Share. My code: location.href = "../res/components/javawebstart/AEF_JNLP.jnlp"; Result on localhost (working): http://localhost:8081/share/res/components/javawebstart/AEF_JNLP.jnlp Result on test environment (not working): http://t1aetest:9080/share/page/context/res/components/javawebstart/AEF_JNLP.jnlp Can anyone help me?
score: 0
tagged with: alfresco
accepted answer: http://stackoverflow.com/a/24799424
answer count: 1

http://stackoverflow.com/q/24803424
has body: I am working on a HTML Webpage with CSS and Ajax. I would like to add an image and I know I can do it by adding the image in a folder inside my project or add it with an URL so which one is better method to use, I mean what should be the inconvinients of each method that would make me prefer one to the other ?
has comment: http://stackoverflow.com/comment/38498897
tagged with: javascript
has comment: http://stackoverflow.com/comment/38498810
tagged with: image
score: 0
accepted answer: http://stackoverflow.com/a/24803507
answer count: 1
favorite count: 0
has title: add image CSS : local file or url?
has comment: http://stackoverflow.com/comment/38498998
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38498847
has comment: http://stackoverflow.com/comment/38498828
has answer: http://stackoverflow.com/a/24803507
has comment: http://stackoverflow.com/comment/38498901
upvote count: 1
downvote count: 1
type: Question

http://stackoverflow.com/a/24846704
has body: Charlie's suggestion of CSS3 transitions is a good one, since they probably offer the most flexibility as to the precise details of the animation and are often smoother than jQuery animations. Only trick with them is that you can't animate an element to/from display: none (and note that jQuery's .hide() sets display to none, meaning you can't combine an animation with these jQuery methods). There are a lot of other ways to do it, however. See, e.g., this blog post that discusses the issue. You can also have the "hidden" state translated a couple thousand pixels offscreen and the "visible" state set to transform: initial. Note that if you use this solution, you'll probably need to use some sort of custom bezier curve for the transition timing function (for which this tool might be helpful).
answers question: http://stackoverflow.com/q/24846471
type: Answer
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/a/73409249
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/24902061
has body: Yes, this is 100% possible with JavaScript! You can Skip to the end for the solution directly or read this for a detailed explanation. The Approach The solution depends on how you want to implement it as the runtime environment comes into play. Browsers implement runtime environments that enforce ECMAScript standards they adopt while Node.js is a fork on V8 and has it's own modules that deals with how standard Below, I will take a use case and give two solutions and direct solution to the example problem of your question: An Universal Solution that you can implement and it will work on the browser AND on Node.js Node.js specific solution. Solution to the exact Use Case of OP. Note: This will also help those studying Data Structures and trying to do a JavaScript implementation. The Problem Let's take a Use Case similar to the OP's use case to understand this better. Suppose you are building the Array Data Structure from scratch as a custom xArray constructor. For simplicity let's only implement the push method so we can push some data and then try to output the result exactly the way the JavaScript Array constructor creates objects and the prints the array when we console.log the object or return it from a function. We will also need the static method XArray.isArray(input) so we can test if the instance of the object is the same as the constructor. If we simply console.log the Object without adding the solution, we will get something that looks like: Undesired Solution: const xArray = new XArray(); xArray.push('a', 'b', 'c', 'd', 'e'); console.log(xArray); // Prints: XArray { '0': 'a', '1': 'b', '2': 'c', '3': 'd', '4': 'e' } But that's not what we want. We need the Object.values(xArray) just like in the OP's use case, user.name is required as the output and not the whole User { name: 'example', password: 'password' } So, instead, this is the output we want: Desired Solution: // Test function that takes an array and returns it. const returnArr = array => array; /****…
downvote count: 0
type: Answer

http://stackoverflow.com/comment/38575270
type: QuestionComment
has text: You are calling function `showMenu` and `hideMenu` even when they are not define. You put them on `onLoad` event. Now, when I changed to `No wrap - in head`, it works. [Demo](http://jsfiddle.net/L4Hzw/6/)
comment on: http://stackoverflow.com/q/24843940
score: 1
type: Comment

http://stackoverflow.com/a/24887449
has body: Partly working solution to get you started: http://jsfiddle.net/nYw35/4/ $(document).scroll(function () { var scroll_top = $(document).scrollTop(); var one_top = $('#menu1').position().top; var two_top = $('#menu2').position().top; if (scroll_top &gt; one_top &amp;&amp; scroll_top &lt; two_top) { $('a[href="#menu1"]').removeClass('active'); $('a[href="#menu2"]').addClass('active'); } });
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24887258

http://stackoverflow.com/comment/38524299
type: Comment
type: QuestionComment
score: 0
has text: @charlietfl Thanks. But I gave try to the accepted answer as it clearly described what I've got to do and also I could understand it better with the explanation provided. However, your suggestion could be valuable to somebody who has better idea of how ajax call is done. Hence, upvoting. :)
comment on: http://stackoverflow.com/q/24808800

http://stackoverflow.com/a/24893982
score: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24893487
answers question: http://stackoverflow.com/q/24893487
type: Answer
upvote count: 2
has body: You use a very old underscore version - 1.1.6 (current version is 1.6.0). Backbone uses this library, but _.has method was introduces in underscore at 1.3.1 and is absent in 1.1.6. I think, this caused error. Just use latest underscore and error should gone away. UPDATE Also it whould be better to use latest jQuery as well

http://stackoverflow.com/q/24806167
has comment: http://stackoverflow.com/comment/38504510
favorite count: 0
possible better answer: http://stackoverflow.com/a/69181823
type: Question
answer count: 2
score: 5
has answer: http://stackoverflow.com/a/69181823
has title: Save Canvas With A Custom File Name
has body: I have the following code to save what is on the canvas to a file, but when it saves it saves as download as the file name. What can I do to use a custom filename instead of download? // Get the Canvas var ctx = document.getElementById("myChart").getContext("2d"); // Handle Saving the Canvas $(document).on("click", "#save-graph", function(e){ e.preventDefault(); var image = ctx.canvas.toDataURL("image/png").replace("image/png", "image/octet-stream"); window.location.href = image; });
accepted answer: http://stackoverflow.com/a/24806516
has comment: http://stackoverflow.com/comment/38504340
upvote count: 5
tagged with: canvas
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/11112321
has answer: http://stackoverflow.com/a/24806516
type: AnsweredQuestion

http://stackoverflow.com/comment/38675726
has text: In general, events are for when multiple things need to know an even occurred. If only one part of your code needs to be alerted to something, a function call fits better.
score: 4
comment on: http://stackoverflow.com/q/24896663
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38628889
has text: how are you calling servlet? just pass it as query params. `setletPath?computerName=xyz`
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24871661
score: 2

http://stackoverflow.com/comment/38449352
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24776340
has text: It seems that the message is clear. You have created a loop. When EventsTest is loaded, it calls `testfun(that)`, where that is EventsTest. replace `testfun(that)` by `testfun(alert("foo"))`.

http://stackoverflow.com/a/24794687
answers question: http://stackoverflow.com/q/24793197
type: Answer
score: 2
downvote count: 0
has body: If you could add the ng-model from the server side, it will have a better performance. But in case you really want to do it in client-side, you could write a custom directive that will add the ng-model automatically at compile time like this: app.directive('myModel', function($compile) { return { restrict: 'A', replace: false, priority: 1000, terminal: true, // these terminal and a high priority will stop all other directive from being compiled at first run link: function (scope, element, attrs) { attrs.$set('ngModel', attrs.name); // set value of ng-model to be the same as the name attribute attrs.$set('myModel', null); // remove itself to avoid a recusion $compile(element)(scope); // begin compiling other directives } }; }); and use it like this: &lt;input type="text" name="myinputname" my-model /&gt; after the first compilation it will automatically become: &lt;input type="text" name="myinputname" ng-model="myinputname" /&gt; Plunker example: http://plnkr.co/edit/hBQQMDTr6cYtHzFvoAaQ?p=preview
upvote count: 2

http://stackoverflow.com/a/24879884
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24875567
type: Answer
score: 1
upvote count: 1
has body: As mentioned in the answer referenced in the other answer, the ID of the handler trigger source is included in the e.parameter properties. You can easily check that using the Logger like below : Logger.log(JSON.stringify(e)); If each button has its own ID you will get this ID with e.parameter.source as a string in the handler function. You don't need to create separate handlers on each button. in your code sample use like this : for (var i=1;i&lt;topManSSData.length;i++){ //for loop conditions to look up relevant data. var projectName = datafromSpreadsheet var editButton = app.createButton("edit").setId("editButton"+i).addClickHandler(editProjectsHandler); projectsPanel.setWidget(row,0,app.createHTML(projectName)).setWidget(row,1, editButton) }
answers question: http://stackoverflow.com/q/24875567

http://stackoverflow.com/q/24764564
type: Question
tagged with: firebase
has body: Sorry if I'm getting the terminology wrong. I'm trying to have a list of movies with dates show in a list that can be ordered by either property. I can do this when working with a local JSON file and $http but as soon as I move to a async implementation the binding fails. Here is an example: http://jsbin.com/nelora/3/edit Any help would be greatly appreciated.
score: 1
has answer: http://stackoverflow.com/a/24764866
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/24764866
has title: angularJS bind async data to ng-repeat orderBy
tagged with: angularjs
type: AnsweredQuestion
upvote count: 1

cell
tags question: http://stackoverflow.com/q/24808751
tag name: cell
tags question: http://stackoverflow.com/q/24875933
type: Tag

http://stackoverflow.com/q/24823000
has comment: http://stackoverflow.com/comment/38536826
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24823325
type: Question
has answer: http://stackoverflow.com/a/24823187
tagged with: underscore.js
score: 0
answer count: 3
has title: Render backbone template when myModel.fetch() is done?
tagged with: javascript
tagged with: jquery
tagged with: backbone.js
has body: Using backbone.js I'm trying to fetch a model from my server and based on that, render an underscore template. I first tried it without using the result of the api call using the following render function: render: function(options) { this.ticketId = options.ticketId; var that = this; var ticketModel = new TicketModel({'id': that.ticketId}); $.when(ticketModel.fetch()).done(function(){ console.log(ticketModel); // this outputs the correct model }); var template = _.template($('#tab-content-template').html(), {ticketId: that.ticketId}); this.$el.html(template); }, This works perfectly well. So I tried using the result of the api call to render the template: render: function(options) { this.ticketId = options.ticketId; var that = this; var ticketModel = new TicketModel({'id': this.ticketId}); $.when(ticketModel.fetch()).done(function(){ console.log(ticketModel); console.log($('#tab-content-template').html()); var template = _.template($('#tab-content-template').html(), {ticketId: that.ticketId}); this.$el.html(template); }); }, but unfortunately, this results in an error saying Uncaugt TypeError: Cannot read property 'html' of undefined. The weird thing is that it outputs the html in the console correctly resulting from console.log($('#tab-content-template').html());. The error I get is on the line which reads this.$el.html(template); How can it be that it first is able to get the html(), and after that it says it can't find the property html? I'm totally stuck here.. :S All tips are welcome!
tagged with: templates
has answer: http://stackoverflow.com/a/24844783

http://stackoverflow.com/a/24885004
score: 1
has body: It is because row is reset every time the loop begins again. function builTable(){ for(i = 0; i< source.Products.length; i++){ var sourceProducts = source.Products[i]; // here is the culprit row = ' sth '; row += sourceProducts.Product; row += ' '; row += sourceProducts.Bookings + ' '; row += sourceProducts.Percentage + '%' + ' '; row += sourceProducts.Transactions + ' '; return row; } }
answers question: http://stackoverflow.com/q/24884904
upvote count: 1
type: Answer
downvote count: 0

backspace
tags question: http://stackoverflow.com/q/24866085
type: Tag
tag name: backspace

http://stackoverflow.com/comment/38623687
type: Comment
comment on: http://stackoverflow.com/a/24850625
score: 1
has text: Yeah, `document` always refers to the root document (outside of all Shadow DOM), even inside the Polymer script code. If you really wanted to you could use `this.shadowRoots['my-app'].querySelector(...)`, but `this.$` is much more idiomatic and DRY.
type: AnswerComment

http://stackoverflow.com/a/24756066
score: 0
type: Answer
has body: You can listen to the map's baselayerchange event instead: map.on('baselayerchange', function (event) { var legend = geomorfologie.getTileJSON().legend; console.log('baselayerchange to ' + event.name); if (event.name === 'Streets') { map.legendControl.removeLegend(legend); } if (event.name === 'Geomorfologie') { map.legendControl.addLegend(legend); } }); DEMO
answers question: http://stackoverflow.com/q/24754609
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24754609

http://stackoverflow.com/comment/38487821
score: 0
comment on: http://stackoverflow.com/q/24796674
type: Comment
type: QuestionComment
has text: sorry, I had a mistake. Now I corrected the post

http://stackoverflow.com/a/25164616
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24834323
type: Answer
downvote count: 0
score: 6
upvote count: 6
accepted answer of: http://stackoverflow.com/q/24834323
has body: Web workers do not provide any dedicated method of finding out what data was posted to them if they fail. But that's quite easy to do manually, you can either handle onerror from outside, or do the deeper inspection in the onmessage handler from inside of the worker (where you have access to the message event): // this one-liner was wrapped in order to improve legibility var w = new Worker( URL.createObjectURL( new Blob([ " self.onmessage = function (evt) {\ console.log(evt.data);\ throw new Error('SOMETHING.WENT.WRONG.'); } " ]) )); w.onerror = function (err) { console.log('worker is suffering!', err) }; w.postMessage(123);

http://stackoverflow.com/comment/38509086
has text: You need to fix this at a lower level. Why isn't SpookifyJS doing any parsing of your data? It's probably coming across in divs that have semantic meaning baked into them. Use that to build your object rather than splitting on newlines.
comment on: http://stackoverflow.com/q/24808278
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/24792823
has body: You don't have to parse it at all; it's a JavaScript object already. The acronym "JSON" stands for JavaScript Object Notation. It's a restricted form of the native syntax in JavaScript for creating objects "on the fly". To say that another way, JavaScript's native object literal syntax is a superset of JSON. What you've typed in there, as the value of your "dataJSON" variable, is a JavaScript object literal expression. The value of such an expression is a reference to an object. No parsing necessary, since the JavaScript parser itself has already done so. edit &mdash; if you really do need a JSON string for testing purposes, then I think the easiest way to do that is to use JSON.stringify() to convert an object into a string, and then pass it into the test code. In your example, that'd look like: dataJSON = JSON.stringify({ "status": "OK", "messages" : [{ "user" : { "id" : "4", "status" : "offline", "name" : "dummy", "pictures" : ["pic.jpg"] }, "message" : "Hey", "timestamp" : 1395660658 }, { "user" : { "id" : "2", "status" : "online", "name" : "dummy1", "pictures" : ["pic1.jpg"] }, "message" : "hello", "timestamp" : 1395660658 }] }); It's a little easier than trying to construct the string by hand because of the "quote quoting" nuisance. Of course the object you pass in should be one that actually can be represented as JSON, but your sample above is definitely OK.
has comment: http://stackoverflow.com/comment/38501781
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24792818
has comment: http://stackoverflow.com/comment/38501455
answers question: http://stackoverflow.com/q/24792818
has comment: http://stackoverflow.com/comment/38519015
has comment: http://stackoverflow.com/comment/38519253
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38501706

http://stackoverflow.com/comment/38425156
has text: i see the problem now, and i couldn't find a work around. i even tried partials and overloading. to fix it, you can either modify the mustache file, specifically the "Context.prototype.lookup()" routine to avoid the "context = context.parent;" part. or, you can change your data before feeding it to the template to remove ambiguous names or insert smoking guns that you can use to trigger empty block behavior.
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/24762700

http://stackoverflow.com/a/25071389
has comment: http://stackoverflow.com/comment/73802604
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/24860198
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24860198
type: Answer
has body: Here's a bit more detail for future questions: The search.list method as stated above can only search ONE channel overall... To go around that: 1) use the channels.list functionality and get the contentDetails of every channel you're working with. 2) In the contentDetails there are playlists in which you can find the upload playlist which is essentially almost the same as the result you get from search.list. 3) Use the playlistItems.list to list the items in the upload playlist. 4) Essentially create functions that list the playlistItems of every channel... You should get separate response objects for each channel and there you go.

http://stackoverflow.com/comment/38521946
type: AnswerComment
has text: I have 2 tag inside my html and its afecting the other button. how do i target only 1 button with id/class of "button_01" ?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24793110

http://stackoverflow.com/a/24843619
type: AcceptedAnswer
downvote count: 0
has body: Here are the 2 appraches : 1. http://jsfiddle.net/xWE3V/ $('.acceptfriend,.rejectfriend').click(function(){ $(this).parent().fadeOut(500); }); 2. http://jsfiddle.net/P6U76/ $('.acceptfriend').click(function(){ $(this).siblings( ".rejectfriend" ).fadeOut(500); $(this).fadeOut(500); }); $('.rejectfriend').click(function(){ $(this).siblings( ".acceptfriend" ).fadeOut(500); $(this).fadeOut(500); });
has comment: http://stackoverflow.com/comment/38574565
type: Answer
accepted answer of: http://stackoverflow.com/q/24843481
upvote count: 1
answers question: http://stackoverflow.com/q/24843481
has comment: http://stackoverflow.com/comment/38574706
score: 1

http://stackoverflow.com/q/24767092
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
has title: grunt-injector - how to use Grunt's 'dynamically built files objects.'?
score: 1
tagged with: gruntjs
type: Question
has answer: http://stackoverflow.com/a/24767270
accepted answer: http://stackoverflow.com/a/24767270
tagged with: javascript
upvote count: 1
answer count: 1
favorite count: 0
has body: Grunt's dynamically built files objects is in the structure of: files: [ { expand: true, // Enable dynamic expansion. cwd: 'lib/', // Src matches are relative to this path. src: ['**/*.js'], // Actual pattern(s) to match. dest: 'build/', // Destination path prefix. ext: '.min.js', // Dest filepaths will have this extension. extDot: 'first' // Extensions in filenames begin after the first dot }, ] But this format does not work in grunt-injector: injector: { options: { destFile : 'app/static/index.html', ignorePath: 'app/' }, local_dependencies: { files: [ expand: true, cwd: 'app/static/css/', src: ['*.css'], dest: '/static/css', ext: '.css' ] } }, Any suggestions on how I can use Grunt's specific 'dynamically built files objects' with it?

http://stackoverflow.com/comment/139628441
type: Comment
comment on: http://stackoverflow.com/a/26559529
has text: How does this answer the question?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38581159
type: AnswerComment
comment on: http://stackoverflow.com/a/24808791
score: 0
type: Comment
has text: That plugin has [an option where you can tune how close the markers must be](https://github.com/jawj/OverlappingMarkerSpiderfier-Leaflet#construction). You'll need to combine your layers to use this or any other plugin: just set different styles for individual items in the layer.

http://stackoverflow.com/q/24907249
has title: How can I save data on the first few tab and submit the data entered on the last tab using Ajax?
has body: I have a form that that is divided into 3 tabs, I want to save the data entered for first and the second tab, and lastly submit the whole data entered for the form at last tab. I couldn't find any close example on this, and i'm doing this for a project. Any help will be really appreciated.
type: Question
score: 3
tagged with: cakephp
accepted answer: http://stackoverflow.com/a/24907500
answer count: 1
has comment: http://stackoverflow.com/comment/38695449
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: ajax
type: AnsweredQuestion
upvote count: 3
has answer: http://stackoverflow.com/a/24907500

http://stackoverflow.com/comment/38438478
score: 1
has text: If you can, I would definitely consider a templating framework like Knockout for this type of work http://knockoutjs.com/
type: Comment
comment on: http://stackoverflow.com/q/24771264
type: QuestionComment

http://stackoverflow.com/q/24789115
has comment: http://stackoverflow.com/comment/38473531
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I am attempting to determine if the TextTrack element of a html video is currently showing or hidden. I took a look at the html specifications and at first glance, the texttracks.mode property would work perfectly according to: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-hidden I tested this property with the following html and code in google chrome version 35.0.1916.153: HTML: &lt;video&gt; &lt;track id="en" kind="subtitles" src="transcript.vtt"&gt;&lt;/track&gt; &lt;source src = "samplevideo.mp4"&gt; &lt;/video&gt; Code: $(video)[0].textTracks[0].mode Initially the code returns a "hidden", as expected, and upon clicking the transcript button on the video player and rerunning the code, it returns "showing". If I toggle the player off after these steps and rerun the code, it still returns "showing" despite the transcripts being hidden on the video. Is there a better way to detect the visible / non-visible state of transcripts on an html5 video player?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38504742
has comment: http://stackoverflow.com/comment/40487909
tagged with: transcription
tagged with: video
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38846709
score: 6
has comment: http://stackoverflow.com/comment/38526622
type: Question
has answer: http://stackoverflow.com/a/26559529
answer count: 1
has title: Tracking HTML5 Video Closed Captions Visibility State
upvote count: 6

http://stackoverflow.com/comment/38562587
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24836812
type: Comment
has text: That's what I've done but it's refusing to recognize the function. Do I need to be hosting the files on a server or does it work locally too?

http://stackoverflow.com/q/24778395
has comment: http://stackoverflow.com/comment/38452242
answer count: 1
tagged with: regex
favorite count: 0
has comment: http://stackoverflow.com/comment/38451486
has comment: http://stackoverflow.com/comment/38451525
has body: This is for the use case of input line which is rather short (on purpose). It supposed to autosend message when the input is full but keep last word in place. I am looking for regex that would fulfill these scenarios: input: "testing" output: [1] - "testing"; [2] - null input: "testing testing" output: [1] - "testing"; [2] - "testing" input: "testing testing testing" output: [1] - "testing testing"; [2] - "testing" input: "testing testing testing " output: [1] - "testing testing"; [2] - "testing " So far I came up with these variants: /(.*)\s+(\w+)/ - closest solution, but doesn't match for one word without spaces /(.*)(?:\s+(\w+))?/ - is not recognizing last word I am not sure how to fulfill all scenarios. Is it even possible ?
type: AnsweredQuestion
score: 0
linked to: http://stackoverflow.com/q/17069122
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/24778542
type: Question
has title: Extracting last word using regex/javascript
accepted answer: http://stackoverflow.com/a/24778542
tagged with: javascript

http://stackoverflow.com/a/24826414
has body: It depends on how the content is loaded. If its just invisible, you can get it this way. But in most cases the content is loaded dynamically, means if the user scrolls to some point, the page sends an ajax request for more content to the server. When the server sends back the data, javascript updates the page. In this case you can't do anything, because it's not possible to send cross-domain ajax-requests.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24826313

http://stackoverflow.com/q/24811353
has answer: http://stackoverflow.com/a/24811423
favorite count: 0
has comment: http://stackoverflow.com/comment/38514223
tagged with: bootstrap-datepicker
type: Question
tagged with: datepicker
has body: I have the following template containing a calendar icon in a javascript file. It doesn't appear in my html file because it's used dynamically. var iconTemplate = '&lt;li id=\"{streamID}\" class=\"list\"&gt;{streamName} &lt;i class="fa fa-calendar pull-right"&gt;&lt;/i&gt;&lt;/li&gt;'; I want to add a click event to the calendar icon and open date picker. I tried the following: $('.fa-calendar').click(function(){ $(this).datepicker(); }); I'm guessing that this doesn't work because it's not calling on a class from the html file. Is it possible to do this all within a javascript file?
upvote count: 3
accepted answer: http://stackoverflow.com/a/24811423
has title: Bootstrap-Datepicker icon click event not working
answer count: 1
tagged with: javascript
tagged with: jquery
type: AnsweredQuestion
score: 3
tagged with: http://stackoverflow.com/tag/html
downvote count: 0

http://stackoverflow.com/comment/38523514
type: QuestionComment
comment on: http://stackoverflow.com/q/24816074
score: 0
has text: you need to put content on $('.modal-body').html('PUT YOUR CONTENT OR RESPONSE');
type: Comment

http://stackoverflow.com/comment/38514333
score: 0
comment on: http://stackoverflow.com/q/24806198
type: Comment
type: QuestionComment
has text: Not sure if this works for you, re-formatting data so that it reflects rendering hierarchy doesn't work here? if you don't want to disturb the original model, you can make a copy of it, do re-format and use it for rendering.

http://stackoverflow.com/comment/38579154
type: QuestionComment
has text: by 'it', you mean a string, or the DOM element itself? Just do a string parse?
score: 0
comment on: http://stackoverflow.com/q/24845835
type: Comment

http://stackoverflow.com/comment/38477994
has text: maybe try doing this: var p = document.createElement("p"); p.id = "add"; body.insertAdjacentHTML("afterbegin", p); instead of document.write
type: AnswerComment
comment on: http://stackoverflow.com/a/24761284
score: 0
type: Comment

http://stackoverflow.com/a/24853570
has body: You can use AngularJS html5 mode https://docs.angularjs.org/guide/$location which takes away the hashbang. Then you need to route all requests to your app to the index.html (which loads angularjs). You need to add exceptions for your static pages routes on your nodeJS app or your webserver, so that the requests for the static pages get handled correctly. That should work allright and keep it an integrated experience for your users.
answers question: http://stackoverflow.com/q/24853493
has comment: http://stackoverflow.com/comment/38594048
score: 0
has comment: http://stackoverflow.com/comment/38594229
type: Answer

http://stackoverflow.com/comment/38603158
comment on: http://stackoverflow.com/a/24858089
type: Comment
has text: @Bala , if Title pops up , on hover , it should stay same ,and user will be able to do Copy and then paste somewhere else
score: 0
type: AnswerComment

http://stackoverflow.com/a/24873933
has body: In your current code you are assigning the RESULT of setInterval() to the interval property. What I would suggest is to wrap the setInterval() call in a function, like this: interval : function() { setInterval(function() { setSlider(); }, 3000); } Then, you should be able to call slider.interval()
upvote count: 2
type: AcceptedAnswer
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/38633358
has comment: http://stackoverflow.com/comment/38633274
score: 1
answers question: http://stackoverflow.com/q/24873807
accepted answer of: http://stackoverflow.com/q/24873807

http://stackoverflow.com/q/24752098
upvote count: 0
answer count: 1
favorite count: 0
tagged with: slicknav
score: -3
tagged with: css
type: AnsweredQuestion
has title: SlickNav menu issue in google Chrome
has comment: http://stackoverflow.com/comment/38402378
downvote count: 3
type: Question
accepted answer: http://stackoverflow.com/a/24752515
tagged with: javascript
has body: Here is my site: http://www.reliableairinc.com, The slickNav responsive menu icon disappears upon re sizing the browser window on dynamic pages. Facing this problem only in chrome.
has answer: http://stackoverflow.com/a/24752515

http://stackoverflow.com/comment/38612836
has text: I think I did something in codebehind which is messing the visibility of my panels. Thanks again.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24863067

http://stackoverflow.com/comment/38519898
type: Comment
type: QuestionComment
has text: [Don't belief them!](http://stackoverflow.com/q/383402/1048572) As all these code snippets show, there are worse thing that can go wrong. [There are better ways](http://stackoverflow.com/a/24020621/1048572) to counter forgotten `new`s.
comment on: http://stackoverflow.com/q/24813533
score: 0

http://stackoverflow.com/a/24791283
has comment: http://stackoverflow.com/comment/56349470
answers question: http://stackoverflow.com/q/24790829
score: 15
upvote count: 15
downvote count: 0
type: Answer
has body: I got it to work with the help of above controls = new THREE.OrbitControls(camera); controls.addEventListener( 'change', light_update ); function light_update() { light.position.copy( camera.position ); } Thanks

http://stackoverflow.com/q/24816784
has comment: http://stackoverflow.com/comment/38524649
type: Question
has comment: http://stackoverflow.com/comment/38524727
has comment: http://stackoverflow.com/comment/38524985
tagged with: javascript
has body: I am making an exercise in which text id drag from div(contain words) then drop them into text-fields (these are 3)..Each field has its own text to be placed .. I have already drag and drop the text but cant able to compare them for particular fields .. Please help me.. Here is my code : verbs noun adjetives I play the guitar The piano is black
upvote count: 2
has comment: http://stackoverflow.com/comment/38524782
answer count: 1
has comment: http://stackoverflow.com/comment/38524693
tagged with: jquery
has answer: http://stackoverflow.com/a/24817138
has comment: http://stackoverflow.com/comment/38524828
accepted answer: http://stackoverflow.com/a/24817138
favorite count: 0
has title: drag and drop text exercise
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/38617253
score: 0
type: Comment
type: QuestionComment
has text: I am assuming you want this to be browser independent(FF, Chrome and Opera)?
comment on: http://stackoverflow.com/q/24847640

http://stackoverflow.com/q/24755215
type: UnansweredQuestion
has body: I made a fully JS game and I'd like to calculate a score and have the player insert it into the database with a nickname, so I can make a top high score ladder. The problem is, can't they enter any number as their score, if they modify the script? Or if they simply access my PHP script and send some POST variables into it? Note that they will be validated as numbers/nickname, but can't they send ANY number they want? How can I prevent that?
tagged with: php
has comment: http://stackoverflow.com/comment/38408151
answer count: 0
has title: Secure High score ladder
type: Question
duplicate of: http://stackoverflow.com/q/8670612
has comment: http://stackoverflow.com/comment/38408238
has comment: http://stackoverflow.com/comment/38408030
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38408085
linked to: http://stackoverflow.com/q/8670612

http://stackoverflow.com/comment/38484637
type: Comment
comment on: http://stackoverflow.com/a/24782824
type: AnswerComment
has text: Routing will not help in this cases??
score: 0

http://stackoverflow.com/comment/38533387
type: QuestionComment
comment on: http://stackoverflow.com/q/24821467
score: 0
has text: so how can I do this on dot net side? thanks for your advice
type: Comment

http://stackoverflow.com/q/24818695
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/24818727
favorite count: 0
type: Question
downvote count: 2
score: -2
answer count: 1
has body: I am validating the text field which should accept only characters it should not allow to enter numbers it is working good but when entering unwanted text the backspace is not working. I want to work it please give me advice. This is my code: function Validate_Classname() { var str = document.cclass.classname.value; if (IsBlank(str)) { alert("Class Name field cannot be empty") return false; } if (!isNaN(str)) { alert("Please enter only text") return false; } return true; } function onlyAlphabets(e, t) { try { if (window.event) { var charCode = window.event.keyCode; } else if (e) { var charCode = e.which; } else { return true; } if ((charCode &gt; 64 &amp;&amp; charCode &lt; 91) || (charCode &gt; 96 &amp;&amp; charCode &lt; 123)) return true; else return false; } catch (err) { alert(err.Description); } }
has answer: http://stackoverflow.com/a/24818727
has title: HTML Textfield validation Backspace issue
tagged with: javascript
type: AnsweredQuestion
upvote count: 0

http://stackoverflow.com/q/24829871
has title: ng-options where selection of one determines options of the other
type: AnsweredQuestion
score: 3
tagged with: angular-ui
favorite count: 0
has body: I have two dropdowns, and I want the second one to have only the options that are relevant to the selected item in the first. I could do some ng-change function but am trying to get it to work with only code in html, and am close but not quite. I tried what is found here but it's not quite working. It shows all options instead of none for Level 2 when no selection is made for Level 1, and when a selection is made for Level 1, it only shows the first valid option for Level 2. I'd like, if a is selected for Level 1, it should show b, c, d, e as options for Level 2, and if z is selected, it should show c, d, f, g as options for Level 2. Here is my code in plnkr: http://plnkr.co/edit/DuCMjAUKTBiGJNQfhVbd?p=preview Here is my javascript: var app = angular.module('myApp', ['ui', 'ui.filters']); app.controller('myController', function($scope){ $scope.myFilters = [ {level1:'a',level2:'b'}, {level1:'a',level2:'c'}, {level1:'a',level2:'d'}, {level1:'a',level2:'e'}, {level1:'z',level2:'c'}, {level1:'z',level2:'d'}, {level1:'z',level2:'f'}, {level1:'z',level2:'g'}, ]; }); And here is my html: Level 1: Level 2:
tagged with: angularjs
type: Question
accepted answer: http://stackoverflow.com/a/24868219
answer count: 3
possible better answer: http://stackoverflow.com/a/24852098
has answer: http://stackoverflow.com/a/24852098
upvote count: 3
has answer: http://stackoverflow.com/a/49774502
has comment: http://stackoverflow.com/comment/38550462
tagged with: ng-options
has comment: http://stackoverflow.com/comment/38550051
downvote count: 0
has answer: http://stackoverflow.com/a/24868219
tagged with: javascript
linked to: http://stackoverflow.com/q/19130825

http://stackoverflow.com/a/24821669
type: Answer
accepted answer of: http://stackoverflow.com/q/24820381
upvote count: 3
has body: I have forked your fiddle. Checkout this http://jsfiddle.net/dhavalcengg/ERX54 Hope this will help.
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24820381
score: 3

http://stackoverflow.com/q/24840064
accepted answer: http://stackoverflow.com/a/24912123
has title: new Dailymotion player API: programmatically set playback quality
answer count: 1
has body: I want to force the Dailymotion player to always show the highest resolution available for any given embedded video. If you manually set the player to 1080p during a video with that resolution available, and the next video in the playlist is only available in 240,380,480 then you get 380p (so you need to click 480, again, manually). If you manually set the playback to "optimal", then you often get a truly suboptimal resolution. The old player API supported setting the playback quality via setPlaybackQuality (as per the player on many other sites). The new player doesn't seem to support this anymore. How to either: a) set the playback quality via JavaScript?, or b) configure the embedded player to always play the highest available resolution?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24912123
tagged with: dailymotion-api
type: Question
tagged with: javascript
score: 0

http://stackoverflow.com/comment/38680438
has text: This was the only working solution I could find that allowed users to upload multiple files within one 'submit' but please let me know if you get the 'multiple' parameter working since I agree that's a more elegant solution.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24877294
type: Comment

http://stackoverflow.com/q/24851373
tagged with: popup
has body: I have three popups in my website. When the user click on something, the first popup open with a div in it. If the user click on this div, the popup is closed, and open a new one. In this new popup it is the same, i have a div, and if the user click on it, it will close the second popup and open the third one. What i am trying to do is, when you are at the third div, if you click in the close button, it will return to the second div. And if you click again in the close button, you will return to the first popup. Is there any method in jquery to do this?
score: -3
downvote count: 3
has answer: http://stackoverflow.com/a/24851589
linked to: http://stackoverflow.com/q/18534561
type: Question
has title: JQuery Click go back to last function
accepted answer: http://stackoverflow.com/a/24851589
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38589717
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38589901
type: AnsweredQuestion

http://stackoverflow.com/comment/62187288
has text: @SzymonDziewoński: This happens, because the back button requests the non-existing URL, which redirects back to `/error/404`. You can work around this, be replacing the non-existing URL with `/error/404` in the browser's history. This way, the back button will get you back to the previous existing page. You can do this, using `$location.replace()`. I have updated the answer and the demo.
type: AnswerComment
score: 1
type: Comment
comment on: http://stackoverflow.com/a/24863329

http://stackoverflow.com/a/24849780
downvote count: 0
answers question: http://stackoverflow.com/q/24849748
score: 1
upvote count: 1
has body: I'm guessing that adding a margin isn't what you're after and you'd like to have the circles touching but without the fade overlapping. To do this you could have another inner span, positioned absolute with the box shadow overridden: &lt;span&gt;&lt;span class="in"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt; span.in{ position:absolute; box-shadow:inset 0px 0px 0px 0px; /*compensate for outer span's padding*/ margin-left:-20px; margin-top:-20px; }
type: Answer

http://stackoverflow.com/comment/38579028
comment on: http://stackoverflow.com/a/24835296
score: 0
type: Comment
has text: Adding another real use of closure above.
type: AnswerComment

http://stackoverflow.com/comment/38665166
type: Comment
comment on: http://stackoverflow.com/a/24889166
score: 0
type: AnswerComment
has text: I want to go through the entire animation on hover in/hover out. If I hover over the button once and hover out before the animation for hover IN is done, I still want it to complete and return back to original position before any other animation tries to start.

http://stackoverflow.com/q/24790007
favorite count: 0
type: UnansweredQuestion
score: -3
upvote count: 0
type: Question
has answer: http://stackoverflow.com/a/24790064
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38474730
has body: My HTML code structure like this //start .....more..... //end .....more..... .....more..... .....more div like above.... I want to use a piece of JQuery code to hide everything except the "div" has id="title"(keep the code from //start to //end). Now, my JQuery code is: $("div:not(:has(#title))").hide(); It shows "div id="title"""div"", but it also hide the several "div" after "div id="title"""div"". Again, I want to keep the code from //start to //end. Please help me, thanks.
has title: How to hide all the elements except first and its child?
downvote count: 3
answer count: 1

http://stackoverflow.com/q/24875570
has body: I want to save an image on a server by sending its properties via ajax.. In the JS I'm encoding the image in base64 before I send it (along with other parameters i need): $.ajax({ type: 'POST', url: 'PhotoSelect.aspx/GetData', data: JSON.stringify({ action: "save", x: x, y: y, width: width, height: height, type: type, obj_id: obj_id, image: image, team: teamVal, jersey: jerseyVal, spot: spotVal }), contentType: 'application/json; charset=utf-8', dataType: 'json' }) And i receive the request on server side by: [WebMethod] [ScriptMethod(UseHttpGet = false, ResponseFormat = ResponseFormat.Json)] public static JsonReturn GetData(string action, string x, string y, string width, string height, string type, string obj_id, string image, string team, string jersey, string spot) { //Process Image } Now the weird part is that this works (by this i mean it reaches the GetData function) for some images! When i attempt to send a smaller (or lower quality) image this works. When i attempt to send images that have really long base64 strings it doesnt reach the function.. Can anyone think of anything that might be wrong with this?
tagged with: image
tagged with: c#
has answer: http://stackoverflow.com/a/24986147
tagged with: .net
tagged with: javascript
tagged with: base64
linked to: http://stackoverflow.com/q/288612
accepted answer: http://stackoverflow.com/a/24986147
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38636319
has comment: http://stackoverflow.com/comment/38647669
has comment: http://stackoverflow.com/comment/38647747
has comment: http://stackoverflow.com/comment/38636189
answer count: 1
has comment: http://stackoverflow.com/comment/38636247
has title: Pass base64 from javascript to C# Server function
score: 0

http://stackoverflow.com/comment/38550837
comment on: http://stackoverflow.com/q/24828066
type: Comment
type: QuestionComment
has text: thanks chris i knew how to check the value i just wanted to combine it properly and i think its a good question but everytime i ask a question related to jquery I get dinged negatively because the question is easy..
score: 0

http://stackoverflow.com/q/24815912
tagged with: javascript
has answer: http://stackoverflow.com/a/24816049
has body: I'm trying to maximize my FLOPS in NodeJS, so I want to add using bitwise operations. So: var a = 6, b = 12; a + b Instead: var add = function (a, b) { var carry, result, shiftedcarry; carry = a &amp; b, result = a ^ b; while (carry !== 0) { shiftedcarry = carry &lt;&lt; 1; carry = result &amp; shiftedcarry; result ^= shiftedcarry; } return result; } add(a, b); However, I found SO answers that said bitwise operations are slower in Javascript due to casting. Is there anyway to bypass this problem (like with a V8 extension or something)? The reason I'm so focused on increasing my FLOPS is because I'm thinking of running a NodeJS experiment on a supercomputer.
downvote count: 4
answer count: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38523058
has title: Adding in Javascript (NodeJS)
has comment: http://stackoverflow.com/comment/38522970
linked to: http://stackoverflow.com/q/277423
tagged with: node.js
has comment: http://stackoverflow.com/comment/38523042
score: -4
type: Question
upvote count: 0

http://stackoverflow.com/comment/38652701
comment on: http://stackoverflow.com/a/24884117
type: Comment
score: 0
type: AnswerComment
has text: i love you xD i had to let absence.id because the elemtn id on the database is different from the order it is seens on the for cycle. http://jsfiddle.net/Bp3pc/4/

http://stackoverflow.com/comment/38819265
has text: Any ideas on this folks? Thanks
comment on: http://stackoverflow.com/q/24808757
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38627134
has text: Please accept the solution if it help you out :) !
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24866463

http://stackoverflow.com/comment/38618849
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24866244
score: 0
has text: ^ +1 use that bundle, so you don't have to reinvent the wheel.

http://stackoverflow.com/q/24903429
score: 2
answer count: 0
downvote count: 0
has body: I have a div that I want to perform slideUp/slideDown on. The only problem is that there is no animation. it just hides/shows the element. The content is dynamically loaded via ajax. $('body').on("change", ".attendingaction", function(e){ // Assign a reference var self = $(this); var menu_list = self.closest(".results-item").find(".menus"); if(self.val() == "Yes") menu_list.slideDown(400); else{ menu_list.slideUp(50, function(){ $(this).find(".menuitem").removeProp("checked"); }); } }); Even more bizarre, it works if the display is "block". but in this case, it sets it to "table-cell" after performing slideDown(). Here's a screenshot:
type: Question
tagged with: javascript
tagged with: jquery
has title: jQuery's slideUp/slideDown instant without animation
has comment: http://stackoverflow.com/comment/39827578
upvote count: 2
has comment: http://stackoverflow.com/comment/38688567
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/38553944
has text: @AlexC -- It's both...OP wants an Angular filter applied to his table based off the dropdown - also no need for any more libraries to process the data.
comment on: http://stackoverflow.com/q/24832192
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24766367
has body: One way would be to set each checkbox to a specific id. Then you could use $('#' + id).is(":checked") to see if the checkbox is checked. If the checkbox is checked, you could get the range and store it in a variable. You can then return that variable. Check this page if you need some help with the checkbox.
score: -1
upvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24766148
downvote count: 1

http://stackoverflow.com/comment/38647286
type: Comment
score: 0
comment on: http://stackoverflow.com/a/24870274
type: AnswerComment
has text: The debug is quite helpfull with things that you can change on the go, but I'm messing with the addProperty(), and it's quite annoying trying to figure out what I can add or not. I'm spending more timing googling how to use each method/propertie than actually coding.

http://stackoverflow.com/a/24896370
answers question: http://stackoverflow.com/q/24895880
has comment: http://stackoverflow.com/comment/38680444
score: 0
has comment: http://stackoverflow.com/comment/38679606
has body: take a look at that: UPDATED: html change: &lt;option value="0"&gt;--please select--&lt;/option&gt; function to check all inputs: function checkinputs() { // if the select is defauld OR we have text inputs empty OR we dont have even one checkbox checked if( $("#order select").val() == "0" || $('#order input[type="text"]').filter(function(){return this.value == ""}).length || !$('#order input[type="checkbox"]').is(':checked') ) { $('#submit').prop('disabled', true); } else { $('#submit').prop('disabled', false); } } simple change and input events of "#order": $( "#order" ).on('change input',function() { checkinputs(); }); demo: http://jsfiddle.net/zVS3t/30/
type: Answer

http://stackoverflow.com/q/24893170
has answer: http://stackoverflow.com/a/24895461
tagged with: gridview
upvote count: 3
accepted answer: http://stackoverflow.com/a/24895461
tagged with: vb.net
has comment: http://stackoverflow.com/comment/38670199
type: Question
type: AnsweredQuestion
score: 3
has title: How to call javascript function on the OnLoad event of GridView?
has body: I want to call a javascript function when the gridview loads. Im calling it like this, &lt;asp:GridView ID="GridView4" runat="server" OnLoad="javascript:AddTHEAD('&lt;%= GridView4.ClientID %&gt;')"&gt; &lt;/asp:GridView&gt; and here is the javascript function &lt;script type="text/javascript"&gt; function AddTHEAD(tableName) { window.open(document.location.href+'&amp;mode=print','_blank'); var table = document.getElementById(tableName); if (table != null) { var head = document.createElement("THEAD"); head.style.display = "table-header-group"; head.appendChild(table.rows[0]); table.insertBefore(head, table.childNodes[0]); } } &lt;/script&gt; But im getting compilation errors on calling javasccript function like this. How to call javascript function on the OnLoad event of GridView? What i want to do is basically print gridview header on each page, but i couldn't figure out how. Please help!
answer count: 1
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/1303145
tagged with: asp.net
favorite count: 0

http://stackoverflow.com/comment/38686792
has text: @BoltClock Just now tested your fiddle, It is still displaying 0 in `chrome Version 26.0.1410.43 m`
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24902335

http://stackoverflow.com/comment/131801288
score: 0
comment on: http://stackoverflow.com/a/24800648
type: Comment
has text: Perhaps you can edit the answer to include that this stuff is bundled with express from v4.16+
type: AnswerComment

http://stackoverflow.com/comment/38540156
score: 0
has text: yes , loading 2 versions of jQuery can cause lots of problems if not done properly
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24793720

http://stackoverflow.com/q/24899326
downvote count: 2
has body: I used mozila and I try to "inspect element" to see if my background image is there. The inspect element even doesn't show the css style mark up like background-image: blah blah; at all. I am very sure that I have written the code correctly: background-image: url ('social-icon/button.png'); Some discussion out there said that it may be caused of "javascript" and adviced to disable the javascript, but I don't know how to do that. Eventhough it is true that the problem is the javascript and it means that I can't use Javascript in my html file, it will be worse. I am just confused? EDITED :p LOL, THE PROBLEM IS BECAUSE I HAVE A SPACE BETWEEN URL AND THE SOURCE. IT SHOULD BE LIKE url{there is no space here}('social-icon/button.png'); It's so funny how we all can't see a little problem when our focus is to the another point of the question. :D :D :D
upvote count: 1
has comment: http://stackoverflow.com/comment/38680963
has comment: http://stackoverflow.com/comment/38680901
has comment: http://stackoverflow.com/comment/38681190
has comment: http://stackoverflow.com/comment/38818426
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24899382
has comment: http://stackoverflow.com/comment/38680958
has comment: http://stackoverflow.com/comment/38680978
score: -1
type: Question
possible better answer: http://stackoverflow.com/a/24899382
answer count: 2
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/38681246
has title: My Background image doesn't show up and is not inspected in the browser
has answer: http://stackoverflow.com/a/24899435
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/24899435

http://stackoverflow.com/comment/38636911
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24857515
has text: Following up on that comment, I found that Google visualization objects have a join method. I've tried to implement that method into my code here: http://jsfiddle.net/2cLA5/1/ but it is not working. Any ideas?

http://stackoverflow.com/comment/38461526
comment on: http://stackoverflow.com/q/24771311
type: Comment
type: QuestionComment
has text: In fact when model is destroyed the collection's listening and runs it's own stuff ;) https://github.com/jashkenas/backbone/blob/master/backbone.js#L973
score: 0

http://stackoverflow.com/q/24839530
type: Question
has answer: http://stackoverflow.com/a/24839603
score: -2
tagged with: java
tagged with: http://stackoverflow.com/tag/json
has title: How to catch the elements of JSON list which is sent by back-end method in Javascript?
downvote count: 2
has comment: http://stackoverflow.com/comment/38567400
has comment: http://stackoverflow.com/comment/38566974
answer count: 1
has body: I'm doing Java web application. A back-end method sends a JSON list but how can I access it from front-end? This is a sample of the JSON list which is returning from back-end method. [ { "completedDate" : null, "completenessLevel" : 0, "priority" : 0, "startedDate" : 1405621923000, "toBeCompleted" : 1405621923000, "userName" : "prasad", "userTaskDiscription" : "Task1 desc", "userTaskId" : 25, "userTaskName" : "Task1" }, { "completedDate" : null, "completenessLevel" : 0, "priority" : 0, "startedDate" : 1405704875000, "toBeCompleted" : 1405704875000, "userName" : "prasad", "userTaskDiscription" : "Task2 desc", "userTaskId" : 26, "userTaskName" : "Task2" } ]
tagged with: javascript
tagged with: jquery
favorite count: 0
type: AnsweredQuestion
upvote count: 0
accepted answer: http://stackoverflow.com/a/24839603

http://stackoverflow.com/comment/38665332
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24889624
score: 0
has text: @GregK It's worse than that, this code runs in a context of the wrong `document` (in a background page).

http://stackoverflow.com/q/24805410
has comment: http://stackoverflow.com/comment/38523260
answer count: 0
type: UnansweredQuestion
type: Question
has title: my jquery code is not working when I remove alert from my m2e.i18nLocalizePage() function
has body: I have the following javascript code. function getLanguage() { // Add any variations of a language value and map to a supported language. var langMap = { /*German/Deutsch */ "de": "de", "de-at": "de", "de-de": "de", "de-li": "de", "de-lu": "de", "de-ch": "de", /*English*/ "en": "en-us", "en-gb": "en-gb", "en-us": "en-us", /*French*/ "fr": "fr-fr", "fr-fr": "fr-fr", "fr-be": "fr-fr", "fr-ca": "fr-fr", "fr-lu": "fr-fr", "fr-ch": "fr-fr", /*Italian*/ "it": "it", "it-it": "it", "it-ch": "it" }; // Querystring parameter Mozilla IE var lang = getParameterByName("lang") || navigator.language || navigator.userLanguage; // Default to en-us return (lang &amp;&amp; langMap[lang.toLowerCase()]) ? langMap[lang.toLowerCase()] : langMap["en"]; } // Public Functions m2e.i18nGetString = function (id) { return m2e.i18n[id] || ("" + id + ": String not found."); }; m2e.i18nFormat = function () { var argLen = arguments.length; var str = m2e.i18nGetString(arguments[0]); for (var i = 1; i &lt; argLen; i++) { var pattern = "\\{" + (i - 1) + "\\}"; str = str.replace(new RegExp(pattern, "g"), arguments[i]); } return str; }; m2e.i18nLocalizePage = function (context) { if (m2e.i18n) { //alert("testing"); context = context ? context : "*"; $.each($('[data-i18n]', $(context)), function (index, item) { id = $(item).attr("data-i18n") || "EMPTY_data-i18n"; id = id.split(";")[0]; val = m2e.i18nGetString(id); if (isTagName(item, 'input') || isTagName(item, 'textarea')) { // Handle placeholder $(item).attr('placeholder', val); } else if (isTagName(item, 'img')) { // Handle alt text $(item).attr('alt', val); } else { // Handle HTML contents $(item).html(val); } }); } }; $.ajax({ url: "../../App/js/i18n/i18n_" + getLanguage() + ".js", dataType: "script", async: false }); Whenever I keep and alert in m2e.i18nLocalizePage() function it works perfectly. but when I removed the alert from the same function it is not working at all. I tried searching on net and everywhere it is written it is a timing issue be…
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38549859
tagged with: ajax
score: 0
tagged with: internationalization

http://stackoverflow.com/q/24848797
has comment: http://stackoverflow.com/comment/38584706
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: prefetch
tagged with: datalist
has body: Hi I'm building an autocomplete function for a searchbox in my website. I'm using the following code: $(document).ready(function(){ var $terms = [ "aggretatibacter aphrophilus", "abiotrophia defectiva", "aerococcus viridans", "aggregatibacter actinomycetemcomitans", "aeromonas hydrophila", "aerococcus urinae", "actinobacillus ureae", "achromobacter xylosoxidans", "capnocytophaga gingivalis", "acinetobacter baumannii", "streptococcus pyogenes" ].sort(), $return = []; function strInArray(str, strArray) { for (var j=0; j&lt;strArray.length; j++) { if (strArray[j].match(str) &amp;&amp; $return.length &lt; 5) { var $h = strArray[j].replace(str, '&lt;strong&gt;'+str+'&lt;/strong&gt;'); $return.push('&lt;li class="prediction-item"&gt;&lt;span class="prediction-text"&gt;' + $h + '&lt;/span&gt;&lt;/li&gt;'); } } } function nextItem(kp) { if ( $('.focus').length &gt; 0 ) { var $next = $('.focus').next(), $prev = $('.focus').prev(); } if ( kp == 38 ) { // Up if ( $('.focus').is(':first-child') ) { $prev = $('.prediction-item:last-child'); } $('.prediction-item').removeClass('focus'); $prev.addClass('focus'); } else if ( kp == 40 ) { // Down if ( $('.focus').is(':last-child') ) { $next = $('.prediction-item:first-child'); } $('.prediction-item').removeClass('focus'); $next.addClass('focus'); } } $(function(){ $('#s').keydown(function(e){ $key = e.keyCode; if ( $key == 38 || $key == 40 ) { nextItem($key); return; } setTimeout(function() { var $search = $('#s').val(); $return = []; strInArray($search, $terms); if ( $search == '' || ! $('input').val ) { $('.output').html('').slideUp(); } else { $('.output').html($return).slideDown(); } $('.prediction-item').on('click', function(){ $text = $(this).find('span').text(); $('.output').slideUp(function(){ $(this).html(''); }); $('#s').val($text); }); $('.prediction-item:first-child').addClass('focus'); }, 50); }); }); $('#s').focus(function(){ if ( $('.prediction-item').length &gt; 0 ) { $('.output').slideDown(); } $('#searchform').subm…
favorite count: 0
has comment: http://stackoverflow.com/comment/38585006
has title: load an external dataset using javascript prefetch
type: UnansweredQuestion
upvote count: 1
type: Question
score: 1
has answer: http://stackoverflow.com/a/24849117

http://stackoverflow.com/comment/38556236
has text: I believe we can't do it with just javascript, what we usually see around is a plugin that puts flash obj to do the work, see more info here: https://github.com/blog/1365-a-more-transparent-clipboard-button
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24833144

http://stackoverflow.com/q/24870495
accepted answer: http://stackoverflow.com/a/24872764
linked to: http://stackoverflow.com/q/9063383
type: Question
has body: I am currently using this function to zoom in on a state: function clicked(d) { if (active.node() === this) return reset(); active.classed("active", false); active = d3.select(this).classed("active", true); var bounds = path.bounds(d), dx = bounds[1][0] - bounds[0][0], dy = bounds[1][1] - bounds[0][1], x = (bounds[0][0] + bounds[1][0]) / 2, y = (bounds[0][1] + bounds[1][1]) / 2, scale = .9 / Math.max(dx / width, dy / height), translate = [width / 2 - scale * x, height / 2 - scale * y]; g.transition() .duration(750) .style("stroke-width", 1.5 / scale + "px") .attr("transform", "translate(" + translate + ")scale(" + scale + ")"); } And I have this on click listener on the path: .on("click", clicked) I want to be able to select a d3 element by class name and then zoom on to it. Preferably, I'd like to call which state to zoom in on from a function like this: function zoomIn(state) { //zoom into the state } How do I go about doing this?
has title: d3 zoom by class name
tagged with: d3.js
score: 0
answer count: 2
tagged with: dictionary
has answer: http://stackoverflow.com/a/24872764
tagged with: http://stackoverflow.com/tag/json
possible better answer: http://stackoverflow.com/a/24870567
has answer: http://stackoverflow.com/a/24870567
type: AnsweredQuestion
tagged with: javascript

http://stackoverflow.com/a/24802978
score: 0
answers question: http://stackoverflow.com/q/24802915
type: Answer
has body: Try $('#numbers').children("button").addClass("hello");

http://stackoverflow.com/comment/67382462
type: AnswerComment
score: 1
has text: I came here (from google) because I want to skip an element, not to use filter, which is something else entirely.. can you please also answer the direct title? thank you
type: Comment
comment on: http://stackoverflow.com/a/24806827

http://stackoverflow.com/a/24825400
answers question: http://stackoverflow.com/q/24825248
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38540807
upvote count: 1
has body: &lt;div id="entire-page" style="padding-top: 72px; overflow: hidden; background-color: grey; height: 100vh;" &gt; remove height: 100vh; try with height:100% or if not remove this attribute from the style.... If it is not working, make a fiddle.
has comment: http://stackoverflow.com/comment/38540589

http://stackoverflow.com/a/24870686
score: 0
has body: remove the .id from proj {{selectedProject.Id}} here is the url : http://jsbin.com/rocajeja/1/ this is the edit url : http://jsbin.com/rocajeja/1/edit
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/24870609
accepted answer of: http://stackoverflow.com/q/24870609

http://stackoverflow.com/q/24780284
favorite count: 0
has answer: http://stackoverflow.com/a/24780326
has body: Firstly this may sound like a duplicate question but I was unable to resolve my problem using the previous asked questions: This is my HTML page: JSP Page This program is not matching my String.I want to match my string using case-insensitive match.I know the problem lies in this line: var result = totalids.match(/variable_name/i); I am unable to pass variable in match function.I can do this; var re = new RegExp(str1, "g"); But I don't know how to do cases-insensitive search using above line.
has title: How to pass a variable in match function in javascript?
tagged with: http://stackoverflow.com/tag/html
tagged with: regex
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24780326
type: Question
has comment: http://stackoverflow.com/comment/38455039
upvote count: 4
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 4

http://stackoverflow.com/q/24873473
has answer: http://stackoverflow.com/a/24873617
has answer: http://stackoverflow.com/a/24873519
tagged with: css
answer count: 4
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24873579
accepted answer: http://stackoverflow.com/a/24873519
score: 1
upvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38632454
tagged with: getelementbyid
has body: I want to push an array of numbers into a div. I know the array will be long, so I want a maximum width so the numbers will continue to the next line. I have an example code here and, as you can see, the maximum width doesn't seem to apply to the numbers -- they just keep running on one line. How do I get the width inside the class to apply to the numbers as well? CSS: .divstyle { background-color:orange; height:125px; width: 75px; } HTML: &lt;div class="divstyle"&gt; &lt;div id="test"&gt;&lt;/div&gt; &lt;/div&gt; Javascript: var number = Math.floor(Math.random()*99+1); var num = []; for (var i = 0; i &lt; 30; i++) { var number = Math.floor(Math.random()*100+1); num.push(number); } document.getElementById("test").innerHTML = num; I'm betting I'm making a simple mistake, but I'm not familiar with CSS so there's that.
downvote count: 0
has answer: http://stackoverflow.com/a/24873578
favorite count: 0
has title: Div style not being applied when using getelementbyid
has answer: http://stackoverflow.com/a/24873579
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/24797161
score: -1
type: Answer
answers question: http://stackoverflow.com/q/24784443
downvote count: 1
upvote count: 0
has body: something that may help you in the future is to install the react chrome developer extension. It displays the DOM in nodes of react components. Here is the link : https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi

http://stackoverflow.com/q/24778287
has body: I have an array of arrays as follows: [[3, 4], [1, 2], [3, 4]] I wish to create a new array of arrays that has no duplicates, and has a count of the number of occurrences of each element in the first array: [[3,4,2], [1,2,1]] here is what I have so far: var alreadyAdded = 0; dataset.forEach(function(data) { From = data[0]; To = data[1]; index = 0; newDataSet.forEach(function(newdata) { newFrom = newData[0]; newTo = newData[1]; // check if the point we are looking for is already added to the new array if ((From == newFrom) &amp;&amp; (To == newTo)) { // if it is, increment the count for that pair var count = newData[2]; var newCount = count + 1; newDataSet[index] = [newFrom, newTo, newCount]; test = "reached here"; alreadyAdded = 1; } index++; }); // the pair was not already added to the new dataset, add it if (alreadyAdded == 0) { newDataSet.push([From, To, 1]); } // reset alreadyAdded variable alreadyAdded = 0; }); I am very new to Javascript, can someone help explain to me what I'm doing wrong? I'm sure there is a more concise way of doing this, however I wasn't able to find an example in javascript that dealt with duplicate array of arrays.
has answer: http://stackoverflow.com/a/67955259
answer count: 4
has comment: http://stackoverflow.com/comment/38451400
possible better answer: http://stackoverflow.com/a/24780139
has comment: http://stackoverflow.com/comment/38451827
has answer: http://stackoverflow.com/a/24780322
has answer: http://stackoverflow.com/a/24780139
upvote count: 1
has title: counting duplicate arrays within an array in javascript
has comment: http://stackoverflow.com/comment/38451640
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/24780322
type: Question
has answer: http://stackoverflow.com/a/24778545
tagged with: arrays
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/38521103
type: QuestionComment
comment on: http://stackoverflow.com/q/24814507
score: 0
has text: Colour is not an attribute of a string - you can't have a JS variable that contains a red piece of text. You could have a variable which contained some HTML ready to inject into the page, or you could put the text into place on the page, and then style it, probably using CSS.
type: Comment

http://stackoverflow.com/comment/38568434
has text: and why not just add the same link to html?
score: 0
comment on: http://stackoverflow.com/q/24840402
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24785746
possible better answer: http://stackoverflow.com/a/24786824
answer count: 3
has answer: http://stackoverflow.com/a/24786808
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24786824
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/38466109
type: Question
has comment: http://stackoverflow.com/comment/38467327
has comment: http://stackoverflow.com/comment/38466276
has body: I'm referring to MDN's article on JavaScript's 'future reserved words' (for use in the new strict mode) - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Future_reserved_keywords . All the reserved words indicate that JavaScript will possibly follow a non-prototypical inheritance procedure, but what does this mean for already developed applications and modifications? Does anyone know how long these have been 'future reserved words', and whether or not these changes will come to light in the near future or not? If this isn't the right place, feel free to move it.
accepted answer: http://stackoverflow.com/a/24786808
tagged with: prototypal-inheritance
has title: Will JavaScript ever become a 'proper' class based language?
upvote count: 1
tagged with: reserved-words
has answer: http://stackoverflow.com/a/24786245
has comment: http://stackoverflow.com/comment/38466130
tagged with: javascript
tagged with: inheritance
tagged with: class

http://stackoverflow.com/comment/38614520
comment on: http://stackoverflow.com/q/24853957
score: 0
has text: what do you want to know exactly please because i have already put in the post the code that im using to add my UserControl
type: QuestionComment
type: Comment

http://stackoverflow.com/q/24872192
has comment: http://stackoverflow.com/comment/38629788
has comment: http://stackoverflow.com/comment/38630033
type: Question
tagged with: arrays
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38629823
has body: I cannot figure out why this is only creating a one dimensional array. What I want is an array of arrays with the inner array being full of items that are strings. Here is my code: modified_row_id_list is an array of IDs that I have already created. list_of_row is an array of the innerHTML from a row of an HTML table. var modified_rows = new Array(modified_row_id_list.length); for (i=0; i&lt;modified_row_id_list.length; i++) { row = document.getElementById(modified_row_id_list[i]); list_of_row = []; for (j=0; j&lt;row.cells.length - 1; j++) { list_of_row.push(row.cells[j].innerHTML); list_of_row.push('-split-') } modified_rows[i] = [list_of_row]; And when I print out modified_rows it is just a one dimensional array of strings. I know this is probably extremely simple but I can't figure it out for some reason and I'm not all that familiar with javascript.
has comment: http://stackoverflow.com/comment/38629861
has comment: http://stackoverflow.com/comment/38629871
type: UnansweredQuestion
has title: array of array of strings in javascript
has comment: http://stackoverflow.com/comment/38629824
answer count: 0

http://stackoverflow.com/comment/38493745
type: Comment
has text: @Lix testAPI() function.
comment on: http://stackoverflow.com/q/24800528
score: 0
type: QuestionComment

http://stackoverflow.com/a/24902844
has comment: http://stackoverflow.com/comment/38688131
has comment: http://stackoverflow.com/comment/38687696
has comment: http://stackoverflow.com/comment/38687568
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24902540
type: Answer
has body: The book may be out-dated (perhaps based on an early version of Angular). There are two things wrong: 1. The 'setDirectiveTitle' in the isolated scope of myScopeDirective is not accessible from the HTML: {{ title }} Bob it! setDirectiveTitle('bob') is bound to AppController's scope not the directive's isolated scope. In AppController's scope, the method doesn't exist. And since isolated scopes are "isolated" and do not inherit scope from the parent (AppController's scope), the button click doesn't actually do anything. 2. The contents under the directive are bound to AppController's scope - not the isolated scope. So the 'title' model is actually the same model as the 'appTitle' above it. The reason why both title's say 'Hello World' is because both are bound to the same model 'title' on AppController's scope. This is also the reason why both title's change to the same title at the same time when the first button is clicked. I think the main mistake that the author makes is the incorrect assumption that the contents under myScopedDirective are bound to the isolated scope. This may have been true for earlier versions of Angluar, but it is certainly not true for Angular 1.2 and above. The contents are bound to the parent scope (AppController's scope).
answers question: http://stackoverflow.com/q/24902540
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38687636

http://stackoverflow.com/comment/38607868
type: QuestionComment
score: 0
has text: Can you provide some code samples, Basicly Sharepoint strips out "harmfull" tags.
comment on: http://stackoverflow.com/q/24860797
type: Comment

http://stackoverflow.com/q/24784156
tagged with: javascript
has answer: http://stackoverflow.com/a/24785038
favorite count: 0
has comment: http://stackoverflow.com/comment/38462913
has body: I want to make a function in JavaScript in which if some input is given like 1240 then it gives output as 1000+200+40+0. Similarly if 16589 then it returns the value like 10000+6000+500+80+9 and so on. Now I want to make a function in JavaScript such that it could returns the values like this but I am somewhere lacking towards the right way, What would be the correct way to proceed?
type: Question
possible better answer: http://stackoverflow.com/a/24785038
score: 1
has title: Finding out the place values
upvote count: 2
has answer: http://stackoverflow.com/a/24784947
answer count: 3
has comment: http://stackoverflow.com/comment/38463662
downvote count: 1
has answer: http://stackoverflow.com/a/24785277
accepted answer: http://stackoverflow.com/a/24784947
type: AnsweredQuestion

http://stackoverflow.com/comment/38633068
type: QuestionComment
score: 0
has text: @Rory McCrossan The problem is that I need the rate at which the image shrinks/grows to slow down/speed up based on whether it's getting bigger or smaller, which is why I have it using 10% of the current size.
comment on: http://stackoverflow.com/q/24873790
type: Comment

http://stackoverflow.com/q/24784628
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
score: -3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38463923
has answer: http://stackoverflow.com/a/24784805
tagged with: css
has comment: http://stackoverflow.com/comment/38463960
downvote count: 4
has comment: http://stackoverflow.com/comment/38464007
has body: I have been playing around with Jquery but I got stuck in this point and to solve it I have this doubt. I would like to put all these anchor elements inside a div that I want to create. copy cut Is there any way to create a div element and put all these elements inside that div? Like this: copy cut So, how many possibilities do I have to move that?
linked to: http://stackoverflow.com/q/1279957
has title: How many ways do I have to move element A to element B and which they are
type: Question
has comment: http://stackoverflow.com/comment/38463885
has comment: http://stackoverflow.com/comment/38464105
tagged with: javascript
upvote count: 1
answer count: 1

sequelize.js
type: Tag
tags question: http://stackoverflow.com/q/24785201
tag name: sequelize.js

http://stackoverflow.com/comment/80923010
type: AnswerComment
has text: best alert message ever. !! made my life miserable since 3 days
score: 4
type: Comment
comment on: http://stackoverflow.com/a/24861307

http://stackoverflow.com/q/24884197
has comment: http://stackoverflow.com/comment/38652609
has comment: http://stackoverflow.com/comment/38652083
has body: I have a weird issue with event listeners on google map markers. Basically I want to declare a bunch of markers in a loop, and have each marker have an associated infowindow. The relevant code is: var markers=[]; var contents = []; var infowindows = []; for (i = 0; i &lt; 10; i++) { markers[i] = new google.maps.Marker({ position: new google.maps.LatLng(40+Math.random()*5, 4+Math.random()*5), map: map, title: 'samplemarker' }); contents[i] = '&lt;div class="popup_container"&gt;' + '&lt;/div&gt;'; infowindows[i] = new google.maps.InfoWindow({ content: contents[i], maxWidth: 300 }); google.maps.event.addListener(markers[i], 'click', function() { infowindows[i].open(map,markers[i]); map.panTo(markers[i].getPosition()); }); } The markers are created correctly, and the infowindows too, since if I do manually infowindows[i].open(map,markers[i]); they are opened correctly. However the listener does not work. Even weirder: I have another marker, "marker_1" declared outside of the for loop, exactly the same way. If I write: google.maps.event.addListener(marker_1, 'click', function() { infowindows[0].open(map,markers[0]); map.panTo(markers[0].getPosition()); }); The infowindow 0 is opened and the map is panned to marker 0 when marker_1 is clicked. However when writing, at the exact same position, the same lines except for marker_1 replaced with markers[0], a click on the marker 0 has no effect at all. Thanks for any help and sorry if it's something stupid!
accepted answer: http://stackoverflow.com/a/24884749
upvote count: 6
type: AnsweredQuestion
downvote count: 1
has title: Declaring google map markers in a loop
type: Question
score: 5
tagged with: javascript
has answer: http://stackoverflow.com/a/24884749
tagged with: google-maps-api-3
tagged with: google-maps
tagged with: google-maps-markers
answer count: 1
favorite count: 0

http://stackoverflow.com/q/24829688
has comment: http://stackoverflow.com/comment/38548868
accepted answer: http://stackoverflow.com/a/24888422
has comment: http://stackoverflow.com/comment/38552276
has body: I'm very new to MVC so please keep the explanations simple and specific. I essentially am trying to open a modal dialog using jQuery and @Url.Action keeps returning a null value. When I forego @Url.Action and hardcode the path, it works fine. Here's the code below. Script: Controller: [Export(typeof(IController))] [ExportMetadata("Name", "MobilePopup")] [ExportMetadata("Plugin", true)] [PartCreationPolicy(CreationPolicy.NonShared)] public class MobilePopupController : Controller { public ActionResult MobilePopup() { return View(); } } View: @{ Layout = null; } Yay!!! This is the modal popup window I've been waiting for. Any ideas as to what I'm doing wrong, please let me know. If you need any more information, please let me know. Thanks!!!
has comment: http://stackoverflow.com/comment/38551800
has comment: http://stackoverflow.com/comment/38552509
has comment: http://stackoverflow.com/comment/38551908
has comment: http://stackoverflow.com/comment/38552164
has comment: http://stackoverflow.com/comment/38552122
has title: @Url.Action returns a null value within the jQuery .load() method
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24888422
has comment: http://stackoverflow.com/comment/38551652
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/38551738
has comment: http://stackoverflow.com/comment/38550215
has comment: http://stackoverflow.com/comment/38552065
type: Question
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/38463717
type: Comment
has text: Well, I don't understand why, but in this case you can create your own `unique` filter.
comment on: http://stackoverflow.com/a/24783463
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38652316
has text: you need to multiplu by 1000, to achieve JS timestamps.
comment on: http://stackoverflow.com/a/24874716
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38519411
has text: if you see the data in `data.addresses` should you be using `$scope.addresses = result.data.addresses` ?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24791142

http://stackoverflow.com/comment/38416112
type: Comment
comment on: http://stackoverflow.com/a/24759396
has text: Try this and you'll see why it's unnecessary: `<?php $array = array('machine' => array('cycle' => 12.34,'percent' => 0.56)); print json_encode($array);`
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38480184
score: 0
type: AnswerComment
has text: 503 is a random number that I thought of.
type: Comment
comment on: http://stackoverflow.com/a/24793067

http://stackoverflow.com/comment/38595184
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24854165
score: 0
has text: It´s not because it is like that in javascript that it´s the right way. A string always should have double quotes, e.g. "string". Single quotes are used for characters, e.g. 'A'. And yea Javascript doesnt obey these rules, but that is because javascript is not a programming language.

http://stackoverflow.com/comment/38575495
has text: Using "on" event attributes has not been recommended for some time - "These attributes should be avoided. This makes the markup bigger and less readable. Concerns of content/structure and behavior are not well-separated, making a bug harder to find. Furthermore, usage of event attributes almost always causes scripts to expose global functions on the Window object, polluting the global namespace." - see https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Event_attributes. I'd strongly suggest using addEventListener to attach the event, which would not require the functions be placed in head
type: Comment
score: 1
comment on: http://stackoverflow.com/a/24844005
type: AnswerComment

http://stackoverflow.com/q/24817284
score: 1
favorite count: 0
tagged with: angularjs
type: Question
tagged with: android
has title: Display data from sqlite DB with AngularJS
has body: I like to collect data from an android app and store them into sqlite DB - no problem so far. But now I want to list these data using AngularJS, ng-repeat command. I take the data from the DB via db.transaction(function(tx) tx.execSql...) but now how to format the data rows so that ng-repeat can read them ? I tried an array of objects, I tried building a JSON string - both not working, I got a ngRepeat error. var app = angular.module('demo',[]); app.controller("MainController", function($scope){ // gets the tasks from the DB as json object db.transaction(function(tx){ tx.executeSql("SELECT task,task_detail,task_date FROM task", [], function(tx, rs){ var rows = rs.rows; if (rows.length&gt;0) { var json_arr = []; for(var i = 0; i &lt; rows.length; i++) { var row = rows.item(i); var obj = {task: row.task,detail:row.task_detail,datum:row.task_date}; json_arr.push(obj); } } var json_str = JSON.stringify(json_arr); alert("json_str: "+ json_str); // WORKING ! sessionStorage.tasks = json_arr; // to get result out of db.transaction... }) }); // end db.transaction $scope.tasks = sessionStorage.tasks; -> when i display {{tasks}} it appears as: [object,object] and ng-repeat doesnt work Otherwise if i use the stringified json, it displays correctly in {{tasks}} but ng-repeat causes again error. Another real "dirty" way to get the result of the query into $scope is the sessionStorage thing - I dont like it this way but I cant see another possibility to set the $scope variable to the JSON (or whatever) result of the DB query. Maybe someone has a better idea ? ;) Any ideas ? Thanks a lot, Chris
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
answer count: 0
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: sqlite

http://stackoverflow.com/comment/38632385
comment on: http://stackoverflow.com/a/24873519
type: AnswerComment
has text: Or `height: auto;` and `min-height: 125px;`
type: Comment
score: 1

http://stackoverflow.com/q/24830643
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24831740
score: 7
linked to: http://stackoverflow.com/q/16151018
type: Question
answer count: 2
has body: When writing question used the Google translator. On a freshly installed ubuntu 14.04 set nodejs - sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update sudo apt-get install python-software-properties python g++ make nodejs Then install yo - sudo npm i -g yo I then install generator-angular - sudo npm i -g generator-angular From the directory you open a terminal and install generator-angular - yo angular And get a lot of errors. Why? How to fix it? Sergio Lopez Mendez - Thank You for your help! Я изменил прова на директорию node_modules sudo chown -R user:group /usr/lib/node_modules/ sudo chown -R `whoami` ~/.npm And mistakes are almost gone, but still, almost.. npm WARN package.json mytesttwo@0.0.0 No description npm WARN package.json mytesttwo@0.0.0 No repository field. npm WARN package.json mytesttwo@0.0.0 No README data npm WARN package.json mytesttwo@0.0.0 No description npm WARN package.json mytesttwo@0.0.0 No repository field. npm WARN package.json mytesttwo@0.0.0 No README data deprecated grunt-ngmin@0.0.3: use grunt-ng-annotate instead ... npm WARN deprecated ngmin@0.4.1: use ng-annotate instead npm WARN optional dep failed, continuing fsevents@0.2.0 ... npm WARN unmet dependency /home/acopalipsis/my-test-two/node_modules/grunt/node_modules/findup-sync requires lodash@'~2.4.1' but will load npm WARN unmet dependency /home/acopalipsis/my-test-two/node_modules/grunt/node_modules/lodash, npm WARN unmet dependency which is version 0.9.2 npm WARN unmet dependency /home/acopalipsis/my-test-two/node_modules/grunt/node_modules/grunt-legacy-log requires lodash@'~2.4.1' but will load npm WARN unmet dependency /home/acopalipsis/my-test-two/node_modules/grunt/node_modules/lodash, npm WARN unmet dependency which is version 0.9.2 npm WARN unmet dependency /home/acopalipsis/my-test-two/node_modules/grunt/node_modules/findup-sync/node_modules/glob requires minimatch@'0.3' but will load npm WARN unmet dependency /home/acopalipsis/my-test-two/node_modules/grunt/n…
downvote count: 0
has comment: http://stackoverflow.com/comment/38550765
tagged with: javascript
tagged with: yeoman-generator-angular
has comment: http://stackoverflow.com/comment/38551211
has comment: http://stackoverflow.com/comment/38551287
has answer: http://stackoverflow.com/a/24831740
has title: Yeoman.io problems installing generator-angular
tagged with: yeoman
tagged with: yeoman-generator
possible better answer: http://stackoverflow.com/a/28551839
has comment: http://stackoverflow.com/comment/38552232
favorite count: 0
has answer: http://stackoverflow.com/a/28551839
has comment: http://stackoverflow.com/comment/38551417
tagged with: npm
has comment: http://stackoverflow.com/comment/38551169
has comment: http://stackoverflow.com/comment/38552319
upvote count: 7

http://stackoverflow.com/q/24880671
tagged with: node.js
tagged with: casperjs
linked to: http://stackoverflow.com/q/22513730
has answer: http://stackoverflow.com/a/24883847
upvote count: 7
answer count: 1
has title: How to open a new tab in CasperJS
has comment: http://stackoverflow.com/comment/38649765
tagged with: javascript
linked to: http://stackoverflow.com/q/24315512
accepted answer: http://stackoverflow.com/a/24883847
type: AnsweredQuestion
downvote count: 0
score: 7
favorite count: 0
type: Question
has body: I am using CasperJS testing framework to make some test suite since almost a month now, but I am facing a problem in one of them. Here is what I want to do: I am browsing a url (page1) and I have to make another action from an another url (simulate a new tab like we have on our graphics browser) without quitting the first one (page1). The action from the second url is going to change my first one. Hope it's clear enough :) So for now when I reach the step to observe that on my first url I open the second one by doing a thenOpen(), so it's making a new navigation step and I am losing the current session and I cannot come back on it. I try many way such as using the history, reopen the page, using the event from CasperJS and also I try with PhantomJS but without success. Here is some pseudo code to make it clearer: casper.test.begin("A random test suite", 0, function testSuite(test) { casper.start(url1, function () { casper.then(function() { // do some action on the first url }); casper.then(function () { // open url2 and do some action in a new tab to not lose the session of url1 }); casper.then(function () { // check url1 (who should be still open) }); }); casper.run(function () { test.done(); }); }); I really would like to use CasperJS to do that but I start to think it is not possible, and I am starting to look in different solution such as this post: CasperJS, parallel browsing WITH the testing framework. But I have never use node.js before so if it's the only way please show me some example.

http://stackoverflow.com/q/24799649
has comment: http://stackoverflow.com/comment/38493311
has comment: http://stackoverflow.com/comment/38562660
has comment: http://stackoverflow.com/comment/38530932
has comment: http://stackoverflow.com/comment/38522483
has comment: http://stackoverflow.com/comment/38492752
answer count: 0
has comment: http://stackoverflow.com/comment/38508511
has comment: http://stackoverflow.com/comment/38492892
type: Question
has comment: http://stackoverflow.com/comment/38493176
has comment: http://stackoverflow.com/comment/38493360
tagged with: javascript
has comment: http://stackoverflow.com/comment/38564640
has body: I am building a simple map application using Google Maps API V3 for JavaScript. I want to show a certain marker image for each location based on IF condition. Here is some code: var myIcon, greenPinIcon, bluePinIcon; greenPinIcon = new google.maps.MarkerImage("images/pin_green.png", null, null, null, new google.maps.Size(50,50)); bluePinIcon = new google.maps.MarkerImage("images/pin_blue.png", null, null, null, new google.maps.Size(50,50)); for(i=0; i&lt;locations.length; i++) { if (locations[i][5] == "保守新政の会") { myIcon = greenPinIcon; } else { myIcon = bluePinIcon; } marker = new MarkerWithLabel( { position: position, map: map, draggable: false, raiseOnDrag: false, title: locations[i][2], labelContent: locations[i][2], labelAnchor: new google.maps.Point(50, 0), labelClass: "labels", // the CSS class for the label labelStyle: {opacity: 0.75}, icon: myIcon } ); } "locations" is a multi-dimensional array containing values: Latitude, Longitude, Name, Phone, Address, Group. Here are a few rows as a sample. 35.866446,139.803246,伊藤治,985-4826,越谷市蒲生三丁目7番7号,自由民主党/市民クラブ 35.877096,139.770734,野口佳司,964-9527,越谷市七左町七丁目175番地,自由民主党/市民クラブ 35.869426,139.780875,樫村紀元,987-1985,越谷市七左町一丁目332番地9,保守新政の会 I cannot see the desired result and all markers are being displayed with "bluePinIcon" as the marker icon. I am not sure whether it is Japanese string or something else which is causing the problem. I have included &lt;meta charset="utf-8" /&gt; as well to support unicode characters. I am new to JavaScript and Google Maps API. Any help would be much appreciated. Thanks.
tagged with: google-maps-api-3
score: 0
has comment: http://stackoverflow.com/comment/38493270
tagged with: google-maps
has comment: http://stackoverflow.com/comment/38522475
has comment: http://stackoverflow.com/comment/38562714
has comment: http://stackoverflow.com/comment/38535520
has title: Google Maps API V3 - Japanese String Comparison and Marker Image
has comment: http://stackoverflow.com/comment/38498955
type: UnansweredQuestion

http://stackoverflow.com/a/24859101
downvote count: 0
answers question: http://stackoverflow.com/q/24859072
type: Answer
upvote count: 1
score: 1
has body: Use required attribute: &lt;input type="text" required /&gt;

http://stackoverflow.com/q/24899645
downvote count: 0
tagged with: javascript
score: 4
accepted answer: http://stackoverflow.com/a/24900617
possible better answer: http://stackoverflow.com/a/24901049
has answer: http://stackoverflow.com/a/24901049
tagged with: jasmine
favorite count: 0
has title: DRY jasmine tests - share code between multiple .js files
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24900617
has body: TLDR: Is it possible to share code between two .js files? Situation: I set up an angular app using the yeoman command yo angular I have the following directory layout for my karma jasmine tests: ../client/test/spec .... /controllers ........ * jasmine tests * .... /directives ........ * jasmine tests * .... /services ........ * jasmine tests * for example I have two tests: userservice.js navservice.js Within each .js file i'm able to be DRY by sharing describe functions etc however is it possible to share some code between the .js files themselves? For example I could share this using function rather than cut and pasting it into each file. Coming from python I would generally make a file common.py and in my other test case files I would have from common import sharedFunction to make use of the sharedFunction edit: this is the command I use to run tests: /usr/local/bin/node "/Users/robertking/Library/Application Support/PyCharm30/js-karma/js_reporter/karma-intellij/lib/intellijRunner.js" --karmaPackageDir=/Users/../client/node_modules/karma --serverPort=8080 --urlRoot=/
type: Question
upvote count: 4
answer count: 2

http://stackoverflow.com/q/24786751
score: 0
has comment: http://stackoverflow.com/comment/38470217
tagged with: highcharts
has comment: http://stackoverflow.com/comment/38468144
tagged with: javascript
has comment: http://stackoverflow.com/comment/38468341
has comment: http://stackoverflow.com/comment/38468445
has body: Trying to remove the one of the chart from the compare charts contains 5 charts series. There were five check-boxes and each check-boxes on check add the charts...and if the checkbox uncheck than the chart get remove. i tried for chart.series[2] but if button 1 ,2 and 3 were checks the chart display all three and if uncheck second checkbox than chart 2 does not goes off instead show all three and same goes with other 3,4 and 5. $('li').click(function (evt) { if ($(this).attr("class") == "BtnA" || $(this).attr("class") == "BtnB" || $(this).attr("class") == "BtnC" || $(this).attr("class") == "BtnD" || $(this).attr("class") == "BtnE") { $(this).addClass("selected"); if ($(this).addClass("selected")) { switch ($(this).attr("class")) { case "BtnA selected": testing_name = "test1"; names = 'testname1'; break; case "BtnB selected": testing_name = "test2"; names = 'testname2'; break; case "BtnC selected": testing_name = "test3"; names = 'testname3'; break; case "BtnD selected": testing_name = "test4"; names = 'testname4'; break; case "BtnE selected": testing_name = "test5"; names = 'testname5'; break; } chart(testing_name, names); }else if ($(this).attr("class") == "BtnA selected" || $(this).attr("class") == "BtnB selected" || $(this).attr("class") == "BtnC selected" || $(this).attr("class") == "BtnD selected" || $(this).attr("class") == "BtnD selected") { $(this).removeClass("selected"); $('li').each(function () { $('#container').charts('tested').series[2].hide(); } and the function call for chart(); function chart(testing_name, names) { $(function () { var seriesOptions = [], yAxisOptions = [], seriesCounter = 0; if (data == 0) { series_names = ["data"]; jsonfilename = ["datajson"]; } data++; series_names.push(names); jsonfilename.push(testing_name); $.each(series_names, function (i, name) { $.getJSON(jsonfilename[i] + ".txt", function (data) { seriesOptions[i] = { name: name, data: data }; seriesCounter++; if (seriesCounter == series_names.length) { createChart(); } }); …
has title: removing chart series from compare charts
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38492927
type: Question

http://stackoverflow.com/q/24871677
has comment: http://stackoverflow.com/comment/38629632
has comment: http://stackoverflow.com/comment/38629061
downvote count: 1
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/38629296
has title: Highcharts - update column graph with setData() not working
has comment: http://stackoverflow.com/comment/38629171
type: Question
upvote count: 4
has answer: http://stackoverflow.com/a/24872526
linked to: http://stackoverflow.com/q/500431
answer count: 2
tagged with: highcharts
tagged with: javascript
tagged with: jquery
has body: I have a column graph that I would like to update when user selects an option from a drop down menu. I am able to render the column graph correctly but I am not able to update the graph using setData(). I am a little stumped because I am not receiving any errors. Any help or insight you can give me would be much appreciated! here is a link to my JSFiddle http://jsfiddle.net/mshirk/6QYzD/2/ and the Javascript code rendering the graph $(document).ready(function () { var chartBench = new Highcharts.Chart({ chart: { renderTo: 'containerYo', type: 'column' }, title: { text: '' }, credits: { enabled: false }, legend: {}, plotOptions: { series: { shadow: false, borderWidth: 0 } }, xAxis: { lineColor: '#999', lineWidth: 1, tickColor: '#666', tickLength: 3, categories: ['2011', '2012', '2013', '2014'], title: { text: 'Years' } }, yAxis: { lineColor: '#999', lineWidth: 1, tickColor: '#666', tickWidth: 1, tickLength: 3, gridLineColor: '#ddd', labels: { format: '$ {value}' }, title: { text: '' } }, series: [{ "name": "Yours", "data": [110, 100, 120, 130] }, { "name": "Another", "data": [100, 90, 110, 120] }, { "name": "Another B", "data": [90, 80, 100, 110] }, { "name": "Another C", "data": [80, 70, 90, 100] }] }); }); $("#list").on('change', function () { //alert('f') var selVal = $("#list").val(); if (selVal == "a") { chartBench.series[0].setData([ [{ "name": "Yours", "data": [110, 100, 120, 130] }, { "name": "Another", "data": [100, 90, 110, 120] }, { "name": "Another B", "data": [90, 80, 100, 110] }, { "name": "Another C", "data": [80, 70, 90, 100] }] ]); } else if (selVal == "b") { chartBench.series[0].setData([ [{ "name": "Yours", "data": [210, 200, 220, 230] }, { "name": "Another", "data": [200, 190, 210, 220] }, { "name": "Another B", "data": [190, 180, 200, 210] }, { "name": "Another C", "data": [180, 170, 190, 200] }] ]); } else { } });
accepted answer: http://stackoverflow.com/a/24872526
favorite count: 0
possible better answer: http://stackoverflow.com/a/24888436
has answer: http://stackoverflow.com/a/24888436

http://stackoverflow.com/q/24821467
tagged with: asp.net-mvc-4
has comment: http://stackoverflow.com/comment/38533387
has body: I have a edittext wihch users can write something and post my server. I want to know how can I control the text include javascript , jquery or something else which has bad behavior ? should I solve this android side or webservice side ? I use mvc 4.5 (I mean should I solve this c# side?) thanks in advance
has title: How can I understand javascript or jquery code inside in edittext?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38533513
has comment: http://stackoverflow.com/comment/38533312
tagged with: c#
tagged with: java
type: Question
score: 0
has comment: http://stackoverflow.com/comment/38533300
answer count: 1
has answer: http://stackoverflow.com/a/24821643
tagged with: javascript
tagged with: android

http://stackoverflow.com/comment/39039821
type: Comment
comment on: http://stackoverflow.com/a/24990267
has text: I tested on 3.0.4 without the problems you describe. Sorry that this is happening; I don't know if there is much else I can add at this point.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38669571
type: Comment
has text: Thanks for your help! I am receiving a 404 error when I try to execute that code in Firebug. Any idea why the same url would return a 404 error using native Javascript as opposed to AJAX?
comment on: http://stackoverflow.com/a/24888064
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38640187
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24877547
has text: @makerofthings7 You are correct. In my answer I assume that `foo` is the deserialized response, else you would encode the JSON data as a string.

http://stackoverflow.com/a/24863474
has body: You may consider using a whitespace between your parent and child elements, this will tell you want any child matching the child description inside the parent no matter how deep it is. This would give you the following: .ng-valid .regImg1{ background-image: url('../img/green-tick.png'); }
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24863173

http://stackoverflow.com/comment/38662419
has text: This is probably something you should talk to the Polymer developers about.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24889485

http://stackoverflow.com/comment/38609913
score: 0
type: AnswerComment
has text: That's what I feared. Thanks for the help.
comment on: http://stackoverflow.com/a/24861419
type: Comment

http://stackoverflow.com/a/24876041
type: Answer
upvote count: 1
score: 1
has body: window.onload = function(){ var ul = document.getElementById('list'); var li = ul.getElementsByTagName('LI') ; var more = document.getElementById('more'); var unit = li[0].offsetHeight; var offset = 50; // Increase this value if you want a narrower list adjust(); function adjust(){ var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); ul.style.height = (h - offset) + "px"; ul.style.overflow = "hidden"; more.innerHTML = Math.ceil(li.length - (parseInt(ul.style.height) / unit)) + " more"; } more.onclick = function(){ if(ul.offsetHeight &lt; unit * li.length){ ul.style.height = ""; ul.style.overflow = ""; more.innerHTML = "less"; }else{ adjust(); } }; window.onresize = function(){ adjust(); }; }; Working jsFiddle
answers question: http://stackoverflow.com/q/24872756
downvote count: 0

http://stackoverflow.com/q/24779039
tagged with: ios
tagged with: javascript
has body: iOS' browser only allows JavaScript FileReader to read images. Renaming images to .txt will make them fail the check, so I guess some validation exists. Is there a way to bypass it? $("#fileinput").change(function(evt){ var r = new FileReader(); r.onload = function(evt){ //file loaded successfuly contents = evt.target.result; ... } r.readAsText(f); });
has comment: http://stackoverflow.com/comment/38452906
has title: Set text in image on iOs' browser
answer count: 0
has comment: http://stackoverflow.com/comment/38456364
type: UnansweredQuestion
type: Question
score: 0
has comment: http://stackoverflow.com/comment/38456427

http://stackoverflow.com/comment/140274184
has text: @ShrinivasKalangutkar Where do you see `pieOptions` in this answer?
type: AnswerComment
comment on: http://stackoverflow.com/a/24865688
score: 0
type: Comment

http://stackoverflow.com/comment/38574867
type: Comment
has text: it's working now after i've added the parse line, but in my php function that i call in ajax i've write echo json_encode($test) it's not enough ?
comment on: http://stackoverflow.com/a/24843658
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38592945
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24852689
has text: You really don't need to explicitly set an initial value for `left`. The animation runs from whatever is the current `left` value (even if it is `auto`) to 500px.
score: 0

http://stackoverflow.com/a/24765453
accepted answer of: http://stackoverflow.com/q/24765389
type: AcceptedAnswer
downvote count: 0
has body: You can get the date object directly from datepicker instead of parsing it again from string var to_date=$("#to_date").datepicker( "getDate" ); See getDate() Docs
type: Answer
answers question: http://stackoverflow.com/q/24765389
upvote count: 1
score: 1

http://stackoverflow.com/q/24900705
tagged with: arrays
answer count: 1
has comment: http://stackoverflow.com/comment/38684405
tagged with: parse-platform
has comment: http://stackoverflow.com/comment/38683582
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24901625
has title: Android, Mandrill and Parse.com: Java ClassCastException: HashMap cannot be cast to a class
accepted answer: http://stackoverflow.com/a/24901625
type: Question
has body: I don't know whether the problem is sourced this far back, so I will tell you about it anyway. I have a function stored as Parse Cloud Code which retrieves the user's list of scheduled emails, as per Parse and Mandrill API documentation. However, the returned object from Mandrill, according to their docs, is an array of structs containing String key-value pairs. You can see the relevant docs here: https://mandrillapp.com/api/docs/messages.JSON.html#method=list-scheduled Parse Cloud Code can only be in Javascript, so how the returned array is interpreted by it, I am not sure. Either way, I have the cloud function return the returned array directly back to the Java method which called it in my Android application. I thought it would arrive as a JSONArray, but that did not seem to be the case. My editor, Android Studio, insisted that the return type was of ArrayList&lt;ScheduledEmail&gt;, and would not let me use any other parameter type, so I set it to that. (ScheduledEmail is the class I created in Java to match the elements contained in a returned struct from Mandrill, for this method. Was this part of where I went wrong? How do I convert those structs in the returned array into Java-compatible key-value pairs?) However, when I try to access an object contained in the array, I receive this error: java.lang.ClassCastException: java.util.HashMap cannot be cast to com.****.******.ScheduledEmail Nowhere does there seem to have been a HashMap used. What am I missing? Should I have first done something to the returned array before having it sent back to the Java method? Has Mandrill returned a HashMap? If so, why would it be interpreted as the Java class which I intended it to match to? The relevant portions of the Java method in question are as follows: HashMap&lt;String, Object&gt; params = new HashMap&lt;String, Object&gt;(); params.put("recipient", "koolstr@gmail.com"); ParseCloud.callFunctionInBackground("listScheduledEmails", params, new FunctionCallback&lt;ArrayLis…
tagged with: java
tagged with: javascript
tagged with: mandrill
score: 0

http://stackoverflow.com/comment/38511673
score: 0
type: Comment
type: QuestionComment
has text: After formatting your code I see that you have two closing tags and no opening tag (was the first one supposed to be an opening tag?), and you have a closing tag but no opening tag.
comment on: http://stackoverflow.com/q/24788912

http://stackoverflow.com/q/24799370
tagged with: angularjs
has answer: http://stackoverflow.com/a/24799812
type: Question
possible better answer: http://stackoverflow.com/a/24799651
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24799651
has comment: http://stackoverflow.com/comment/38491755
has body: I encountered this error : ERROR : DISCIPLINE.EVENTS is NULL It's raised by the second if statement. Here's the code : angular.forEach($scope.form.disciplines, function(discipline) { if (angular.isUndefined(discipline.events) || discipline.events == null){ angular.forEach(discipline.compets, function(compet) { var key = compet.eventCode; if (angular.isUndefined(discipline.events[key]) || discipline.events[key] == null) { discipline.events[key] = {fhi:{presented : null, box : null, notAccepted : null, withdrawn : null, accepted : null}} } }); } }); Thanks to all .
answer count: 2
accepted answer: http://stackoverflow.com/a/24799812
tagged with: javascript
score: 0
has title: Error : XXX is null on angularJS

http://stackoverflow.com/comment/38580355
type: Comment
type: AnswerComment
has text: Another side note, PHP is based off of Perl which is why they have similarities such as this.
comment on: http://stackoverflow.com/a/24846562
score: 0

http://stackoverflow.com/a/24865590
accepted answer of: http://stackoverflow.com/q/24865277
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24865277
has comment: http://stackoverflow.com/comment/59189951
type: Answer
has comment: http://stackoverflow.com/comment/59198177
has body: you could accomplish this in two ways: Remove the following lines of code from your html, 1 2 3 OR Add the following lines of code to your css. ol.bjqs-markers { display: none; }

http://stackoverflow.com/comment/38590993
score: 0
type: AnswerComment
has text: Don't forget to check it as right answer.. and up votes if don't mind.. ^^ Glad I can help you..
type: Comment
comment on: http://stackoverflow.com/a/24851921

http://stackoverflow.com/a/24906428
score: 0
accepted answer of: http://stackoverflow.com/q/24905548
type: AcceptedAnswer
type: Answer
has body: The problem is the success of yout $http request, your setting an string when your ng-mouseenter need a function. Change a variable name and you are done.
answers question: http://stackoverflow.com/q/24905548

http://stackoverflow.com/comment/38591875
comment on: http://stackoverflow.com/q/24852549
has text: I usually code with security in mind to prevent anything from slipping past me in the end.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24766669
has comment: http://stackoverflow.com/comment/38464994
has comment: http://stackoverflow.com/comment/38541583
has body: As has already been pointed out if you can get a hold of the binaries for an app (or for that matter ANY .NET application not just MVC) then it's definately game over. Just sat in front of me here and now I have 3 applications that make it child's play to see what's inside. Telerick - Just Decompile IL-Spy Are both freely downloadable in seconds, and the former of the two will take an entire compiled assembly, and actually not just reverse engineer the code, but will create me a solution file and other project assets too, allowing me to load it immediately back into Visual Studio. Visual Studio meanwhile, will allow me to reference the binaries in another project, then let me browse into them to find out their calling structure using nothing more than the simple object browser. You can obfuscate your assemblies, and there are plenty of apps to do this, but they still stop short of stopping you from de-compiling the code, and instead just make the reverse engineered code hard to read. on the flip side Even if you don't employ anything mentioned above, you can still use command line tools such as "Strings" or editors such as "Ultra Edit 32" and "Notepad++" that can display hex bytes and readable ASCII, to visually pick out interesting text strings (This approach also works well on natively compiled code too) If your just worried about casual drive by / accidental intrusions, then the first thing you'll want to do is to make sure you DON'T keep your source code in the server folder. It's amazing just how many production MVC sites Iv'e come accross where the developer has the active project files and development configuration actually on the server that's serving live to the internet. Thankfully, in most cases, IIS7 is set with sensible defaults, which means that things like '*.CS' files, or 'web.config' files are refused when an attempt is made to download them. It's by no means however an exact science, just try the following link to see what I mean!! filetype:config …
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/38547323
has comment: http://stackoverflow.com/comment/38542650
answers question: http://stackoverflow.com/q/24765627
type: Answer
has comment: http://stackoverflow.com/comment/38540354
has comment: http://stackoverflow.com/comment/38459136
score: 2
has comment: http://stackoverflow.com/comment/38465518
has comment: http://stackoverflow.com/comment/38464806
has comment: http://stackoverflow.com/comment/38541566

http://stackoverflow.com/comment/38532920
comment on: http://stackoverflow.com/a/24820584
has text: @MrSeo did you read the last part of my answer, and look at the fiddle?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38578614
type: AnswerComment
has text: What will `clearTimeout` do without any parameters, is it really necessary there?
type: Comment
comment on: http://stackoverflow.com/a/24845634
score: 1

http://stackoverflow.com/comment/38521022
has text: works fine for me, I can't get it to reveal the bug you're facing, check it with another browser and see if it still consists!
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24814691

http://stackoverflow.com/a/24782930
downvote count: 0
upvote count: 2
type: Answer
has body: To remember values you can use : HTML5 Storage like localStorage or SessionStorage. https://developer.mozilla.org/en-US/docs/DOM/Storage cookie : https://developer.mozilla.org/en-US/docs/DOM/document.cookie Use like that : localStorage.variable = "saveMe";
answers question: http://stackoverflow.com/q/24782725
score: 2

http://stackoverflow.com/comment/80909681
score: 2
comment on: http://stackoverflow.com/a/24830607
type: AnswerComment
has text: `npm root -g` returns `/home/ubuntu/.npm-global/lib/node_modules` on EC2 ubuntu.
type: Comment

http://stackoverflow.com/comment/38552319
has text: If you're referring to the `npm WARN unmet dependency` lines you can safely ignore them. Try running `grunt serve`. If something's wrong it will let you now :)
score: 0
comment on: http://stackoverflow.com/q/24830643
type: QuestionComment
type: Comment

http://stackoverflow.com/q/24765791
has answer: http://stackoverflow.com/a/36921686
answer count: 2
has answer: http://stackoverflow.com/a/25165838
downvote count: 0
tagged with: javascript
has title: What the best way to debug gulp plugins during developing using webstorm
possible better answer: http://stackoverflow.com/a/36921686
accepted answer: http://stackoverflow.com/a/25165838
tagged with: gulp
favorite count: 0
tagged with: node.js
has body: I'm trying to find the best way for debug gulp plugins during developing using webstorm. I have a project example and couple gulp plugins, and I want to trace and inspect the code in webstorm right after I run gulp command in terminal. Ideally I want to add debugger statement or breakpoint inside the webstorm to trace the code execution.
type: AnsweredQuestion
score: 7
upvote count: 7
type: Question

http://stackoverflow.com/q/24871066
accepted answer: http://stackoverflow.com/a/24874809
tagged with: php
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38630299
has title: Pull down updates when user click on updates
score: -1
tagged with: mysql
type: Question
has comment: http://stackoverflow.com/comment/38632714
has comment: http://stackoverflow.com/comment/38631429
has answer: http://stackoverflow.com/a/24874809
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38631866
has body: Hello people please help me with this! what i want to achieve is similar to twitter update notification bar that displays the number of new tweets and when you click on it; it drops the latest tweets on the previous tweets. i have been banging my head over this for days now, Here is what i tried. //feed.php &lt;?php session_start(); $cxn = mysqli_connect('localhost','root','','my_db'); $query = "SELECT insertion_time FROM feeds ORDER BY insertion_time DESC LIMIT 0,1"; $result = mysqli_query($cxn, $query) or die (mysqli_error($cxn)); $latest_feed = mysqli_fetch_assoc($result); $_SESSION['latest_id'] = $latest_feed['insertion_time']; $latest_news = $_SESSION['latest_id']; echo $check = &lt;&lt;&lt;JS_SCRIPT &lt;script&gt; interval = setInterval(function(){ check_update($latest_news); },5000); &lt;/script&gt; JS_SCRIPT; ?&gt; &lt;script src='jquery.js'&gt;&lt;/script&gt; &lt;script&gt; function check_update(old_feed) { $.post('server.php',{get_num_update: old_feed},function(data){ $("#update_bar").html(data); }); //checks for number of updates $.post('server.php',{retrieve_update: old_feed},function(data){ $("#hidden_div").html(data); }); //retrieves the update into a div } $(function(){ $("#update_bar").click(function(){ $("#hidden_div").prependTo("#news_feed_container").fadeIn(500); }); }); &lt;/script&gt; //server.php if(isset($_POST['get_num_update']) &amp;&amp; !empty($_POST['get_num_update']) &amp;&amp; is_numeric($_POST['get_num_update'])) { $old_feed = $_POST['get_num_update']; $query = "SELECT id FROM feeds WHERE insertion_time &gt; $old_feed ORDER BY insertion_time DESC"; $exec = mysqli_query($cxn, $query) or die(mysqli_error($cxn)); $num_updates = mysqli_num_rows($exec); echo ($num_updates &gt; 0) ? $num_updates.' new updates' : ''; } if(isset($_POST['retrieve_update']) &amp;&amp; !empty($_POST['retrieve_update']) &amp;&amp; is_numeric($_POST['retrieve_update'])) { while($result = mysqli_fetch_assoc($exec)) { extract($result); echo &lt;&lt;&lt;HTML //inserti…

http://stackoverflow.com/comment/38471763
type: Comment
comment on: http://stackoverflow.com/q/24788522
has text: It doesn't work. When I change the smugmug favicon address to something that is clearly not present, there is no affect on the image src. It doesn't load my secondary link http://www.prometeogallery.com/wp-content/uploads/2011/01/Invitation_NO_GLOBALTOUR-800x575.jpg
score: 0
type: QuestionComment

http://stackoverflow.com/q/24898278
tagged with: windows-phone-8
type: Question
has answer: http://stackoverflow.com/a/64647717
tagged with: javascript
has title: Phonegap/Angular - angular.element().scope() not working
answer count: 1
downvote count: 0
favorite count: 0
tagged with: cordova
has body: I'm overriding the back-button behaviour for Android/WP8 for my Phonegap/Angular app. I had implemented it a few weeks ago, and it was working like a charm. But, due to a repository blunder I made, that part of the code became lost. So today I've been recreating it, but no matter what I do, I cannot get to my handleBack() function in my MainController. In my index.html, I'm including all my various .js files in the header, and here's my body: &lt;body ng-view ng-class="slide" ng-controller="MainController" &gt; &lt;script type="text/javascript"&gt; document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady(event){ document.addEventListener("backbutton", handleBackButton, false); } function handleBackButton(event){ alert("entered handleBackButton"); angular.element('[ng-controller=MainController]').scope().handleBack(event); } &lt;/script&gt; &lt;/body&gt; and here's my MainController: .controller('MainController', ['$scope', '$rootScope', '$window', '$location', 'currentLocale', 'Auth', function ($scope, $rootScope, $window, $location, currentLocale, Auth) { $scope.slide = ''; $rootScope.back = function() { $(window).blur(); $scope.slide = 'slide-right'; if (typeof (navigator.app) !== "undefined") { navigator.app.backHistory(); } else { $window.history.back(); } } $rootScope.go = function(path, direction) { $(window).blur(); $scope.slide = typeof direction !== 'undefined' ? direction : 'slide-left'; $location.url(path); } $rootScope.login = function() { $scope.slide = 'slide-right'; $location.path('/'); $window.localStorage.clear(); } $rootScope.logout = function() { if(navigator.notification.confirm("Are you sure you want to logout?", function(index){ if(index == 1){ Auth.logout(function(data) { $rootScope.login(); }); } }, "Confirm")) { Auth.logout(function(data) { $rootScope.login(); }); } } $rootScope.showAlert = function(message, title, labels, callback) { var bl = (labels) ? labels : currentLocale.OK; var t = (title) ? title : ""; v…
tagged with: angularjs
type: UnansweredQuestion
tagged with: android
score: 2
upvote count: 2

http://stackoverflow.com/comment/52375133
score: 1
comment on: http://stackoverflow.com/a/29383892
type: AnswerComment
has text: HI, thanks do you have any idea how to create folder using API?
type: Comment

http://stackoverflow.com/q/24758728
has title: Comparing Javascript Input
has body: My goal is to have one password open one file and another password open a different file. The first half seems to be working but the second password will not. &lt;script type="text/javascript"&gt; var password; var password2; var pass1 = "password"; // place password here var pass2 = "password2"; // place password here password=prompt("Please enter your password:",""); if (password==pass1) { window.location= "WEB-PL_dom.xls"; } else if (password2==pass2) { window.location= "WEB-PL_int.xls"; } else window.location= "pass_failed.html"; // file to load if password is incorrect // End --&gt; &lt;/script&gt;
has answer: http://stackoverflow.com/a/24758773
upvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24758773
downvote count: 3
type: Question
score: -2
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/38482951
comment on: http://stackoverflow.com/a/24794440
score: 0
type: AnswerComment
type: Comment
has text: However, it doesn't really help to understand the details what `new` does :-)

http://stackoverflow.com/comment/38534316
comment on: http://stackoverflow.com/q/24822087
has text: I don't think this is possible with CSS
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24821391
has body: I am trying to validate email address input by user in javascript something like this var email = document.getElementById("&lt;%=Email.ClientID%&gt;").value; // checks if the e-mail address is valid var emailPat = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*(\+[a-z0-9-]+)?@[a-z0-9-]+(\.[a-z0-9-]+)*$/i; var matchArray = email.match(emailPat); if (matchArray == null) { alert("Not a valid e-mail address"); document.getElementById("&lt;%=Email.ClientID%&gt;").focus(); return false; } This works great it validates email address ok but it return false on this email address ayaz5+any+thing+you+want@gmail.com what I want is this is also a valid email address what changes do I need to made in this thanks
type: Question
tagged with: validation
answer count: 1
accepted answer: http://stackoverflow.com/a/24821529
tagged with: javascript
linked to: http://stackoverflow.com/q/201323
score: 0
tagged with: email
has title: email address validation javascript for multiple '+' signs
has answer: http://stackoverflow.com/a/24821529
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/201323

http://stackoverflow.com/comment/38698158
comment on: http://stackoverflow.com/q/24908710
type: QuestionComment
has text: You are right. I forgot to make both 'l' capital. I'm Gonna edit it. Thanks
score: 0
type: Comment

http://stackoverflow.com/comment/38495935
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24801770
type: QuestionComment
has text: Try actually adding a hidden input to the form, and adding the form to the DOM before you submit it.

http://stackoverflow.com/q/24832509
has body: When cursor is hovered on video when it's playing, then animation of word 'pause' is fine, and when I toggle it - it's fine too, but when video is stopped, cursor is removed from video and again hovered on it - then my animation of word 'play' is failed. Tried to set different behavior when video is playing and stopped: var x = myVid.play(); var x = true; if ( x ) { } var y = myVid.pause(); var y = true; if ( y ) { } How can I fix it or any ideas would be great. fiddle live example
accepted answer: http://stackoverflow.com/a/24832918
tagged with: animation
has answer: http://stackoverflow.com/a/24832918
tagged with: video
type: AnsweredQuestion
type: Question
tagged with: javascript
has title: Video play pause button animation
tagged with: jquery
tagged with: html5-video
score: 0
answer count: 1

http://stackoverflow.com/comment/38535460
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24822833
has text: why not add a parameter to your function `updateView` like this `updateView(para)`. Send `true` to this from where you want to happen this change for others don't send
score: 0

http://stackoverflow.com/q/24770154
tagged with: http://stackoverflow.com/tag/svg
duplicate of: http://stackoverflow.com/q/9872947
type: UnansweredQuestion
has title: Change SVG Icons Color with CSS or JavaScript
type: Question
has body: In a browser, can the color of an SVG icon be changed with CSS or JavaScript?
answer count: 1
tagged with: javascript
score: 0
linked to: http://stackoverflow.com/q/9872947
tagged with: css
has answer: http://stackoverflow.com/a/24770176

http://stackoverflow.com/a/24797996
score: 8
type: Answer
has body: You should use onKeyPress event to call the function. &lt;asp:TextBox ID="search" name="Search" runat="server" onKeyPress="javascript:text_changed();"&gt;&lt;/asp:TextBox&gt;
downvote count: 0
upvote count: 8
accepted answer of: http://stackoverflow.com/q/24797445
answers question: http://stackoverflow.com/q/24797445
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/126401091

http://stackoverflow.com/q/24815360
linked to: http://stackoverflow.com/q/5186441
score: 2
answer count: 0
upvote count: 2
type: Question
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/45155673
has comment: http://stackoverflow.com/comment/38523402
tagged with: javascript
has body: I am struggling with the jQuery mouseleave event on IE11 if I tap a link by touch screen. Every time I tap a link by touch, a mouseleave event fires afterwards, although I don't tap somewhere else. On Chrome and FF, it works fine as they reposition the actual cursor position whereas IE leaves it at the previous position. See the following script - works on touchscreens in FF and Chrome, and by using the mouse. http://jsfiddle.net/daSL2/ Expected behaviour: The mouseleave event should only fire if I move away with the mouse or tap somewhere else by touch screen. (Tested on Lenovo Yoga 13) JS: $(function () { $('a').on({ click: function (e) { writeDebugText('click'); }, mousedown: function (e) { writeDebugText('mousedown'); }, mouseenter: function (e) { writeDebugText('mouseenter'); }, mouseleave: function (e) { writeDebugText('mouseleave'); } }); }); var last = new Date(); function writeDebugText(text) { var o = $('div.Debug'); var now = new Date(); var diff = now.getTime() - last.getTime(); o.html(text + " @ " + diff + " " + o.html()); last = now; } HTML: Click me Thanks for your help!
tagged with: mouseevent
tagged with: touch
downvote count: 0
tagged with: jquery
favorite count: 0
has title: jQuery mouseleave event always fires in IE11 when I tap via touch screen
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38531548

http://stackoverflow.com/comment/38539202
comment on: http://stackoverflow.com/q/24824839
has text: `CalculateRoutes()` runs the function immediately. Lose the parenthesis.
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/q/24827840
has title: Syntax of dynamic window.open method
type: UnansweredQuestion
tagged with: onclick
type: Question
tagged with: javascript
tagged with: window.open
score: 0
has body: i know this is a simple question, but i can't get this syntax to render properly for me in my onclick event when doing this in code; else{ hhResults = hhResults + "&lt;a href='#' onClick='window.open(\'/applications/app360/dashboard.aspx?vchAcctKey=&amp;amp;ihhid=" + this.ID + "&amp;amp;tcn=&amp;amp;icfnaccountid=');'&gt;" + this.displayText + "&lt;/a&gt;"; My syntax is wrong below i just want to add the window.open in the onClick event of the anchor tag, i've been trying for 25 minutes and can't get it to render correctly. Currently in chrome it renders like this; &lt;a href="#" onclick="window.open(" applications="" app360="" dashboard.aspx?vchacctkey="&amp;amp;ihhid=978089&amp;amp;tcn=&amp;amp;icfnaccountid=');'"&gt;BEVILACQUA, FRANK &amp;amp; MARJORIE&lt;/a&gt;
has answer: http://stackoverflow.com/a/24827961
answer count: 1

http://stackoverflow.com/comment/38781396
has text: OK, I finally manage to delete the Web linked app (I deleted the game from the console and created it back). What am I supposed to write in the field "Launch URL" ? Something like : "http://localhost/reset-o-matic/achievement.html" ??
comment on: http://stackoverflow.com/q/24845701
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/38581726
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24847292
has text: b1j, It's still allowing spaces in the updated fiddle. Such as, if you type "this is a test" in Flat1 input the resulting output into the Price1 input is "this is a test" when it should be "thisisatest"
score: 0

http://stackoverflow.com/comment/38685966
comment on: http://stackoverflow.com/q/24901903
type: Comment
type: QuestionComment
has text: So you're saying it disappears before the click event gets triggered?
score: 0

http://stackoverflow.com/comment/38565418
score: 0
type: Comment
type: QuestionComment
has text: i dont want to save data into the database before user clicks on submit. I want to temporarily store it in array or something else
comment on: http://stackoverflow.com/q/24837711

http://stackoverflow.com/a/24901938
score: 0
answers question: http://stackoverflow.com/q/24901841
type: Answer
has body: Write your script like bellow. var showOptionsAcorrdingCheckbox = function(){ var lives_in_css = $('#natural_person_lives_in_ccs_0').is(':checked'); if (lives_in_css) { $(".shipping_from option[value='MRW']").remove(); } else { $(".shipping_from").append(' Option1 '); } } $(document).ready(function(){ $(':checkbox').change(showOptionsAcorrdingCheckbox); });

http://stackoverflow.com/comment/38680653
comment on: http://stackoverflow.com/q/24899168
type: Comment
type: QuestionComment
score: 3
has text: I'd say it does not match a URL but an e-mail address. And it's a pretty bad regex for that, as it will not support any of the new gTLDs (and without an `i` modifier, it will not match existing ccTLDs. Also I fail to understand the purpose of a regex that matches either strictly only spaces, or any text that contains an e-mail address somewhere in it (due to the use of the enclosing `\b`s.

http://stackoverflow.com/a/24855320
score: 4
type: Answer
has body: I'm not all that familiar with Jade, but I have looked into it a little bit before. After playing around a while here, I was able to get this to work: a.apply-url(href="#{locals['apply-url']}") {"apply-url": "foo"} produces: &lt;a href="foo" class="apply-url"&gt;&lt;/a&gt; This works because this particular implementation stores the data in a local variable named locals which is then closed over by the templating function. As far as I can tell, this is an implementation detail, and I wouldn't necessarily expect this to work in other Jade implementations.
upvote count: 4
accepted answer of: http://stackoverflow.com/q/24855111
downvote count: 0
answers question: http://stackoverflow.com/q/24855111
type: AcceptedAnswer

http://stackoverflow.com/q/24863620
tagged with: php
has title: PHP exit on page ajax abort()
linked to: http://stackoverflow.com/q/5997102
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/24863865
type: Question
tagged with: javascript
has body: I would like to have the browser wait for any notifications but stop waiting if a link is clicked. That's why I have a PHP script which as a while loop, which ends if something happens and then returns the event. PHP require 'required.php'; ignore_user_abort ( false ); // I hoped this does it set_time_limit ( 60 ); $lock = false; // maybe this helps? register_shutdown_function ( function () { // click the stop button in your browser ... $lock = true; exit (); } ); if (isset ( $_SESSION ['user'] )) { while ( ! new_event () &amp;&amp; !$lock) { if (connection_status () != CONNECTION_NORMAL) { break; // and maybe this works??? } sleep(1); } echo json_encode (array('someparameter','...') ); } else { echo 'login first'; } My JQuery AJAX code starts the waiting after load and calls abort() after a link is clicked var pollReq; $(document).ready(function() { doPoll(); // do the first poll }); function doPoll() { pollReq = $.post("wait.php", {parameter: value}, function(result) { // new event, do something doPoll(); // this effectively causes the poll to run again as // soon as the response comes back }, 'json'); } And if a link is clicked $('a[href]').not('noajax').click( function(e) { e.preventDefault(); if (typeof pollReq !== 'undefined') { pollReq.abort(); // stop waiting } // Do something... }); I can't find the mistake/cause, maybe someone finds it. Thank you
accepted answer: http://stackoverflow.com/a/24863865
answer count: 1
downvote count: 0
tagged with: comet
tagged with: jquery
favorite count: 0
tagged with: ajax

http://stackoverflow.com/comment/38436461
type: QuestionComment
comment on: http://stackoverflow.com/q/24770101
has text: Why are you adding the `href` *after* you create the `a` tag? You're also replacing every `href` with the same value on each loop. Why not put it in when you create the `a` tag string? Also, since you have the `mydata...` part in quotes, that's a string literal that's put in that attribute, not it's related variable.
score: 0
type: Comment

http://stackoverflow.com/q/24795306
has title: Javascript onKeyDown function
has answer: http://stackoverflow.com/a/24795519
type: AnsweredQuestion
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/38484326
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/38484343
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24795519
favorite count: 0
upvote count: 3
has answer: http://stackoverflow.com/a/24795448
accepted answer: http://stackoverflow.com/a/24795448
has body: I have written a simple javascript code and added event listener for onKeyDown/onKeyUp . It works just fine and detects the Control key as required. However the Control key shows pressed even when I am using OS shortcuts. To be specific I am on Ubuntu and use Ctrl+Alt+ arrow keys to switch workspaces. So when I switch the workspace and come back to Chrome, it shows Control key pressed already. I dont mind it but even when the shortcut keys are released, onkeyup method is not called and hence the status shows Ctrl key pressed. How do I avoid this? Below is my code: function keypressedfn(e){ if(e.which == CTRL_KEY){ console.log("isCtrl pressed"); isCtrl=true; if(isWheel){ e.preventDefault(); e.stopPropagation(); } } }; function keyreleasedfn(e){ if(e.which == CTRL_KEY){ console.log("isCtrl released"); isCtrl=false; isWheel=false; } }; $(document).ready(function(){ $(document).keydown(keypressedfn); $(document).keyup(keyreleasedfn); });
has comment: http://stackoverflow.com/comment/38484782

http://stackoverflow.com/comment/38670199
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24893170
score: 0
has text: try calling AddTHEAD() method in document ready function using jquery

http://stackoverflow.com/comment/38625046
score: 0
type: QuestionComment
has text: Thank you all for all of your help. This actually gets me much further than anything I've tried previously.
comment on: http://stackoverflow.com/q/24869121
type: Comment

http://stackoverflow.com/q/24777886
has title: What is the correct sequence of including jquery files?
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/24778083
tagged with: javascript
tagged with: jquery
tagged with: ajax
possible better answer: http://stackoverflow.com/a/24778083
has answer: http://stackoverflow.com/a/24777954
tagged with: http://stackoverflow.com/tag/html
has body: Today i wanted to add datepicker() to my page.So I downloaded jqueryui and added then in the sequence below. It didn't work. It took me whole day to figure out what is wrong. it was the SEQUENCE of js files included!!! To work my code i had to include them like bellow.("jquery.js" position had to change) Can some one explain this please. Please give me a Source so I wont make this mistake again.
has comment: http://stackoverflow.com/comment/38450615
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38450621
has comment: http://stackoverflow.com/comment/38451187
has comment: http://stackoverflow.com/comment/38450690
type: Question
has comment: http://stackoverflow.com/comment/38450634
accepted answer: http://stackoverflow.com/a/24777954
tagged with: jquery-ui
has answer: http://stackoverflow.com/a/24778117

http://stackoverflow.com/q/24842979
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/24843042
type: Question
has body: I'm really new at trying to use jQuery, so please forgive me for asking what is likely a simple question. Perhaps it isn't even related to jQuery, but anyway, here's the scenario. I'm trying to put in a hidden div which I only want to show up when the user hovers their mouse over the Learner's anchor tag on the page. I've started with only one anchor tag, to get it working first before implementing the rest of them. I've downloaded a jQuery library and included a reference to it, so here's some of what I've got in my page's head section: Next I've defined an unordered list, using the styling above to make it horizontal, and I've got a hidden div after it, which I want to show when the user moves their mouse over the first anchor in the unordered list. Here's the relevant HTML from within the body tag: Home Learners Teachers Businesses Contact Us Description A Description B Description C However, when I run this from within the browser (IE11) nothing happens. Using the F12 web developers tools built into IE11 I learn that it giving an error of "showHide is undefined". Why is it doing that? The showHide() function is most certainly in the jquery-1-11.1.js file, which most certainly is in my js folder. What have I done wrong, or failed to take into account?
tagged with: javascript
answer count: 2
upvote count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/24843042
has comment: http://stackoverflow.com/comment/38573462
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/24843029
accepted answer: http://stackoverflow.com/a/24843029
has title: Why is the jQuery function showHide() undefined?

http://stackoverflow.com/a/24814691
answers question: http://stackoverflow.com/q/24814611
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/38520800
has comment: http://stackoverflow.com/comment/38520968
has comment: http://stackoverflow.com/comment/38520900
has comment: http://stackoverflow.com/comment/38521022
has comment: http://stackoverflow.com/comment/38521063
has comment: http://stackoverflow.com/comment/38520866
has body: here you go: $("#listing-new").hide(); $(document).on('click',function(e){ if (!$('#listing-new').is(e.target) &amp;&amp; $('#listing-new').has(e.target).length === 0 &amp;&amp; !$('#list-item-btn').is(e.target) &amp;&amp; $('#list-item-btn').has(e.target).length === 0){ $("#listing-new").hide(); } else{ $("#listing-new").show(); } }); The Working DEMO

http://stackoverflow.com/a/24846813
type: AcceptedAnswer
has body: Here is a different approach... You can just clone it and replace it with itself. Change to this: $("#submit").on("click", function () { if ($("#fileName").val() === '') { alert("please selct a file"); } else { alert("successfully uploaded"); $('#fileName').replaceWith($('#fileName').val('').clone(true)); } }); JSFiddle Demo
type: Answer
answers question: http://stackoverflow.com/q/24846717
accepted answer of: http://stackoverflow.com/q/24846717
score: 0

http://stackoverflow.com/q/24866131
has title: Use several symbols on a serie FlotJS
type: AnsweredQuestion
type: Question
linked to: http://stackoverflow.com/q/8926513
has answer: http://stackoverflow.com/a/24869024
score: 0
answer count: 1
tagged with: flot
tagged with: javascript
has body: I'm using FlotJS library and I'd like to display some points on a serie with several symbol types. I'd like having lines displayed and several selected points but not all. Is there any way to do this ? EDIT : I've just found jquery flot, varying size and color for each point who helped me understanding how it works but, I'd like keep grid : {hoverable : true} And it creates a display bug cause of modulo, is there a way to override that ? The associated JSFiddle Example
accepted answer: http://stackoverflow.com/a/24869024

http://stackoverflow.com/a/62901665
answers question: http://stackoverflow.com/q/24758817
type: Answer
has body: Quick solution: call it like this: console.log(localeN(value, 4)); function localeN(v, n) { var i, f; i = Math.floor(v); f = v - i; return i.toLocaleString() + f.toFixed(n).substr(1); }
score: 0

http://stackoverflow.com/q/24814855
answer count: 0
score: 1
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: arrow-keys
has comment: http://stackoverflow.com/comment/38521709
favorite count: 0
has title: selecting current highlighted button with arrow key with Javascript
type: UnansweredQuestion
has body: Trying to be able to select the current highlighted button using the right arrow key using javascript. case hcap.key.Code.RIGHT : var select = "button" + index; document.getElementById(select).onclick(); break; thats what i got so far.
has comment: http://stackoverflow.com/comment/38521188

http://stackoverflow.com/comment/38539445
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24824943
type: Comment
has text: Thanks, but I'm more interested in fastest way in HTML than wrappers which does it.

jquery-autocomplete
tags question: http://stackoverflow.com/q/24783452
type: Tag
tags question: http://stackoverflow.com/q/24881517
tag name: jquery-autocomplete
tags question: http://stackoverflow.com/q/24851727

http://stackoverflow.com/comment/38606325
score: 0
type: AnswerComment
type: Comment
has text: I have added the update function in the question in the Update: section. Can you please check it... It is not getting the images from the album... In face not from my account...
comment on: http://stackoverflow.com/a/24849527

http://stackoverflow.com/comment/127093334
score: 2
comment on: http://stackoverflow.com/a/55260552
type: AnswerComment
type: Comment
has text: I vote for this solution. Regarding PERFORMANCES, It is logical that its one round is faster than 2 rounds of filter + map actions, unless its 'flattening' part causes performance downgrading

http://stackoverflow.com/comment/38547119
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24826992
has text: Right, I guess I didn't fully understand your context. It will be run twice every time it changes the value, because changing the value triggers it to be run again. This is an awesome way of exhausting the stack if you're not careful. A directive like this still gives you the power to control what happens when the model changes (and with it's brother, the `$formatter` can provide a nice distinction between view and model). I guess it just wasn't the right tool this time around.
score: 0

http://stackoverflow.com/comment/38515267
comment on: http://stackoverflow.com/q/24811863
type: QuestionComment
has text: Did you tried to put the text on an $scope variable?
score: 1
type: Comment

http://stackoverflow.com/comment/38657506
type: Comment
comment on: http://stackoverflow.com/a/24886872
has text: NO,I can access data send from form
score: 0
type: AnswerComment

http://stackoverflow.com/q/24793070
upvote count: 6
has answer: http://stackoverflow.com/a/24793479
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38480324
possible better answer: http://stackoverflow.com/a/24793257
type: Question
has answer: http://stackoverflow.com/a/24793257
tagged with: validation
has body: I'm building a form with AngularJS, and I noticed some behavior I don't understand. When I assign ng-minlength=5 as an input attribute, AngularJS unbinds the value until it is longer than required. This is inconvenient for me because I'd like to tell the user how much content they've entered using user.lifestory.length. Why does AngularJS work this way? How can prevent Angular from unbinding the value while it's invalid? Life story: An example of this is here: http://jsfiddle.net/J67jm/3/ You can see the behavior I'm talking about by filling in the life story field.
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24793479
score: 6
answer count: 3
has title: How do I prevent AngularJS from unbinding a form input's value from its model when it's invalid?
linked to: http://stackoverflow.com/q/18676461
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/24794846

http://stackoverflow.com/a/24774270
score: 0
type: Answer
has body: I have done a work around for this here: JsFiddle //current timestamp var curr_date = $.now(); //random data generator up to 300 function randomData(label, color) { //counter var count = 0; //rand value function randValue() { return Math.floor(Math.random() * 300); } //this.test=[count,count++,count++]; this.series = [ {label: label, color: color, data: [ [curr_date - (count * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()], [curr_date - (count++ * 3600000), randValue()] ]} ]; } var randomData=new randomData('label','color'); console.log(randomData.series);
answers question: http://stackoverflow.com/q/24773922

jsp
tags question: http://stackoverflow.com/q/24824338
tags question: http://stackoverflow.com/q/24822593
tags question: http://stackoverflow.com/q/24871661
tags question: http://stackoverflow.com/q/24773497
tags question: http://stackoverflow.com/q/24773426
tags question: http://stackoverflow.com/q/24796464
tags question: http://stackoverflow.com/q/24788800
tags question: http://stackoverflow.com/q/24887761
tags question: http://stackoverflow.com/q/24772500
type: Tag
tags question: http://stackoverflow.com/q/24781801
tags question: http://stackoverflow.com/q/24821400
tags question: http://stackoverflow.com/q/24904938
tag name: jsp
tags question: http://stackoverflow.com/q/24903273
tags question: http://stackoverflow.com/q/24803912
tags question: http://stackoverflow.com/q/24888161
tags question: http://stackoverflow.com/q/24842237
tags question: http://stackoverflow.com/q/24873944
tags question: http://stackoverflow.com/q/24827991
tags question: http://stackoverflow.com/q/24823909
tags question: http://stackoverflow.com/q/24761070
tags question: http://stackoverflow.com/q/24760283
tags question: http://stackoverflow.com/q/24880198
tags question: http://stackoverflow.com/q/24752111
tags question: http://stackoverflow.com/q/24893371
tags question: http://stackoverflow.com/q/24820869
tags question: http://stackoverflow.com/q/24837711

http://stackoverflow.com/comment/38552509
comment on: http://stackoverflow.com/q/24829688
score: 0
type: Comment
type: QuestionComment
has text: @malkam - Tried it and it still doesn't work. My popup dialog was empty and when I did a view source, the load looked like this --> $(this).load(''); <--. This doesn't make sense.

http://stackoverflow.com/q/24825499
has title: addEventListener() to non-existent elements?
score: 13
upvote count: 13
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24825565
accepted answer: http://stackoverflow.com/a/24825565
type: Question
has answer: http://stackoverflow.com/a/24825586
possible better answer: http://stackoverflow.com/a/73318837
has answer: http://stackoverflow.com/a/73318837
tagged with: addeventlistener
has comment: http://stackoverflow.com/comment/38540513
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38540561
has body: I have attached a click event listener on an element like: document.querySelector('.class-name').addEventListener('click', function () { }); The element may or may not get generated from the server-side. So, if the server generates the element then all works fine but if not then I get an error like: Cannot read property 'addEventListener' of null I know why this happens, but I want to know whether there is a better way of attaching event listeners to elements that won't generate such errors?
has answer: http://stackoverflow.com/a/24825544
answer count: 4
favorite count: 0

http://stackoverflow.com/comment/66846410
score: 1
has text: @HussienK I prefer to use a block if the function should have no return value so intent is obvious to the next developer who reads the code. Changing that to `{(child) => this._child = child}` would create a Function that always returned `true`, but that value is not used by React's `ref` attribute.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24848228

http://stackoverflow.com/a/24807854
has body: You can directly call the Javascript from jQuery. After all Jquery is Javascript library. You call it in the below way. Even you can pass arguments if you want. returnData = ""; $(function () { $("#combobox").selectmenu({ change: function (event, ui) { // console.log(ui); selected_value = ui.item.value; // alert("You selected : "+selected_value); returnData = selected_value; //you can call as below update(); } }); }); function update() { alert(returnData); }
type: Answer
accepted answer of: http://stackoverflow.com/q/24807701
score: 0
answers question: http://stackoverflow.com/q/24807701
type: AcceptedAnswer

http://stackoverflow.com/comment/38570845
has text: You need to use square bracket notation to access that key name. rows[i].bestPrice = rows[i]['MIN(inventory.price)']; delete rows[i]['MIN(inventory.price)'];
comment on: http://stackoverflow.com/q/24841190
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/24843747
answers question: http://stackoverflow.com/q/24843602
has body: The first call to next works because you are grabbing the first h3 element (thereby limiting your collection of items to 1 element), and looking for a sibling h3. The second call is undefined since Header 2 does not have an additional sibling h3. Header 1 Header 2 Header 3 If you want to perform manipulations over the all of your h3 elements, use jQuery's collection methods: var inputs = $('h3'); inputs.each(function () { console.log($(this).text()); }); // Header 1 // Header 2 // Header 3 console.log(inputs.eq(1).text()); // Header 2 console.log(inputs.eq(0).text()); // Header 1
type: Answer
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/24843602
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/38550565
type: Comment
has text: Maybe you could change the height of the ` ` manually on mobile devices via CSS after skrollr has been initiated? CSS: `.body-fixed{height: 2000px; overflow: hidden;}` and JS could say something like: `if([mobile device detection]) {$('body').addClass('body-fixed');};`
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24817968

http://stackoverflow.com/q/24799459
tagged with: ng-grid
accepted answer: http://stackoverflow.com/a/24801114
favorite count: 0
has title: access header value from ng-grid
linked to: http://stackoverflow.com/q/1116708
has body: We are currently using ng-grid to display click-able flags in a grid, ie. cell 1 contain a green flag, cell 2 empty, cell 3 contains a red flag. The flag represents the status. To make the flag clickable, we have created a directive within each sell &lt;gridresultsummary data-ng-click="filterReportByOrderFromSummary()" resultsummaryflag="{{row.entity[col.field]}}" /&gt; the filterReportByOrderFromSummary() function at the moment, simply shows a static alert. What we are struggling to achieve, it a way to pass the column header into this function. we have tried many variations of {{row.entity[col.field]}} {{row.entity[col.header]}} {{row.entity[col.headerValue]}} however, still cant seem to capture it. What is the syntax to retrieve the column header within a directive?
has answer: http://stackoverflow.com/a/24801114
tagged with: angularjs
downvote count: 0
type: AnsweredQuestion
score: 1
type: Question
upvote count: 1
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/24864032
answers question: http://stackoverflow.com/q/24854737
score: 0
type: Answer
has body: You can use custom window as Editor for any control in kendo, you just need to specify the below line to use it on Grid. editable: { mode: "popup", template: kendo.template($("#popup-editor").html()) } Telerik Examplnation I have updated your sample as per your requirement. Custom Editor Working Sample
has comment: http://stackoverflow.com/comment/38621592
has comment: http://stackoverflow.com/comment/38621506
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24854737

http://stackoverflow.com/comment/38524903
type: AnswerComment
comment on: http://stackoverflow.com/a/24811975
has text: Not working in ie. More over that i don't want to do this on a single click. Color should change on changing the slider value.
type: Comment
score: 0

http://stackoverflow.com/a/24861399
has body: I've found (maybe in SO) in the past this script and it worked for me (IE 10 too) &lt;![if IE]&gt; &lt;script type='text/javascript'&gt; if(/*@cc_on!@*/false) var bIsIE = 1; &lt;/script&gt; &lt;![endif]&gt; and then if (typeof (bIsIE) != 'undefined') { //IE :( } else { //NOT IE :) }
score: 1
answers question: http://stackoverflow.com/q/24861073
has comment: http://stackoverflow.com/comment/83845660
upvote count: 2
type: Answer
downvote count: 1

http://stackoverflow.com/comment/38627450
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24869761
score: 1
has text: Not sure why you would need a nodeList, but here you go -> **http://jsfiddle.net/dzu2m/**

http://stackoverflow.com/comment/38617473
type: AnswerComment
comment on: http://stackoverflow.com/a/24865543
score: 0
type: Comment
has text: @user3853834 I didn't post an answer since it's quite long to explain. But I've answered a similar situation before. Take a look at this [question](http://stackoverflow.com/q/20939737). If it's still unclear, ping me [here](http://chat.stackoverflow.com/rooms/25767/regex)

http://stackoverflow.com/comment/38469059
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24787133
has text: Oh ok fixed it. Indentation fixed it as you said..

http://stackoverflow.com/comment/38601647
comment on: http://stackoverflow.com/q/24857383
score: 1
type: Comment
type: QuestionComment
has text: Too much wrong. Will not teach what the web provides.

http://stackoverflow.com/comment/38563874
score: 0
type: Comment
has text: thank you so much for your answer and i did changed but not working yet. Any more options for solving this problem?
comment on: http://stackoverflow.com/a/24837250
type: AnswerComment

http://stackoverflow.com/comment/38407058
type: Comment
has text: You cannot fool the network. Preload the data to be able to display it quickly.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24754336

http://stackoverflow.com/q/24817845
has answer: http://stackoverflow.com/a/24818668
tagged with: ruby-on-rails
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24817982
accepted answer: http://stackoverflow.com/a/24817982
has comment: http://stackoverflow.com/comment/38526391
has comment: http://stackoverflow.com/comment/38526598
type: Question
answer count: 2
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24818668
has title: Loading a new page on changing select value in Rails
tagged with: jquery
downvote count: 3
tagged with: http://stackoverflow.com/tag/html
has body: I have a select tag which loads 10 shops. Shop Number should be passed as a parameter on changing the select value.. I tried to put a tag in my html like this.. aaa and in my script $("#wo_select_shop").change(function() { var shop_number = $("#wo_select_shop").val(); var url = '/estimate_lookups/select_store?shop_number='+shop_number; $('#wo_selected_shop').attr('href',url).trigger('click'); }); $('#wo_selected_shop').click(function() { console.log("A Click"); }); Thing is on changing the select tag the console works and also the href is changing in console.. But url is not changing or the page is not changing.. But it changes if i click that a tag manually.. What do i miss?
favorite count: 0
tagged with: ruby
upvote count: 0
has comment: http://stackoverflow.com/comment/38526374
score: -3

import
type: Tag
tags question: http://stackoverflow.com/q/24903217
tag name: import
tags question: http://stackoverflow.com/q/24783504

http://stackoverflow.com/a/24817270
downvote count: 0
has comment: http://stackoverflow.com/comment/38525488
type: Answer
has comment: http://stackoverflow.com/comment/38525570
score: 2
has body: Put your dom element in quotes, and as pointed out in comments, inner is spelled wrong and is also not a jquery property, it's a property on the dom element. You can use the jquery property html() instead to retieve the html property, or if you want to get at the dom element you can use brackets [0] or call jquery method get() $('#parentID').html().replace('...'); or $('#parentID').get().innerHTML.replace('...'); If you're looking to get simply show an element, or hide an element you can just use the jquery show() or hide() functions //show the element $('#idOfDOMElementToShow').show(); //hide the element $('#idOfDOMElementToHide').hide(); Also if you're looking to change attributes or classes, take a look at css(), prop() or attr()
has comment: http://stackoverflow.com/comment/38525527
answers question: http://stackoverflow.com/q/24817252
upvote count: 2
accepted answer of: http://stackoverflow.com/q/24817252
type: AcceptedAnswer

http://stackoverflow.com/comment/38445143
has text: @user3652322 please check now
type: AnswerComment
comment on: http://stackoverflow.com/a/24760634
score: 0
type: Comment

http://stackoverflow.com/comment/38460370
has text: Better look into this line : ` `.
score: 0
comment on: http://stackoverflow.com/q/24782106
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38664906
has text: Ditto & Ditto, we need to see your code to help you.
score: 1
comment on: http://stackoverflow.com/q/24883619
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38537275
type: AnswerComment
comment on: http://stackoverflow.com/a/24822270
score: 0
type: Comment
has text: Please notice that in your fiddle demo, the series names in legends are not updating when changing data from 2013 to 2012 and back forth !

http://stackoverflow.com/comment/38574126
type: QuestionComment
comment on: http://stackoverflow.com/q/24842651
has text: @YHarry Please do not drag on a question by editing in follow-up questions in your question. You can ask for clarification in the comments under an answer, but it is up to that person if they want to give any further help or if you need to figure out things on your own.
score: 0
type: Comment

http://stackoverflow.com/a/24810685
has body: Use AJAX like this instead your JS: $(function(){ $("#signInButton").click(function(){ var email=$("input#login_email").val(); var password=$("input#login_password").val(); $.ajax({ url:"login.php", data:{"e":email,"p":password}, cache:false, success:function(response){ if(response=="login_success"){ $("#login_email").css("background-color","green");; $("#login_password").css("background-color","green");; } if(response=="login_failed"){ $("#login_email").css("background-color","red");; $("#login_password").css("background-color","red");; } } }); return false }) }); And HTML: &lt;form name="signIn" id="signIn" name="signIn" action="index.php" method="post" enctype="multipart/form-data" &gt; &lt;input type="text" placeholder="Email" maxlength="50" id="login_email" /&gt; &lt;input type="password" placeholder="********" maxlength="20" id="login_password" /&gt; &lt;input type="image" id="signInButton" src="img/signIn.png" alt="&gt;" name="submit" /&gt; &lt;/form&gt;
score: 0
answers question: http://stackoverflow.com/q/24810346
type: Answer

http://stackoverflow.com/comment/38677924
has text: [Read this first](http://diveintohtml5.info/storage.html), before you decide.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24897699
score: 1

http://stackoverflow.com/q/24787002
favorite count: 0
tagged with: backbone.js
downvote count: 1
has answer: http://stackoverflow.com/a/24787658
type: AnsweredQuestion
tagged with: underscore.js
score: -1
has title: Push onto template data
has body: I have a backbone view that looks like: var BooksView = Backbone.View.extend({ initialize: function() { this.render(); }, render: function() { this.model.fetch({ success : function(model, resp, opt) { var data = { model, navigationText: this.navText }; this.$el.append ( JST['templates/' + "book"] ( data.toJSON() ) ); }.bind(this) }); } }); Basically, I'm trying to pass template data with model data, as well as other data that ISN'T model data. Right now, I can do: this.$el.append ( JST['templates/' + "book"] ( model.toJSON() ) ); and it will send the model data. But for example, I have a variable (navigationText) I want to pass to the template as well, but it shouldn't ever be model.set. With my current code, I get the error: Uncaught SyntaxError: Unexpected token ,, because it's not a valid object?
type: Question
upvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/24787658
tagged with: javascript
tagged with: jquery
tagged with: templates

http://stackoverflow.com/comment/38710382
comment on: http://stackoverflow.com/a/24874083
score: 0
type: AnswerComment
type: Comment
has text: That was my first thought, too, but then you run into a problem if you have duplicate elements and the arrays *do* match, right? [1,1,2] wouldn't match itself. My thought was instead of using a bool, keep track of the count and decrement the counter, and if it's 0 or undefined for an element (so anything falsy), return false. So something like `holder[d] = (holder[d] || 0) + 1` and then `if (!holder[arr2[i]]) { return false; } else { holder[arr2[i]]--; }`

http://stackoverflow.com/comment/38671574
score: 0
has text: **show us code** What are your displays resolution? I guess you're doing a for loop on each pixel of the screen or similar, so the bigger the resolution is, the harder it is for your computer…
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24893713

http://stackoverflow.com/comment/38596717
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24854902
type: AnswerComment
has text: Thank you very much, this is what I was looking for. I sincerely appreciate it!

http://stackoverflow.com/comment/39052358
type: AnswerComment
has text: Thanks for that note about relative routing hope it helps others and I will accept this answer.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25027885

http://stackoverflow.com/comment/38539103
score: 0
type: AnswerComment
has text: problem in this function store.loadData(generateData()); donut is ok but problem in click on relaod no data is loaded pls help where i have done wrong
type: Comment
comment on: http://stackoverflow.com/a/24824765

http://stackoverflow.com/q/24788931
answer count: 2
has answer: http://stackoverflow.com/a/24789046
has title: JQuery - waiting until image loaded not working
tagged with: javascript
tagged with: jquery
has body: I need to get the height of an image on the page and try to do so only after the image has been loaded. However, it seems like I'm still getting a height of 0 for some of the images on the page. Here's my code: carousel_img.on('load', function(){ setCarouselImageMargins(carousel_img, carousel_width); }); function setCarouselImageMargins(image, width){ var carousel_left_margin = (image.width()-parseInt(width))/2*-1; image.css('margin-left', carousel_left_margin); console.log('carousel image width: ' + image.width()); // this is returning 0 console.log('carousel_left_margin: ' + carousel_left_margin); } Is there another way to ensure the image is fully loaded on the page?
has comment: http://stackoverflow.com/comment/38472450
score: 0
has answer: http://stackoverflow.com/a/69137475
has comment: http://stackoverflow.com/comment/38472451
has comment: http://stackoverflow.com/comment/38472275
has comment: http://stackoverflow.com/comment/38472374
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/3877027
type: Question
has comment: http://stackoverflow.com/comment/38472357

http://stackoverflow.com/q/24796199
has answer: http://stackoverflow.com/a/24796404
upvote count: 5
type: Question
accepted answer: http://stackoverflow.com/a/24796404
possible better answer: http://stackoverflow.com/a/24796455
has comment: http://stackoverflow.com/comment/38486374
has answer: http://stackoverflow.com/a/24796455
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: css
linked to: http://stackoverflow.com/q/826782
has comment: http://stackoverflow.com/comment/38486573
has title: Javascript: Prevent mouse click event moving the cursor (prevent it changing selection)
score: 5
has answer: http://stackoverflow.com/a/24807922
has comment: http://stackoverflow.com/comment/38486032
type: AnsweredQuestion
has body: I have a situation that when I click on a button, I need the current selection before the click. Example code goes like $('div#test').on('click', 'span', function () { sel = window.getSelection(); $('div#out p').text(sel.toString()); }); The expected behavior is shown here - http://jsfiddle.net/yvondtm/NH2DW/ Things goes right when the image button is clicked. If you make a selection before clicking the image, then you get the output - here it's just a copy of your selection. But if you click on a text button, the selection gets lost, and the result isn't as expected. It seems like clicking on the text will move the cursor and hence change the selection. I have checked CSS solutions like this one to disable the selection, as I have put in the fiddle, -webkit-user-select: none;. It does what it says, but doesn't make any help - even though "range" selection is not allowed, the caret still moves! How can I solve this problem? Do I have to find some way to convert the text button to as if it were an image? (No problem to use either js or jquery or css to achieve that. )
has comment: http://stackoverflow.com/comment/38486197

http://stackoverflow.com/a/25585778
has comment: http://stackoverflow.com/comment/40603095
has comment: http://stackoverflow.com/comment/64040504
accepted answer of: http://stackoverflow.com/q/24835954
has comment: http://stackoverflow.com/comment/40701971
has comment: http://stackoverflow.com/comment/76352025
upvote count: 98
has comment: http://stackoverflow.com/comment/51572285
has comment: http://stackoverflow.com/comment/42992886
answers question: http://stackoverflow.com/q/24835954
has comment: http://stackoverflow.com/comment/40235782
downvote count: 2
has comment: http://stackoverflow.com/comment/64008838
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/41617870
has comment: http://stackoverflow.com/comment/64041201
has comment: http://stackoverflow.com/comment/43072770
score: 96
has body: After revisiting this and trying some more things, I finally wrapped my head around what browserify-shim is doing and how to use it. For me, there was one key principle I had to grasp before I finally understood how to use browserify-shim. There are basically two ways to use browserify-shim for two different use cases: exposing & shimming. Background Let's say you want to just drop in a script tag in your markup (for testing or performance reasons like caching, CDN & the like). By including a script tag in the markup the browser will hit the script, run it, and most likely attach a property on the window object (also known as a global in JS). Of course this can be accessed by either doing myGlobal or window.myGlobal. But there's an issue with either syntax. It doesn't follow the CommonJS spec which means that if a module begins supporting CommonJS syntax (require()), you're not able to take advantage of it. The Solution Browserify-shim allows you to specify a global you'd like "exposed" through CommonJS require() syntax. Remember, you could do var whatever = global; or var whatever = window.global; but you could NOT do var whatever = require('global') and expect it to give you the right lib/module. Don't be confused about the name of the variable. It could be anything arbitrary. You're essentially making a global variable a local variable. It sounds stupid, but its the sad state of JS in the browser. Again, the hope is that once a lib supports CommonJS syntax it will never attach itself via a global on the window object. Which means you MUST use require() syntax and assign it to a local variable and then use it wherever you need it. Note: I found variable naming slightly confusing in the browserify-shim docs/examples. Remember, the key is that you want to include a lib as if it were a properly behaving CommonJS module. So what you end up doing is telling browserify that when you require myGlobal require('myGlobal') you actually just want to be given the global prope…
has comment: http://stackoverflow.com/comment/64001327
has comment: http://stackoverflow.com/comment/44232803
has comment: http://stackoverflow.com/comment/41277297
type: Answer
has comment: http://stackoverflow.com/comment/40235826
has comment: http://stackoverflow.com/comment/57080224
has comment: http://stackoverflow.com/comment/44190664
has comment: http://stackoverflow.com/comment/41280560

http://stackoverflow.com/a/24865705
has body: The code is creating two trackers but you sent data only to one of them. You need to give a name to one of the trackers and make one additional send pageview-call to that name. ga('create', 'UA-XXXXXXX-1', 'www.websitename.com'); ga('create', 'UA-YYYYYYY-46', 'auto', {'name': 'newTracker', 'allowLinker': true}); // NAME SET HERE ! ga('require', 'linker'); ga('linker:autoLink', ['otherwebsitename.com'] ); ga('send', 'pageview'); ga('newTracker.send', 'pageview'); // NAME CALLED HERE ! Ask them if they are sure they need the crossdomain tracking (the bits that have "link" or "linker" in them), else the code can be much simplified (and since they seem not to understand how the code works they might have included those lines erroneously).
type: Answer
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24864506
has comment: http://stackoverflow.com/comment/38619256
answers question: http://stackoverflow.com/q/24864506

http://stackoverflow.com/comment/38733139
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24861746
has text: exactly! Well done. **between two numbers** is the point here. Normally, that's it, but you don't have a 2nd point for the LAST interval. So instead of using **two numbers** for describing each interval, we use **one number and a ">" sign**, paying attention to the order of the loop.
score: 0

http://stackoverflow.com/q/24786071
type: Question
has answer: http://stackoverflow.com/a/24786194
has comment: http://stackoverflow.com/comment/38467181
score: 1
has comment: http://stackoverflow.com/comment/38467396
has answer: http://stackoverflow.com/a/24786233
answer count: 3
has comment: http://stackoverflow.com/comment/38466836
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24786222
favorite count: 0
has title: Wrap each word in an html element
has body: Is there an algorithm/library for taking any html document, finding all the 'words' (single words) in the document and the wrapping each word inside a span (or any other html element). I am using angularJS framework which has some jQuery restrictions. Still, even with jQuery i cannot seem to get it to work. I used the .contents().filter().wrap() mechanism outlined on the jQuery documentation. However it is only useful when I want to wrap entire lines of text rather than the individual words. This problem is very frustrating and I would truly appreciate some help. Thanks much! Okay sorry for the lack of details previously. My application pulls a string from a database. The string is contains html. I created a custom directive named 'spanner' and bound this directive to the html string on the scope like so: Inside my directive I try to add a span around each word in the html like so: .directive('spanner', function($compile){ var linkFn = function(scope, element, attributes) { element.append(scope.spanner); angular.forEach(element.find('*').contents(), function(val, key){ var a = angular.element(val); var text; if(a.context.nodeType === 3) { text = a.text(); text = text.split(' '); angular.forEach(text, function(val, key){ if(key%2 === 0){ val = "&lt;span class='even'&gt;" + val + "&lt;/span&gt;"; } else { val = "&lt;span ng-class='odd'&gt;" + val + "&lt;/span&gt;"; } text[key] = val; }); text = text.join(' '); } a.html(text); element.find('*').contents()[key] = a; }); $compile(element.contents())(scope); }; return { scope: { spanner: '=' }, restrict: 'A', link: linkFn }; });
has comment: http://stackoverflow.com/comment/38466740
possible better answer: http://stackoverflow.com/a/24786194
upvote count: 5
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38466722
downvote count: 4
has answer: http://stackoverflow.com/a/24786222
type: AnsweredQuestion

http://stackoverflow.com/q/24788514
tagged with: ajax
has body: I have data from an ajax call like so: [ { "id": "1", "name": "Jim", "age": "39", "address": "12 High Street, London", "hasCar": "1", "speaksForeignLanguage": "1", "canWorkNights": "1", "isStudent": "1" }, { "id": "2", "name": "Fred", "age": "29", "address": "13 High Street, London", "hasCar": "1", "speaksForeignLanguage": "1", "canWorkNights": "1", "isStudent": "0" }, { "id": "3", "name": "Bill", "age": "19", "address": "14 High Street, London", "hasCar": "1", "speaksForeignLanguage": "1", "canWorkNights": "0", "isStudent": "0" }, { "id": "4", "name": "Tom", "age": "39", "address": "15 High Street, London", "hasCar": "1", "speaksForeignLanguage": "0", "canWorkNights": "0", "isStudent": "0" }, { "id": "5", "name": "Cathy", "age": "29", "address": "16 High Street, London", "hasCar": "1", "speaksForeignLanguage": "0", "canWorkNights": "0", "isStudent": "1" }, { "id": "6", "name": "Petra", "age": "19", "address": "17 High Street, London", "hasCar": "1", "speaksForeignLanguage": "0", "canWorkNights": "1", "isStudent": "0" }, { "id": "7", "name": "Heide", "age": "39", "address": "18 High Street, London", "hasCar": "1", "speaksForeignLanguage": "1", "canWorkNights": "0", "isStudent": "0" }, { "id": "8", "name": "William", "age": "29", "address": "19 High Street, London", "hasCar": "1", "speaksForeignLanguage": "1", "canWorkNights": "0", "isStudent": "1" }, { "id": "9", "name": "Ted", "age": "19", "address": "20 High Street, London", "hasCar": "0", "speaksForeignLanguage": "0", "canWorkNights": "0", "isStudent": "1" }, { "id": "10", "name": "Mike", "age": "19", "address": "21 High Street, London", "hasCar": "1", "speaksForeignLanguage": "0", "canWorkNights": "0", "isStudent": "1" }, { "id": "11", "name": "Jo", "age": "19", "address": "22 High Street, London", "hasCar": "0", "speaksForeignLanguage": "1", "canWorkNights": "0", "isStudent": "1" } ] what I am trying to do with this data is draw out a div element but I just want specific data information for what I am trying to…
type: Question
has answer: http://stackoverflow.com/a/24788581
score: 0
has title: Ajax call data issue
answer count: 1
accepted answer: http://stackoverflow.com/a/24788581
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/24831371
answer count: 1
downvote count: 0
tagged with: jquery-mobile
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38553582
has answer: http://stackoverflow.com/a/24833042
has comment: http://stackoverflow.com/comment/99698020
tagged with: android
favorite count: 0
has comment: http://stackoverflow.com/comment/38553286
upvote count: 2
type: UnansweredQuestion
tagged with: local-storage
has title: Localstorage not working on android
score: 2
has body: I have a weird issue getting localstorage working on my android device running JQM. I should mention that my code works perfectly fine when viewed on a web browser, however on my android it will not receive the variable from localStorage.getItem('visittime'). The script is basically my own little popup window that displays to a user once every minute. I store a variable in local storage with the current time stamp. If variable exists, it compares it with the timestamp of now. If its been over a minute, the pop will show again. $( document ).on( "pagecreate", function() { var now = new Date().getTime(), storagedate = localStorage.getItem('visittime'); if(storagedate){ var diff = now - storagedate; if(diff &gt; 60000){ localStorage.removeItem('visited'); localStorage.removeItem('visittime'); } } var yetVisited = localStorage.getItem('visited'); if (!yetVisited) { $(".welcomewindow").delay(1500).fadeIn("300", function(){ $(".welcome").css({"margin-left":leftPos,"width":welcomeSetwidth}).fadeIn("300") ; }); $(".welcomeClose").on("click",function(e){ $(".welcomeshield").fadeOut("300"); $(".welcome").fadeOut("300"); localStorage.setItem('visited','yes'); localStorage.setItem('visittime', new Date().getTime()); }); } } I saw people having somewhat similar issues that resolved it by changing the location of their script to be called before JQM loads or on mobileinit. I haven't been able to figure this out.
type: Question
has comment: http://stackoverflow.com/comment/38563236

http://stackoverflow.com/comment/38439424
score: 0
comment on: http://stackoverflow.com/q/24771593
has text: So, What is your question?
type: QuestionComment
type: Comment

http://stackoverflow.com/a/24854038
has comment: http://stackoverflow.com/comment/38982496
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/39129001
has comment: http://stackoverflow.com/comment/38928929
accepted answer of: http://stackoverflow.com/q/24838139
answers question: http://stackoverflow.com/q/24838139
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/39139738
has comment: http://stackoverflow.com/comment/39109602
has body: You could either try to convert the object to JSON first. e.g. console.log(JSON.stringify(obj, null, 4)); Or else use %O to force the format of the value as an expandable JavaScript object. e.g. console.log('%O', obj); Failing that output values rather than objects. e.g. console.log(ge.getPluginVersion()); not console.log(ge); EDIT Based on your code that is what you would expect to see. You should log the values you are interested in as I mentioned in the last example. e.g. console.log(ge.getPluginVersion()); not console.log(ge); You can also test to see what an API object is at runtime by calling getType. e.g. console.log(ge.getType()); // GEPlugin You can also test to see if an API object has a property/method at runtime using in. e.g. console.log('createPlacemark' in ge) // true To help you can always use the Google Earth API Reference if you want to know what properties and methods an API object has, or you could even open the object in something like visual studios object browser.

http://stackoverflow.com/comment/38627863
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24870896
has text: How are you loading the data from the server? It must be getting loaded in the controller. Whatever request you make, you can set `first_name` in the response handler. And that will just do what you want. It'd be better if you can share how you are loading data from the server.
type: Comment

http://stackoverflow.com/comment/38574549
type: Comment
comment on: http://stackoverflow.com/a/24837982
type: AnswerComment
score: 0
has text: My thinking was that because the input box was a form object it would work. But now I see that it's not a form object without the form tag...right?

http://stackoverflow.com/comment/38417698
type: Comment
type: QuestionComment
has text: Why not just use node-inspector? What do you use to debug your client-side javascript?
comment on: http://stackoverflow.com/q/24758683
score: 0

http://stackoverflow.com/comment/38622090
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/24868247
has text: Is it possible to simply put the second image behind the first and manipulate the opacity of the top one? Is that what you are looking for?

http://stackoverflow.com/a/24763547
downvote count: 0
answers question: http://stackoverflow.com/q/24763484
type: Answer
has body: You are not setting test3 to anything. Console.log does not return anything(except undefined). If you want to set it to the value of arg, just return the value itself.
score: 1
upvote count: 1

http://stackoverflow.com/comment/124370911
comment on: http://stackoverflow.com/a/50425562
has text: Some linting rules will allow you to denote an unused variable with an underscore like: `_var` while still allowing you to declare it like so: `const { _a, _b, ...rest }`. Otherwise you can add this to your `eslintrc`: `"no-unused-vars": ["error", { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }]` to ignore unused variables or arguments that start with an underscore. I really like the "neat" answer, but as with most neat code it may not be easily understood. You could always wrap it in a named function for better readability though.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/24867599
has comment: http://stackoverflow.com/comment/38625667
has comment: http://stackoverflow.com/comment/38621002
has comment: http://stackoverflow.com/comment/38620990
has comment: http://stackoverflow.com/comment/38620901
score: 0
tagged with: mouseleave
type: Question
has comment: http://stackoverflow.com/comment/38620931
answer count: 1
has answer: http://stackoverflow.com/a/24867806
tagged with: javascript
tagged with: jquery
has title: On mouseleave of one div AND mouseenter of other div when both condition true
has comment: http://stackoverflow.com/comment/38621407
tagged with: qmouseevent
tagged with: mouseenter
has body: There is 4 divs like following hello hi bye see ya I want to show div 21 when i hover on div11, dev22 on hover of div12, just like menu it should stay and clickable. If i move out from div11 then div21 must hide, except user enters into div21. Currently if i move out my pointer out of div11 towards div21 its hiding. i want it to be stayed. Both must be in separate div like above. I tried with mouseenter and mouseleave but its not fulfilling my requirement. Please help me with this. $( "body" ).on( "mouseenter", "#div11", function(event) { $( "#div21" ).removeClass( "displayNoneIcon" ); }); $( "body" ).on( "mouseleave", "#div11", function(event) { $( "#div21" ).addClass( "displayNoneIcon" ); }); $( "body" ).on( "mouseenter", "#div12", function(event) { $( "#div22" ).removeClass( "displayNoneIcon" ); }); $( "body" ).on( "mouseleave", "#div12", function(event) { $( "#div22" ).addClass( "displayNoneIcon" ); }); Thanks in advance. jsfiddle link
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38624872

http://stackoverflow.com/q/24863372
favorite count: 0
has answer: http://stackoverflow.com/a/31104861
has body: Edge scrolling Let's say I've created a simple map with default options, a draggable marker and a draggable shape (I've tested it with circle, rectangle, polygon and polyline). When I drag the marker or shape to the edge of map canvas, the map starts scrolling and that's fine. JSFiddle demo The problem When I set map's draggable property to false, the edge scrolling doesn't work anymore with the marker, but all the shapes ignore it and the map is still scrolled - and that's unexpected behaviour. var mapOptions = { ... draggable: false }; JSFiddle demo The problem exists in both release (3.16) and experimental (3.17) versions. I've reported it on google's bugtracker, but it will probably take years before they fix it. So, does anyone know a workaround? Edit: for the sake of simplicity, let's assume that zooming the map is also disabled
upvote count: 1
has comment: http://stackoverflow.com/comment/38618771
has title: Shapes don't respect map's 'draggable' property
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38615684
has comment: http://stackoverflow.com/comment/38617748
has comment: http://stackoverflow.com/comment/38617853
possible better answer: http://stackoverflow.com/a/24866831
has answer: http://stackoverflow.com/a/24866831
downvote count: 1
has comment: http://stackoverflow.com/comment/38618122
accepted answer: http://stackoverflow.com/a/31104861
type: Question
answer count: 2
tagged with: google-maps
has comment: http://stackoverflow.com/comment/38617628
tagged with: javascript
has comment: http://stackoverflow.com/comment/38618836
has comment: http://stackoverflow.com/comment/38618370
has comment: http://stackoverflow.com/comment/38619009
tagged with: google-maps-api-3
score: 0
has comment: http://stackoverflow.com/comment/38615340

http://stackoverflow.com/comment/38522483
has text: @Dr.Molle...This array is coming from a text file. I am using "locations" data in InfoWindow as well and everything displays correctly.
type: QuestionComment
comment on: http://stackoverflow.com/q/24799649
type: Comment
score: 0

http://stackoverflow.com/a/24897532
type: Answer
upvote count: 3
accepted answer of: http://stackoverflow.com/q/24897329
score: 3
type: AcceptedAnswer
downvote count: 0
has body: When using addEventListener you omit the "on" prefix in the event name addEventListener('keydown', , /**/,/**/); addEventListener('click', , /**/,/**/); addEventListener('mouseover', , /**/,/**/); //etc instead of addEventListener('onkeydown', , /**/,/**/); addEventListener('onclick', , /**/,/**/); addEventListener('onmouseover', , /**/,/**/); //etc Spec for event list types However if supporting older IE browsers you will need attachEvent which uses "on" prefix
answers question: http://stackoverflow.com/q/24897329

http://stackoverflow.com/comment/38550490
has text: well, like my original comment stated: this is more about a tool and less about an actual programming problem, so it should be on one of the aforementioned sites.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24830586

alfresco
tags question: http://stackoverflow.com/q/24799366
type: Tag
tags question: http://stackoverflow.com/q/24804117
tag name: alfresco

http://stackoverflow.com/q/24880454
favorite count: 0
has answer: http://stackoverflow.com/a/35062710
has comment: http://stackoverflow.com/comment/38645349
has answer: http://stackoverflow.com/a/24880499
has body: I have some code {{if commission}} &lt;td&gt;${profit - commission}&lt;/td&gt; {{else}} &lt;td&gt;${profit}&lt;/td&gt; {{/if}} profit = 5; commission = 2.145 result = 2.855999999999 I need 2.856 Please help me I try to use (${profit - commission}).toFixed(2) - but it does not work.
has answer: http://stackoverflow.com/a/42539287
has answer: http://stackoverflow.com/a/24880546
has comment: http://stackoverflow.com/comment/38645376
upvote count: 5
type: UnansweredQuestion
has title: JavaScript math, round to two decimal places in Jquery template
linked to: http://stackoverflow.com/q/11832914
tagged with: jquery-templates
has answer: http://stackoverflow.com/a/24880560
has comment: http://stackoverflow.com/comment/38645379
has answer: http://stackoverflow.com/a/24880556
type: Question
score: 5
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 6

http://stackoverflow.com/comment/38503273
type: QuestionComment
has text: I did post a fiddle. It's the first link in the post.
comment on: http://stackoverflow.com/q/24805629
score: 0
type: Comment

http://stackoverflow.com/comment/38430141
type: Comment
has text: This is not only to change the size, if you use same icons of different scales it will appear that there size are changing, but this is used to just change the icon on applied event.
comment on: http://stackoverflow.com/a/24766746
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38584084
comment on: http://stackoverflow.com/a/24848516
type: AnswerComment
has text: I need to "REMOVE" few items and "PRESERVE THE BALANCE" in an array using SPLICE.
score: 0
type: Comment

http://stackoverflow.com/comment/38568387
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24840316
score: 2
has text: possible duplicate of [Understanding the difference between Object.create() and new SomeFunction() in JavaScript](http://stackoverflow.com/questions/4166616/understanding-the-difference-between-object-create-and-new-somefunction-in-j)

http://stackoverflow.com/q/24834319
upvote count: 4
answer count: 2
has title: Rally-app-builder displays nothing in browser for "Story Board" app
has answer: http://stackoverflow.com/a/51850101
has comment: http://stackoverflow.com/comment/38557892
downvote count: 0
tagged with: rally
favorite count: 0
has answer: http://stackoverflow.com/a/24836531
possible better answer: http://stackoverflow.com/a/51850101
type: AnsweredQuestion
has body: I have been attempting to learn how to build a Rally app using the rally-app-builder. I began wiith the Your first Rally app tutorial at https://help.rallydev.com/apps/2.0rc3/doc/#!/guide/first_app, after following the instructions for installing Node.js, and the rally-app-builder, I got to the step where we are supposed to add a rallycombobox to our app. However, when I run the App-debug.html file, my screen is blank. I have attempted to add other objects rather than a combobox and still nothing appears on the screen in the browser. I noticed that one other person had asked this question several months ago, but there is no answer posted as to why this might happen. I attempted to view the App-debug.html file in several browsers as well. None of them displayed the expected output. Here is the code for the app.js file. Ext.define('CustomApp', { extend: 'Rally.app.App', launch: function () { this.iterationCombobox = this.add({ xtype: 'rallyiterationcombobox', listeners: { ready: this._onIterationComboboxLoad, scope: this } }); }, });
has comment: http://stackoverflow.com/comment/38557936
accepted answer: http://stackoverflow.com/a/24836531
type: Question
tagged with: javascript
score: 4

http://stackoverflow.com/q/24883866
has comment: http://stackoverflow.com/comment/38652328
has comment: http://stackoverflow.com/comment/38651346
has comment: http://stackoverflow.com/comment/38651413
tagged with: arrays
has body: I have two array. a_array= [2,3,4] b_array= [2,3,4,5] I'd like to know how to check all of a_array elements are included in b_array. I used Jquery. $.inArray( a_array, b_array ) but It can only be checked for one element.
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/9204283
linked to: http://stackoverflow.com/q/11076067
has comment: http://stackoverflow.com/comment/38652113
answer count: 0
upvote count: 2
score: 1
has comment: http://stackoverflow.com/comment/38651593
duplicate of: http://stackoverflow.com/q/9204283
downvote count: 1
type: Question
linked to: http://stackoverflow.com/q/1885557
tagged with: javascript
duplicate of: http://stackoverflow.com/q/1885557
has comment: http://stackoverflow.com/comment/38651621
has title: In Javascript, Check the array element include in another array

http://stackoverflow.com/q/24796333
answer count: 2
upvote count: 0
has answer: http://stackoverflow.com/a/24796881
has comment: http://stackoverflow.com/comment/38486758
tagged with: arrays
has comment: http://stackoverflow.com/comment/38486556
downvote count: 5
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/24796976
has comment: http://stackoverflow.com/comment/38486633
has comment: http://stackoverflow.com/comment/38486258
has answer: http://stackoverflow.com/a/24796976
accepted answer: http://stackoverflow.com/a/24796881
has comment: http://stackoverflow.com/comment/38486602
has comment: http://stackoverflow.com/comment/38486677
has title: If an array has an attribute, find the value of another attribute of the same array?
has body: "dTableRowData": [ { "id": "1", "rowData": [ "tt", "Sep13, 2010" ], "action": [ { "hrefvar": "aaa", "label": "fff" }, { "hrefvar": "bbb", "label": "Details" }, { "hrefvar": "ccc", "label": "View" } ] } ] Above is the array I have, and I need to find the value of "action" by taking the "id" (if action is present). Please help me achieve this using jQuery. This question is closed
has comment: http://stackoverflow.com/comment/38486357
favorite count: 0
has comment: http://stackoverflow.com/comment/38486380
has comment: http://stackoverflow.com/comment/38487251
type: AnsweredQuestion
score: -5
has comment: http://stackoverflow.com/comment/38486825
has comment: http://stackoverflow.com/comment/38486839
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38486794
has comment: http://stackoverflow.com/comment/38486312
has comment: http://stackoverflow.com/comment/38486665
type: Question

http://stackoverflow.com/q/24750058
has answer: http://stackoverflow.com/a/24750477
has comment: http://stackoverflow.com/comment/38398879
has comment: http://stackoverflow.com/comment/38398741
upvote count: 0
has answer: http://stackoverflow.com/a/24750116
has title: Javascript not giving alert after for loop
accepted answer: http://stackoverflow.com/a/24750109
has comment: http://stackoverflow.com/comment/38398789
score: -3
has comment: http://stackoverflow.com/comment/38398767
type: AnsweredQuestion
tagged with: alert
has body: i have a javascript function which has foor loop in it. once the loop exists it is not displaying alert can anyone suggest what might be wrong. the code is below <?PHP Include('Includes\common\header_items.php'); session_start(); ?> Brawing / Document No. Revision No. Description (Optional) i cant figure out why it is not displaying the last alert. Any suggestions? THe last alert is not working.
has answer: http://stackoverflow.com/a/24750109
has comment: http://stackoverflow.com/comment/38398807
has comment: http://stackoverflow.com/comment/38398852
type: Question
has comment: http://stackoverflow.com/comment/38398794
possible better answer: http://stackoverflow.com/a/24750116
tagged with: function
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38399285
favorite count: 0
has comment: http://stackoverflow.com/comment/38398812
answer count: 3
downvote count: 3

http://stackoverflow.com/comment/38439230
has text: It worked! Thank you...dandavis and kevin b. So obvious now. Please Answer Dan Davis or Kevin B, so I can mark as answered.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24771495
score: 0

session-timeout
type: Tag
tags question: http://stackoverflow.com/q/24799745
tag name: session-timeout

http://stackoverflow.com/q/24866293
score: 20
has answer: http://stackoverflow.com/a/24866401
has answer: http://stackoverflow.com/a/79396667
has body: Is it possible to hide my REST URL that I using via AJAX to populate page data? I don't want others taking and consuming from my REST API, but need to use it to display content in my site. How do I hide my REST API URLs from the end user?
accepted answer: http://stackoverflow.com/a/24866357
favorite count: 0
has answer: http://stackoverflow.com/a/58091632
upvote count: 20
tagged with: rest
has comment: http://stackoverflow.com/comment/38618274
has answer: http://stackoverflow.com/a/24866357
has answer: http://stackoverflow.com/a/24866396
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/65591216
downvote count: 0
possible better answer: http://stackoverflow.com/a/24866401
has answer: http://stackoverflow.com/a/24866466
has comment: http://stackoverflow.com/comment/38618334
type: Question
answer count: 8
has title: How do I hide a REST API Url from the end user?
tagged with: javascript
has answer: http://stackoverflow.com/a/62180276

http://stackoverflow.com/comment/38452059
comment on: http://stackoverflow.com/q/24778666
has text: Yes, console is clean.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38558225
comment on: http://stackoverflow.com/q/24834686
score: 0
type: Comment
type: QuestionComment
has text: If you say it didn't work, show me the code!

http://stackoverflow.com/q/24836843
type: UnansweredQuestion
score: -4
has body: I'm learning HTML, CSS and JavaScript using Aptana. I'm trying to run JavaScript in Aptana and it does not seem to be working, no autocomplete functions and things are not logging to console when I try to debug. Do I have to enable JavaScript in Aptana somehow? Is there a different IDE I should be using? I see a lot of similar questions but no answers, help would be appreciated.
type: Question
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/68384666
tagged with: aptana
downvote count: 4
answer count: 1
has answer: http://stackoverflow.com/a/25085993
favorite count: 0
has title: Using javascript in Aptana

http://stackoverflow.com/a/24864829
has body: you need to set the checked property of your checkboxes to false I made this fiddle with a wokring solution for you. HTML: &lt;input type="checkbox" id="mat" onclick="uncheck(this)"/&gt; &lt;input type="checkbox" id="Exam" onclick="uncheck(this)"/&gt; &lt;input type="checkbox" id="none" onclick="uncheck(this)"/&gt; Javascript: function uncheck(checkbox) { if(checkbox.id == "none" &amp;&amp; checkbox.checked){ document.getElementById("mat").checked = false; document.getElementById("Exam").checked = false; }else{ document.getElementById("none").checked = false; } }
type: Answer
accepted answer of: http://stackoverflow.com/q/24864174
has comment: http://stackoverflow.com/comment/38616439
answers question: http://stackoverflow.com/q/24864174
score: 0
type: AcceptedAnswer

graphael
tag name: graphael
type: Tag
tags question: http://stackoverflow.com/q/24887170

http://stackoverflow.com/comment/38526001
score: 0
type: Comment
type: QuestionComment
has text: @PratikJoshi it is **#frmLocations #cboSearch** means **#cboSearch** element under **#frmLocations**??
comment on: http://stackoverflow.com/q/24817582

http://stackoverflow.com/a/24809937
downvote count: 0
upvote count: 8
type: Answer
accepted answer of: http://stackoverflow.com/q/24808217
score: 8
answers question: http://stackoverflow.com/q/24808217
has body: After some more snooping, I found a JavaScript example on Dottoro that led me down the rabbit hole. Quick Answer The text can be grabbed with event.dataTransfer.getData("Text") assuming that the browser supports dataTransfer objects. There are other restrictions as well -- such as a Webkit issue where getData is always empty on dragstart or dragover (source). (Fiddle) Likewise, the dragged text can be modified by using event.dataTransfer.setData("Text", newText). (Fiddle) In both samples above, "Text" is the format of the dragged content we are retrieving/modifying. There are many options listed in the MDN documentation, but note that the available formats for a given "drag" can be found in the events.dataTransferTypes array. Details and Context The following code explains how to use the dataTransfer object and some peculiarities: //Modify the text when some specific text is dragged. function changeDraggedText(event) { if (event.dataTransfer) { // Note: textData is empty here for Safari and Google Chrome :( var textData = event.dataTransfer.getData("Text"); var newText = "..." //Modify the data being dragged BEFORE it is dropped. event.dataTransfer.setData (format, newText); } } //Access the text when the `drag` ends. function getDraggedText(event) { if (event.dataTransfer) { var format = "Text"; var textData = event.dataTransfer.getData (format); if (!textData) { // ... There is no text being dragged. } else { // ... Do what you will with the textData. } } else { // ... Some (less modern) browsers don't support dataTransfer objects. } // Use stopPropagation and cancelBubble to prevent the browser // from performing the default `drop` action for this element. if (event.stopPropagation) { event.stopPropagation (); } else { event.cancelBubble = true; } return false; } Which can just be bound to the ondrop and ondragstart events as in the following HTML: &lt;div ondragstart="changeDraggedText(event)"&gt; Dragging these contents causes the `ondragstart` event to be fire…
type: AcceptedAnswer

http://stackoverflow.com/q/24771831
score: 1
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/24771832
upvote count: 1
answer count: 1
has body: Are class instances created with a const constructor more optimized than the normal instances (created with a new constructor) when compiled to JavaScript with dart2js?
has title: Does dart2js optimize const objects better?
tagged with: javascript
type: UnansweredQuestion
tagged with: dart
tagged with: dart2js
downvote count: 0

http://stackoverflow.com/a/24904096
has body: I think you have misread the documentation. It mentions over here that the data from the store must have id and label attributes, not value and label attributes. The id of the store will be the value you get using the get("value") call. For getting the value you need to use get("value") function on the widget i.e widget.get("value") and for label I am assuming that it is widget.get("label") [{"id":1,"name":"Item 1","label":"Item 1"},{"id":2,"name":"Item 2","label":"Item 2"},{"id":3,"name":"Item 3","label":"Item 3"}]
type: Answer
has comment: http://stackoverflow.com/comment/38689900
answers question: http://stackoverflow.com/q/24903892
score: 0

http://stackoverflow.com/q/24817981
accepted answer: http://stackoverflow.com/a/24859950
type: Question
score: 5
tagged with: validation
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I'm now using parsley 2 to validate my form, it works fine except this problem: only after you submit your form for the first time, the validation will be triggered when you change your input, but before submission, it will do nothing. That said, I want to trigger validation before the first submission. How can I achieve this?
answer count: 1
favorite count: 0
has title: How to trigger validation before submission in parsley?
has answer: http://stackoverflow.com/a/24859950
type: AnsweredQuestion
tagged with: parsley.js
upvote count: 5

http://stackoverflow.com/a/24880047
has body: The reason it sort of seems to work with the commented out line is that myChildClass in that commented-out line is the function; but in the line inside the myChildClass constructor, this is not the function, it's the instance created by the new operator. The prototype property on functions is the object that will be assigned by the new operator to the new instances it creates, as their underlying prototype; there is no special meaning to the prototype property on instances (it doesn't, for instance, refer to the instance's underlying prototype). The correct way to do this is this: // Parent constructor function myMotherClass(value){ this.MyValue = value } // Child constructor function myChildClass(value){ // Chain to parent constructor, passing any necessary args myMotherClass.call(this, value); // Other child stuff -- see note below this.alert = function(){ alert(value); }; } // Set up inheritance by creating myChildClass's prototype // property to be an object that is baked by myMotherClass's // prototype object; do NOT *call* myMotherClass here, it's // a common anti-pattern you'll see in a lot of examples inherit(myMotherClass, myChildClass); // Create an instance var myClass = new myChildClass(2); myClass.alert(); ...where inherit is: function inherit(parent, child) { var temp; if (Object.create) { child.prototype = Object.create(parent.prototype); } else { temp = function() { }; temp.prototype = parent.prototype; child.prototype = new temp(); } child.prototype.constructor = child; } Note that with the way you're defining alert, this slightly strange behavior occurs: var o = new myChildClass(42); console.log(o.MyValue); // 42 o.alert(); // alerts "42" o.MyValue = 67; console.log(o.MyValue); // 67 o.alert(); // alerts "42" &lt;== !!! You can change how you define alert so it uses MyValue like this: this.alert = function() { alert(this.MyValue); }; ...provided you always call it through the instance. (More on my blog: Mythical methods) But if you're going to do t…
type: Answer
accepted answer of: http://stackoverflow.com/q/24879900
has comment: http://stackoverflow.com/comment/38646502
upvote count: 3
answers question: http://stackoverflow.com/q/24879900
score: 3
has comment: http://stackoverflow.com/comment/38644646
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/24811183
score: 4
answers question: http://stackoverflow.com/q/24811001
type: Answer
upvote count: 4
downvote count: 0
has body: undefined is a property of the global object, i.e. it is a variable in global scope. The initial value of undefined is the primitive value undefined. In modern browsers (JavaScript 1.8.5 / Firefox 4+), undefined is a non-configurable, non-writable property per the ECMAScript 5 specification. Even when this is not the case, avoid overriding it. A variable that has not been assigned a value is of type undefined. A method or statement also returns undefined if the variable that is being evaluated does not have an assigned value. A function returns undefined if a value was not returned. Since undefined is not a reserved word, it can be used as an identifier (variable name) in any scope other than the global scope. Example var x; if (x === undefined) { // these statements execute } else { // these statements do not execute } typeof operator Alternatively, typeof can be used: var x; if (typeof x === 'undefined') { // these statements execute } One reason to use typeof is that it does not throw an error if the variable has not been defined. // x has not been defined before if (typeof x === 'undefined') { // evaluates to true without errors // these statements execute } if(x === undefined){ // throws a ReferenceError } void operator The void operator is a third alternative. var x; if (x === void 0) { // these statements execute } // y has not been defined before if (y === void 0) { // throws a ReferenceError (in contrast to `typeof`) } Source: MDN - Mozilla Developer Network

http://stackoverflow.com/q/24860160
has body: Here is my Script,so when I click the first item with a unique id it loads the data but when i click the other item that uses the same function it is added to the first one so i want only the one I click to appear and the other one must be hidden this is inside toggle_visibility. function toggle_visibility(id){ var e = document.getElementById(id); if (e.style.display == 'block') e.style.display='none'; else (e.style.display = 'inline-block') }
has comment: http://stackoverflow.com/comment/38607340
score: 0
has comment: http://stackoverflow.com/comment/38606835
has comment: http://stackoverflow.com/comment/38607554
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/24861206
has title: How to disable onclick when applying onclick on the other item
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/38519787
has text: `b.__proto__ === Bar.prototype` - uh,**no**? The constructor `return`s an object, the prototype will be ignored.
comment on: http://stackoverflow.com/a/24813649
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/24906934
tagged with: http://stackoverflow.com/tag/html
score: 1
has comment: http://stackoverflow.com/comment/38695454
has answer: http://stackoverflow.com/a/24917430
answer count: 2
upvote count: 1
has body: Last few hours i am trying to solve this but i can not.I am sending ajax request using jquery and based on response i set data on jsp.actully i am checking login detail so if login fail it set error message on label problem is that error message is set for few second and removed i mean to say error message is set for few second i want that if login fails the message is set on label still user enter valid details thanks in advance Here is my code LoginDemo.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> Insert title here Log In Forgot your password? AddInspServlet Here i m adding code which server executed and retrieve response if(btn.equals("login")) { System.out.println("***** login condition checking ******"); String password =request.getParameter("password"); UserVO v =op.loginCheck(username, password); if(password.equals(v.getPassword())) { System.out.println("inside true condition"); HttpSession session = request.getSession(); session.setAttribute("userid",v.getUser_id()); session.setAttribute("username",v.getUsername()); session.setAttribute("user", v.getFirst_name()+" "+v.getLast_name()); session.setAttribute("roleid", v.getRole_id()); // response.sendRedirect("Home.jsp"); System.out.println("submitting data success fully"); out.print("yes"); } else { System.out.println("false condition"); out.print("no"); } }
tagged with: java
accepted answer: http://stackoverflow.com/a/24917430
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/38695104
possible better answer: http://stackoverflow.com/a/24907353
has title: Set Ajax response on jsp not working
type: Question
has answer: http://stackoverflow.com/a/24907353

http://stackoverflow.com/a/24867616
has body: You will want to define a class that extends Backbone.Collection and then extend that new class everytime you create one of your own collections. I would also wrap it in your own domain so that you can get easy access to it with dot syntax, and you can add more custom classes, like Backbone.Model extensions. var MyStuff = (function() { function MyStuff() {}; MyStuff.MyFancyCollection = Backbone.Collection.extend({ test: function.... }); return MyStuff; })(); So when you want to use this collection later you will use something like this: var MySpecificCollection = MyStuff.MyFancyCollection.extend({...});
type: Answer
answers question: http://stackoverflow.com/q/24867438
has comment: http://stackoverflow.com/comment/38621001
score: 0

http://stackoverflow.com/a/24784055
type: Answer
has body: You can use this pattern too: var myStr = "1.6.1 Members................................................................ 12\n1.6.2 Accessibility.......................................................... 13\n1.6.3 Type parameters........................................................ 13\n1.6.4 The T generic type aka &lt;T&gt;............................................. 13"; console.log(myStr.split(/ (.+?)\.{2,} ?\d+$\n?/m)); About a way with a lookahead : I don't think it is possible. Because the only way to skip a character (here a space between two words), is to match it on the occasion of the previous occurence of a space (between the number and the first word). In other words, you use the fact that characters can not be matched more than one time. But if, except the space where you want to split, all the pattern is enclosed in a lookahead, and since the substring matched by this subpattern in the lookahead isn't a part of the match result (in other words, it's only a check and the corresponding characters are not eaten by the regex engine), you can't skip the next spaces, and the regex engine will continue his road until the next space character.
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/24779247

http://stackoverflow.com/q/24846064
has title: How to correctly extend a defined object?
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/24846083
accepted answer: http://stackoverflow.com/a/24846083
downvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/24846074
has body: I am looking to a nice blog series called relearning Backbone. I wanted to give a try to some code there to make sure I get better at it, since I am kind of new to Javascript. The code I want to run is very simple var MovieApp = { Models: {}, Collections: {}, Views: {}, Templates: {} }; var MovieApp.Models.Movie = Backbone.Model.extend ({ defaults: { title: 'Bag IT', year: 2010, averageRating: 4.6, rating: 'NR' }, initialize: function() { console.log('Movie Model Create'); } }); var movie = new MovieApp.Models.Movie(); But when I load the page, the following error is show on the console Uncaught SyntaxError: Unexpected token . and the line that is pointing is this one var MovieApp.Models.Movie = Backbone.Model.extend ({ I spend a couple of hours looking at it and I dont understand why. Probably I am missing something very basic, but I cant see it. Al the necessary libraries are already loaded. Appreciate if anyone can help me. Thanks
score: -1
has answer: http://stackoverflow.com/a/24846092
answer count: 3
tagged with: javascript
favorite count: 0
tagged with: backbone.js
has answer: http://stackoverflow.com/a/24846074

http://stackoverflow.com/q/24864694
type: Question
has comment: http://stackoverflow.com/comment/38619100
has comment: http://stackoverflow.com/comment/38615565
has title: shown.bs.modal, show.bs.modal, hidden.bs.modal won't fire on mobile devices
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/38620425
has comment: http://stackoverflow.com/comment/38615187
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38615432
has comment: http://stackoverflow.com/comment/38615374
has comment: http://stackoverflow.com/comment/38615798
has comment: http://stackoverflow.com/comment/38619176
answer count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
has body: I am fallen into a very weird problem that I had never faced before. What I am doing is that I am handling the bootstrap show.bs.modal/shown.bs.modal and hidden.bs.modal events so that I could tweak my CSS a bit when a modal is opened and closed. On desktop it runs just fine but when I try to open the website on mobile it doesn't handle those on mobile. Here is my code: MyWebsite $('.bs-example-modal-lg').bind('hidden.bs.modal', function () { $("html").css("overflow", "visible"); }); $('.bs-example-modal-lg').bind('shown.bs.modal', function () { $("html").css("overflow", "hidden"); }); Here's the fiddle. Better watch the results here.
tagged with: css
has comment: http://stackoverflow.com/comment/38620076
has comment: http://stackoverflow.com/comment/38615517

http://stackoverflow.com/comment/38871204
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24897628
has text: Safari, Chrome on Mac OSX
type: AnswerComment

http://stackoverflow.com/q/24866875
tagged with: angularjs
type: UnansweredQuestion
tagged with: unit-testing
type: Question
has answer: http://stackoverflow.com/a/24884466
tagged with: javascript
has body: This may seems silly to you, but I am worried from last couple of days, because I am new to angularjs and jasmine as well Here I have downloaded the angular-seed-master from https://github.com/angular/angular-seed and the Directory structure is : In my app/js folder I have a file called controllers.js having the code 'use strict'; /* Controllers */ angular.module('myApp.controllers', []).controller('MyCtrl1', ["$scope",function($scope) { $scope.name = 'Hello World!'; }]); And created the file called home.tests.js in the same folder and has the code like 'use strict'; describe('MyCtrl1', function () { var scope, $httpBackend; //we'll use these in our tests //mock Application to allow us to inject our own dependencies beforeEach(angular.mock.module('myApp')); //mock the controller for the same reason and include $rootScope and $controller beforeEach(angular.mock.inject(function ($rootScope) { //create an empty scope scope = $rootScope.$new(); //declare the controller and inject our empty scope $controller('MyCtrl1', { $scope: scope }); })); // tests start here it('should have variable text = "Hello World!"', function () { expect(scope.text).toBe('Hello World!'); }); }); And my karma file is like: // Karma configuration // Generated on Tue Jul 15 2014 14:30:06 GMT+0530 (India Standard Time) module.exports = function(config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: '', // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frameworks: ['jasmine'], // list of files / patterns to load in the browser files: [ 'app/bower_components/angular/angular.js', 'app/bower_components/angular-route/angular-route.js', 'app/bower_components/angular-mocks/angular-mocks.js', 'app/js/*.js' ], // list of files to exclude exclude: [ ], // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { }…
tagged with: karma-jasmine
score: 0
has title: How to Test the unit test file angularjs
answer count: 1

http://stackoverflow.com/comment/38418159
type: Comment
score: 3
comment on: http://stackoverflow.com/q/24760490
has text: Where is the static variable ?
type: QuestionComment

http://stackoverflow.com/q/24783632
has answer: http://stackoverflow.com/a/24784275
score: 0
type: AnsweredQuestion
has title: How could I reload ajax json result to datatable?
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/24784275
type: Question
tagged with: javascript
tagged with: jquery
tagged with: ajax
has body: $("#save").click(function () { $.ajax({ url: "<%:Url.Action("ApplicantSearch")%>", data: $("#SearchTerm").serialize(), type: 'POST', success: function (response) { alert(response.FIRST_NAME); $table.fnReload(response); }, error: function (xhr, status, error) { alert(error); } }); }); This is the button event. When I click a button, it submits a form and returns a json result from controller. My goal here is to grab the result and reload my data table. I've tried FnReload(response). This one gives me a server not responded error. I've also tried FnReloadAjax(). I got syntax error. Below is the code for my table. Can anyone help plz? Thank you. $table = $("#MasterTable").dataTable( { bAutoWidth: false, bProcessing: true, sDom: '<"$grid-toolbar"sF>tr<"dataTables-footer"ilp>', sSelectionMode: 'single', iDisplayLength: 10, aoColumns: [ { sProperty: "EMP_ID", sTitle: "Parent ID", }, { sProperty: "LAST_NAME", sTitle: "Last Name" }, { sProperty: "FIRST_NAME", sTitle: "First Name" }, { sTitle: "Maintenance Actions", mRender: function (data, type, obj) { return "Application " + "Documents " + "Interviews " + "Personal Info " + "Scores/Awards "; } } ] } );
tagged with: datatables
answer count: 1

http://stackoverflow.com/comment/38567400
type: QuestionComment
has text: Thanks Mritunjay and Ganesh. Both of your answers are working. Now my task is to display them in a table.
comment on: http://stackoverflow.com/q/24839530
score: 0
type: Comment

http://stackoverflow.com/comment/38659825
comment on: http://stackoverflow.com/a/24886411
has text: Ok so it doesnt make sense how i do it, since the set parameters belong to the page tracking and not to a user or a session. Any clever ideas how to delay execution of the track event?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38685577
type: Comment
has text: Sreekesh Okky thanks! it seems the perfect solution. It is not working on my project though( I think there is some other problem),but I think I will figure it out.Thanks again
type: AnswerComment
comment on: http://stackoverflow.com/a/24901518
score: 0

http://stackoverflow.com/comment/38525892
score: 0
comment on: http://stackoverflow.com/q/24817109
type: Comment
type: QuestionComment
has text: Your jsFiddle needs jQuery library to be loaded (as-is, it simply fails to do anything). See http://jsfiddle.net/daCrosby/9eSKg/3/

http://stackoverflow.com/comment/38444979
score: 0
comment on: http://stackoverflow.com/q/24774720
type: Comment
type: QuestionComment
has text: please share your code in a fiddle along with the script

http://stackoverflow.com/comment/38407688
type: Comment
type: QuestionComment
has text: I see now also you try to open your connection twice, just once will suffice in your test1.php file.
comment on: http://stackoverflow.com/q/24753319
score: 0

http://stackoverflow.com/q/24880239
has comment: http://stackoverflow.com/comment/38645955
has title: regex create levels in a li from a select
type: Question
has comment: http://stackoverflow.com/comment/38644925
tagged with: javascript
upvote count: 1
has body: Here is my problem. I have a select field. &lt;select id="category_id" onchange="return showCategory(this);" name="data[category_id]"&gt; &lt;option value="Agencies"&gt;More &gt; Agencies&lt;/option&gt; &lt;option value="Catering"&gt;More&gt; Agencies &gt; Catering&lt;/option&gt; &lt;option value="Freelancers"&gt;More &gt; Agencies &gt; Freelancers&lt;/option&gt; &lt;option value="Driving-Instructors"&gt;More &gt; Agencies &gt; Freelancers &gt; Driving Instructors&lt;/option&gt; &lt;option value="Interior-Designer"&gt;More &gt; Agencies &gt; Freelancers &gt; Interior Designer&lt;/option&gt; &lt;option value="Swimming-Instructor"&gt;More &gt; Agencies &gt; Freelancers &gt; Swimming Instructor&lt;/option&gt; &lt;/select&gt; What i currently do, is pull into a separate Unordered list each of these. Which then looks like this. &lt;li class="listCat"&gt; &lt;a href="#"&gt;More&lt;/a&gt; &lt;ul class="More"&gt; &lt;li&gt;&lt;/li&gt; &lt;li class="More listed_nav"&gt; &lt;a href="#"&gt;More&lt;/a&gt; &lt;/li&gt; &lt;li&gt;&lt;/li&gt; &lt;li class="More listed_nav"&gt; &lt;a href="#"&gt;More &amp;gt; Agencies&lt;/a&gt; &lt;/li&gt; &lt;li&gt;&lt;/li&gt; &lt;li class="More listed_nav"&gt; &lt;a href="#"&gt;More &amp;gt; Agencies &amp;gt; Catering&lt;/a&gt; &lt;/li&gt; &lt;li&gt;&lt;/li&gt; &lt;li class="More listed_nav"&gt; &lt;a href="#"&gt;More &amp;gt; Agencies &amp;gt; Freelancers&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; Here is the JS that accomplishes the task. $('#category_id option').not(':first-child').each(function(){ var stripper = $(this).text(); var length = $(this).text().split(' ').length; var single; if(stripper.indexOf('&gt;') === -1){ //var str = stripper.replace(/[^a-zA-Z 0-9]+/g, ''); single = stripper; $('.parentCat .styled_list').append('&lt;li class="listCat "&gt;&lt;a href="#"&gt;'+single+'&lt;/a&gt;&lt;ul class="'+single+'"&gt;&lt;/ul&gt;&lt;/li&gt;'); } }); $('div.parentCat ul li').each(function(){ var liName = $(this).text(); $('#category_id op…
answer count: 1
has answer: http://stackoverflow.com/a/24880940
accepted answer: http://stackoverflow.com/a/24880940
tagged with: jquery
has comment: http://stackoverflow.com/comment/38644942
favorite count: 0
tagged with: regex
type: AnsweredQuestion
downvote count: 0
score: 1

http://stackoverflow.com/q/24757734
accepted answer: http://stackoverflow.com/a/24758002
answer count: 2
has answer: http://stackoverflow.com/a/24757943
downvote count: 0
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/24757943
tagged with: zend-framework2
tagged with: php
has body: layout.phtml <a href="<?php echo $this->url('login') ?>"><?php echo $this->translate('Home') ?> Jobs <a tabindex="-1" href="<?php echo $this->url('home') ?>">Interviews Resume Tips Interview Ques <a href="<?php echo $this->url('company') ?>"><?php echo $this->translate('HR Desk') ?> <a href="<?php echo $this->url('home') ?>"><?php echo $this->translate('Job Tips') ?> <a href="<?php echo $this->url('home') ?>"><?php echo $this->translate('Contact Us') ?> what and where should i do change the class when change the page to add the css class(active)
has answer: http://stackoverflow.com/a/24758002
type: AnsweredQuestion
upvote count: 1
type: Question
has title: how to add css class(active) while change the page in zend framework's layout
score: 1

http://stackoverflow.com/comment/38675454
has text: What have you tried? A quick Google search [brought up this guide.](http://www.codeproject.com/Articles/149258/Inject-HTML-and-JavaScript-into-an-existing-page-w)
score: 1
comment on: http://stackoverflow.com/q/24896460
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24839137
has comment: http://stackoverflow.com/comment/38566277
answers question: http://stackoverflow.com/q/24838976
type: Answer
has body: Not Sure but i think if condition is being true please try once like this: &lt;?php session_start(); $userid = $_SESSION['mucciusersess']; // if session var not already exists --&gt; get from cookie and set if(!$userid&gt;0) { $usercokie = $_COOKIE['mucciuserid']; echo $usercokie.' &lt; &gt; '.$userid; $_SESSION['mucciusersess'] = $usercokie; $userid = $_SESSION['mucciusersess']; echo '-'.$userid; } ?&gt;
score: 0

recaptcha
tag name: recaptcha
tags question: http://stackoverflow.com/q/24904924
type: Tag

http://stackoverflow.com/comment/38460950
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24783026
has text: @Pak it is not a problem within `ng-repeat` because the element can't exist until it is compiled anyway

http://stackoverflow.com/q/24827138
type: AnsweredQuestion
downvote count: 5
has comment: http://stackoverflow.com/comment/38544637
score: -3
has answer: http://stackoverflow.com/a/24827183
accepted answer: http://stackoverflow.com/a/24827183
type: Question
has comment: http://stackoverflow.com/comment/38544243
has comment: http://stackoverflow.com/comment/38543854
has comment: http://stackoverflow.com/comment/38543868
possible better answer: http://stackoverflow.com/a/24827178
has body: I have a &lt;ul&gt; where each li reponds on :hover. Here is the css: .profile_nav_item:hover { border-color: #af0621; } But it want these borders to stay colored when I click them. I have this jQuery function: $('a[rel="tab"]').click(function(e){ var url = $(this).attr('href'); $('.profile_nav_item').css('border-color', 'transparent'); $('.profile_nav_item', this).css('border-color', '#af0621'); But after clicking, the :hover css property isn't called anymore. Does anyone know how I could fix this? Here is the fiddle: http://jsfiddle.net/zRJK9/
upvote count: 2
has answer: http://stackoverflow.com/a/24827178
answer count: 2
has comment: http://stackoverflow.com/comment/38543900
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: :hover doesn't work with jquery script
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/q/24758669
score: 0
has title: Validate form and some inputs at same time
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24758779
type: Question
has body: Here I have a form and I need to validate form. I have select2 input fields and this fields I cant validate with parsley plugin so I write my code... Problem is how to at same time check if validate = true and select2 inputs ===null... I write: $(function() { $('#myForm').submit(function(e) { e.preventDefault(); if ( $(this).parsley('validate') ) { if ($("#parcele").select2("data")== null || $("#vrsta_rada").select2("data")== null) { $('#parerror').show(); console.log('nema dalje'); } else { var zemljiste = $("#parcele").select2("data").naziv; var id_parcele = $("#parcele").select2("data").id; var vrsta_rada = $("#vrsta_rada").select2("data").text; $.ajax({ url: "insertAkt.php", type: "POST", async: true, data: { naziv:$("#naziv").val(),parcele:zemljiste,vrsta_rada:vrsta_rada,opis:$("#opis").val(),pocetak:$("#pocetak").val(),zavrsetak:$("#zavrsetak").val(),status:$("#status").val(),id_parcele:id_parcele,}, //your form data to post goes here as a json object dataType: "html", success: function(data) { $('#myModal').modal('hide'); drawVisualization(); console.log('USPEH'); console.log(data); }, error: function (data) { console.log(data); console.log('GRESKA NEKA'); } }); } } }); }); but as you can see my code first check form validation after that select2 inputs so how I can at same time check form and select2 inputs fields?
tagged with: forms
tagged with: validation
accepted answer: http://stackoverflow.com/a/24758779
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/38479320
type: Comment
has text: That is not how you use `.appendChild`. `.appendChild` accepts an `HTMLElement` object, not a string.
comment on: http://stackoverflow.com/a/24792377
type: AnswerComment
score: 0

http://stackoverflow.com/a/24804107
answers question: http://stackoverflow.com/q/24803456
has body: I agree with finelords answer. That is the best approach but to answer your question Demo: http://jsfiddle.net/robschmuecker/EZJv6/ We had to do a check on the timer being in existence aswell, see comments below. JS: var timer = null; function openToolbar() { // Moved these out of event to prevent re-processing. // Toolbar and Window width var tableToolbar = $('.ac-table-toolbar'), winWidth = $(window).width(); // Only execute for desktop $('.no-touch').on('mousemove', function (event) { // If cursor enters right hand side of the screen start the timer // and execute after 2 seconds // here you are setting a timer on every mousemove, even the ones when the cursor is over the active bar so we need to fix by checking if if (event.pageX &gt; (winWidth - 20) &amp;&amp; tableToolbar.hasClass('notActive') &amp;&amp; timer == null) { // Timeout console.log('setting timeout'); timer = setTimeout(function () { // Add active class to toobar and css transition will animate it to open position tableToolbar.addClass('active').removeClass('notActive'); }, 500); } // If mouse pointer leaves right hand side of the screen and // still has notActive class cancel the timeout to prevent // the toolbar from opening if (event.pageX &lt; (winWidth - 20) &amp;&amp; tableToolbar.hasClass('notActive') &amp;&amp; timer != null) { clearTimeout(timer); timer = null; console.log('cancelling timeout 1'); } // Toolbar has active class so we know its visible if (tableToolbar.hasClass('active') &amp;&amp; event.pageX &lt; (winWidth - 20)) { // Clear timeout (if needed?) clearTimeout(timer); timer = null; console.log('cancelling timeout 2'); // Remove active class and css transition will return it to docked position tableToolbar.removeClass('active').addClass('notActive'); } }); } openToolbar();
type: Answer
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/comment/67559924
has text: @ChristopherHarris When you use zip this way, are the server response objects in the array in the same order as the requests are listed?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/24816917
type: Comment

http://stackoverflow.com/q/24876643
has body: In my navigation menu, I have a dropdown that I want to use. The actual dropping down is fine, and I've prevented the automatic bubbling by using preventDefault(); but now all the links within the dropdown no longer work. How do I make it so that the dropdown works, doesn't bubble and all the links within the dropdown work? Edit: I've also used event.stopPropagation() to no effect either. What's going on here?! This is my code: // Toggle dropdowns $('.menu-item-has-children').click(function(e){ e.preventDefault(); $(this).find('.sub-menu').toggleClass('open'); });
has comment: http://stackoverflow.com/comment/38638177
type: AnsweredQuestion
downvote count: 0
score: 1
linked to: http://stackoverflow.com/q/5963669
has answer: http://stackoverflow.com/a/24876661
accepted answer: http://stackoverflow.com/a/24876661
has title: preventDefault but activate links
has answer: http://stackoverflow.com/a/24877415
has comment: http://stackoverflow.com/comment/38638224
type: Question
has comment: http://stackoverflow.com/comment/38638150
tagged with: javascript
answer count: 2
upvote count: 1
possible better answer: http://stackoverflow.com/a/24877415
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/38438763
type: Comment
comment on: http://stackoverflow.com/a/24771376
has text: Then you can reserve the process by creating a hidden input type with a form around it whose value is that of the javascript variable and then taking the PHP variable by taking the value of $_GET['name of hidden input']
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38405844
type: QuestionComment
score: 0
has text: I doubt that the image load callback would trigger before DOM ready. The image node is going to be loaded before the actual image and its dimensions. What you want to do is do your image work on image load not DOM ready.
comment on: http://stackoverflow.com/q/24753940
type: Comment

http://stackoverflow.com/comment/62183886
type: Comment
comment on: http://stackoverflow.com/a/24863329
score: 0
type: AnswerComment
has text: YOU ARE THE BEST, but I found out when we are on error page "back button" doesnt work, In your example just doesnt work in my work shows "tried to load angular more than once" :/ any solution?

http://stackoverflow.com/comment/38425423
comment on: http://stackoverflow.com/a/24764273
type: AnswerComment
has text: That's not always possible. Sometimes there are multiple references to the original Array, which means they won't see the update.
score: 0
type: Comment

http://stackoverflow.com/comment/38438923
type: Comment
comment on: http://stackoverflow.com/a/24771416
type: AnswerComment
has text: put here your html, without that i cant help you
score: 0

http://stackoverflow.com/q/24871443
has answer: http://stackoverflow.com/a/24880475
has answer: http://stackoverflow.com/a/38144164
has body: I have my application which bases on Three.js library. However, it doesn't run on mobile browser when I used WebGLRender. I checked some application from Mr.doob (http://threejs.org/examples/#webgl_panorama_equirectangular). I wonder whether or not mobile browser support three.js or I missed something to run its application on device? Tks
downvote count: 0
tagged with: jquery-mobile
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24880475
answer count: 3
has title: Does mobile browser support Three.js application
favorite count: 0
has comment: http://stackoverflow.com/comment/38628198
tagged with: three.js
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/24871503
upvote count: 3
has answer: http://stackoverflow.com/a/24871503
has comment: http://stackoverflow.com/comment/38628496
type: Question

http://stackoverflow.com/q/24833487
has title: What is HTML5 File.slice method actually doing?
type: AnsweredQuestion
downvote count: 0
score: 40
type: Question
tagged with: algorithm
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24834417
has body: I'm working with a custom API to allow a user to upload a file (of, hopefully, arbitrary size). If the file is to large, it will be chunkfied, and handled in multiple requests to the server. I'm writing code that uses File and FileReader (HTML5) as per many examples from online. In general (from what I read online) for a chunkfied file transfer, people will first get a blob of data from their file object var file = $('input[type=file]')[0].files[0]; var blob = file.slice(start,end) Then use a FileReader to read the blob readAsArrayBuffer(blob) or readAsBinaryString(blob) And finally in FileReader.onload(e) method, send the data to the server. Repeat this process for all the chunks in the file. My questions are Why do I need to use a FileReader? If I don't use it, and simply send blobs with File.slice, is there any guarantee that the slicing operation will be done before I try to send the data in each request. Does the File object load the entire file when it's created (surely not?). Does File.slice seek to the position stipulated by the parameters, and then read the information in? The documentation doesn't give me an clues on how it's implemented.
tagged with: http://stackoverflow.com/tag/html
answer count: 1
upvote count: 40
tagged with: file-upload
favorite count: 0
has answer: http://stackoverflow.com/a/24834417
tagged with: chunking

http://stackoverflow.com/q/24837580
tagged with: javascript
has answer: http://stackoverflow.com/a/24838857
has body: I have this code to test out the server, var client = net.connect({port: 3000}, onConnected); client.setNoDelay(false); function onConnected() { while (true) { client.write('hello'); } } using the debug module, I see 0ms for each request which is expected considering it is on the same machine. The server should receive &lt;Buffer 68 65 6c 6c 6f&gt; but the server actually receives: &lt;Buffer 68 65 6c 6c 6f 68 65 6c 6c 6f 68 65 6c 6c 6f 68 65 6c 6c 6f 68 65 6c 6c 6f 68 65 6c 6c 6f 68 65 6c 6c 6f 68 65 6c 6c 6f 68 65 6^Cc 6c 6f 68 65 6c 6c 6f 68 ...&gt; Odd behaviour? Actually not, if I understand this correctly, this is happening because the write isn't flushed immediately causing it to be joined before actually getting sent. But problem is how do I get around this and actually receive the right bytes even if the writing to the socket is very fast. An idea is to have all the written data to be prepended with the size. Then read from that size and cut the buffer from there. But question is how do I do that? I don't think I can do that with something like this: socket.on('data', function(data) { var len = data[0]; // hmmmm }) So, Is there a way to read the stream byte by byte and cut off to every length which is specified on the first byte of every packet? A better alternative? or am I missing the point?
favorite count: 0
has comment: http://stackoverflow.com/comment/38563418
accepted answer: http://stackoverflow.com/a/24837625
tagged with: sockets
possible better answer: http://stackoverflow.com/a/24838857
tagged with: node.js
score: 2
type: AnsweredQuestion
upvote count: 2
type: Question
has title: Writing to socket very fast causes joined buffers
answer count: 2
has answer: http://stackoverflow.com/a/24837625
downvote count: 0

http://stackoverflow.com/q/24907473
tagged with: javascript
type: UnansweredQuestion
has title: dojo xhr.post, I put a array in xhr.post data but the data is changed why?
favorite count: 0
type: Question
tagged with: dojo
upvote count: 2
has answer: http://stackoverflow.com/a/24909070
has body: I use dojo 1.9 in my aplication. When i pass the array (aID) to the xhr.post data, the array data will change and will convert in array, example: aid = [3,4] and xhr.post send aid =[[3],[4]] why? I do not understand why this happens. // Create the grid grid = new EnhancedGrid({ id: 'grid', store: Mystore, structure: layout, //selectionMode: multiple, //keepSelection: true, escapeHTMLInData: false, width: '100%', autoHeight: true, rowSelector: gridLayout, noDataMessage: 'No Devices', plugins: { pagination: { pageSizes: [], description: true, sizeSwitch: true, pageStepper: true, gotoButton: true, /*page step to be displayed*/ maxPageStep: 4, /*position of the pagination bar*/ position: "bottom" }, indirectSelection: {headerSelector:true, width:gridLayout, styles:"text-align: center;"} } }) grid.placeAt('gridContainer'); grid.startup(); var button4 = new Button({ label:"Delete device"}); //button4.startup(); button4.placeAt("buttonD"); button4.on("click", function(event) { var aID =[]; var items = grid.selection.getSelected(); dojo.forEach(items, function(selectedItem){ aID.push(grid.store.getValues(selectedItem,'id')); }); console.info(aID); xhr.post("/****/***/***/***/action",{ sync: true, data: dojo.toJson({ action: 255, targets: aID }), headers: { 'Content-Type': 'application/json','x-ds-session': cookie("token")}, handleAs: "json" }).then(function(data1){ },function(err){ if( (err.response.text).indexOf("Invalid session token") != -1 ){ window.location.reload(true); } }); });
answer count: 1
linked to: http://stackoverflow.com/q/1374126
score: 2
tagged with: arrays
downvote count: 0

http://stackoverflow.com/comment/38615340
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24863372
type: Comment
has text: I'm not sure if there is a bug, the map scolls(pans), but IMO this is no dragging-operation on the map(it's more panning executed by the API). Setting the draggable-option to false will not prevent the map from viewport-changes.

http://stackoverflow.com/q/24811205
has answer: http://stackoverflow.com/a/24811366
has comment: http://stackoverflow.com/comment/38513865
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/38514436
possible better answer: http://stackoverflow.com/a/24811374
answer count: 3
has answer: http://stackoverflow.com/a/24811374
linked to: http://stackoverflow.com/q/4618541
downvote count: 1
has answer: http://stackoverflow.com/a/24811382
favorite count: 0
has comment: http://stackoverflow.com/comment/38514750
has comment: http://stackoverflow.com/comment/38514530
has body: I want to access the variable in the object, something like below: var menuSetup = { m : [100,200], height: m[0], // m is not defined } var menuSetup = { m : [100,200], height: this.m[0], // I tried this, still failed } So can I access the variable in the object?
has comment: http://stackoverflow.com/comment/38513863
has title: Cannot access the variable in the object
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/38514616
accepted answer: http://stackoverflow.com/a/24811366
type: Question
has comment: http://stackoverflow.com/comment/38513989
has comment: http://stackoverflow.com/comment/38514089