http://stackoverflow.com/q/26854240
has comment: http://stackoverflow.com/comment/42271041
score: 1
has answer: http://stackoverflow.com/a/26854332
has comment: http://stackoverflow.com/comment/42271011
accepted answer: http://stackoverflow.com/a/26854332
upvote count: 1
type: Question
has body: In JavaScript I want to load an image file from a different directory. My file structure is as such: Project/js/script.js Project/img/1.png In script.js I want the following: document.getElementById("image").src = "Project/img/1.png"; How do I make this work?
tagged with: javascript
has title: JavaScript load image file from a different directory
has answer: http://stackoverflow.com/a/26854399
answer count: 2
downvote count: 0
tagged with: directory
favorite count: 0
tagged with: path
has comment: http://stackoverflow.com/comment/42271070
possible better answer: http://stackoverflow.com/a/26854399
type: AnsweredQuestion

http://stackoverflow.com/a/26922646
answers question: http://stackoverflow.com/q/26868420
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26868420
type: AcceptedAnswer
downvote count: 0
has body: It looks like was still missing a ) on the if var anchors = document.getElementsByTagName('a'); var pattern = /topic3048|topic2145|topic2147/; for (var j = 0; j &lt; anchors.length; j++) { if ( pattern.test( anchors[j].href ) ) { anchors[j].style.backgroundColor = 'GreenYellow'; } //optional else { console.log(anchors[j].href); } } You should try check the firebug console, also use an IDE, like Sublime Text, WebStorm.
type: Answer

http://stackoverflow.com/q/26864654
has body: Based on reading some documents from mozilla i just wanted to try out the html5 "xhr2" (so called) functionality. SO i used this code... var oReq = new XMLHttpRequest(); function transferComplete(evt) { alert("The transfer is complete."); } oReq.upload.addEventListener("load", transferComplete, false); oReq.open('POST',"https://www.google.com",true); I placed the above code in the head section of my page , but the page always loads but none of the events are fired.. Could someone please tell me what im doing wrong .... Thanks guys
has answer: http://stackoverflow.com/a/26864864
accepted answer: http://stackoverflow.com/a/26864864
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42289147
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: XHttpRequest 2 page progress not working
has comment: http://stackoverflow.com/comment/42288870
type: AnsweredQuestion

http://stackoverflow.com/comment/42381600
type: QuestionComment
has text: @Bergi No they don't need to and shouldn't.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/26916368

http://stackoverflow.com/q/26921489
linked to: http://stackoverflow.com/q/8098406
score: 0
tagged with: drag-and-drop
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/52268030
has title: Interact.js drag and drop not working in IE9 browser
has comment: http://stackoverflow.com/comment/42391047
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42415764
duplicate of: http://stackoverflow.com/q/8098406
has body: Getting below error when I was trying to drag. event.target.classList.add('drop-active'); " Unable to get property 'add' of undefined or null reference" I have used polyfill classList.js to fix this but it doesn't work. Please help me on this. I am getting this error only in ie9 browser.
has comment: http://stackoverflow.com/comment/42391007
type: Question
has comment: http://stackoverflow.com/comment/42416048
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42462914
tagged with: polyfills

http://stackoverflow.com/a/27924847
upvote count: 7
score: 7
has body: Try this //client.js 'change .logoBusinessBig-upload': function(event, template) { var file = event.target.files[0]; //assuming you have only 1 file if (!file) return; var reader = new FileReader(); //create a reader according to HTML5 File API reader.onload = function(event){ var buffer = new Uint8Array(reader.result) // convert to binary Meteor.call('saveFile',buffer); } reader.readAsArrayBuffer(file); //read the file as arraybuffer } //server.js 'saveFile': function(buffer){ var fs = Npm.require("fs"); fs.writeFile('/location',new Buffer(buffer),function(error){...}); } Explanation You read the file as ArrayBuffer, but current DDP can't send it, so you 'convert' it to Uint8Array, then Meteor.call On the server, then you have to convert it by calling new Buffer(buffer) to save it. The '/location' can't be in meteor folder as this will trigger a reload, maybe save it to some TmpDir
downvote count: 0
answers question: http://stackoverflow.com/q/26868200
type: Answer

http://stackoverflow.com/q/26985213
favorite count: 0
has comment: http://stackoverflow.com/comment/42504063
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26985260
tagged with: iframe
has body: in the above code i want to add window.onresie event if i add a fuction it is not working please help me.
upvote count: 1
downvote count: 1
type: Question
has title: I need To Add window.onresize code to this javascript
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/42503987
answer count: 1
tagged with: jquery

http://stackoverflow.com/comment/42502339
has text: This is the quick and dirty way. The best way to achieve inheritance and so forth is to use `Object.create` - [read about it here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create)
comment on: http://stackoverflow.com/a/26984105
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/26852609
linked to: http://stackoverflow.com/q/16063394
upvote count: 1
has body: Okay... relative newbie here, probably overreaching myself but here goes. I've created an object in order to help validate a form. The object is called "Field" and looks like this: var Field = { mini : { val : 3, err : "Wrong length. Your entry needs to be greater than 2 characters", valid : false, check : function(target){ var target = event.target || event.srcElement; if (target.value.length &lt; this.mini.val) { this.mini.valid = false; fadeIn("mini",this.mini.err); } else { this.mini.valid = true; fadeOut("mini",this.mini.err); return null; } }, }, max : { val : 5, err: "Wrong length. Your entry needs to be less than 30 characters", valid : false, check : function(target){ var target = event.target || event.srcElement; if (target.value.length &gt; this.max.val) { this.max.valid = false; fadeIn("max",this.max.err); } else { this.max.valid = true; fadeOut("max",this.max.err); return null; } }, }, regex : { val : /[^a-zA-Z- ]/, err : "Letters, hyphens, apostrophes and spaces only please.", valid : false, check : function(){ var target = event.target || event.srcElement; if (target.value.match(this.regex.val)) { this.regex.valid = false; fadeIn("regex",this.regex.err); } else { this.regex.valid = true; fadeOut("regex",this.regex.err); return null; } }, }, hintID : "" } I get that this in itslf is somewhat clumsy and I'll be looking at ways to sort that further down the line. I've created several instances of this object as follows: var firstName = Object.create(Field); firstName.hintID = fnHint; firstName.regex.val = /[^a-zA-Z- ]/; firstName.regex.err = "Letters, hyphens, apostrophes and spaces only please."; var lastName = Object.create(Field); lastName.hintID = lnHint; lastName.regex.val = /[^a-zA-Z- ]/; lastName.regex.err = "Letters, hyphens, apostrophes and spaces only please."; var age = Object.create(Field); age.max.val = 3; age.max.err = "Wrong length. The age needs to be no more than 3 characters long."; age.regex.val = /[^0-9]/; age.regex.err = "Numbers onl…
tagged with: object
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26852883
has title: Object overridden by subsequent object in javascript
has comment: http://stackoverflow.com/comment/42272331
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: inheritance
linked to: http://stackoverflow.com/q/728360
favorite count: 0
has answer: http://stackoverflow.com/a/26852883
linked to: http://stackoverflow.com/q/3781373
tagged with: regex
score: 1

http://stackoverflow.com/comment/42449497
has text: I had a look at that iframe. There is no communication between the parent page and the iframe; the "autoclick" function is defined inside the iframe header tag. Btw, is the function called? Try to log something to the console.
comment on: http://stackoverflow.com/a/26954793
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/26871862
has body: Here are the steps I took: 1) I downloaded the script file from: https://github.com/doodeec/dcom-angular-dialog 2) included in my webpage and in my application: var summariesApp = angular.module('summariesApp', ['ui.bootstrap', 'ngCkeditor', 'dcModal']); 3) Tried to use it in a controller: summariesApp.controller("singleSNPController", function ($scope, $http) { $scope.stopLightModal = dialogService.create('../Templates/test.html'); I get an error that the dialogService resource is not found. I know this question is a little simplistic but I have been stuck on this for a while now. Thanks in advance.
tagged with: angularjs
has answer: http://stackoverflow.com/a/26872325
type: UnansweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/26871922
tagged with: javascript
type: Question
answer count: 2
downvote count: 0
has title: trouble with ng-modal while calling it in controller
favorite count: 0

http://stackoverflow.com/comment/42253720
comment on: http://stackoverflow.com/a/26845185
has text: Updated with example.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/26887751
score: 0
answers question: http://stackoverflow.com/q/26887582
type: AcceptedAnswer
type: Answer
has body: If you want to check whether length of "ebc" between 1-4 then try like; function getHue() { var ebc = document.getElementById("ebctotal").value; if (ebc.length&gt;=1 &amp;&amp; ebc.length&lt;=4) { document.getElementById('hue').value='Very pale'; } } or whether value of "ebc" between 1-4 then try like; function getHue() { var ebc = parseInt(document.getElementById("ebctotal").value); if (ebc&gt;=1 &amp;&amp; ebc&lt;=4) { document.getElementById('hue').value='Very pale'; } }
accepted answer of: http://stackoverflow.com/q/26887582

http://stackoverflow.com/comment/42506045
has text: That does not work . It does not change when I connect to my vpn client.
comment on: http://stackoverflow.com/a/26986191
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/42376522
has text: Just tried the above example, but it did not work unfortunately. The dropdown list just gets filled with [object Object] for each row.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26911922
type: Comment

http://stackoverflow.com/comment/42403053
comment on: http://stackoverflow.com/a/26927771
type: AnswerComment
score: 0
has text: Yes, i changed it according to the advice, But while i choose 1st, 2nd and 3rd selection list accordingly When i change the 1st selection list, the 3rd selection list should be reset , is there any other option rather than ab('#RegionName').selectmenu('refresh', true); ?
type: Comment

http://stackoverflow.com/a/57680320
type: Answer
score: 8
upvote count: 8
answers question: http://stackoverflow.com/q/26915193
downvote count: 0
has body: this.$el - points to the root element of the component this.$refs.<ref name> + <div ref="<ref name>" ... - points to nested element use $el/$refs only after mounted() step of vue lifecycle root element child element

http://stackoverflow.com/a/28234897
has comment: http://stackoverflow.com/comment/44831484
upvote count: 3
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26903493
answers question: http://stackoverflow.com/q/26903493
type: Answer
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/45457627
has body: As mentioned by other friends clientside code can easily be neglected. So we can translate what you have done with javascript into c# like this with an addition of mine which is to remove extra spaces and merge them into one: if (Regex.IsMatch(txtSearch.Text, "[^a-zA-Z0-9 %]")) { //error Response.Redirect("Error.aspx?tx=It's a Shame Dude!"); } else { //Remove multiple spaces String ClearSpaces = Regex.Replace(txtSearch.Text, @"\s+", " "); Response.Redirect("search?tx=" + HttpUtility.UrlEncode(ClearSpaces)); } Not to forget, the regex is coming from: this answer. And the regex for replacing multiple spaces is coming from this answer.

jquery
tags question: http://stackoverflow.com/q/26880842
tags question: http://stackoverflow.com/q/26874203
tags question: http://stackoverflow.com/q/26986168
tags question: http://stackoverflow.com/q/26836688
tags question: http://stackoverflow.com/q/26947473
tags question: http://stackoverflow.com/q/26838195
tags question: http://stackoverflow.com/q/26941627
tags question: http://stackoverflow.com/q/26839774
tags question: http://stackoverflow.com/q/26882960
tags question: http://stackoverflow.com/q/26911219
tags question: http://stackoverflow.com/q/26986590
tags question: http://stackoverflow.com/q/26867321
tags question: http://stackoverflow.com/q/26977008
tags question: http://stackoverflow.com/q/26986986
tags question: http://stackoverflow.com/q/26970562
tags question: http://stackoverflow.com/q/26889299
tags question: http://stackoverflow.com/q/26952903
tags question: http://stackoverflow.com/q/26938392
tags question: http://stackoverflow.com/q/26886038
tags question: http://stackoverflow.com/q/26834990
tags question: http://stackoverflow.com/q/26841163
tags question: http://stackoverflow.com/q/26976148
tags question: http://stackoverflow.com/q/26988957
tags question: http://stackoverflow.com/q/26860394
tags question: http://stackoverflow.com/q/26843869
tags question: http://stackoverflow.com/q/26885135
tags question: http://stackoverflow.com/q/26880829
tags question: http://stackoverflow.com/q/26978087
tags question: http://stackoverflow.com/q/26855577
tags question: http://stackoverflow.com/q/26844529
tags question: http://stackoverflow.com/q/26881157
tags question: http://stackoverflow.com/q/26910584
tags question: http://stackoverflow.com/q/26957090
tags question: http://stackoverflow.com/q/26961532
tags question: http://stackoverflow.com/q/26882171
tags question: http://stackoverflow.com/q/26859275
tags question: http://stackoverflow.com/q/26843396
tags question: http://stackoverflow.com/q/26930104
tags question: http://stackoverflow.com/q/26838560
tags question: http://stackoverflow.com/q/26976925
tags question: http://stackoverflow.com/q/26935884
tags question: http://stackoverflow.com/q/26986197
tags question: http://stackoverflow.com/q/26856512
tags question: http://stackoverflow.com/q/26870629
tags question: http://stackoverflow.com/q/26863459
tags question: http://stackoverflow.com/q/26902332
tags question: http://stackoverflow.com/q/26953802
tags question: http://stackoverflow.com/q/26867974
tags question: http://stackoverflow.com/q/26976245
tags question: http://stackoverflow.com/q/26882333
tags question: http://stackoverflow.com/q/26849113
tags question: http://stackoverflow.com/q/26850144
tags question: http://stackoverflow.com/q/26853533
tags question: http://stackoverflow.com/q/26973188
tags question: http://stackoverflow.com/q/26921160
tags question: http://stackoverflow.com/q/26957761
tags question: http://stackoverflow.com/q/26907794
tags question: http://stackoverflow.com/q/26970179
tags question: http://stackoverflow.com/q/26985814
tags question: http://stackoverflow.com/q/26969489
tags question: http://stackoverflow.com/q/26943500
tags question: http://stackoverflow.com/q/26921536
tags question: http://stackoverflow.com/q/26842835
tags question: http://stackoverflow.com/q/26883297
tags question: http://stackoverflow.com/q/26898378
tags question: http://stackoverflow.com/q/26990992
tags question: http://stackoverflow.com/q/26961325
tags question: http://stackoverflow.com/q/26845505
tags question: http://stackoverflow.com/q/26902068
tags question: http://stackoverflow.com/q/26952544
tags question: http://stackoverflow.com/q/26964803
tags question: http://stackoverflow.com/q/26965901
tags question: http://stackoverflow.com/q/26860166
tags question: http://stackoverflow.com/q/26859462
tags question: http://stackoverflow.com/q/26946607
tags question: http://stackoverflow.com/q/26833545
tags question: http://stackoverflow.com/q/26832590
tags question: http://stackoverflow.com/q/26844368
tags question: http://stackoverflow.com/q/26878245
tags question: http://stackoverflow.com/q/26893113

angularjs
tags question: http://stackoverflow.com/q/26953495
tags question: http://stackoverflow.com/q/26871068
tags question: http://stackoverflow.com/q/26933127
tags question: http://stackoverflow.com/q/26926876
tags question: http://stackoverflow.com/q/26971376
tags question: http://stackoverflow.com/q/26890810
tags question: http://stackoverflow.com/q/26937645
tags question: http://stackoverflow.com/q/26881100
tags question: http://stackoverflow.com/q/26947667
tags question: http://stackoverflow.com/q/26972725
tags question: http://stackoverflow.com/q/26916755
tags question: http://stackoverflow.com/q/26916852
tags question: http://stackoverflow.com/q/26833500
tags question: http://stackoverflow.com/q/26934875
tags question: http://stackoverflow.com/q/26951793
tags question: http://stackoverflow.com/q/26919942
tags question: http://stackoverflow.com/q/26942674
tags question: http://stackoverflow.com/q/26912758
tags question: http://stackoverflow.com/q/26983914
tags question: http://stackoverflow.com/q/26936946
tags question: http://stackoverflow.com/q/26848479
tags question: http://stackoverflow.com/q/26961280
tags question: http://stackoverflow.com/q/26909028
tags question: http://stackoverflow.com/q/26853403
tags question: http://stackoverflow.com/q/26951152
tags question: http://stackoverflow.com/q/26856358
tags question: http://stackoverflow.com/q/26943342
tags question: http://stackoverflow.com/q/26835290
tags question: http://stackoverflow.com/q/26883663
tags question: http://stackoverflow.com/q/26920217
tags question: http://stackoverflow.com/q/26968019
tags question: http://stackoverflow.com/q/26970640
tags question: http://stackoverflow.com/q/26879892
tags question: http://stackoverflow.com/q/26980797
tags question: http://stackoverflow.com/q/26865892
tags question: http://stackoverflow.com/q/26914059
tags question: http://stackoverflow.com/q/26982459
tags question: http://stackoverflow.com/q/26858569
tags question: http://stackoverflow.com/q/26954479
tags question: http://stackoverflow.com/q/26883485
tags question: http://stackoverflow.com/q/26897667
tags question: http://stackoverflow.com/q/26907428
tags question: http://stackoverflow.com/q/26940360
tags question: http://stackoverflow.com/q/26910849
tags question: http://stackoverflow.com/q/26858039
tags question: http://stackoverflow.com/q/26981749
tags question: http://stackoverflow.com/q/26866979
tags question: http://stackoverflow.com/q/26967477
tags question: http://stackoverflow.com/q/26927987
tags question: http://stackoverflow.com/q/26953032
tags question: http://stackoverflow.com/q/26853603
tags question: http://stackoverflow.com/q/26926435
tags question: http://stackoverflow.com/q/26895859
tags question: http://stackoverflow.com/q/26991661
tags question: http://stackoverflow.com/q/26834667
tags question: http://stackoverflow.com/q/26903620
tags question: http://stackoverflow.com/q/26911876
tags question: http://stackoverflow.com/q/26840305
tags question: http://stackoverflow.com/q/26968959
tags question: http://stackoverflow.com/q/26938302
tags question: http://stackoverflow.com/q/26972777
tags question: http://stackoverflow.com/q/26892746
tags question: http://stackoverflow.com/q/26877084
tags question: http://stackoverflow.com/q/26949527
tags question: http://stackoverflow.com/q/26851373
tags question: http://stackoverflow.com/q/26917905
tags question: http://stackoverflow.com/q/26850857
tags question: http://stackoverflow.com/q/26915136
tags question: http://stackoverflow.com/q/26965359
type: Tag
tags question: http://stackoverflow.com/q/26861385
tags question: http://stackoverflow.com/q/26918546
tags question: http://stackoverflow.com/q/26894779
tags question: http://stackoverflow.com/q/26991475
tags question: http://stackoverflow.com/q/26847767
tags question: http://stackoverflow.com/q/26856929
tags question: http://stackoverflow.com/q/26882350
tags question: http://stackoverflow.com/q/26894656
tags question: http://stackoverflow.com/q/26833035
tags question: http://stackoverflow.com/q/26845358

http://stackoverflow.com/a/26867109
has body: Its becaus your absolute position of the navigation and navi element. left: 1100px; Your .container has a min-width of 800px... optimize the menu for this width and make the container centered. EDIT: Overwrite this stylings: #midbar { background-color: #e0dfcb; height: 115px; margin: 0 auto; opacity: 0.8; position: relative; top: -20px; width: 800px; z-index: 1111; } #navigation { border-bottom-style: dotted; border-top-style: dotted; border-width: 2px; left: 0; position: absolute; top: 45px; } #navi { border-bottom-style: dotted; border-top-style: dotted; border-width: 2px; position: absolute; right: 0; top: 45px; } If it is to narrow alter the width in #midbar. EDIT:2 Ok to keep the tan bar i added another div around the menu: See here: http://jsfiddle.net/zzfa1m3p/1/ Added: in Line 8 in Line 28 an copied styling from midbar: .top { position: relative; top: -20px; width: 100%; height: 115px; background-color: green; z-index: 1111; opacity: 0.8; margin: 0 auto; width: 100%; }
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26866966
has comment: http://stackoverflow.com/comment/42293878
has comment: http://stackoverflow.com/comment/42293960
answers question: http://stackoverflow.com/q/26866966
type: Answer
has comment: http://stackoverflow.com/comment/42293824
has comment: http://stackoverflow.com/comment/42293419
score: 1
upvote count: 1

http://stackoverflow.com/comment/42469840
score: 0
comment on: http://stackoverflow.com/a/26966217
type: AnswerComment
type: Comment
has text: Thank you for the answer. How do I make the other images stay in their position when displaying info when I click on an image? How can I display the info without moving the images' positions?

http://stackoverflow.com/a/26885050
downvote count: 1
has body: First give an id/class to the ul: a b c d Using jQuery to access the 'li' element at 2nd position: var second_li = $('#mylist').find('li')[1]; // to access 2nd li use index 1 var second_li_class = $(second_li).attr('class'); // second_li_class will be equal to 'list_2' var second_li_content = $(second_li).html(); // second_li_content will be equal to 'b'
type: Answer
upvote count: 0
answers question: http://stackoverflow.com/q/26884995
score: -1

http://stackoverflow.com/comment/42467977
type: Comment
has text: jQuery's [`:nth-child` selector](http://api.jquery.com/nth-child-selector/) will work on IE8. Just use a jQuery version that [actually supports IE8](http://jquery.com/browser-support/). Hint: It's not 2.x.
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/26965137

http://stackoverflow.com/q/26891846
has comment: http://stackoverflow.com/comment/42337766
upvote count: 7
has comment: http://stackoverflow.com/comment/42337843
has comment: http://stackoverflow.com/comment/42337497
favorite count: 0
downvote count: 0
has comment: http://stackoverflow.com/comment/42337638
has comment: http://stackoverflow.com/comment/42337504
has title: Is there an equivalent of `console.table` in the browser?
has comment: http://stackoverflow.com/comment/42337759
possible better answer: http://stackoverflow.com/a/26892123
has answer: http://stackoverflow.com/a/26892123
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42337745
has comment: http://stackoverflow.com/comment/42339458
score: 7
has body: console.table does exactly what I need it to do. But I want that table to be outputted in the browser. How can I do this? I've tried a few other solutions that didn't work because either: They expect an array of objects. The columns aren't dynamically determined (i.e. my objects don't all have the props). My Object looks like this: { source0: {target0: 2, target1: 2, target2: 1}, source1: {target1: 3}, /*...*/ }
accepted answer: http://stackoverflow.com/a/26892309
has comment: http://stackoverflow.com/comment/42337592
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/42337553
tagged with: javascript
has answer: http://stackoverflow.com/a/26892309

http://stackoverflow.com/a/26872492
has comment: http://stackoverflow.com/comment/42303307
answers question: http://stackoverflow.com/q/26872331
score: 3
downvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42303798
has body: This seems to be a CSS issue. In your master.css file, there is the following CSS declaration: .gm-style div div * { -webkit-transform: none !important; } Removing this CSS seems to cause the arrow to appear properly in Chrome.
upvote count: 3
type: Answer
accepted answer of: http://stackoverflow.com/q/26872331

http://stackoverflow.com/a/27062267
answers question: http://stackoverflow.com/q/26990663
type: AcceptedAnswer
type: Answer
has body: Here is a working solution if (navigator.appName == "Microsoft Internet Explorer") { var oWin = window.open(); oWin.document.write('sep=,\r\n' + CSV); oWin.document.close(); oWin.document.execCommand('SaveAs', true, fileName + ".csv"); oWin.close(); }
has comment: http://stackoverflow.com/comment/52595974
accepted answer of: http://stackoverflow.com/q/26990663
score: 0

http://stackoverflow.com/comment/42342445
has text: @Huangism - you're right, I just changed it to `prev`
score: 0
comment on: http://stackoverflow.com/a/26894438
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42466394
type: AnswerComment
comment on: http://stackoverflow.com/a/26943104
type: Comment
has text: I did take your advice and implemented this without success unfortunately. It still doesn't reset after I go to a new page.
score: 0

http://stackoverflow.com/comment/42445733
has text: JavaScript doesn't support lookbehinds.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26952540
score: 2

http://stackoverflow.com/a/26864524
answers question: http://stackoverflow.com/q/26864454
type: Answer
accepted answer of: http://stackoverflow.com/q/26864454
has body: The function calls itself recursively at the second to last line function readShift(){ ... readShift(); } This means that even though the method finishes, it will be invoked over and over again. Read this article on recusrion to understand what happenes.
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/26974265
score: 4
has answer: http://stackoverflow.com/a/33732064
has body: I have spent 2 days trying to solve this problem, and finally, I ask you, dear StackoverFlowers. I am developing an application for 27' multi-touch screens on C# 4.5 and I need a WebBrowser element within it. A user should only be able to pan the page by Y-axis and click on items. I disabled text selection, items dragging using JS; navigation using C#; but can't make it not scalable. I installed IE11 and turned it on using registry key (FEATURE_BROWSER_EMULATION). My HTML-file contains: &lt;meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1"&gt; My CSS-file contains: * { -ms-user-select: none; -ms-content-zooming: none; touch-action: pan-y; } But when I pinch with two fingers to zoom it still zooms. Can't get rid of this annoying function. How to disable it using any of JS, jQuery, IE11, .NET, Windows instruments? P.S. I am using Windows 8 and there is no "disable multi-touch gestures" in Mouse settings of control panel like in Windows 7 :&lt;
answer count: 2
tagged with: .net
favorite count: 0
upvote count: 4
tagged with: css
has answer: http://stackoverflow.com/a/27228063
downvote count: 0
accepted answer: http://stackoverflow.com/a/33732064
possible better answer: http://stackoverflow.com/a/27228063
type: Question
type: AnsweredQuestion
tagged with: c#
has title: How to disable IE11 WebBrowser control scaling
tagged with: internet-explorer
tagged with: javascript

http://stackoverflow.com/comment/42259821
comment on: http://stackoverflow.com/a/26848547
type: AnswerComment
score: 0
type: Comment
has text: Shouldn't it be `"url('" + new_src + "')"`?

http://stackoverflow.com/q/26855477
score: 0
linked to: http://stackoverflow.com/q/5498770
tagged with: google-maps
answer count: 1
tagged with: jquery
has body: I have just tried the solutions presented in Why is an embedded google map altering Safari&#39;s font rendering? and was hoping this would fix the issue, seeing as they are both webkit based browsers. However, I still see a difference with some text, specifically, the text which is within position: fixed sections of content (i.e. the header, and menu sections) after I add the Google Map to the page. I am using the Google Maps API to embed the map on the page on page load as follows: $(document).ready(function() { createMap("gmap", "&lt;?php echo $this-&gt;business['location']; ?&gt;"); }); function createMap(target, location) { var url = "http://maps.google.com/maps/api/geocode/json?address=" + location + "&amp;sensor=false"; $.getJSON(url,function (data, textStatus, jqXHR) { var r = data.results[0]; var jobLatLang = new google.maps.LatLng(r.geometry.location.lat, r.geometry.location.lng); var mapOptions = { zoom: 12, center: jobLatLang }; var map, marker; map = new google.maps.Map(document.getElementById(target),mapOptions); marker = new google.maps.Marker({ position: jobLatLang, map: map, title: r.formatted_address }); marker.setMap(map); map.panTo(marker.getPosition()); }); } and if I block the call to createMap there is no issue with the text rendering (of course this also means no map) and I have no idea why this would cause text rendered within position: fixed elements to possibly re-render? Any ideas? UPDATE: I have now been able to get the &lt;div&gt; element containing the map to prevent the addition of any further translates by adding style="-webkit-transform:none !important;" however the problem still persists. UPDATE 2: I have just found a horrible workaround, which more just confirms the issue, than fixes it. using the following function from Is it possible to remove inline styles with jQuery? (function($) { $.fn.removeStyle = function(style) { var search = new RegExp(style + '[^;]+;?', 'g'); return this.each(function() { $(this).attr('style', function(…
has comment: http://stackoverflow.com/comment/42273268
linked to: http://stackoverflow.com/q/2465158
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/42273704
has comment: http://stackoverflow.com/comment/42273339
type: Question
has comment: http://stackoverflow.com/comment/42273963
tagged with: javascript
has comment: http://stackoverflow.com/comment/42273662
has answer: http://stackoverflow.com/a/28312958
has title: Why is an embedded google map altering Chrome's font rendering?
has comment: http://stackoverflow.com/comment/42273239

http://stackoverflow.com/q/26854327
has title: jQuery Syntax, mouseover & timeouts
type: Question
answer count: 2
upvote count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: mouseover
has answer: http://stackoverflow.com/a/26854363
has body: I'm working on JQuery for the first time and am trying to implement script for an element which will expand 'on mouse enter' to 50px. After the mouse has hovered for 1 second or more it should expand to a further 190px. Finally when the mouse leaves the location it should resize back down to 35px. If the mouse leaves the location before it has fully expanded to 190px it should not continue to that step. The code I have developed so far allows the element to expand, but if the mouse is removed the element is sized up to 190px regardless of time hovered. I realise that I will most likely need to use a timeout function or some sort of if statement here, however I'm having problems adding it to the original code; $(document).ready(function() { $("#element").on("mouseenter", function() { $(this).animate({"width": "50px"}) //DELAY 100MS, IF THE MOUSE IS STILL HOVERED THEN PROCEED .animate({"width": "190px"}); //ELSE CONTINUE WITH MOUSE LEAVE FUNCTION }).on("mouseleave", function() { $(this).animate({"width": "35px"}); }); }); Like I mentioned, I'm having trouble finding the correct syntax for this and after reading through other questions I'm getting more confused; which would be best to use? timeouts, .hover, if statement etc.? http://jsfiddle.net/#&amp;togetherjs=3gl8z3blFI
tagged with: hover
possible better answer: http://stackoverflow.com/a/26854363
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26854422
tagged with: syntax
accepted answer: http://stackoverflow.com/a/26854422
score: 1

http://stackoverflow.com/q/26973654
has title: If the date picker field is clicked, both the date ranges calendars has to be displayed
downvote count: 1
type: Question
upvote count: 0
has body: The following is my code: defaultDate: "+1w", changeMonth: true, numberOfMonths: 1, onClose: function( selectedDate ) { $( "#to" ).datepicker( "option", "minDate", selectedDate ); } }); $( "#to" ).datepicker({ defaultDate: "+1w", changeMonth: true, numberOfMonths: 1, onClose: function( selectedDate ) { $( "#from" ).datepicker( "option", "maxDate", selectedDate ); What changes should I make?
tagged with: javascript
score: -1
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/42482488
has comment: http://stackoverflow.com/comment/42483436
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26973936

http://stackoverflow.com/tag/html
tags question: http://stackoverflow.com/q/26956430
tags question: http://stackoverflow.com/q/26838738
tags question: http://stackoverflow.com/q/26918212
tags question: http://stackoverflow.com/q/26979778
tags question: http://stackoverflow.com/q/26887217
tags question: http://stackoverflow.com/q/26866342
tags question: http://stackoverflow.com/q/26937838
tags question: http://stackoverflow.com/q/26934029
tags question: http://stackoverflow.com/q/26969764
tags question: http://stackoverflow.com/q/26873134
tags question: http://stackoverflow.com/q/26832708
tags question: http://stackoverflow.com/q/26860881
tags question: http://stackoverflow.com/q/26894291
tags question: http://stackoverflow.com/q/26985648
tags question: http://stackoverflow.com/q/26935677
tags question: http://stackoverflow.com/q/26908857
tags question: http://stackoverflow.com/q/26898848
tags question: http://stackoverflow.com/q/26877982
tags question: http://stackoverflow.com/q/26885908
tags question: http://stackoverflow.com/q/26835284
tags question: http://stackoverflow.com/q/26892137
tags question: http://stackoverflow.com/q/26862110
tags question: http://stackoverflow.com/q/26847360
tags question: http://stackoverflow.com/q/26864287
tags question: http://stackoverflow.com/q/26932349
tags question: http://stackoverflow.com/q/26843330
tags question: http://stackoverflow.com/q/26879471
tags question: http://stackoverflow.com/q/26991581
tags question: http://stackoverflow.com/q/26835546
tags question: http://stackoverflow.com/q/26868883
tags question: http://stackoverflow.com/q/26887345
tags question: http://stackoverflow.com/q/26979443
tags question: http://stackoverflow.com/q/26922159
tags question: http://stackoverflow.com/q/26861110
tags question: http://stackoverflow.com/q/26894318
tags question: http://stackoverflow.com/q/26943124
tags question: http://stackoverflow.com/q/26924551
tags question: http://stackoverflow.com/q/26875454
tags question: http://stackoverflow.com/q/26848642
tags question: http://stackoverflow.com/q/26966137
tags question: http://stackoverflow.com/q/26859302
tags question: http://stackoverflow.com/q/26900095
tags question: http://stackoverflow.com/q/26924989
tags question: http://stackoverflow.com/q/26930841
tags question: http://stackoverflow.com/q/26921784
tags question: http://stackoverflow.com/q/26878304
tags question: http://stackoverflow.com/q/26970077
tags question: http://stackoverflow.com/q/26886922
tags question: http://stackoverflow.com/q/26859479
tags question: http://stackoverflow.com/q/26874339
tags question: http://stackoverflow.com/q/26977225
tags question: http://stackoverflow.com/q/26987831
tags question: http://stackoverflow.com/q/26987180
tags question: http://stackoverflow.com/q/26954685
tags question: http://stackoverflow.com/q/26853354
tags question: http://stackoverflow.com/q/26840808
tags question: http://stackoverflow.com/q/26977737
tags question: http://stackoverflow.com/q/26920979
tags question: http://stackoverflow.com/q/26909189
tags question: http://stackoverflow.com/q/26977723
tags question: http://stackoverflow.com/q/26833075
tags question: http://stackoverflow.com/q/26883314
tags question: http://stackoverflow.com/q/26987661
tags question: http://stackoverflow.com/q/26966082
tags question: http://stackoverflow.com/q/26868190
tags question: http://stackoverflow.com/q/26965425
tags question: http://stackoverflow.com/q/26991245
tags question: http://stackoverflow.com/q/26943272
tags question: http://stackoverflow.com/q/26845325
tags question: http://stackoverflow.com/q/26966716
tags question: http://stackoverflow.com/q/26878132
tags question: http://stackoverflow.com/q/26952694
tags question: http://stackoverflow.com/q/26925411
tags question: http://stackoverflow.com/q/26861986
tags question: http://stackoverflow.com/q/26894310
tags question: http://stackoverflow.com/q/26863166
tags question: http://stackoverflow.com/q/26923743
tags question: http://stackoverflow.com/q/26949471
tags question: http://stackoverflow.com/q/26930429
tags question: http://stackoverflow.com/q/26874449

http://stackoverflow.com/a/26878615
score: 0
has comment: http://stackoverflow.com/comment/42314726
has comment: http://stackoverflow.com/comment/63975041
has comment: http://stackoverflow.com/comment/42314802
has comment: http://stackoverflow.com/comment/42314710
has body: One problem is the script wrapper in the fiddle. But another problem is the type, sometimes when an unknown file type is used, type will be an empty string and mimetype will be undefined so value of mime becomes undefined. One solution is to use the mimetype only of type is undefined mime = (typeof test.type == 'undefined'? test.mimeType:test.type); Another is to check whether mime has a value in the condition like // Image/File validation on Client-side function getImg(input, max, accepted) { var upImg = new Image(), test, size, msg = input.form; msg = msg.elements[0].children[0]; return input.files ? validate() : (upImg.src = input.value, upImg.onerror = upImg.onload = validate); function validate() { test = (input.files ? input.files[0] : upImg); size = (test.size || test.fileSize) / 1024; mime = (test.type || test.mimeType); mime && mime.match(RegExp(accepted, 'i')) ? size > max ? (input.form.reset(), msg.innerHTML = max + "KB Exceeded!") : msg.innerHTML = "Upload ready..." : (input.form.reset(), msg.innerHTML = accepted + " file type(s) only!"); } } Image upload
type: Answer
answers question: http://stackoverflow.com/q/26878574

node.js
tags question: http://stackoverflow.com/q/26922173
tags question: http://stackoverflow.com/q/26949140
tags question: http://stackoverflow.com/q/26892759
tags question: http://stackoverflow.com/q/26976486
tags question: http://stackoverflow.com/q/26908685
tags question: http://stackoverflow.com/q/26854573
tags question: http://stackoverflow.com/q/26966666
tags question: http://stackoverflow.com/q/26982478
tags question: http://stackoverflow.com/q/26833191
tags question: http://stackoverflow.com/q/26936730
tags question: http://stackoverflow.com/q/26915600
tags question: http://stackoverflow.com/q/26914849
tags question: http://stackoverflow.com/q/26947684
tags question: http://stackoverflow.com/q/26909924
tags question: http://stackoverflow.com/q/26856460
tags question: http://stackoverflow.com/q/26934114
tags question: http://stackoverflow.com/q/26871996
tags question: http://stackoverflow.com/q/26892660
tags question: http://stackoverflow.com/q/26974918
tags question: http://stackoverflow.com/q/26987238
tags question: http://stackoverflow.com/q/26970928
tags question: http://stackoverflow.com/q/26982996
tags question: http://stackoverflow.com/q/26967265
tags question: http://stackoverflow.com/q/26893352
tags question: http://stackoverflow.com/q/26873940
tags question: http://stackoverflow.com/q/26947286
tags question: http://stackoverflow.com/q/26877251
tags question: http://stackoverflow.com/q/26832381
tags question: http://stackoverflow.com/q/26881173
tags question: http://stackoverflow.com/q/26962210
tags question: http://stackoverflow.com/q/26934635
tags question: http://stackoverflow.com/q/26856215
tags question: http://stackoverflow.com/q/26943115
tags question: http://stackoverflow.com/q/26974348
tags question: http://stackoverflow.com/q/26962233
tags question: http://stackoverflow.com/q/26878975
tags question: http://stackoverflow.com/q/26921889
tags question: http://stackoverflow.com/q/26991421
tags question: http://stackoverflow.com/q/26883326
tags question: http://stackoverflow.com/q/26941911
tags question: http://stackoverflow.com/q/26863260
tags question: http://stackoverflow.com/q/26855837
tags question: http://stackoverflow.com/q/26991515
tags question: http://stackoverflow.com/q/26898270
tags question: http://stackoverflow.com/q/26920459
tags question: http://stackoverflow.com/q/26903999
tags question: http://stackoverflow.com/q/26930142
tags question: http://stackoverflow.com/q/26852333
tags question: http://stackoverflow.com/q/26915864
tags question: http://stackoverflow.com/q/26975068
tags question: http://stackoverflow.com/q/26969851
tags question: http://stackoverflow.com/q/26909540
tags question: http://stackoverflow.com/q/26902400
tags question: http://stackoverflow.com/q/26911889
tags question: http://stackoverflow.com/q/26948516
tags question: http://stackoverflow.com/q/26847506
tags question: http://stackoverflow.com/q/26867483
tags question: http://stackoverflow.com/q/26936293
tags question: http://stackoverflow.com/q/26868200
tags question: http://stackoverflow.com/q/26885876
tags question: http://stackoverflow.com/q/26987407
tags question: http://stackoverflow.com/q/26913754
tags question: http://stackoverflow.com/q/26908285
tags question: http://stackoverflow.com/q/26985096
tags question: http://stackoverflow.com/q/26911415
tags question: http://stackoverflow.com/q/26844761
tags question: http://stackoverflow.com/q/26843483
tags question: http://stackoverflow.com/q/26869522
tags question: http://stackoverflow.com/q/26944424
tags question: http://stackoverflow.com/q/26898884
tags question: http://stackoverflow.com/q/26947092
tags question: http://stackoverflow.com/q/26908063
tags question: http://stackoverflow.com/q/26850183
tags question: http://stackoverflow.com/q/26950399
tags question: http://stackoverflow.com/q/26833414
tags question: http://stackoverflow.com/q/26889873
tags question: http://stackoverflow.com/q/26914990
tags question: http://stackoverflow.com/q/26860189
tags question: http://stackoverflow.com/q/26905164
tags question: http://stackoverflow.com/q/26940547

http://stackoverflow.com/comment/42415118
type: Comment
has text: When the button is pressed the alert pops up saying "'Are you sure you want to delete this record?". The first method works and if the user presses OK then the Form action continues. If they press Cancel then nothing happens. I want to do the same but using jalerts as they are more attractive.
comment on: http://stackoverflow.com/q/26934685
score: 0
type: QuestionComment

http://stackoverflow.com/comment/42400596
has text: Yes, because i forgot to add the random number to `usedNumbers` array. Check my edited code. I've added this: ` usedNumbers.push(r);`
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/26911806

scale
tags question: http://stackoverflow.com/q/26947143
type: Tag
tag name: scale

http://stackoverflow.com/comment/42503987
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26985213
score: 3
has text: Sorry, not clicking on an unknown link just because you tell me to. What is your code like when you add the function? In which way *exactly* is it not working? Is there an error message? Does it silently ignore your resizes? Does it drink all of your tomato soup out of your fridge?

http://stackoverflow.com/comment/42481969
type: QuestionComment
comment on: http://stackoverflow.com/q/26973273
has text: You are using bootstrap version 3 date-picker??
score: 0
type: Comment

meteor
tags question: http://stackoverflow.com/q/26947337
tags question: http://stackoverflow.com/q/26973078
tags question: http://stackoverflow.com/q/26940547
tags question: http://stackoverflow.com/q/26905866
tags question: http://stackoverflow.com/q/26844646
tags question: http://stackoverflow.com/q/26979943
tags question: http://stackoverflow.com/q/26969969
tags question: http://stackoverflow.com/q/26909098
tags question: http://stackoverflow.com/q/26951262
tags question: http://stackoverflow.com/q/26988907
tags question: http://stackoverflow.com/q/26952084
tags question: http://stackoverflow.com/q/26876281
tags question: http://stackoverflow.com/q/26868200
tags question: http://stackoverflow.com/q/26851711
tags question: http://stackoverflow.com/q/26864931
tags question: http://stackoverflow.com/q/26902180
tags question: http://stackoverflow.com/q/26965178
tags question: http://stackoverflow.com/q/26928562
tags question: http://stackoverflow.com/q/26914766
tags question: http://stackoverflow.com/q/26881830
type: Tag
tags question: http://stackoverflow.com/q/26976942
tags question: http://stackoverflow.com/q/26950262
tags question: http://stackoverflow.com/q/26959738
tags question: http://stackoverflow.com/q/26975799
tags question: http://stackoverflow.com/q/26836740
tags question: http://stackoverflow.com/q/26851878
tags question: http://stackoverflow.com/q/26849292
tags question: http://stackoverflow.com/q/26968931
tags question: http://stackoverflow.com/q/26981172
tags question: http://stackoverflow.com/q/26951541
tags question: http://stackoverflow.com/q/26840469
tags question: http://stackoverflow.com/q/26843042
tags question: http://stackoverflow.com/q/26873176
tags question: http://stackoverflow.com/q/26985106
tags question: http://stackoverflow.com/q/26971149
tags question: http://stackoverflow.com/q/26924843
tags question: http://stackoverflow.com/q/26961049
tags question: http://stackoverflow.com/q/26929909
tags question: http://stackoverflow.com/q/26937506
tags question: http://stackoverflow.com/q/26978547
tags question: http://stackoverflow.com/q/26836390
tags question: http://stackoverflow.com/q/26862331
tags question: http://stackoverflow.com/q/26925096
tags question: http://stackoverflow.com/q/26874750
tags question: http://stackoverflow.com/q/26920395
tags question: http://stackoverflow.com/q/26856009
tags question: http://stackoverflow.com/q/26913198
tags question: http://stackoverflow.com/q/26833596
tags question: http://stackoverflow.com/q/26835411
tags question: http://stackoverflow.com/q/26977316
tags question: http://stackoverflow.com/q/26838824
tags question: http://stackoverflow.com/q/26901430
tag name: meteor
tags question: http://stackoverflow.com/q/26926111
tags question: http://stackoverflow.com/q/26902400
tags question: http://stackoverflow.com/q/26888273
tags question: http://stackoverflow.com/q/26939956
tags question: http://stackoverflow.com/q/26872135
tags question: http://stackoverflow.com/q/26950439
tags question: http://stackoverflow.com/q/26951776
tags question: http://stackoverflow.com/q/26863799
tags question: http://stackoverflow.com/q/26974888
tags question: http://stackoverflow.com/q/26944421
tags question: http://stackoverflow.com/q/26949103
tags question: http://stackoverflow.com/q/26946243

http://stackoverflow.com/comment/42363156
type: QuestionComment
has text: see http://stackoverflow.com/questions/784929/what-is-the-not-not-operator-in-javascript
comment on: http://stackoverflow.com/q/26906294
score: 0
type: Comment

http://stackoverflow.com/a/26855417
type: Answer
answers question: http://stackoverflow.com/q/26854840
has body: I think the problem is you are using delete to remove item from old list, that will not remove the "slot" of the item in the array, just set it to undefined e.g. [a, b, c], after delete b, it becomes [a, undefined, c] You may want to try splice to remove the item from array
has comment: http://stackoverflow.com/comment/42276484
has comment: http://stackoverflow.com/comment/42276457
has comment: http://stackoverflow.com/comment/42298178
score: 0

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

http://stackoverflow.com/a/26833681
has comment: http://stackoverflow.com/comment/42233797
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/42233799
has comment: http://stackoverflow.com/comment/42234087
score: 1
has comment: http://stackoverflow.com/comment/42233741
downvote count: 0
has comment: http://stackoverflow.com/comment/42233727
answers question: http://stackoverflow.com/q/26833609
has comment: http://stackoverflow.com/comment/42233932
has body: You would need to attach another click event listener to document. To prevent issues with overlap, compare e.target with the button and only fire code for the second handler if there's no overlap. And for the proper logic with the open flag, use the .animate() handler to run the relevant code including flipping open. jQuery(function($) { var open = false; $('#footerSlideButton, .footer_wrapper').on('click', function () { if( !open ) { $('#footerSlideContent').animate({ height: '37px' }, function() { $(this).css('backgroundPosition', 'bottom left'); $("#footerSlideButton").hide(1); open = true; }); } else { $('#footerSlideContent').animate({ height: '0px' }, function() { $(this).css('backgroundPosition', 'top left'); $("#footerSlideButton").show(1); open = false; }); } }); $(document).on('click',function() { if( open &amp;&amp; !$(e.target).is("#footerSlideButton") ) { $('#footerSlideContent').animate({ height: '0px' }, function() { open = true; }); } }); });

http://stackoverflow.com/a/26879079
upvote count: 1
score: 1
has body: $('div.codeOption').click(function(){ ... colorSelection = $(this).attr('id'); playerCode [i] = colorSelection; ... }); you are using $(this) in side div.codeOption which will always point to that particular div which has been clicked. Try using something like .each which will do it for all of the divs. Haven't tested it but hope that helps. $('div.codeOption').click(function(){ $('div.codeOption').each(function(){ //some code }); });
answers question: http://stackoverflow.com/q/26879012
downvote count: 0
type: Answer

http://stackoverflow.com/comment/42517753
comment on: http://stackoverflow.com/a/26978064
type: Comment
score: 0
type: AnswerComment
has text: Brilliant, thanks. So I just need to install Node.js and then run the command line to install Bower to use the scripts?

http://stackoverflow.com/comment/42336560
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/26891234
has text: I really don't get what you want. You talk about pixels, resolution, and size. But anyway, you can not. Until user do not upload the file, the file is on the client side, and you have no access to that.
type: Comment

http://stackoverflow.com/q/26973174
favorite count: 0
type: UnansweredQuestion
tagged with: leaflet
score: 1
has body: I am trying to display custom markers on a map. The markers are created dynamically with every record that i get through API. The images are hosted elsewhere. However whenever i try to pull up the map with the markers those do not display and only a default marker shows up. I am wondering if i do something wrong with the marker set up: var dynamicIcon = []; var dIcon = []; var weatherMarker = []; $.getJSON('http://api.openweathermap.org/data/2.5/box/city?bbox=1.89,49.05,2.86,48.63,10&amp;cluster=yes', function(data) { var i=0; while(i &lt; data.list.length-1) { dynamicIcon[i] = L.Icon.Default.extend({ options:{ iconURL:'http://openweathermap.org/img/w/'+data.list[i].weather[0].icon+'.png', } }); dIcon[i] = new dynamicIcon[i](); weatherMarker[i] = new L.marker([data.list[i].coord.lat, data.list[i].coord.lon], {icon: dIcon[i]}, {draggable:false}); map.addLayer(weatherMarker[i]); } });
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/26974476
answer count: 1
downvote count: 0
has title: Dynamic generated markers in leaflet

http://stackoverflow.com/q/26865724
tagged with: http://stackoverflow.com/tag/html
has title: floating horizontal bar for a div
tagged with: css
answer count: 4
has answer: http://stackoverflow.com/a/26866004
has answer: http://stackoverflow.com/a/26865890
score: -4
has comment: http://stackoverflow.com/comment/42290804
type: Question
has answer: http://stackoverflow.com/a/26866168
has body: I have an html table that is very tall. The web page has to be scrolled vertically to reach the horizontal scroll bar at the bottom of the table. It would be nice if I could float the horizontal scroll bar for the table at the bottom of the browser window.Can such a thing be done?Is der any plugin available for it? JS Fiddle is : http://jsfiddle.net/RurTZ/1/
tagged with: javascript
has answer: http://stackoverflow.com/a/26865816
downvote count: 4
upvote count: 0
tagged with: jquery
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/42279353
has text: these are in the same file name apppage1.js
comment on: http://stackoverflow.com/q/26858670
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26949300
downvote count: 1
answers question: http://stackoverflow.com/q/26949187
type: Answer
upvote count: 0
score: -1
has body: It appears to me that == means "evaluates to the same value". 42 does not equal true because true is being converted to an integer for the comparison, and 42 != 1. But if people want to convert 42 to a Boolean, simply do if (42), or you can do the !! not not trick. Most people just do if (42), converting the non-zero, non-empty value to a bool with the parenthetical. (x == true) should only be used when x is expected to be either 0 or 1, or true or false. And I gather you know the difference between == and === already. (1 == true) // true (1 === true) // false, because data types aren't converted when using === For more info on automatic type conversions and assignment shortcuts, I recommend reading this page. While it doesn't specifically answer your question, it does provide examples illustrating when you should be specific for what you are testing for.

http://stackoverflow.com/a/26887747
accepted answer of: http://stackoverflow.com/q/26887578
score: 2
has comment: http://stackoverflow.com/comment/42334242
has comment: http://stackoverflow.com/comment/42334778
answers question: http://stackoverflow.com/q/26887578
has comment: http://stackoverflow.com/comment/42333786
has comment: http://stackoverflow.com/comment/42374466
has comment: http://stackoverflow.com/comment/42335176
has comment: http://stackoverflow.com/comment/42334439
has body: You can remove the line with JSON.parse() as already explicitly set that you will receive a JSON: dataType: 'JSON', Then in your success block, handle it as follows: $.each(jsonStr.data, function(index, element){ $("#result").text(element.username); $("#img").attr('src', element.profile_picture); });
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42333088
has comment: http://stackoverflow.com/comment/42335806
has comment: http://stackoverflow.com/comment/42334913
has comment: http://stackoverflow.com/comment/42332623
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/42332532
type: Answer

http://stackoverflow.com/q/26882789
downvote count: 3
has comment: http://stackoverflow.com/comment/42323830
answer count: 2
accepted answer: http://stackoverflow.com/a/26883356
has comment: http://stackoverflow.com/comment/42321156
has comment: http://stackoverflow.com/comment/49186792
tagged with: javascript
has comment: http://stackoverflow.com/comment/42321727
favorite count: 0
possible better answer: http://stackoverflow.com/a/29774620
has title: Learning angularjs 1.3 , knowing that angular 2 will be released in 1 year
has answer: http://stackoverflow.com/a/29774620
has comment: http://stackoverflow.com/comment/42321248
upvote count: 13
has body: I'd like to learn angularjs 1.3,but i am having some problems on making up a decision if it is the right time to do so, since angular will be be dramatically changed when the version 2 will be released. It is worth it to spend the time and energy to learn a framework that we know it is going to change. what suggestions can the people give me regarding this. Could you please suggest any other framework, that is easy to learn? Thanks!
has comment: http://stackoverflow.com/comment/42324663
tagged with: angularjs
has answer: http://stackoverflow.com/a/26883356
type: Question
type: AnsweredQuestion
score: 10

http://stackoverflow.com/a/26909501
type: Answer
has comment: http://stackoverflow.com/comment/42369174
has comment: http://stackoverflow.com/comment/42369610
answers question: http://stackoverflow.com/q/26906859
score: 0
has body: Simply adding Cordova.js file doesn't help you achieve your needs, you must set up the Cordova project. First create the Cordova project and then build the project with which platform you want. After that you can use Cordova plugins to fulfill your needs. Actually, the Cordova.js file only acts as a JavaScript bridge to access the native features of the phone (camera, GPS, etc.). If you want something more than that, Ionic framework is the best option in my opinion.

http://stackoverflow.com/a/26971329
has comment: http://stackoverflow.com/comment/42495496
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42501336
upvote count: 3
type: Answer
accepted answer of: http://stackoverflow.com/q/26971262
downvote count: 0
answers question: http://stackoverflow.com/q/26971262
has comment: http://stackoverflow.com/comment/42478612
score: 3
has body: B.prototype has a reference to the same object as A.prototype (line 12). On line 16 you stored a reference of this same object to C.prototype. This means all three prototypes point to the same object, therefore all changes made to A.prototype, B.prototype or C.prototype will actually change the same object. At the end of your code, this object has three methods: a, b and c.
has comment: http://stackoverflow.com/comment/42488447
has comment: http://stackoverflow.com/comment/42478528

http://stackoverflow.com/comment/42503343
has text: It's hard to tell to be honest because once I look at the plunker I can't tell if they actually want to add a row or if they want to add data inside of a column. Right now the table is not right because there is a tag inside one of the 's where there should be a
comment on: http://stackoverflow.com/q/26984735
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26913420
accepted answer: http://stackoverflow.com/a/26914372
tagged with: plugins
has title: OwlCarousel 2 function animate
type: AnsweredQuestion
tagged with: owl-carousel
type: Question
has comment: http://stackoverflow.com/comment/42377495
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has body: I'm using owl.carousel 2 (beta version). The animate function for fade effect works only clicking on nav buttons. Is there a function (or add a code) that changes the images when I click on the image? So I can hide prev-next buttons. Thanks.
has answer: http://stackoverflow.com/a/26914372

http://stackoverflow.com/a/26837410
has body: It depends on the platform and application you are using and more importantly the purpose of the logging. You can use the Console class which offers Write and WriteLine static methods. This will write your log to standard console. For a console application, this is the best choice: System.Console.WriteLine("Log text") If you are using the log just for debugging purposes, you can use the System.Diagnostics.Debug class with WriteLine static method. This class also offers a WriteLineIf method which accepts an argument of type Boolean and writes the log if the value passed for that argument equals to True: System.Diagnostics.Debug.WriteLineIf(x = y, "They are equal") You can view the debug console output in Visual Studio's output window.
downvote count: 0
answers question: http://stackoverflow.com/q/26836402
type: Answer
upvote count: 11
score: 11
accepted answer of: http://stackoverflow.com/q/26836402
type: AcceptedAnswer

http://stackoverflow.com/a/26873657
answers question: http://stackoverflow.com/q/26873403
type: Answer
upvote count: 1
score: 1
has body: You can have the data in variable, this will be like temporary storage. &lt;script type="text/javascript"&gt; $(document).ready(function() { $('#users_form1').ajaxForm({ dataType: 'json', success: processJson }); }); var tem_data; function processJson(data) { $("#first").val(data[1].elem1); $("#second").val(data[1].elem2); tem_data = data; } // Use tem_data anywhere; &lt;/script&gt; But only last requested data will be the tem_data. If you want all data then do it in array with array push method
downvote count: 0

http://stackoverflow.com/comment/42423611
comment on: http://stackoverflow.com/a/26934344
type: Comment
has text: Updating my code I get an error on the line `var fillCommand = this.graphics.beginFill("#969696").command;` It's telling me can not read property 'beginFill' of undefined. The entire reason why I'm doing it as a class implementation is because eventually I am going to track other tiles that are being created in order to turn their states on or off. These Tiles are essentially prefabs that are getting generated. Would an easier implementation not use the class model that I'm trying to do?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/42300274
type: AnswerComment
comment on: http://stackoverflow.com/a/26858435
type: Comment
has text: Ahhh ok ... I was searching for the id field in the json file. Now I know where to find it. Thanks huan that helps a lot.
score: 0

internet-explorer-9
tag name: internet-explorer-9
tags question: http://stackoverflow.com/q/26989671
tags question: http://stackoverflow.com/q/26851792
tags question: http://stackoverflow.com/q/26854085
tags question: http://stackoverflow.com/q/26926672
tags question: http://stackoverflow.com/q/26932435
tags question: http://stackoverflow.com/q/26867140
type: Tag
tags question: http://stackoverflow.com/q/26891090
tags question: http://stackoverflow.com/q/26983407

http://stackoverflow.com/comment/42298628
has text: Thanks buddy I truly would appreciate that. I added the GOTMLS system, found about 25 backdoor scripts and 3 threats BUT the path to these is not the WP subdirectory. One of the threats was similar to the odd stroupper code (last code added) which is making me think it might be used for some else :S so I deleted this one to see what happens, nothing though. The other 2 threats won't allow me to delete it, even with permission. site is radonicrodgers. com How would I be able to show you the log from Scanner?
comment on: http://stackoverflow.com/a/26852932
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/49651120
type: AnswerComment
comment on: http://stackoverflow.com/a/26838580
has text: Was struggling with the same problem but found that once I removed the `var` keyword I would get undefined errors since I was using `"use strict";` at the top of my JavaScript files (which I think is essential). Having a look at this thread cleared a lot up for me https://github.com/meteor/meteor/issues/1380
type: Comment
score: 0

http://stackoverflow.com/comment/42337061
has text: Send an ajax request to a script that adds each count to a database.
type: Comment
comment on: http://stackoverflow.com/q/26891603
type: QuestionComment
score: 1

http://stackoverflow.com/q/26933324
accepted answer: http://stackoverflow.com/a/26933438
type: Question
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/26933734
has answer: http://stackoverflow.com/a/26933438
tagged with: javascript
has title: JavaScript: get to arguments object of callback
possible better answer: http://stackoverflow.com/a/26933734
type: AnsweredQuestion
has body: Fiddle here I'm looking at making some very high level logic into helper functions for curiosity's sake. I would like to be able to execute a function with its parameters in the _if function without having to define something like _callback ahead of time? I feel like I'm missing something here. var _if = function(predicate,callback){ if(predicate){ callback(); //callback(arguments) is not arguments for callback } }; var text = 'some text'; _if(1 &gt; 0,function(){ console.log('hello world'); //hello world }); _if(1 &gt; 0,function(text){ console.log(text); //undefined }); //define callback for this situation var _callback = function(x){ console.log(x); } _if(1 &gt; 0,function(){ _callback(text); //some text });
linked to: http://stackoverflow.com/q/11659134

http://stackoverflow.com/q/26894352
has title: How do I programmatically know when I’m about to exceed the javascript heap size?
favorite count: 0
upvote count: 7
linked to: http://stackoverflow.com/q/23506064
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42342259
accepted answer: http://stackoverflow.com/a/26896780
duplicate of: http://stackoverflow.com/q/23506064
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/42342642
has body: I’m writing an application that instantiates many large array buffers, some of which are 5MB. I would like to know when I’m about to fill up the javascript heap, so I could activate a condition in my javascript that halts allocating the buffers. I’ve found that if I do exceed the heap size, the browser crashes for Chrome and Firefox. Does W3C expose an interface for gauging javascript heap usage?
has comment: http://stackoverflow.com/comment/42342586
score: 7
has answer: http://stackoverflow.com/a/26896780

http://stackoverflow.com/comment/42345655
has text: @David my javascript console doesn't show any errors which is causing more confusion, this is my first time posting on this site so im not sure which way to show my code is better. I didn't mean for community to be a debugger everything in my code seems to work except for the button but i didnt know how to ask that question without posting my code here to show you guys what i mean, im in my first year of school for coding so most of this is new to me.
comment on: http://stackoverflow.com/q/26895466
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26946120
score: 2
has body: Your code is correct but you are passing reserved keyword class as a param. please change it and it would works function toggleDisplay(className) { var display = document.getElementsByClassName(className); for(var i = 0; i < display.length; ++i) { var style = display[i].style; style.display = style.display === 'none' ? 'block' : 'none'; } } toggleDisplay('display'); A paragraph
has comment: http://stackoverflow.com/comment/42434713
has comment: http://stackoverflow.com/comment/42434656
has comment: http://stackoverflow.com/comment/42434687
answers question: http://stackoverflow.com/q/26946081
has comment: http://stackoverflow.com/comment/42434784
downvote count: 0
has comment: http://stackoverflow.com/comment/42434683
has comment: http://stackoverflow.com/comment/42434598
type: Answer
upvote count: 2

http://stackoverflow.com/q/26937871
has comment: http://stackoverflow.com/comment/42483723
has comment: http://stackoverflow.com/comment/42420665
favorite count: 0
has title: Exporting data from jqgrid to Excel in Internet Explorer
has comment: http://stackoverflow.com/comment/42431882
has comment: http://stackoverflow.com/comment/42420477
answer count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/42426744
tagged with: excel
has body: I am developing some enhancements for a web page and I need some assistance. I have added a button that when clicked will take the html from a jqgrid and export it to Excel. I thought I had it all working and then I did the cross browser test and Internet Explorer does not like the following method: function exportGrid() { var grid = "#diamondpassConferencePreregistrantGrid"; var mya=new Array(); mya=$(grid).getDataIDs(); // Get All IDs var data=$(grid).getRowData(mya[0]); // Get First row to get the labels var colNames=new Array(); var ii=0; for (var i in data){colNames[ii++]=i;} // capture col names var html=""; var columnNames = $(grid).jqGrid('getGridParam','colNames'); for(i=0;i&lt;columnNames.length-1;i++) { html = html + columnNames[i+1]+"\t"; } html=html+"\n"; for(i=0;i&lt;mya.length;i++) { data=$(grid).getRowData(mya[i]); // get each row for(j=0;j&lt;colNames.length-1;j++) { html=html+data[colNames[j+1]]+"\t"; // output each column as tab delimited } html=html+"\n"; // output each row with end of line } html=html+"\n"; // end of line at the end alert(html); window.open('data:application/vnd.ms-excel,' + encodeURIComponent(html)); } This all seems to work fine for me in Firefox and Chrome. The problem is that when I test in IE, the line: window.open('data:application/vnd.ms-excel,' + encodeURIComponent(html)); opens up a new tab telling me the webpage cannot be displayed. I got some info from the following webpage: http://www.jquerybyexample.net/2012/10/export-table-data-to-excel-using-jquery.html that basically tells me that line will not work in IE, that I need to set the response header as so: Response.AddHeader("Content-Disposition", "attachment;filename=download.xls"); My problem is that I do not know what this entails. I tried adding this line and as I would have expected, I get "Response is undefined" or something of this nature. I was just curious if anyone had an idea as to the best way to move forward from this point. I know how to detect the brows…
score: 1
type: Question
tagged with: internet-explorer
tagged with: jqgrid
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42432761

http://stackoverflow.com/comment/42409584
comment on: http://stackoverflow.com/q/26932349
score: 0
type: QuestionComment
type: Comment
has text: Please refrain from using a live link as that wont be useful to others with the same question down the road. Add the code from your site that is relevant so we can help you! Thanks! :)

http://stackoverflow.com/comment/42299898
has text: Yep. best advice I can give is run a virtual machine with a linux installation. Most things run happy that way. It's what people "expect" for most projects under deployment. So even "development" under windows environments is generally limitted.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26870229

http://stackoverflow.com/comment/42436550
has text: Why do you have multiple elements with the same id? I suppose you should use class in this case.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26947191

http://stackoverflow.com/comment/42359335
score: 0
comment on: http://stackoverflow.com/q/26903978
type: Comment
type: QuestionComment
has text: If you aren't using it on a function prompted with a click, window.close doesn't work.

http://stackoverflow.com/q/26944347
has title: How can I show # instead of characters in input text?
upvote count: 0
has comment: http://stackoverflow.com/comment/42431638
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
tagged with: textbox
type: Question
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
score: -1
has body: I have an input text (text box) in a php page whose maxlength attribute is 11. Basically, I use it for phone number. When the user enters a phone number, it will show as # symbols of all 11 characters and if the phone no &lt; 11 show a message, if phone no > 11, user cannot type more characters. Note that on the textbox, the user can enter only numbers. How do I do that?
has answer: http://stackoverflow.com/a/26944463
answer count: 1
downvote count: 1

http://stackoverflow.com/q/26947830
has body: I declare user_properties outside of my function. I then get my data from firebase and try to store it in user_properties but it ends up being undefined. Does anyone know what I am doing wrong here? var user_properties; get_user_properties = new Firebase("https://&lt;MY-URL&gt;/users/"+auth.uid+"/properties"); get_user_properties.once('value', function (dataSnapshot) { user_properties = dataSnapshot.val(); }); //undefined console.log(user_properties);
has title: Variable undefined when updated inside a function
has answer: http://stackoverflow.com/a/26948826
type: UnansweredQuestion
tagged with: firebase
linked to: http://stackoverflow.com/q/6847697
type: Question
has comment: http://stackoverflow.com/comment/42437624
tagged with: javascript
score: 0
duplicate of: http://stackoverflow.com/q/14220321
answer count: 1
duplicate of: http://stackoverflow.com/q/6847697
tagged with: jquery
linked to: http://stackoverflow.com/q/14220321

http://stackoverflow.com/comment/42427557
has text: I had glanced over the JS. Yes, you can ignore my first comment then.
comment on: http://stackoverflow.com/a/26941917
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/39941763
answers question: http://stackoverflow.com/q/26845101
has comment: http://stackoverflow.com/comment/126233345
type: Answer
score: 4
upvote count: 4
has body: if you want to use the in-memory bundle, you can use the streamed file like this: var express = require('express'); var app = express(); var webpack = require('webpack'); var path = require('path'); var compiler = webpack(require('./webpack.config.js')); app.use(require('webpack-dev-middleware')(compiler, { noInfo: true, publicPath: '/' })); app.use('*', function (req, res, next) { var filename = path.join(compiler.outputPath,'index.html'); compiler.outputFileSystem.readFile(filename, function(err, result){ if (err) { return next(err); } res.set('content-type','text/html'); res.send(result); res.end(); }); }); app.listen(3000);
downvote count: 0

http://stackoverflow.com/comment/42430222
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26943352
has text: @Richie - something like this should do that -> **http://jsfiddle.net/adeneo/tcm4f9gd/1/**
score: 0

http://stackoverflow.com/comment/42372005
comment on: http://stackoverflow.com/a/26910324
has text: But you are looking for a valid matrix no ? Or you want to generate all valid matrices ?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/42452178
has text: How does the generated HTML look like in the browser? Your code looks fine. Ignore any syntax errors Visual Studio might be showing. Razor Intellisense is buggy as hell. Just run your application and see how the generated javascript differs from the working code.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26956372

http://stackoverflow.com/comment/42318336
comment on: http://stackoverflow.com/a/26881070
type: AnswerComment
score: 0
type: Comment
has text: first I do not want to hide and second is if you see that after 0 opacity it is also clickable point the mouse in blank space and see that.

http://stackoverflow.com/comment/42336373
type: Comment
type: QuestionComment
has text: At the point when this PHP code can execute, the image is already uploaded
score: 1
comment on: http://stackoverflow.com/q/26891234

http://stackoverflow.com/q/26907243
answer count: 1
tagged with: adobe-indesign
tagged with: javascript
has answer: http://stackoverflow.com/a/26930198
favorite count: 0
has title: add property to object
type: UnansweredQuestion
tagged with: extendscript
tagged with: basil.js
has body: With Indesign scripting, why can't I add properties to an object? I get an error Object does not support the property or method 'foo' items = b.items(b.layer("s_labels")); for (var i = 0; i &lt; items.length; i++) { items[i].fit(FitOptions.frameToContent); items[i].foo = "bar"; // other attempt items[i]["foo"] = "bar"; }
downvote count: 0
score: 1
type: Question
upvote count: 1

http://stackoverflow.com/comment/42655877
score: 0
type: Comment
comment on: http://stackoverflow.com/q/26933772
type: QuestionComment
has text: `screenRefreshTime = parseInt(screenRefreshTime);` are you refreshing the screen in iPad too? that can cause issues.

http://stackoverflow.com/comment/84144047
comment on: http://stackoverflow.com/a/26933067
has text: @matty Acknowledged - marking my answer as inappropriate in an edit to avoid harm to future viewers. I can't delete it until it is no longer accepted by OP.
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/comment/42283742
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26844368
has text: @errand solved it by adding `$("#search-results").scroll(function(){ $("img.lazy").show().lazyload() });` at the end of my load() function.
score: 0

http://stackoverflow.com/comment/42351778
type: AnswerComment
comment on: http://stackoverflow.com/a/26899164
has text: Should I change my current wordGen() with the updated one you commented? You mean the wordGen() outside the .onClick function right?
score: 0
type: Comment

http://stackoverflow.com/q/26953939
downvote count: 0
score: 1
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26954042
upvote count: 1
type: Question
has title: What's the best way to call function within directive from controller
has body: Just wondering what's the best way to communication from controller to directive function, i have got an ng-click on one of the button, but the function sit in the directive, is there a way i can call the function within the controller (which sits in directive). i understand u can apply double binding with scope, is there any better way of doing so? Cheers app.controller('leadsListing', ['$scope', function($scope){ $scope.filterresultcount = 0; $scope.records = []; $scope.filtertotal = ''; $scope.$watch('filtertotal', function(){ $scope.filterresultcount = parseInt($scope.filtertotal / 20); }); $scope.moreFilterResult = function(){ if($scope.filterresultcount &gt; 0){ $scope.filterresultcount--; } $scope.heyJoe(); // It's in diretive }; }]); app.directive('recordfilter', ['$http', 'filterService', function($http, filterService){ return { scope: { names : '@names', model : '@model', records : '=records', filtertotal : '=filtertotal', filterresultcount : '=filterresultcount' }, restrict: 'A', replace: true, link: function($scope, iElm, iAttrs, controller) { $scope.heyJoe() } } }
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26955232
answer count: 2
has answer: http://stackoverflow.com/a/26955232
accepted answer: http://stackoverflow.com/a/26954042

http://stackoverflow.com/comment/42508684
has text: Well, as I understand it's ok to use controller as ajax.php file will approve your answer.
comment on: http://stackoverflow.com/a/26987928
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42403985
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/64935/discussion-between-elayaraja-and-rotora).
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26928178
score: 0

http://stackoverflow.com/q/26976537
upvote count: 2
has body: I am using Restangular to make backend calls and everything works fine as long as URL gives me data like below: If I hit http://mysite/responses/ the responses look like [ {"fname":"some guy", "lname":"some name", "dob":2091, "job":"mgr", "id":"100" }, {"fname":"another guy", "lname":"anpther name", "dob":1991, "job":"worker", "id":"101" }, {"fname":"someone", "lname":"some name", "dob":1997, "job":"dev", "id":"102" }, {"fname":"some guy2", "lname":"some name", "dob":2091, "job":"sec", "id":"103" } ] and everything works fine which is wrapped in an array and my Restangular URL looks like RestangularProvider.setBaseUrl('http://mysite/responses/'); RestangularProvider.setRestangularFields({ id: 'id' }); and it works all fine Now I deconstructed the backend and API returns the data in below format http://mysite/responses/100 { fname:"some guy", lname:"some name", dob:2091, job:"mgr", id:"100" } http://mysite/responses/101 { fname:"another guy", lname:"another name", dob:1991, job:"sec", id:"101" } http://mysite/responses/102 { fname:"some name", lname:"some person", dob:1091, job:"sec", id:"102" } http://mysite/responses/103 { fname:"a guy", lname:"person name", dob:1998, job:"dev", id:"103" } Now if I hit http://mysite/responses/ I get below responses http://mysite/responses/100 http://mysite/responses/101 http://mysite/responses/102 http://mysite/responses/103 http://mysite/responses/104 As you see, the id is getting appended to the url, and I need to get this id, make an Restangular call and get the data. How can I loop through this multiple http calls, get the id and put it in Angular. I think I am not constructing the BaseURl for Restanglar properly, because I am not sure how to get the id. thanks for the help
tagged with: http
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/42838940
has answer: http://stackoverflow.com/a/26976633
has title: How do I get an ID that is part of a URL, in angularjs? I am using Restangular to communicate with REST API's
has comment: http://stackoverflow.com/comment/42650275
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/42621632
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42656634
tagged with: restangular
score: 2
has comment: http://stackoverflow.com/comment/42665392

http://stackoverflow.com/a/26919386
downvote count: 0
answers question: http://stackoverflow.com/q/26917002
type: Answer
accepted answer of: http://stackoverflow.com/q/26917002
has body: Wow....so, I was putting the plugin in a custom package. That was messing everything up! The simple change from: com.isabellaproducts.serialhelper to com.phonegap.plugins.serialhlper It now looks like this. Javascript: var SerialHelper = { getName: function(){ return "this is the name" }, getSerial: function(success, failure) { cordova.exec( success, // success callback function failure, // error callback function 'SerialHelper', 'getFableSerial', [] ); } } module.exports = SerialHelper; Java: package com.phonegap.plugins.serialhelper; import org.apache.cordova.CallbackContext; import org.apache.cordova.CordovaPlugin; import org.json.JSONObject; import org.json.JSONArray; import org.json.JSONException; import org.apache.cordova.*; public class SerialHelper extends CordovaPlugin { @Override public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { if ("getFableSerial".equals(action)) { String serial = "15345344132354"; callbackContext.success(serial); //callbackContext.sendPluginResult(new PluginResult(Status.OK, serial)); return true; } else{ callbackContext.error("method not found"); return false; } } } plugin.xml: <?xml version="1.0" encoding="UTF-8"?> SerialHelper Serial Helper gets the Fable gives serial number access MIT serial, helper, fable <clobbers target="com.phonegap.plugins.serialhelper" /> <source-file src="src/android/com/phonegap/plugins/serialhelper/SerialHelper.java" target-dir="src/com/phonegap/plugins/serialhelper" />
score: 4
upvote count: 4
type: AcceptedAnswer

http://stackoverflow.com/comment/42420944
type: QuestionComment
comment on: http://stackoverflow.com/q/26938282
has text: when I click 'start' I can see that the canvas is resized and a colored rectangle appears. But half a second later the page seems to be reloaded, and the canvas is again 100x100 without a rectangle init
score: 0
type: Comment

http://stackoverflow.com/comment/110834733
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/26863909
has text: This approach has a problem: every time the chart updates (for example, zooming or resetting the zoom), the hidden SVGs are shown again.

http://stackoverflow.com/comment/42302102
has text: Yes - or use `bind`. For details, see the [canonical question](http://stackoverflow.com/q/20279484/1048572) - I wonder whether I should close as a duplicate.
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26864234

http://stackoverflow.com/comment/42456155
type: QuestionComment
has text: @Pointy, You are speaking of this line `NS["MyConstructor"].prototype["setAValue"] = MyConstructor.prototype.setAValue;`, right? That line is necessary for Closure. Otherwise, when it renames `setValue` to say `Ba` the calls from outside the compiled code will break. The construction with the quote marks sets up an alias.
comment on: http://stackoverflow.com/q/26958582
score: 0
type: Comment

http://stackoverflow.com/q/26973188
type: AnsweredQuestion
has title: How to prevent tooltip from showing when dialog is opened
tagged with: jquery-ui
has comment: http://stackoverflow.com/comment/50475774
type: Question
score: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26976780
favorite count: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/26976780
has body: I have to following scenario: There are several dialogs (some static, some created with ajax-loaded content, some created after pageload) on my site. One as an example: $(".agreementcount_dialog").dialog({ position: { my: "center center", at: "center center" }, draggable: true, resizable: true, modal: false, width: 250, height: 300, close: function () { $(this).dialog("close"); } }); And the jQuery-UI tooltip is included: $('#main').tooltip(); Everytime when a dialog is opened, the tooltip is triggerd through the autofocus laying on the close-button of the dialog. Demo So now my Question: How can I prevent the tooltip from showing when a dialog is opened ? Can I set an option in the initialisation of the tooltip, so the tooltip is not triggered when the focus is set on the close-button ? This would be the best solution, because I have only one place where the tooltip is called and where I have to change someting. In fact, I don't want the focus to be changed but the tooltip not to be shown. I know it can be done with the :tabbale or the autofocus attributes, but is there another way? I don't want to edit all the dialogs among the project to add an new autofocus-element (and then the dialog can't be closed by pressing enter or escape after opening anymore) and I want to keep the functionalty of the tooltip in the dialogs. Note: Not every dialog is opened within a click-event.
upvote count: 3
possible better answer: http://stackoverflow.com/a/26973531
has answer: http://stackoverflow.com/a/26973531
has answer: http://stackoverflow.com/a/26973550
downvote count: 1

http://stackoverflow.com/a/26974564
has comment: http://stackoverflow.com/comment/42508666
score: 2
has body: You don't want to make an API call from your "paged" method because that's in the controller. Your route should take care of the API calls to retrieve data for your model. What you want is for your links in your template to include query params specifying the desired page and pagesize. So something like: &lt;div class ="tableNavigation"&gt; {{#link-to 'accounts' (query-params page=previousPage pagesize=currentPageSize)}}Previous Page{{/link-to}} {{#link-to 'accounts' (query-params page=nextPage pagesize=currentPageSize)}}Next Page{{/link-to}} Current Page: {{page}} Next: {{nextPage}} Prev: {{previousPage}} &lt;/div&gt; Then in your route include params.nextPage and params.currentPageSize in your query strings for your AJAX calls. Note that only changing query params won't usually trigger another API call, so also include in your route: queryParams: { pagesize: { refreshModel: true }, page: { refreshModel: true } }, Then in your controller include queryParams: ['page', 'pagesize'] and functions like this but with bounds checking: nextPage: function() { return (parseInt(this.get('page')) + 1); }.property('page'), previousPage: function() { return (parseInt(this.get('page')) - 1); }.property('page'),
has comment: http://stackoverflow.com/comment/42513060
upvote count: 2
accepted answer of: http://stackoverflow.com/q/26973079
answers question: http://stackoverflow.com/q/26973079
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42516556
type: Answer

http://stackoverflow.com/comment/42478423
comment on: http://stackoverflow.com/q/26971341
type: Comment
type: QuestionComment
has text: This value must survive page refresh or not?
score: 0

http://stackoverflow.com/comment/42429903
comment on: http://stackoverflow.com/a/26943285
type: Comment
has text: What are the objects? This code will only remove exact object matches. Maybe you are looking to remove any matching data even if there are partial matches?
score: 0
type: AnswerComment

c#
tags question: http://stackoverflow.com/q/26985099
tags question: http://stackoverflow.com/q/26908510
tags question: http://stackoverflow.com/q/26955920
tags question: http://stackoverflow.com/q/26984488
tags question: http://stackoverflow.com/q/26878264
tags question: http://stackoverflow.com/q/26864339
tags question: http://stackoverflow.com/q/26927712
tags question: http://stackoverflow.com/q/26975444
tags question: http://stackoverflow.com/q/26972001
tags question: http://stackoverflow.com/q/26859984
tags question: http://stackoverflow.com/q/26884176
tags question: http://stackoverflow.com/q/26969414
tags question: http://stackoverflow.com/q/26974265
tags question: http://stackoverflow.com/q/26942950
tag name: c#
tags question: http://stackoverflow.com/q/26934201
tags question: http://stackoverflow.com/q/26948782
tags question: http://stackoverflow.com/q/26982344
tags question: http://stackoverflow.com/q/26953149
tags question: http://stackoverflow.com/q/26884931
tags question: http://stackoverflow.com/q/26991037
tags question: http://stackoverflow.com/q/26869390
tags question: http://stackoverflow.com/q/26898817
tags question: http://stackoverflow.com/q/26949886
tags question: http://stackoverflow.com/q/26875588
tags question: http://stackoverflow.com/q/26958209
tags question: http://stackoverflow.com/q/26836881
tags question: http://stackoverflow.com/q/26934180
tags question: http://stackoverflow.com/q/26935884
tags question: http://stackoverflow.com/q/26970004
tags question: http://stackoverflow.com/q/26841312
tags question: http://stackoverflow.com/q/26966161
tags question: http://stackoverflow.com/q/26888194
tags question: http://stackoverflow.com/q/26886196
tags question: http://stackoverflow.com/q/26843043
tags question: http://stackoverflow.com/q/26900836
tags question: http://stackoverflow.com/q/26896061
tags question: http://stackoverflow.com/q/26982809
tags question: http://stackoverflow.com/q/26925187
tags question: http://stackoverflow.com/q/26942090
tags question: http://stackoverflow.com/q/26880825
tags question: http://stackoverflow.com/q/26969618
tags question: http://stackoverflow.com/q/26899734
tags question: http://stackoverflow.com/q/26987623
tags question: http://stackoverflow.com/q/26895092
tags question: http://stackoverflow.com/q/26989177
tags question: http://stackoverflow.com/q/26988957
tags question: http://stackoverflow.com/q/26885811
tags question: http://stackoverflow.com/q/26873162
tags question: http://stackoverflow.com/q/26847251
tags question: http://stackoverflow.com/q/26862894
tags question: http://stackoverflow.com/q/26893087
tags question: http://stackoverflow.com/q/26894779
type: Tag
tags question: http://stackoverflow.com/q/26907315
tags question: http://stackoverflow.com/q/26857526
tags question: http://stackoverflow.com/q/26937553
tags question: http://stackoverflow.com/q/26909078
tags question: http://stackoverflow.com/q/26850681
tags question: http://stackoverflow.com/q/26875809
tags question: http://stackoverflow.com/q/26844408
tags question: http://stackoverflow.com/q/26943051
tags question: http://stackoverflow.com/q/26929303
tags question: http://stackoverflow.com/q/26977801
tags question: http://stackoverflow.com/q/26933772
tags question: http://stackoverflow.com/q/26934872
tags question: http://stackoverflow.com/q/26871413
tags question: http://stackoverflow.com/q/26903493
tags question: http://stackoverflow.com/q/26927396
tags question: http://stackoverflow.com/q/26957957
tags question: http://stackoverflow.com/q/26956372
tags question: http://stackoverflow.com/q/26895253
tags question: http://stackoverflow.com/q/26888278

http://stackoverflow.com/comment/42362307
comment on: http://stackoverflow.com/a/26904966
score: 0
type: AnswerComment
type: Comment
has text: Can you enter 0.dd? Because if you can, the check has to be set into the validation thing. I changed the code so that navigation keys should work, but, in which browsers are you experiencing the backspace issue? BTW I added to the not blocked keys: backspace, delete and shift

javascript
tags question: http://stackoverflow.com/q/26905770
tags question: http://stackoverflow.com/q/26935537
tags question: http://stackoverflow.com/q/26914731
tags question: http://stackoverflow.com/q/26926340
tags question: http://stackoverflow.com/q/26897974
tags question: http://stackoverflow.com/q/26872848
tags question: http://stackoverflow.com/q/26953371
tags question: http://stackoverflow.com/q/26946843
tags question: http://stackoverflow.com/q/26929669
tags question: http://stackoverflow.com/q/26935820
tags question: http://stackoverflow.com/q/26918200
tags question: http://stackoverflow.com/q/26975091
tags question: http://stackoverflow.com/q/26991651
tags question: http://stackoverflow.com/q/26888276
tags question: http://stackoverflow.com/q/26932031
tags question: http://stackoverflow.com/q/26866394
tags question: http://stackoverflow.com/q/26986737
tags question: http://stackoverflow.com/q/26912550
tags question: http://stackoverflow.com/q/26987220
tags question: http://stackoverflow.com/q/26883243
tags question: http://stackoverflow.com/q/26869191
tags question: http://stackoverflow.com/q/26977822
tags question: http://stackoverflow.com/q/26903231
tags question: http://stackoverflow.com/q/26839183
tags question: http://stackoverflow.com/q/26979145
tags question: http://stackoverflow.com/q/26890560
tags question: http://stackoverflow.com/q/26848289
tags question: http://stackoverflow.com/q/26950412
tags question: http://stackoverflow.com/q/26984488
tags question: http://stackoverflow.com/q/26991862
tags question: http://stackoverflow.com/q/26882039
tags question: http://stackoverflow.com/q/26925922
tags question: http://stackoverflow.com/q/26955191
tags question: http://stackoverflow.com/q/26898817
tags question: http://stackoverflow.com/q/26972553
tags question: http://stackoverflow.com/q/26890849
tags question: http://stackoverflow.com/q/26857871
tags question: http://stackoverflow.com/q/26904188
tags question: http://stackoverflow.com/q/26949196
tags question: http://stackoverflow.com/q/26845305
tags question: http://stackoverflow.com/q/26948720
tags question: http://stackoverflow.com/q/26860735
tags question: http://stackoverflow.com/q/26842574
tags question: http://stackoverflow.com/q/26903758
tags question: http://stackoverflow.com/q/26875049
tags question: http://stackoverflow.com/q/26965043
tags question: http://stackoverflow.com/q/26967648
tags question: http://stackoverflow.com/q/26869913
tags question: http://stackoverflow.com/q/26887351
tags question: http://stackoverflow.com/q/26949406
tags question: http://stackoverflow.com/q/26984210
tags question: http://stackoverflow.com/q/26845860
tags question: http://stackoverflow.com/q/26859859
tags question: http://stackoverflow.com/q/26892736
tags question: http://stackoverflow.com/q/26942968
tags question: http://stackoverflow.com/q/26943193
tags question: http://stackoverflow.com/q/26853385
tags question: http://stackoverflow.com/q/26964434
tags question: http://stackoverflow.com/q/26908467
tags question: http://stackoverflow.com/q/26935548
tags question: http://stackoverflow.com/q/26905038
tags question: http://stackoverflow.com/q/26959242
tags question: http://stackoverflow.com/q/26985105
tags question: http://stackoverflow.com/q/26977351
tags question: http://stackoverflow.com/q/26905164
tags question: http://stackoverflow.com/q/26932132
tags question: http://stackoverflow.com/q/26857300
tags question: http://stackoverflow.com/q/26939528
tags question: http://stackoverflow.com/q/26866063
tags question: http://stackoverflow.com/q/26981397
tags question: http://stackoverflow.com/q/26890998
tags question: http://stackoverflow.com/q/26944298
tags question: http://stackoverflow.com/q/26837474
tags question: http://stackoverflow.com/q/26900154
tags question: http://stackoverflow.com/q/26954087
tags question: http://stackoverflow.com/q/26836063
tags question: http://stackoverflow.com/q/26896986
tags question: http://stackoverflow.com/q/26868499
tags question: http://stackoverflow.com/q/26975871
tags question: http://stackoverflow.com/q/26869963

http://stackoverflow.com/q/26946339
tagged with: node.js
has comment: http://stackoverflow.com/comment/42435362
has comment: http://stackoverflow.com/comment/42436561
type: Question
has body: So basicly I create my db client like this: client = new pg.Client(conString); client.connect(); but after some time of innactivity on the db, the clients probably drops the connection and gives me this error: "Error: read ECONNRESET" I tried doing this to keep it open: db.client.on('error', function(e){ db.client.connect(); }); But that doesn't work and I still get the error. Anyone dealt with this before and has any idea how to solve it?
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/42435420
answer count: 1
tagged with: postgresql
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26965749
has title: How do I keep PostgreSQL connection open?

http://stackoverflow.com/a/26897723
accepted answer of: http://stackoverflow.com/q/26897578
has comment: http://stackoverflow.com/comment/42348772
has comment: http://stackoverflow.com/comment/42348985
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42351776
has comment: http://stackoverflow.com/comment/42349113
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/42348875
has body: I want the user to be able to click it so he can be alerted with an error Remove the disabled from the submit button. Remove the checker.onchange = function(){ Make sure to event.preventDefault(); browser triggering form submits or other default evett actions All you need: var checker = document.getElementById('checkme'); var sendbtn = document.getElementById('submit'); sendbtn.onclick = function( event ){ event.preventDefault(); if(!checker.checked){ alert("You must agree to our terms of service"); } }; Note that you might want to do the above not on button Click but on formID.onsubmit (the form can always be submitted even without a Button click. Not seeing your form this is all I can suggest.) P.S: Developer Console (access by F12 and click Console) helps to debug such errors like &amp;/&amp;&amp; =/=== missing ; etc... P.S2: when using only JS a handy function to fast-get an element by ID can be achieved with a nice little function i.e: function ID(id){return document.getElementById(id);} // ...and use like: var submitBtn = ID("submit");
upvote count: 1
answers question: http://stackoverflow.com/q/26897578

http://stackoverflow.com/q/26901430
tagged with: redactor
score: 0
answer count: 1
tagged with: javascript
type: UnansweredQuestion
has body: I'm currently using the redactor wysiwyg, which has an image upload implementation that sends a post request to a given url then expects back some JSON like: { "filelink": "/static/img.jpg" } in order to display the uploaded image. My current approach has been to create a server-side route, which would get the image from the request body, send it to s3, save the meta data (collectionFS), then return the necessary JSON via the response. I've instantiated redactor like this: Template.editor.rendered = function() { $("#editor").redactor({ imageUpload: "s3" }); }; And the server-side router looks like this: Router.route('/s3', function () { this.response.setHeader("Content-Type", "text/html"); var data = JSON.stringify(this.request.body; var res = this.response; res.end(data); }, {where: 'server'} ); Unfortunately, this returns a blank JSON object. I have tried with request.files and request.body.files, but these don't work. I know the route is working, because I can send plain html via the response. And, I can definitely see binary data of the uploaded file in the post request in firebug, but I can't seem to get Meteor to get those files.
tagged with: meteor
type: Question
has title: Meteor - What's the best way to get files from a post request?
has answer: http://stackoverflow.com/a/26911655

http://stackoverflow.com/comment/42279367
has text: Even in 5000 items it gets slow & large data is the necessity , isn't their any possibility? @adeneo ?
comment on: http://stackoverflow.com/q/26858244
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26877991
type: Answer
upvote count: 0
has comment: http://stackoverflow.com/comment/42313419
downvote count: 1
has comment: http://stackoverflow.com/comment/42313125
has body: You might change the way you call your function. Try this code if this will help createpatient($(this).attr('id'));
score: -1
answers question: http://stackoverflow.com/q/26877912

http://stackoverflow.com/comment/42250232
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26842825
has text: Does it make sense now?

http://stackoverflow.com/a/28921149
upvote count: 3
has body: you are just missing a i in intialize BTW you should call App.prototype.initializ as in the readme
score: 3
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26844890
type: Answer
answers question: http://stackoverflow.com/q/26844890

cordova
tags question: http://stackoverflow.com/q/26951541
tags question: http://stackoverflow.com/q/26945162
tags question: http://stackoverflow.com/q/26962464
tags question: http://stackoverflow.com/q/26888242
tags question: http://stackoverflow.com/q/26881100
tags question: http://stackoverflow.com/q/26912758
tags question: http://stackoverflow.com/q/26937506
tags question: http://stackoverflow.com/q/26840106
tags question: http://stackoverflow.com/q/26869138
tags question: http://stackoverflow.com/q/26856497
tags question: http://stackoverflow.com/q/26937105
tags question: http://stackoverflow.com/q/26953466
tags question: http://stackoverflow.com/q/26956877
tags question: http://stackoverflow.com/q/26852391
tags question: http://stackoverflow.com/q/26933240
tags question: http://stackoverflow.com/q/26991714
tags question: http://stackoverflow.com/q/26880437
tags question: http://stackoverflow.com/q/26869831
tags question: http://stackoverflow.com/q/26931834
tags question: http://stackoverflow.com/q/26843264
tags question: http://stackoverflow.com/q/26887506
tags question: http://stackoverflow.com/q/26959263
tags question: http://stackoverflow.com/q/26971021
tags question: http://stackoverflow.com/q/26910891
tags question: http://stackoverflow.com/q/26832578
tags question: http://stackoverflow.com/q/26893517
tags question: http://stackoverflow.com/q/26836652
tags question: http://stackoverflow.com/q/26833752
tags question: http://stackoverflow.com/q/26967621
tags question: http://stackoverflow.com/q/26975091
tags question: http://stackoverflow.com/q/26898122
tags question: http://stackoverflow.com/q/26863397
tag name: cordova
tags question: http://stackoverflow.com/q/26947611
tags question: http://stackoverflow.com/q/26960901
tags question: http://stackoverflow.com/q/26877251
tags question: http://stackoverflow.com/q/26943036
tags question: http://stackoverflow.com/q/26880881
tags question: http://stackoverflow.com/q/26861002
tags question: http://stackoverflow.com/q/26928993
tags question: http://stackoverflow.com/q/26893546
tags question: http://stackoverflow.com/q/26906859
tags question: http://stackoverflow.com/q/26871615
tags question: http://stackoverflow.com/q/26917002
tags question: http://stackoverflow.com/q/26949054
tags question: http://stackoverflow.com/q/26858573
tags question: http://stackoverflow.com/q/26951793
tags question: http://stackoverflow.com/q/26834738
tags question: http://stackoverflow.com/q/26928580
tags question: http://stackoverflow.com/q/26917561
tags question: http://stackoverflow.com/q/26873162
tags question: http://stackoverflow.com/q/26933560
tags question: http://stackoverflow.com/q/26859422
tags question: http://stackoverflow.com/q/26955469
tags question: http://stackoverflow.com/q/26973254
type: Tag
tags question: http://stackoverflow.com/q/26847587
tags question: http://stackoverflow.com/q/26844422
tags question: http://stackoverflow.com/q/26973974

http://stackoverflow.com/q/26944424
upvote count: 1
type: Question
tagged with: mongodb
tagged with: mongoose
tagged with: javascript
has title: How to save Data in MongoDB from forms
accepted answer: http://stackoverflow.com/a/26944556
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/42431769
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26944556
score: 1
has body: I have a form. I need to get text from my form to save it in MongoDB. tweets.ejs: &lt;form method="post" action="/tweets"&gt; &lt;input type="text" id="txt" name="text"/&gt; &lt;input type="button" id="btn" value="Touch me"&gt; &lt;/form&gt; Here is my route file tweets.js: var Message = require('models/messages'); exports.get = function(req,res) { res.render('tweets') }; I use mongoose schema(models/messages.js): var mongoose = require('../libs/mongoose'), Schema = mongoose.Schema; var MessageSchema = new Schema({ message: String, date: Date }); var Message = mongoose.model('Message', MessageSchema); module.exports = Message; I tried set var m = req.body.text in tweets.js, but I think it's absolutely wrong way exports.post = function(req,res){ var m = new Message; m.message = req.body.text; m.save(); } Explain me how to do it right please!
tagged with: forms

http://stackoverflow.com/comment/42429841
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26943273
has text: And what exactly isn't working

http://stackoverflow.com/comment/42271903
score: 0
has text: Just to be clear, the challenge I am having is getting data BACK from the Guest. I can inject a script and have it interact with the data on the Guest, but using a simple "return window.globalVar" is not sending the data back to the host. I am wondering if I should be using "message passing" instead?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26851116

http://stackoverflow.com/comment/42427055
has text: No, not exactly. I'm wondering why I can't pass in multiple properties to iron:router, and call one of those properties ONLY in the data property. I'm about to update my question to make it more specific.
comment on: http://stackoverflow.com/a/26856677
type: AnswerComment
type: Comment
score: 2

http://stackoverflow.com/comment/42421892
comment on: http://stackoverflow.com/a/26938493
type: Comment
type: AnswerComment
has text: Peterka,yeah, I've got u, was inattentive. Bit it does not work(
score: 0

http://stackoverflow.com/comment/42457410
type: QuestionComment
type: Comment
score: 0
has text: Yes I am being redirected to a selected page. I don't read the URL of currently opened page which I assume is the solution. But I don't know yet how to do that :)
comment on: http://stackoverflow.com/q/26959219

http://stackoverflow.com/a/26858600
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/26858571
has comment: http://stackoverflow.com/comment/42279037
accepted answer of: http://stackoverflow.com/q/26858571
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42279532
has comment: http://stackoverflow.com/comment/42278933
has comment: http://stackoverflow.com/comment/42279280
has comment: http://stackoverflow.com/comment/42279696
has comment: http://stackoverflow.com/comment/42279632
has comment: http://stackoverflow.com/comment/42279232
has comment: http://stackoverflow.com/comment/42279342
has body: Use the function name itself without quotes: function timerFunc() { alert("Howdy"); setTimeout(timerFunc, 5000);//&lt;-- quotes removed } timerFunc(); You can also use setInterval for repetitive task: function timerFunc() { alert("Howdy"); } timerFunc(); setInterval(timerFunc, 5000);

http://stackoverflow.com/q/26958517
type: Question
has title: How can I achieve this effect using SVG and JS?
has body: I've already built the animation part, used JS to control the in SVG element. Now what I want to achieve is something like this: I tried to use paths.getBoundingClientRect() to get the distance between viewport's border to the path's highest position, so I can make the whole background change when the peak reaches a certain position. (if (rect.top &lt;= 100) {...}) But I don't know how to control irregularly shaped areas' attributes. Any possible solution? Thank you very much.
tagged with: javascript
upvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/26958879
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/26958879
score: -3
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/42455877
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/svg
downvote count: 3

http://stackoverflow.com/q/26884797
has title: Getting website's time to set time range
has answer: http://stackoverflow.com/a/26885904
tagged with: javascript
has comment: http://stackoverflow.com/comment/42324627
tagged with: ajax
accepted answer: http://stackoverflow.com/a/26885904
tagged with: php
possible better answer: http://stackoverflow.com/a/26885031
has comment: http://stackoverflow.com/comment/42325060
has answer: http://stackoverflow.com/a/26885031
has comment: http://stackoverflow.com/comment/42325142
score: 0
has comment: http://stackoverflow.com/comment/42324897
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42324981
has comment: http://stackoverflow.com/comment/42324798
has comment: http://stackoverflow.com/comment/42324777
has comment: http://stackoverflow.com/comment/42325447
has comment: http://stackoverflow.com/comment/42324840
has comment: http://stackoverflow.com/comment/42325088
type: Question
has body: Is there any way to get the current time of website in order to set range time for reaction? e.g if current time of website &gt;= 14:00 &amp;&amp; current time of website &lt; 15:00 do reaction else another reaction I want to do this checking type of fuction every 30' sec EDITED e.g If in my country the time is 14:00 and in another one is 19:00 I want to do the reaction to another country based in my country's time. Correct my if I do smthng wrong.
answer count: 2
has comment: http://stackoverflow.com/comment/42324742

http://stackoverflow.com/a/26948029
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/26947673
has comment: http://stackoverflow.com/comment/42438469
has comment: http://stackoverflow.com/comment/42438448
has body: Sugar is basically a support library. It does not export any function, but adds functions to the various types of objects of a JavaScript runtime. Steps: Place sugar.min.js in the script directory or some other directory, require("sugar.min"); to execute the file directly or from another directory require("./relativePath/sugar.min");. The following complete script shows that it works: casper.test.begin("sugar1", function suite(test){ test.assertTrue(![1,2,3].average, "average function does not exist"); require("sugar.min"); test.assertFalse(![1,2,3].average, "average function does exist"); test.assertTrue([1,2,3].average() === 2, "average function works"); test.done(); }); require is usually for loading modules, but since Sugar does not export anything it is just executed. An alternative would be reading the file with fs.read and eval.
upvote count: 2
has comment: http://stackoverflow.com/comment/42537798
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/26947673

http://stackoverflow.com/comment/42526131
type: Comment
comment on: http://stackoverflow.com/a/26988705
has text: How does google analytics handle click tracking? Here click tracking and destination are served at the same time. All we do is onclick setup `ga('send', 'event', 'button', 'click', label, value)`.
type: AnswerComment
score: 0

http://stackoverflow.com/q/26942519
has title: How to create a clipboard object in GTK using JavaScript
type: AnsweredQuestion
score: 3
downvote count: 0
type: Question
tagged with: gnome
tagged with: javascript
has body: I'm having a dickens of a time creating a clipboard object in JavaScript. const Gtk = imports.gi.Gtk; const Gdk = imports.gi.Gdk; // A bunch of unimportant code var clippy = Gtk.Clipboard.get(Gdk.Atom.intern("CLIPBOARD", false)); // Hi clippy clippy.request_text(this._textRec); // And elsewhere this._textRec is defined as... _textRec: function(clipboard, text, data) { this.label.label = text; } With the above code, I get the error "Can't create a Javascript object for Atom; no way to copy". Thoughts? Suggestions? I'm very new to GTK programming, and I'm not sure how different the JS stuff is from, say, the python information available.
upvote count: 3
has answer: http://stackoverflow.com/a/27587027
accepted answer: http://stackoverflow.com/a/27587027
answer count: 1
favorite count: 0
tagged with: linux
tagged with: gtk

http://stackoverflow.com/comment/42474523
has text: how to define the function outside the controller's scope (public)
type: AnswerComment
comment on: http://stackoverflow.com/a/26968081
score: 0
type: Comment

http://stackoverflow.com/a/26871890
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/42302085
has body: index = index+""; object[index] = (value.toFixed(2)); concatenating an integer to a "" will turn that number to string , although types are very flexible in javascript
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/42302143
has comment: http://stackoverflow.com/comment/42302646
has comment: http://stackoverflow.com/comment/42302130
answers question: http://stackoverflow.com/q/26871820

http://stackoverflow.com/a/26902058
accepted answer of: http://stackoverflow.com/q/26901712
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42358601
has comment: http://stackoverflow.com/comment/42357457
has comment: http://stackoverflow.com/comment/42356645
type: Answer
score: 0
has body: Your problem is almost certainly the issue: this.a = ((WebView)findViewById(2131230720)); The number "2131230720" is a static reference int to resources, in this case a layout view in your Activity. That number comes from R.java which is created when you "build" your project. Each time you perform a build, it will assign an integer to layout objects, strings, etc. that you define in XML in your res folder. Using the integer value might work for a while (or is present in source code), but then you change your layouts (or other R objects like strings) or rebuild on a different machine, Android library, etc. and it doesn't work anymore; That line should look like this: this.a = ((WebView)findViewById(R.id.my_webview_layout_id)); where "my_webview_layout_id" is from your layout XML file. You should find the "id" of the XML defined object in an XML file in res/layout Use that @+id reference. That will keep track of changes to that static reference. Then when you build or rebuild your Android app, it will create the R.java file with all of the appropriate references.
has comment: http://stackoverflow.com/comment/42356987
answers question: http://stackoverflow.com/q/26901712

http://stackoverflow.com/comment/42314412
score: 0
type: AnswerComment
has text: I need the third element of the `arr2` object. So when I do `arr2[3].length`. It still gives undefined.
type: Comment
comment on: http://stackoverflow.com/a/26878663

http://stackoverflow.com/comment/42339854
comment on: http://stackoverflow.com/a/26893017
score: 0
type: AnswerComment
has text: This is actually not one of those cases where `setTimeout` is more appropriate
type: Comment

http://stackoverflow.com/comment/42369391
type: QuestionComment
comment on: http://stackoverflow.com/q/26909833
has text: @SalmanA The Inspector shows me the code of the journey2.html in the main div.
score: 0
type: Comment

http://stackoverflow.com/q/26868883
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/26868969
has body: I'm working on a simple jQuery script that i want to change the background color of the clicked element. So here is my code: ev Банков превод I have many ... tags Here is the CSS of : .opc-wrapper-opc .payment-block dt { background: #3399CC; border-radius: 2px; margin: 0px 0px 13px; position: relative; } So actually it seems that i am clicking on the label or on the input but the background that i want to change is of that dt element. How i can make it ?
tagged with: http://stackoverflow.com/tag/html
has title: jQuery change CSS background of clicked element from many elements with same .class
tagged with: css
has comment: http://stackoverflow.com/comment/42296851
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/26868969
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/42440780
has text: Your controller actions shouldn't contain a bunch of logic for saving/loading data, they should be calling something else to handle that (maybe a service object). This way you can have different controllers saving similar data while still staying DRY. You will spend a great deal of time trying to find the right solution, and you probably be fully satisfied until you've done it over and over again. Consider looking into the presenter pattern, don't use them unless you really feel like they will help.
comment on: http://stackoverflow.com/a/26942201
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/42461529
comment on: http://stackoverflow.com/q/26961265
score: 0
has text: Sorry, my bad there.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42494317
score: 0
has text: I can't imagine why regex wouldn't easily solve this problem, possibly with the necessity of capture groups, however, without a more concise definition of variation, it's kind of difficult to provide a succinct answer.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26979761

parse-platform
tags question: http://stackoverflow.com/q/26975675
tags question: http://stackoverflow.com/q/26973873
tags question: http://stackoverflow.com/q/26952234
type: Tag
tags question: http://stackoverflow.com/q/26871754
tags question: http://stackoverflow.com/q/26891751
tags question: http://stackoverflow.com/q/26977531
tags question: http://stackoverflow.com/q/26872374
tags question: http://stackoverflow.com/q/26836278
tags question: http://stackoverflow.com/q/26878139
tags question: http://stackoverflow.com/q/26929709
tags question: http://stackoverflow.com/q/26983356
tags question: http://stackoverflow.com/q/26923172
tags question: http://stackoverflow.com/q/26844511
tag name: parse-platform

http://stackoverflow.com/q/26957401
has comment: http://stackoverflow.com/comment/42455006
answer count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: geolocation
downvote count: 1
has comment: http://stackoverflow.com/comment/42455056
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/42455111
has body: please no negative points as I am so new. Plz check the jsFidle link and then read the following. Actually i am going to retrieve data using json, API and in the first dropdown list CAR MAKE have to be displayed. Then based on the selected CAR MAKE, CAR MODEL should be retrieved. After that i have to make a call by selecting CAR MODEL to retrieve VARIENT. Finally You have to retrieve cities in four dropdown lists. Now based on CAR MAKE, CAR MODEL, CAR VARIENT and four different cities the car price should be displayed on google map for the cities clearly identifying those. For documentation: API Docs. What I exactly want: HTML: Make Model Varient Cities JS: $.getJSON( "http://api.dataweave.in/v1/car_prices/listUniqMakes?api_key=f63d3f0d8138ad1ea25bfb0f3068ec39efec318c", function( data ) { var items = []; $.each( data["data"], function( key, val ) { console.log(val); items.push( " " + val["brand"] + " " ); }); $( " ", { "class": "my-new-list", "id" : "select1", html: items.join( "" ) }).appendTo( ".make" ); }).done(function(){ $('#select1').change(function(){ console.log($(this).val()); var make = $(this).val(); $.getJSON( 'http://api.dataweave.in/v1/carPricesIndia/findByMake/?api_key=f63d3f0d8138ad1ea25bfb0f3068ec39efec318c&make='+make+'&city=Bangalore&page=1&per_page=10', function( data ) { var items_model = []; var items_varient = []; $.each( data["data"], function( key, val ) { console.log(val['variant']); items_model.push( " " + val["model"] + " " ); items_varient.push( " " + val["variant"] + " " ); }); var sel = $( " ", { "class": "my-new-list-1", "id" : "select2", html: items_model.join( "" ) }); var sel_var = $( " ", { "class": "my-new-list-2", "id" : "select3", html: items_varient.join( "" ) }); $('#mod').html(sel); $('#var').html(sel_var); }); }); });
type: Question
has comment: http://stackoverflow.com/comment/42454064
tagged with: jsonp
tagged with: api
tagged with: javascript
has comment: http://stackoverflow.com/comment/42455996
has title: How to retrieve data contained in json format using API
favorite count: 0
score: 1

http://stackoverflow.com/q/26906657
favorite count: 0
upvote count: 66
has title: Round number to nearest thousand, up or down depending on the number
answer count: 5
score: 65
accepted answer: http://stackoverflow.com/a/26906709
has answer: http://stackoverflow.com/a/66324512
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/67136959
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/26906771
has body: I want to round up a number to the nearest thousand, at the moment I'm using this: Math.ceil(value/1000)*1000; But this goes always up, if I type 1001 it will go to 2000, I want to go up or down depeding on the number, for example 1001 goes to 1000 or 1400 goes to 1000 but 1500 goes to 2000 EDIT: if(value&lt;1000){ value = 1000; }else{ value = Math.round(value/1000)*1000; }
has answer: http://stackoverflow.com/a/37749702
has answer: http://stackoverflow.com/a/26906709
tagged with: javascript
has comment: http://stackoverflow.com/comment/42363723
possible better answer: http://stackoverflow.com/a/37749702

http://stackoverflow.com/a/66324512
answers question: http://stackoverflow.com/q/26906657
downvote count: 0
type: Answer
has body: Not the exactly point, but to round a number like 1250 to 1.2k or 55730 to 55,7m you might use something like: let value = 90731+''; let len = value.length; let sym = len&gt;6?'m':'k'; let hundred = (len==9||len==6); if(len&gt;3){ value = value.slice(0,-3)+(hundred?'':'.'+value.charAt(1))+sym; };
upvote count: 3
score: 3

http://stackoverflow.com/q/26946322
type: Question
tagged with: arrays
answer count: 1
tagged with: javascript
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/26946491
upvote count: 2
tagged with: hardcoded
tagged with: geojson
downvote count: 1
has body: I am using a function with hardcoded values to assign colors to polygons on a leaflet map. the styling functions are called from inside a $.getJSON. i want to rewrite my code so that that the values are pulled directly from the data instead of hardcoded - in theory, this is so that i can reuse the code more easily in the future The (truncated) geojson data called by $.getJSON is: {"type": "FeatureCollection","crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, "features": [{"type": "Feature", "properties": {"MAJORCOLOR": "ZONE A"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ -77.946264290220981, 42.574112051418197 ], [ -77.954525714402251, 42.569801987122105 ], [ -77.964847297117899, 42.562124252064194 ]]]}}, "features": [{"type": "Feature", "properties": {"MAJORCOLOR": "ZONE B"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ -77.946264290220981, 42.574112051418197 ], [ -77.954525714402251, 42.569801987122105 ], [ -77.964847297117899, 42.562124252064194 ]]]}}, "features": [{"type": "Feature", "properties": {"MAJORCOLOR": "ZONE A"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ -77.946264290220981, 42.574112051418197 ], [ -77.954525714402251, 42.569801987122105 ], [ -77.964847297117899, 42.562124252064194 ]]]]}}]} The $.getJSON is: $.getJSON('data/ecozone_wgs84_multipart.geojson', function(data){ var geojsonLayer = L.geoJson(data.features, { onEachFeature: makeMarkers, //this provides thematic styling to the layers style: style }) .addTo(map); //call the function to create keys getArray(data); }); This is the function that assigns colors based on the data values //get color depending on the Zone value function getColor(z) { return z == 'ZONE A' ? '#a6cee3': z == 'ZONE B' ? '#1f78b4': z == 'ZONE C' ? '#b2df8a': '#000000';} Which in turn is called by the style function, from inside $.getJSON function style(feature) { return { fillColor: getColor(feature.properties.MAJORCOLOR), color: getColor(feature.properties…
has title: function works only with hardcoded values
type: AnsweredQuestion
tagged with: leaflet
accepted answer: http://stackoverflow.com/a/26946491

http://stackoverflow.com/comment/42382019
comment on: http://stackoverflow.com/a/26915739
type: Comment
has text: @Migue , only thing, i can tell you that you need to rethink about design of this thing, may be handle all thing using `javascript` only or possibly server-side code.
score: 0
type: AnswerComment

http://stackoverflow.com/a/26896146
type: AcceptedAnswer
has body: Where is span being create, before the line range.surroundContents(span) ? This fixes it for me: var newSpan = document.createElement('span'); range.surroundContents(newSpan); Here's a screenshot of the DOM after adding the above lines, then selecting some text as described: EDIT Here is the updated code as per clarification in comments. /** * This line will check if the selected text is already inside a &lt;span&gt; * ---------------------------------------------------------------------- * text.anchorNode.parentNode.nodeName === 'SPAN' * * This line will check if the selected text contains a &lt;span&gt; within it * ---------------------------------------------------------------------- * text.anchorNode.parentNode.querySelector('span') !== null * */ if( text === '' || text.toString().trim() === '' || text.anchorNode.parentNode.querySelector('span') !== null) { console.log('&lt;span&gt; inside selection - returning'); return false; }
has comment: http://stackoverflow.com/comment/42347193
has comment: http://stackoverflow.com/comment/42346022
has comment: http://stackoverflow.com/comment/42346650
type: Answer
accepted answer of: http://stackoverflow.com/q/26895801
has comment: http://stackoverflow.com/comment/42347344
answers question: http://stackoverflow.com/q/26895801
score: 0

http://stackoverflow.com/q/26900373
type: Question
has comment: http://stackoverflow.com/comment/42393232
tagged with: google-apps-script
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/42402060
has body: I am currently working on a little recreational Google Apps Script (GAS) for EVE Online and I have hit a brick wall when I am getting my server side functions talking to my client side ones. HTML: Type Name Type ID GAS: function doGet() { return HtmlService.createTemplateFromFile('Index').evaluate().setTitle('UMX Web App'); }; function include(filename) { return HtmlService.createHtmlOutputFromFile(filename).getContent(); }; function shortlist(form,table) { var arr = transpose(htmlToArray(table)); var item = form.mat; if ( isNaN(item) ) { var url = 'https://www.fuzzwork.co.uk/api/typeid2.php?format=xml&typename=' + item.toString(); } else { var url = 'https://api.eveonline.com/eve/TypeName.xml.aspx?ids=' + item.toString(); }; var xml = UrlFetchApp.fetch(url).getContentText(); var document = XmlService.parse(xml); var name = document.getRootElement().getChild('result').getChild('rowset').getChild('row').getAttribute('typeName').getValue(); if ( arr[0].indexOf(name) == -1 && name != 'Unknown Type' && name != 'bad item' ) { arr[0].push(name); arr[1].push(document.getRootElement().getChild('result').getChild('rowset').getChild('row').getAttribute('typeID').getValue()); }; var str = arrayToHTML(transpose(arr)); return ['spn1',str] }; function arrayToHTML(arr) { var i = 0; var j = 0; var str = ' '; while ( i < arr.length ) { str = str + ' '; while ( j < arr[i].length ) { str = str + ' ' + arr[i][j] + ' '; j += 1 }; str = str + ' '; j = 0; i += 1 }; str = str + ' '; return str }; function htmlToArray(str) { var arr1 = str.replace(/ /g,' ').split(' '); var arr2 = []; var i = 1; var j = 1; var x = []; while ( i < arr1.length ) { arr2.push([]); x = arr1[i].replace(/ /g,' ').split(' '); while ( j < x.length ) { arr2[arr2.length - 1].push(x[j]); j += 2 }; j = 1; i += 2 }; return arr2 }; function transpose(input) { var output = []; var i = 0; var j = 0; while ( i < input[0].length ) { output.push([]); while ( j < input.length ) { output[i].push(input[j][i]); j += 1 }; j = 0; i +…
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: HTML error in Google Apps Script for EVE Online
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42375936
has answer: http://stackoverflow.com/a/26921701

http://stackoverflow.com/a/26875028
score: 2
upvote count: 2
has body: If I understood the Question, Then it does'nt need to be js, Css will do the trick. Look into alpha and opacity and z-index #img1{position:absolute;top:0px;} #img2{position:absolute;top:50px;opacity:.6;} &lt;img src="http://lorempixel.com/400/200/sports/1" id="img1"&gt; &lt;img src="http://lorempixel.com/50/50/sports/2" id="img2"&gt;
answers question: http://stackoverflow.com/q/26874586
downvote count: 0
type: Answer

http://stackoverflow.com/q/26847064
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26847124
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26847228
possible better answer: http://stackoverflow.com/a/26847124
type: AnsweredQuestion
has title: how to $(".class").load part of external html div along with css/js
accepted answer: http://stackoverflow.com/a/26847228
has body: I have a div loadContent in my main html, loading successfully with my external html, instead of loading the whole html i decided to load just 1 part of the div, but if i just load that one part, it won't link with my external css anymore. my external HTML des GAD Portfolio1 bee GAD Portfolio2 tee GAD Portfolio3 fee GAD Portfolio4 foon GAD Portfolio5 yea GAD Portfolio6 ded GAD Portfolio7 bef GAD Portfolio8 if i just load the above file as a whole it works, but if i just load #content, the .js and .css will disappear. Any solution for it? my Jquery $(function() { $("#tab_gad").click(function() { $('.loadContent').load('portfolio_gad.html #content'); // js and css file gone $('.loadContent').load('portfolio_gad.html'); // works fine since i import everything include heading }); }); Please advise if u have a easier way that i should approach towards. Summary to what i want to achieve. main html load a div of external html(with js & css intact) my approach: i duplicated the main css and js to let my external html link towards it since my main html and external html are almost the same, just different content. Not sure if i am doing this the right way please advise
type: Question
answer count: 2

http://stackoverflow.com/comment/42310455
type: QuestionComment
comment on: http://stackoverflow.com/q/26874769
has text: Actually, if what you described about `getComputedStyle()` were true, IE should put SOMETHING inside the `fooText` div in the fiddle I linked in my question, but this isn't the case. The `cssText` property does not contain any data, including styles which were applied via stylesheet, unless I'm mistaken about the way JSFiddle includes styles.
score: 0
type: Comment

http://stackoverflow.com/comment/42394813
comment on: http://stackoverflow.com/a/26923917
type: AnswerComment
has text: Thanks for help. I got sorted it out. +1 for jsfiddle.
score: 0
type: Comment

http://stackoverflow.com/q/26990192
downvote count: 1
has answer: http://stackoverflow.com/a/27147628
type: Question
has body: I'm working on a visualization of data with d3js and hierarchical layout. My data looks like this: 0 / | \ / | \ 1 5 3 \ | | \ | | 4 / | / 2 As I can't make link to multiple parent, I duplicates nodes on display: 0 / | \ / | \ 1 5 3 | | | | | | 4 4 | | | | 2 2 2 I've made a fiddle demo to show my problem: When I use correct data in my JSON input, I have the good layout (graphic in border blue). When I use a loop to parse my JSON input, I have strange graph (graphic in border green). This is the loop I used to parse the input: for (i in root[2].Arcs){ var d = root[1].Nodes[root[2].Arcs[i].D]; var s = root[1].Nodes[root[2].Arcs[i].S]; if (!d.children){ d.children = []; } d.children.push(s); } For me : both printed element in console are the same, but not the render of layout. There are maybe some differents in object reference. A bad solution I found is to decode then encode my var : var root = JSON.parse(JSON.stringify(root)); Then the script works good. But I root is a long long array, the parsing takes long time... Any idea to explain why I need to use that encode/decode to display same things ? Thank you
score: 5
has answer: http://stackoverflow.com/a/27160538
has comment: http://stackoverflow.com/comment/42756196
has comment: http://stackoverflow.com/comment/42739669
tagged with: javascript
linked to: http://stackoverflow.com/q/122102
favorite count: 0
linked to: http://stackoverflow.com/q/728360
tagged with: d3.js
type: UnansweredQuestion
has title: d3js works after encode decode data
has answer: http://stackoverflow.com/a/27184175
has answer: http://stackoverflow.com/a/27169037
upvote count: 6
answer count: 4
has comment: http://stackoverflow.com/comment/42823792
has comment: http://stackoverflow.com/comment/42824088
tagged with: http://stackoverflow.com/tag/json
linked to: http://stackoverflow.com/q/184710

http://stackoverflow.com/a/26923653
has body: I see that you have tagged it as javascript, so i would suggest you t go through this official Facebook tutorial : https://developers.facebook.com/docs/facebook-login/login-flow-for-web/v2.2 Once the user is done with this, you just need to allow the user to query your database. P.S. - For a more appropriate answer in regards to the later section, you need to put forward a more "to the point" question.
type: Answer
accepted answer of: http://stackoverflow.com/q/26922097
answers question: http://stackoverflow.com/q/26922097
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42420623

http://stackoverflow.com/comment/42275981
type: QuestionComment
has text: jfriend00 No. It has images too, and maybe forms as well, so embedding everything in the responseText seems bad practice in this case. I will give angular a go as @andrew suggested.
comment on: http://stackoverflow.com/q/26856729
score: 0
type: Comment

http://stackoverflow.com/comment/42239919
score: 0
type: Comment
has text: It's still not working. Can you send me the zip file? It would be much appreciated.
type: AnswerComment
comment on: http://stackoverflow.com/a/26837073

http://stackoverflow.com/a/26877286
score: 1
has comment: http://stackoverflow.com/comment/42328054
upvote count: 1
has comment: http://stackoverflow.com/comment/42312704
has body: What Radu said, mostly. I was updating your fiddle at the same time he was it seems. Additionally, you might find it more convenient to wait until you have that latLng before you construct your infoWindow object, like this: var infoWindow = new google.maps.InfoWindow({ content: " Mi marca situada en " + "Lat: " + event.latLng.lat() + " " + "Lng: " + event.latLng.lng() + " " }); infoWindow.open(map, marker); If you want to update the contents of your infoWindow, use infoWindow.setContent(). See the Google Maps API reference for an exhaustive list of objects and their properties.
answers question: http://stackoverflow.com/q/26876806
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26876806
type: Answer
has comment: http://stackoverflow.com/comment/42329447

http://stackoverflow.com/a/26941511
upvote count: 1
downvote count: 0
has body: To use jQuery remove method you need this: function removeImage() { $(dragimg).remove(); } Your dragimg is a dom element, but $(dragimg) is a jQuery element. While jQuery prepend method accepts dom elements, remove does not - it applies to jQuery element itself or to selector. More about jQuery remove and prepend.
answers question: http://stackoverflow.com/q/26941385
type: Answer
score: 1

http://stackoverflow.com/comment/42344974
type: Comment
has text: The first one works. The simpler one does not. There is no trace of "value". Thanks anyway.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26895361

css
tags question: http://stackoverflow.com/q/26985185
tags question: http://stackoverflow.com/q/26869270
tags question: http://stackoverflow.com/q/26860449
tags question: http://stackoverflow.com/q/26870638
tags question: http://stackoverflow.com/q/26963728
tags question: http://stackoverflow.com/q/26899886
tags question: http://stackoverflow.com/q/26969539
tags question: http://stackoverflow.com/q/26914872
tags question: http://stackoverflow.com/q/26834841
tags question: http://stackoverflow.com/q/26959217
tags question: http://stackoverflow.com/q/26894349
tags question: http://stackoverflow.com/q/26951066
tags question: http://stackoverflow.com/q/26955728
tags question: http://stackoverflow.com/q/26876376
tags question: http://stackoverflow.com/q/26895466
tags question: http://stackoverflow.com/q/26927092
tags question: http://stackoverflow.com/q/26913401
tags question: http://stackoverflow.com/q/26845161
tags question: http://stackoverflow.com/q/26837493
tags question: http://stackoverflow.com/q/26963017
tags question: http://stackoverflow.com/q/26893524
tags question: http://stackoverflow.com/q/26936638
tags question: http://stackoverflow.com/q/26896077
tags question: http://stackoverflow.com/q/26909862
tags question: http://stackoverflow.com/q/26897873
tags question: http://stackoverflow.com/q/26947776
tags question: http://stackoverflow.com/q/26940538
tags question: http://stackoverflow.com/q/26989122
tags question: http://stackoverflow.com/q/26854584
tags question: http://stackoverflow.com/q/26974265
tags question: http://stackoverflow.com/q/26984165
tags question: http://stackoverflow.com/q/26911279
tags question: http://stackoverflow.com/q/26970880
tags question: http://stackoverflow.com/q/26876216
tags question: http://stackoverflow.com/q/26927887
tags question: http://stackoverflow.com/q/26880189
tags question: http://stackoverflow.com/q/26841741
tags question: http://stackoverflow.com/q/26955440
tags question: http://stackoverflow.com/q/26841609
tags question: http://stackoverflow.com/q/26969306
tags question: http://stackoverflow.com/q/26917973
tags question: http://stackoverflow.com/q/26918447
tags question: http://stackoverflow.com/q/26853241
tags question: http://stackoverflow.com/q/26855477
tags question: http://stackoverflow.com/q/26906479
tags question: http://stackoverflow.com/q/26934029
tags question: http://stackoverflow.com/q/26908374
tags question: http://stackoverflow.com/q/26908857
tags question: http://stackoverflow.com/q/26847372
tags question: http://stackoverflow.com/q/26885908
tags question: http://stackoverflow.com/q/26835284
tags question: http://stackoverflow.com/q/26836532
tags question: http://stackoverflow.com/q/26862110
tags question: http://stackoverflow.com/q/26886976
tags question: http://stackoverflow.com/q/26932349
tags question: http://stackoverflow.com/q/26879471
tags question: http://stackoverflow.com/q/26990942
tags question: http://stackoverflow.com/q/26948804
tags question: http://stackoverflow.com/q/26861110
tags question: http://stackoverflow.com/q/26848642
tags question: http://stackoverflow.com/q/26941247
tags question: http://stackoverflow.com/q/26906131
tags question: http://stackoverflow.com/q/26924989
tags question: http://stackoverflow.com/q/26921784
tags question: http://stackoverflow.com/q/26899210
tags question: http://stackoverflow.com/q/26886922
tags question: http://stackoverflow.com/q/26874339
tags question: http://stackoverflow.com/q/26893494
tags question: http://stackoverflow.com/q/26987831
tags question: http://stackoverflow.com/q/26987180
tags question: http://stackoverflow.com/q/26840808
tags question: http://stackoverflow.com/q/26909189
tags question: http://stackoverflow.com/q/26945452
tags question: http://stackoverflow.com/q/26871351
tags question: http://stackoverflow.com/q/26886019
tags question: http://stackoverflow.com/q/26952694
tags question: http://stackoverflow.com/q/26863166
tags question: http://stackoverflow.com/q/26949471
tags question: http://stackoverflow.com/q/26870089
tags question: http://stackoverflow.com/q/26874769

http://stackoverflow.com/q/26939309
has comment: http://stackoverflow.com/comment/42423320
tagged with: html-email
possible better answer: http://stackoverflow.com/a/26939389
has answer: http://stackoverflow.com/a/26939389
answer count: 4
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/42583262
upvote count: 1
has answer: http://stackoverflow.com/a/26939523
type: Question
accepted answer: http://stackoverflow.com/a/26939368
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/42423734
has title: How to change bgcolor of each item in array with JavaScript
downvote count: 0
has comment: http://stackoverflow.com/comment/42423006
has body: (Keep in mind, this needs to be compatible with HTML email so tables and outdated attributes are a necessity - such as bgcolor.) I am trying to change the bgcolor of all TDs with a certain id that is defined in an array in JavaScript. I have tried numerous similar examples with no luck, for example: var yellowIDs = ["1201", "1204", "0116"]; for (i = 0; i < yellowIDs.length; i++) { document.getElementById(yellowIDs[i]).bgcolor = "#ffff00"; } HTML PORTION Sun I'm sure I'm missing a lot, and I appreciate any and all help. Thank you.
favorite count: 0
has answer: http://stackoverflow.com/a/27027268
has comment: http://stackoverflow.com/comment/42423638
has answer: http://stackoverflow.com/a/26939368
has comment: http://stackoverflow.com/comment/42423194

http://stackoverflow.com/q/26893711
has title: Typeahead with results starting with query ranked higher
downvote count: 0
has body: I'm using the AngulaJS typeahead directive like follows: typeahead="elements.name for elements in someObject.elements | filter:{name:$viewValue} | orderBy:'name' With the $viewValue being 'foo' the output looks like this and in the exact order: a foo goes first after the foo goes a bar bar comes before foo foo comes after bar foobar is awesome I'd like to have results starting with query being ranked higher, like this: foo comes after bar foobar is awesome a foo goes first after the foo goes a bar bar comes before foo But I don't see any way to do this cleanly. What I also tried was this: $scope.startsWith = function (state, viewValue) { return state.substr(0, viewValue.length).toLowerCase() === viewValue.toLowerCase(); }; ...using it like follows: typeahead="elements.name for elements in someObject.elements | filter:{name:$viewValue}:startsWith | orderBy:'name' The result was this: foo comes after bar foobar is awesome Any ideas?
type: Question
score: 3
has answer: http://stackoverflow.com/a/26917925
accepted answer: http://stackoverflow.com/a/26917925
upvote count: 3
has answer: http://stackoverflow.com/a/28081058
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/26893873
tagged with: angularjs
answer count: 3
has answer: http://stackoverflow.com/a/26893873
type: AnsweredQuestion

http://stackoverflow.com/q/26877084
tagged with: javascript
upvote count: 3
has title: angularjs ng-repeat in table "jump" outside the table?
answer count: 1
favorite count: 0
tagged with: angularjs
linked to: http://stackoverflow.com/q/19177738
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/18600710
has body: So I am basically creating a table with nested ng-repeat. And the template of directive in-preset is {{preset.name}} 一些属性 编辑 删除 Directive declaration module.directive('inPreset', function() { return { restrict: 'E', replace: true, templateUrl: 'scripts/directive-templates/in-preset.html' } }); But when I open the page, I found that all trs jumped outside of the table. If I change table to div, then it works fine. I have checked all html tags are perfectly closed. It is damn hard to debug this issue. Any clues?
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26877346
downvote count: 0
type: Question
score: 3

http://stackoverflow.com/q/26870638
tagged with: css
has comment: http://stackoverflow.com/comment/42303425
has title: Creating several D3js graphs on same html page
answer count: 0
linked to: http://stackoverflow.com/q/2554839
tagged with: d3.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42303293
has comment: http://stackoverflow.com/comment/42302455
type: Question
has body: SO I have this html template :- Multiple D3 graphs Multigraphs on same page DEMO GRAPH___1 GRAPH__2 GRAPH__3 Secondary Column Footer If you load this page in your browser it will show three panes horizontally tiled. The thing is that its not displaying the GRAPH__1 inside the first pane. Similarly I would like to insert another D3js graph code in GRAPH__2 and same way for GRAPH__3. Thus I want to show three seperate graphs on the same page , but the position should be as per my need rather than some random location. Please suggest how to get this done. The stylesheet : styles.css body{text-align:center;} #ft{clear:both;} /**/ /* 750 centered, and backward compatibility */ #doc,#doc2,#doc3,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7 { margin:auto;text-align:left; width:57.69em;*width:56.3em;min-width:750px;} /* 950 centered */ #doc2 { width:73.074em;*width:71.313em;min-width:950px;} /* 100% with 10px viewport side matting */ #doc3 { margin:auto 10px; /* not for structure, but so content doesn't bleed to edge */ width:auto;} /* below required for all fluid grids; adjust widths and margins above accordingly */ /* to preserve source-order independence for Gecko */ .yui-b{position:relative;} .yui-b{_position:static;} /* for IE < 7 */ #yui-main .yui-b{position:static;} #yui-main {width:100%;} .yui-t1 #yui-main, .yui-t2 #yui-main, .yui-t3 #yui-main{float:right;margin-left:-25em;/* IE: preserve layout at narrow widths */} .yui-t4 #yui-main, .yui-t5 #yui-main, .yui-t6 #yui-main{float:left;margin-right:-25em;/* IE: preserve layout at narrow widths */} .yui-t1 .yui-b { float:left; width:12.3207em;*width:12.0106em;} .yui-t1 #yui-main .yui-b{ margin-left:13.3207em;*margin-left:13.0106em; } .yui-t2 .yui-b { float:left; width:13.8456em;*width:13.512em;} .yui-t2 #yui-main .yui-b { margin-left:14.8456em;*margin-left:14.512em; } .yui-t3 .yui-b { float:left; width:23.0759em;*width:22.52em;} .yui-t3 #yui-main .yui-b { margin-left:24.0759em;*margin-left:23.52em; } .yui-t4 .y…
tagged with: javascript
score: 0
tagged with: visualization
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/26880316
accepted answer: http://stackoverflow.com/a/26882736
score: 0
has body: I'm working on making a three or four generation family tree in d3.js. You can see the early version here: http://jsfiddle.net/Asparagirl/uenh4j92/8/ Code: // People var nodes = [ { id: 1, name: "Aaron", x: 50, y: 100, gender: "male", dob: "1900", hasParent: false, hasSpouse: true, spouse1_id: 2 }, { id: 2, name: "Brina" , x: 400, y: 100, gender: "female", dob: "1900", hasParent: false, hasSpouse: true, spouse1_id: 1 }, { id: 3, name: "Caden", x: 100, y: 260, gender: "female", dob: "1925", hasParent: true, parent1_id: 1, parent2_id: 2, hasSpouse: false }, { id: 4, name: "David", x: 200, y: 260, gender: "male", dob: "1930", hasParent: true, parent1_id: 1, parent2_id: 2, hasSpouse: false }, { id: 5, name: "Ewa", x: 320, y: 260, gender: "female", dob: "1935", hasParent: true, parent1_id: 1, parent2_id: 2, hasSpouse: true, spouse_id: 6 }, { id: 6, name: "Feivel", x: 450, y: 260, gender: "male", dob: "1935", hasParent: false, hasSpouse: true, spouse_id: 5 }, { id: 7, name: "Gershon", x: 390, y: 370, gender: "male", dob: "1955", hasParent: true, parent1_id: 5, parent2_id: 6, hasSpouse: false } ]; var links = [ { source: 0, target: 1 } ]; // Make the viewport automatically adjust to max X and Y values for nodes var max_x = 0; var max_y = 0; for (var i=0; i&lt;nodes.length; i++) { var temp_x, temp_y; var temp_x = nodes[i].x + 200; var temp_y = nodes[i].y + 40; if ( temp_x &gt;= max_x ) { max_x = temp_x; } if ( temp_y &gt;= max_y ) { max_y = temp_y; } } // Variables var width = max_x, height = max_y, margin = {top: 10, right: 10, bottom: 10, left: 10}, circleRadius = 20, circleStrokeWidth = 3; // Basic setup var svg = d3.select("body").append("svg") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom) .attr("id", "visualization") .attr("xmlns", "http://www.w3.org/2000/svg"); var elem = svg.selectAll("g") .data(nodes) var elemEnter = elem.enter() .append("g") .attr("data-name", function(d){ return d.name }) .attr("data-gender…
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/26882736
has title: d3: Nodes + Links to make a multi-generation family tree; how to parse data to draw lines?
type: AnsweredQuestion
tagged with: d3.js
type: Question

http://stackoverflow.com/comment/42349967
type: QuestionComment
comment on: http://stackoverflow.com/q/26897924
has text: @squint - Yup, you can definitely create this functionality with some custom functions. However, it isn't built in. There is no native way to do this all at once which is going to be "more shorthand" than the oneliner shown.
score: 0
type: Comment

http://stackoverflow.com/q/26846925
type: Question
possible better answer: http://stackoverflow.com/a/26856549
type: AnsweredQuestion
has body: i am trying to download a file from facebook, for example https://www.facebook.com/download/847027648649013/36654984.doc using jquery's ajax (not to disk, to js variable...). since this is for debug purposes i disabled my chrome's 'same origin policy' using -allow-file-access-from-files -disable-web-security the problem is - im getting 404 while if i put this link in a new browser tab ill get 302 and then a redirect to the actual file. how would i download this file? thanks!
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26861805
accepted answer: http://stackoverflow.com/a/26861805
tagged with: ajax
has answer: http://stackoverflow.com/a/26856549
has title: ajax file download from facebook
score: 0
tagged with: xmlhttprequest

http://stackoverflow.com/comment/42432464
has text: Quick follow-up, in my original query I returned 10 results in the future, in ascending order. In your query these params no longer work, it just returns all events in any order. Can't see any info on restricting results on the API reference, any ideas?
comment on: http://stackoverflow.com/a/26943643
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/a/49492006
type: Answer
answers question: http://stackoverflow.com/q/26969514
upvote count: 7
has body: You can use pdfmake which support both client side and server side rendering //import pdfmake import pdfMake from 'pdfmake/build/pdfmake.js'; import pdfFonts from 'pdfmake/build/vfs_fonts.js'; pdfMake.vfs = pdfFonts.pdfMake.vfs; const employees = [ {"firstName":"John", "lastName":"Doe"}, {"firstName":"Anna", "lastName":"Smith"}, {"firstName":"Peter", "lastName":"Jones"} ]; const document = { content: [{text: 'Employees', fontStyle: 15, lineHeight: 2}] } employees.forEach(employee =&gt; { document.content.push({ columns: [ { text: 'firstname', width: 60 }, { text: ':', width: 10 }, { text:employee.firstName, width: 50 }, { text: 'lastName', width: 60 }, {text: ':', width: 10 }, { text: employee.lastName, width: 50} ], lineHeight: 2 }); }); pdfMake.createPdf(document).download();
score: 7
downvote count: 0

http://stackoverflow.com/comment/42236541
score: 5
comment on: http://stackoverflow.com/q/26835270
has text: you know nothing jon snow.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42428130
type: QuestionComment
type: Comment
has text: Please indent your code properly. Also, we don't need the ` ` tags, we can see that it's JS.
score: 0
comment on: http://stackoverflow.com/q/26941851

http://stackoverflow.com/q/26947268
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/26947508
score: 0
answer count: 2
has body: I am stuck with some coding. This is my issue. I have no problem submitting the data to the database varchar field as json using php but how do I retrieve and have the right checkboxes being checked using jquery. Here are the checkboxes and then below that is the data submitted to the database field as json. &lt;input type="checkbox" name="referto[]" value="1"/&gt;Infection Control &lt;input type="checkbox" name="referto[]" value="2"/&gt;Medical &lt;input type="checkbox" name="referto[]" value="3"/&gt;Nursing Administration &lt;input type="checkbox" name="referto[]" value="4"/&gt;Personnel &lt;input type="checkbox" name="referto[]" value="5"/&gt;Quality Committee &lt;input type="checkbox" name="referto[]" value="6"/&gt;Risk and Safety &lt;input type="checkbox" name="referto[]" value="7"/&gt;EAP &lt;input type="checkbox" name="referto[]" value="8"/&gt;Other Json data from the referto field ["1","3","6","7"]
tagged with: php
possible better answer: http://stackoverflow.com/a/26947508
accepted answer: http://stackoverflow.com/a/26947930
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has title: jquery and ajax. How to retrieve data for this field and return to right checkboxes
has answer: http://stackoverflow.com/a/26947930
type: Question
tagged with: javascript

http://stackoverflow.com/comment/42236118
type: QuestionComment
comment on: http://stackoverflow.com/q/26835095
has text: Try `compose(Date.prototype.getMonth)`.
score: 0
type: Comment

http://stackoverflow.com/comment/42363812
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26905952
has text: I also want the hash to appear before my content for instance it should be like `www.example.com/about` something like this

http://stackoverflow.com/comment/42496021
score: 0
type: Comment
type: QuestionComment
has text: Yes, that is what I mean. When you move to another page, open your browser's JavaScript console and enter "dataLayer" to display the contents of the dataLayer object. You will see several sub-objects. If you open the fourth object, what is the event type? Do you see any additional sub-objects? What are their event types?
comment on: http://stackoverflow.com/q/26972185

http://stackoverflow.com/a/26989833
accepted answer of: http://stackoverflow.com/q/26988907
type: AcceptedAnswer
upvote count: 1
type: Answer
downvote count: 0
has body: In your publishing code you have to use Rooms instead of rooms, That is your collection name. Like this Meteor.publish("rooms", function() { return Rooms.find(); });
answers question: http://stackoverflow.com/q/26988907
score: 1

http://stackoverflow.com/comment/42294389
type: AnswerComment
has text: I got dataFormat from a similar post asking how to use date in jquery validation. I solved the problem by removing the validation from the button clicks. Previously, i assumed the validation had to be done on click but i guess that wasnt the case. Thanks for the help.
type: Comment
comment on: http://stackoverflow.com/a/26867066
score: 0

http://stackoverflow.com/q/26912762
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: extjs
accepted answer: http://stackoverflow.com/a/26913088
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26913088
score: 1
has title: How to dynamically change grid column sortable?
type: Question
has body: I use ext 4.2. So I have grid with columns and I have to dynamically set columns sortable... I have tried this method in grid setColumnsSortable: function(sortable){ for(var i in this.columns){ this.columns[i].sortable = sortable; } } but after disabling sorting there is arrow which has to disappear...
upvote count: 1

http://stackoverflow.com/a/26979729
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26979494
score: 1
has body: The problem is that inside myFunction, this is no longer event.currentTarget. Instead, it will be window in non-strict mode, or undefined in strict mode. You could fix that setting the value of this manually, e.g. using call: onkeyup="myFunction.call(this)" function myFunction() { var ele = document.getElementById("auto"); if (this.value==" " || this.value=="") { ele.style.display = "none"; } else { ele.innerHTML = "chuckbeyor101@hotmail.com josh@computersbyjd.com"; ele.style.display = "block"; } } Customer Information Email: Test Div But better use addEventListener and get rid of inline event handlers: document.getElementsByName('email')[0].addEventListener('input', function() { // Your code here. }); Note I used input event because inputs can be changed in other ways than the keyboard. var ele = document.getElementById("auto"); document.getElementsByName('email')[0].addEventListener('input', function() { if (!this.value.trim()) { ele.style.display = "none"; } else { ele.innerHTML = "chuckbeyor101@hotmail.com josh@computersbyjd.com"; ele.style.display = "block"; } }); #auto { display: none; } Customer Information Email: Test Div
answers question: http://stackoverflow.com/q/26979494
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42497149

http://stackoverflow.com/a/26910679
answers question: http://stackoverflow.com/q/26910625
type: Answer
downvote count: 0
score: 1
has body: Assuming title is a class (not a tag), and assuming the element is an input (which has a value property): $('.name').children('.title').each(function() { console.log( $(this).val() ); }); If you meant that title is an attribute of an element such as an anchor, try this: $('.name').children('[title]').each(function() { console.log( $(this).val() ); }); However, an anchor doesn't have a value, so you'd use the text() method: console.log( $(this).text() );
upvote count: 1

express
tags question: http://stackoverflow.com/q/26838319
tags question: http://stackoverflow.com/q/26918061
tags question: http://stackoverflow.com/q/26879487
tags question: http://stackoverflow.com/q/26922173
tags question: http://stackoverflow.com/q/26871407
tags question: http://stackoverflow.com/q/26988071
tags question: http://stackoverflow.com/q/26833191
tags question: http://stackoverflow.com/q/26871996
tags question: http://stackoverflow.com/q/26982996
tags question: http://stackoverflow.com/q/26893352
tags question: http://stackoverflow.com/q/26877251
tags question: http://stackoverflow.com/q/26863260
tags question: http://stackoverflow.com/q/26898270
tags question: http://stackoverflow.com/q/26962482
tags question: http://stackoverflow.com/q/26909540
tags question: http://stackoverflow.com/q/26987407
tags question: http://stackoverflow.com/q/26913754
tags question: http://stackoverflow.com/q/26864529
tags question: http://stackoverflow.com/q/26845101
tags question: http://stackoverflow.com/q/26967265
tags question: http://stackoverflow.com/q/26920217
tags question: http://stackoverflow.com/q/26951141
tags question: http://stackoverflow.com/q/26991515
tags question: http://stackoverflow.com/q/26852333
tags question: http://stackoverflow.com/q/26910995
tags question: http://stackoverflow.com/q/26942492
tags question: http://stackoverflow.com/q/26885425
tags question: http://stackoverflow.com/q/26834288
tags question: http://stackoverflow.com/q/26911495
tags question: http://stackoverflow.com/q/26834835
tags question: http://stackoverflow.com/q/26922045
tags question: http://stackoverflow.com/q/26878466
tags question: http://stackoverflow.com/q/26954589
tags question: http://stackoverflow.com/q/26905333
tag name: express
tags question: http://stackoverflow.com/q/26835685
tags question: http://stackoverflow.com/q/26971234
tags question: http://stackoverflow.com/q/26908604
tags question: http://stackoverflow.com/q/26854207
tags question: http://stackoverflow.com/q/26912208
tags question: http://stackoverflow.com/q/26953617
tags question: http://stackoverflow.com/q/26970861
tags question: http://stackoverflow.com/q/26900758
type: Tag
tags question: http://stackoverflow.com/q/26874367
tags question: http://stackoverflow.com/q/26838960
tags question: http://stackoverflow.com/q/26935283
tags question: http://stackoverflow.com/q/26903806

http://stackoverflow.com/comment/42281815
comment on: http://stackoverflow.com/a/26860416
type: AnswerComment
type: Comment
has text: That's a bit strange, what happens? do you get an error message?
score: 0

http://stackoverflow.com/comment/42295830
type: QuestionComment
comment on: http://stackoverflow.com/q/26867709
has text: Please have a look @Xan on image
score: 0
type: Comment

http://stackoverflow.com/comment/42379143
comment on: http://stackoverflow.com/q/26915134
has text: Are you using bootstrap modals?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26930444
has title: Not able to set value for Dynamic Dropdown in Jquery mobile
has comment: http://stackoverflow.com/comment/42406585
answer count: 1
has comment: http://stackoverflow.com/comment/42406704
has comment: http://stackoverflow.com/comment/42406074
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42406855
tagged with: javascript
linked to: http://stackoverflow.com/q/26800685
tagged with: jquery
has comment: http://stackoverflow.com/comment/42406379
has comment: http://stackoverflow.com/comment/42406140
has answer: http://stackoverflow.com/a/26930784
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: I have created a dynamic layout in which it has dropdown which is populated dynamically from websql I had to set a value for that dropdown when I come back to the page that has dropdown as I am removing that layout it is not persisiting value I tried various ways but not able to do so instead I am getting blank value.the value that I have to set as selected from value. ansSet = questions[i].Question.Answers.Answer; var fieldSerCntrl; fieldSerCntrl = ' ' + ' ' + ' '; fieldSerCntrl = fieldSerCntrl + ' Select Option '; for (ansCnt = 0; ansCnt < ansSet.length; ansCnt++) { fieldSerCntrl = fieldSerCntrl + ' ' + ansSet[ansCnt].Description + ' '; console.log("ansCnt"+ansCnt); // $('#'+questions[i].Question.QuestionId).val($('#'+questions[i].Question.QuestionId 'option').eq(3).val()); } fieldSerCntrl = fieldSerCntrl + ' ' $("#QuestionsDesc").append(fieldSerCntrl); // $("#"+questions[i].Question.QuestionId 'option[value='+check_back[i]+']').attr('selected', true); I am new to jquery Could anyone suggest how to proceed.
score: 0
has comment: http://stackoverflow.com/comment/42406513

http://stackoverflow.com/comment/42351471
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/26899201
has text: Many thanks, it worked, I also realized that the logic was wrong in my code, I had to remove the else statement and leave it only in `var titulo = escape(this.title.$t); SelectedDates[key].push(titulo);` for it to work

http://stackoverflow.com/a/26873293
type: Answer
answers question: http://stackoverflow.com/q/26871068
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/42310115
has comment: http://stackoverflow.com/comment/42310339
downvote count: 0
has body: Well, assuming that you call LOGIN only once user clicks login button, here's the explanation. When you register $timeout, it will be removed once you refresh your browser. This is standard behaviour and just the way it all works in browser environment. That is - on a new page refresh, when user is already logged in, you no longer call login method. It means that you don't register your $timeout once again and after refresh, browser has no idea that you wanted to use it. One solution might be to change that code to register $timeout on every page load but taking further look at your code, you can set TokenExpireTime as a variable inside e.g localStorage and use it in somewhere else. Example assuming localStorage['expires'] is set. if (localStorage['expires']) { $timeout(function() { // do your thing, if you are not going to update model, keep 3rd parameter false, // otherwise skip it to prevent $digest cycle from running }, localStorage['expires'], false); } This is similar to bank sessions that logs you out after 15 minutes no matter what are you doing. If you want to reset timeout when user goes to a different page or just interacts with your app, you need to make that logic slightly more advanced by adding e.g. focus events. $(window).on('focusin', function() { // clear timeout, user is back in your app }); $(window).on('focusout', function() { // register timeout, user is away });
has comment: http://stackoverflow.com/comment/42324807

http://stackoverflow.com/comment/42232507
type: Comment
has text: require('load-grunt-tasks')(grunt) loads all tasks listed in my package.json.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26832998

http://stackoverflow.com/a/26846413
answers question: http://stackoverflow.com/q/26846252
score: 0
has body: after ajax success a new form will be generated with add station button that will use this code If you generate a new button you have to bind the click again after it is placed to the dom.
type: Answer

http://stackoverflow.com/comment/42377002
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26913546
has text: In this case, the best way is to create a directive, as [@BastienSander](http://stackoverflow.com/users/1361124/bastiensander) pointed out.

http://stackoverflow.com/a/26926606
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/42400228
has body: These are the issues I've identified: Issue 1 You're creating a responseText string, but you're not writing it to the output stream, so it will not be present in the response that is sent back to the client. At the end of your try block (in new.jsp), after doing responseText += OptionValue; you need to add out.print(responseText); Issue 2 Your button is of type submit, so it submits the form. This means that the page will be reloaded immediately after calling the AJAX request. Add return false to your onclick handler as follows: &lt;input type="submit" name="Submit" value="CREATE" onclick="create(textfield.value); return false;"/&gt; Or change your buttom from a submit button to a regular button: &lt;input type="button" name="Submit" value="CREATE" onclick="create(textfield.value)"/&gt; Issue 3 You need to declare var xmlHttp outside of your create method. As it is now, your stateChanged() method has no access to your xmlHttp variable.
has comment: http://stackoverflow.com/comment/42400787
answers question: http://stackoverflow.com/q/26926502
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26926502

http://stackoverflow.com/comment/97333310
comment on: http://stackoverflow.com/a/54977491
has text: what is that for?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/42259208
has text: Is it a .html-document or a .php-file?
comment on: http://stackoverflow.com/q/26848206
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42448752
type: AnswerComment
comment on: http://stackoverflow.com/a/26954363
type: Comment
has text: what you gave would be correct if only a single div has to be updated. but there are many divs, its like a social networking site. and number posts could be anything. so, i have to call the function for each post individually. :\
score: 0

http://stackoverflow.com/comment/42398902
type: Comment
has text: @ps2goat - Thanks! You're right. It looks like it was switching the order. I changed the way I'm pulling the data and it seems to work now. Thanks for the help!
comment on: http://stackoverflow.com/q/26924366
score: 0
type: QuestionComment

http://stackoverflow.com/q/26958451
type: Question
has answer: http://stackoverflow.com/a/26958596
has comment: http://stackoverflow.com/comment/42455952
tagged with: javascript
tagged with: variables
tagged with: scope
score: 0
answer count: 1
has body: Looking at this code it should produce output "TEST1"+"TEST2" however I get "TEST2" twice: function TEST1(){ var __construct = function () { this.box = { test_ : function () {console.log('TEST1')} }} __construct() } TEST1.prototype = {t: function(){ return box.test_()} } function TEST2(){ var __construct = function () { this.box = { test_ : function () {console.log('TEST2')} }} __construct() } TEST2.prototype = {t: function(){ return box.test_()}} var t1 = new TEST1() var t2 = new TEST2() t1.t() t2.t() If I rename "box" in second function I get correct output: function TEST2(){ var __construct = function () { this.box_ = { test_ : function () {console.log('TEST2')} }} __construct() } TEST2.prototype = {t: function(){ return box_.test_()}} Why is there this what appears a variable isolation issue?
has comment: http://stackoverflow.com/comment/42455852
accepted answer: http://stackoverflow.com/a/26958596
tagged with: constructor
has comment: http://stackoverflow.com/comment/42455849
linked to: http://stackoverflow.com/q/16063394
has comment: http://stackoverflow.com/comment/42456202
tagged with: object
type: AnsweredQuestion
has title: JavaScript variable isolation in constructors of separate objects

http://stackoverflow.com/a/26843291
downvote count: 0
has body: If you want to use binding you need a Polymer element or a <auto-binding> tag with a model that wraps your element. Now you can bind an attribute from the and to the same attribute in <some-element>.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42250851
type: Answer
accepted answer of: http://stackoverflow.com/q/26842518
score: 1
answers question: http://stackoverflow.com/q/26842518
upvote count: 1

http://stackoverflow.com/comment/42310242
comment on: http://stackoverflow.com/q/26875802
has text: @mallendeo I posted an answer below that addresses that.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/42457048
score: 0
type: AnswerComment
has text: I have already solved the problem. I added header("Access-Control-Allow-Origin: *") in the php file and it works like a charm. Thanks anyway for asking :)
type: Comment
comment on: http://stackoverflow.com/a/26957860

http://stackoverflow.com/q/26917988
has answer: http://stackoverflow.com/a/26921358
has body: Hi please I would like to create the same thing here at audio section, so when I type a name of a singer It will send me a Json data of that singer with all available tracks in soundcloud website throught its API. This is the code i'm trying right now: So as you can see the track ID is simple to get it from soundcloud API from this link: http://api.soundcloud.com/tracks/13158665.json?client_id=YOUR_CLIENT_ID but what I want is getting these IDs of a specific singer passed as parameter to a function, all with Javascript please else with PHP.
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/26921358
upvote count: 1
type: Question
has title: Soundcloud Api - get track by singer
has comment: http://stackoverflow.com/comment/42387350
tagged with: javascript
tagged with: soundcloud
answer count: 1
downvote count: 0
favorite count: 0
tagged with: php

http://stackoverflow.com/q/26903355
upvote count: 17
has answer: http://stackoverflow.com/a/26904293
tagged with: d3.js
possible better answer: http://stackoverflow.com/a/43378963
type: AnsweredQuestion
downvote count: 0
score: 17
tagged with: transition
type: Question
has answer: http://stackoverflow.com/a/43378963
has title: How to cancel scheduled transition in d3?
tagged with: javascript
has body: Transition Code, d3.select('chart').select('svg') .selectAll("circle") .data(sampleData) .enter().append('circle') .each(function (d,i) { d3.select(this) .transition() .delay(i*50) .attr('cx', function(d) {return d.x;}) .attr('cy', function(d) {return d.y;}) .attr('r', 4); }); How can I stop/cancel the scheduled/delayed transactions?
has answer: http://stackoverflow.com/a/26905771
accepted answer: http://stackoverflow.com/a/26905771
favorite count: 0
answer count: 3

http://stackoverflow.com/q/26874312
score: 0
upvote count: 1
downvote count: 1
possible better answer: http://stackoverflow.com/a/26874389
tagged with: string
has comment: http://stackoverflow.com/comment/42306750
has comment: http://stackoverflow.com/comment/42306515
favorite count: 0
has comment: http://stackoverflow.com/comment/42306844
has comment: http://stackoverflow.com/comment/42306573
type: AnsweredQuestion
has title: Unable to slice strings retrieved from div's
tagged with: slice
has body: I'm having trouble slicing text I retrieved from a div with javascript/jquery. I thought you could slice every string and that the .text() function always returned a string so I fail to see the problem. Any help will be greatly appreciated! Fiddle Html: Div 1 :55% Div 2 :60% Div 3 :64% Div 4 :76% Div 5 :63% Javascript: $(function () { var divs = {}; var tempString, vakken = {}; $('.vaknaam').each(function (key, value) { tempString = $(value).contents().filter(function () { return this.nodeType == 3; }).text(); tempString = tempString.slice(0, - 2); vakken[tempString] = $(value).children('span').text(); }); for (var property in vakken) { $('body').append(" " + property + " "); } });
type: Question
has comment: http://stackoverflow.com/comment/42306824
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26874540
accepted answer: http://stackoverflow.com/a/26874540
has answer: http://stackoverflow.com/a/26874389
has comment: http://stackoverflow.com/comment/42306619

http://stackoverflow.com/q/26837489
score: -3
tagged with: php
has title: How to sign in directly from link?
upvote count: 0
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/26837533
has body: How may i able to signin the account from 'Test Link' by providing Username and Password. So once test link clicked then we are already logged in. eg- &lt;a href="https://www.usps.com/"&gt; Test Link &lt;/a&gt;
tagged with: javascript
has answer: http://stackoverflow.com/a/26837763
downvote count: 3
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/42442536
type: Comment
comment on: http://stackoverflow.com/a/26950673
has text: so just change 150 to -150
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42240412
type: AnswerComment
score: 0
type: Comment
has text: no luck bro when first check checkbox and then input all textbox after populated input box it doesn't enable button.
comment on: http://stackoverflow.com/a/26837394

http://stackoverflow.com/q/26985265
possible better answer: http://stackoverflow.com/a/27004657
linked to: http://stackoverflow.com/q/6995941
has answer: http://stackoverflow.com/a/27004657
has comment: http://stackoverflow.com/comment/42504297
has title: How to dynamically load one dropdown by selecting another dropdown (without AJAX) in Grails
has answer: http://stackoverflow.com/a/26985347
type: AnsweredQuestion
tagged with: grails
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/26985347
tagged with: javascript
score: 0
has body: I'm trying to avoid using AJAX to improve on performance so I only load the lists (sets) of values once for a dropdown field (Child). This Child field will be populated dynamically based on the selection of another dropdown field (Parent). I want to load the values as a javascript variable that will be assigned to the Child based on the selected value of the Parent. These values will be written as part of the html (gsp) output. Any suggestions?
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/42335685
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26890779
has text: What is $(this).data('target')? An element id? If yes, does it already containt the hash symbol?
score: 0

http://stackoverflow.com/comment/42358783
type: Comment
has text: are you appending to your parent view?
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/26903562

http://stackoverflow.com/comment/42465962
comment on: http://stackoverflow.com/a/26963959
type: AnswerComment
has text: The time of usage in this case is when you create the string, so it actually does get the value of the variable at the time of usage. I can't think of any language in which a similar pattern would yield a different result.
type: Comment
score: 1

http://stackoverflow.com/q/26979083
score: 1
tagged with: java
upvote count: 1
tagged with: tomcat6
type: Question
has answer: http://stackoverflow.com/a/26982449
has title: net::ERR_CONNECTION_RESET with Tomcat 6
tagged with: intellij-idea
tagged with: javascript
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/26982449
tagged with: tomcat
favorite count: 0
has body: I just setup a Tomcat 6 instance in IntelliJ using Maven and an exploded WAR. The WAR deploys, and the Java classes are clearly loading and are debuggable. For some reason, loading js files is incredibly buggy. I keep getting net::ERR_CONNECTION_RESET errors from Chrome and the outcome is the same on other browsers (the pages incompletely load, with js files not being loaded because of net::ERR_CONNECTION_RESET errors). Even if I do direct links to the files (say localhost:8080/somejavascriptfile.js) and keep hitting refresh, half the time it'll just come up empty, half the time it will load. I've looked at other solutions and people keep saying I need to do something similiar to this response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1. response.setHeader("Pragma", "no-cache"); // HTTP 1.0. response.setDateHeader("Expires", 0); // Proxies. But that has had no effect. Any suggestions?
type: AnsweredQuestion

recursion
type: Tag
tags question: http://stackoverflow.com/q/26872182
tags question: http://stackoverflow.com/q/26935407
tags question: http://stackoverflow.com/q/26836808
tag name: recursion
tags question: http://stackoverflow.com/q/26876401
tags question: http://stackoverflow.com/q/26872083
tags question: http://stackoverflow.com/q/26969564
tags question: http://stackoverflow.com/q/26876497
tags question: http://stackoverflow.com/q/26866172
tags question: http://stackoverflow.com/q/26861471
tags question: http://stackoverflow.com/q/26935825
tags question: http://stackoverflow.com/q/26912464
tags question: http://stackoverflow.com/q/26940845
tags question: http://stackoverflow.com/q/26932255
tags question: http://stackoverflow.com/q/26937329

http://stackoverflow.com/q/26918546
has answer: http://stackoverflow.com/a/26918772
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26918772
has body: I have an array of pairs of amounts and currencies. The latter not just 'USD' or 'EUR', but is an object that contains formatting rules for that currency. I've written a filter for formatting the amount, but it only works if I hard code the formatting arguments: // arguments: currency symbol, is symbol prefix, decimal symbol, digit group symbol {{ entry.amount | currency24: '$',true,'.',',' } //USD example {{ entry.amount | currency24: '€',false,'.',',' } //EUR example What I'd like to be able to do is put the whole object in there like so: // currency object holds all the formatting parameters, but I could just as well pass them one by one How can I achieve this? EDIT: entry is not a part of $scope. It come from an ng-repeat: ng-repeat="entry in entries" That's why I'm having problems passing it to a filter.
type: AnsweredQuestion
tagged with: angularjs-filter
downvote count: 0
score: 1
favorite count: 0
tagged with: angularjs
type: Question
has title: How to pass non-scope variables to AngularJS filter?
has comment: http://stackoverflow.com/comment/42385737
upvote count: 1
answer count: 1

http://stackoverflow.com/comment/42503995
has text: @ArpitSrivastava, i expect the AJAX success function to receive data in form of: `code` { redirect: "/tutor-profile-form?first_name=test&last_name=test" }
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26967265
score: 0

http://stackoverflow.com/comment/42383235
type: QuestionComment
comment on: http://stackoverflow.com/q/26866708
has text: You would need to make a `min-width` CSS property to keep that from happening. Check out @JoshBurgess's answer.
score: 0
type: Comment

http://stackoverflow.com/comment/42451485
score: 0
type: Comment
type: QuestionComment
has text: @webkit: I can't remove the slashes as the paths i get are absolute path from server. Even if i remove the slashes from beginning or end, slashes in between can't be removed, and it fails in second case when the last word will have extra characters.
comment on: http://stackoverflow.com/q/26955755

http://stackoverflow.com/comment/42533980
comment on: http://stackoverflow.com/a/26984927
score: 0
type: AnswerComment
type: Comment
has text: Which I've tried following above, but got me no where :( Do you understand it (the docs) any better?

http://stackoverflow.com/comment/42496823
type: QuestionComment
has text: SO if i have 12 menu items the isActive is called 24 times? Where i can learn this behaviour on angularjs doc?
type: Comment
comment on: http://stackoverflow.com/q/26980797
score: 0

http://stackoverflow.com/comment/42284144
type: Comment
type: QuestionComment
score: 2
has text: $('#sidebar-container').show() ll solve your problem
comment on: http://stackoverflow.com/q/26861990

http://stackoverflow.com/comment/42295036
has text: I structure my code better, removed unnecessary functions and that made it work. I did like you showed and put the `slideToggle` function on `$(document).ready(function(){` instead of an other function. Thanks for your help!
comment on: http://stackoverflow.com/a/26866921
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42329886
score: 0
comment on: http://stackoverflow.com/q/26887264
type: QuestionComment
type: Comment
has text: the variables are created so it is not possible to have a value in them earlier

http://stackoverflow.com/a/26934884
has comment: http://stackoverflow.com/comment/42414682
answers question: http://stackoverflow.com/q/26933961
score: 3
downvote count: 0
has body: Define the XPage you want to open a form with in forms properties: This way your URL http://server/database/0/...UNID...?OpenDocument will work.
type: AcceptedAnswer
upvote count: 3
accepted answer of: http://stackoverflow.com/q/26933961
type: Answer

http://stackoverflow.com/comment/42396862
type: Comment
type: QuestionComment
has text: I was able to do it pretty simple with ngAnimate - http://plnkr.co/edit/yUPS3Pb8Z3ErKRD9KNix?p=preview
score: 0
comment on: http://stackoverflow.com/q/26922374

http://stackoverflow.com/comment/42407175
type: QuestionComment
comment on: http://stackoverflow.com/q/26930605
has text: You need to put everything into `$(function(){})` and get rid of inline `onchange` thing when using jquery. That's all you need to make it work
score: 0
type: Comment

http://stackoverflow.com/q/26881084
type: UnansweredQuestion
tagged with: php
tagged with: codeigniter
has answer: http://stackoverflow.com/a/26891852
type: Question
has body: I am using Codeigniter .I want to print billing details of customers on a web using thermal printer.how can I print billing details using php/javascript/jquery .Is there any simulator to test this?. Any one please help me..
tagged with: javascript
tagged with: jquery
score: 0
has title: Printing onThermal printer
tagged with: printing
answer count: 1

http://stackoverflow.com/a/26898484
has comment: http://stackoverflow.com/comment/42350462
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/26898378
has body: Just add this: if(days &lt; 10){days = "0" + days;} if(hours &lt; 10){hours = "0" + hours;} if(minutes &lt; 10){minutes = "0" + minutes;} if(seconds &lt; 10){seconds = "0" + seconds;} before this: // format countdown string + set tag value countdown.innerHTML = days + " : " + hours + " : " + minutes + " : " + seconds + " ";
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26898378
upvote count: 2

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

http://stackoverflow.com/comment/42449161
score: 0
type: Comment
has text: Appreciate the answer. However, this is not as optimal as the idea I posted, setting one call to window.setTimeout outside of the callback with a timeout of 0, which is much faster.
type: AnswerComment
comment on: http://stackoverflow.com/a/26954661

http://stackoverflow.com/q/26908170
tagged with: google-chrome
type: Question
tagged with: javascript
has title: Show on Chrome Extension Popup a late window variable
score: 0
answer count: 1
tagged with: jquery
has body: I am still learning about all the Chrome Extension scheme, with background/content/popup scripts. I have a page that runs some script on $(document).ready() and it sets a new variable in the window, that i can access in the website like "window.newVariableHere". I want to be able to echo the content of this variable whenever i open the Extension popup. I tried, in the popup.js (which is being called in my popup.html) do a: chrome.extension.getBackgroundPage() But it wont show the new variable (that i am sure it was created). Any ideas on a better way to do this? Thanks for all the ideas
has answer: http://stackoverflow.com/a/26908270
type: UnansweredQuestion
tagged with: google-chrome-extension
linked to: http://stackoverflow.com/q/26140443

http://stackoverflow.com/comment/42491850
comment on: http://stackoverflow.com/a/26978456
type: AnswerComment
has text: In fact this answer is more generic so it should be accepted.
score: 0
type: Comment

http://stackoverflow.com/q/26870013
tagged with: css
has body: Is it possible to use html5, css and javascript to open an android application? I searched online but none of the answers I found so far where usefull for me. Im trying to create an android app made in html and css and act like an android launcher. The layout is done but I cant find out how I can actualy launch apps with it. edit: I used phonegap to create the apk and installed it on my phone.
downvote count: 2
upvote count: 1
has title: Opening an android app with html code
has answer: http://stackoverflow.com/a/26870143
type: Question
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/26870072
answer count: 2
favorite count: 0
type: UnansweredQuestion
tagged with: android
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/26942978
favorite count: 0
has title: Menu won't slide back up once user go to new page
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42466386
has answer: http://stackoverflow.com/a/26943104
tagged with: menu
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/42429216
has body: I'm creating a web app that has a custom responsive menu. It's just your basic three list-item menu dropdown. When user clicks "hamburger" icon, it slides down. When they click on the "X", it slides up. The problem having is that when the user clicks the "hamburger" icon in the mobile menu's closed state and then they click another link on the page outside of the mobile menu, the menu stays in its open/slid down state and becomes unusable unless the user reloads the page. What do I need to put in my JS function or my CSS to prevent this behavior? I appreciate the help. The code: HTML: About Terms Help About Terms Help CSS (only the relevant stuff): .home-header-content__nav--menu { @media (max-width: $site-screen__iphone5s--landscape + 1px) { display: none; } } .home-header-content__nav--mobile-menu { display: none; text-align: right; position: relative; .fa { font-size: 28px; &:hover { color: $site-color__secondary; @include transition(0.2s ease-in); cursor: pointer; } } .fa-times { display: none; } ul { text-align: right; font-weight: 700; position: absolute; top: 40px; right: 0px; background-color: $site-color__secondary; border-radius: 5px; padding: 10px 10px 10px 20px; font-size: 18px; } a { color: $site-color__white; &:hover { color: $site-color__secondary--darker; } } @media (max-width: $site-screen__iphone5s--landscape) { display: inline-block; } } Javascript: $(function responsiveHomeMenu(){ // Store content nodes in DOM var $menuIcon = $('.home-header-content__nav--mobile-menu .fa'); var $menuList = $('.home-header-content__nav--mobile-menu ul'); // Hide menu links by default $menuList.hide(); // Toggle menu with icon $menuIcon.on("click", function(e){ $menuIcon.toggle(); $menuList.slideToggle(300); $(document).off("click",function(){ $menuList.toggle(); }) }); });
type: Question
downvote count: 0
has comment: http://stackoverflow.com/comment/42429227
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/42466376
tagged with: jquery

fullpage.js
tags question: http://stackoverflow.com/q/26980147
tags question: http://stackoverflow.com/q/26986136
tag name: fullpage.js
tags question: http://stackoverflow.com/q/26957560
tags question: http://stackoverflow.com/q/26849126
type: Tag

http://stackoverflow.com/q/26865457
upvote count: 4
has title: Should numbers be avoided in Javascript function names?
favorite count: 0
accepted answer: http://stackoverflow.com/a/26865574
has answer: http://stackoverflow.com/a/26865544
has answer: http://stackoverflow.com/a/26865678
has body: I heard from a JS developer recently that you should avoid using numbers inside function names. For example: function test1test() { // function body } I've never come across this before so I was wondering if it's true? If so, why?
answer count: 4
type: AnsweredQuestion
score: 3
downvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/26865694
has comment: http://stackoverflow.com/comment/42290404
has answer: http://stackoverflow.com/a/26865574
has answer: http://stackoverflow.com/a/26865694
tagged with: javascript
has comment: http://stackoverflow.com/comment/42452851
has comment: http://stackoverflow.com/comment/42291316
has comment: http://stackoverflow.com/comment/42290189

http://stackoverflow.com/q/26836568
type: Question
has answer: http://stackoverflow.com/a/26836743
tagged with: arrays
possible better answer: http://stackoverflow.com/a/26836649
tagged with: javascript
has answer: http://stackoverflow.com/a/26836649
has body: I have a loop which I want to compile an object for the frontend. The loop sets a user, hours and timestamp variable from which I want to dynamically create the new object. This is what I have so far which does not work as it obviously just replaces the user. Any help would be great as the best way to go about this, thanks. var Things = { /* big dump of data */ }; var usersHours = {}; for (var i = Things.length - 1; i &gt;= 0; i--) { var user = Things[i].user; var hours = Things[i].hours; var timeStamp = Things[i].timeStamp; var hoursAdd = {}; hoursAdd[timeStamp] = hours; usersHours[user] = hoursAdd; }; // example of wanted final output var usersHours = { user1 : { 1406178757855 : 10:00, 1406178743473 : 04:00, 1406178759600 : 04:44 }, user2 : { 1406178475847 : 01:30, 1406193847384 : 07:00, 1406984783487 : 08:44 }, user3 : { 1406173847787 : 01:40, 1406139847873 : 07:14, 1406183748374 : 08:34 } }
answer count: 2
accepted answer: http://stackoverflow.com/a/26836743
has title: Javascript - Add multiple dynamic values to dynamic key in for loop
has comment: http://stackoverflow.com/comment/42239030
tagged with: javascript-objects
has comment: http://stackoverflow.com/comment/42238887
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
score: 0

http://stackoverflow.com/a/26893873
has body: You would need to change the orderBy, not the filter. Maybe doing a function instead of a property on the orderBy would achieve the desired effect. Possibly something like $scope.typeAheadModel = ''; $scope.orderByPriority = function (element) { return element.name.indexOf($scope.typeAheadModel); } And in your HTML add an ng-model on your input ng-model="typeAheadModel" typeahead="element.name for element in someObject.elements | filter:{name:$viewValue} | orderBy:orderByPriority edit Here's a plunkr of it, for some reason it doesn't do it properly when you type in just "f", but once you type in "fo" it orders it correctly. Not sure why.
answers question: http://stackoverflow.com/q/26893711
has comment: http://stackoverflow.com/comment/42384430
has comment: http://stackoverflow.com/comment/42342070
has comment: http://stackoverflow.com/comment/42441795
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/42410814
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/64654107

http://stackoverflow.com/q/26916089
downvote count: 1
has answer: http://stackoverflow.com/a/27393042
type: AnsweredQuestion
tagged with: wordpress
type: Question
has title: Dropdown Menus work only on Homepage, in Chrome
upvote count: 0
tagged with: javascript
tagged with: jquery
score: -1
accepted answer: http://stackoverflow.com/a/27393042
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I have Created a WordPress theme, and ran into a weird issue recently. Probably, after some Google Chrome Update. The issue is: the dropdown, after hovering on certain items on menu, appears only on homepage. It doesn't appear on any other page. Although, its there in the source code. Demo -> inkhive I have investigated Javascript which triggers the dropdown: jQuery('#site-navigation li').find('ul').hide(); jQuery('#site-navigation li').hover( function(){ jQuery(this).find('&gt; ul').slideDown('fast'); }, function(){ jQuery(this).find('ul').hide(); }); The Javascript is doing its job, verified from Inspect Element. Can Anyone help me understand or figure out the issue?
has comment: http://stackoverflow.com/comment/42381059
favorite count: 0
tagged with: css

http://stackoverflow.com/q/26920649
has title: Javascript World Clock Only Shows in Table
linked to: http://stackoverflow.com/q/3486198
type: AnsweredQuestion
has body: I am trying to display times from a few different cities around the world, and I have searched and Google'd and even used the answer found here: World Clock API in php or in javascript, but the clocks will only display in a table. I used this website's tutorial: http://www.proglogic.com/code/javascript/time/worldclock.php (among others. This one seemed the most straight forward.). I am trying to get it to display in my nav bar, similar to this page: https://www.blackcard.com/, so a table does not seem like the way to go. Of course, I may be wrong. Also, I am using Bootstrap, if that matters at all. Let me know if you all have any ideas. Thanks!
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/26921514
favorite count: 0
type: Question
tagged with: twitter-bootstrap
answer count: 1
accepted answer: http://stackoverflow.com/a/26921514
upvote count: 1
tagged with: javascript

http://stackoverflow.com/a/26887080
has comment: http://stackoverflow.com/comment/42330801
has body: To remove an item from Firebase, you will need to know its name(), which is automatically generated for you when you call push() to add a new item to Firebase. So you will need to bind the name to the scope: $scope.providers.push({ name: snapshot.name(), title: snapshotVal.title }); You then pass this name into your call to removeProvider from your HTML: {{ provider.title }} Remove And use it to call remove on Firebase: $scope.removeProvider = function(name) { providersRef.child(name).remove(); }; As @SharpieOne already commented, this and many other things are automatically handled for you if you use the AngularFire library (and in this case specifically its $asArray() method).
type: AcceptedAnswer
upvote count: 6
downvote count: 0
has comment: http://stackoverflow.com/comment/42331090
has comment: http://stackoverflow.com/comment/42330581
type: Answer
score: 6
answers question: http://stackoverflow.com/q/26878682
accepted answer of: http://stackoverflow.com/q/26878682
has comment: http://stackoverflow.com/comment/42333599

http://stackoverflow.com/comment/42248323
comment on: http://stackoverflow.com/q/26841796
type: Comment
type: QuestionComment
score: 0
has text: you are writing `$('#photo-update'+currentImgCnt).click();` but there is no `.click()` event for `#photo-update` in jquery in jsfiddle..

http://stackoverflow.com/comment/42416357
has text: What if you put `alert('test');` before the ajax call? Do you see the alert?
comment on: http://stackoverflow.com/q/26935884
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42352570
type: Comment
comment on: http://stackoverflow.com/a/26899775
score: 0
type: AnswerComment
has text: Thank you @David Thomas for the suggestion.

http://stackoverflow.com/comment/42420040
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26937839
has text: I know that is the error you got...Click on the error and it takes you right to the line I changed.
score: 0

http://stackoverflow.com/comment/42409416
score: 0
type: AnswerComment
has text: Noitidart, could you please detail "If you enable all the developer preferences though it should put out a long string in error console which shows what line it came from."? Could you please directly add it to my answer? Your input will make a better answer.
comment on: http://stackoverflow.com/a/26902012
type: Comment

http://stackoverflow.com/comment/42316965
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26880249
has text: It looks like the name of the property is `0_id` not `_id`
score: 0

http://stackoverflow.com/comment/42324488
has text: There is an easier way. Why do not you create a class? Something like .margin-auto and search by all these elements?
score: 0
comment on: http://stackoverflow.com/q/26884654
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26941385
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/26941584
has comment: http://stackoverflow.com/comment/42426655
answer count: 3
has comment: http://stackoverflow.com/comment/42426595
has comment: http://stackoverflow.com/comment/42426610
favorite count: 0
type: AnsweredQuestion
upvote count: 2
has answer: http://stackoverflow.com/a/26941492
has comment: http://stackoverflow.com/comment/42426628
downvote count: 1
has answer: http://stackoverflow.com/a/26941584
type: Question
possible better answer: http://stackoverflow.com/a/26941511
score: 1
has answer: http://stackoverflow.com/a/26941511
has body: I'm dynamically creating an image via javascript like this: var dragimg = null; function createImage(g) { dragimg = document.createElement("img"); dragimg.src = "link/to/image.png"; dragimg.style.width = "50px"; dragimg.style.position = "absolute"; dragimg.style.zIndex = 100; $("body").prepend(dragimg); } After creating the Image, I want to remove it at some point by calling this function: function removeImage() { dragimg.remove(); } This works well in Chrome, Firefox &amp; Opera. However, it doesn't work in Internet Explorer 11. I'd also like to point out I have an document.onmousemove function set which manipulates the left and top attribute of the created image when the mouse moves. This works well in all browsers - but I'm not sure if it has something to do with the remove-problem. I've also tried to remove the image by dragimg.parentNode.removeChild(dragimg), but same result.
has title: JS: Can't remove created Element in IE

http://stackoverflow.com/comment/42315170
score: 0
type: AnswerComment
has text: We ended up implementing this methodology and it works for us for now. Thanks!
type: Comment
comment on: http://stackoverflow.com/a/26874122

http://stackoverflow.com/comment/42350045
has text: since JSON stands for JavaScript Object Notation so it is a subset of javascript it should validate it normally. Maybe because json is used to exhange data through servers side (php, asp) where .01 values are not valid
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26898431

http://stackoverflow.com/a/26877057
answers question: http://stackoverflow.com/q/26876806
downvote count: 0
has comment: http://stackoverflow.com/comment/42312771
type: Answer
upvote count: 1
has body: Uff.. when you place the marker you already have it's position. This position: location contains the position of your marker. In case you somehow need that position you can access it through there or you can do marker.getPosition(). I've updated your fiddle here. Note: 'k' is lowercase, 'A' is uppercase - in the getPosition() returned object.
score: 1

http://stackoverflow.com/q/26947655
tagged with: instafeedjs
type: AnsweredQuestion
has title: Sort images by most recent and filter for images with likes > x
has body: In instafeed.js, I have the ability to sortBy tagged pictures either by most-liked or most-recent. Those options are mutually exclusive. I am trying to find a middle ground to do both. I would like to sort by most-recent and then display those that have likes &gt; x amount. How can I achieve this in instafeed.js? var feed = new Instafeed({ target: 'instafeed', get: 'tagged', tagName: 'dog', limit: '10', sortBy: 'most-recent', resolution: 'standard_resolution', clientId: 'xxxxx', template:'&lt;div class="tile"&gt;&lt;div class="text"&gt;&lt;b&gt;{{likes}} &amp;hearts; &lt;/b&gt;{{model.user.full_name}}&lt;/div&gt;&lt;img class="item" src="{{image}}"&gt;&lt;/div&gt;', filter: function(image) { //filter for recent images with most like } });
type: Question
has answer: http://stackoverflow.com/a/26948279
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
tagged with: instagram
accepted answer: http://stackoverflow.com/a/26948279

http://stackoverflow.com/q/26861753
has comment: http://stackoverflow.com/comment/42305497
has answer: http://stackoverflow.com/a/26862360
has title: how to display a div for an empty textarea?
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26861888
has comment: http://stackoverflow.com/comment/42283796
favorite count: 0
has comment: http://stackoverflow.com/comment/42283829
has answer: http://stackoverflow.com/a/26862544
accepted answer: http://stackoverflow.com/a/26862544
type: AnsweredQuestion
has body: I want to raise a DIV, when someone click the 'Submit' button leaving the textarea empty. Here is my form: http://pastebin.com/1K3Ci9QA Please, help me.
possible better answer: http://stackoverflow.com/a/26861888
type: Question
upvote count: 2
downvote count: 2
tagged with: javascript

http://stackoverflow.com/a/26950776
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26944858
type: Answer
upvote count: 3
has body: Publishing a Google Add-on is a different processes to publishing a Chrome Web Store extension. Add-ons are also only in developer preview. This doesn't stop you publishing an add-on but it means that it first must be approved by Google. This page contains a form for submitting your add-on for approval as well as other information about the publication process.
score: 3
accepted answer of: http://stackoverflow.com/q/26944858

http://stackoverflow.com/a/26895992
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/26895597
answers question: http://stackoverflow.com/q/26895597
has body: I am guessing as to what you actually want, but it seems that you want the page to populate with whatever friends are currently in the database on first load, and then when you click add-order button, it adds new friends and updates your list. The first thing is that you are trying to POST to the learncode name, which you can't do. Change where it says "yourname" in the URLs below to something else. Here is what you should do:

http://stackoverflow.com/comment/42298367
type: QuestionComment
comment on: http://stackoverflow.com/q/26869426
score: 0
has text: The output in childfilm.php shouldn't be an option list, should it?
type: Comment

http://stackoverflow.com/a/26859208
has body: You can use json_encode and then just put it in your view code. PHP: $contents = json_encode($contents); and then in your javascript: &lt;script&gt; var content = &lt;?=$contents; ?&gt;; &lt;/script&gt;
score: 1
answers question: http://stackoverflow.com/q/26859159
has comment: http://stackoverflow.com/comment/42279430
accepted answer of: http://stackoverflow.com/q/26859159
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42279552
type: Answer
has comment: http://stackoverflow.com/comment/42279460
upvote count: 1

http://stackoverflow.com/a/26955388
accepted answer of: http://stackoverflow.com/q/26954915
answers question: http://stackoverflow.com/q/26954915
type: Answer
has body: What you need is to use $broadcast rather than $emit. you put listeners on $rootScope, whenever a controller is destroyed it's scope is destroyed too thus all it's scope listeners are removed automatically, but when you put the listeners on $rootScope you need to manually remove them. what happens in your code is that you attach one listener to $rootscope with each route change without removing the previous listeners. If you'll use the controller's local $scope you don't have to do anything. This is probably what you need (plunker): app.controller('MainCtrl', function($scope, $location, $rootScope, $timeout) { $scope.navigate = function() { var route = location.href.indexOf('index') &gt; -1 ? 'package' : 'index'; $location.path('/' + route); // $location.path happens only after the digest cycle so we must wait for it.. $timeout(function() { $rootScope.$broadcast('navigate'); }); }; }); app.controller('viewIndexCtrl', function($scope, $rootScope) { $scope.$on('navigate', function(e) { console.log('event reached index'); }); }); app.controller('viewPackageCtrl', function($scope, $rootScope) { $scope.$on('navigate', function(e) { console.log('event reached package'); }); });
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/42466588
comment on: http://stackoverflow.com/q/26964171
score: 0
type: Comment
has text: made a tiny solution, it was replacing everything after the main portion of the url, with what i had in there. so it was mineclicker.weebly.com/mineclicker.weebly.com/mineclicker.html. so i just changed the window.open to mineclicker.html and it works fine now. so long story short, i shouldn't have called a function, from another function, that was called before the first function was initialized haha. lesson learned
type: QuestionComment

http://stackoverflow.com/comment/42284602
has text: @JamesThorpe you're right! it's only for chrome. Firefox triggers both `foo()` and closes the dialog. I'm running Ubuntu and I'm too lazy to run a VM to check IE, but I'm assuming it'll be like FF
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26861939

http://stackoverflow.com/q/26841012
linked to: http://stackoverflow.com/q/156686
type: Question
has answer: http://stackoverflow.com/a/26841096
tagged with: javascript
has answer: http://stackoverflow.com/a/26841099
upvote count: 2
answer count: 2
tagged with: jquery
favorite count: 0
has body: I try to make a image download button that works correctly in all browsers(ie8+) and i try this codes: Download and Download according to this question
tagged with: download
has title: create image download button support all browsers
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 2
downvote count: 0

http://stackoverflow.com/q/26899973
downvote count: 0
accepted answer: http://stackoverflow.com/a/26900164
favorite count: 0
type: AnsweredQuestion
score: 7
upvote count: 7
has answer: http://stackoverflow.com/a/26900164
type: Question
has answer: http://stackoverflow.com/a/26900062
has body: I'm in the process of experimenting with transitioning an existing web app from knockout to react js. As it stands the application establishes a websocket connection to the server and receives update asynchronously (there can be many clients which can affect each others state, think chat room for example). My Question is, if I were do the rendering server side, how could changes be pushed down to each client? I've only just started reading up on rendering on the server so I may be misunderstanding how it works but the way I believe: Client performs an action which is sent to the server, server responds with an html fragment which the client then replaces into it's DOM In the case of an app where the state can be changed by either the server or another client, would I still be forced to use websockets/http polling to show these updates? Is it possible for the server to push down new fragments otherwise?
has title: React server-side rendering without polling for changes
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26900062
tagged with: reactjs
answer count: 2
tagged with: websocket

http://stackoverflow.com/comment/42418832
type: Comment
comment on: http://stackoverflow.com/q/26910980
score: 0
has text: After many hours attemting to fix the problem I found this question http://stackoverflow.com/questions/23695239/primefaces-5-overlaypanel-broken-after-update based on that I switched from version 5.1 to 4 and this works, so is a primefaces bug. I don´t think in this like a answer for the question. @BalusC how I should mark this question?
type: QuestionComment

http://stackoverflow.com/q/26888747
has body: I have a list/link on a page When I click a list/link item, I want to load div content from other pages into a div on the main page. I known that this can be done by hardcoding like below. Home Work Contact function load() { $("#main2").load("home.html #title"); } Instead of this is it possible to pass the .html in as a parameter? Something like Home function load(url) { $("#main2").load( + url + "#title"); } Thanks for any help and apologies for the noob question :)
accepted answer: http://stackoverflow.com/a/26888896
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42331774
has answer: http://stackoverflow.com/a/26888896
downvote count: 1
possible better answer: http://stackoverflow.com/a/26888836
type: Question
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
has title: How can I load div content from html pages into a div on main page?
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/26888836

http://stackoverflow.com/q/26967549
score: 0
answer count: 1
has body: I am receiving the follow error in my Console : " Uncaught TypeError: undefined is not a function " &lt;script&gt; //name : calculateResult()--&gt; function calculateResult() { console.log("calculateResult() function called!"); //1. Declare Variables--&gt; var hoursWorked, jobCategory, jobCategorySelectedIndex, hoursEligibleForBasePay, hoursEligibleForOvertime, basePayAmount, overtimePayAmount, totalPayAmount, overtimePayRate; //2. Values for Local Variables--&gt; hoursWorked = document.getElementById("txthoursWorked").value; console.log("hoursWorked = " + hoursWorked); //Get Select element choice: Job Category--&gt; jobCategorySelectedIndex = document.getElementById("seljobCategory").selectedIndex; console.log("jobCategorySelectedIndex = " + jobCategorySelectedIndex); jobCategory = document.getElementById("seljobCategory").options[jobCategorySelectedIndex].value; console.log("jobCategory = " + jobCategory); //3. Do Calculations--&gt; hoursWorked = parseFloat(hoursWorked); if (jobCategory == "M") { basePayRate = "25"; } else if (jobCategory == "R") { basePayRate = "20"; } else if (jobCategory == "S") { basePayRate = "15"; } hoursEligibleForBasePay = 40; basePayAmount = basePayRate * hoursEligibleForBasePay; console.log("basePayAmount = " + basePayAmount); console.log("hoursEligibleForOvertime =" + hoursEligibleForBasePay); if (hoursWorked &gt; 40) { hoursEligibleForOvertime = hoursWorked - 40; } else { hoursEligibleForOvertime = 0; } console.log("hoursEligibleForOvertime = " + hoursEligibleForOvertime); overtimePayRate = 1.5 * basePayRate; overtimePayAmount = overtimePayRate * hoursEligibleForOvertime; totalPayAmount = basePayRate + overtimePayAmount; console.log("overtimePayRate = " + overtimePayRate); console.log("overtimePayAmount = " + overtimePayAmount); console.log("totalPayAmount = " + totalPayAmount); //4. Display Results--&gt; displayString = "Base Pay " + "$" + basePayAmount.toFixed(2) + "&lt;br /&gt;" + "Overtime Pay &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbs…
has comment: http://stackoverflow.com/comment/42471848
type: UnansweredQuestion
tagged with: undefined-function
has title: Cannot call toFixed on a number variable
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/26968056

http://stackoverflow.com/comment/42346057
comment on: http://stackoverflow.com/q/26896291
type: Comment
type: QuestionComment
has text: Since `.mySelects` isn't available on DOM load, you need to delegate your `click` event.
score: 4

http://stackoverflow.com/comment/42429271
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26943036
score: 0
has text: In a word, you can't. An async function is async. Your function will return long before the actual results are even available. You MUST learn to program in an async fashion. The results will ONLY be delivered in a callback, not in a return value. I'd suggest you read and study [this answer](http://stackoverflow.com/a/14220323/816620) which shows you the options.

http://stackoverflow.com/q/26952040
has answer: http://stackoverflow.com/a/26952511
favorite count: 0
has comment: http://stackoverflow.com/comment/42444775
has comment: http://stackoverflow.com/comment/42445351
has comment: http://stackoverflow.com/comment/42445645
accepted answer: http://stackoverflow.com/a/26952511
has comment: http://stackoverflow.com/comment/42445371
answer count: 1
has comment: http://stackoverflow.com/comment/42444795
has comment: http://stackoverflow.com/comment/42445535
tagged with: angularjs
upvote count: 1
has comment: http://stackoverflow.com/comment/42445451
type: AnsweredQuestion
has body: I'm having a problem binding a promise to &lt;autocomplete source='fnPromise()'&gt; when using ngTagsInput. I don't think there is anything wrong with ngTagsInput; I think I don't understand scope and promises well enough to understand how to do what I want to do. I set up the directive normally: &lt;tags-input ng-model="token.ids.tags" class="form-field no-animate tag-input" placeholder="Delete unwanted IDs" addFromAutocompleteOnly="true"&gt; &lt;auto-complete source="offerTags($query)"&gt;&lt;/auto-complete&gt; &lt;/tags-input&gt; The problem lies in the offerTags() function. This returns a promise, but because I want to populate the autocomplete with the array that's part of this controller's $scope, I tell the promise just returns that $scope attribute: $scope.offerTags=function(query) { var deferred=$q.defer(); var tags=$scope.token.ids.tags; deferred.resolve( tags); return deferred.promise; } However, $scope.token.ids.tags is only populated after a service has returned (after the page has loaded). So what happens is that offerTags always returns an empty array. The promise is not updated with the new values of token.ids.tags service. EDIT: Plunkr demonstrating problem I.e., if you replace the $scope.token.ids.tags with a static array, then the autocomplete functionality works, but only the contents of that static array. Sorry for the long explanation... any idea how I can get this to work?
score: 1
has comment: http://stackoverflow.com/comment/42445594
has comment: http://stackoverflow.com/comment/42444753
has comment: http://stackoverflow.com/comment/42444840
type: Question
has title: Failure binding Angular promise to $scope change
has comment: http://stackoverflow.com/comment/42445204
has comment: http://stackoverflow.com/comment/42445309
has comment: http://stackoverflow.com/comment/42445879
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/42444985

http://stackoverflow.com/a/26862712
answers question: http://stackoverflow.com/q/26862253
has comment: http://stackoverflow.com/comment/42295432
score: 0
has body: I like the idea, and we do the same thing (sort of). IF the second set of controller items does not have new requirements (directives and such), you should be able to do this: in app.js: var app = angular.module('myModule', ["whatever-directive", "some-service"]); app.config(['$httpProvider', '$locationProvider', function ($httpProvider, $locationProvider) { .. .. }]); .. .. in controllers.js function someCtrl($scope, $location, $http) {...} function someOtherCtrl($scope, $location, $http) {...} in onlyForYouControllers.js - that is only added if needed function someCtrlOnlyForYou($scope, $location, $http) {...} Like I wrote - you must declare what ever needed in the app to start with - even if it not used by a particular set of controllers.
type: Answer

http://stackoverflow.com/comment/88615164
type: AnswerComment
has text: Agreed w/r/t control flow, but there is use in doing this in the context of a strongly typed system, such as Flow or TypeScipt. I.e. in cases where a function's signature strictly necessitates a `boolean` type.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/26906309

http://stackoverflow.com/comment/65688092
type: AnswerComment
has text: I see then I am not sure what the issue is, I have seen that working before with pouchDB / couchDB, I can put together a small example
score: 0
type: Comment
comment on: http://stackoverflow.com/a/39154573

uglifyjs
tags question: http://stackoverflow.com/q/26853217
tag name: uglifyjs
type: Tag

http://stackoverflow.com/a/26898230
has comment: http://stackoverflow.com/comment/42349657
has body: If you want to test whether the table contains $&lt;searchword&gt;%, use .indexOf() xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { var content = xmlhttp.responseText; if (content.indexOf("%&lt;searchword&gt;%") != -1) { document.getElementById("result1").innerHTML = content; } else { document.getElementById("result2").innerHTML = content; } } }
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42349714
type: Answer
accepted answer of: http://stackoverflow.com/q/26897974
answers question: http://stackoverflow.com/q/26897974
has comment: http://stackoverflow.com/comment/42350443
score: 0

http://stackoverflow.com/comment/42306502
score: 0
has text: pff neither works, still empties the form when the new window pops up
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/26874175

http://stackoverflow.com/comment/42506985
has text: The syntax for replace is ``replace(/<keywords|regex>/g, "<replacement>")`` or you might want a better enlightenment at [this link](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26987030
type: Comment

function
tags question: http://stackoverflow.com/q/26905074
tags question: http://stackoverflow.com/q/26897166
tags question: http://stackoverflow.com/q/26915284
tags question: http://stackoverflow.com/q/26858571
tags question: http://stackoverflow.com/q/26924827
tags question: http://stackoverflow.com/q/26871377
tag name: function
tags question: http://stackoverflow.com/q/26950412
tags question: http://stackoverflow.com/q/26944624
tags question: http://stackoverflow.com/q/26882540
tags question: http://stackoverflow.com/q/26969562
tags question: http://stackoverflow.com/q/26856783
tags question: http://stackoverflow.com/q/26991779
tags question: http://stackoverflow.com/q/26966082
tags question: http://stackoverflow.com/q/26947973
tags question: http://stackoverflow.com/q/26908003
tags question: http://stackoverflow.com/q/26920027
tags question: http://stackoverflow.com/q/26931228
tags question: http://stackoverflow.com/q/26893703
tags question: http://stackoverflow.com/q/26916014
tags question: http://stackoverflow.com/q/26920682
tags question: http://stackoverflow.com/q/26859275
tags question: http://stackoverflow.com/q/26946081
tags question: http://stackoverflow.com/q/26886098
type: Tag
tags question: http://stackoverflow.com/q/26835809
tags question: http://stackoverflow.com/q/26843504
tags question: http://stackoverflow.com/q/26891970
tags question: http://stackoverflow.com/q/26958164
tags question: http://stackoverflow.com/q/26876493
tags question: http://stackoverflow.com/q/26863465
tags question: http://stackoverflow.com/q/26928668
tags question: http://stackoverflow.com/q/26900144
tags question: http://stackoverflow.com/q/26870375
tags question: http://stackoverflow.com/q/26836280
tags question: http://stackoverflow.com/q/26957188
tags question: http://stackoverflow.com/q/26937208
tags question: http://stackoverflow.com/q/26849748
tags question: http://stackoverflow.com/q/26925812
tags question: http://stackoverflow.com/q/26900542
tags question: http://stackoverflow.com/q/26949574
tags question: http://stackoverflow.com/q/26945686
tags question: http://stackoverflow.com/q/26963679

http://stackoverflow.com/comment/42314135
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/26878574
has text: http://jsfiddle.net/opar56kk/5/ use `no wrap - in `, otherwise the script in jsfiddle is wrapped and your function `getImg` is out of scope.

http://stackoverflow.com/q/26864197
has body: I just use VLC to broadcast a ts content with the 5M bps through udp, and using the following Nodejs codes to recieve the data and output them to stdout: var socket = require( "dgram" ).createSocket( "udp4" ); var fs = require('fs'); // Listen messages socket.on( "message", function ( message, requestInfo ) { process.stdout.write(message); } ); ... The problem is: it seems the pipe's speed can't meet 5M bps. I have check the output data from the pipe of stdout and found some of the data missed. I just wander if the pipe can't support the throughput more than 5Mbps? Does anybody can give some suggestions? Thanks ahead. BTW: OS: win7; Nodejs version: 0.10.33
has comment: http://stackoverflow.com/comment/42306554
tagged with: linux
tagged with: node.js
linked to: http://stackoverflow.com/q/3857052
answer count: 0
type: UnansweredQuestion
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/42324301
score: 0
has title: What is the data throughput of NodeJS PIPE?
has comment: http://stackoverflow.com/comment/42288713

http://stackoverflow.com/comment/42446983
comment on: http://stackoverflow.com/q/26953251
has text: It will populate the entire row and then display the images.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/27956524
answers question: http://stackoverflow.com/q/26989779
type: Answer
has body: replace all payment. by billing. in that file and in osc_payment.js and payment.js of ogone + add this configurable layout : <checkout_onestep_index> css/ops.css </checkout_onestep_index>
score: 0

http://stackoverflow.com/q/26864359
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/26864681
tagged with: javascript
has title: Access parent local variable in child window
possible better answer: http://stackoverflow.com/a/26864551
tagged with: parent-child
has answer: http://stackoverflow.com/a/26864551
has body: I would like to use a local variable of a parent in child window. I used parent.window.opener but it returns undefined. This is my code: &lt;script type="text/javascript"&gt; var selectedVal; $(document).ready(function () { //.... //... if ($(this).val() == "byActor"){ $("#tags").focus(); $("#tags").autocomplete({ source: "actorsauto.php", minLength: 2, focus: function( event, ui ){ event.preventDefault(); return false; }, select: function (event, ui){ var selectedVal = ui.item.value; alert(selectedVal); } }); }); $('#btnRight').on('click', function (e) { popupCenter("movieByactor.php","_blank","400","400"); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; and this is a child: &lt;body&gt; &lt;script type="text/javascript"&gt; var selectedVal = parent.window.opener.selectedVal; alert(selectedVal); &lt;/script&gt; &lt;/body&gt;
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/42288241
has answer: http://stackoverflow.com/a/26864681
tagged with: php
type: AnsweredQuestion
score: 7
upvote count: 7
tagged with: global-variables

http://stackoverflow.com/comment/42503574
comment on: http://stackoverflow.com/a/26978867
type: Comment
has text: Thank @meetamit .. . I saw the answer now . .but I did use the logic of the node-links as in the case of a FDN (i.e. the source and target indexes) .. was able to get it running. :)
type: AnswerComment
score: 0

http://stackoverflow.com/q/26861818
has title: How do I get specific value key pair in ajax javascript for datatype json?
tagged with: http://stackoverflow.com/tag/json
possible better answer: http://stackoverflow.com/a/26862201
accepted answer: http://stackoverflow.com/a/26862049
has comment: http://stackoverflow.com/comment/42284013
has answer: http://stackoverflow.com/a/26862201
has body: I want to get the value of "status" from data in the code below, $.ajax({ dataType: "json", url: "calendar/php/date.php", type: "POST", data: { select: "%Y-%c-%e", where: "%Y-%c", d: y + "-" + m, order: "timestamp, id" }, beforeSend: function() { $('#loading').show(); }, success: function(data) { sessionStorage[y+"-"+m] = JSON.stringify(data); for (var key in data) { $("&lt;span class=\"label label-success\"&gt;" + Object.keys(data[key]).length + "&lt;/span&gt;").prependTo($("#" + key)); console.log('key: ' + key + '\n' + 'value: ' + JSON.stringify(data)); } }, complete: function() { $('#loading').fadeOut(200); } }); Following is some part of the console.log result: key: 2014-11-11 value: {"2014-11-11":[{"0":"3","1":"2014-11-11 11:11:00","2":"2014-11-28 10:12:00","3":"test","4":"test","5":"0","6":"","7":"","8":"","9":"0","10":"0","11":"0","12":"0","13":"0","14":"0","15":"0","16":"","17":"2014-11-11","id":"3","timestamp":"2014-11-11 11:11:00","toTimestamp":"2014-11-28 10:12:00","title":"test","location":"test","status":"0","organizer":"","organizerContact":"","organizerEmail":"","projector":"0","laptop":"0","speaker":"0","pointer":"0","whiteboard":"0","mediaCoverage":"0","parking":"0","remark":"","selector":"2014-11-11"}],"2014-11-12":[{"0":"15","1":"2014-11-12 07:07:00","2":"2014-11-12 03:09:00","3":"test","4":"test","5":"1","6":"","7":"","8":"","9":"0","10":"0","11":"0","12":"0","13":"0","14":"0","15":"0","16":"","17":"2014-11-12","id":"15","timestamp":"2014-11-12 07:07:00","toTimestamp":"2014-11-12 03:09:00","title":"test","location":"test","status":"1","organizer":"","organizerContact":"","organizerEmail":"","projector":"0","laptop":"0","speaker":"0","pointer":"0","whiteboard":"0","mediaCoverage":"0","parking":"0","remark":"","selector":"2014-11-12"}]} I want get the value of "status" i.e 0, as seen in the above result, in order to include it in the for loop (for (var key in data) {...}) to change the class 'label-success' to 'label-failure' if the status is 0. C…
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/26862726
tagged with: ajax
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/42284181
has answer: http://stackoverflow.com/a/26862049
type: AnsweredQuestion

http://stackoverflow.com/comment/42355846
type: Comment
score: 0
has text: Yes, in if.Do what Deepak Sharma (below) told you, but just add TextBox1.Text = string.Empty; to clear contents of the textBox
type: QuestionComment
comment on: http://stackoverflow.com/q/26901517

http://stackoverflow.com/a/26872566
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/26858039
upvote count: 4
score: 4
has body: You can use ocLazyLoad for this purpose. https://github.com/ocombe/ocLazyLoad The way I understand - you include ocLazyLoad.js in your code. Then, instead of angular.module('app',['module1','module2']) your code becomes angular.module('app',['oc.lazyLoad']). Then you inject $ocLazyLoad into your controller and use it like $ocLazyLoad.load({name:'module1', files:['js/controllers/module1.js']},{name:'module2',files:['js/controllers/module2']}). You can check out the examples on the github page.

http://stackoverflow.com/comment/42371363
type: QuestionComment
has text: I guess because your declaration of `MyImplementation` is technically "finished" in line 66 without implementing all necessary functions of the interface. I suppose you have to integrate the method implementation into the declaration of `MyImplementation`, not add it to the prototype later on.
comment on: http://stackoverflow.com/q/26910809
score: 0
type: Comment

http://stackoverflow.com/a/26869851
score: 0
type: Answer
has body: This simple function will do what you're asking for. It makes certain assumptions: The colouring is taken care of by your existing CSS The table that needs to be moved is the first table direct child of content_area Code: // Script I currently have that checks if the page is a category page. $(function() { if (location.pathname.indexOf("-s/") != -1) { moveTable(); } else { } }); // END Script I currently have that checks if the page is a category page. function moveTable(){ $("#MainForm").before($("#content_area &gt; table:first-of-type")); } Works on your fiddle
answers question: http://stackoverflow.com/q/26869570

http://stackoverflow.com/a/26863909
upvote count: 2
has body: You can also manipulate on the SVG element. $('#btn').click(function () { var plotBand = chart.yAxis[0].plotLinesAndBands[0]; if (plotBand.hidden) { plotBand.hidden = false; plotBand.svgElem.show(); } else { plotBand.hidden = true; plotBand.svgElem.hide(); } }); Example: http://jsfiddle.net/stypmpde/
has comment: http://stackoverflow.com/comment/42290926
has comment: http://stackoverflow.com/comment/110834733
downvote count: 0
has comment: http://stackoverflow.com/comment/42289621
type: Answer
answers question: http://stackoverflow.com/q/26860662
score: 2

http://stackoverflow.com/q/26916169
answer count: 0
type: Question
has body: I am running an angular app. I am having the strangest effect ever... I am calling a backend which returns a json. I parse that json and build an object structure client side. It works perfectly in dev but the exact same code does provide strange effects on prod. See code inline comments for hints. The only thing I could think of is that the data comes different from prod... I can't see what's wrong, as it's the exact same code, and it's driving me completely nuts, probably the worse thing I ever saw in 10+ years programming! Basically the json structure is a list of objects, every object has a reference ID, and several objects are correlated by the same reference ID - I need a structure where I'd access all objects with the same reference ID. Maybe I'll make a fool of myself here but I really can't see it...I just ran the data in two JSON validators and both say the data is valid. app.factory('ItemService', ['ItemProvider', function(itemProvider) { var itemSrv; var obj_by_id = {}; //create empty object itemSrv = function(callback) { itemProvider.get_data() .success(function(data) { // callback ok, data has json content for (var i=0; i&lt;data.length; i++) { obj = data[i]; // I get the object in the json if (! (obj.identificador in obj_by_id)) { obj_by_id[obj.identificador] = {}; //build a key in the object if not already available } obj_by_id[obj.identificador][obj.campo_nombre] = obj; //assign the object by keys console.log(obj_by_id); **//HERE obj_by_id is ALWAYS EMPTY!!!! BUT ONLY ON PROD!!! On dev works fine...** } callback(obj_by_id); //Here I would get the whole structure, but it's empty on prod... }) .error(function(data) { console.log("Error getting data from server"); }); } //factory function body that constructs shinyNewServiceInstance return itemSrv; }]); EDIT: console.log(data) right after success, on request dev: https://i.sstatic.net/D6MP3.png prod: https://i.sstatic.net/rfwvc.png EDIT2: you can have a look at the returned data here (will remove this …
tagged with: http://stackoverflow.com/tag/json
has title: Script works in development environment, but not in production
has comment: http://stackoverflow.com/comment/42381088
score: 0
has comment: http://stackoverflow.com/comment/42381698
has comment: http://stackoverflow.com/comment/42381120
tagged with: javascript
has comment: http://stackoverflow.com/comment/42381467
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42381714
has comment: http://stackoverflow.com/comment/42382674

http://stackoverflow.com/comment/42239395
score: 0
type: AnswerComment
type: Comment
has text: Thanks for the suggestion, but I can't utilize plugins just like that. If there were a way to make the webpage behave the way I want without plugins, that would be appreciated.
comment on: http://stackoverflow.com/a/26836507

http://stackoverflow.com/q/26912096
tagged with: undefined
tagged with: console
type: UnansweredQuestion
tagged with: facebook
has comment: http://stackoverflow.com/comment/42376721
has comment: http://stackoverflow.com/comment/42375171
answer count: 0
has comment: http://stackoverflow.com/comment/42375784
type: Question
has comment: http://stackoverflow.com/comment/42374397
has body: My issue seems to be retrieving comments from the users feed from facebook. It gets the type and the message properties just fine. So I can use them within the control structure to output what I want. However, the comments property is acting strange. The console seems to throw the error cannot access data property of undefined. So I added another if statement testing for comments. I have tried adding undefined and null, but if I get feed[item].comments I just get undefined even if I log the current feed[item] to the console and the comments are there. //I stripped this code down as most of it will just get in the way //so up here is my success function for the ajax call and is also where 'resp' comes from... var feed = resp['feed']; for(item in feed) { switch(feed[item].type) { case "status": if(feed[item].message === undefined || feed[item].message === null) { //console.log(feed[item].comments); if(feed[item].comments !== undefined) { console.log(feed[item].comments.data.length); } }else if(feed[item].story === undefined || feed[item].story === null) { //console.log(feed[item].comments); if(feed[item].comments !== undefined) { console.log(feed[item].comments.data.length); } } break; } } Suggestions are appreciated :)
has title: cannot access data property of undefined when retrieving facebook comments
has comment: http://stackoverflow.com/comment/42374755
score: 0
has comment: http://stackoverflow.com/comment/42376284
has comment: http://stackoverflow.com/comment/42374253
tagged with: javascript

http://stackoverflow.com/comment/42420878
type: Comment
has text: I appreciate your answer @JohnWhish Running it from my local system. However when I add 'yo {{team.rb}}' inside the ng-repeat, I get the same result without using the script you'd added. Trying to figure this out so I can further build out the running-backs.html template and make something useful once I get a hang of this
comment on: http://stackoverflow.com/a/26937919
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42490025
comment on: http://stackoverflow.com/q/26975831
has text: Complete CSS added to new [FIDDLE](http://jsfiddle.net/5h0sjtqf/5/). Result: the JS still works!
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26976650
tagged with: jquery
has comment: http://stackoverflow.com/comment/42488016
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/42488620
has answer: http://stackoverflow.com/a/26976803
has body: i'm working on a project, and i have to make some calculations on an existing value of an input field. let's say the input value is 400 or whatever. underneath i've got a select box YES means add 425, NO means add 0 or substract -425; HTML: Choose-- yes no jQuery: jQuery(document).ready(function($){ var priceTag = $('#priceTag'); $('#designChoice').on('change', function(){ if($(this).val()==='yes'){ /* Here i want to add + 425 to the */ }else{ /* Here I want to add nothing to the input or substract -425 */ } }); }); What i've tried: priceTag.val(+ 425); /* And more of this type of wrong code ;-P */ I've tried to look up existing examples but i didn't find many examples so thanks in advance for the answer!
has title: Calculate with .val() of input jQuery
has answer: http://stackoverflow.com/a/26976727
upvote count: 1
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42488562
score: 1
has answer: http://stackoverflow.com/a/26976764
type: Question
possible better answer: http://stackoverflow.com/a/26976725
accepted answer: http://stackoverflow.com/a/26976727
has answer: http://stackoverflow.com/a/26976725
tagged with: javascript

http://stackoverflow.com/a/27175224
has comment: http://stackoverflow.com/comment/48358450
answers question: http://stackoverflow.com/q/26979433
score: 0
has body: Try upgrading to gulp-ruby-sass 1.0.0-alpha. It uses gulp-sourcemaps and should avoid all iterations of this problem.
type: Answer
has comment: http://stackoverflow.com/comment/48550253

http://stackoverflow.com/q/26932206
has body: I am interested how the following technique is made: http://www.otherfocus.com/ When you click on a thumbnail, the website will overlay the single page with an animation. I consulted the source, but do not quite understand what the core of these functions is. Does anyone know how to check which function is fired after clicking a thumbnail?
tagged with: dom-events
favorite count: 0
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/42409787
upvote count: 1
has comment: http://stackoverflow.com/comment/42409496
type: Question
has answer: http://stackoverflow.com/a/26932284
has comment: http://stackoverflow.com/comment/42409634
tagged with: javascript
score: -1
has title: How can I check which function will be fired after clicking a link?
answer count: 1

http://stackoverflow.com/q/26889353
score: 1
has title: Bootstrap modal height
type: Question
has body: Maybe I do not undestand something, but does bootstrap modal callbacks work? $('#myModal').on('shown.bs.modal', function (e) { set_valign() alert($('.modal-content').height()) }); This always return 0. CSS: .modal-content { text-align:center;min-height:100%;width:100%; } I try to set position:relative, but also return always 0.
tagged with: javascript
has comment: http://stackoverflow.com/comment/42333288
upvote count: 1
favorite count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42333103
has comment: http://stackoverflow.com/comment/42334591
answer count: 0
downvote count: 0

http://stackoverflow.com/q/26918104
score: 1
tagged with: jquery
favorite count: 0
has title: jQuery Cycle2 non-active parent of nested slideshow not hidden
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: jquery-cycle2
type: Question
has body: I'm trying to set up nested slideshows with the cycle2 jQuery plugin, and I'm having an issue with the non-active slides of the parent not hiding properly when the parent slide is changed. I'm using the code from the demo: div" data-cycle-timeout=0 data-cycle-speed=250 data-cycle-prev="#prev" data-cycle-next="#next"> I've set up a fiddle using the code from the demo which is clearer: http://jsfiddle.net/cfu5yp2r/ When the parent uses scrollHorz or scrollVert you don't really notice (though the non-active slides are still there), but when you use a fade effect you can see the active images from the children which are in the non-active slides of the parent stick around, somehow over the top. For me the issue was that my navigation and text content in my parent slides weren't clickable no matter what I did with z-indexes. It's best illustrated by clicking-and-dragging over the slideshow - you'll see the image that drags away isn't actually the current slide. Or using a web inspector you'll see the image you find on top isn't the 'live' one in the slideshow.
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/26910638
downvote count: 0
has body: You method kinda works if you use the parent legend div instead of the table: .legend { position: absolute; left:800px; } This is probably not the best way to achieve your goals though. flot provides the ability to relocate the legend to a container (div) of your choice. So to put the legend right of the plot, I'd do: &lt;div id="flotGraph" style="width: 400px; height: 400px; float: left"&gt;&lt;/div&gt; &lt;div id="legendContainer" style="float: left"&gt;&lt;/div&gt; And then use the legend container property: $.plot("#placeholder", data, { yaxis: { min: 0 }, xaxis: { tickDecimals: 0 }, legend: { container: $('#legendContainer') } }); Here's an example.
type: Answer
accepted answer of: http://stackoverflow.com/q/26903819
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/26903819
type: AcceptedAnswer

http://stackoverflow.com/comment/42238980
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26836519
has text: Sure [Codepen](http://codepen.io/anon/pen/emOMEz?editors=101)

http://stackoverflow.com/comment/42445245
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26952328
has text: "It is always better to go with the straight forward method" that statement is simply not correct. In some browsers, the `join` method is significantly faster.
type: AnswerComment

http://stackoverflow.com/a/26862003
has comment: http://stackoverflow.com/comment/42284299
has comment: http://stackoverflow.com/comment/42284326
type: Answer
has body: Even this works, /{}/ == false; // false
has comment: http://stackoverflow.com/comment/42284513
has comment: http://stackoverflow.com/comment/42284343
answers question: http://stackoverflow.com/q/26861863
has comment: http://stackoverflow.com/comment/42284366
score: 0

http://stackoverflow.com/a/26907743
type: Answer
answers question: http://stackoverflow.com/q/26900423
has body: $scope.updateProvider = function(provider) { providersRef.child(provider.$id).update({tile:Provider.title}); }
score: 0

ajax
tags question: http://stackoverflow.com/q/26851861
tags question: http://stackoverflow.com/q/26932476
tags question: http://stackoverflow.com/q/26844401
tags question: http://stackoverflow.com/q/26850472
tags question: http://stackoverflow.com/q/26964751
tags question: http://stackoverflow.com/q/26957310
tags question: http://stackoverflow.com/q/26974329
tags question: http://stackoverflow.com/q/26911910
tags question: http://stackoverflow.com/q/26874942
tags question: http://stackoverflow.com/q/26907053
tags question: http://stackoverflow.com/q/26897715
tags question: http://stackoverflow.com/q/26903670
tags question: http://stackoverflow.com/q/26859096
tags question: http://stackoverflow.com/q/26861818
tags question: http://stackoverflow.com/q/26953645
tags question: http://stackoverflow.com/q/26945056
tags question: http://stackoverflow.com/q/26907320
tags question: http://stackoverflow.com/q/26887918
tags question: http://stackoverflow.com/q/26872609
tags question: http://stackoverflow.com/q/26884937
tags question: http://stackoverflow.com/q/26921603
tags question: http://stackoverflow.com/q/26860192
tags question: http://stackoverflow.com/q/26917730
tags question: http://stackoverflow.com/q/26938826
tags question: http://stackoverflow.com/q/26883916
tags question: http://stackoverflow.com/q/26986651
tags question: http://stackoverflow.com/q/26858662
tags question: http://stackoverflow.com/q/26911340
tags question: http://stackoverflow.com/q/26842683
tags question: http://stackoverflow.com/q/26860366
tags question: http://stackoverflow.com/q/26964974
tags question: http://stackoverflow.com/q/26904565
tags question: http://stackoverflow.com/q/26933560
tags question: http://stackoverflow.com/q/26884427
tags question: http://stackoverflow.com/q/26947564
tags question: http://stackoverflow.com/q/26962600
tags question: http://stackoverflow.com/q/26865562
tags question: http://stackoverflow.com/q/26937879
tags question: http://stackoverflow.com/q/26946096
tags question: http://stackoverflow.com/q/26950978
tags question: http://stackoverflow.com/q/26837132
tags question: http://stackoverflow.com/q/26948819
tags question: http://stackoverflow.com/q/26979063
tags question: http://stackoverflow.com/q/26946816
tags question: http://stackoverflow.com/q/26907167
tags question: http://stackoverflow.com/q/26868057
type: Tag
tags question: http://stackoverflow.com/q/26869426
tags question: http://stackoverflow.com/q/26902772
tags question: http://stackoverflow.com/q/26835093
tags question: http://stackoverflow.com/q/26947268
tags question: http://stackoverflow.com/q/26940432
tags question: http://stackoverflow.com/q/26938890
tags question: http://stackoverflow.com/q/26956877
tags question: http://stackoverflow.com/q/26959968
tags question: http://stackoverflow.com/q/26852391
tags question: http://stackoverflow.com/q/26975232
tags question: http://stackoverflow.com/q/26861795
tags question: http://stackoverflow.com/q/26904804
tags question: http://stackoverflow.com/q/26991818
tags question: http://stackoverflow.com/q/26975624
tags question: http://stackoverflow.com/q/26987746
tags question: http://stackoverflow.com/q/26869617
tags question: http://stackoverflow.com/q/26855939
tags question: http://stackoverflow.com/q/26901972
tags question: http://stackoverflow.com/q/26906064
tags question: http://stackoverflow.com/q/26965191
tags question: http://stackoverflow.com/q/26900938
tags question: http://stackoverflow.com/q/26977402
tags question: http://stackoverflow.com/q/26974800
tags question: http://stackoverflow.com/q/26928352
tags question: http://stackoverflow.com/q/26833914
tags question: http://stackoverflow.com/q/26949587
tags question: http://stackoverflow.com/q/26876994
tags question: http://stackoverflow.com/q/26938164
tags question: http://stackoverflow.com/q/26866810
tags question: http://stackoverflow.com/q/26846035
tags question: http://stackoverflow.com/q/26982533
tags question: http://stackoverflow.com/q/26883244
tags question: http://stackoverflow.com/q/26950321

http://stackoverflow.com/a/26860897
downvote count: 0
has comment: http://stackoverflow.com/comment/42283837
type: Answer
score: 1
has body: As an interpreted language, Javascript is slower and Access db is too. To get an accurate picture, you should time the individual processes of your application: how long it takes to read the database (creating it and looping over it the recordset) withtout creating the HTML elements; how long it takes to create the tbl element without inserting; how long it takes to insert it into the body document, etc. However, Without testing it, I won't be surprised to learn that the building of the tbl element and its insertion are the two slowest processes; so instead of build it using dynamic nodes; you should instead build your new HTML as a plain text and use an assignation innerText to insert it. This will cause some problems outside of IE, so see 'innerText' works in IE, but not in Firefox for more information on this topic.
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26860570
answers question: http://stackoverflow.com/q/26860570
type: AcceptedAnswer

http://stackoverflow.com/q/26858107
tagged with: jquery
has comment: http://stackoverflow.com/comment/42277765
favorite count: 0
tagged with: http://stackoverflow.com/tag/csv
has title: Export in CSV from JSON in IE through javascript
upvote count: 2
type: UnansweredQuestion
score: 2
tagged with: internet-explorer
type: Question
has answer: http://stackoverflow.com/a/26886737
tagged with: export-to-csv
has body: How to download table rows in CSV format in Internet Explorer from client side? At present I am using the below URI method to download it in other browser. But it seems Internet Explorer does not support the below mechanism. I want to support from IE version 8 till the latest. Any help for IE would be appreciated. var fileName = "Result"; var uri = 'data:text/csv;charset=utf-8,' + escape(CSV); var link = document.createElement("a"); link.href = uri; link.style = "visibility:hidden"; link.download = fileName + ".csv"; document.body.appendChild(link); link.click(); document.body.removeChild(link);
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/42374200
type: Comment
has text: This doesn't work, it takes DOB and still creates D O B
comment on: http://stackoverflow.com/a/26911529
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42246843
type: QuestionComment
has text: Express Error Handling by default exits the application. By implementing yourself the middleware with arity 4 (error middleware) you can manage personally the behavior of your app in case of errors. Note that using Express Error Middleware is not enough: try to "setTimetout(function () {console.log(someUndefinedVariable.someUndefinedProperty);}, 1000)" inside an Express route handler and you'll observe that you don't pass through the Error Middleware.
type: Comment
score: 1
comment on: http://stackoverflow.com/q/26838960

http://stackoverflow.com/q/26930999
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42407219
tagged with: css
answer count: 4
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26931273
score: 0
tagged with: wordpress
has comment: http://stackoverflow.com/comment/42407300
has comment: http://stackoverflow.com/comment/42407215
type: Question
tagged with: javascript
has body: I need to change icon when it is clicked or focused, and back to normal when its not. fiddle In fiddle, when we click on icon the image changes but it doesn't change back to original one when the other icons were clicked. Please help My html code: YEARS OF EXPERTISE & EXPERIENCE djsadsadkldksaldk lkdlsakd ksldk lksldkl COMPREHENSIVE CONSULTANCY djsadsadkldksaldk lkdlsakd ksldk lksldkl THE BEST QUALITY APPS djsadsadkldksaldk lkdlsakd ksldk lksldkl YEARS OF EXPERTISE & EXPERIENCE djsadsadkldksaldk lkdlsakd ksldk lksldkl COMPREHENSIVE CONSULTANCY djsadsadkldksaldk lkdlsakd ksldk lksldkl THE BEST QUALITY APPS djsadsadkldksaldk lkdlsakd ksldk lksldkl My Jquery Code: $(document).ready(function(){ $(".SerV-Image").on('click', function(){ var id = this.id; if(id == 1){ $("#"+id).attr('src','http://abc/wp-content/uploads/2014/11/1-hover1.png'); } if(id == 2){ $("#"+id).attr('src','http://abc/wp-content/uploads/2014/11/2hover1.png'); } if(id == 3){ $("#"+id).attr('src','http://abc/wp-content/uploads/2014/11/1-hover1.png'); } if(id == 4){ $("#"+id).attr('src','http://abc/wp-content/uploads/2014/11/4-hover.png'); } if(id == 5){ $("#"+id).attr('src','http://abc/wp-content/uploads/2014/11/5hover1.png'); } if(id == 6){ $("#"+id).attr('src','http://abc/wp-content/uploads/2014/11/4-hover.png'); } }); });
has title: qHow to change image of div on focus?
has answer: http://stackoverflow.com/a/26931652
has answer: http://stackoverflow.com/a/26931273
has answer: http://stackoverflow.com/a/26931276
tagged with: jquery
has comment: http://stackoverflow.com/comment/42407375
possible better answer: http://stackoverflow.com/a/26931276
has answer: http://stackoverflow.com/a/26932543
has comment: http://stackoverflow.com/comment/42407140

http://stackoverflow.com/q/26907932
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/26910592
has answer: http://stackoverflow.com/a/37340526
type: Question
has comment: http://stackoverflow.com/comment/42393508
has answer: http://stackoverflow.com/a/27582444
tagged with: javascript
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/42367525
has title: Titanium app crashes when removing pages from ScrollableView
favorite count: 0
has comment: http://stackoverflow.com/comment/42367390
type: UnansweredQuestion
tagged with: android
tagged with: titanium
has comment: http://stackoverflow.com/comment/42366810
has body: I have an app that uses a ScrollableView with dynamically added pages. I have a function that removes the views. If I haven't changed pages in the ScrollableView the pages are removed OK. However, if I scroll to a different page i.e not the first page, then try to remove the pages the app crashes. It's fine on iOS but it's Android that I'm having the problem on. Here's the function that removes the views from the ScrollableView. function emptyScrollView(){ var views = $.bookables_scroll.views; var count = views.length; for (var i = 0; i &lt; count; ++i) { $.bookables_scroll.removeView(views[i]); $.bookables_scroll.views[i] = null; } } This is the code that adds a view to my ScrollableView var payload = { bookable : bookable, rota: b_rota, current_date: current_date, }; // adds to scrollable view $.bookables_scroll.addView(Alloy.createController('appointments_bookable', payload).getView()); Why is the app crashing when I remove a view/page after having scrolled away from the first one? Titanium v3.4.0 Alloy v1.5.1

http://stackoverflow.com/comment/44240708
comment on: http://stackoverflow.com/a/27065073
type: AnswerComment
score: 0
type: Comment
has text: I tried with that one it is not working, Please see the updated code for reference

http://stackoverflow.com/comment/42359496
score: 0
type: Comment
comment on: http://stackoverflow.com/q/26903978
type: QuestionComment
has text: Well since I want it to run without user interference, I have put the script in a self invoking function. Will update my question.

http://stackoverflow.com/comment/42363696
has text: http://webdesignfan.com/htmlspecialchars-in-javascript/
score: 0
comment on: http://stackoverflow.com/q/26906612
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26920132
score: 1
upvote count: 1
type: Question
linked to: http://stackoverflow.com/q/5472938
has title: HTML 5 Video Auto Play Feature detection
tagged with: ios
has answer: http://stackoverflow.com/a/26920998
tagged with: javascript
has body: HTML 5 Video play() method is not supported on mobile unless the action is user generated, eg comes from a click/tap. This is fine. What I would like to know is, is there a reliable way to detect if the browser blocks this play() action, when it is not user generated. For example on desktop in chrome it does not, but on Android it does. Specifically my problem is that we have a third ad module that requires to know whether it can auto play the ad when we initialize it. For desktop browsers it can always do this, but for mobile browsers it cannot. This recently became a problem when mobile browsers (ios 8 on ipad) started honouring the no controls attribute. Which led to a situation where the ad module would remove the controls, the browser would block the play event and the user would have no native controls to actually start the ad and thus the video. (The ad Module removes the controls to stop you skipping through the ad). I really want to avoid browser / platform sniffing through the user agent and would like some thing more akin to feature detection. My current best guess is to check for touch event feature, and assume touch means wont allow play from non user action, but I'm hoping there is something that removes this "best guess".
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/26920998
tagged with: android
tagged with: video
type: AnsweredQuestion

http://stackoverflow.com/q/26851248
has title: Accessing return value of one function from another function in javascript (confused)
has comment: http://stackoverflow.com/comment/42265549
has comment: http://stackoverflow.com/comment/42265688
has comment: http://stackoverflow.com/comment/42265625
score: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/42266499
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42264984
linked to: http://stackoverflow.com/q/14220321
has body: May be a silly one , but stuck. This is the code I am trying Get Weather Temperature It returned {} Not returned the JSON (the return defined in getWeather) Not the temperature (in get element by id part) The temperature button should return temperature only.
answer count: 0
duplicate of: http://stackoverflow.com/q/14220321
has comment: http://stackoverflow.com/comment/42265462
type: Question
has comment: http://stackoverflow.com/comment/42265596

http://stackoverflow.com/a/26936968
upvote count: 1
has comment: http://stackoverflow.com/comment/42418393
type: Answer
has comment: http://stackoverflow.com/comment/42418488
has comment: http://stackoverflow.com/comment/42418455
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/26936947
has body: You want: window.location = field1;

http://stackoverflow.com/comment/42314644
type: AnswerComment
type: Comment
has text: yeap, you are using svg.append("g")...call(yAxis) each time you call draw. it means that in each call, a new set of labels are added to your graph. instead of append, either select the existing element or store a reference to the first one to avoid this problem.
comment on: http://stackoverflow.com/a/26878662
score: 0

http://stackoverflow.com/comment/42408123
score: 0
type: Comment
type: QuestionComment
has text: Nothing wrong with this code
comment on: http://stackoverflow.com/q/26931558

http://stackoverflow.com/q/26943036
score: 0
duplicate of: http://stackoverflow.com/q/14220321
tagged with: higher-order-functions
tagged with: asynchronous
linked to: http://stackoverflow.com/q/14220321
has comment: http://stackoverflow.com/comment/42442688
type: UnansweredQuestion
has body: Apolgies if my question is basic - I have spent a good amount of time trying to understand callbacks to resolve this myself, but I am stuck! I have also reviewed other similar questions, but can't apply what I learned to this. I am trying to modify the standard Ionic tutorial. This service part of the application is intended to return an array of friend data to populate a dropdown. In the original sample, the data is manually loaded with hardcoded values as an example. You can see that commented out towards the bottom. My question is how do I make the return of the overall function wait for the completion of my asynchronous facebook call which brings back real data in place of the dummy data. Thanks so much! John angular.module('starter.services', []) .factory('Friends', function() { function friendsFunction() { //Async FB API call to return friends of user FB.api('/me/friends', function (response) { var fbFriendData = []; //Load friends into an array for (var i = 0; i &lt; response.data.length; i++) { fbFriendData.push({ id: i, fbid: response.data[i].id, name: response.data[i].name }); } return fbFriendData; }); } var friends = friendsFunction(); //friends = [ // {id: 0, name: 'KJ'}, // {id: 1, name: 'Your Mum'}, // {id: 2, name: 'Nikki B'}, // {id: 3, name: 'Jesus'} //]; return { all: function() { return friends; }, get: function(friendId) { // Simple index lookup return friends[friendId]; } } });
tagged with: cordova
answer count: 0
has title: How to wait for the result of a nested asynchronous function before returning the main function
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/42429271
tagged with: ionic-framework

http://stackoverflow.com/q/26961187
tagged with: multidimensional-array
has body: I am trying to replicate the 2d array generation in java-script form the following PHP code I have written, I am feeling I am getting some misconception because I am not getting the expected result from my javascript. Help me out where I am doing it wrong and what is my misconception. PHP CODE &lt;?php $checkArray = array(); for($m=0; $m&lt;3; $m++){ for($n=0; $n&lt;4; $n++ ) { $checkArray[$m][$n] = "Inside_ ".$m." is ".$n; } } var_dump($checkArray); ?&gt; JAVASCRIPT CODE &lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;script&gt; function ArrayFunction(){ var checkArray = []; for(var m=0; m&lt;3; m++){ checkArray[m] = []; for(var n=0; n&lt;4; n++){ checkArray[m][n] = "Inside " +m+ " is " + n ; } } for(var i = 0; i &lt; checkArray.length; i++) console.log(checkArray[i]); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; The content of the document...... &lt;input id="clickMe" type="button" value="clickme" onclick="ArrayFunction();" /&gt; &lt;/body&gt; &lt;/html&gt; After @sifriday suggestion, I moved the array initialization outside inner loop, Updated Question: But why do we have to initialize it everytime we need to expand the dimension unlike php
upvote count: 1
tagged with: php
has answer: http://stackoverflow.com/a/26961220
type: Question
type: AnsweredQuestion
has title: How to create Javascript 2-d array like in PHP?
tagged with: arrays
downvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/26961220
tagged with: javascript
score: 1
favorite count: 0

http://stackoverflow.com/comment/42515805
type: Comment
comment on: http://stackoverflow.com/a/26984671
score: 0
has text: Well done, it is a bit tricky to think between template execution and the later JavaScript execution.
type: AnswerComment

http://stackoverflow.com/comment/42247839
has text: No Prog ,, I checked But it will Come Error,,, How i can Get the Session value in another web page?
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26841394

global
type: Tag
tags question: http://stackoverflow.com/q/26947904
tag name: global
tags question: http://stackoverflow.com/q/26937424
tags question: http://stackoverflow.com/q/26933976

http://stackoverflow.com/comment/42497289
type: QuestionComment
has text: Yes i see that sorry but i try only one code and if is not 123 calling jPrompt('Enter the right code please: '); but when i try a second rong code for example 234 the prompt box close.I want until the use fill the code 123 or click cancel button the prompt box show again and again
score: 0
comment on: http://stackoverflow.com/q/26980326
type: Comment

http://stackoverflow.com/q/26840808
accepted answer: http://stackoverflow.com/a/26841329
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26841329
type: Question
tagged with: mootools
tagged with: javascript
score: 0
has title: mootools and iframem, show div at top right corner
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I have iframe popup for image, and close button within that iframe. I want that close button at top corner of iframe with some portion outside of iframe. How can I apply it?

http://stackoverflow.com/comment/42415929
has text: Fair enough, but clone isn't necessary here.
comment on: http://stackoverflow.com/a/26935589
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/26852235
has body: A: The URL gets encoded automatically with HTML helpers that I found. I instead just used Cancel. It's not quite as fancy, but works. B: My problem was in my controller. I send my data back to the controller to handle and then transfer to index from there. I was using a RedirectToAction, but again it encodes.return Redirect("~/Home/Index#1"); seems to be working. If there are obvious problems with these solutions, please share. Otherwise at the moment, this seems to be the solution.
answers question: http://stackoverflow.com/q/26850472
score: 0
type: Answer

http://stackoverflow.com/q/26900156
downvote count: 0
has comment: http://stackoverflow.com/comment/42352958
tagged with: javascript
has comment: http://stackoverflow.com/comment/42353105
has answer: http://stackoverflow.com/a/26900212
has title: Javascript replace works in console, not in code
has comment: http://stackoverflow.com/comment/42353145
has body: I've been trying to setup a small booking system however I'm stuck. Basically, I add all the seat numbers that want to be booked into a string eg (a22~b20~f10). However when a seat is deselected it needs to be removed from the string. I have tried using .replace but to no avail, even in the console. I then tried the code below. It works brilliantly in the console, but not at all in my code. seatNumbersToBook.split(seatNumber+"~").join(""); The full function is here var seatNumbersToBook = ""; function calcSeats(calc, seatNumber){ if(amountSeatsToBeBooked != 0 &amp;&amp; seatNumber != "NaN" &amp;&amp; calc == "-1"){ seatNumbersToBook = seatNumber + "~" + seatNumbersToBook; } if(calc == "+1"){ //remove from seatNumbersToBook array seatNumbersToBook.split(seatNumber+"~").join(""); console.log(seatNumber); } // despite removing seat number from array, still MUST check in array to see if the seatnumber has already been recorded amountSeatsToBeBooked = eval(amountSeatsToBeBooked + calc); $("#remainingSeatsToBeBooked").html(amountSeatsToBeBooked); console.log(seatNumbersToBook); return amountSeatsToBeBooked; } Thanks a lot in advance!!
favorite count: 0
upvote count: 2
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42352984
possible better answer: http://stackoverflow.com/a/26900212
has comment: http://stackoverflow.com/comment/42353095
tagged with: replace
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/26900186
accepted answer: http://stackoverflow.com/a/26900186

http://stackoverflow.com/comment/42288418
type: QuestionComment
has text: You have a problem with infinite recursive calls in the page - you should see an error like *Uncaught RangeError: Maximum call stack size exceeded* in your console
score: 0
type: Comment
comment on: http://stackoverflow.com/q/26864454

http://stackoverflow.com/comment/42371410
has text: Thnx this is what I needed!
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26910919

http://stackoverflow.com/comment/42285672
comment on: http://stackoverflow.com/q/26862687
score: 0
type: Comment
type: QuestionComment
has text: there is a button but i forgot to add that

code-coverage
tags question: http://stackoverflow.com/q/26940610
type: Tag
tag name: code-coverage
tags question: http://stackoverflow.com/q/26970405

http://stackoverflow.com/q/26893295
tagged with: jquery
has answer: http://stackoverflow.com/a/26893366
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: Question
has body: For some reason, my website's fading &amp; positioning work and look great in Chrome &amp; Firefox but Internet Explorer is not showing the fading effect at all and the alignment is all messed up. here's the coding: /* fade slider */ .slides { height:600px; margin:0px auto; overflow:hidden; position:relative; width:900px; } .slides ul { list-style:none; position:relative; } /* keyframes #anim_slides */ @-webkit-keyframes anim_slides { 0% { opacity:0; } 6% { opacity:1; } 24% { opacity:1; } 30% { opacity:0; } 100% { opacity:0; } } @-moz-keyframes anim_slides { 0% { opacity:0; } 6% { opacity:1; } 24% { opacity:1; } 30% { opacity:0; } 100% { opacity:0; } } @keyframes anim_slides { 0% { opacity:0; } 6% { opacity:1; } 24% { opacity:1; } 30% { opacity:0; } 100% { opacity:0; } } .slides ul li { opacity:0; position:absolute; top:0; /* css3 animation */ -webkit-animation-name: anim_slides; -webkit-animation-duration: 24.0s; -webkit-animation-timing-function: linear; -webkit-animation-iteration-count: infinite; -webkit-animation-direction: normal; -webkit-animation-delay: 0; -webkit-animation-play-state: running; -webkit-animation-fill-mode: forwards; -moz-animation-name: anim_slides; -moz-animation-duration: 24.0s; -moz-animation-timing-function: linear; -moz-animation-iteration-count: infinite; -moz-animation-direction: normal; -moz-animation-delay: 0; -moz-animation-play-state: running; -moz-animation-fill-mode: forwards; animation-name: anim_slides; animation-duration: 24.0s; animation-timing-function: linear; animation-iteration-count: infinite; animation-direction: normal; animation-delay: 0; animation-play-state: running; animation-fill-mode: forwards; } /* css3 delays */ .slides ul li:nth-child(2), .slides ul li:nth-child(2) div { -webkit-animation-delay: 6.0s; -moz-animation-delay: 6.0s; animation-delay: 6.0s; } .slides ul li:nth-child(3), .slides ul li:nth-child(3) div { -webkit-animation-delay: 12.0s; -moz-animation-delay: 12.0s; animation-delay: 12.0s; } .slides ul…
tagged with: internet-explorer
has answer: http://stackoverflow.com/a/26893516
score: 0
answer count: 2
has title: Website Fading Effect not Working in Internet Explorer
tagged with: javascript

http://stackoverflow.com/q/26947568
has comment: http://stackoverflow.com/comment/42437132
type: AnsweredQuestion
has title: How to divide array array with specific pattern
downvote count: 1
type: Question
upvote count: 4
tagged with: arrays
has answer: http://stackoverflow.com/a/26947682
tagged with: javascript
has body: I need divide array: Into N ( N is number of new arrays ) arrays with certain patern. Array is dynamic and values can change. This is illustrated example what i want to do: This is real life example what i trying to do: I need divide one array in this pattern and create N arrays: In examples i created 2 arrays but now imagine that i want create 99 arrays
score: 3
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/26947682

http://stackoverflow.com/comment/42317704
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/26867356
has text: There is no easy way to do this. alandarev's solution is close but you can't meaningfully compare the contents of objects using == (or ===) in JavaScript so you'd have to manually compare the values. You can hide some of the nastiness using a utility library (such as Underscore) but that's just shuffling the deck chairs around and hiding the complexity.

http://stackoverflow.com/q/26909540
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/26910300
answer count: 1
downvote count: 0
tagged with: javascript
score: 1
tagged with: express
favorite count: 0
has body: I wonder what would be the proper way of breaking the flow of the program and redirect to some route. Something like the equivalent of a header redirection but using route names instead of the complete URL. This is quite common to be found in PHP frameworks and quite powerful, and I haven't found yet the way of doing it with express.js. Imagine this scenario: function getUser() { //... //getting user.. //Here I would like to break the flow of the program if (error) { res.redirect('add'); } //If there was no error we keep the normal flow //... } router.get('/add', function (req, res, next) { var user = getUser(); var date = //whatever var type = //whatever var event = createEvent(user, date, type); res.render('add', { date: date, type: type, whatever: whatever, csrfToken: req.csrfToken(), message: req.flash('error') }); }); A normal render wouldn't be what I want, because I don't want having to get again all the variables needed to render the view, I would like the route I want to redirect to deal with it. I was thinking about using writeHead, but that would require the whole URL, not just the route URL. Any ideas or recommendations?
tagged with: node.js
type: AnsweredQuestion
has title: Break program flow with express.js
has answer: http://stackoverflow.com/a/26910300

http://stackoverflow.com/comment/42469557
score: 0
has text: I checked with needed changes on above function, but still i am getting an error like "NetworkError: 405 Method Not Allowed". And there is a message like "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://api.crossMRKT.net/rest/v1/{user_name}/list. This can be fixed by moving the resource to the same domain or enabling CORS."
type: Comment
comment on: http://stackoverflow.com/a/26966146
type: AnswerComment

http://stackoverflow.com/q/26879471
tagged with: jquery
has answer: http://stackoverflow.com/a/26879515
has answer: http://stackoverflow.com/a/26880053
type: Question
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/26879515
tagged with: php
has comment: http://stackoverflow.com/comment/42316142
tagged with: css
has answer: http://stackoverflow.com/a/26881254
has comment: http://stackoverflow.com/comment/42315910
score: 0
has comment: http://stackoverflow.com/comment/42316707
has answer: http://stackoverflow.com/a/26879722
has comment: http://stackoverflow.com/comment/42315919
answer count: 5
tagged with: javascript
has comment: http://stackoverflow.com/comment/42315953
accepted answer: http://stackoverflow.com/a/26881254
has body: How to make the script to make upload file rather than pressing upload button in the below script Detail : In the below the will display the image that is uploaded and the to choose the file. and Upload to upload the image. And in the it will choose the file, But i don't want to upload the image every time after clicking on the Upload button How can make the image upload while choosing the file itself HTML : Upload Img Upload Script :
type: AnsweredQuestion
has title: How to make image upload directly while choosing image rather than pressing upload button in JQuery
has comment: http://stackoverflow.com/comment/42316576
has answer: http://stackoverflow.com/a/26880065

http://stackoverflow.com/q/26845031
has comment: http://stackoverflow.com/comment/136195493
type: Question
has comment: http://stackoverflow.com/comment/42253605
has body: I have a textarea meant for plain text that users sometimes copy and paste special characters into. It becomes a problem when emoticons are used, because it's material we then need to include in PDF files. For instance: ❤️ &amp;#10084; Now my question is, how could I go about identifying such characters and removing them with Javascript as the form is validated? I don't want to be too restrictive, as many languages are allowed (Russian, Arabic, etc.). Only those symbols would need to be excluded. Thank you
has title: Disabling ranges of Unicode characters in input field
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/42255394
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/42255221
has answer: http://stackoverflow.com/a/26847690
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26847690

http://stackoverflow.com/a/26881554
type: Answer
has body: Use as newsTarget[0].style.top= "500px"; ThegetElementsByClassName() method returns a collection of all elements in the document with the specified class name, as a NodeList object. The NodeList object represents a collection of nodes. The nodes can be accessed by index numbers. The index starts at 0
score: 0
answers question: http://stackoverflow.com/q/26881515

http://stackoverflow.com/comment/42538591
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27003588
type: AnswerComment
has text: Thanks :). But now the removeItem does not work. I am getting the index of the addItem and passing it to removeItem, but only works first one. Any Idea where I am being N00b?

http://stackoverflow.com/q/26961049
has comment: http://stackoverflow.com/comment/42460450
answer count: 1
downvote count: 1
tagged with: meteor
tagged with: meteor-blaze
favorite count: 0
has body: I've got a list of thumbnail urls stored as a list in a MongoDB document. I can access all of these urls by looping through them: {{#each thumbs}} &lt;img src="{{.}}"&gt; {{/each}} However, I would like to just get the first thumbnail (so without looping through all of them). I've tried {{thumbs[0]}}, but this doesn't work Any help would be greatly appreciated.
has title: Access specific element in list in meteor
has comment: http://stackoverflow.com/comment/42460630
accepted answer: http://stackoverflow.com/a/26961225
upvote count: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42460385
has answer: http://stackoverflow.com/a/26961225
has comment: http://stackoverflow.com/comment/42460391
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/42460343
type: Question
tagged with: mongodb

http://stackoverflow.com/comment/42376856
has text: What I've you done in the view (HTML) ?
comment on: http://stackoverflow.com/q/26913816
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42325490
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26884341
score: 1
has text: Why minuses? I don't understaand!

http://stackoverflow.com/comment/42238878
type: Comment
type: QuestionComment
has text: @Robg there are multiple totals, but using any of them ie ( salestTotal , or the taxed total) causes a NAN or undefined
score: 0
comment on: http://stackoverflow.com/q/26836519

http://stackoverflow.com/q/26880499
type: AnsweredQuestion
tagged with: validation
tagged with: jquery
type: Question
has title: jqgrid / Validation of ID
tagged with: regex
possible better answer: http://stackoverflow.com/a/26881350
has answer: http://stackoverflow.com/a/26881350
has comment: http://stackoverflow.com/comment/42317334
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/26882449
has body: I'm trying to create "validation" which is about "ID" in jqgrid to use 'custom' and 'custom_func'. This is the custom function to test the value of id whether the id is combined with number and english(a-z) properly. function id_validation(value, colname) { var idReg = /[^a-z|^0-9]/gi; if (!idReg.test(value)) { alert("ID는 영숫자 조합만 사용하세요"); } } This is the column name,'USER_ID', which i want to apply the above function so i used the 'custom' and 'cusotm_func' in 'editrules'. colModel: [ {name: 'USER_ID', index: 'USER_ID', editable: true, sortable: false, search: false, editrules: {custom: true, custom_func: id_validation}} ], This code is execute very well unless i put the right value however, the biggest problem is it shows me the alert even if i put right value. It alerts every situation regardless of the values. Did i miss something? What parts do i have to fix?
tagged with: jqgrid
tagged with: javascript
has comment: http://stackoverflow.com/comment/42318152
has comment: http://stackoverflow.com/comment/42318356
has comment: http://stackoverflow.com/comment/42317500
accepted answer: http://stackoverflow.com/a/26882449

http://stackoverflow.com/q/26938890
downvote count: 0
tagged with: ace-editor
score: 1
tagged with: ruby-on-rails
has title: How do I use form_for with non-input elements?
type: Question
has answer: http://stackoverflow.com/a/26944635
tagged with: javascript
has body: I want to use Ace Editor in my view for creating a post object, instead of a textarea, but Ace Editor requires the use of a &lt;div&gt; to contain its content. I'm new to Ruby on Rails 4 I'm trying to figure out how I can securely submit user input using the Ace Editor and redirect the user to the page that shows the post after it's been submitted. Here's my current form for submitting a post that does NOT yet use the Ace Editor &lt;div&gt;... &lt;%= form_for(@post) do |f| %&gt; &lt;div class="field"&gt; &lt;%= f.label :title %&gt;&lt;br&gt; &lt;%= f.text_field :title %&gt; &lt;/div&gt; &lt;div class="field"&gt; &lt;%= f.label :description %&gt;&lt;br&gt; &lt;!-- I'd like to replace this text_area with the ace editor div--&gt; &lt;%= f.text_area :description %&gt; &lt;/div&gt; &lt;div class="actions"&gt; &lt;%= f.submit %&gt; &lt;/div&gt; &lt;% end %&gt; How can I replace the f.text_area element with a &lt;div&gt; and include it's contents in the form's post request?
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26944635

http://stackoverflow.com/comment/42380115
type: AnswerComment
comment on: http://stackoverflow.com/a/26915706
score: 0
has text: i can't use any inbuilt JavaScript funtions such as "slice()","delete()", "concat()", "join()", "pop()", "push()", "reverse()", "shift()", "slice()", "sort()", "splice()", "toString()", "unshift()" or "valueOf()
type: Comment

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

http://stackoverflow.com/comment/42279903
type: Comment
type: QuestionComment
has text: by the way thanks it is little bit matched with my problem
comment on: http://stackoverflow.com/q/26859006
score: 0

http://stackoverflow.com/comment/42353676
comment on: http://stackoverflow.com/a/26900530
type: Comment
score: 1
has text: @ianaya89 Additionally, you could have `'button' + Math.ceil(Math.random() * 3) + '.jpg'`, and then the images can be named `button1.jpg`, etc., which is a little clearer than just straight numbers.
type: AnswerComment

http://stackoverflow.com/q/26954129
score: 0
tagged with: gwt
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27002830
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has title: Gwt and native html inter play
tagged with: css
has answer: http://stackoverflow.com/a/27002830
has body: I have a bunch of native html elements from a bootstrap template - namely cleanzone. I would like to handle the events fired from the html directly in my gwt app with or without wrapping the html elements as gwt widgets. e.g. &lt;div id=avatar class=".gwt-Image"&gt; &lt;img src=avatar6.jpg&gt;&lt;/img&gt; &lt;/div&gt; I tried wrapping this in a Image widget by using code - Element ele = RootPanel.get("avatar").getElement() ; Image.wrap(ele) I also tried final Element element = DOM.getElementById("avatar"); final Image img = Image.wrap(element); In both cases it throws an exception. My Question is --- Since I will do all my styling using css is it necessary to wrap the html tag in the page as a gwt widget to handle events fired by it and if yes what is the best approach to wrap a huge number of widgets on my page i.e. almost all of it from cleanzone?

http://stackoverflow.com/a/26961636
type: AcceptedAnswer
type: Answer
score: 11
has body: It's a completely empty object (nothing inherited from any .prototype including Object.prototype), so you can be guaranteed that any property lookup will only succeed if the property was explicitly added to the object. For example, if you want to store some data where you won't know the keys in advance, there's a possibility that a provided key will have the same name as a member of Object.prototype, and cause a bug. In those cases, you need to do an explicit .hasOwnProperty() check to rule out unexpected inherited values. But if there's nothing inherited, your testing can be simplified to a if (key in my_object) { test, or perhaps a simple truthy test if (my_object[key]) { if appropriate. Also, with no prototype chain, I would imagine that lookups of properties that turn out to not exist would be faster, since only the immediate object would need to be checked. Whether or not this pans out in reality (due to optimizations) would be determined with performance testing.
accepted answer of: http://stackoverflow.com/q/26961544
downvote count: 0
answers question: http://stackoverflow.com/q/26961544
upvote count: 11

http://stackoverflow.com/comment/42376140
type: QuestionComment
comment on: http://stackoverflow.com/q/26896527
score: 0
has text: I've edited above where it has to land in the existing responsive code. See .
type: Comment

http://stackoverflow.com/a/26893991
has body: Check this to help you debug: console.log(toMove.children().length); // how many children are seen? then angular.forEach(toMove.children(), function(element, index){ console.log(index, angular.element(element).width()); });
answers question: http://stackoverflow.com/q/26893772
type: Answer
score: 0

http://stackoverflow.com/comment/42480346
type: Comment
type: QuestionComment
has text: Please check this link http://datatables.net/reference/api/ajax.json()
comment on: http://stackoverflow.com/q/26972389
score: 0

http://stackoverflow.com/comment/42317257
type: AnswerComment
has text: I do not wish to have a scrollbar as a fix. The second div in the fiddle is how the result should look. The links should wrap automatically.
type: Comment
comment on: http://stackoverflow.com/a/26880506
score: 0

http://stackoverflow.com/q/26961226
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/26961375
tagged with: jquery
has title: CSS - Mobile Menu Trigger
has answer: http://stackoverflow.com/a/26961502
has answer: http://stackoverflow.com/a/26961375
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I am building a menu for a responsive website - my query is what people think is the best solution for showing / hiding the menu. I have setup the menu in this jsfiddle - http://jsfiddle.net/paul_dance/5z7rvvn4/2/ The menu is hidden at 768px and a button is show - I was thinking of adding a simple js script $('.menu-btn).click(function(){ $('nav ul').slidetoggle(); }); or similar.. which toggles the menu on click - but my fear is if the user hides it again then expands their screen beyond 768 the menu will remain hidden and no button present to re-show. Is there a better cross browser / device solution available? Or a CSS only solution? This needs to work on IE8 also.
type: AnsweredQuestion
type: Question
possible better answer: http://stackoverflow.com/a/26961502
tagged with: javascript

http://stackoverflow.com/a/26854947
upvote count: 4
has comment: http://stackoverflow.com/comment/42276823
has comment: http://stackoverflow.com/comment/42293288
has comment: http://stackoverflow.com/comment/64118139
answers question: http://stackoverflow.com/q/26839930
downvote count: 0
score: 4
has body: I just came across this problem today and I confirm the same problem. I could not remove the "script" prohibited elements but I was able to remove everything else. I then tried just putting a period in the Prohibited Elements input box, saved and I now can use script tags. I frames work too. I'm using 3.3.6. Strange. Global Configurations -> Text Filters for Super Users - set it "No Filtering" Users -> User Manager - Make sure you have Super User privileges Extensions -> Plugin Manager -> Filter:Editors -> TnyMCE -In the TinyMCE plugin field, add a period in the "Prohibited Elements" field
type: Answer

http://stackoverflow.com/comment/42539740
type: Comment
comment on: http://stackoverflow.com/a/26991241
score: 2
has text: This worked perfectly to change the styles accordingly. Very detailed instructions too. thanks!
type: AnswerComment

http://stackoverflow.com/q/26834667
favorite count: 0
score: 8
accepted answer: http://stackoverflow.com/a/26835016
upvote count: 8
tagged with: angularjs
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/19992090
has answer: http://stackoverflow.com/a/26835316
has body: Is there group by like something in angular that can convert this sort of json data grouped under group_header. outer list to sort data by groups and then inner list data items of that group, i couldn't make sense of this if this data can be grouped? var data = [ { "id":23, "name":"Fun Run (Pre-Registration Required)", "date":"Wednesday Nov 12", "group_header":"Sessions from 7:00 am to 1:45 pm" }, { "id":24, "name":"Breakfast", "date":"Wednesday Nov 12", "group_header":"Sessions from 7:00 am to 1:45 pm" }, { "id":25, "name":"Opening Address", "date":"Wednesday Nov 12", "group_header":"Sessions from 7:00 am to 1:45 pm" }, { "id":25, "name":"abc", "date":"Wednesday Nov 12", "group_header":"Sessions from 1:00 pm to 9:00 pm" }, { "id":26, "name":"xyz", "date":"Wednesday Nov 12", "group_header":"Sessions from 1:00 pm to 9:00 pm" }, { "id":26, "name":"xyz", "date":"Wednesday Nov 12", "group_header":"Sessions from 8:45 am to 2:00 pm" //notice a different header }, { "id":26, "name":"xyz", "date":"Wednesday Nov 12", "group_header":"Sessions from 1:30 pm to 11:00 pm" //another different header } ] Sessions from 7:00 am to 1:45 pm Fun Run (Pre-Registration Required) Breakfast Opening Address Sessions from 1:00 pm to 9:00 pm abc xyz Address another custom header (no pattern to it) - sessions from 10 am to 5 pm abc xyz Address
has title: Angularjs group data from a field in the records
type: Question
possible better answer: http://stackoverflow.com/a/26835316
answer count: 2
has answer: http://stackoverflow.com/a/26835016
has comment: http://stackoverflow.com/comment/42235524
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/42235441

http://stackoverflow.com/q/26857457
has answer: http://stackoverflow.com/a/26857704
has comment: http://stackoverflow.com/comment/42306686
type: UnansweredQuestion
downvote count: 2
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/42276730
tagged with: java
score: -1
has title: CSS and JS are not rendered when index.jsp is set as welcome file
tagged with: servlets
has comment: http://stackoverflow.com/comment/42276569
has comment: http://stackoverflow.com/comment/42306711
answer count: 1
tagged with: jsp
tagged with: javascript
has comment: http://stackoverflow.com/comment/42276815
has comment: http://stackoverflow.com/comment/42276961
favorite count: 0
has comment: http://stackoverflow.com/comment/42316029
has body: I am facing a problem in jsp-servlet, when I am setting up my index.jsp as welcome-file (default page to run first as soon as the project gets run) at that time the CSS and JS files are not rendered. My project Hierarchy is like this -ProjectName &nbsp; &nbsp; &nbsp; &nbsp; -User &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; -css &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; -js &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; -index.jsp And also when I run my project the URL in the browser will be localhost:8080/ProjectName so here index.jsp is called but without CSS and JS files. Edit: Finally, I had solved this issue by copying the CSS and JS to the root directory also. i.e. I have CSS and JS @ "User" as well as "ProjectName".
tagged with: css

http://stackoverflow.com/comment/42233876
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26833743
has text: Can't you set style of your dataTable element to be hidden without using javascript? For example ` ...`
score: 0

http://stackoverflow.com/comment/42377247
score: 0
comment on: http://stackoverflow.com/a/26911346
type: AnswerComment
has text: Actually your solution was much standard.
type: Comment

http://stackoverflow.com/q/26841163
has answer: http://stackoverflow.com/a/26841220
score: 1
possible better answer: http://stackoverflow.com/a/26842140
type: Question
has answer: http://stackoverflow.com/a/26842140
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/26841220
has body: I want to add an event listener for the whole document, and another if the program is inside a function. eg. $(document).click(function(){ foo(); //etc. }); function f1(){ $(document).click(function(){ bar(); //etc. }); //etc. }; And when running: click -&gt; foo(); click -&gt; foo(); ... f1(); click -&gt; bar(); click -&gt; bar();
upvote count: 1
has title: Can I override an event listener temporarily?
type: AnsweredQuestion

http://stackoverflow.com/q/26959431
has comment: http://stackoverflow.com/comment/42457367
answer count: 1
tagged with: events
tagged with: asynchronous
has title: Node.js module not communicating
has comment: http://stackoverflow.com/comment/42457342
has comment: http://stackoverflow.com/comment/42457474
type: UnansweredQuestion
has body: I am in the process of teaching myself node.js by building a personal project. I am trying to follow best practices by splitting my code up into separate modules. However, I've run into a problem where one of my modules is communicating back to the caller module. I've used callback functions and events, but the caller module never gets anything back from the called module, unless the called module returns a value immediately. Please look at the below code and let me know what I'm missing: blogs.controller.js (caller module) var ImageParser = require('../../components/parsers/ImageParser.js'); ..... var imageParser = new ImageParser(); imageParser.on('imagesParsed', function(){ console.log('test)}); ImageParser.js (called module) var EventEmitter = require('events').EventEmitter; var util = require('util'); var ImageParser = function(){ this.emit('imagesParsed'); }; util.inherits(ImageParser, EventEmitter); module.exports = ImageParser; Within the ImageParser function, I can listen for the event, but outside of it, I can't. Any help would be greatly appreciated. Thanks
tagged with: node.js
type: Question
has answer: http://stackoverflow.com/a/26959693
tagged with: javascript
has comment: http://stackoverflow.com/comment/42457415
score: 0

http://stackoverflow.com/q/26960010
linked to: http://stackoverflow.com/q/24698557
type: Question
has body: I'm doing this in JavaScript ( SVG or Canvas ) but I'm really just looking for pseudocode for how somebody could accomplish this: If given a rectangle, how can you fill it with various sized, non-overlapping triangles similar to this picture: https://i.sstatic.net/skvvw.jpg UPDATE Here is what I came up with for those that are interested. I used D3.js which has a great delaunay function to do this. var width = 360; var height = 220; var vertices = d3.range(100).map(function (d) { return [Math.random() * width, Math.random() * height]; }); // place coordinates in the corners [ [0, 0], [width, 0], [0, height], [width, height] ].forEach(function (d) { vertices.push(d); }); // add the temporary coordinates that will follow mousemove vertices.unshift([0, 0]); var svg = d3.select("#main").append("svg") .style("width", width + "px") .style("height", height + "px") .on("mousemove", function () { vertices[0] = d3.mouse(this); draw(); }) .on("click", function () { vertices.push(d3.mouse(this)); }); var path = svg.append("g").selectAll("path"); draw(); function draw() { path = path.data(d3.geom.delaunay(vertices).map(function (d) { return "M" + d.join("L") + "Z"; }), String); path.exit().remove(); path.enter().append("path").attr("class", function (d, i) { return "q" + (i % 9) + "-9"; }).attr("d", String); } #main { position: relative; width: 360px; height: 220px; border: 1px solid #ddd; } path { fill: #fff; stroke: steelblue; } &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js"&gt;&lt;/script&gt; &lt;div id="main"&gt;&lt;/div&gt;
has comment: http://stackoverflow.com/comment/42459561
tagged with: javascript
tagged with: pseudocode
has answer: http://stackoverflow.com/a/26961026
answer count: 2
tagged with: canvas
downvote count: 0
favorite count: 0
has title: Creating a rectangle filled with triangles
accepted answer: http://stackoverflow.com/a/26961026
score: 2
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/svg
upvote count: 2
possible better answer: http://stackoverflow.com/a/26964083
has answer: http://stackoverflow.com/a/26964083

http://stackoverflow.com/q/26912607
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42374741
has comment: http://stackoverflow.com/comment/42374837
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/26912740
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
has body: I am not sure how to mimic this (http://ironsummitmedia.github.io/startbootstrap-agency/) website's easing. What I mean by easing is when I click on the websites navigation tabs, I would slide to the appropriate portion of the section/div. I think it uses jQuery UI easing (http://api.jqueryui.com/easings/). I'm not sure where to start as I just start learning jQuery and front end development. I think to get started, I would do $("#nav-pill").onclick(function() { // easing methods? })
score: 0
has comment: http://stackoverflow.com/comment/42374832
has answer: http://stackoverflow.com/a/26912690
accepted answer: http://stackoverflow.com/a/26912690
has answer: http://stackoverflow.com/a/26912740
tagged with: frontend
has title: Easing href to div/section of website
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/42371192
type: Comment
comment on: http://stackoverflow.com/a/26910798
has text: thank for your quickly response. I will try and get you feed back
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42492670
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26977327
has text: There aren't any errors
score: 0

http://stackoverflow.com/comment/42430837
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26943272
score: 0
has text: @SajibAcharya I made selVal1 and selVal2 as global variable but it's value aren't displayed in getval function

http://stackoverflow.com/comment/45672746
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28690320
type: Comment
has text: it's scroll offset, i am needs scroll value

http://stackoverflow.com/q/26909869
has body: I have a problem with my dynamic form. This input is: This input have a mask $('#phone').mask('(00)-0000-00000'); Everything works fine, but when I add a button who append a new input after the first the .mask filter doesn't work to the new . How can I apply a dynamic mask in an dynamic form? The .append function is: $('#plusPhone').click(function(){ $('#appendPhone').append(" Phone "); });
has answer: http://stackoverflow.com/a/26910227
has comment: http://stackoverflow.com/comment/42369586
tagged with: dynamic
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/26910227
has title: How can I apply a dynamic mask in an dynamic form?
type: Question
has comment: http://stackoverflow.com/comment/42369521
possible better answer: http://stackoverflow.com/a/27982928
has answer: http://stackoverflow.com/a/27982928
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/42369408

http://stackoverflow.com/q/26941002
has comment: http://stackoverflow.com/comment/42434076
accepted answer: http://stackoverflow.com/a/26958651
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/42433929
has title: Angularjs form imposible to validate
tagged with: javascript
has comment: http://stackoverflow.com/comment/42427432
score: 0
has answer: http://stackoverflow.com/a/26958651
has body: I am facing a peculiar issue with Angularjs 1.3.2 I am trying to setup a form with angular validation, which I did many times before. Only this time there is no way to make my inputs valid. This is what my html looks like: &lt;form name="user.form"&gt; &lt;input name="email" class="form-control" type="text" ng-model="user.email" required&gt; &lt;/form&gt; My controller (this is from a ng-view, since I am using angularjs routes): var mod = angular.module("userEdit", [ "ngRoute" ]); mod.controller('UserEditCtrl', function ($scope) { ... $scope.user = { email : "" }; ... }); And this is the result that I get in Google Chrome's elements console, with empty input : &lt;input name="email" class="form-control ng-pristine ng-untouched ng-invalid ng-invalid-required" type="text" ng-model="user.email" required=""&gt; With non empty input : &lt;input name="email" class="form-control ng-invalid ng-dirty ng-valid-parse ng-valid-required ng-touched" type="text" ng-model="user.email" required=""&gt; There must be something I do wrong but I can't figure out what.
tagged with: validation
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/42434271
tagged with: angularjs

http://stackoverflow.com/comment/42372728
comment on: http://stackoverflow.com/a/26910737
has text: You can check my code and output. Is it matching with what you need?
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/42428967
score: 0
type: AnswerComment
type: Comment
has text: I need to reference the data in Firebase in order to get the data, so this solution will not work. I added the reference to my question to make it more clear.
comment on: http://stackoverflow.com/a/26942618

http://stackoverflow.com/comment/42503689
has text: Did you say object? As it is you selector is targeting the DOM, not some object.
comment on: http://stackoverflow.com/q/26985047
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/42593413
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26989638
has text: Ok thanks [here](http://stackoverflow.com/questions/26994219/disable-jquery-fading-header-menu-function-after-bootstrap-collapse) i opened a new question. Thanks!
score: 0

http://stackoverflow.com/q/26886909
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/26886995
favorite count: 0
possible better answer: http://stackoverflow.com/a/26887088
has answer: http://stackoverflow.com/a/26887088
has body: Everytime an certain image is clicked I fetch some information, to add that information to a string and after that replace the current url with the new one. This is my code so far: jQuery(document).ready(function(){ var kleuren = []; jQuery('.swatch-category-container img').click(function(){ var kleur = jQuery(this).attr('title'); console.log("Selected kleur: " + kleur); var link = jQuery(this).closest('.popup').find('.photo a').prop('href'); kleuren.push(kleur); console.log(kleuren); console.log(kleuren.length); console.log("Fetched link: " + link); var length = kleuren.length -1; var avoid ="?kleur="+kleuren[length]; console.log("Remove string: " + avoid); var news_link = link.replace(avoid,''); var new_link = news_link + "?kleur="+kleur; console.log("Cut string: " + news_link); jQuery('.photo').find('.sendkleur').attr("href", new_link); }); }); This works fine, but the previous data doesn't get removed. For example When the first image is clicked the kleur = zwart that info is put in the url. But when the user clicks another image after that the url will look like ?kleur=zwart?kleur=beige instead just of ?kleur=beige How can I remove the first part?
downvote count: 1
has answer: http://stackoverflow.com/a/26886995
type: AnsweredQuestion
score: -1
type: Question
answer count: 2
has title: jQuery remove string from string doesn't work
upvote count: 0

http://stackoverflow.com/comment/42337638
comment on: http://stackoverflow.com/q/26891846
score: 0
type: Comment
type: QuestionComment
has text: Even if I could inspect the dev tools and grab the table's html I would be happy at this point @dystroy

http://stackoverflow.com/comment/42375026
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26907272
has text: Thanks for your answer - it is exactly the kind of trick I was looking for.
score: 0

http://stackoverflow.com/a/26867505
has body: I can see at least two possible issues there. 1) sub-nav-list is not a children of click element. If they are on the same level something like that might work: $('.click').click(function() { $(this).parent().find('.sub-nav-list').toggleClass('active'); }); 2) You have these elements generated dynamically - so you need use on with selector of any parent element that exists before you dynamically generate your sub-menus (let say nav-list): $(".click").on("click", ".nav-list", function() { $(this).parent().find('.sub-nav-list').toggleClass('active'); });
answers question: http://stackoverflow.com/q/26867244
type: Answer
score: 0

http://stackoverflow.com/q/26908288
score: 9
tagged with: testing
has body: I have a load of tests, and some of them have "(slow)" in the name: Some of them are slower than the tests marked (slow), but are relied on by other tests and so cannot be skipped. I would just like to skip the ones with (slow) in the name—is that possible? I'm using Mocha.
tagged with: javascript
tagged with: mocha.js
has answer: http://stackoverflow.com/a/26931288
has comment: http://stackoverflow.com/comment/115621460
possible better answer: http://stackoverflow.com/a/26918709
has title: With mocha, how do I run all tests that *don't* have (slow) in the name?
favorite count: 0
upvote count: 9
has answer: http://stackoverflow.com/a/26918709
answer count: 4
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/55438136
accepted answer: http://stackoverflow.com/a/26931288
has answer: http://stackoverflow.com/a/26918842
tagged with: unit-testing
type: Question

http://stackoverflow.com/q/26989168
has comment: http://stackoverflow.com/comment/42513411
score: 0
answer count: 1
has title: Javascript separating text from anchor tags
type: UnansweredQuestion
tagged with: regex
has body: I am facing difficulties in generalizing a string using REGEX in javascript. I have a string which contains a couple of anchor tags, containing text that can be anything like: &lt;b&gt; text &lt;a href="javascript:opendynamicurlwindow('http://www.google.com', '', '', '', '','no')"&gt;www.google.com&lt; /a &gt;&lt;abc&gt;&lt;a href="javascript:opendynamicurlwindow( 'http://www.flipkart.com', '', '', '', '','no')" &gt;www.flipkart.com&lt;/a&gt;&lt;/b&gt; I need to convert this text to html compatible values excepting anchor tags i.e. 1. &lt;b&gt; text should be encoded as &amp;lt;b&amp;gt; text 2. &lt;abc&gt; should be encoded as &amp;lt;abc&amp;gt; text 3. &lt;/a&gt; should be encoded as &amp;lt;/a&amp;gt; text I am having troubles in seperating the text and anchor tags so that i can process them correctly. I have tried regex : (]>+.&lt;+.*/a>) but matching is not working for multiple urls.
has comment: http://stackoverflow.com/comment/42510452
has comment: http://stackoverflow.com/comment/42512374
type: Question
tagged with: anchor
tagged with: tags
tagged with: javascript
has answer: http://stackoverflow.com/a/26989850

http://stackoverflow.com/comment/42243280
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/26839183
has text: position: { my: "right bottom", at: "right top", collision: "flip" }, and position: { my: "left bottom", at: "left top", collision: "flip" }, things is on both the option I can't see any significant change in the autocomplete box.. as-if the parameter is not taken at all..below is my complete code.. $ (function() { $ ("#search").autocomplete( { position: { my: "right bottom", at: "right top", collision: "flip" }, source:uris }) });

http://stackoverflow.com/comment/42343832
has text: Note that `.bind` maps to `.on` in current version of jQuery. `.toggleClass` will add or remove class based on the index of your click (defaults to 0).
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26895194
type: Comment

http://stackoverflow.com/comment/42475621
comment on: http://stackoverflow.com/q/26969579
type: QuestionComment
type: Comment
has text: I don't know thy, but adding `locals = locals || {};` as first instruction for the `getUser()` function solved this issue. Does anyone have an explanation?
score: 0

http://stackoverflow.com/comment/42270367
comment on: http://stackoverflow.com/a/26853761
type: AnswerComment
score: 0
type: Comment
has text: True (although `.on()` is needlessly expensive if the target *won't* be modified). Either way, tangential to the problem at hand.

http://stackoverflow.com/a/26924119
type: Answer
has body: I don't believe there is a way of doing it when you are redirecting the browser like that. If you were instead provide the download via link you could use the download attribute to suggest a filename. Not all browsers support the download attribute` at this time.
accepted answer of: http://stackoverflow.com/q/26923743
answers question: http://stackoverflow.com/q/26923743
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/42344018
comment on: http://stackoverflow.com/a/26891763
type: Comment
score: 0
type: AnswerComment
has text: @Dwza `$content.length` here means the result of the `.find(selector)` found at least one element, regardless of their contents.

http://stackoverflow.com/q/26853217
answer count: 2
tagged with: minify
favorite count: 0
has title: how to have part of some JS code NOT being minified by minifiers
linked to: http://stackoverflow.com/q/3012337
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42269139
has comment: http://stackoverflow.com/comment/42269027
score: 0
has comment: http://stackoverflow.com/comment/42269223
has body: There are many tools out there to "compress" more or less javascript files by mangling variable names, removing comments, etc... But how to "tell" them to NOT process a part of a file, from this file. I need to "tell" them somehow, by even rewriting that part another way, or putting some tags in comments, ... to NOT process some parts of my files. The easiest but very ugly solution I found was to put my code in a string and eval it. But if there is any other solution I'd love to know it because eval is UGLY! UPDATE: please due to my requirements, those are not possible answers: the file HAVE to be minified it needs to be done FROM WITHIN the source code
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/42269049
has answer: http://stackoverflow.com/a/26854238
has comment: http://stackoverflow.com/comment/42269003
type: Question
has comment: http://stackoverflow.com/comment/42268980
tagged with: uglifyjs
tagged with: javascript
has comment: http://stackoverflow.com/comment/42269197
has answer: http://stackoverflow.com/a/26853431

http://stackoverflow.com/q/26976486
score: 0
tagged with: api
tagged with: spotify
answer count: 1
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26978064
has body: I've completed the spotify tutorial (on their developer site) that prints a users information on screen, via the web API which runs using Node.js. I've now edited my app.js file to include all permissions for the site to look / edit into user's music and playlists. I'm now (as a test) trying to print a users playlists on screen, however, don't know how as I need the Spotify user ID as part of the URL to call the JSON array. It'll be spotifyurl.com/me/[useridgoeshere]/playlists. The user ID is printed in the html, which takes it from the JSON array. How would I go about taking the ID from the html and adding it to my javascript so I can make the call for the correct playlist array? $.ajax({ url: 'https://api.spotify.com/v1/me', headers: { 'Authorization': 'Bearer ' + access_token }, success: function(response) { userProfilePlaceholder.innerHTML = userProfileTemplate(response); userNavPlaceholder.innerHTML = userNavTemplate(response); $('.login').hide(); $('.loggedin').show(); } }); This is the code for making the call for the user information and this is the URL I need to make the playlists request: https://api.spotify.com/v1/users/{USERID}/playlists Many thanks for your help, I'm very new to this and having googled concatenating strings and variables I wondered if anyone could help.
tagged with: node.js
has title: Printing information from the Spotify URI with Node JS
type: Question
tagged with: javascript

http://stackoverflow.com/q/26837523
has comment: http://stackoverflow.com/comment/42245756
has comment: http://stackoverflow.com/comment/42248422
answer count: 0
type: UnansweredQuestion
tagged with: jsfiddle
has body: I was working on a fairly large prototype in jsFiddle (which I've used many times for a similar purpose), and got an unpleasant shock when I hit the 'Update' button only be sent straight to http://jsfiddle.net with a completely empty code editor. Luckily hitting 'Back' in the browser was sufficient to recover the lost code. But I quickly found that my code could not be saved, and that the problem didn't seem to affect any other bit of code on the site. After a lot of trial and error, I determined that the code could not be saved due to the following benign-looking line: window.location.href = "/u/deleteReport?reportId=" + reportId; In fact, it appears that it's impossible to save any code (not even the most trivial of examples) on jsFiddle that contains window.location.href.*=.*;. I'm a bit surprised by this fact, and wondering if anyone knows why this limitation exists? It seems somewhat arbitrary and also entirely ineffective, as things like window["location"].href = "..."; are still allowed. Here's an example; the following code can be saved in jsFiddle without any problems: var path = window.location.href; $("a").click(function(e) { window["location"].href = path; }); ...while trying to save this equivalent code will dump you straight to the jsfiddle index page: var path = window.location.href; $("a").click(function(e) { window.location.href = path; }); Refer this Fiddle Does anyone know of an explanation for why this happens?
has comment: http://stackoverflow.com/comment/42305506
type: Question
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/42257935
has title: jsFiddle blocks any code containing 'window.location.href = ...'?
tagged with: javascript
score: 4
favorite count: 0

http://stackoverflow.com/comment/42274801
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26856318
has text: Bill, what I'm trying to do is create a JSON from a dynamic web page. My on a webpage has a name of "name.address[0].zipcode". With JQuery I can say assign (accountinfo, {{inputName}}, {{inputVal}}). (I'm obviously doing a split by ".") I want to add another address, so I jsut hit a +, the jquery dynamically increments the # so the next input box will have a name of name.address[1].zipcode.

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

ticker
tags question: http://stackoverflow.com/q/26869763
type: Tag
tag name: ticker

http://stackoverflow.com/a/26875327
type: Answer
has body: Module IDs with exclamation points are AMD loader plugins. The part before the exclamation point is the module ID of the loader plugin module, and the part after the exclamation point is plugin-specific information that the plugin module uses to decide what to do. intern!object loads the intern plugin module and then tells it "object" (which causes the plugin to load the object interface API) intern/chai!assert loads the intern/chai plugin module (and tells it to load the assert-style API) intern/dojo/has!host-browser?tests/utils (there should not be a node_modules in this mid) loads the dojo/has module from Intern’s internal copy of Dojo, and uses it to load tests/utils if the host-browser feature detection test is true (otherwise it loads nothing).
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26874905
downvote count: 0
score: 8
accepted answer of: http://stackoverflow.com/q/26874905
upvote count: 8

http://stackoverflow.com/comment/42251827
comment on: http://stackoverflow.com/a/26842752
type: AnswerComment
score: 0
type: Comment
has text: Please feedback the other answer.

http://stackoverflow.com/comment/42475213
has text: In that code do an `alert($("a").length)`
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26969425
score: 0

http://stackoverflow.com/comment/42413552
comment on: http://stackoverflow.com/q/26934470
score: 0
has text: @adeneo he says "digits", so it's the length.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/42408559
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/26931568
type: Comment
has text: did you include angular.js and the app.js ? using

http://stackoverflow.com/comment/42451207
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26910647
score: 0
has text: Thanks ... the code in your extension is long and complex. Please can you provide a simplified code snippet (or extension) that demonstrates the problem and I will investigate.

http://stackoverflow.com/q/26837132
linked to: http://stackoverflow.com/q/26837334
type: Question
has title: Fluent interface by chaining AJAX promises?
has comment: http://stackoverflow.com/comment/72334816
tagged with: javascript
tagged with: jquery
tagged with: ajax
has body: I am trying to achieve the below API for queuing AJAX promises to execute later. I do not understand how I can pass multiple promises up the chain. Here is where I want to be if possible: MyObj.ancestor(99) .parent(98) .child(97) .done(function (resp) {...} Can I pass ancestor's promise to parent, then to pass it down to child, and finally to 'done' in that order?
upvote count: 1
has comment: http://stackoverflow.com/comment/42239747
answer count: 1
favorite count: 0
tagged with: fluent-interface
tagged with: promise
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42241858
has comment: http://stackoverflow.com/comment/42241899
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/26838438
has comment: http://stackoverflow.com/comment/42242069

http://stackoverflow.com/comment/42322697
score: 4
comment on: http://stackoverflow.com/q/26883621
type: Comment
type: QuestionComment
has text: *With URLEncode is the problem that if the Querystring contains spaces between the Name and the "plus" sign, the spaces also get converted to "plus" signs.* - that is what *should* happen. A plus sign denotes a space. An encoded plus sign denotes a plus sign. Sounds like you have already solved this problem.

http://stackoverflow.com/comment/42354216
comment on: http://stackoverflow.com/q/26899886
has text: A CSS mask or clip-path would be the simplest approach AFAICS. Plus it has the advantage over Canvas in that the masked images can remain interactive (CSS effects on hover etc). The trickiest part would be just making sure that the images are positioned in the grid so that they are visible on the map, and not off in the sea areas somewhere.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26922097
tagged with: javascript
score: 0
answer count: 1
has body: I am very new to web technologies. I don't even know what keywords to search with, so please bear with me. I want to make a hybrid web app. The user visits the site and gets a login prompt to verify his/her identity via facebook. When the use logs in correctly, they are allowed to query the database on my website. If the login fails, they cannot query my database. I do not want any heavy duty SDKs or special purpose libraries. Is there a shortcut, lightweight implementation? thank you for the help!
tagged with: angularjs
tagged with: android
tagged with: facebook
has answer: http://stackoverflow.com/a/26923653
has title: authenticating via facebook to update another database
type: AnsweredQuestion
tagged with: ionic-framework
type: Question
accepted answer: http://stackoverflow.com/a/26923653

http://stackoverflow.com/comment/42468203
comment on: http://stackoverflow.com/q/26965154
has text: The way this site works is you have to post (in your question) the relevant code and THEN people will help you figure out how to change it to achieve your goal. No code and you will rarely get a good answer. Include the relevant code and you will often get a good answer. Do not expect us to go try to guess what the relevant code is in some offsite resource. That is not the way this site works for a variety of reasons.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/26836468
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26836543
upvote count: 2
has title: on jquery, how to manually define image src into html tag
type: Question
has answer: http://stackoverflow.com/a/26836968
tagged with: javascript
has body: i'm trying to create a page filled with thumbnails, and on click, another div Full(to show the thumbnail image in full screen) will pop out, i will retrieve the src of the thumbnail img and pass into the Full div to display the clicked image. This is what i have so far, fiddle: http://jsfiddle.net/mwhLoyy8/1/ for now i am detecting test_img click, and retrieving from js with img = $(' ', {src : this.src, 'class': 'full_image_pic' }); this.src works fine, but i want to change to detecting on img_section instead of test_img, but i don't know how to retrieve the src, i tried this.test_img.src but it doesn't work. Reason why i want to detect the div instead of the img directly is because in my real working file i have overlay another and while mouseover on the thumbnails, which the detection will not work on the words, since i only make it image-detectable only, so i want to change to detecting the parent div instead. Another thing is, once i display the full image, how do i display unique Title & description under the full image displayed? Please guide me! Thanks for Kamal Title My desc
tagged with: image
accepted answer: http://stackoverflow.com/a/26836543
possible better answer: http://stackoverflow.com/a/26836968
has answer: http://stackoverflow.com/a/26836504
answer count: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/42238640
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/a/26928463
answers question: http://stackoverflow.com/q/26928133
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/26928133
upvote count: 1
type: AcceptedAnswer
has body: You can write one more function which returns value based on status. Like this HTML {{item.status}}% JS $scope.result=[ { id: 0, name: "Abc", status: "InProgress" }, { id: 0, name: "Abc", status: "InHold" } ] $scope.getStatusValue(st) { if(st == "InProgress") { return 30; } else if(st == "InHold") { return 10; } } It will work.
type: Answer

http://stackoverflow.com/q/26869050
has answer: http://stackoverflow.com/a/26869821
accepted answer: http://stackoverflow.com/a/26869821
type: AnsweredQuestion
has title: JS popup does't works comparison operator
has comment: http://stackoverflow.com/comment/42305050
type: Question
has comment: http://stackoverflow.com/comment/42298118
has comment: http://stackoverflow.com/comment/42297785
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42302332
score: 0
has body: I have 5 link and mini preview photo and url 3 links its good link opsss and upsss is wrong when i click good link i'm going to new page when i click error link attr href change to adresError and then we have popup This only works for the first time second time click all links have a popup and should have only opsss and upsss http://jsfiddle.net/3ptktp47/1/ Here is my code : var nameError = [ "opsss", "upsss", ]; $(function() { $('#prev').hide(); $(function() { var title_link = 'kliknij aby podejżeć'; $(".preview-link a") .attr({title: title_link}) //.tooltip() .click(function(){ $('.preview-link a img').css('opacity',1); var sciezka = $(this).attr("href"); var tytul = $(this).attr("title"); var adres = $(this).text(); //alert(adres); $(".duzy").attr({ src: sciezka, alt: tytul, style:'cursor:pointer;', href:'http://www.'+ adres,'target':'_blank'}); $('.link').html(adres).attr({href:'http://www.'+ adres,'target':'_blank'}); $('#prev').show(); function errorDomain() { $('.link, .duzy').removeAttr('href'); $('.link, .duzy').click(function(event){ $('#popup, .popup-bg').show('slow'); $('.server_url').html(adresError).attr({href:'http://'+ adresError,'target':'_blank'}); }); }; if(adres == 'opsss.com'){ var adresError = 'x4ql.nazwa.pl/'+ nameError[0]; errorDomain(); }else if(adres == 'upsss.com' ){ var adresError = 'x4ql.nazwa.pl/'+ nameError[1]; errorDomain(); }else{ //$('#popup, .popup-bg').fadeOut(); }; $('.cancel, .popup-bg').click(function(event){ $('#popup, .popup-bg').fadeOut(); }); return false; }); $('.close').click(function(){ $('#prev').hide(); }); $('.link').mouseover(function(){ $(this).css({style: 'color:#000;'}); }); }); });
answer count: 1

http://stackoverflow.com/comment/42381382
type: Comment
type: QuestionComment
score: 0
has text: What behavior are you looking for once user inputs the weight?
comment on: http://stackoverflow.com/q/26916069

http://stackoverflow.com/q/26884484
type: Question
has answer: http://stackoverflow.com/a/55113215
has title: How to pass the text pasted in a textbox to javascript function using onPaste event?
has comment: http://stackoverflow.com/comment/42324899
has comment: http://stackoverflow.com/comment/42324344
tagged with: javascript
has comment: http://stackoverflow.com/comment/42324360
answer count: 3
score: 3
downvote count: 0
accepted answer: http://stackoverflow.com/a/26884685
has answer: http://stackoverflow.com/a/26884597
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/26884597
tagged with: input
has comment: http://stackoverflow.com/comment/42324962
type: AnsweredQuestion
tagged with: paste
upvote count: 3
has comment: http://stackoverflow.com/comment/42324534
has comment: http://stackoverflow.com/comment/42324244
has body: I have an HTML page like this: &lt;html&gt; &lt;body&gt; &lt;input type="text" onPaste="return myfunction()"&gt;&lt;/input&gt; &lt;/body&gt; &lt;/html&gt; I have a javascript like this: function myfunction(){ var text = ; if(text == "ABC"){ alert("Accepted"); return true; } else{ alert("Rejected"); return false; } } I want to assign the pasted String to the var text This question may seem like a duplicate. But, I want to acheive this without jquery.
has answer: http://stackoverflow.com/a/26884685

http://stackoverflow.com/a/26971121
answers question: http://stackoverflow.com/q/26970405
type: Answer
has body: I think Istambul is the tool you are looking for.
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/comment/42533382
score: 0
comment on: http://stackoverflow.com/a/26978323
type: AnswerComment
type: Comment
has text: @TyLo It's also difficult to see what the problem is here. Have you tried isolating your code into something like JSFiddle? Have you checked the link Asik posted as a comment?

http://stackoverflow.com/comment/42368090
has text: possible duplicate of [Is floating point math broken?](http://stackoverflow.com/questions/588004/is-floating-point-math-broken)
comment on: http://stackoverflow.com/q/26909128
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/q/26852890
has answer: http://stackoverflow.com/a/26853013
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26852962
has title: 'Replace' changes entire src and not just the ending.. why?
type: AnsweredQuestion
tagged with: jquery
accepted answer: http://stackoverflow.com/a/26853013
type: Question
has body: Situation: I have ten gray divs (each with an image and text) as buttons. I want the buttons to have a darker text and darker image when active. When the active button is clicked I want it to deactivate. I also want it to deactivate when another button becomes active. Problem: When I replace the ending on the image sources, it changes the complete source on the images to the same as the active one... which changes all the other images to the same icon. jsfiddle: http://jsfiddle.net/messedUP90/gtf1dk0m/ Warning: The jsfiddle shows the problem I am having with all the other images changing to be the same but for some reason the active image does not change color. It works fine in Dreamweaver so I am not too concerned about that. $(document).ready(function(){ var x = 300; $("[id^=pport]").click(function () { var src = $('.butt', this).attr('src'); if($(this).hasClass('highlight')){ $(this).removeClass('highlight'); $('.butt', this).attr('src', src.replace(/_dark(\.[^.]+)?$/, '_light$1')); } else{ $('.butt').removeClass('highlight'); $('.butt').attr('src', src.replace(/_dark(\.[^.]+)?$/, '_light$1')); $('.talk').fadeOut(x); $(this).addClass('highlight'); $('.butt', this).attr('src', src.replace(/_light(\.[^.]+)?$/, '_dark$1')); } }); });
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/26852962

http://stackoverflow.com/a/26978552
answers question: http://stackoverflow.com/q/26978404
score: 0
type: Answer
has body: Since you do not have access to the Layout, you really can't remove them before they're loaded and parsed by the user's browser. If you need them for some pages and not others, there is no harm loading them for all pages since the browser should cache them on the first request and use the cache on each additional request. A little overhead on initial page load, but should be insignificant for future page loads

http://stackoverflow.com/q/26912442
score: 1
has body: I would like to somehow hide the keyboard shown in iOS whenever I focus in a textfield. When I say "focus", I would still like to be able to type in stuff from an external keyboard, but the iOS virtual keyboard should not be displayed. Stuff from previous SO questions which are not applicable: [textfield resignFirstResponder] --> hides the iOS keyboard but cannot take input events from external keyboard anymore. [view endEditing: YES] --> does not work. sSame as above. javascript onblur() outoffocus not applicable. Does anybody out there know a way to just hide the keyboard but still listen to key events?
type: Question
downvote count: 0
tagged with: ios
has answer: http://stackoverflow.com/a/27208020
tagged with: javascript
tagged with: keyboard
favorite count: 0
answer count: 1
has title: Hide the iOS keyboard maintaining focus on textfield
accepted answer: http://stackoverflow.com/a/27208020
upvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/q/26850065
tagged with: http
type: Question
has body: I'm currently learning NodeJS with the tutorial LearnYouNode. It's pretty great, but I'm stuck on an error, that I can't troubleshoot. Here's a part of the code I try to run. It should work as expected (I check solutions, it's ok). http.get(url+query, function(response){ var content = ""; response.setEncoding("utf8") response.on('data',function(data){ content += String(data) }) response.on('end',function(){ content = JSON.parse(content) content.forEach(function(item){ results.push(item.name) }) return results }) }).on('error',function(e){ console.log(e.message) }) But it doesn't. That's why I made a log on 'error' event. Here's what it returns : connect ECONNREFUSED The thing is : it just appeared suddently, I didn't modify the code. What's wrong there ?
has comment: http://stackoverflow.com/comment/42262595
tagged with: javascript
has title: LearnYouNode : connect ECONNREFUSED with http
score: 0
has comment: http://stackoverflow.com/comment/42263309
type: UnansweredQuestion
tagged with: node.js
answer count: 0

http://stackoverflow.com/comment/42383598
type: Comment
comment on: http://stackoverflow.com/a/26917334
has text: this does the same thing I already have except it still reloads the html and javascript inside the page instead of "blowing it up into" the dialog.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42463432
type: AnswerComment
has text: Apologies. Rushing - bad form. Udated with correction - price.toString(2). I do recommend using float to preserve low order positions in case you ever want to use fractional prices. Test with gildan and XXL.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26961243

http://stackoverflow.com/comment/42420459
type: QuestionComment
has text: @Indra : I am getting the error from the first part of the script ie Uploading the file.
score: 0
comment on: http://stackoverflow.com/q/26937426
type: Comment

http://stackoverflow.com/a/26982324
accepted answer of: http://stackoverflow.com/q/26981860
upvote count: 1
score: 1
has body: I don't have your car image, but it seems like you have a setInterval set to 30ms and you call a timeout every 10ms (which is equivalent to a setInterval), each time clearing the canvas, hence creating a flickering. You should have only one repaint function that should clear the canvas, draw the car and then draw the circle. try //Setting the canvas and context var canvas = document.getElementById('gameCanvas'); var context = canvas.getContext('2d'); //Uploading car var car = new Image(); car.src = "file:///H:/Desktop/Game/img/car.png"; //Setting properties of car var x = 450; var y = 730; var speed = 10; var angle = 990; var mod = 0; //Event listeners for keys window.addEventListener("keydown", keypress_handler, false); window.addEventListener("keyup", keyup_handler, false); //Drawing the car turning and changing speed function draw() { x += (speed * mod) * Math.cos(Math.PI / 180 * angle); y += (speed * mod) * Math.sin(Math.PI / 180 * angle); context.save(); context.translate(x, y); context.rotate(Math.PI / 180 * angle); context.drawImage(car, -(car.width / 2), -(car.height / 2)); context.restore(); } //Setting the keys function keyup_handler(event) { console.log('a'); if (event.keyCode == 38 || event.keyCode == 40) { mod = 0; } } //Setting all of the keys function keypress_handler(event) { console.log(event.keyCode); if (event.keyCode == 38) { mod = 1; } if (event.keyCode == 40) { mod = -1; } if (event.keyCode == 37) { angle -= 5; } if (event.keyCode == 39) { angle += 5; } } var context = $('#gameCanvas')[0].getContext('2d'); var width = $('#gameCanvas').width(); var height = $('#gameCanvas').height(); var circleX = width / 2; var circleY = height / 2; var circleVX = 1.0; var circleVY = 0.0; var circleR = 30; function update() { context.clearRect(0, 0, width, height); /* circleX = Math.random() * (width - 2 * circleR) + circleR; circleY = Math.random() * (height - 2 * circleR) + circleR; */ draw(); drawCircle(circleX, circleY, circleR); setTimeout(update, 10); } f…
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26981860
type: Answer

http://stackoverflow.com/comment/42478713
type: Comment
comment on: http://stackoverflow.com/a/26935873
has text: strange enough $("input:checkbox").serialize(); serializes it
score: 0
type: AnswerComment

http://stackoverflow.com/q/26916258
downvote count: 1
has answer: http://stackoverflow.com/a/63133397
tagged with: google-maps
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/37055770
has body: Im writing a GeoJson layer for Google Maps that uses different kinds of Features, styled dynamically. I cant find a way to plot LineStrings as geodesic lines. I have to make a feature request for Google Maps API or I'm missing something?
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26917306
favorite count: 0
accepted answer: http://stackoverflow.com/a/63133397
has answer: http://stackoverflow.com/a/26917306
type: Question
upvote count: 3
has title: Geodesic Lines on GeoJSON features on google maps
answer count: 3
tagged with: geojson

http://stackoverflow.com/q/26913931
tagged with: forms
downvote count: 1
type: Question
has title: Reveal an element upon successful form submission
upvote count: 0
tagged with: javascript
tagged with: jquery
score: -1
has body: I have a form on a wordpress site using a contact form plugin and I would like to reveal a div after the form is submitted successfully. I tried using jquery to reveal the div upon submit with .submit() but in that case it calls the div to show up whenever the submit button is clicked regardless of whether or not the form was submitted successfully. Can anyone help me with this as to how to validate whether or not the form was submitted successfully before running the reveal function? My jquery and html is below! Thanks! some text to be displayed here
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26914844

http://stackoverflow.com/comment/42440229
comment on: http://stackoverflow.com/q/26949187
has text: @self To show converting it to a boolean myself made it `true`. How would you recommend me do it? I don't think doing `if(42)` is clear that I made it into a boolean (at least for people who don't know JS well).
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26913085
tagged with: hyperlink
tagged with: javascript
type: UnansweredQuestion
type: Question
tagged with: dojo
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/26918261
has title: creating a dialog box on link click, javascript part 2
linked to: http://stackoverflow.com/q/26897317
has answer: http://stackoverflow.com/a/26913808
has body: Thanks to Frank's answer to my original post creating a dialog box on link click, javascript I got the sample code to launch a dialog from a button to work. Now I want to launch a dialog box from a link click. I've tried to add a function to the code that is run on a link click, but it just launches a blank page with a server error. What is wrong? show show EDIT Here is updated code based the answer below, still getting same error Uncaught ReferenceError: showDialog is not defined': show show
tagged with: dialog

http://stackoverflow.com/comment/42389314
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26920397
has text: Thanks you John. That definitely works perfectly. One newbie question so by running .each() and setting $element = $(this) that is what would allow me to put the same "container" class on all my containers yet have it run independently on each one?
type: AnswerComment

http://stackoverflow.com/a/26900097
answers question: http://stackoverflow.com/q/26900080
has comment: http://stackoverflow.com/comment/42352849
has body: First of all if you want even number from 1 to 1000 your iteration variable should start from 1, not 0. :) To write odd numbers after even ones you can just put another loop behind the first one with if(i%2==1) and it should be fine!
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/115820580

http://stackoverflow.com/q/26930531
has comment: http://stackoverflow.com/comment/42406301
favorite count: 0
has answer: http://stackoverflow.com/a/69979493
accepted answer: http://stackoverflow.com/a/27274600
has comment: http://stackoverflow.com/comment/42413961
downvote count: 0
has comment: http://stackoverflow.com/comment/42406295
tagged with: d3.js
has body: I'm rendering a tree layout with d3.js. I need to use the nodeSize option because the number of nodes and breadth/depth is widely variable (data is loaded dynamically). Now I have an image export feature too, and I would like to be able to dynamically resize the SVG canvas according to the final tree to make it "best fit" to the canvas, resulting a nice looking image output. Is there any way to get/compute/query the final tree size after the tree has been rendered?
has comment: http://stackoverflow.com/comment/42406517
type: Question
has answer: http://stackoverflow.com/a/27274600
type: AnsweredQuestion
score: 1
answer count: 2
has comment: http://stackoverflow.com/comment/42407101
upvote count: 1
has comment: http://stackoverflow.com/comment/43018099
tagged with: javascript
has title: D3.js get the rendered dimensions of a tree when nodeSize is specified
has comment: http://stackoverflow.com/comment/42412822
possible better answer: http://stackoverflow.com/a/69979493

http://stackoverflow.com/a/26896460
score: 0
has body: It's not normal behavior, You need to bind your text box. your are just setting the value in you text box but not binding like this &lt;input type="text" ng-model="SelectedValue" value="{{SelectedValue}}"/&gt; Here is the updated code.enter link description here Demo Fiddle
type: Answer
answers question: http://stackoverflow.com/q/26895859

http://stackoverflow.com/q/26875466
type: AnsweredQuestion
has body: I am trying to make a month picker using a directive. I defined the months as an array of index/name objects and use ng-options to create a select drop-down in a directive. My goal is to pass in the month as a local scope variable, update the variable, and have it in the form of readable html (like this:) &lt;month-select month="myMonth"&gt;&lt;/month-select&gt; So far I pass the month as an integer but it comes out as an object once I make a selection. e.g. IN 1: User selects Jun: OUT { value : 6, name : 'Jun' } I just want the model value to become 6. Here is my directive: app.directive('monthSelect', function () { return { restrict : 'E', replace : true, scope : { month: '=' }, controller : function ($scope) { $scope.months = []; $scope.month_names = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]; $scope.month_indexes = [0,1,2,3,4,5,6,7,8,9,10,11]; $scope.month_names.forEach(function (mn, i) { $scope.months.push({ value : i+1, name : mn }); }); }, template : '&lt;select ng-model="month" ng-options="m.name for m in months track by m.value"&gt;&lt;/select&gt;' }; }); Is there a way to change it so that it updates only the month index? Here is a plunkr: http://plnkr.co/edit/LVqRUCVO6Rpr9QlDtacQ?p=preview
has answer: http://stackoverflow.com/a/26875629
accepted answer: http://stackoverflow.com/a/26875629
type: Question
tagged with: angularjs-directive
tagged with: javascript
has title: how to return index of object from ng-options in angularjs directive
score: 0
answer count: 1
tagged with: angularjs

asp.net
tags question: http://stackoverflow.com/q/26969414
tags question: http://stackoverflow.com/q/26986661
tags question: http://stackoverflow.com/q/26868251
tags question: http://stackoverflow.com/q/26925967
tags question: http://stackoverflow.com/q/26934201
tags question: http://stackoverflow.com/q/26881963
tags question: http://stackoverflow.com/q/26864320
tags question: http://stackoverflow.com/q/26934872
tags question: http://stackoverflow.com/q/26842668
tags question: http://stackoverflow.com/q/26948782
tags question: http://stackoverflow.com/q/26953149
tags question: http://stackoverflow.com/q/26944435
tags question: http://stackoverflow.com/q/26957957
tags question: http://stackoverflow.com/q/26884931
tags question: http://stackoverflow.com/q/26846519
tags question: http://stackoverflow.com/q/26979095
tags question: http://stackoverflow.com/q/26991037
tags question: http://stackoverflow.com/q/26869390
tags question: http://stackoverflow.com/q/26984488
tags question: http://stackoverflow.com/q/26898817
tags question: http://stackoverflow.com/q/26972553
tags question: http://stackoverflow.com/q/26990646
tags question: http://stackoverflow.com/q/26859170
tags question: http://stackoverflow.com/q/26970730
tags question: http://stackoverflow.com/q/26958209
tags question: http://stackoverflow.com/q/26836881
tags question: http://stackoverflow.com/q/26989430
tags question: http://stackoverflow.com/q/26884176
tags question: http://stackoverflow.com/q/26934180
tags question: http://stackoverflow.com/q/26965664
tags question: http://stackoverflow.com/q/26915279
tags question: http://stackoverflow.com/q/26863833
tags question: http://stackoverflow.com/q/26841312
tags question: http://stackoverflow.com/q/26876477
tags question: http://stackoverflow.com/q/26840000
tags question: http://stackoverflow.com/q/26849430
tags question: http://stackoverflow.com/q/26888831
tags question: http://stackoverflow.com/q/26861654
tags question: http://stackoverflow.com/q/26966161
tags question: http://stackoverflow.com/q/26886196
tags question: http://stackoverflow.com/q/26978112
tags question: http://stackoverflow.com/q/26883621
tags question: http://stackoverflow.com/q/26970974
tags question: http://stackoverflow.com/q/26990987
tags question: http://stackoverflow.com/q/26942090
tags question: http://stackoverflow.com/q/26838699
tags question: http://stackoverflow.com/q/26969618
tags question: http://stackoverflow.com/q/26899734
tags question: http://stackoverflow.com/q/26861067
tags question: http://stackoverflow.com/q/26988957
tags question: http://stackoverflow.com/q/26935884
tags question: http://stackoverflow.com/q/26857422
tags question: http://stackoverflow.com/q/26862894
tags question: http://stackoverflow.com/q/26879924
tags question: http://stackoverflow.com/q/26985636
type: Tag
tags question: http://stackoverflow.com/q/26966740
tags question: http://stackoverflow.com/q/26982809
tags question: http://stackoverflow.com/q/26944467
tags question: http://stackoverflow.com/q/26880825
tags question: http://stackoverflow.com/q/26837251
tags question: http://stackoverflow.com/q/26895004
tags question: http://stackoverflow.com/q/26897141
tags question: http://stackoverflow.com/q/26901517
tags question: http://stackoverflow.com/q/26857526
tags question: http://stackoverflow.com/q/26840288
tags question: http://stackoverflow.com/q/26943051
tags question: http://stackoverflow.com/q/26981567
tags question: http://stackoverflow.com/q/26929303
tags question: http://stackoverflow.com/q/26902258
tags question: http://stackoverflow.com/q/26933772
tags question: http://stackoverflow.com/q/26903493
tags question: http://stackoverflow.com/q/26927562
tags question: http://stackoverflow.com/q/26908011
tags question: http://stackoverflow.com/q/26853787
tags question: http://stackoverflow.com/q/26980054
tags question: http://stackoverflow.com/q/26908510
tags question: http://stackoverflow.com/q/26893197
tags question: http://stackoverflow.com/q/26878264
tag name: asp.net

http://stackoverflow.com/q/26833752
type: AnsweredQuestion
tagged with: telerik-appbuilder
score: 1
linked to: http://stackoverflow.com/q/12225456
has comment: http://stackoverflow.com/comment/42335702
has answer: http://stackoverflow.com/a/26983772
has comment: http://stackoverflow.com/comment/42383841
has comment: http://stackoverflow.com/comment/42274630
accepted answer: http://stackoverflow.com/a/26983772
type: Question
has comment: http://stackoverflow.com/comment/42384016
upvote count: 1
answer count: 1
has title: Getting animatescroll.js to work in Phonegap/Cordova/AppBuilder
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/12260279
favorite count: 0
has comment: http://stackoverflow.com/comment/42384081
linked to: http://stackoverflow.com/q/9316415
tagged with: cordova
downvote count: 0
has body: I've been struggling trying to get Ram Swaroop's animateScroll.js to work with Telerik's AppBuilder. I need the nice fine-grained control of animateScroll, like pre and post scroll event handling, animation easing and controllable scrolling speed (!). However, no matter what I do the scrolling behavior won't actually happen, even though the jquery animate code that does the work (line 162 ) of animateScroll does seem to fire, at as near as I can tell by instrumenting with console.log. To be clear the behavior I am after is the method in animatescroll where you are scrolling within an existing element as opposed to the default behavior of scrolling the whole page. Scrolling within an element is achieved referencing the containing element as a parameter. Effectively, this approach turns an arbitrary containing div into a "scroller" and can be seen in the demo under the parameter section. I have a large appbuilder project, so I made an essentially empty appbuilder project from Telerik's demo templates and I get the same result. My assumption is this issue would also affect since Phone and Cordova since they are very, very similar. If anyone is able to help with this I'll do my best to submit the tweaked version under the same MIT license to the various cordova/phonegap plugin directories. It's a really nice scroller - if I can get it to work in a hybrid mobile app context. Any suggestions or help appreciated. Html code from the non-working demo project follows, then followed by the complete source of the animatescroll plugin. Thanks, Dave Gerding For Example: Click here to scroll to the last paragraph within this "div" element This "div" element has a class-name "element-demo" which is the value passed for "element" option while calling the plugin. Compzets.com is India's first open source software and freeware publishing site, Download and Upload Open source software and Freeware relevant to the Paid ones for PC,Mac and Linux. It also makes its own Cloud Applications …
has comment: http://stackoverflow.com/comment/42344878

http://stackoverflow.com/q/26884747
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/42325378
linked to: http://stackoverflow.com/q/8988573
has title: Displaying accented character in Javascript
type: Question
has comment: http://stackoverflow.com/comment/42324935
answer count: 1
has comment: http://stackoverflow.com/comment/42325109
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/42325050
tagged with: ajax
has comment: http://stackoverflow.com/comment/42325580
has comment: http://stackoverflow.com/comment/42325960
score: 1
has answer: http://stackoverflow.com/a/26900666
has body: I am having problem displaying accented character in my app; It is showing ⛽ instead of ó. The string is coming from a json file retrieved from a server. Here are the technical details: JSON: (This is the object being retrieved from the server) notice the 3rd key "Relación" the letter "o" is accented. [ { "key": "Canales" }, { "key": "Productos" }, { "key": "Relación con el ejecutivo" } ] Ajax (here is the code to retrieve the information) notice I already added charset=utf-8 as most answers suggest $.ajax({ url: url, type: "GET", dataType: "json", contentType: "application/json; charset=utf-8", success: function(uri){ alert("clintg test: " + JSON.stringify(uri)); } } Alert: (as you can see, it is just showing a box symbol where it's supposed to be -> ó)
has comment: http://stackoverflow.com/comment/42325800
tagged with: non-ascii-characters
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42324758
accepted answer: http://stackoverflow.com/a/26900666

http://stackoverflow.com/a/26927708
type: Answer
type: AcceptedAnswer
has body: There is something in Extendscript that looks like it can execute KeyboardEvents Javascript Tools Guide Look at page 152 initKeyboardEvent() eventObj.initKeyboardEvent (eventName, bubble, isCancelable, view, keyID, keyLocation, modifiersList)
accepted answer of: http://stackoverflow.com/q/26850666
score: 2
answers question: http://stackoverflow.com/q/26850666
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/42478430
type: Comment
comment on: http://stackoverflow.com/q/26971341
has text: U meant element with class name "p-pstctgry-lnk-ctgry" will change and its state need to be stored ?
score: 0
type: QuestionComment

ruby-on-rails
tags question: http://stackoverflow.com/q/26848076
tags question: http://stackoverflow.com/q/26838239
tags question: http://stackoverflow.com/q/26946096
type: Tag
tags question: http://stackoverflow.com/q/26938890
tags question: http://stackoverflow.com/q/26938957
tags question: http://stackoverflow.com/q/26981370
tags question: http://stackoverflow.com/q/26897393
tags question: http://stackoverflow.com/q/26921940
tags question: http://stackoverflow.com/q/26962995
tags question: http://stackoverflow.com/q/26944486
tags question: http://stackoverflow.com/q/26908633
tags question: http://stackoverflow.com/q/26954244
tags question: http://stackoverflow.com/q/26928348
tags question: http://stackoverflow.com/q/26917858
tags question: http://stackoverflow.com/q/26833605
tags question: http://stackoverflow.com/q/26906282
tags question: http://stackoverflow.com/q/26964974
tags question: http://stackoverflow.com/q/26920304
tags question: http://stackoverflow.com/q/26981942
tags question: http://stackoverflow.com/q/26915871
tags question: http://stackoverflow.com/q/26952660
tags question: http://stackoverflow.com/q/26896550
tags question: http://stackoverflow.com/q/26963854
tags question: http://stackoverflow.com/q/26896565
tags question: http://stackoverflow.com/q/26979145
tags question: http://stackoverflow.com/q/26876864
tags question: http://stackoverflow.com/q/26978739
tags question: http://stackoverflow.com/q/26957639
tags question: http://stackoverflow.com/q/26921331
tags question: http://stackoverflow.com/q/26962080
tags question: http://stackoverflow.com/q/26897426
tags question: http://stackoverflow.com/q/26931947
tags question: http://stackoverflow.com/q/26940892
tags question: http://stackoverflow.com/q/26948522
tags question: http://stackoverflow.com/q/26923194
tags question: http://stackoverflow.com/q/26904511
tags question: http://stackoverflow.com/q/26873520
tags question: http://stackoverflow.com/q/26867415
tag name: ruby-on-rails
tags question: http://stackoverflow.com/q/26949941
tags question: http://stackoverflow.com/q/26977623
tags question: http://stackoverflow.com/q/26897874
tags question: http://stackoverflow.com/q/26937601
tags question: http://stackoverflow.com/q/26867974
tags question: http://stackoverflow.com/q/26972185
tags question: http://stackoverflow.com/q/26961325
tags question: http://stackoverflow.com/q/26880328
tags question: http://stackoverflow.com/q/26937244
tags question: http://stackoverflow.com/q/26969206
tags question: http://stackoverflow.com/q/26954898
tags question: http://stackoverflow.com/q/26938130
tags question: http://stackoverflow.com/q/26941962
tags question: http://stackoverflow.com/q/26932182
tags question: http://stackoverflow.com/q/26928418
tags question: http://stackoverflow.com/q/26957310
tags question: http://stackoverflow.com/q/26917358
tags question: http://stackoverflow.com/q/26976079
tags question: http://stackoverflow.com/q/26947879
tags question: http://stackoverflow.com/q/26866117
tags question: http://stackoverflow.com/q/26866750
tags question: http://stackoverflow.com/q/26834799

http://stackoverflow.com/q/26975365
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27018905
has answer: http://stackoverflow.com/a/27018905
tagged with: youtube-data-api
upvote count: 1
tagged with: youtube-api
accepted answer: http://stackoverflow.com/a/27007405
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/35605600
answer count: 3
downvote count: 0
score: 1
has title: youtube api v3 search by keyword javascript
favorite count: 0
has answer: http://stackoverflow.com/a/27007405
linked to: http://stackoverflow.com/q/24586072
has body: The javascript example for "search by keyword" that is given at the google developers page isn't working for me. https://developers.google.com/youtube/v3/code_samples/javascript When I run the code, I get a disabled search box with "cats" inside. Also, the example doesn't explain how to write in the API key as opposed to the Client ID. It says it's possible, but gives no concrete example of how to do it. Can someone point out where this code is going wrong. The code for the two .js files and the html is as follows: auth.js file: // The client ID is obtained from the Google Developers Console // at https://console.developers.google.com/. // If you run this code from a server other than http://localhost, // you need to register your own client ID. var OAUTH2_CLIENT_ID = '__YOUR_CLIENT_ID__'; var OAUTH2_SCOPES = [ 'https://www.googleapis.com/auth/youtube' ]; // Upon loading, the Google APIs JS client automatically invokes this callback. googleApiClientReady = function() { gapi.auth.init(function() { window.setTimeout(checkAuth, 1); }); } // Attempt the immediate OAuth 2.0 client flow as soon as the page loads. // If the currently logged-in Google Account has previously authorized // the client specified as the OAUTH2_CLIENT_ID, then the authorization // succeeds with no user intervention. Otherwise, it fails and the // user interface that prompts for authorization needs to display. function checkAuth() { gapi.auth.authorize({ client_id: OAUTH2_CLIENT_ID, scope: OAUTH2_SCOPES, immediate: true }, handleAuthResult); } // Handle the result of a gapi.auth.authorize() call. function handleAuthResult(authResult) { if (authResult && !authResult.error) { // Authorization was successful. Hide authorization prompts and show // content that should be visible after authorization succeeds. $('.pre-auth').hide(); $('.post-auth').show(); loadAPIClientInterfaces(); } else { // Make the #login-link clickable. Attempt a non-immediate OAuth 2.0 // client flow. The current function is call…
tagged with: youtube

http://stackoverflow.com/comment/42241962
score: 0
type: Comment
type: QuestionComment
has text: I just don't want any server stuff besides yql.
comment on: http://stackoverflow.com/q/26838138

http://stackoverflow.com/comment/42311665
comment on: http://stackoverflow.com/a/26854738
has text: Yes, this is a lot of code. I'm posting the solution that I was able to get to. Could you please try it out to see if it works for you? Anyways, I'm giving plus one for your answer because it addresses the issue as well, thanks a lot!
score: 0
type: AnswerComment
type: Comment

addition
tags question: http://stackoverflow.com/q/26931338
tags question: http://stackoverflow.com/q/26866468
type: Tag
tag name: addition

http://stackoverflow.com/q/26844104
has comment: http://stackoverflow.com/comment/46353790
tagged with: accordion
has comment: http://stackoverflow.com/comment/45206962
tagged with: angularjs
has body: I noticed, when you nest an acordion (angular-mobile-ui) within div with hm-[whatever] directive (angular-gestures), acordion will stop working properly (cant expand or collapse). It's browser independent. E.g. ... Example above will not work, but example below will do: ... Do you know how to fix that? I'm afraid there is a collision between angular-gesture and angular-mobile-ui. Anybody solved this? Edit1: It is possible to use ngTouch instead angular-gestures (ng-swipe-right directive) - which works properly, but it doesnt solve the problem with angular-gestures.
type: UnansweredQuestion
tagged with: collision
answer count: 0
type: Question
tagged with: javascript
has title: Angular gestures and angular mobile ui accordion collision
score: 0

http://stackoverflow.com/q/26973957
has comment: http://stackoverflow.com/comment/42483151
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42483173
has body: my code is not working after adding style property, here it is: $("#instaUser").append("&lt;figure style='"display:inline "'&gt;&lt;img id='"+i+"' src='"+data.data[i].profile_picture+"' alt='pic number "+i+"' height='"+200+"' width='"+200+"'&gt; &lt;figcaption&gt;@"+data.data[i].username+"&lt;/figcaption&gt;&lt;/figure&gt;"); could it be that i used the " in a wrong way?
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
score: -4
has comment: http://stackoverflow.com/comment/42483180
type: Question
has comment: http://stackoverflow.com/comment/42483215
tagged with: javascript
has title: Is there anything wrong in this Javascript line?
has comment: http://stackoverflow.com/comment/42483136
has comment: http://stackoverflow.com/comment/42483134
downvote count: 4
upvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/26974045
accepted answer: http://stackoverflow.com/a/26974045
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/42483312

http://stackoverflow.com/comment/42304852
has text: Laissez les bons tons (*temps*) rouler! ♫
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26869965

http://stackoverflow.com/comment/42303797
comment on: http://stackoverflow.com/q/26872848
type: Comment
type: QuestionComment
has text: replace `opponent` with `player2`
score: 5

http://stackoverflow.com/q/26908685
has body: I am building my first node.js webapp. I don't need to manage users registrations. I just need an admin page wich easly allow updating the content of some pages. I have almost finished the development phase but there is something about security I would like to clarify. ADMIN PAGE: there are 2 level of security: 1) The admin page is linked to mywebsite.com/hexadecimal_string . Maybe it's very stupid but the admin page is a "secret" page. Linking it to mywebsite.com/admin is too much common. Do you think that using an hexadecimal string can be considered a first level of security? 2) Of course there is a password for admin, stored in my database. If the password is right, a temp cookie is setted. Maybe I should encrtypt this password while is posted but I'm not planning to use https. Is there a way, different by using https, to make the posting of the password more secure ? CORS: I don't need CORS but there is a thing that is making me crazy: In the homepage everyone can post some data to server (we are talking about newsletter emails and others personal datas) suppose someone reads the javascript code of the home page(in particular the ajax urls) in same way and he tries to post data to the same urls but using a personal script that skip the validation phase. Of course I did the validation to server also but I'd like to not accept any req coming from personal scripts written by other than me. The server should respond only to requests coming from my javascripts, tha anyone can run accessing to www.mywebsite.com. All other requests coming from different scripts will recieve 500-server error. Now, I read about lot's of people that is tryng to ALLOW CORS. So I was supposing that cors is disabled by default but I tried to post data from another website to mine and the data have been sent without problem and the server responds 200. Why? Can I manage this thing? There are other common things that I need to analyze and manage for security in my situation??
tagged with: ajax
has answer: http://stackoverflow.com/a/26908973
tagged with: node.js
type: UnansweredQuestion
has title: Node js security: CORS, admin page and other things
type: Question
tagged with: javascript
tagged with: security
score: 0
tagged with: cors
answer count: 1

http://stackoverflow.com/comment/42291759
score: 0
type: Comment
type: QuestionComment
has text: If you were linking somewhere, it didn't work?
comment on: http://stackoverflow.com/q/26866196

http://stackoverflow.com/q/26872274
answer count: 1
type: AnsweredQuestion
has body: I have done a e shop to learn some more javascript. A gallery of products is displayed on the products page. If you click on one product, a larger picture with description pops up. The problem is, if you make a search, and after that click on a product, the wrong product shows. It shows the product in the gallery array and not matches. Bad on explaining, but here's the code: /* Create a li element and append to already existing ul Show an image of the product, and below the image show product title and price */ function showItemsList(gallery) { // get ul var ul = document.getElementById("product_list"); // empty its content ul.innerHTML = ""; for(i =0; i &lt; gallery.length; i++) { // get the current product var currentProduct = gallery[i]; // create element li var li = document.createElement('li'); // create product img var productImg = document.createElement('img'); productImg.src = currentProduct.img; productImg.id = i; productImg.className = "thumbnail"; productImg.addEventListener("click", showItem); li.appendChild(productImg); // create caption li.appendChild(document.createTextNode(currentProduct.title + " " + currentProduct.price + "kr")); ul.appendChild(li); } function showItem() { // get the single item div var single_item_page = document.getElementById("single_item"); // empty its content single_item_page.innerHTML = ""; // add the name of the product var h2 = document.createElement('h2'); h2.appendChild(document.createTextNode(gallery[this.id].title)); single_item_page.appendChild(h2); // add the image var productImg = document.createElement('img'); productImg.src = gallery[this.id].img; productImg.className = "single_img"; single_item_page.appendChild(productImg); // add the text var productText = document.createElement('p'); productText.appendChild(document.createTextNode(gallery[this.id].about + " " + gallery[this.id].price + "kr")); single_item_page.appendChild(productText); // add the close button var closeButton = document.getElementById("close_but…
has answer: http://stackoverflow.com/a/26872514
accepted answer: http://stackoverflow.com/a/26872514
type: Question
has comment: http://stackoverflow.com/comment/42302809
tagged with: arrays
tagged with: javascript
score: 0
has title: Search item function gives wrong value in array

http://stackoverflow.com/comment/42462899
score: 0
type: QuestionComment
has text: @Paul Draper: then I agree. If one reads programming language code based on feelings not knowledge, then any programming language is confusing. `a = a + 1;` <--- how silly is it, isn't it? Math taught us it may never be true! JS is sooooo confusing :-D
type: Comment
comment on: http://stackoverflow.com/q/26962278

http://stackoverflow.com/q/26870744
has title: How to disable a button tag with type submit using jquery or javascript?
has body: Can someone help me figure out how to disable a button tag, with type submit, when a form is submitted? Everything I find is showing me how to disable an input tag with type submit. What I currently have is: HTML: Add Booking Jquery: $('#addBookingForm').on('submit', function() { $("#addBooking").attr( "disabled", "disabled" ); }); OR: onsubmit="document.getElementById('addBooking').disabled = 1;" The problem with this is that it does not submit the page. The easiest solution would be to convert the button to be an input but I was hoping it could be done as a button Many thanks!
possible better answer: http://stackoverflow.com/a/26870952
has comment: http://stackoverflow.com/comment/42301249
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/26871019
tagged with: button
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42300275
score: 0
has comment: http://stackoverflow.com/comment/42300350
tagged with: http://stackoverflow.com/tag/html
tagged with: submit
has comment: http://stackoverflow.com/comment/42300332
has comment: http://stackoverflow.com/comment/42300186
has answer: http://stackoverflow.com/a/26871019
has answer: http://stackoverflow.com/a/26870952
type: AnsweredQuestion

http://stackoverflow.com/q/26840288
has comment: http://stackoverflow.com/comment/42246867
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/26849510
has comment: http://stackoverflow.com/comment/42245176
has title: Radio button checked property not changing
tagged with: jquery
tagged with: asp.net
has answer: http://stackoverflow.com/a/26840375
has comment: http://stackoverflow.com/comment/42244990
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42245070
has body: I have a div on which I am appending a table which has input of type radio. After it get rendered, Its checked property is not changing while I click it. What could be the problem? Update 1 I am using Jquery.Ajax to create Markup as below $.ajax({ type: "POST", url: "Leave-Application.aspx/CreateTable", data: "{'dates':'" + formattedDateArray + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { $("#tblLeaveDetails").html(""); $("#tblLeaveDetails").append(msg.d); $("#divLeaveDetails").fadeIn(); $("#divTotal").fadeIn(); } }); [WebMethod] public static string CreateTable(string dates) { string[] dateArray = dates.Split(','); StringBuilder markup = new StringBuilder(" "); markup.Append(@" Date Half Day Full Day "); for (int i = 0; i < dateArray.Length; i++) { string rowid = dateArray[i].Replace('/', '-'); markup.Append(" " + dateArray[i] + " "); markup.Append(" "); markup.Append(" "); } markup.Append(" "); return markup.ToString(); }
has comment: http://stackoverflow.com/comment/42245099
type: Question
has comment: http://stackoverflow.com/comment/42246779
tagged with: javascript

http://stackoverflow.com/comment/42539537
score: 1
has text: just remember the cors only affects browsers, so security has nothing to do with cors.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26988071

http://stackoverflow.com/a/26919605
has comment: http://stackoverflow.com/comment/42387906
score: 1
has body: Adding the CSS properties overflow:hidden and resize:none to a &lt;textarea&gt; should do the trick. JS to prevent ENTER var textarea = document.querySelector('textarea'); textarea.addEventListener('keydown', function (event) { if ( event.keyCode == 13 ) { event.preventDefault(); } })
has comment: http://stackoverflow.com/comment/42387624
upvote count: 1
answers question: http://stackoverflow.com/q/26919487
has comment: http://stackoverflow.com/comment/42387581
type: Answer
downvote count: 0

http://stackoverflow.com/q/26962873
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42463805
tagged with: php
score: 0
tagged with: forms
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
tagged with: email
has title: PHP Calculator form not sending results to email address
answer count: 1
has comment: http://stackoverflow.com/comment/42463765
has answer: http://stackoverflow.com/a/26962951
favorite count: 0
has body: I have a calculator form and i want to send the results to my email address. It's posting the right data, but the response is just showing the full php code instead of "email sent" Here is a working example: http://www.blackcatcoding.co.uk/calculator/calculator.php and here is the php code behind it: &lt;script src="//code.jquery.com/jquery-1.11.0.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function propType(id) { var pprice = document.getElementById('pur_price').value; var rate1 = document.getElementById('select2').value; var refurb = document.getElementById('refurb').value;; document.getElementById('avg_claim_rate').value=id; var result1 = +pprice + + refurb; var result2 = result1 * rate1; document.getElementById('amount_claim').value=result2; } function calculate() { var tax_rate=document.getElementById('tax_rate').value; var amount_claim=document.getElementById('amount_claim').value; var client_benefit=amount_claim*tax_rate; var cash_reclaim=client_benefit*0.36; var future_tax_rel=client_benefit-cash_reclaim; //$('#future_tax_rel').text(future_tax_rel); document.getElementById('future_tax_rel').value=future_tax_rel; document.getElementById('client_benefit').value=client_benefit; document.getElementById('cash_reclaim').value=cash_reclaim; return false; } &lt;/script&gt; &lt;div class="main_box"&gt; &lt;div class="clear"&gt;&lt;/div&gt; &lt;div class="clear"&gt;&lt;/div&gt; &lt;?php $action=$_REQUEST['action']; if ($action=="") /* display the contact form */ { ?&gt; &lt;form action="" method="POST" enctype="multipart/form-data"&gt; &lt;div class="main_col"&gt; &lt;div class="main_col_left"&gt;&lt;strong&gt;BUSINESS NAME:&lt;/strong&gt;&lt;/div&gt; &lt;div class="main_col_right"&gt; &lt;input type="text" name="business" id="business" value="" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="main_col"&gt; &lt;div class="main_col_left"&gt;&lt;strong&gt;EMAIL ADDRESS:&lt;/strong&gt;&lt;/div&gt; &lt;div class="main_col_right"&gt; &lt;input type="text…

http://stackoverflow.com/comment/42499114
has text: When I ran your JSFiddle, it comes up saying `Uncaught ReferenceError: updatePic is undefined`.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26965019

http://stackoverflow.com/q/26862894
tagged with: c#
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26862935
type: Question
has body: In the &lt;head&gt; section of my _Layout.cshtml(master page) file I have the following reference to minified jQuery: &lt;script src="~/Scripts/jquery-1.8.2.min.js" type="text/javascript"&gt;&lt;/script&gt; After adding this line I can now use jQuery in everyone of my pages which reference the master page which is great.What I would like to know is how often is the loading of the jQuery file performed?Will it be done everytime a page is loaded or only once when the first page of the website is loaded in the browser?
answer count: 2
has title: Loading jquery in MVC 4.0 master page
tagged with: javascript
tagged with: jquery
tagged with: asp.net
possible better answer: http://stackoverflow.com/a/26863112
score: 0
has answer: http://stackoverflow.com/a/26863112
has answer: http://stackoverflow.com/a/26862935
has comment: http://stackoverflow.com/comment/42285768
tagged with: asp.net-mvc-4

http://stackoverflow.com/a/30188419
answers question: http://stackoverflow.com/q/26923850
type: Answer
score: 0
has body: To load a "global" store via Ext.getStore(), it must be registered in the application. To do that, ensure it is added to the stores array in your main app class Ext.application({ extend: 'Ext.app.Application', stores: [ add global store classes here ] });

http://stackoverflow.com/q/26921610
score: 0
has comment: http://stackoverflow.com/comment/42391228
has body: I'm stuck on this code...I'm trying to get the html page to, when you click the link, call the bms function, which should open internet explorer, go to google, and fill the search textbox with the word "test". This isn't exactly the website or word I want to use, but I needed to change it since the actual website/words are sensitive information. I want to use this through IE since our processes go through this browswer, specific with also using the -nomerge function. My code is below. Thanks for the help! BMS DAY ​
has comment: http://stackoverflow.com/comment/42391270
type: Question
has comment: http://stackoverflow.com/comment/42428764
tagged with: javascript
answer count: 1
tagged with: wsh
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26921871
has title: html code that executes wsh code through javascript

http://stackoverflow.com/q/26978688
accepted answer: http://stackoverflow.com/a/26980084
has title: If Else Condition with Ajax responseText from PHP
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/42491949
has body: Im building simple login system using Ajax XMLhttpRequest. PHP File and Javascript all working fine.. but when i use response test in IF Else Condition its not working as i expect. Here My HTML Log In Forgot password? Here my Javascript Code. function ajax_post(){ // Create our XMLHttpRequest object var hr = new XMLHttpRequest(); // Create some variables we need to send to our PHP file var url = "http://boost.meximas.com/mobile/login.php"; var fn = document.getElementById("username").value; var ln = document.getElementById("password").value; var vars = "username="+fn+"&password="+ln; hr.open("POST", url, true); // Set content type header information for sending url encoded variables in the request hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); // Access the onreadystatechange event for the XMLHttpRequest object hr.onreadystatechange = function() { if(hr.readyState == 4 && hr.status == 200) { var return_data = hr.responseText; document.getElementById("status").innerHTML = return_data; if(return_data=="true"){ alert("Yes Login True"); }else{ alert("No Login False"); } } } // Send the data to PHP now... and wait for response to update the status div hr.send(vars); // Actually execute the request document.getElementById("status").innerHTML = "processing..."; } Here my PHP Code if(isset($_POST['username']) && isset($_POST['password'])){ $username = $_POST['username']; $password = $_POST['password']; } $sql = "SELECT * FROM member WHERE username = '$username' AND password = '$password'"; $result = mysqli_query($con,$sql); if(!$result){ echo "failed"; }else{ echo "true"; } For the Wrong input also im getting Yes Login True and status inner HTML True that mean PHP file always returning True. but when i check php file alone it works fine.. there is no errors. i meant using this. while($row = mysqli_fetch_array($result)) { echo "Hello" .$row['email']. "Thanks"; } it gives correct output. Im sorry if its unclear.. please let me know.
answer count: 1
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/42492189
tagged with: php
has comment: http://stackoverflow.com/comment/42492105
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42493556
has comment: http://stackoverflow.com/comment/42494339
tagged with: mysql
type: Question
has answer: http://stackoverflow.com/a/26980084

ruby
tags question: http://stackoverflow.com/q/26981370
tags question: http://stackoverflow.com/q/26897393
tags question: http://stackoverflow.com/q/26986879
tags question: http://stackoverflow.com/q/26954244
tags question: http://stackoverflow.com/q/26928348
tags question: http://stackoverflow.com/q/26840694
tag name: ruby
tags question: http://stackoverflow.com/q/26981942
tags question: http://stackoverflow.com/q/26963854
tags question: http://stackoverflow.com/q/26962080
tags question: http://stackoverflow.com/q/26882043
tags question: http://stackoverflow.com/q/26979433
tags question: http://stackoverflow.com/q/26866750
tags question: http://stackoverflow.com/q/26834799
tags question: http://stackoverflow.com/q/26838239
type: Tag

http://stackoverflow.com/a/26976336
accepted answer of: http://stackoverflow.com/q/26976245
has comment: http://stackoverflow.com/comment/42487409
type: AcceptedAnswer
has body: You don't need to use parent. Also you have to remove fixed height from li elements: //Accordion (function($) { var allPanels = $('ul.sub-level').hide(); $('.click-me').click(function() { allPanels.slideUp(); // Problem line $(this).next().slideDown(); return false; }); })(jQuery); ul { list-style: none; padding: 0; margin: 0; width: 400px; } ul li { position: relative; background: #fafafa; margin-bottom: 3px; } ul li > ul { margin-left: 30px; background: #e3e3e3; } .click-me { display: block; width: 20px; height: 20px; position: absolute; top: 0; right: 0; background: #e4f; cursor: pointer; } Link somewhere Link somewhere Link somewhere Link 1 Link 2 Link 3 Link 4 Link somewhere
has comment: http://stackoverflow.com/comment/42487383
downvote count: 0
answers question: http://stackoverflow.com/q/26976245
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/comment/42254222
has text: @Wolf .on('click', ()=> ??? What kind of syntax is it? This is a Typescript syntax equivalent to .on('click', funtion(){});
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26845483

http://stackoverflow.com/comment/42418484
type: Comment
comment on: http://stackoverflow.com/a/26936521
has text: anyway to view in a more friendly manner? how can I join all those strings!
type: AnswerComment
score: 0

http://stackoverflow.com/a/26941527
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42426922
answers question: http://stackoverflow.com/q/26941474
type: Answer
has comment: http://stackoverflow.com/comment/42427135
has body: You could do this easily with jQuery with the .load() function. Use it like this: &lt;script&gt; $(function(){ $("#header").load("header.html"); $("#footer").load("footer.html"); }); &lt;/script&gt; HTML: &lt;div id="header"&gt;&lt;/div&gt; &lt;!--Remaining section--&gt; &lt;div id="footer"&gt;&lt;/div&gt; For more information about the .load() function: http://www.jquery-tutorial.net/ajax/the-load-method/ Hope this helps!
score: 0
has comment: http://stackoverflow.com/comment/42427120
accepted answer of: http://stackoverflow.com/q/26941474
has comment: http://stackoverflow.com/comment/42426896

excel
tags question: http://stackoverflow.com/q/26860643
tags question: http://stackoverflow.com/q/26875778
tag name: excel
tags question: http://stackoverflow.com/q/26920560
type: Tag
tags question: http://stackoverflow.com/q/26979321
tags question: http://stackoverflow.com/q/26937871

http://stackoverflow.com/comment/42347606
type: Comment
has text: @k-nut - When a button is clicked in my eCommerce shop my CMS responds with an alert. I am overriding that behavior and showing a modal of my own.
score: 1
comment on: http://stackoverflow.com/q/26894505
type: QuestionComment

http://stackoverflow.com/a/26856943
has body: You need to use event delegation for the first event handler also $(document).ready(function() { $('.container').delegate('.div1shown', 'click', function(event) { $('.red').hide(); $('.green').show(); $(this).removeClass('div1shown').addClass('div2shown'); console.log('a'); }); $('.container').delegate('.div2shown', 'click', function(event) { $('.green').hide(); $('.blue').show(); $(this).removeClass('div2shown').addClass('div3shown'); console.log('b'); }); }); .box { width: 200px; height: 200px; display: block; } .red { background-color: red; } .green { background-color: green; display: none; } .blue { background-color: blue; display: none; } submit When you use a normal event handler registration as you have done in the first case, the selector is evaluated only one at the registration phase after that the selector is never evaluated that is why even after you change the class the first handler is getting executed. But when you use a delegated event handler the target element selector is executed lazily so it can accommodate changes happened to the element at a later stage.
accepted answer of: http://stackoverflow.com/q/26856902
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26856902
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/42396212
comment on: http://stackoverflow.com/a/26924680
type: AnswerComment
has text: I need to sort my table by the numbers in td id ItemID
score: 0
type: Comment

http://stackoverflow.com/comment/42413970
has text: @adeneo For the moment I only care about that, not the numbers themselves.
type: Comment
comment on: http://stackoverflow.com/q/26934470
score: 0
type: QuestionComment

http://stackoverflow.com/comment/42323722
has text: That's why I have `myClass : { selector: ".myClass" ...`
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26884090
score: 1

http://stackoverflow.com/q/26908864
has body: I have $("#cn-btn-cust-slt").button().click(function () { $("#cn-dialog").dialog({ autoOpen: true, position: { my: "left", at: "top+350", of: window }, width: 700, height: 600, resizable: false, title: 'Customer Selection', modal: true, open: function () { $("#cn-dialog").load("/Customer/CustomerSearch"); }, buttons: { Cancel: function () { $(this).dialog("close"); } } }); }); which returns a partial view and opens it in the dialog Problem is the session values are lost when .load() calls the action (debugged to ascertain). I'm using ASP.NET MVC5 in VS 2013 and running locally from VS. Cookies are enabled. I've tried everything I can find on the internet without success. Session is working fine throughout the application except with jquery dialog. Has anyone any idea? - pulling my hair out (what's left of it) EDIT Here is the controller action that is called by the jquery above public ActionResult CustomerSearch() { string test = SessionManager.DisplayDateFormat; //zit return View(); } It simply returns a view but the session variable has been lost before it returns. For debugging purposes I added the test variable above which gets set to null. I use the code below to get and set session variables which is working fine in all other parts of the application. public class SessionManager { //Session variable constants public const string DATEFORMATVAR = "DisplayDateFormat"; //use generics to work with any type public static T Read&lt;T&gt;(string variable) { object value = HttpContext.Current.Session[variable]; if (value == null) return default(T); else return ((T)value); } public static void Write(string variable, object value) { HttpContext.Current.Session[variable] = value; } public static string DisplayDateFormat { get { return Read&lt;string&gt;(DATEFORMATVAR); } set { Write(DATEFORMATVAR, value); } } } I've successfully debugged the session variable in the controller that serves the view containing the jquery .load() call above. The Session variable value is bein…
has comment: http://stackoverflow.com/comment/42367953
answer count: 0
has title: Why is jQuery to Controller Action clearing Session object?
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/42409999
tagged with: jquery-ui
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/42367733
tagged with: session
tagged with: javascript
has comment: http://stackoverflow.com/comment/42370393
score: 0
has comment: http://stackoverflow.com/comment/42372798
has comment: http://stackoverflow.com/comment/42410131
tagged with: jquery
has comment: http://stackoverflow.com/comment/42372272
has comment: http://stackoverflow.com/comment/42370448

http://stackoverflow.com/comment/42269815
has text: Just to clarify the situation here. If you know that you will only ever have a single instance of the named Object eg Subject1 or Subject2 is it still deemed incorrect to define the function as that defined in Subject2?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26853587

http://stackoverflow.com/comment/42474860
type: Comment
type: QuestionComment
has text: what do you want if the input is `11112341`? Would it be `2341` or `234`?
comment on: http://stackoverflow.com/q/26969189
score: 0

http://stackoverflow.com/q/26944607
tagged with: hyperlink
tagged with: javascript
has comment: http://stackoverflow.com/comment/42432356
accepted answer: http://stackoverflow.com/a/26944627
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/26945524
favorite count: 0
has body: I have this Button CSS written in common for entire theme on all the sliders .btn { font-size: 13px; padding: 9px 20px 12px; margin: 11px 0px 0px; border: 0px; line-height: 19px; white-space: nowrap; opacity: 1; left: 471.5px; top: 292px; transform: scale(1, 1) rotate(0deg); visibility: visible; } I linked the text within this Button. I can access the link only when I click on the text over the button. But my requirement is the link to be accessed when I click anywhere on the button. I tried alot but no luck. Please guide me.
upvote count: 0
has answer: http://stackoverflow.com/a/26944627
downvote count: 2
tagged with: css
type: AnsweredQuestion
has title: Link a button through CSS
has answer: http://stackoverflow.com/a/26945524
type: Question
answer count: 2
score: -2
tagged with: button

http://stackoverflow.com/comment/42487170
comment on: http://stackoverflow.com/q/26975854
has text: I agree. While over normalization is a bad thing, some approaches can be used. A task, for example, needs to be documented. Only one of the fields denotes the group this task is associated with. And even that might change. So moving a task from Team A to Team B changes a lot more in the database than simply changing the reference to the assigned team. Plus, a team may have hundreds of tasks, each associated with additional documentation, information and whatnot. You'll reach the 16MB document limit for a group pretty fast. Another indicator that tasks should be a first class citizen.
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/26843489
downvote count: 0
tagged with: button
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/26843738
tagged with: datepicker
has answer: http://stackoverflow.com/a/26843738
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26843997
type: Question
has body: I have a site where I use two datepickers. The first one selects the departure and the second one the arrival. The second datepicker is opened by the "onClose:" function of the first. Until this point there is no problem. It occurres, when I click on next month in the second datepicker. It seems, that the datepicker closes for half an second and reopens in the same month as before. After that I can normally use the next month button. I don't get the problem. I made a fiddle with the minimal requirements to reproduce the problem, to be sure, there is no other code in my project that produces the problem. Fun fact: It works fine in IE 10 and not in FF/Chrome. Here comes the fiddle: http://jsfiddle.net/xe247evv/1/ &lt;input type="text" value="1.1.1700" class="datepicker" id="datepickerFromDate2" readonly="readonly"&gt; &lt;input type="text" value="5.1.1700" class="datepicker" id="datepickerToDate2" readonly="readonly"&gt; jQuery("#datepickerFromDate2").datepicker({ onClose: function() { jQuery('#datepickerToDate2').datepicker('show'); } }); jQuery("#datepickerToDate2").datepicker(); To reproduce it: Click left datepicker and select date. Click on the right arrow for next month in the new opened datepicker. you'll see a bug. Could someone help me with this strange behavior?
tagged with: jquery-ui
tagged with: javascript
score: 4
has title: jQuery Datepicker opens twice after click on next month (using 2 Datepickers)
upvote count: 4
answer count: 2
has answer: http://stackoverflow.com/a/26843997

http://stackoverflow.com/q/26875339
has body: Kind of basic I guess. I'm writing on a modular application and am often running into having to do something like this: var foo = {}; foo.do_something = function () { //... }; foo.do_something_else = function () { // ... }; foo.do_all = function () { var x = foo.do_something(); // ... }; I prefer to stick with functional programming like this. Question: Is it safe to reference methods declared on foo inside the declaration of other methods? Any better idea on how to do this? Thanks!
has comment: http://stackoverflow.com/comment/42309180
tagged with: functional-programming
upvote count: 1
has answer: http://stackoverflow.com/a/26875449
favorite count: 0
type: AnsweredQuestion
has title: How to correctly reference an method set on an object when declaring a method on this object in Javascript?
tagged with: oop
downvote count: 0
score: 1
possible better answer: http://stackoverflow.com/a/26875449
accepted answer: http://stackoverflow.com/a/26875421
type: Question
answer count: 2
tagged with: javascript
linked to: http://stackoverflow.com/q/10711064
has answer: http://stackoverflow.com/a/26875421

http://stackoverflow.com/a/26964178
has comment: http://stackoverflow.com/comment/42466344
has comment: http://stackoverflow.com/comment/42466235
downvote count: 0
type: Answer
score: 1
answers question: http://stackoverflow.com/q/26964115
upvote count: 1
has body: In a computer program the order of the commands is important. In your program you first compute reducCost from amountPurchased, and THEN you get the input from the user and store it in amountPurchased. But the computation has already finished, and reducCost will not be changed by this input.

http://stackoverflow.com/a/26836987
has comment: http://stackoverflow.com/comment/42340253
has comment: http://stackoverflow.com/comment/42239546
has comment: http://stackoverflow.com/comment/42239457
upvote count: 2
has body: First, for other people who might be looking to reverse an array for a real problem rather than homework, use Array.reverse, don't waste you time trying to implement it yourself. If you absolutely must, then the trick here would be to pass a smaller array (minus the first and last elements by using slice) when you recurse and rebuild the final array as you unwind using concat. For example: function ReverseArray(arr) { if (arr.length &lt; 2) { return arr; } else { var first = arr[0]; var last = arr[arr.length - 1]; return [last].concat(ReverseArray(arr.slice(1, length - 1))).concat([first]); } } alert(ReverseArray([1,2,3,4,5]));
answers question: http://stackoverflow.com/q/26836808
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/comment/42327049
has text: Now ,Again ,Show your 2 Checkboxes u use in image Edit question.
comment on: http://stackoverflow.com/a/26885577
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/26911629
answers question: http://stackoverflow.com/q/26911279
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26911279
type: Answer
has body: You can change it via Javascript : var image = document.getElementsByTagName("img")[0]; image.setAttribute("bs-tooltip", "your new value"); Or, if you're using jQuery : $("img").attr("bs-tooltip", "your new value"); Here's a fiddle : http://jsfiddle.net/hsxx0pwo/ You can target your image more precisely by giving it an id and using getElementById instead of getElementsByTagName.

http://stackoverflow.com/a/26931630
has body: You are missing the $scope service name in the controller definition: .controller('testAppController',['$scope', 'helloworldservice',function($scope,helloworldservice){ helloworldservice.getDatafunction(); }]); Remember that if you specify the service names as strings for the parameters, you have to specify all the parameters for the function. Specifying the services names for injection is a recommended practice when you will minify the javascript. Taking this into account, could be good to do the same for the $http parameter in your service definition: .service('helloworldservice',['$http', function($http){ this.getDatafunction = function(){ $http.get('json/countries.json') .success(function(data) { alert("sucesss"); }) .error(function(data) { alert("wrong"); }); } }])
type: Answer
answers question: http://stackoverflow.com/q/26882541
score: 0

http://stackoverflow.com/comment/42236007
comment on: http://stackoverflow.com/a/26833181
type: AnswerComment
has text: @macroscripts - the text IS sorted with duplicates removed. The result IS an array with duplicates removed (I only joined them for display purposes).
type: Comment
score: 1

http://stackoverflow.com/comment/42354515
has text: I have tried console.log(data) and in html. console gives me things like e{$promise: Promise, $resolved: false,...} and somewhere in there is my object. gives a totally normal result: {"question": "QuestionHere", "answer": "answerHere"}. The weird thing is, using ng-repeat to showcase the values is totally fine, but accessing the value in the controller just doesn't work.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26900764
score: 0

http://stackoverflow.com/comment/42504523
has text: The code worked fine without making any changes, so this doesn't answer the question.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26985508

http://stackoverflow.com/q/26907449
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42365715
has comment: http://stackoverflow.com/comment/42368075
tagged with: dynamics-crm-2013
type: Question
tagged with: javascript
score: 0
has title: Click method does not work without the alert
has comment: http://stackoverflow.com/comment/42365295
has comment: http://stackoverflow.com/comment/42366030
has body: I'm writing some custom code with JS. I want to activate a section that is usually activated by pressing on the corresponding button. The code I use is: var controlEle = document.getElementById("header_notescontrol"); if (controlEle.children != null &amp;&amp; controlEle.children.length &gt; 0) { var ctrl = controlEle.children[0]; if (ctrl.title == "NOTES") { //alert(ctrl.title); ctrl.focus(); ctrl.click(); } } But it does not work. If I uncomment the alert, after pressing on OK the code works. Why is it so?
answer count: 0

http://stackoverflow.com/comment/42266753
type: Comment
type: QuestionComment
score: 0
has text: Windows. But its still not working with .
comment on: http://stackoverflow.com/q/26852035

http://stackoverflow.com/q/26847077
has title: PHP and AJAX: How can I display json_encode data in PHP while loop?
has answer: http://stackoverflow.com/a/26847232
upvote count: 2
tagged with: mysqli
tagged with: php
type: AnsweredQuestion
score: 1
downvote count: 1
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/26847193
tagged with: javascript
tagged with: jquery
tagged with: ajax
has body: I am very new to using AJAX and passing data with json_encode. I have this "aht" button when clicked it will send an AJAX request to my show_aht.php script, which will run a query. I want to save the results and display it to my map.php. Problem: In my map.php I have a while loop that outputs square(desk) DIVs with another DIV(station) when clicked that displays content inside of it. Here is the fiddle so you may understand. I want the results of show_aht.php "TIME" to be displayed in the DIVs being produced by my WHILE LOOP in map.php. How is it possible to do this? I know that AJAX and PHP cannot interact with eachother and thats why I need help. If this can't be done, how else can I display the TIME from show_aht.php to their corresponding usernames on each DIV being output? I have around 200 of them being displayed. Thanks in advance. map.php (only showing the last line of the while loop, outputs all DIVs) //desk DIV while(somequery){ .... echo ' ' . $sta_num . ' ' . "\n"; }//end while //station DIV while(some query){ ..... echo ' User:' . $user .' Station:' . $hostname . ' Pod:' . $sta_num . ' Section:' . $sec_name . ' State:' . $state .' ' . "\n"; }//end while map.php (AJAX part) AHT show_aht.php (showing the loop and part I where I want the data to be returned) foreach($memo_data as $v){ foreach($user_data as $m){ if($v['memo_code'] == $m){ echo " User: " .$m. " Time: " . $v['avg_handle_time'] . " "; } elseif( $v['memo_code'] != $m){ echo "User: " . $m . " Time: N/A "; } } }
accepted answer: http://stackoverflow.com/a/26847193
favorite count: 0
possible better answer: http://stackoverflow.com/a/26847232

http://stackoverflow.com/a/26886344
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26886038
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/26886038
upvote count: 1
has body: You can use JSON[P] and access a time API: (The code below should work perfectly, just tested it...) function getTime(zone, success) { var url = 'http://json-time.appspot.com/time.json?tz=' + zone, ud = 'json' + (+new Date()); window[ud]= function(o){ success &amp;&amp; success(new Date(o.datetime)); }; document.getElementsByTagName('head')[0].appendChild((function(){ var s = document.createElement('script'); s.type = 'text/javascript'; s.src = url + '&amp;callback=' + ud; return s; })()); } getTime('GMT', function(time){ // This is where you do whatever you want with the time: alert(time); }); If you want get it through php: $usersTimezone = 'Asia/Tehran'; $date = new DateTime( 'Thu, 31 Mar 2011 02:05:59 GMT', new DateTimeZone($usersTimezone) ); echo $date-&gt;format('y/m/d H:i');
has comment: http://stackoverflow.com/comment/42327337

http://stackoverflow.com/q/26851534
has comment: http://stackoverflow.com/comment/42265458
has answer: http://stackoverflow.com/a/26851713
has comment: http://stackoverflow.com/comment/42265513
has comment: http://stackoverflow.com/comment/42265449
type: Question
has body: I am attempting to loop over the whateverDivand find the offset of each element. I am getting the error message Uncaught TypeError: undefined is not a function, I suspect because .offset() cannot be called on the element. This brings me to the question of how I can call functions, such as .offset() and .is(":hover") on elements in an array like this. whateverDiv = document.getElementsByClassName('whatever') //RETURNS SOMETHING LIKE [&lt;img src=​"http:​/​/​www.whateversource.jpg"&gt;​,&lt;img src=​"http:​/​/​www.whateversource2.jpg"&gt;​] for (i in whateverDiv){ console.log(whateverDiv[i].offset()) }
possible better answer: http://stackoverflow.com/a/26851623
tagged with: javascript
has answer: http://stackoverflow.com/a/26851597
has answer: http://stackoverflow.com/a/26851623
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/26851597
tagged with: arrays
tagged with: jquery
has title: Using a FOR loop for an array of elements selected by class, and calling functions on each
type: AnsweredQuestion

http://stackoverflow.com/comment/42379807
comment on: http://stackoverflow.com/q/26913625
score: 0
type: Comment
type: QuestionComment
has text: Comments in this post shows exactly the kind of problems I'm having with those guys: http://googletesting.blogspot.com.br/2009/06/my-selenium-tests-arent-stable.html

http://stackoverflow.com/q/26887435
favorite count: 0
has comment: http://stackoverflow.com/comment/42329215
has answer: http://stackoverflow.com/a/26887972
tagged with: http://stackoverflow.com/tag/html
tagged with: checkbox
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42329370
score: 1
has answer: http://stackoverflow.com/a/26888379
upvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/26888270
tagged with: javascript
has answer: http://stackoverflow.com/a/26888270
has comment: http://stackoverflow.com/comment/42329768
accepted answer: http://stackoverflow.com/a/26887972
tagged with: radio-button
has body: I have six columns with six checkboxes (or radio). My intention is, that only one checkbox can be selected in the same row and the same column. For example: When I select the checkbox in column4 and row3', every checkbox in row3 and column4 have to be unselected immediately. I tried it with radio buttons, but I simply can´t do it, because every single radio always to be in two different groups. Edit: My HTML Code: column1row1 column1row2 column1row3 column1row4 column1row5 column1row6 column2row1 column2row2 column2row3 column2row4 column2row5 column2row6 column3row1 column3row2 column3row3 column3row4 column3row5 column3row6 column4row1 column4row2 column4row3 column4row4 column4row5 column4row6 column5row1 column5row2 column5row3 column5row4 column5row5 column5row6 column6row1 column6row2 column6row3 column6row4 column6row5 column6row6
has answer: http://stackoverflow.com/a/56712940
downvote count: 0
has title: Select only one checkbox/radiobutton in the same row and column
tagged with: jquery

http://stackoverflow.com/comment/42324558
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26884751
has text: Are there errors in the console? What is your expected output?

http://stackoverflow.com/a/26941986
has comment: http://stackoverflow.com/comment/42463786
has comment: http://stackoverflow.com/comment/42428135
has comment: http://stackoverflow.com/comment/42428168
has comment: http://stackoverflow.com/comment/42427928
type: Answer
has comment: http://stackoverflow.com/comment/42438515
has comment: http://stackoverflow.com/comment/42427875
has body: Try commenting out your old code and try this instead. Also sometimes when you have two fields with the same name, it could get tricky and sometimes even fail. $(document).ready(function(){ var radio1 = $('input[name="BPSUBPT"]'); var radio2 = $('input[name="BPSUBQ"]'); var selectedValue = ''; $(radio1).on('click', function(){ $(radio1).each(function(index, value){ var checked = $(this).is(':checked'); if(checked &amp;&amp; index == '0'){ selectedValue = 300; $('#BPSUTotal').val(selectedValue); } else if(checked &amp;&amp; index == '1'){ selectedValue = 500; $('#BPSUTotal').val(selectedValue); } }); }); $(radio2).on('click', function(){ var checked = $(this).is(':checked'); if(checked &amp;&amp; selectedValue != ''){ var oldValue = $('#BPSUTotal').val(); var newValue = oldValue - 150; $('#BPSUTotal').val(newValue); } }); });
has comment: http://stackoverflow.com/comment/42428043
answers question: http://stackoverflow.com/q/26941899
score: 0
has comment: http://stackoverflow.com/comment/42428277
has comment: http://stackoverflow.com/comment/42427897

http://stackoverflow.com/a/40524403
answers question: http://stackoverflow.com/q/26888276
type: Answer
score: 1
upvote count: 1
downvote count: 0
has body: Here is a simple way to enable your custom toolbar button and attach a click event handler inside a read only TinyMCE editor using JQUERY: //Initialize read only Tinymce editor so that Lock button is also disabled function initReadOnlyTinyMCE() { tinymce.init({ selector: '#main' , toolbar: 'myLockButton' , body_class: 'main-div' , content_css: 'stylesheets/index.css' , readonly: true , setup: function (readOnlyMain) { readOnlyMain.addButton('myLockButton', { //Lock button is disabled because readonly is set to true image: 'images/lock.png' , tooltip: 'Lock Editor' }); } }); } function displayReadOnlyTinyMCEwithLockButtonEnabled() { var edContent = $('main').html(); $("#main").empty(); initReadOnlyTinyMCE(true); tinyMCE.activeEditor.setContent(edContent); //enable the lock button and attach a click event handler $('[aria-label="Lock Editor"]').removeClass("mce-disabled"); $('[aria-label="Lock Editor"]').removeAttr("aria-disabled"); $('[aria-label="Lock Editor"]').attr("onclick", "LockEditor()"); } function LockEditor() { alert("Tiny mce editor is locked by the current user!!"); //Write your logic to lock the editor... }

http://stackoverflow.com/comment/42440560
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26949222
has text: Thanks for your response Nick, that does solve the problem as I presented it, but I outsmarted myself when writing the question. I adapted an example from the knockout documentation to isolate this specific issue. In my actual application, I need to populate multiple multiple form fields based on various properties of the selected object. Will edit the question.

http://stackoverflow.com/comment/42252437
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/26844401
type: Comment
has text: If I create a json file and save it onto my ftp this file will be accesible through a browser, at least thats what I understand.

http://stackoverflow.com/comment/42290931
comment on: http://stackoverflow.com/a/26863717
has text: @MarioLevrero: I've updated the answer to show how to use `getOwnPropertyNames` (well, one of the ways).
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/74602566
type: Comment
has text: I may sound out of topic. But I have similar issue in angular2. How do i solve it?
comment on: http://stackoverflow.com/a/26900666
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42286902
type: Comment
comment on: http://stackoverflow.com/a/26863483
score: 0
type: AnswerComment
has text: Still not enough info. What programming language do you run on the server?

http://stackoverflow.com/comment/51926124
score: 2
comment on: http://stackoverflow.com/a/26885619
type: AnswerComment
type: Comment
has text: You can react on paper.on('cell:pointerup blank:pointerup', handler) where you discard all links that do not have both source.id and target.id set.

http://stackoverflow.com/q/26843232
has title: Photoshop scripting - access index of selected regions
score: 0
has comment: http://stackoverflow.com/comment/42289251
answer count: 1
has body: I have an image with lets say five separate regions selected at once. Is there a way thru scripting that I can access the index value of these regions and loop thru them. Or either some type of forall call that I could do?
tagged with: javascript
tagged with: photoshop
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26864848
type: Question

http://stackoverflow.com/q/26950439
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/26950793
tagged with: meteor
has answer: http://stackoverflow.com/a/26950567
accepted answer: http://stackoverflow.com/a/26950793
has body: We're trying to make an application that pairs users in a database every Wednesday and Friday. How is done in Meteor? So in the server code I was thinking of putting this in a timedserver.js file boolean hasMatched = false; boolean isWednesday = false; while(true){ if (day != Wednesday) isWednesday = false; if (day == Wednesday){ matchUsers() Wednesday = true; } setTimeOut(5 HOURS) } Is this how it should be approached? I'm not sure how to have continually running server code. Where do we put this code?
possible better answer: http://stackoverflow.com/a/26950848
tagged with: node.js
type: AnsweredQuestion
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/26950848
has title: Meteor.js: time-based server calls?

http://stackoverflow.com/q/26910870
tagged with: javascript
tagged with: popover
score: 0
has comment: http://stackoverflow.com/comment/42371545
has title: How can I inject a popover inside an iframe?
has body: I am using an iframe to display a page in the same domain and I would like to inject a bootstrap popover inside the iframe: is there a way of doing it? I am currently trying: Javascript: var iframe = $('#editor-iframe'); iframe.load(function (){ var contents = iframe.contents(); var element = contents.find('a'); element.popover(); }); HTML (partial content from the iframe): Dismissible popover I try to click on the a element, but nothing happens and no error messages are given. It works fine outside of the iframe, but I don't know why it does not work on the iframe. Any help is appreciated.
tagged with: twitter-bootstrap-3
answer count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: iframe
type: Question
has comment: http://stackoverflow.com/comment/42373481

http://stackoverflow.com/comment/42848050
comment on: http://stackoverflow.com/a/26878523
score: 0
type: AnswerComment
type: Comment
has text: Thanks for your solution, it is clean. I don't know yet if I will implement this. I'll come back and accept it if I decide to use that :) About my global_lock... actually I realised I might have invented a problem I didn't have. I was afraid that, if the user changed `total price`, the code that modifies value1 and value2 would trigger their own `change` eventListener, which then would fire total_price's `change` EventListener, etc. (infinite loop). Was I wrong ?

http://stackoverflow.com/comment/42240459
type: AnswerComment
has text: won't this just call onSuccess, which would automatically set result to true regardless if the ajax is successful or not?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26836493

http://stackoverflow.com/a/26845095
has body: Your callback is the problem. function AddValueToDB(sportName, location, dateTime, team, teamOpp) { function doActionOnResult(transaction, result){ //Do your action here if (result != null &amp;&amp; result.rows != null) { if (result.rows.length &gt; 0) { return false; } return false; } else { return true; } } lookMatchEvent(sportName, location, dateTime, team, teamOpp, doActionOnResult) } function lookMatchEvent($sportName, $location, $dateTime, $team, $teamOpp, callback) { db.transaction(function(transaction) { transaction.executeSql("SELECT * from sport where sportName='"+$sportName+"' and location='"+$location+"' and dateTime='"+$dateTime+"' and team='"+$team+"' and teamOpp='"+$teamOpp+"';", [], doActionOnResult, errorHandler); },errorHandler,nullHandler); }
type: Answer
score: 0
answers question: http://stackoverflow.com/q/26844422

http://stackoverflow.com/a/26906384
type: Answer
accepted answer of: http://stackoverflow.com/q/26906271
has body: function successAJAX(response){ response = $.parseJSON(response); var priceHTML = document.createElement('p'); priceHTML.innerText= "foo"; $("#priceContainer").append(priceHTML); } First of all, what is that response = $.parseJSON(response); line doing there if you're not even using response in that function? Secondly, we'd have to see the function that executes your AJAX to see what's going wrong, because there seems to be not so much wrong with your code. By the way, you can also create your priceHTML var by using var priceHTML = $('&lt;p&gt;'); priceHTML.html('foo');` (since you're using jQuery).
has comment: http://stackoverflow.com/comment/42372986
answers question: http://stackoverflow.com/q/26906271
type: AcceptedAnswer
score: 0

http://stackoverflow.com/a/26987640
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/26987558
downvote count: 0
has body: Try this one Controller:: $scope.keyPress = function(keyCode){ console.log(keyCode); if(keyCode == 13) { // Call the func if user enters 13 i.e for Enter } }
type: Answer

google-maps
tags question: http://stackoverflow.com/q/26975713
tags question: http://stackoverflow.com/q/26904472
tag name: google-maps
tags question: http://stackoverflow.com/q/26977622
tags question: http://stackoverflow.com/q/26904189
tags question: http://stackoverflow.com/q/26944072
tags question: http://stackoverflow.com/q/26970947
tags question: http://stackoverflow.com/q/26904703
tags question: http://stackoverflow.com/q/26962080
tags question: http://stackoverflow.com/q/26936901
tags question: http://stackoverflow.com/q/26856390
tags question: http://stackoverflow.com/q/26941247
tags question: http://stackoverflow.com/q/26968272
tags question: http://stackoverflow.com/q/26899484
tags question: http://stackoverflow.com/q/26965425
tags question: http://stackoverflow.com/q/26956372
tags question: http://stackoverflow.com/q/26949769
tags question: http://stackoverflow.com/q/26968583
tags question: http://stackoverflow.com/q/26865593
tags question: http://stackoverflow.com/q/26932031
tags question: http://stackoverflow.com/q/26866063
tags question: http://stackoverflow.com/q/26918489
tags question: http://stackoverflow.com/q/26887416
tags question: http://stackoverflow.com/q/26849203
tags question: http://stackoverflow.com/q/26982715
tags question: http://stackoverflow.com/q/26872331
tags question: http://stackoverflow.com/q/26987993
tags question: http://stackoverflow.com/q/26897134
tags question: http://stackoverflow.com/q/26899886
tags question: http://stackoverflow.com/q/26876806
tags question: http://stackoverflow.com/q/26854058
tags question: http://stackoverflow.com/q/26885135
tags question: http://stackoverflow.com/q/26961399
tags question: http://stackoverflow.com/q/26855477
tags question: http://stackoverflow.com/q/26957593
tags question: http://stackoverflow.com/q/26906127
tags question: http://stackoverflow.com/q/26844237
tags question: http://stackoverflow.com/q/26971611
tags question: http://stackoverflow.com/q/26983211
tags question: http://stackoverflow.com/q/26981315
tags question: http://stackoverflow.com/q/26941458
tags question: http://stackoverflow.com/q/26855798
tags question: http://stackoverflow.com/q/26951293
tags question: http://stackoverflow.com/q/26910573
tags question: http://stackoverflow.com/q/26982888
tags question: http://stackoverflow.com/q/26970243
tags question: http://stackoverflow.com/q/26916258
type: Tag
tags question: http://stackoverflow.com/q/26955469
tags question: http://stackoverflow.com/q/26940432
tags question: http://stackoverflow.com/q/26936287
tags question: http://stackoverflow.com/q/26921940
tags question: http://stackoverflow.com/q/26948657
tags question: http://stackoverflow.com/q/26953599
tags question: http://stackoverflow.com/q/26873898
tags question: http://stackoverflow.com/q/26956693
tags question: http://stackoverflow.com/q/26964543
tags question: http://stackoverflow.com/q/26991406
tags question: http://stackoverflow.com/q/26841084
tags question: http://stackoverflow.com/q/26982576
tags question: http://stackoverflow.com/q/26976377
tags question: http://stackoverflow.com/q/26930669
tags question: http://stackoverflow.com/q/26934867
tags question: http://stackoverflow.com/q/26877148
tags question: http://stackoverflow.com/q/26878503
tags question: http://stackoverflow.com/q/26885883
tags question: http://stackoverflow.com/q/26960704

http://stackoverflow.com/comment/42430740
type: Comment
type: QuestionComment
score: 5
comment on: http://stackoverflow.com/q/26943853
has text: It is not recalculated when referenced, it is set when something happens to change the length of the array. People have been writing `for (var i=0; i<obj.length; i++)` for decades with no "danger to memory". Retrieving length in advance and assigning it to a variable like `count` is merely a micro-optimization that saves one property reference each time through the loop.

http://stackoverflow.com/q/26846302
has comment: http://stackoverflow.com/comment/42255807
score: -6
favorite count: 0
downvote count: 6
has comment: http://stackoverflow.com/comment/42255891
has body: I have a form where i can select a product then set a begin week (for example 1) and a end week (for example 10) Then i have a table with 52 rows that represent the weeks. I want when a user selects a product and set the weeks it adds the product in the table on the set weeks. Everything works fine when i add week 1 - 10 but when i put 3 - 10 it doesnt work. Here is my Jquery code $(".sub_product_toevoegen").click(function(e) { e.preventDefault(); var product = $("select[name='select_product'] option:selected").val(); var start_week = $("input[name='start_week']").val(); var eind_week = $("input[name='eind_week']").val(); $(".tabs .nieuwe_offerte_table tbody tr td a.product_toevoegen").each(function(index) { for (i = start_week; i &lt;= eind_week; i++) { if (i == index + 1) { $(this).append(product); } } }); }); Someone can tell me what im doing wrong ?
accepted answer: http://stackoverflow.com/a/26846615
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42255737
has comment: http://stackoverflow.com/comment/42255706
has comment: http://stackoverflow.com/comment/42255730
has comment: http://stackoverflow.com/comment/42255655
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Jquery each only adds the first elements
has comment: http://stackoverflow.com/comment/42255675
has answer: http://stackoverflow.com/a/26846615
has comment: http://stackoverflow.com/comment/42255799
has comment: http://stackoverflow.com/comment/42255694

http://stackoverflow.com/q/26969835
has comment: http://stackoverflow.com/comment/42482140
score: 0
has comment: http://stackoverflow.com/comment/42482385
has title: IE7 & IE8 frameset onload only fires on first use
has body: I have a htm page called launch which is within the same directory as a JavaScript file. The launch.htm page contains the frameset which has an onload function called initalise() which is a method within the JavaScript file. The frameset onload function works fine on any load in IE9, IE10 and IE11. However it only works on first load in IE7 & IE8. I debugged it and found out that the initalise() method in the frameset onload is not found on any load after the first. Below is my code: Launching Caring for your Customer What I have tried so far: Re-adding the onload function to the frameset, didnt work. Creating the frameset on the fly, there was code in the JavaScript file which requires the frameset to by static so this didnt work either. Any help will be appreciated very much :).
type: UnansweredQuestion
tagged with: onload
tagged with: frameset
answer count: 0
has comment: http://stackoverflow.com/comment/42481801
type: Question
tagged with: internet-explorer
tagged with: internet-explorer-8
tagged with: javascript

http://stackoverflow.com/comment/42388052
type: QuestionComment
comment on: http://stackoverflow.com/q/26919660
score: 0
has text: Ah - so your query isn't working! It is likely that you aren't setting the `$_POST` array variables that you need to successfully query the database.
type: Comment

http://stackoverflow.com/a/26991302
has body: Just to clarify @laruiss and explain what is going on, lets start with your code: /* body.onload is not recommended, window.onload is. But thats not the main issue*/ window.onload = function() { /* You are declaring a function here. Very important: * its a declaration, NOT a function call */ function UP() { if(window.pageYOffset &gt; window.innerHeight) document.getElementById('UP').style.display = "block"; } /* So if you want to execute ('call') your function, you have two options: * - Remove the declaration around your function aka `function UP(){` and the ending `}` * - Call the function here. To make your code work instantly, lets do that. */ UP(); } When using the onload event, you are actually doing the right thing. True, it's not recommended to actually do that in your DOM, but it should work. The biggest issue that DOM load is subjective. Some browsers will consider the body loaded as soon as the content is in, others will wait for images, and older IE versions won't fire it all! So if you use the recommended window.onload, you should be fine, as it will fire as soon as the DOM is ready. There is another great event for this you might want to consider, which is DOMContentLoaded, but its not as widely supported. Theres a bit more (by clicking through as well) here: https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.onload I would also like to add that even though you put your button to display, its has no content so it could appear either empty or if you are resetting your button styles, not at all. Something to keep in mind.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42537807
accepted answer of: http://stackoverflow.com/q/26989980
downvote count: 0
type: Answer
score: 7
answers question: http://stackoverflow.com/q/26989980
upvote count: 7

http://stackoverflow.com/comment/42365916
type: QuestionComment
score: 1
has text: Use SVG, if possible instead of canvas. SVG is vector based, scales very well, while CANVAS renders bitmap, which does not scale up lossless.
comment on: http://stackoverflow.com/q/26907269
type: Comment

http://stackoverflow.com/q/26947473
has comment: http://stackoverflow.com/comment/42438614
has comment: http://stackoverflow.com/comment/42438103
has answer: http://stackoverflow.com/a/26948513
type: UnansweredQuestion
has title: Update DIV content on click without directly knowing its ID
score: 0
has comment: http://stackoverflow.com/comment/42437101
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I am building 2D tile game map. Each tile is a div in 2D array (var tiles = []). Below is the function which builds a tile based on some arguments defined somewhere else: function Tile(rnd, px, py, nid) { var self = this; var _types = ["grass","forest","hills","swamp","forest", "mountains"]; var height = 60; var width = 60; var tileID = nid // new numeric tile id var id = "tile_"+px+py+rnd; // old tile ID var x = px; var y = py; var type = _types[rnd]; var img = 'img/maptiles/'+type+'.png'; this.Draw = function() { var div = $("&lt;div class='tile'&gt;&lt;/div&gt;"); div.attr('id',tileID).data('type',type).data('x',x).data('y',y); div.get(0).tile = self; div.css({top:height*y, left:width*x}); div.css({"background":"url('"+img+"')"}); div.appendTo('#map-content'); }; this.Alert = function() { alert("Tile type: "+type+". Tile ID: "+tileID+" "); }; this.Move = function(){ // moves player to available tile, in this case if player stands to a tile before the clicked one alert("start move! Tile type: "+type+". Tile ID: "+tileID+" "); if (playerPosition === tileID - 1) { $("#player").remove(); $("#????")").append('&lt;img id="player" src="Pictures/maptiles/player.png" /&gt;'); playerPosition = tileID; alert("Player position now: " + playerPosition); } }; } As a result I end up with m x n map made of divs each with a unique numeric ID starting with 1. I know that using numeric IDs for elements is(was?) frowned upon, though HTML5 specs do not actually prohibit this anymore. Now what I want to do is to place a player icon (player.png) depending on player's position. Starting position is 1 and I am using tiles (aka divs) numeric IDs to calculate legal moves (can move only to bordering tiles). When a tile is clicked this.Move is called. Its purpose is to check if player can move on a clicked tile (just one IF statement for now to test) and must remove player.png and redraw it on the clicked div. Here I run into a problem since I need to somehow use the tileID (which is equal to…
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/42356246
has text: no..!! ScriptManager.RegisterClientScriptBlock() is a method returns void so can not apply these bool operation here..
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26902118
type: Comment

http://stackoverflow.com/comment/42436396
has text: @Qantas94Heavy, you are absolutely right that `this` can not be used in the callback. I will edit my answer. I disagree however on using `map` as its intention is to create a new array, which is not what OP wanted.
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/26944771

http://stackoverflow.com/comment/42414496
comment on: http://stackoverflow.com/q/26933357
has text: As T.J. already says: you cannot prevent a user from reaching a page by writing code on the client. What you can (and should do) is remove links to the admin page for users that are not administrators. But that is just a UX thing, the user can still type the URL of the admin page directly into the browser and reach it that way. So: yes, you should redirect them back if they reach the admin page and are not administrators, but you should not pretend that this is security.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26852849
has comment: http://stackoverflow.com/comment/42268391
tagged with: javascript
has comment: http://stackoverflow.com/comment/42274348
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/42268196
has comment: http://stackoverflow.com/comment/42275068
has answer: http://stackoverflow.com/a/26852918
tagged with: regex
type: AnsweredQuestion
has body: I am trying to get my regexp working but I am not having much luck. I would like to check whether the input string is 6 numbers and 1 character (123123A), no spaces, no dashes. My regex doesn't match even though I think I am entering a valid string. Could anyone please point me where my issue is? var userString = "123123A"; if( /^d{6}[a-zA-Z]{1}$/.test(userString) ){ alert("Correct format"); } else{ alert("Incorrect format"); }
has answer: http://stackoverflow.com/a/26852871
accepted answer: http://stackoverflow.com/a/26852871
type: Question
possible better answer: http://stackoverflow.com/a/26852918
has title: Javascript regexp validation not working

http://stackoverflow.com/q/26912876
upvote count: 1
type: Question
tagged with: dialog
score: 1
answer count: 1
has title: Add custom ttitle and message to Facebook dialog share
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/26913257
favorite count: 0
type: UnansweredQuestion
tagged with: facebook
tagged with: facebook-opengraph
has body: I'm trying to share a link on Facebook, but, with a custom title and message. Let me explain, I build my url like this : var obj = { "object":"page.html", "image":"image.jpg", "data":{ "title":"foo", "message":"bar" } }; var furl = "https://www.facebook.com/dialog/share_open_graph?app_id=XXXXXXXXXX&amp;display=popup&amp;action_type=og.likes&amp;action_properties=" + encodeURIComponent(JSON.stringify(obj)) + "&amp;redirect_uri=" + encodeURI("page.html"); But, when I use the URL, the title and the description of the page are still the one provided by the page's meta tag and not the one I tried to defined. But, the custom image works well... Any idea of what I could be missing ?

http://stackoverflow.com/q/26866979
has comment: http://stackoverflow.com/comment/42294061
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/26867473
tagged with: angularjs
has body: I'm trying to pass some data to a angularjs form with no success. I'm defining a module, calling it in the template and binding the template to a controller. The idea is to pass something to the $scope variable in order to show the existing username as value to the field. The same form is going to be used to add and edit users. In the last case, I'll fetch the user by id and pass his info to the $scope through the myForm variable. Here's a plunker to make things easier: http://plnkr.co/edit/nAabxgrw4HqLcgrErVxq?p=preview Template: Nome This field is required {{ myForm.username }} Code: window.angular.module('App', []); window.angular.module('App').controller('TestController', ['$scope', function ($scope) { $scope.myForm = {}; $scope.myForm.username = 'John Doe'; }]); Any help would be awesome.
has title: AngularJS pass data to form not working
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42293457
tagged with: angularjs-templates
accepted answer: http://stackoverflow.com/a/26867473
possible better answer: http://stackoverflow.com/a/26867565
type: Question
has comment: http://stackoverflow.com/comment/42293289
has answer: http://stackoverflow.com/a/26867565
tagged with: javascript

http://stackoverflow.com/q/26860760
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/26861586
has comment: http://stackoverflow.com/comment/42282165
possible better answer: http://stackoverflow.com/a/26860915
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42282261
has answer: http://stackoverflow.com/a/26860915
has title: Add hyphen to textarea when pressed enter
tagged with: forms
has answer: http://stackoverflow.com/a/26861586
type: Question
has answer: http://stackoverflow.com/a/26861063
tagged with: textarea
tagged with: javascript
tagged with: jquery
has body: So I want to put hyphen to every new line on my textarea. How can I achieve this? I basically want it to look like this: - One - Two ... Something with jQuery maybe but I have no idea what..

http://stackoverflow.com/a/26968081
answers question: http://stackoverflow.com/q/26968019
has comment: http://stackoverflow.com/comment/42474523
has body: isInvalid is defined inside the scope of the Controller function. To test it you should, either define the function outside the controller's scope (public) or register it in the $scope object. Basically, jasmine can't look inside the controller.
score: 0
type: Answer

http://stackoverflow.com/comment/99882147
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/43634169
has text: @Amsvartner In the `storageHandler` function, is there a way to pull the value that was updated from the `e` parameter being passed in?
score: 0

http://stackoverflow.com/comment/42409699
type: Comment
has text: @MIvanIsten thats why there is a timeout in place
type: QuestionComment
comment on: http://stackoverflow.com/q/26932082
score: 0

http://stackoverflow.com/a/26886717
downvote count: 0
answers question: http://stackoverflow.com/q/26885922
has comment: http://stackoverflow.com/comment/42327863
type: Answer
accepted answer of: http://stackoverflow.com/q/26885922
score: 2
upvote count: 2
has body: I think you not able to fetch data according to id field because you fetch the data in resultrows variable as : var resultrows = db.execute('SELECT destination,fromdate,todate FROM newtrip'); So here you do not fetch the id column. But you use it at : rowid : resultrows.fieldByName('id') // in : var imgedit Hence rowid for var imgedit would be null/undefined. You should modify your SELECT query as : var resultrows = db.execute('SELECT id,destination,fromdate,todate FROM newtrip'); Edit : Under click listener of imgedit you have : var x = db.execute('SELECT * FROM newtrip WHERE id=' + rowid); But there is no variable rowid defined, hence error is thrown. Make following changes ( rowid changed to e.source.rowid) : var x = db.execute('SELECT * FROM newtrip WHERE id=' + e.source.rowid); Hope it helps.
has comment: http://stackoverflow.com/comment/42328210
type: AcceptedAnswer

http://stackoverflow.com/q/26957761
favorite count: 0
accepted answer: http://stackoverflow.com/a/26957808
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has title: How to group JSON data using Javascript/jquery?
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/26957808
has body: I have JSON data: {"A1":"3","A2":"34","B1":"23","B2":"23","C1":"234","C2":"43",...} I would like to group, or restructure it like so var dataJson1 = { "A":{"A1":"3","A2":34}, "B":{"B1":"23","B2":"23"}, ... } AND var dataJson2 = { "0":{"A1":"3", "B1":"23", ...}, "1":{"A2":"34", "B2":"23", ...} } How can I group json data?
score: 0
answer count: 1
tagged with: grouping
tagged with: jquery

http://stackoverflow.com/q/26968052
score: 1
type: Question
answer count: 2
upvote count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/26968308
tagged with: http://stackoverflow.com/tag/html
tagged with: mailto
has body: This is my first post. I am trying to create a mailto link using 'templated' Javascript that takes the following excerpt from a JSON object: var menu = { "menu": [ { "title": "let's talk", "link": "mailto:mrlevitas@yahoo.com" } ] } Where '+menu.menu[i].link+' is replaced by "mailto:mrlevitas@yahoo.com" for (i=0; i&lt;menu.menu.length; i=i+1) { entry = '&lt;li&gt;&lt;a href="'+menu.menu[i].link+'"&gt;'+menu.menu[i].title+' &lt;/a&gt;&lt;/li&gt;'; } $("#navmenu:last").append(entry); When I click on the page (http://mrlevitas.github.io), nothing happens in either chrome or firefox. Any advice please?
has answer: http://stackoverflow.com/a/26968235
accepted answer: http://stackoverflow.com/a/26968235
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26968308
has title: HTML "mailto:" not opening in new window

http://stackoverflow.com/q/26937941
has body: I'm currently trying to sort between a list of 2 items based on their thickness "3mm" and "5mm". I want for when you click the radio button for 3mm to automatically filter the list for items with the class of 3mm, and the same for 5mm. Then if you click "no preference" I want it to remove any filter based on thickness. I've been messing around with it for a while now, trying to piece together code, but to no avail, any help would be really appreciated! Thanks! JSFiddle also: http://jsfiddle.net/gdkmrqnr/ HTML: piece-y search piece search Sort by type Sort by thickness Sort by height Sort by style Select a Material Plastic Glass No Preference 3mm 5mm Show all Only show scientific glass Only show artsy glass plastic pipe 3mm 15inch+ artsy glass bowl 3mm 14inch- scientific JS // radio button to select thickness $("input[type='radio']").change(function () { var number = $("[name='thickness']:checked").val(); var letter = $("[name='thickness']:checked").val(); if (!thickness || !thickness) return; $("li").hide(); $("li").filter(function (index) { return $(this).hasClass(thickness) && $(this).hasClass(letter); }).show(); });
type: AnsweredQuestion
downvote count: 0
score: 1
has title: Filtering a list with radio buttons
type: Question
answer count: 2
upvote count: 1
possible better answer: http://stackoverflow.com/a/26938185
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/26938367
tagged with: filter
has answer: http://stackoverflow.com/a/26938367
favorite count: 0
tagged with: html-select
has answer: http://stackoverflow.com/a/26938185

http://stackoverflow.com/q/26903678
tagged with: jquery
has answer: http://stackoverflow.com/a/57556902
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/27250147
tagged with: jvectormap
has answer: http://stackoverflow.com/a/27157970
type: UnansweredQuestion
upvote count: 7
score: 7
has title: jVectorMap renders too small
linked to: http://stackoverflow.com/q/14969023
has comment: http://stackoverflow.com/comment/44850342
type: Question
has answer: http://stackoverflow.com/a/32586734
has body: My jVectorMap isn't taking the new height I'm providing on the containing div and only renders at the default (?) height of 54px. This is in a document.ready function in my scripts.js file: $('#team-map-usa').vectorMap({ map: 'us_lcc_en', backgroundColor: '#ffffff', hoverColor: '#999999', color: '#dddddd', normalizeFunction: 'polynomial', values: myData, scaleColors: ['#d0c4dc', '#d1b0eb', '#b296cb', '#47006b'], onLabelShow: function(event, label, code) { label.text(code); }) }); Containing div: &lt;section id="top"&gt; &lt;div id="team-map-usa" style="width: 600px; height: 400px;"&gt;&lt;/div&gt; &lt;/section&gt; Documentation suggests that if I have a width and height set on the containing div, that should be applied to the created jVectorMap. The div is not hidden at any point (which I read here: Jvectormap very small on div change could be an issue) and $('#team-map-usa') clientHeight and clientWidth are both defined when the vectormap is initialized. This is my first time using jVectorMap and I must be missing something. Any suggestions of how to make the map appear the right size?
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/26974930
has comment: http://stackoverflow.com/comment/42484847
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/26974865
downvote count: 0
has body: The function Start() has to be instantiated as an object. So you would use: function Start(data) { this.move = function() { .... }; this.load = function(){ // call move this.move(); } } var s = new Start(foobar); s.load();
type: Answer

http://stackoverflow.com/comment/42328696
type: AnswerComment
type: Comment
has text: Do you know if it's possible to rotate an imageStatic layer? Thanks for all your help here.
comment on: http://stackoverflow.com/a/26873834
score: 0

http://stackoverflow.com/a/26882102
has comment: http://stackoverflow.com/comment/42320133
has comment: http://stackoverflow.com/comment/42320077
has body: three's no need to add it using document.write. To import scrip file correctly, you can either do it using your first approach, or using the JHtml method like so: JHtml::_('script', 'components/com_mycomp/javascript/myfile1.js'); JHtml::_('script', 'components/com_mycomp/javascript/myfile11.js'); JHtml::_('script', 'components/com_mycomp/javascript/myfile12.js');
has comment: http://stackoverflow.com/comment/42320557
has comment: http://stackoverflow.com/comment/42320270
score: 0
answers question: http://stackoverflow.com/q/26881737
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42961272
accepted answer of: http://stackoverflow.com/q/26881737
type: Answer
has comment: http://stackoverflow.com/comment/42327117

http://stackoverflow.com/q/26977587
has comment: http://stackoverflow.com/comment/42495343
downvote count: 0
tagged with: twitter-bootstrap
has title: Dynamic Height for Bootstrap 3
linked to: http://stackoverflow.com/q/9162933
type: Question
has answer: http://stackoverflow.com/a/26980570
score: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/26978846
has comment: http://stackoverflow.com/comment/42491626
answer count: 2
has comment: http://stackoverflow.com/comment/42491572
upvote count: 1
has comment: http://stackoverflow.com/comment/42490809
has comment: http://stackoverflow.com/comment/42489954
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has body: I have a like this: But when I decrease the screen size to small or medium, I will get white-space beneath the . Like This: How can I have a dynamic height for this to avoid the white-space?
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/42394654
comment on: http://stackoverflow.com/q/26917287
score: 0
type: Comment
type: QuestionComment
has text: @themyth92 can I call the "addItems()" function from the script ? not with "ng-click" ?

http://stackoverflow.com/q/26878301
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26878359
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/26878359
has comment: http://stackoverflow.com/comment/42313657
has title: .mousedown() only called once for each element
has body: I am trying to make a chess game. So far i have only made the white pawns moveable (you move them by dragging them to where you want them to go). However, only the first move works. Why does this happen? I use $(".piece").mousedown(function(){} , but it is only called once.
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26878400
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42313635
has answer: http://stackoverflow.com/a/26878400
tagged with: chess

youtube
tags question: http://stackoverflow.com/q/26975365
tags question: http://stackoverflow.com/q/26965150
tags question: http://stackoverflow.com/q/26835331
tags question: http://stackoverflow.com/q/26838238
tags question: http://stackoverflow.com/q/26867538
type: Tag
tag name: youtube
tags question: http://stackoverflow.com/q/26987780
tags question: http://stackoverflow.com/q/26844274
tags question: http://stackoverflow.com/q/26984718
tags question: http://stackoverflow.com/q/26860881

http://stackoverflow.com/comment/42356808
type: Comment
has text: You need to pass the date in as a string.. ie: isValidThruDate("11/2004");
comment on: http://stackoverflow.com/q/26902272
score: 0
type: QuestionComment

http://stackoverflow.com/q/26952379
has comment: http://stackoverflow.com/comment/42445479
upvote count: 1
has comment: http://stackoverflow.com/comment/42445379
answer count: 1
has comment: http://stackoverflow.com/comment/42445360
favorite count: 0
has answer: http://stackoverflow.com/a/26952404
has comment: http://stackoverflow.com/comment/42445469
type: UnansweredQuestion
downvote count: 0
score: 1
has body: Is it possible to get the list of all images paths in an array used in my whole website? var allImages = ['images/path1.jpg','images/path2.jpg','images/path3.png']
has comment: http://stackoverflow.com/comment/42445343
has comment: http://stackoverflow.com/comment/42445489
has comment: http://stackoverflow.com/comment/42445863
has comment: http://stackoverflow.com/comment/42445399
type: Question
has title: Push all images paths in an array of a whole website
has comment: http://stackoverflow.com/comment/42445669
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/26924476
type: UnansweredQuestion
type: Question
score: 3
tagged with: blueimp
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: jquery-file-upload
has body: JavaScript Load Image Demo Can I add result from crop to file upload ? jQuery File Upload Demo file.canvas = $j('#result canvas'); file.type = 'blob'; $('#fileupload').fileupload('add', {files: file}); Not work $('#fileupload').fileupload('add', {files: $j('#result a').attr('href')}); Not work
has title: JavaScript-Load-Image afte Crop add to jQuery-File-Upload
answer count: 0
upvote count: 3

http://stackoverflow.com/a/26872304
has comment: http://stackoverflow.com/comment/42305355
has body: You must checkout this helpful guide here: http://www.bloggertipstricks.com/adsense-below-post-title.html Use responsive theme and stop showing mobile template. It will work like charm.
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/26868811
upvote count: 1

http://stackoverflow.com/q/26913250
has comment: http://stackoverflow.com/comment/42376302
has body: We have a pre-built page for our staff intranet at work which we have limited customisability over. We can add pages etc and are given access to add custom CSS / Javascript (we can't see what current css / javascript is on the pages) but none of the HTML. Is there a way to remove a selector? There is an icon that is before any links to documents which is added in the ::before selector but not sure what it's called. I've managed to remove it using CSS (display: none;) but that leaves a blank space where the icon would be and makes the link indented. Any help would be appreciated - Thanks.
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/26913568
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26913736
tagged with: css
has comment: http://stackoverflow.com/comment/42375946
has title: Using CSS / Javascript to completely remove elements
has comment: http://stackoverflow.com/comment/42375876
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/42377061
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/42376080
tagged with: javascript
has comment: http://stackoverflow.com/comment/42376237

http://stackoverflow.com/comment/42338612
type: Comment
type: QuestionComment
has text: Should it ring in all pages?
comment on: http://stackoverflow.com/q/26883915
score: 0

http://stackoverflow.com/q/26833545
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/26833663
type: Question
has answer: http://stackoverflow.com/a/26833677
has answer: http://stackoverflow.com/a/26833663
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/26833677
has title: Click button with dataset, and the div with the same dataset will show up
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26833686
has body: I have a button with data-id="1" and i have a div with data-id="1", i want to do when press the button so its get the data-id of the button and the div with the same data-id will show up. i have this code: jsfiddle.net/mmqjs5zs/

http://stackoverflow.com/a/26898936
type: Answer
has body: You can use __dirname to refer to the path of the current script. So main.js would become: module.exports.test = function() { var doc = fs.readFileSync(__dirname + '/header.html'); console.log(doc); }
has comment: http://stackoverflow.com/comment/42352285
score: 0
answers question: http://stackoverflow.com/q/26898848

http://stackoverflow.com/q/26870229
linked to: http://stackoverflow.com/q/29440811
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/42335105
type: Question
upvote count: 5
has answer: http://stackoverflow.com/a/37768912
has comment: http://stackoverflow.com/comment/42299898
tagged with: javascript
has title: Node.js with Webstorm -
has body: I've followed this example to try and add a record to MongoDB database. When trying to run ./server/server.js I get the following message (at 2:22 in video): "C:\Program Files (x86)\JetBrains\WebStorm 9.0.1\bin\runnerw.exe" "C:\Program Files\nodejs\npm" server.js CreateProcess failed with error 193 (no message available) Process finished with exit code 0 The node.exe path is right but don't know why I'm getting this error and can't find information on debugging it.
tagged with: webstorm
has comment: http://stackoverflow.com/comment/42311336
has comment: http://stackoverflow.com/comment/42334952
tagged with: mongodb
score: 5
has comment: http://stackoverflow.com/comment/42311320
has comment: http://stackoverflow.com/comment/42299402

http://stackoverflow.com/a/26900123
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26899905
has comment: http://stackoverflow.com/comment/42392674
has body: Consider the following: var a = 123; var b = "123"; Those look the same in output, but, "a" is a number and "b" is a string. if you want to know the variable type of any variable, you can get it like this: console.log(typeof a); console.log(typeof b); Values that come from form fields are usually of type string. To quickly check if a variable is numeric, regardless if it is actually string, or a number, you can check it like this: if (!isNaN(b)) { /* it is a number, do stuff*/ } or if(isNaN(b -1)) { /* there maybe be some other characters in there*/ }

http://stackoverflow.com/q/26928352
tagged with: jquery
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
has title: Keeping track of page number on scroll event
has answer: http://stackoverflow.com/a/26929582
has comment: http://stackoverflow.com/comment/42402962
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42403952
type: Question
has body: I have a web page which will be loaded with the contents of page one on load. Once the user scrolls the page I'm loading the contents of remaining pages using ajax call. What went wrong here is that I'm having a variable which will be initialized to 2 ( since page one is loaded on loading the page ) to keep track of the page number. What I thought is I would increment this variable once the user scrolls so that it would be pointing to the next page. But Its doesn't work. Its getting incremented before the ajax call is over. So Its missing out many pages. Can anyone tell me the better way to do this ? here is the code.. var pageNo = 2; $(window).scroll(function() { if($(window).scrollTop() == $(document).height() -$(window).height()) { console.log('pageNo ' + pageNo); $.ajax({ type: 'POST', cache: false, dataType: 'json', url: 'url'+pageNo, success: function(data, status, xhr) { $.each(data,function(i, item) { var tp = $('content'); $('#trpcontainer').append(tp); }); }, error: function(jqXHR, textStatus, errorThrown) { } }); } pageNo = pageNo + 1; });
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26929582
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/42403159

http://stackoverflow.com/a/26900677
has body: It is a scoping issue. The ttlTasks you are incrementing in addTask is actually passed in by value and any changes you make to it are local to the addTask method. There is no reason for you to 'send in' ttlTask into addTask, since you have it declared globally and JavaScript is a pass by value language (see this post)
score: 0
answers question: http://stackoverflow.com/q/26900542
has comment: http://stackoverflow.com/comment/42354785
accepted answer of: http://stackoverflow.com/q/26900542
type: Answer
type: AcceptedAnswer

http://stackoverflow.com/comment/42472017
comment on: http://stackoverflow.com/q/26967614
score: 0
type: Comment
type: QuestionComment
has text: I suggest you to use $.ajax

http://stackoverflow.com/comment/42311481
has text: Small update: NIST doesn't define OFB for a "segment size" other than the full block size (128 for AES) per block. So using anything other than 128 is not standardized for OFB. Segments have only been defined in the current spec for CFB.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26876638
type: Comment

http://stackoverflow.com/comment/42462693
type: QuestionComment
comment on: http://stackoverflow.com/q/26949320
has text: Dnyanesh is right. It looks like you're trying to use $.ajax to post directly into the data file. You need to post to a server-side script (PHP or Python), which will do the work of writing the data to the file.
score: 0
type: Comment

http://stackoverflow.com/q/26982624
has answer: http://stackoverflow.com/a/27030504
tagged with: javascript
type: UnansweredQuestion
has title: Angular and Breeze edit Date object
has comment: http://stackoverflow.com/comment/42499516
has comment: http://stackoverflow.com/comment/42500721
tagged with: asp.net-web-api
has comment: http://stackoverflow.com/comment/42500220
tagged with: angularjs
has comment: http://stackoverflow.com/comment/42500825
type: Question
tagged with: breeze-sharp
has body: I have an AngularJS application where I want to edit a Date object that is being exposed by ASP Web API through BreezeJS. When I try to edit this field in a HTML form it doesn't quite work. It seems to edit part of the object, or doesn't bind to the date input type at all. I am wondering what the best way would be to edit Date fields in HTML forms with BreezeJS. I can't find any resources about how one would solve this problem in a proper way. My own guesses would be: Extend the Breeze entity with an extra field that is based on the original date with a getter/setter. Not using a date field in the WebAPI, but that doesn't feel right. Code In my Angular controller I'm getting the object from Breeze through a repository pattern: datacontext.session.getById(id) .then(function (data) { return vm.session = data; }); After that the vm.session is filled with the Breeze object, like this: [{ "$id":"1", "$type":"TestApp.Model.Session, TestApp.Model", "Id":3, "Name":"Second session", "StartDate":"2014-10-12T00:00:00.000", }] Now in my HTML form I'm binding like this: &lt;input type="date" ng-model="vm.session.startDate" placeholder="Start Date"&gt; It's currenyly showing this date as "Sun Oct 12 2014 02:00:00 GMT+0200 (Romance Daylight Time)" if I use a type "text" instead of "date" in the input field. And the casing of the ng-model field is correct since I'm using this to create camelCase fields: breeze.NamingConvention.camelCase.setAsDefault(); So this is fairly straightforward... I'll try to make a JSFiddle or Plunker asap
tagged with: breeze
score: 0
answer count: 1

http://stackoverflow.com/a/26975218
has comment: http://stackoverflow.com/comment/42485518
has comment: http://stackoverflow.com/comment/42485415
score: 2
answers question: http://stackoverflow.com/q/26975079
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26975079
type: Answer
has body: function a() { var x = Math.ceil((Math.random()*100)+1) return x; } function b() { var y = Math.floor((Math.random()*100)+1) return y; } function c(x,y) { console.log(x + ' : ' + y); } c(a(),b());
upvote count: 2

http://stackoverflow.com/a/26860328
accepted answer of: http://stackoverflow.com/q/26858644
answers question: http://stackoverflow.com/q/26858644
has body: I just pulled the repo to test, and I got it up and running without problems. Here's the environment I'm using: OS X Mavericks Node v0.10.29 npm 1.4.14 git 1.9.4 Steps on the command line: git clone https://github.com/facebook/flux.git cd flux/examples/flux-todomvc/ npm install npm start ctrl-C open index.html Then if you want to hack on it, you would start up watchify again with npm start so your changes get transpiled to standard ECMAScript 5.
upvote count: 3
has comment: http://stackoverflow.com/comment/42309094
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 3

http://stackoverflow.com/q/26845250
answer count: 1
tagged with: performance
has title: Performance of updating options in chosen select box
tagged with: javascript
tagged with: jquery-chosen
accepted answer: http://stackoverflow.com/a/26845549
upvote count: 4
type: AnsweredQuestion
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/42253971
type: Question
has body: I use jQuery Chosen plugin for select boxes and Bootstrap 2.3.2. I have two select boxes with same options, where values are strings. If I select option in first select box, this option is disabled in second select box and vice versa. If I deselect option in first select box, this option is enabled in second select box and vice versa. Basically, i have two selected boxes, which have the same options but you can select the same options only in one select box. I use reset button for first select box, which update the select boxes to initial state. It means for all options in first select box selected attribute is false and for all options in second select box disabled attribute is false. The problem is performance. When i click the reset button, updating of option attributes and chosen select box is too long. I want to use reset button for select boxes with more than one thousand options, but i don't know if i should change my code or use another select box plugin. jsfiddle $(".keywordContain").click(function(){ $('select[name=keywordContainSelect] option').prop('selected', false).trigger('chosen:updated'); $('select[name=keywordNotContainSelect] option').prop('disabled', false).trigger('chosen:updated'); });
tagged with: twitter-bootstrap-2
has comment: http://stackoverflow.com/comment/42253958
score: 4
has answer: http://stackoverflow.com/a/26845549

http://stackoverflow.com/q/26910680
has comment: http://stackoverflow.com/comment/42370986
has answer: http://stackoverflow.com/a/26910754
has comment: http://stackoverflow.com/comment/42371347
answer count: 2
has body: I'm trying to play an embedded Youtube video after a button click (.playbutton). The video is embedded as an iframe within a div named #youtubecontainer. The easiest way to achieve this is to append '?autoplay=1' to the iframe's src attribute. (I know there is an API, but for now I need to do it this way.) My HTML code is this Javascript code $(function() { //This controls YouTube playback via button $('.playbutton').click(function() { $("#youtubecontainer iframe").attr('src', ($("#youtubecontainer iframe").attr('src') + '?autoplay=1')); }); }); However, this appends'?autoplay=1' to the src twice, so it reads as follows and fails: Any ideas why?
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/26910899
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42371215
type: UnansweredQuestion
tagged with: iframe
has title: Why is jquery concatenating string twice?
type: Question

http://stackoverflow.com/q/26834337
tagged with: prototypal-inheritance
has answer: http://stackoverflow.com/a/26834389
upvote count: 1
tagged with: methods
downvote count: 1
type: AnsweredQuestion
tagged with: javascript
type: Question
score: 0
accepted answer: http://stackoverflow.com/a/26834389
answer count: 1
has body: Everything I have read seems to favor declaring methods of object constructor functions in a prototype declarations instead of putting the method straight into the initial constructor. function MyClass(name){ this.name = name; } MyClass.prototype.callMethod = function(){ console.log(this.name); }; Would this be recommended? If so what are the disadvantages to putting the method inside the initial constructor like so. function MyClass(name){ this.name = name; this.callMethod = function(){ console.log(this.name); }; } I'm assuming a case as simple as this that it doesn't really matter either way, but in cases of larger objects what are the implications in declaring the method in both stated cases?
favorite count: 0
linked to: http://stackoverflow.com/q/9772307
has title: Should I declare javascript object methods in an object prototype?
duplicate of: http://stackoverflow.com/q/9772307
tagged with: constructor

http://stackoverflow.com/comment/42461535
score: 0
has text: I haven't used this plugin, but can't you change `$('#my-button')` to `$('.newbutton')`? Oh, and 2 elements with the same id is just bad design anyway -- ids should be unique.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26961630

http://stackoverflow.com/comment/42433515
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26944657
type: Comment
has text: @Jeyp yes . JS has to know what it is going to deal with. you have to check if its function or scalar etc.

http://stackoverflow.com/q/26885157
upvote count: 2
has answer: http://stackoverflow.com/a/26887911
accepted answer: http://stackoverflow.com/a/26887911
has body: The problem is demonstrated in the image below In other words, how to exactly compute the x and y coordinates for every frame? ctx.arc(x,y,radius,0,pi*2,false) because after incrementing one coordinate, I have a problem how to compute the other I tried this but doesn't work var step=2,x=100,y=100,r=50,coordinates=x,y-r; for(var i=1;i &lt;r;i+=step){ bx=x; x+=step; y=y-Math.sqrt(Math.pow(r,2)-Math.pow(bx-x,2)) coordinates[i]=[x,y]; } a jsfiddle will be appreciated.
score: 2
type: AnsweredQuestion
has title: how to make an object turn around a point in html5 canvas
tagged with: coordinates
type: Question
tagged with: canvas
tagged with: javascript
tagged with: html5-canvas
downvote count: 0
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/42305965
comment on: http://stackoverflow.com/a/26873762
type: AnswerComment
score: 0
type: Comment
has text: @egekhter I provided an example in my edit. There are other ways that Kevin B mentioned.

http://stackoverflow.com/a/26908603
score: 15
upvote count: 15
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/65328473
answers question: http://stackoverflow.com/q/26907669
accepted answer of: http://stackoverflow.com/q/26907669
has body: Not only it provide validation for max length, it also adds a class ng-invalid-maxlength. so when you put anything beyond the limit ng-invalid-maxlength class will placed there and in that class you can write your own css. So after key press if validation fails, the css will be invoked simultaneously and reflects on your UI.

http://stackoverflow.com/comment/42241931
comment on: http://stackoverflow.com/q/26838414
has text: Could you include a more complete code sample, for instance, all of your HTML and controller code? What you have posted looks correct. Perhaps try replicating the problem at http://jsfiddle.net/ first.
type: Comment
score: 1
type: QuestionComment

http://stackoverflow.com/comment/42386689
score: 0
type: AnswerComment
has text: I change `$q=1;` to `$q=0;` and it shows ` quantity 0 ` When it is '1' it doesn't show ` quantity 1 `
type: Comment
comment on: http://stackoverflow.com/a/26916121

browserify
tags question: http://stackoverflow.com/q/26925277
tags question: http://stackoverflow.com/q/26903999
tags question: http://stackoverflow.com/q/26868815
tag name: browserify
tags question: http://stackoverflow.com/q/26984262
tags question: http://stackoverflow.com/q/26950731
tags question: http://stackoverflow.com/q/26877541
tags question: http://stackoverflow.com/q/26854796
type: Tag
tags question: http://stackoverflow.com/q/26914968
tags question: http://stackoverflow.com/q/26861340

http://stackoverflow.com/comment/42315174
score: 0
type: QuestionComment
has text: provide proper code. here no html code
type: Comment
comment on: http://stackoverflow.com/q/26877003

http://stackoverflow.com/comment/42391238
comment on: http://stackoverflow.com/q/26918724
has text: Here is another exact example of my problem. http://bootsnipp.com/snippets/featured/responsive-navigation-menu
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42373764
comment on: http://stackoverflow.com/a/26911785
type: AnswerComment
score: 0
has text: thanks, this is about what I came up with on my own working through it
type: Comment

http://stackoverflow.com/a/26956139
answers question: http://stackoverflow.com/q/26956120
type: Answer
has body: I didn't think this one through but for the benefit of everyone who's googling, here's what's up: Once you dig into the err, you'll find: { "error": "E_UNKNOWN", "status": 500, "summary": "Encountered an unexpected error", "raw": {} } In other words, Waterline's findOne always requires some sort of a query to find one item; it won't automatically find first one on any list and return it, that's not specific enough for findOne.
upvote count: 4
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26956120
score: 4

http://stackoverflow.com/comment/42279566
type: QuestionComment
has text: You can't make it wait. You have to use a callback that can be passed in to messager and then called when the last `fadeOut()` is done. Or you could use promises (which also end up using callbacks)
score: 0
comment on: http://stackoverflow.com/q/26859275
type: Comment

http://stackoverflow.com/a/26896804
score: 9
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26896565
upvote count: 9
answers question: http://stackoverflow.com/q/26896565
type: Answer
has body: Your selectboxes have form-control class which defines width: 100% and display: block. It means to makes them all take same line you should wrap selectboxes with one more container and then make them inline/inline-block and set some width: ... Date of birth ... And define this CSS styles for .date-select class: .date-select { display: inline-block; width: 30%; } Illustration: http://plnkr.co/edit/00izoqhM3nfquNieFNwe?p=preview
downvote count: 0

http://stackoverflow.com/q/26943500
has answer: http://stackoverflow.com/a/26943673
tagged with: session
has comment: http://stackoverflow.com/comment/42430074
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
answer count: 3
has title: send session variable to another php page that is never loaded
has answer: http://stackoverflow.com/a/26943579
type: UnansweredQuestion
has body: index page recieves the session variables from login page. I want this session variable to be sent to another php page withour any action from the user. A table is created and filled with data using the script.js file. The script.js file has ajax calls to dbmanipulate.php file. dbmanipulate.php interacts with the database. now is there anyway to send the php session variable from index.php to dbmanipulate.php the only page that the user loads is index.php and he is shown with a table that is produced dynamically. my index.php page after edits: <?php session_start(); $fname=$_SESSION['mail']; ?> Addressbook Your Adressbook your addressbook is connected to our servers :) <?php echo $fname; ?>
tagged with: php
has answer: http://stackoverflow.com/a/26943659
has comment: http://stackoverflow.com/comment/42432259
has comment: http://stackoverflow.com/comment/42430187
type: Question

http://stackoverflow.com/a/26861747
type: Answer
score: 0
has body: This behaviour is related to implicit form submission which is correctly implemented by Chrome as per HTML5 spec. You can go through the spec here. In short 'hitting the enter key' while a text field is focussed invokes browser controlled implicit form submission which in turn looks for first submit button under the 'form' element and invoke the attached handler. In your case the 'button' element is defaulted to 'submit' type but since it is not a decendent of 'form' element hence it will not be invoked. You can assume that current IE behaviour is not as per spec.
answers question: http://stackoverflow.com/q/26860996

http://stackoverflow.com/a/26843131
upvote count: 3
answers question: http://stackoverflow.com/q/26842835
has body: Just use this JS for (var i=1; i &lt;= imagesCount; i++){ var img = "&lt;img src='http: //www.example. com/GetImage.aspx?cid=000-000-000&amp;num="+ i +" /&gt;"; $(".yourContainerClass").append(img) ; } Must have jquery for this to work
downvote count: 0
type: Answer
score: 3

http://stackoverflow.com/comment/42407523
has text: no i have't got that as well, m getting wrong result set
comment on: http://stackoverflow.com/a/26930793
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/26905835
type: Question
tagged with: javascript
tagged with: jquery
upvote count: 1
has body: I am using Primefaces 5 and have a LazyLoaded data scroller set as follows &lt;p:dataScroller value="#{controller.dataModel}" var="item" chunkSize="10" lazy="true" mode="inline" scrollHeight="100" id="scroller"&gt; &lt;/p:dataScroller&gt; I want the dataScroller scrollHeight to be set to take up the full height of the space on the page which I can get via JavaScript and not a fixed size of 100. I have bound the window resize method to recalculate the size and set it and this works, but I can't set it initially. The javascript to set it looks like this $("#scroller &gt; div").css("height", $("#main").height()); And I call this after the component using &lt;h:outputScript&gt; $("#scroller &gt; div").css("height", $("#main").height()); &lt;/h:outputScript&gt; As stated, this works if I resize the window but not when the component is initially rendered.
answer count: 1
accepted answer: http://stackoverflow.com/a/26907350
favorite count: 0
has title: Primefaces 5 datascroller - Setting scrollHeight with Javascript
has answer: http://stackoverflow.com/a/26907350
type: AnsweredQuestion
tagged with: jsf
tagged with: primefaces
downvote count: 0
score: 1

http://stackoverflow.com/comment/42338623
type: QuestionComment
comment on: http://stackoverflow.com/q/26892254
has text: Can you give us your HTML?
score: 0
type: Comment

http://stackoverflow.com/q/26867456
has title: JavaScript or JQuery to make an element behave like a link - onmouseover or hover?
upvote count: 1
has body: Well, this time I have a rather sticky problem: make a TR row of a HTML table behave like a hyperlink. :/ Unfortunately I can't change the basic structure of HTML to use DIVs (due to coding requirements - it's a long story). So what's the problem? Basically, I know that the onclick (JavaScript) or click (JQuery) will link these elements up to the pages I need, and I have implemented these solutions with success. However, I would like them to act like hyperlinks while the user is hovering, so that the user sees (via the "hand" or whatever hover icon in his browser) that he is looking at a link, and can right-click and open in a new window. I know that I can use onmouseover and hover methods for respectively JavaScript and JQuery. The problem is, I haven't the faintest idea what code to put in such methods to make them work the way I need, and my search on Google has been thus far fairly fruitless. :/ My working code thus far With HTML and JavaScript My HTML: &lt;tr class = "oneResultat" onclick="DoNav('annonce.php')"&gt; ... &lt;/tr&gt; And JavaScript: function DoNav(url) { document.location.href = url; } With HTML and JQuery My HTML: &lt;tr class = "oneResultat" href = "annonce.php"&gt; ... &lt;/tr&gt; My JQuery: jQuery(document).ready(function($) { $(".oneResultat").click(function() { window.document.location = $(this).attr("href"); }); });
tagged with: jquery-hover
type: Question
has answer: http://stackoverflow.com/a/26868491
has answer: http://stackoverflow.com/a/26867567
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26868491
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/42294245
has comment: http://stackoverflow.com/comment/42294122
has answer: http://stackoverflow.com/a/26867718
has answer: http://stackoverflow.com/a/59618311
has comment: http://stackoverflow.com/comment/42294314
answer count: 5
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/26867718
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26881463
has comment: http://stackoverflow.com/comment/42294340
score: 1
tagged with: onmouseover

http://stackoverflow.com/comment/42326298
has text: If there is any difference in speed resolving absolute vs relative paths, it's so small it doesn't even need to be taken into consideration. I suggest you don't waste time on optimizing things that need no optimization, unless you have some profiling data that suggests otherwise.
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26883489

http://stackoverflow.com/comment/43036699
type: AnswerComment
score: 0
type: Comment
has text: This seems workable. Are you suggesting that sails.js will lift and continue running even if it fails to write to its .tmp directory? I also found that sails/grunt was trying to write to the ./views/ directory.
comment on: http://stackoverflow.com/a/27277832

http://stackoverflow.com/q/26941249
accepted answer: http://stackoverflow.com/a/26941359
possible better answer: http://stackoverflow.com/a/26941315
upvote count: 2
has answer: http://stackoverflow.com/a/26941315
downvote count: 1
has title: auto expand background height with textarea
type: Question
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/26941359
answer count: 2
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I need a background to expand automatically when the entered text resizes a textarea. I had problems with the position of the textarea so I had to use position:absolute to place it correctly. the html: &lt;ul id="UL"&gt; &lt;li class="newComment_row"&gt; &lt;div class="userComments_photo"&gt; &lt;img class="photo" src="' . $userComment_img . '" alt="" /&gt; &lt;/div&gt; &lt;textarea id="" class="textarea" rows="1" placeholder="Escribe un comentario..." title="Escribe un comentario..."&gt;&lt;/textarea&gt; &lt;/li&gt; &lt;/ul&gt; the css: #UL { width: 494px; list-style: none outside none; margin: 0px; padding: 0px; border-top: 1px solid rgb(225, 226, 227); } .newComment_row { height: 32px; position: relative; width: 470px; background: rgb(246, 247, 248) none repeat scroll 0% 0% / auto padding-box border-box; border-radius: 0 0 2px 2px; list-style: none outside none; margin: 0px 12px; padding: 4px 0px 8px; rows: 1px; } .textarea { resize: none; width: 420px; font: normal normal normal 12px/15.3599996566772px Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif; position: absolute; padding: 8px 3px 0 3px; margin: 0 7px; overflow: hidden; } and the jquery to autoresize the textarea: function h(e) { $(e).css({ 'height': 'auto', 'overflow-y': 'hidden' }).height(e.scrollHeight); } $('textarea').each(function () { h(this); }).on('input', function () { h(this); }); I'm testing it here http://jsfiddle.net/ttwbxwon/28/
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/45672692
score: 0
type: Comment
has text: @AndreyVorobyev You should get the value of scroll height left after the place have scrolled. If you need positive number you have to make it absolute.
comment on: http://stackoverflow.com/a/28690320
type: AnswerComment

http://stackoverflow.com/comment/42402060
type: Comment
type: QuestionComment
has text: Check your client side javascript console - there will be an error about the parameters being passed to the server. When a `form` is a parameter, it must be the only parameter. You won't be able to pass the table like this. You could have the clickHandler build an object with form field + table, though. Better, you could put the script into a spreadsheet, and use IT as a database. Or you could use a hosted db...
comment on: http://stackoverflow.com/q/26900373
score: 0

http://stackoverflow.com/a/26902588
type: Answer
has comment: http://stackoverflow.com/comment/42359576
answers question: http://stackoverflow.com/q/26902332
has comment: http://stackoverflow.com/comment/42357770
has body: Use the Popover's Options to beautify your popover. Using these options you can have complete control over the functionality and appearance of your popover. http://getbootstrap.com/javascript/#popovers-usage This fiddle only demonstrates a few of these options... Js Code $(document).ready(function(){ $(".popover-examples a").popover({ title : 'Weather App', trigger: 'hover', template: ' Just an example of inserting image in a Popover... ' }); }); HTML Popover Example
score: 0
has comment: http://stackoverflow.com/comment/42357038

http://stackoverflow.com/a/26982635
has body: Ajax Deferred If you wanted to use the ajax deferred method, you would do something like this. (function($){ $('#add_category_form').submit(function( event ){ event.preventDefault(); var _data = this.serialize(); doSomething( _data ).then( function( response ){}, // Success function( error, code){} // Error ); }); var doSomething = function( data ){ return $.ajax({ url : base_url + "/menu/add_category", data : data, type : 'POST', dataType : 'html' }).promise(); }; }(jQuery));
score: 0
has comment: http://stackoverflow.com/comment/42507386
answers question: http://stackoverflow.com/q/26971024
type: Answer

http://stackoverflow.com/a/26982396
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26981817
answers question: http://stackoverflow.com/q/26981817
score: 0
type: Answer
has body: .delay(1500) is non blocking, hence you loop will call drawline() continously without any delay. What you are looking for is timeout : function drawline(){ //your stuff setTimeout(drawline, 1500); }

http://stackoverflow.com/comment/42399685
score: 1
comment on: http://stackoverflow.com/q/26926672
type: QuestionComment
has text: Maybe if you show us some code in question, we can get closer to the answer.
type: Comment

http://stackoverflow.com/a/27001849
has body: I've played around the data, which was close to your. I had a log table (ascending timestamps) with ~350k of records. I dumped it into csv and wrote a benchmark.js suite to slice ~10% range of it (see below). I have the following results on my laptop: Firefox Array.prototype.filter x 38.42 ops/sec ±0.79% (64 runs sampled) Full crossfilter.js x 11.85 ops/sec ±18.42% (30 runs sampled) Prepared crossfilter.js x 1,196 ops/sec ±9.70% (69 runs sampled) Binary search x 3,525 ops/sec ±4.51% (45 runs sampled) Fastest: Binary search Chromium Array.prototype.filter x 33.34 ops/sec ±2.34% (44 runs sampled) Full crossfilter.js x 5.23 ops/sec ±6.74% (17 runs sampled) Prepared crossfilter.js x 1,321 ops/sec ±11.90% (95 runs sampled) Binary search x 22,172 ops/sec ±1.25% (95 runs sampled) Fastest: Binary search A note about crossfilter.js. It's not exactly a part of D3, but a member of the family (written also by Mike Bostock). Its goal is quick filtering and grouping of multi-dimensional data. So in case you would like to slice your data interactively, it's exactly what you need. However if performance is an absolute priority and you can guarantee that data is sorted, then you'd like to adapt binary search like in example below. Sorted list date range performance comparison
accepted answer of: http://stackoverflow.com/q/26987005
type: Answer
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26987005

http://stackoverflow.com/a/26880258
accepted answer of: http://stackoverflow.com/q/26878503
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/26878503
has body: Your main problem is that your map variable is local to the initialize function, so it is not available in the global scope where HTML click functions run. One solution: var geocoder; var map; function initialize() { geocoder = new google.maps.Geocoder(); var mapOptions = { center: { lat: 48.509532, lng: -122.643852 }, zoom: 4 }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); working fiddle Another solution: define codeAddress inside the initialize function and use the google.maps.event.addDomListener function: google.maps.event.addDomListener(document.getElementsByClassName('search_button')[0],'click',codeAddress); working fiddle
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/42274516
type: Comment
type: QuestionComment
has text: Thanks for the example, but I still have a problem: the button text must be in spanish: "Me gusta" (Like) and "Ya no me gusta" (Unlike). How can I do this?
score: 0
comment on: http://stackoverflow.com/q/26855002

http://stackoverflow.com/comment/42362588
type: Comment
comment on: http://stackoverflow.com/a/26904390
has text: You can see from the caniuse site, that IE9 does not support 3D transformations (only 2D with -ms- prefix). You can simply show the back div on hover, without animation. What's the big deal about having animation? Remember that content is still more important than presentation. IE9 users will miss that animation and will not even be aware of that. Go to http://css-tricks.com/snippets/css/browser-specific-hacks/ for IE9 specific CSS. This way you leave animation available for real browsers.
type: AnswerComment
score: 0

http://stackoverflow.com/a/26855313
has comment: http://stackoverflow.com/comment/42272877
score: 0
has body: EDIT: Forgot the obvious...but: JSON = [ {"state":"First State","district":"First District","local_district_id":1,"zone_id":117,"center_id":"A","center_name":"Voting Center First"}, {"state":"First State","district":"First District","local_district_id":2,"zone_id":117,"center_id":"B","center_name":"Voting Center Second"}, {"state":"First State","district":"First District","local_district_id":6,"zone_id":117,"center_id":"C","center_name":"Voting Center Third"}, ] messy, but... something like this newObj = {}; for (var i in JSON) { if (!newObj.length) { newObj.push({'state': JSON[i]['state']}) delete([JSON[i]['state']) newObj[0]['children'] = [JSON[i]] continue } for (var j in newObj) { if (newObj[j]['state'] = JSON[i]['state']) { delete([JSON[i]['state']) newObj[j]['children'].push(JSON[i]) } else { newObj.push({'state': JSON[i]['state']}) delete([JSON[i]['state']) newObj[newObj.length-1]['children'] = [JSON[i]] } } }
type: Answer
answers question: http://stackoverflow.com/q/26855157
has comment: http://stackoverflow.com/comment/42272910

http://stackoverflow.com/q/26908604
has body: After updating the express module to the 4.0 version the following url regexp stop working: app.get("/admin/list001/(userid/:userid)?/(name/:name)?/(email/:email)?/order/:order/field/:field/first/:first/rows/:rows/curriculums.:format(json)", function(request, response){ SyntaxError: Invalid regular expression: /^\/admin\/list001\/(?(?:([^\/]+?))\/(?:([^\/]+?)))?\/name(?:\/([^\/]+?))?\/email(?:\/([^\/]+?))?\/order\/(?:([^\/]+?))\/field\/(?:([^\/]+?))\/first\/(?:([^\/]+?))\/rows\/(?:([^\/]+?))\/curriculums(?:\.(json))\/?$/: Invalid group There are any other way of achieving the same result? Edit: (progress) /admin/list001(/userid/:userid)?(/name/:name)?(/email/:email)?(/order/:order)?(/field/:field)?(/first/:first)?(/rows/:rows)?/curriculums.:format(json) This works. But the request.params vars don't catch the right values: { '0': '/field/userid', '1': 'userid', '2': '/first/0', '3': '0', '4': '/rows/20', '5': '20', '6': 'json', userid: '/userid/true', name: 'true', email: '/name/true', order: 'true', field: '/email/true', first: 'true', rows: '/order/DESC', format: 'DESC' }
type: Question
tagged with: javascript
tagged with: express
has comment: http://stackoverflow.com/comment/42368071
has comment: http://stackoverflow.com/comment/42368438
has title: NodeJS Express 4.0 routing regex error
score: 0
tagged with: regex
tagged with: node.js
has comment: http://stackoverflow.com/comment/42368003
has comment: http://stackoverflow.com/comment/42367091
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/42441043
comment on: http://stackoverflow.com/a/26946739
score: 0
type: AnswerComment
type: Comment
has text: I see. Glad you figured it out.

http://stackoverflow.com/q/26908262
answer count: 1
tagged with: jquery
has body: I have problem I'm validating text field (click submit button) and if value is true then i need to use jQuery dialog to get another permissions (enter another code). But if user closing down the dialog box and click submit button again then dialog box come up again (this is good) user entering code in to dialog form and submitting. Then i have two records (duplicated) on my database. If user closing-submitting dialog box 3 times then i have 3 dublicated records: $('#f_button').click(function(){ // validation { // if true $("#dialog").dialog("open"); $("#test_button").click(function() { $.ajax({ // validating text field in dialog type: 'POST', url: file.php', data: $('#form_name).serialize(), success: function validate(data1) { if (data1 == 1) { $("#text_field").css('background-color', '#00FF00'); $('#another_form')[0].submit(); } else { $("#text_field").css('background-color', '#FF0000'); } } }) });
favorite count: 0
has title: Record are multiple recorded on DB after jQuery validation
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42367065
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42366774
accepted answer: http://stackoverflow.com/a/26908541
type: Question
has answer: http://stackoverflow.com/a/26908541
tagged with: javascript
score: 0
upvote count: 1
downvote count: 1

http://stackoverflow.com/a/26922944
upvote count: 2
answers question: http://stackoverflow.com/q/26897762
has body: Improving Mathew's answer with pure javascript: var html = document.getElementById('content').cloneNode(true); var imgs = html.getElementsByTagName('img'); for (i = 0; i &lt; imgs.length; i++) { var textSep = document.createTextNode('@img@'); imgs[i].parentNode.insertBefore(textSep, imgs[i]); } var texts = html.textContent; texts = texts.split('@img@');
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/q/26861912
has answer: http://stackoverflow.com/a/26862398
tagged with: node.js
has body: I need to generate HEX encoded CMAC-AES digest using Node.JS. I have found library from GitHub. I want to know how to call it? This is the part I want to do it in node.js. I want to pass key and message. I imported this library into my node.js project. I want to know how to call this method aesCmac. My index.js var express = require('express'); var querystring = require('querystring'); var http = require('http'); var aesCmac = require('./lib/aes-cmac.js'); var app = express(); app.get('/aesCmac', aesCmac.aesCmac('xxxxxxxx' ,'LSCourse|0xxxxxxxx|103xxxxxxxx|xxxxx|xxxx.xxx.xx@xxx.com|2014-11-11T09:29:04Z')); app.configure(function () { app.use(express.logger('dev')); /* 'default', 'short', 'tiny', 'dev' */ app.use(express.bodyParser()); }); app.listen(80); I got this error: F:\NODE.JS\node-aes-cmac-master&gt;node index.js node-crypto : Invalid key length 32 crypto.js:315 this._binding.initiv(cipher, toBuf(key), toBuf(iv)); ^ Error: error:0607A082:digital envelope routines:EVP_CIPHER_CTX_set_key_length:invalid key length at new Cipheriv (crypto.js:315:17) at Object.Cipheriv (crypto.js:313:12) at aes128 (F:\NODE.JS\node-aes-cmac-master\lib\aes-cmac.js:25:23) at Object.exports.generateSubkeys (F:\NODE.JS\node-aes-cmac-master\lib\aes-cmac.js:9:11) at Object.exports.aesCmac (F:\NODE.JS\node-aes-cmac-master\lib\aes-cmac.js:32:25) at Object.&lt;anonymous&gt; (F:\NODE.JS\node-aes-cmac-master\index.js:9:29) 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) I am new to Node js.
type: UnansweredQuestion
tagged with: oauth-2.0
tagged with: encryption
type: Question
score: 0
answer count: 1
tagged with: javascript
has title: How can I generate HEX-encoded CMAC-AES digest in Node JS?
tagged with: cryptography

http://stackoverflow.com/a/27016014
type: Answer
accepted answer of: http://stackoverflow.com/q/26910552
answers question: http://stackoverflow.com/q/26910552
score: 0
type: AcceptedAnswer
has body: As Georgy mentioned, the cookie was set to HTTPOnly in WAS, which could be disabled under the Security settings.

http://stackoverflow.com/comment/42364554
has text: @Benjamin - use `window.location.hash = $(this).attr('href');` it will resolve your `#undefined` issue
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26905952
type: Comment

http://stackoverflow.com/comment/42460223
type: Comment
type: AnswerComment
has text: Any Way I Can put Both The Name ANd the Picture In The Array?
score: 0
comment on: http://stackoverflow.com/a/26955193

http://stackoverflow.com/a/26868230
score: 0
accepted answer of: http://stackoverflow.com/q/26868064
type: Answer
answers question: http://stackoverflow.com/q/26868064
has body: .getAttribute("href"); is available in JavaScript itself, but not in jQuery. Adding the [0] to it selects the DOM element and then running getAttribute() will select the DOM element related to your jQuery object, and then gets the attribute. However, using jQuerys .attr() allows you to select it directly in jQuery. So both of these work: // jQuery and pure JS alert(jQuery('.photo').find('a')[0].getAttribute("href")); // pure jQuery alert(jQuery('.photo').find('a').attr("href"));
type: AcceptedAnswer

zurb-foundation
tags question: http://stackoverflow.com/q/26884197
type: Tag
tags question: http://stackoverflow.com/q/26974879
tags question: http://stackoverflow.com/q/26885945
tags question: http://stackoverflow.com/q/26863833
tag name: zurb-foundation

http://stackoverflow.com/comment/42345887
comment on: http://stackoverflow.com/q/26895859
score: 0
type: QuestionComment
type: Comment
has text: @sylwester It has some default values for all the options except the option `Other`, which should allow the user to input a value, but again the user can select an option with a predefined value so the text box value (user entered) should be replaced.

http://stackoverflow.com/q/26853850
tagged with: angularjs-ng-repeat
favorite count: 0
accepted answer: http://stackoverflow.com/a/26853971
has comment: http://stackoverflow.com/comment/42270361
tagged with: angularjs
score: 6
upvote count: 6
has title: AngularJS display list from an array
type: AnsweredQuestion
tagged with: list
has body: I have a controller that returns an array, I'm trying to display every element of that array as a list. What I am attempting to do, which is not working: &lt;li ng-repeat="Name in names"&gt; &lt;a ng-controller="PostsCtrl" href="#"&gt;{{response.text}}&lt;/a&gt; &lt;/li&gt; response.text returns an array from the controller. I am also wondering, what is the value of the ng-repeat attribute supposed to be, any unique string? Thank you!
has answer: http://stackoverflow.com/a/26854727
type: Question
has answer: http://stackoverflow.com/a/26853981
has answer: http://stackoverflow.com/a/26853971
tagged with: arrays
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26854727
answer count: 3
has comment: http://stackoverflow.com/comment/42270432

http://stackoverflow.com/q/26925637
type: Question
tagged with: browser
has answer: http://stackoverflow.com/a/26925663
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: android
score: 1
has title: How Solve error in Webview Browser Android Application?
type: UnansweredQuestion
tagged with: webview
upvote count: 1
has body: I m New in Android. I'm trying to build a simple Web view Browser android application. This Application is important for me.But the application is not opening and is crashing.There are many errors in log cat.How to solve this error. please any programmer help me. Thank you log error txt 11-14 13:31:03.922: E/AndroidRuntime(901): FATAL EXCEPTION: main 11-14 13:31:03.922: E/AndroidRuntime(901): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ronny.yesjarweb/com.ronny.yesjarweb.MainActivity}: java.lang.NullPointerException 11-14 13:31:03.922: E/AndroidRuntime(901): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059) 11-14 13:31:03.922: E/AndroidRuntime(901): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) 11-14 13:31:03.922: E/AndroidRuntime(901): at android.app.ActivityThread.access$600(ActivityThread.java:130) 11-14 13:31:03.922: E/AndroidRuntime(901): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) 11-14 13:31:03.922: E/AndroidRuntime(901): at android.os.Handler.dispatchMessage(Handler.java:99) 11-14 13:31:03.922: E/AndroidRuntime(901): at android.os.Looper.loop(Looper.java:137) 11-14 13:31:03.922: E/AndroidRuntime(901): at android.app.ActivityThread.main(ActivityThread.java:4745) 11-14 13:31:03.922: E/AndroidRuntime(901): at java.lang.reflect.Method.invokeNative(Native Method) 11-14 13:31:03.922: E/AndroidRuntime(901): at java.lang.reflect.Method.invoke(Method.java:511) 11-14 13:31:03.922: E/AndroidRuntime(901): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 11-14 13:31:03.922: E/AndroidRuntime(901): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 11-14 13:31:03.922: E/AndroidRuntime(901): at dalvik.system.NativeStart.main(Native Method) 11-14 13:31:03.922: E/AndroidRuntime(901): Caused by: java.lang.NullPointerException 11-14 13:31:03.922: E/AndroidRuntime(901): at android.view.ViewGroup.addViewInner(ViewGroup.ja…

http://stackoverflow.com/comment/42436629
type: Comment
type: QuestionComment
has text: Common guys need a little help here!
comment on: http://stackoverflow.com/q/26935548
score: 0

http://stackoverflow.com/comment/42447421
score: 0
type: Comment
has text: Updated my answer, made a mistake in FireFox. Error in your code cannot be re produced in FireFox 33.0 unless running it in a console of a fresh new tab that doesn't have a page open. I am curious what the updated code in my answer would produce for you in other browser (I only have FireFox and Chrome).
type: QuestionComment
comment on: http://stackoverflow.com/q/26946843

http://stackoverflow.com/a/26977341
has comment: http://stackoverflow.com/comment/42505013
has comment: http://stackoverflow.com/comment/42574412
has comment: http://stackoverflow.com/comment/42572807
score: 0
has comment: http://stackoverflow.com/comment/42583179
type: Answer
has comment: http://stackoverflow.com/comment/42524155
answers question: http://stackoverflow.com/q/26965388
has body: Put each div named one,two etc... inside individual container div Add height:100% to html{} and body{} Remove dot before body{} Add overflow-y: scroll and float:left properties to .container{} Make height:100% for #everything{} Check my code below and implement for all other 97 scrollers. -Cheers! $(document).scroll(function(){ $('body').append($('#one').html()); }); $(document).scroll(function(){ $('body').append($('#two').html()); }); $(document).scroll(function(){ $('body').append($('#three').html()); }); $(document).scroll(function(){ $('body').append($('#four').html()); }); $(document).scroll(function(){ $('body').append($('#five').html()); }); $(document).scroll(function(){ $('body').append($('#six').html()); }); $(document).scroll(function(){ $('body').append($('#seven').html()); }); $(document).scroll(function(){ $('body').append($('#eight').html()); }); $(document).scroll(function(){ $('body').append($('#nine').html()); }); $(document).scroll(function(){ $('body').append($('#ten').html()); }); $(document).scroll(function(){ $('body').append($('#eleven').html()); }); $(document).scroll(function(){ $('body').append($('#twelve').html()); }); $(document).scroll(function(){ $('body').append($('#thirteen').html()); }); $(document).scroll(function(){ $('body').append($('#fourteen').html()); }); $(document).scroll(function(){ $('body').append($('#fifteen').html()); }); $(document).scroll(function(){ $('body').append($('#sixteen').html()); }); $(document).scroll(function(){ $('body').append($('#seventeen').html()); }); $(document).scroll(function(){ $('body').append($('#eighteen').html()); }); $(document).scroll(function(){ $('body').append($('#nineteen').html()); }); $(document).scroll(function(){ $('body').append($('#twenty').html()); }); $(document).scroll(function(){ $('body').append($('#twentyone').html()); }); $(document).scroll(function(){ $('body').append($('#twentytwo').html()); }); $(document).scroll(function(){ $('body').append($('#twentythree').html()); …
has comment: http://stackoverflow.com/comment/42583315

http://stackoverflow.com/a/27027268
upvote count: 1
answers question: http://stackoverflow.com/q/26939309
score: 1
has comment: http://stackoverflow.com/comment/42583258
has body: You can't use Javascript in emails. Most clients will block it. You're stuck with changing these bgcolors by hand.
downvote count: 0
type: Answer

http://stackoverflow.com/q/26948631
has title: D3: scale and color for choropleth map
type: AnsweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/42439198
type: Question
accepted answer: http://stackoverflow.com/a/26948959
downvote count: 0
tagged with: javascript
answer count: 1
score: 1
favorite count: 0
tagged with: d3.js
tagged with: http://stackoverflow.com/tag/csv
has answer: http://stackoverflow.com/a/26948959
has body: I'm working on a D3 map as one of several prototypes for a project involving small areas statistics. I'm starting with a simple map and I am new to D3. I have not been able to display a range of colors using either a threshold or quantile scale. I have written at least 6 examples to experiment with the many other examples that already exist but I simply cant get the range to display in the areas. I know I am close but there is something I am missing. My example is on git at https://github.com/Monduiz/OL-explorer. I really would appreciate any insights to help me understand what I'm doing wrong. Here's the code I'm working with and the files are available at the link above. var width = 960, height = 500; var colors = d3.scale.quantize() .domain([0, 1]) .range(colorbrewer.YlOrRd[7]); var projection = d3.geo.azimuthalEqualArea() .rotate([100, -45]) .center([5, 20]) .scale(800) .translate([width/2, height/2]) var path = d3.geo.path() .projection(projection); var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height); queue() .defer(d3.json, "OLMCSDfr.json") .defer(d3.csv, "data.csv") .await(ready); function ready(error, can, OLM) { var PopById = {}; OLM.forEach(function(d) { PopById[d.Id] = +d.OLMnb; }); svg.append("g") .attr("class", "SDR") .selectAll("path") .data(topojson.feature(can, can.objects.OLMCSDfr).features) .enter().append("path") .attr("d", path) .style("fill", function(d) { return colors(PopById[d.Id]); }); }
tagged with: topojson
tagged with: choropleth

http://stackoverflow.com/comment/42449282
comment on: http://stackoverflow.com/q/26954685
score: 0
type: Comment
type: QuestionComment
has text: It doesn't automatically click the div?

http://stackoverflow.com/comment/42341358
has text: I did not state that I place all php files in that location. The files which I place there are utility scripts which would for all intent purposes constitute 'shared libraries'. Placing them with in the web root could reveal program structure which may make hacking the site easier. I used to place them in cgi-bin and use a path such as ../../cgi-bin/myfile.php but found using the default include directory easier because the path does not need to be altered if the file resides in a sub-directory of the web root.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26893234
score: 0

http://stackoverflow.com/a/26857697
score: 0
has comment: http://stackoverflow.com/comment/42297773
answers question: http://stackoverflow.com/q/26857662
has comment: http://stackoverflow.com/comment/42287350
type: Answer
has comment: http://stackoverflow.com/comment/42282779
has comment: http://stackoverflow.com/comment/42285931
has body: Check the HTTP status if it is 404 then redirect to your default page. How to check HTTP status code. Redirect to your default webpage using: window.location = "your-default-webpage.html";

http://stackoverflow.com/comment/42337504
type: Comment
type: QuestionComment
has text: I wouldn't be a one-liner but is there really a problem in iterating to list the columns and then build the table with a second iteration ? Are you expecting us to write that code or do you see a blocking problem ?
score: 2
comment on: http://stackoverflow.com/q/26891846

http://stackoverflow.com/comment/42372204
type: QuestionComment
comment on: http://stackoverflow.com/q/26910791
score: 1
has text: Why you redirect all the requests to login page?
type: Comment

http://stackoverflow.com/comment/42676973
type: Comment
type: QuestionComment
has text: I just added an answer bellow : If you need help understanding more general File API I would be more then willing to give you my email.
score: 0
comment on: http://stackoverflow.com/q/26962068

http://stackoverflow.com/comment/42359378
type: AnswerComment
type: Comment
score: 2
comment on: http://stackoverflow.com/a/26903950
has text: @OmarDiab A promise represents a _proxy for a value_, the value is already there. Chaining to a promise does not launch any action on itself - it will make a single http request. The `find` method launches the request - the `then` handlers only let us hook on its result when it is done. Calling `.then` on `student` twice is no different from passing a variable to two different functions - it will not execute the code that assigned to that variable to begin with.

http://stackoverflow.com/comment/42310945
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/26876703
has text: Why don't you simply count the 3 shots for each player?

http://stackoverflow.com/comment/42510580
has text: Thank you for your answer! I try one more time to set CORS. I search php script [there](http://stackoverflow.com/a/18399709) When i reload server and browser on page derived "You have CORS!" But when i try to get ajax request => same error :(
type: Comment
comment on: http://stackoverflow.com/a/26983323
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42455877
type: Comment
type: QuestionComment
has text: Welcome to StackOverflow. Your question is pretty vague, you should read the "how do I ask" FAQ and revise your question to make it very specific and to show what you've already tried. http://stackoverflow.com/help/how-to-ask
score: 1
comment on: http://stackoverflow.com/q/26958517

http://stackoverflow.com/q/26834795
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42235683
upvote count: 1
has title: How to access parent scope inside Javascript object?
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/26834891
answer count: 1
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/42235652
has body: Is it possible to get a variable above the current scope in a Javascript object? var object = { access: [{ actionName: "Defending", action: function(unit) { } }, { actionName: "Mining", action: function(unit) { super.promises.push($interval(function() { // Here I need to access the variable 'promises' from the above scope // do something }, 1000)); } }, { actionName: "Cutting wood", action: function(unit) { super.promises.push($interval(function() { // Same here // do something }, 1000)); } }], promises: [] };
accepted answer: http://stackoverflow.com/a/26834891

http://stackoverflow.com/comment/42283829
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26861753
has text: So you want to empty the textarea when the form is submitted? BTW, is that tag `java` or `javascript`?

http://stackoverflow.com/a/27099835
has comment: http://stackoverflow.com/comment/42736377
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/42721094
type: Answer
accepted answer of: http://stackoverflow.com/q/26941923
has body: Thread-safety of a library means that the library can be used in a multithreaded environment. SpiderMonkey library can be integrated into a multithreaded C++ application. That has nothing to do with JavaScript language model. However certain rules and restrictions apply. Theses rules are confusing as they have been changing from one version of the library to another and the documentation wasn't and still isn't very clear about them. Documentation pages often display notes like: "Deprecated since..." or "DRAFT IN PROGRESS...", or "Not Found 404". Starting in Gecko 12.0 or SpiderMonkey 24, the rules are: JSRuntime is single-threaded. You must only use it from one thread To call the library APIs from more that one thread at once, use multiple JSRuntimes In a JS_THREADSAFE build, many JSAPI functions must only be called from within a request (JS_THREADSAFE is now permanently on) Bracket API calls with JS_BeginRequest, JS_EndRequest functions or use JSAutoRequest class Garbage Collector suspends all other threads calling into SpiderMonkey. To keep wait time to a minimum, avoid long-running requests. Do not include blocking I/O or time-consuming calculations inside JS_BeginRequest, JS_EndRequest blocks. You may consider building a debug version of SpiderMonkey to test your integration. Try using flags: --enable-root-analysis --enable-debug --disable-optimize Those add assertions in the library code to help catching thread (garbage collector, and memory) related problems earlier.
answers question: http://stackoverflow.com/q/26941923
upvote count: 1

http://stackoverflow.com/comment/42311304
score: 0
type: Comment
type: QuestionComment
has text: Thanks so much for your help and direction. I was trying to add something in javascript as I do the php end and am unfamiliar with it. I will withdraw my question and leave.
comment on: http://stackoverflow.com/q/26875501

http://stackoverflow.com/comment/42501090
type: QuestionComment
comment on: http://stackoverflow.com/q/26983490
type: Comment
score: 0
has text: None of those should return the window, in any browser, so you're doing something really strange here.

http://stackoverflow.com/comment/42478822
type: QuestionComment
has text: Just give `Test`. Giving # will try to load url which is "/"
score: 0
comment on: http://stackoverflow.com/q/26971376
type: Comment

http://stackoverflow.com/comment/42392298
has text: @anoop, thanks for you interest in this! I've been scratching my head for 2 days!
comment on: http://stackoverflow.com/q/26878054
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26985077
has answer: http://stackoverflow.com/a/26992888
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion
tagged with: oracle-database
has title: Oracle Apex Canvas to blob in PNG format saved to item
has body: I am struggling to convert my canvas URL to a blob format, specifically in PNG format. The DataURL is generating quite perfectly when I tested it without the conversion code, the problem comes in when trying to convert it to Blob. I am using an html button that triggers the JavaScript function with the ID buttonTextArea. I need the Blob file to be linked to my APEX page item, which I use the $s('P9_IMAGE_CODE', Blob) format, which also works when I tested it using text only. Once the page is processed, that item will be sent into a blob column within my table. Here is my code: $("#buttonTextArea").click(function(dataURL) { var BASE64_MARKER = ';base64,'; var canvas = document.getElementById('myCanvas'); var dataURL = canvas.toDataURL(); if (dataURL.indexOf(BASE64_MARKER) == -1) { var parts = dataURL.split(','); var contentType = parts[0].split(':')[1]; var raw = decodeURIComponent(parts[1]); return new Blob([raw], {type: contentType}); } var parts = dataURL.split(BASE64_MARKER); var contentType = parts[0].split(':')[1]; var raw = window.atob(parts[1]); var rawLength = raw.length; var uInt8Array = new Uint8Array(rawLength); for (var i = 0; i &lt; rawLength; ++i) { uInt8Array[i] = raw.charCodeAt(i); } return new Blob([uInt8Array], {type: contentType}); document.getElementById("textArea").value = dataUrl; $s('P9_IMAGE_CODE', Blob); --P9_IMAGE_CODE IS THE ITEM ON MY PAGE }); I have been trying examples from : https://github.com/blueimp/JavaScript-Canvas-to-Blob/blob/master/README.md and https://code.google.com/p/chromium/issues/detail?id=67587 Thank you in advance.
type: Question
tagged with: canvas
tagged with: javascript
tagged with: oracle-apex
has comment: http://stackoverflow.com/comment/42506733
score: 0
has comment: http://stackoverflow.com/comment/42507973

http://stackoverflow.com/q/26901971
downvote count: 0
possible better answer: http://stackoverflow.com/a/46009173
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/71445086
score: 44
type: Question
has answer: http://stackoverflow.com/a/66977055
has body: {"document": {"people":[ {"name":["Harry Potter"],"age":["18"],"gender":["Male"]}, {"name":["hermione granger"],"age":["18"],"gender":["Female"]}, ]} } From this JSON example, I would like to get the keys such as name, age, gender for each people. How to do this?
tagged with: javascript
has answer: http://stackoverflow.com/a/66068389
has answer: http://stackoverflow.com/a/45168990
has answer: http://stackoverflow.com/a/46009173
has comment: http://stackoverflow.com/comment/105733424
answer count: 7
upvote count: 44
accepted answer: http://stackoverflow.com/a/26902030
favorite count: 0
has answer: http://stackoverflow.com/a/26902030
has title: How to get all key in JSON object (javascript)
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26923906
has comment: http://stackoverflow.com/comment/42356271

http://stackoverflow.com/q/26865040
possible better answer: http://stackoverflow.com/a/26881019
answer count: 2
has answer: http://stackoverflow.com/a/26881019
score: 2
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has body: I have to view 'doc','docx','pdf' in light box.I have tried blow link and view googledrive document link in iframe .But its show blank. Reference link:https://github.com/addyosmani/jquery-googleviewer-plugin/blob/master/demo.html Thanks Advance
favorite count: 0
accepted answer: http://stackoverflow.com/a/26865158
tagged with: google-drive-api
has title: How to view googledrive document link in iframe or lightbox
tagged with: php
type: AnsweredQuestion
upvote count: 2
type: Question
has answer: http://stackoverflow.com/a/26865158
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/26964861
type: AcceptedAnswer
score: 0
type: Answer
has body: popup: colorbox slider: elastislide-responsive-carousel http://jsfiddle.net/ckraoftt/1/ HTML: JQ: $( '#carousel' ).elastislide( { orientation : 'vertical' } ); $('#carousel a').colorbox({photo :true}); EDIT2: http://jsfiddle.net/ckraoftt/7/ for all a tag add 2 attr: data-txt="image 4 4000$" //text after image data-button-url="http://test.com/shop/4" //url for button Shop JQ $( '#carousel' ).elastislide( { orientation : 'vertical' } ); $('#carousel a').colorbox({ html:function(){ var src=$(this).attr('href'); var txt=$(this).attr('data-txt'); var url=$(this).attr('data-button-url'); var img=' '; var text= ' '+txt+' '; var btn='SHOP'; var html=' '+img+text+btn+' '; return html; }
accepted answer of: http://stackoverflow.com/q/26963129
has comment: http://stackoverflow.com/comment/42467722
answers question: http://stackoverflow.com/q/26963129

http://stackoverflow.com/a/27004193
type: Answer
score: 1
has body: Just an addendum to Artjom's answer; when using SlimerJS as the engine it hangs when using require. I got it working (with both PhantomJS and SlimerJS) using the following: var fs = require('fs'); var sugarJS = fs.read("/path/to/sugar.min.js"); eval(sugarJS); as a drop-in replacement for: require("/path/to/sugar.min");
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/26947673

http://stackoverflow.com/comment/42464958
score: 0
comment on: http://stackoverflow.com/a/26919628
type: Comment
has text: So, something like this:' '
type: AnswerComment

http://stackoverflow.com/comment/42452175
has text: Yeah thats odd i've checked the JSON is valid via JSON lint, but I get an error when I do $scope.machineDetails = JSON.parse(data);
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/26956267
type: Comment

http://stackoverflow.com/comment/42473527
type: Comment
type: QuestionComment
has text: typical xy problem..
comment on: http://stackoverflow.com/q/26928545
score: 0

http://stackoverflow.com/comment/42256122
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26846580
has text: change `jquery` to `jQuery`

http://stackoverflow.com/q/26866431
type: Question
tagged with: hta
tagged with: javascript
tagged with: base64
upvote count: 2
accepted answer: http://stackoverflow.com/a/26873462
answer count: 1
favorite count: 0
has body: I'm currently making a HTA application and I need to save Base64-encoded ZIP archive to file. var stream = new ActiveXObject('ADODB.Stream'); stream.Type = 1; stream.Open(); stream.Write(atob(data)); stream.SaveToFile('dump.zip'); stream.Close(); This code throw error on stream.Write(data) Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. There are some solutions for VBScript, but I'm trying to make it on javascript.
has answer: http://stackoverflow.com/a/26873462
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: activex
has title: Write binary file with Javascript and ADODB.Stream

http://stackoverflow.com/q/26834244
tagged with: image
downvote count: 4
answer count: 1
linked to: http://stackoverflow.com/q/442404
favorite count: 0
has title: How do I test if two are touching each other
type: UnansweredQuestion
score: -4
has answer: http://stackoverflow.com/a/26834813
type: Question
has body: I'm trying to create this mini-game where you fight each other. I used two &lt;img&gt;s as the characters and I got the movement down on both of the &lt;img&gt;s but, I want to make it so when the &lt;img&gt;s are touching you have a option to punch them. All I'm asking is how to test if they are touching. I'm pretty sure I can handle everything else and if not I can look whatever up. I've tried looking it up hundreds of times, but none of them really talking about &lt;img&gt;s only like divs. If they do talk about &lt;img&gt;s it's very confusing.
upvote count: 0
has comment: http://stackoverflow.com/comment/42234749
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/26918255
has title: How to open a link in chrome browser, even though the default computer browser is 'Safari'?
has answer: http://stackoverflow.com/a/26918456
possible better answer: http://stackoverflow.com/a/26923362
type: Question
type: AnsweredQuestion
upvote count: 5
tagged with: javascript
answer count: 2
score: 5
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/26923362
tagged with: google-chrome-app
has body: I've built a chrome packaged app, and I'm trying to make one of the buttons in it open the chrome browser in a specific link. For this, I used window.open("http://myLink.com"), which works, but unfortunately it opens the default browser rather than chrome. Is there a way around this?
accepted answer: http://stackoverflow.com/a/26918456

http://stackoverflow.com/q/26973273
answer count: 1
has body: This is code i implements daterangepicker1 with bootstrap. To This is the code how i implements Second daterangepicker... To Both daterangepickers are working fine, as on clicking in each input box calendar is opened and i can get values, Regarding to fields 'from_total' and 'to_total' [first two] when i select value in 'from_total' it dierectly goes to 'to_toal' that's good it's exactly what i want,,,, but problem arises in second date range picker that when i select value in 'from_owner' it doesn't goes to 'to_owner' rather cursor moves to 'to_total' that is the second input field in first daterangepicker and it's not right, i want it to move it to 'to_owner' if you have ever used TWO DATERANGEPICKERS ON A SINGLE PAGE USING BOOTSTRAP than i hope you can understand me and help as well. thanks in advance.....
accepted answer: http://stackoverflow.com/a/26973385
has comment: http://stackoverflow.com/comment/42481969
tagged with: twitter-bootstrap
tagged with: datepicker
has title: How to use two bootstrap daterangepickers on same page
has answer: http://stackoverflow.com/a/26973385
type: AnsweredQuestion
type: Question
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/42278834
has text: Hey, Jithender! Thanks for answering but, keeping in mind that I got the same answer again, It's because I made the wrong question. I've edited the question. Hope you can help me. Thanks
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26858619
type: Comment

http://stackoverflow.com/q/26849892
downvote count: 0
has title: jQuery: How to change the position of a div, inside of another div then create a glide effect?
type: Question
score: 1
has answer: http://stackoverflow.com/a/26850459
answer count: 2
upvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I currently have a div, and using css to make it in the shape of a red box, with the ID of #box. Just to make it look neat I put #box inside of another div. I would like to know how can I change the position of the #box to somewhere else on screen (lets say top left), then have it glide to the bottom right of the screen. $(document).ready(function(){ /*Limits for Glide*/ var top_limit = "10px"; var left_limit = "10px"; var right_limit = "600px"; var bottom_limit = "600px"; /*Glide*/ $('#glide').click(function(){ $('#box').css("left",left_limit).css("top",top_limit); $('#box').animate({"left": right_limit, "top": bottom_limit},2000); }); }); As for my divs I have multiple things on my html file but the main ones are these. .subDiv { width: 600px; height: 250px; margin: 0 auto; padding: 10px; background-color: #876D52; border: 3px solid white; } #box{ width: 250px; height: 200px; background: #FF9933; margin: 0 auto; }
has answer: http://stackoverflow.com/a/26849975

http://stackoverflow.com/comment/42369211
type: AnswerComment
type: Comment
score: 0
has text: BigBadaboom:- could you give me you skypid or contact no or email id
comment on: http://stackoverflow.com/a/26908474

http://stackoverflow.com/comment/42393955
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26923367
has text: Thanks now it works so simple and I was looking for the 2k0 error (just jooking)

http://stackoverflow.com/a/26895448
downvote count: 0
has comment: http://stackoverflow.com/comment/42344774
score: 1
has comment: http://stackoverflow.com/comment/42345405
accepted answer of: http://stackoverflow.com/q/26895325
has body: Here's how I understand the process: Find all divs with class "desk_box_ver" Loop over the returned list of objects like {"username":"HCZR","aht_value":"578","station":"B12"} For each returned object, loop over the divs from 1. and see the div has a inner HTML matching the object's station property If it does, replace the inner HTML with object's aht_value property. The desk_# IDs don't actually seem to be used here - is that right? The Javascript code would be something like: success : function(data){ console.log(data); var allDivs = $('.desk_box_ver'); // 1. for(var i = 0; i &lt; data.length; i++) { // 2. for (var j = 0; j &lt; allDivs.length; j++) { if (allDivs[j].innerHTML === data[i]['station']) { // 3. allDivs[j].innerHTML = data[i]['aht_value']; // 4. } } } } // end success This isn't a super great way of organizing the code (nested for loops are generally bad, though at smaller sizes might not matter much), but it should do what you need. With IDs like desk_B20, you can do: success : function(data){ console.log(data); for(var i = 0; i &lt; data.length; i++) { // loop over results var divForResult = $('#desk_' + data[i]['station']); // look for div for this object if (divForResult.length) { // if a div was found divForResult.html(data[i]['aht_value']); // set inner HTML } } } // end success
answers question: http://stackoverflow.com/q/26895325
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42344297
has comment: http://stackoverflow.com/comment/42345486
has comment: http://stackoverflow.com/comment/42345302
has comment: http://stackoverflow.com/comment/42344497
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/42344426
has comment: http://stackoverflow.com/comment/42345142
has comment: http://stackoverflow.com/comment/42344930

http://stackoverflow.com/a/26960688
upvote count: 5
has comment: http://stackoverflow.com/comment/42459863
score: 5
has body: From your sample code, you haven't included the CSS which is vital in setting the tooltip to position: absolute. Furthermore, you'll also need to explicitly initialise the tooltip yourself, the data-toggle example is just a suggestion of how you might handle it: For performance reasons, the Tooltip and Popover data-apis are opt-in, meaning you must initialize them yourself. One way to initialize all tooltips on a page would be to select them by their data-toggle attribute: $(function () { $('[data-toggle="tooltip"]').tooltip() }); (source) Working Code Tooltip on top Click to toggle popover
downvote count: 0
has comment: http://stackoverflow.com/comment/42460979
has comment: http://stackoverflow.com/comment/42461017
type: Answer
has comment: http://stackoverflow.com/comment/42460225
answers question: http://stackoverflow.com/q/26960524
has comment: http://stackoverflow.com/comment/42460303
has comment: http://stackoverflow.com/comment/42461020

http://stackoverflow.com/comment/42460965
has text: it's not quite working it displays the two numbers next to each other instead of adding one to the other
type: Comment
comment on: http://stackoverflow.com/a/26961229
type: AnswerComment
score: 0

http://stackoverflow.com/a/26939394
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26939151
has body: Couple of issues with your code. First, you are defining the delayInc() function, but you are never calling it. So, no $timeout is ever scheduled. This needs to either be called in the controller, or you need to have it be initiated from some event (ng-click for example on a button). Second, from your description, it sounds like you want it to increment every second. Using $timeout would only increment it once -- one second after delayInc() was called. Take a look at the following approach, showing both $timeout working as well as using $interval to have it ongoing every second: Count (timeout): {{count}}! Start Delay Timer Count2 (interval): {{count2}}! Start Interval Counter app.controller('MainCtrl', function($scope, $timeout, $interval) { $scope.count = 1; $scope.count2 = 1; $scope.delayInc = function() { $timeout(function() { $scope.count += 1; }, 1000); }; $scope.repeatInc = function() { $interval(function() { $scope.count2 += 1; }, 1000); } Here is the Plunker with all of it working: http://plnkr.co/edit/c0EFB7Lbs6ZjJL5NQf86?p=preview
answers question: http://stackoverflow.com/q/26939151
type: AcceptedAnswer
downvote count: 0
score: 1

http://stackoverflow.com/q/26957188
score: 0
has comment: http://stackoverflow.com/comment/42464401
has answer: http://stackoverflow.com/a/26963273
answer count: 1
has comment: http://stackoverflow.com/comment/42453613
has comment: http://stackoverflow.com/comment/42453606
type: UnansweredQuestion
has body: I´m storing some values in an array and print them on an HTML page with Javascript. So far so good. Now I want to use the same data in the array for a data graphic. But I can´t get the array out of the function in which I created the array. I can´t event print it out as I did before from inside the function. This doesn´t seem impossible, but I don´t get it. I tried to define a getter function, but I wasn´t successful. Maybe someone can help me. By the way, I received the data from a node.js server via Socket.io. On http://jsfiddle.net/dL3Lsx0L/ I reduced the code and strangely it works there, but not in my original code below. &lt;script src='//code.jquery.com/jquery-1.7.2.min.js'&gt;&lt;/script&gt; &lt;script src='//localhost:3000/socket.io/socket.io.js'&gt;&lt;/script&gt; &lt;script&gt; var socket = io(); var values_array = new Array(); socket.on('server2browser', function(data) // Receive data from server { fct_values_array(data); }); function fct_values_array(data) { $.each(data, function(i, obj) // Store received data in array { values_array[i] = obj.numbers; }); $('#arrayprint_values').text(values_array); // Print array on HTML - It works. } $('#printagain').text(values_array); // Print array again - Doesn´t work. &lt;/script&gt;
linked to: http://stackoverflow.com/q/23667086
has title: Using an array outside the function of origin
tagged with: node.js
tagged with: parameters
duplicate of: http://stackoverflow.com/q/23667086
type: Question
tagged with: function
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/q/26906479
has comment: http://stackoverflow.com/comment/42501978
type: Question
has comment: http://stackoverflow.com/comment/42514165
has comment: http://stackoverflow.com/comment/42475763
tagged with: ios
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
tagged with: android
tagged with: css
has comment: http://stackoverflow.com/comment/42507470
type: UnansweredQuestion
has title: Enable scrolling with drag-n-drop on touch devices
has body: Re-arranging columns and click is now working on touch devices. Now facing the issue with scrolling. I tried to resolve it with iScroll plugin but it didn't work. The screenshot I took from device mode of chrome browser. Table columns can be added on-the-fly and so number of columns may vary. Is there any css way to work scrolling properly ??? If not how do I implement it with javascript or jquery ??? Update: -webkit-overflow-scrolling: touch; is not working. Update 2: Tried with below code: if (Modernizr.touch) { $('.container-fluid').css('overflow', 'auto'); } and this one as well: if (Modernizr.touch) { //iScroll plugin var myScroll = new IScroll('#tblGrid', { scrollbars: true }); } None of them worked. Update 3: Below is the code to enable dragging of table columns and click event: var clickms = 200; var lastTouchDown = -1; function touchHandler(event) { var touch = event.changedTouches[0]; var d = new Date(); var type = ""; switch (event.type) { case "touchstart": type = "mousedown"; lastTouchDown = d.getTime(); break; case "touchmove": type = "mousemove"; lastTouchDown = -1; break; case "touchend": if (lastTouchDown &gt; -1 &amp;&amp; (d.getTime() - lastTouchDown) &lt; clickms) { lastTouchDown = -1; type = "click"; break; } type = "mouseup"; break; default: return; } var simulatedEvent = document.createEvent("MouseEvent"); simulatedEvent.initMouseEvent(type, true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null); touch.target.dispatchEvent(simulatedEvent); event.preventDefault(); } function init() { document.addEventListener("touchstart", touchHandler, true); document.addEventListener("touchmove", touchHandler, true); document.addEventListener("touchend", touchHandler, true); document.addEventListener("touchcancel", touchHandler, true); } $(document).ready(function () { init(); var myScroll; function loaded() { myScroll = new IScroll('#tblGrid', { mouseWheel: true, scrollbars: true, click: true, …
has comment: http://stackoverflow.com/comment/42537075
has answer: http://stackoverflow.com/a/27004137
has comment: http://stackoverflow.com/comment/42478279

http://stackoverflow.com/q/26912559
accepted answer: http://stackoverflow.com/a/26912748
has title: Generate from array in
score: 1
has body: Im geting error Uncaught TypeError: Cannot read property 'appendChild' of null and i dont know why: Im trying make a list from array and display it on div var options = [ set0 = ['Option 1', 'Option 2'], set1 = ['First Option', 'Second Option', 'Third Option'] ]; function makeUL(array) { // Create the list element: var list = document.createElement('ul'); for (var i = 0; i &lt; array.length; i++) { // Create the list item: var item = document.createElement('li'); // Set its contents: item.appendChild(document.createTextNode(array[i])); // Add it to the list: list.appendChild(item); } // Finally, return the constructed list: return list; } // Add the contents of options[0] to #foo: document.getElementById("foo").appendChild(makeUL(options[1])); &lt;div id="foo"&gt;&lt;/div&gt;
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42374581
tagged with: javascript
has comment: http://stackoverflow.com/comment/42374943
type: Question
has answer: http://stackoverflow.com/a/26912748
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/42414591
type: Comment
type: QuestionComment
has text: Also if you truly POST JSON to the server using proper CONtent Type headers (application/json), you would not even use $_POST at all. You would need to read POST data from PHP raw input.
comment on: http://stackoverflow.com/q/26933901
score: 0

http://stackoverflow.com/q/26911602
has comment: http://stackoverflow.com/comment/42372708
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42373302
score: 1
has comment: http://stackoverflow.com/comment/42372996
type: Question
has answer: http://stackoverflow.com/a/26911832
has comment: http://stackoverflow.com/comment/42372761
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/42372801
has comment: http://stackoverflow.com/comment/42373273
has title: How can I make 6 images play as a gif with an on click button (Can't find whats missing in my code)
accepted answer: http://stackoverflow.com/a/26911832
has body: So I'm trying to get an 6 images to play (runner0 - runner5) and then go back to the beginning and so far only the first image and second image appears but the rest aren't playing but are in the same folder. I was told to use getElementById(), getElementsByName(), or getElementsByTagName(). But how would i implement those? Project 10 11 Sample
upvote count: 1

http://stackoverflow.com/comment/45457558
type: AnswerComment
has text: Sorry for the delay, have you fixed it yet?
type: Comment
comment on: http://stackoverflow.com/a/28056141
score: 0

http://stackoverflow.com/a/26905495
has comment: http://stackoverflow.com/comment/42374675
has comment: http://stackoverflow.com/comment/42487171
has body: If you're OK to use JQuery As said by Martin Ernst for yonatan's answer: 'This will select only elements with marginLeft/Right="auto".' Besides, as described in the comments, elements must be hidden in order to work with FF and safari. This should work using JQuery: $(document).ready(function() { var visibleElements = $('body *:visible'); $('body *').hide(); var elements = $('body *').filter(function() { return $(this).css('margin-left') == 'auto' &amp;&amp; $(this).css('margin-right') == 'auto'; }) // show only elements that were visible visibleElements.show(); }); Tip: if for some reason, you need to not load external scripts, just copy the content of the minified jquery script at the begining of yours.
has comment: http://stackoverflow.com/comment/42375716
has comment: http://stackoverflow.com/comment/42377166
has comment: http://stackoverflow.com/comment/42376879
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26884654
has comment: http://stackoverflow.com/comment/42488687
has comment: http://stackoverflow.com/comment/42382010
answers question: http://stackoverflow.com/q/26884654
has comment: http://stackoverflow.com/comment/42376338
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/42375334

http://stackoverflow.com/a/26863667
type: Answer
score: 0
has body: Are you trying to create your own pop-over? Just initialize or reset a timeout variable whenever the pop-over pops. function foo(callback) { make_the_popover_show(); popoverTimeout = setTimeout(clearPopover, 1000); } function clearPopover() { hide_the_popover(); } Be sure to add identifiers to your pop-overs and to different timeouts, if you plan on showing multiple pop-overs at the same time. Edit: I forgot to mention i wrote the variable as global. But you should write the code the way you like, with or without global vars, and check out how to use Timeouts correctly.
answers question: http://stackoverflow.com/q/26863397

http://stackoverflow.com/q/26877246
has answer: http://stackoverflow.com/a/26878644
type: Question
tagged with: java
accepted answer: http://stackoverflow.com/a/26878644
tagged with: javascript
score: 4
upvote count: 4
downvote count: 0
answer count: 1
favorite count: 0
tagged with: resteasy
tagged with: angularjs
has body: I'm trying to use AngularJS in front end and Resteasy as a Rest API. My problem is that my @FormParam are always null when sending params with AngularsJS. Here is how my JS : $scope.addPerson = function(newFirstName, newLastName) { $http({ method: 'POST', url: "rest/persons/savePerson", data: {firstName: 'newFirstName', lastName: 'newLastName'}, headers: {'Content-Type': 'application/json'} }) .success(function(data) { alert("DATA : " + data); }).error(function(data, status, headers, config) { alert("Could not save new person"); }); }; And this is my code server side : @POST @Path("/savePerson") @Produces("application/json") @Secured({ "ROLE_USER" }) public PersonBean savePerson(@FormParam("firstName") String firstName, @FormParam("lastName") String lastName) { if (firstName== null || lastName== null) { return null; } PersonBean person = personDao.savePerson(firstName, lastName); return person ; } Any help is appreciated.
has title: Resteasy @FormParam null when passing params with AngularJS
type: AnsweredQuestion

http://stackoverflow.com/comment/42304980
type: QuestionComment
comment on: http://stackoverflow.com/q/26873434
score: 0
has text: The javascript code you post is in `complex.js`?
type: Comment

http://stackoverflow.com/comment/123608986
comment on: http://stackoverflow.com/a/26895380
score: 0
type: AnswerComment
has text: I was trying to convince you, that you actually **know** the locale. User agent sends "Accept-Language" header along with request. There are tons of server-side scripts to parse it. Then you can simply set the locale globally for all JS code and use it. The other question is, why in the world you want to convert character case in form fields... This does not seem like a good idea.
type: Comment

http://stackoverflow.com/q/26883780
tagged with: angularjs
has body: We are trying to implement tracking via the google tag manager for an angularjs app. When using a click-listener defined in the tag-manager, the following script gets injected into the app on every click (or so it seems): (function (a) { var b = {}, c; for (c in a || {})if (a.hasOwnProperty(c) &amp;&amp; "undefined" != typeof a[c])try { b[c] = JSON.stringify(a[c]) } catch (d) { console.log("Cannot stringify " + c) } a = document.createEvent("CustomEvent"); a.initCustomEvent("RetrievedVariablesEvent", !0, !0, {variables: b}); window.dispatchEvent(a) })({'studioV2': window['studioV2'], 'richMediaIframeBreakoutCreatives': window['richMediaIframeBreakoutCreatives'], 'dataLayer': window['dataLayer']}) When a click is tracked the "Cannot stringify dataLayer" error occurs. The reason for this is, that with the click, also the element is send which has a circular reference to itself, because of the child and parent references attached to the object (by jquery possibly??). Any ideas how to implement a click-listener with the google tag manager, without running into this recursion?
type: AnsweredQuestion
tagged with: jqlite
tagged with: google-tag-manager
accepted answer: http://stackoverflow.com/a/26889925
type: Question
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has title: 'Cannot stringify dataLayer' when using Google Tag Managers 'click-listener' in angular-js app
has answer: http://stackoverflow.com/a/26889925

http://stackoverflow.com/comment/42345311
comment on: http://stackoverflow.com/q/26873279
score: 0
type: Comment
type: QuestionComment
has text: We feel the best Stack Overflow questions have a bit of source code in them, but if your question generally covers… a specific programming problem, or a software algorithm, or **software tools commonly used by programmers;** and is **a practical, answerable problem that is unique to software development** How does this question not fit the bolded text? I would love to hear your explanation.

http://stackoverflow.com/comment/42365832
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26864650
type: AnswerComment
has text: @euvl I don't think is neseccary here.Just a bit of Jquery

http://stackoverflow.com/q/26910567
type: Question
score: 5
has comment: http://stackoverflow.com/comment/42370738
has answer: http://stackoverflow.com/a/26910622
accepted answer: http://stackoverflow.com/a/26910622
tagged with: javascript
answer count: 3
possible better answer: http://stackoverflow.com/a/26910651
has body: I'm trying to convert a number like: 1215464565 into 12-15-46-45-65. I'm trying to do this: var num = 1215464565; num = num.toString(); num.replace(/(.{2)/g,"-1"); The JSFiddle, however doesn't reflect this change though.
has comment: http://stackoverflow.com/comment/42371356
favorite count: 0
upvote count: 5
has title: Insert character after every nth character
duplicate of: http://stackoverflow.com/q/1772941
has answer: http://stackoverflow.com/a/26910651
tagged with: regex
has comment: http://stackoverflow.com/comment/42394250
linked to: http://stackoverflow.com/q/1772941
has answer: http://stackoverflow.com/a/26910656
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/42266865
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26852151
has text: sorry for that .. and updated question please have look about w.. var w=screen.width -------- var h=screen.height
score: 0

http://stackoverflow.com/comment/42268575
score: 0
comment on: http://stackoverflow.com/a/26852792
type: AnswerComment
has text: I added the line you mentioned as well as content in the else statement. It still won't work though.
type: Comment

http://stackoverflow.com/comment/42407950
score: 0
type: Comment
has text: I have edited the code. This is another way u should your answer.
type: AnswerComment
comment on: http://stackoverflow.com/a/26928991

http://stackoverflow.com/comment/42380954
score: 1
comment on: http://stackoverflow.com/q/26916135
has text: Okay, I see another problem... try changing `$(this).val()` to `$(this).html()`... or `text()` as I see slicedtoad beat me to this (your buttons do not have values)
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/42393773
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26923171
score: 0
has text: sorry, on that case, your code works fine, but if i try to add two consecutive row with same "Berry" values for example, I want also to detect the last part to be duplicate or if he input three consecutives "Berries" i want the second and third to have red borderline.

http://stackoverflow.com/a/26927041
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/94106995
upvote count: 8
answers question: http://stackoverflow.com/q/26926994
type: Answer
accepted answer of: http://stackoverflow.com/q/26926994
has body: You're calling isVowel in three places, and just throwing away the return value in the first two. If you want to see the return value in the first two places, show it (via alert as in your last example, or any of several other ways). There are other issues as well: As devqon points out, you've used boolean rather than var, so the code won't parse Any time you find yourself writing: var result; if (condition) { result = true; } else { result = false; } return result; ...stop and make it: var result = condition; return result; So for isVowel: function isVowel(x) { var result; result = x == "A" || x == "E" || x == "I" || x == "O" || x == "U"; return result; } (You can, of course, make that a one-liner, but it's easier to debug this way.) You have an extra } after your if block (reasonable, consistent formatting would have make that obvious) Your while loop will never end, because you never update input with the return value of the prompt Rather than an if followed by a while, use do-while Here's an updated version with just those changes function isVowel(x) { var result; result = x == "A" || x == "E" || x == "I" || x == "O" || x == "U"; return result; } var input; do { input = prompt("Enter a character "); if (input.length == 1) { alert(isVowel(input)); } } while (input.length != 1);
has comment: http://stackoverflow.com/comment/94114124
score: 8

http://stackoverflow.com/a/27022100
downvote count: 0
answers question: http://stackoverflow.com/q/26987851
score: 3
upvote count: 3
type: Answer
has body: After quite a bit of searching around, I narrowed it down to simple Javascript error on my part. I started by commenting all the debug statements and printing the objects as-is. That is where I discovered that my callback function was getting an object for authResult[res] in one of the iterations and since I was trying to concatenate it to a String, a TypeError was being thrown. The Google Plus Login flow was fine all the time, with my JS being the issue. It worked in GPLogin() when trying to log additionalParams[param] because they're all strings and have no problems concatenating with Strings.

http://stackoverflow.com/a/26840648
accepted answer of: http://stackoverflow.com/q/26840562
has comment: http://stackoverflow.com/comment/42281984
downvote count: 0
has body: ({[^}]+})\/({[^}]+}) Try this.See demo.Repalce by \\frac$1$2. http://regex101.com/r/tF5fT5/24
score: 1
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26840562
type: Answer

http://stackoverflow.com/comment/42304503
has text: The problem is knowing. You have to design for your upper time limit.
type: Comment
comment on: http://stackoverflow.com/q/26873076
type: QuestionComment
score: 0

http://stackoverflow.com/q/26901011
tagged with: css
downvote count: 0
possible better answer: http://stackoverflow.com/a/26901041
has answer: http://stackoverflow.com/a/26901091
linked to: http://stackoverflow.com/q/26965050
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3808808
score: 1
type: Question
has answer: http://stackoverflow.com/a/26901041
upvote count: 1
tagged with: javascript
tagged with: jquery
has body: I'm doing a card flip using CSS3 and javascript on multiple divs. I'm using desssandro's 3d Card Flip but his is only using an ID and therefore one div at a time. I have several cards in one page that I want to flip. How can I do it? Here's the desandro's script and a fiddle http://jsfiddle.net/vanduzled/nawdpj5j/ var init = function() { var card = document.getElementById('card'); document.getElementById('flip').addEventListener( 'click', function(){ card.toggleClassName('flipped'); }, false); }; window.addEventListener('DOMContentLoaded', init, false); If I make my divs a class instead of id's, the script below doesn't work: var init = function() { var card = document.getElementById('card'); document.getElementById('flip').addEventListener( 'click', function(){ card.toggleClassName('flipped'); }, false); }; window.addEventListener('DOMContentLoaded', init, false); EDIT I created a fiddle byclassname but it doesn't work http://jsfiddle.net/vanduzled/omLac95t/
has answer: http://stackoverflow.com/a/26901117
accepted answer: http://stackoverflow.com/a/26901117
has comment: http://stackoverflow.com/comment/42354344
favorite count: 0
answer count: 3
has title: Multiple card flip using getElelementsByClass
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/26982611
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/42499208
favorite count: 0
downvote count: 2
has comment: http://stackoverflow.com/comment/42499399
tagged with: xmlhttprequest
has comment: http://stackoverflow.com/comment/42499629
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42499506
has answer: http://stackoverflow.com/a/26982873
has comment: http://stackoverflow.com/comment/42499523
accepted answer: http://stackoverflow.com/a/26982873
has comment: http://stackoverflow.com/comment/42499656
type: Question
has body: I have been trying to use script load instead of using XMLHTTPRequest (because of XSS limitation). var s = document.createElement('script'); s.src = "http://example.com/data.txt"; document.getElementsByTagName("body")[0].appendChild(s); However, the content of the file is just a text file, is there a way to read the content from this loaded file?
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/42499457
has title: How to use "Script load" instead of XMLHttpRequest?

typescript
tags question: http://stackoverflow.com/q/26850904
tags question: http://stackoverflow.com/q/26845483
tags question: http://stackoverflow.com/q/26901282
tags question: http://stackoverflow.com/q/26968228
tags question: http://stackoverflow.com/q/26863833
tag name: typescript
tags question: http://stackoverflow.com/q/26937853
tags question: http://stackoverflow.com/q/26968390
tags question: http://stackoverflow.com/q/26948400
tags question: http://stackoverflow.com/q/26930592
tags question: http://stackoverflow.com/q/26871068
tags question: http://stackoverflow.com/q/26962454
type: Tag

http://stackoverflow.com/comment/42345077
has text: On a side note, sometimes Codecademy doesn't accept answers that are *correct*, but are not permitted as "acceptable" answers because of the rigid/specific syntax that is sometimes required. You should take a look at their Q/A section.
comment on: http://stackoverflow.com/q/26895761
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/26968274
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/26968174
has body: function prependArray(a, b) { return a.splice.apply(a, [0, b.length].concat(b)) } Thanks The Paramagnetic Croissant (*_*)
upvote count: 1
type: Answer

http://stackoverflow.com/comment/42285968
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26862935
has text: Do you know if this behaviour will be the same when accessing a website on an iPad using Safari?

http://stackoverflow.com/comment/42484422
type: AnswerComment
comment on: http://stackoverflow.com/a/26974487
type: Comment
has text: Hurray for JavaScript and rewriting original functions!
score: 4

http://stackoverflow.com/a/26919676
type: Answer
score: 3
downvote count: 0
upvote count: 3
answers question: http://stackoverflow.com/q/26919599
has body: defineProperties simply gives you more power over the properties you define. If you use dot-notation to define a property as you did with Person2, that property is writeable, deletable, and enumerable by default. You kept defaults for Person1, one of which is writeable: false, so you can't reassign the attribute unless you use the setter explicitly. In other words, you wouldn't be able to use dot-notation to change that attribute. Generally there's not really a need for this behavior, so I'd be careful using it as it may cause unexpected results.
has comment: http://stackoverflow.com/comment/42388038

http://stackoverflow.com/q/26866887
tagged with: slidedown
type: AnsweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/42293842
has body: I'm having a slideDown function on my site. But somehow it doesn't work the first time when you click it. So I need to click two times to make the function work. What can possible be wrong? I also want the div to slide up when I click on the button again, don't know how I will do this. I tried using slideToggle but it just ended up with the div going up and down a couple of times before closing. Even for this I needed to click two times. Here is my JS: function showCart() { $("#rollDown").click(function() { $("#shopping_cart_page").slideDown(); }); /* not relevant for this */ emptyBag = document.getElementById("emptyBag"); emptyBag.addEventListener("click", emptyCart); } And here is my HTML: Products About Giveaways Contact Shopping Bag
type: Question
tagged with: slideup
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26866921
tagged with: jquery
has title: slideDown function needs two click to work
has comment: http://stackoverflow.com/comment/42293722
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/42292927
has answer: http://stackoverflow.com/a/26866921

http://stackoverflow.com/a/26921860
has comment: http://stackoverflow.com/comment/42503067
type: Answer
has comment: http://stackoverflow.com/comment/42470982
has comment: http://stackoverflow.com/comment/42393235
has body: I am assuming you want to target the "Name" column, although you could easily change this to target all columns. Basically, you want to go through the input elements, keeping a reference to the values you've already reviewed: $("#save").off("click").on("click",function(){ var existing = []; var duplicates = $('#myTable td:nth-child(3) input').filter(function() { var value = $(this).val(); if (existing.indexOf(value) &gt;= 0) { return $(this); } existing.push(value); }); duplicates.closest('tr').css('background-color', 'red'); }); JSFiddle Edit: To avoid marking a read-only line as a duplicate, the process is a little less straightforward $("#save").off("click").on("click",function(){ // Clear status of all elements $('#myTable tr').css('background-color', 'none'); // Get all values first (Apple, Orange, etc) as strings var allValues = $('#myTable td:nth-child(3) input').map(function() { return $(this).val(); }).toArray(); // Iterate unique values individually, to avoid marking a read-only input as duplicate var processedValues = []; for (var i = 0; i &lt; allValues.length; i++) { var value = allValues[i]; if (value != '' &amp;&amp; processedValues.indexOf(value) &gt;= 0) continue; var inputs = $('#myTable td:nth-child(3) input').filter(function() { return $(this).val() == value; }); // Check if this value is in one of the readonly var readOnlyInput = inputs.filter(function() { return $(this).is('[readonly]'); }); if (readOnlyInput.length) { inputs.not(readOnlyInput).closest('tr').css('background-color', 'red'); } else { inputs.not(':first').closest('tr').css('background-color', 'red'); } processedValues.push(value); } }); Updated JSFiddle
has comment: http://stackoverflow.com/comment/42428079
has comment: http://stackoverflow.com/comment/42543041
has comment: http://stackoverflow.com/comment/42392136
has comment: http://stackoverflow.com/comment/42412349
has comment: http://stackoverflow.com/comment/42427906
score: 4
answers question: http://stackoverflow.com/q/26921700
upvote count: 4
has comment: http://stackoverflow.com/comment/42425711
accepted answer of: http://stackoverflow.com/q/26921700
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42526426
downvote count: 0
has comment: http://stackoverflow.com/comment/42428148

http://stackoverflow.com/a/26961581
has comment: http://stackoverflow.com/comment/42467405
has comment: http://stackoverflow.com/comment/42469033
has comment: http://stackoverflow.com/comment/42469373
has body: for date time &amp; Currency: Date:&lt;input type="text" pattern="^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[01]) ([0-1][0-9]|[2][0-3]):[0-5][0-9]$" /&gt; Currency:&lt;input type="text" pattern="^(?(?!0)(\d{1,3},?){1,3}|0)(\.[0-9]{1,2})?$" /&gt;
has comment: http://stackoverflow.com/comment/42469268
answers question: http://stackoverflow.com/q/26961307
score: 0
has comment: http://stackoverflow.com/comment/42468874
type: Answer
has comment: http://stackoverflow.com/comment/42468966

http://stackoverflow.com/comment/42478727
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26971150
has text: Will it block all extensions of just the one injected by Google?

http://stackoverflow.com/q/26869247
tagged with: design-patterns
type: Question
tagged with: javascript
has title: Javascript - Separating variables in different script
has answer: http://stackoverflow.com/a/26869608
upvote count: 1
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/42297544
has body: I have few pieces of scripts written already. However, the variables inside different script will surely collide with each other upon import Some of the examples from my scripts The following is script A &lt;script&gt; var vx = 0; var vy = 0; var d = null; function init() { ...} function CommentBox() { ... } CommentBox.prototype.create = function() { ... } &lt;/script&gt; The following is script B &lt;script&gt; var vx = 0; var vy = 0; var x = 0; var y = 0; var p = null; function init() { ...} function Ball() { ... } Ball.prototype.create = function() { ... } &lt;/script&gt; Upon import, variables and methods will surely collide with each other. Here's my question. Is it possible to separate them without the need to modify the name? I know there exists some design patterns but how can I achieve this? I have been using prototype pattern for various "object" in these script but I don't know how to do it when I have to apply it to whole script. Also is it possible to have nested Prototype?
type: UnansweredQuestion
downvote count: 0
score: 1

http://stackoverflow.com/comment/42373416
type: Comment
has text: Updated the answer with a code snippet, and tried your example, but nothing happens when adding that filter.
comment on: http://stackoverflow.com/a/26911922
type: AnswerComment
score: 0

http://stackoverflow.com/a/27095195
upvote count: 11
answers question: http://stackoverflow.com/q/26856497
accepted answer of: http://stackoverflow.com/q/26856497
has comment: http://stackoverflow.com/comment/65520439
has body: Not sure what happened but what I ended up doing is creating a new clone of the remote repo and applied my splash screen related changes to the new instance on my local machine. then i executed the following: ionic platform rm ios ionic platform add ios ionic build ios ...and it was able to get out of the splash screen. hope this helps.
type: Answer
score: 11
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/26960524
downvote count: 5
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/42459397
tagged with: css
has title: Bootstrap JS bugged..?
favorite count: 0
has comment: http://stackoverflow.com/comment/42459852
tagged with: twitter-bootstrap
type: UnansweredQuestion
has body: i got some problems with bootstrap, i tried to use stuff like Modal, Popover or tooltip, but some bugs are: Modal: Backround overlay is above the modal(makes everything including modal darker) Tooptip: Ignores the alignment of it, like top. Popover: Wont work at all. I copied the examples of bootstrap straight into my website, still dont works. i'll include the need codes: Tooltip on top Click to toggle popover i use the newest JS of bootstrap and the newest JQuery. I didnt include the whole sourcecode, since it isnt needed, you only needed what i use(Tooltip and popover) and it only needs the Jquery part. hard to explain but yeah.
score: -5
has comment: http://stackoverflow.com/comment/42459557
type: Question
has answer: http://stackoverflow.com/a/26960688
upvote count: 0

http://stackoverflow.com/a/26836772
downvote count: 0
answers question: http://stackoverflow.com/q/26836688
type: Answer
has body: This is because when you specify a page fragment when calling jQuery.load, the script tags are stripped. See Loading Page Fragments on the jQuery.load documentation. The .load() method, unlike $.get(), allows us to specify a portion of the remote document to be inserted. This is achieved with a special syntax for the url parameter. If one or more space characters are included in the string, the portion of the string following the first space is assumed to be a jQuery selector that determines the content to be loaded. You will need to use another feature to achieve your desired result.
score: 1
upvote count: 1

http://stackoverflow.com/comment/42374148
score: 1
comment on: http://stackoverflow.com/q/26912283
type: QuestionComment
type: Comment
has text: Avoid click handlers for forms as they will not work for keyboard submitting. Attach the logic to your submit handler.

http://stackoverflow.com/comment/42478037
comment on: http://stackoverflow.com/q/26970880
score: 0
type: QuestionComment
has text: Same id for multiple controls is always going to cause such issue.
type: Comment

http://stackoverflow.com/comment/42339760
has text: should be not so sure if that will fix it, but is the proper way to do it.
comment on: http://stackoverflow.com/q/26892887
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/42399751
comment on: http://stackoverflow.com/a/26926256
type: AnswerComment
has text: If you follow Manish Gupta's reply and also change: 'var wrapper = $(".input_fields_wrap table");' So that it's appended to the table, it should work as you want it to do.
score: 0
type: Comment

http://stackoverflow.com/comment/42488233
has text: Date Range :- Consider this as field X. If I click on the field X, the following should be displayed "From" with calender below "To" with calender below
type: Comment
comment on: http://stackoverflow.com/a/26973936
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42246266
score: 0
type: AnswerComment
type: Comment
has text: If you want to test `$resource` just use `$httpBackend` and type the full URL you expect it to call.
comment on: http://stackoverflow.com/a/26840132

http://stackoverflow.com/q/26935407
has comment: http://stackoverflow.com/comment/42416042
has comment: http://stackoverflow.com/comment/42415450
has comment: http://stackoverflow.com/comment/42415816
has comment: http://stackoverflow.com/comment/42415746
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42415774
tagged with: set
has answer: http://stackoverflow.com/a/26936494
type: Question
has comment: http://stackoverflow.com/comment/42415609
tagged with: recursion
has comment: http://stackoverflow.com/comment/42415380
has comment: http://stackoverflow.com/comment/42415307
has comment: http://stackoverflow.com/comment/42415337
has body: I want to write a function -- call it setGenerator() -- that accepts two parameters: An array of possible values An integer maximum I want my function to return an array of arrays, representing every possible permutation of the possible values, from sets of size 0 up to sets of the specified maximum. So no matter what, this function would always at least return an array containing an empty array. But here's a quick example to illustrate what I'm trying to do: setGenerator(["A", "B", "C"], 2); // should return: // [ [], ["A"], ["B"], ["C"], ["A", "A"], ["A", "B"], ["A", "C"], // ["B", "A"], ["B", "B"], ["B", "C"], ["C", "A"], ["C", "B"], ["C", "C"] ] Look at the input and output here in my example. The input says my possible values are the strings A, B, and C, and that I should form sets of size 0 through 2. So the resultant sets returned are: A set of size zero [] Sets of size one for each possible value: [A], [B], [C] Sets of size two for every permutation: [A,A], [A,B], [A,C], [B,A], etc. If I were to have set my maximum to 3, though, then the function should also return all permutation sets of length 3. I hope that makes sense. Can anyone help me write this in JavaScript? It would have to involve recursion, but I'm getting stuck when thinking about it. UPDATE: If you read the comments, you'll see that what I'm describing here are not technically permutations. This is actually a much larger set than just permutations. But hopefully the target I'm shooting for here is made clear by my example above. These can perhaps be called permutations with repetition. I think there should be x factorial of them for a given number, but keep in mind I'm asking about all numbers 0 up to x.
has comment: http://stackoverflow.com/comment/42415837
has title: How can I write a recursive function to get an array representing the set of every permutation of values?
tagged with: javascript
score: 0
answer count: 2
upvote count: 1
downvote count: 1
possible better answer: http://stackoverflow.com/a/26936494
has answer: http://stackoverflow.com/a/26937803
accepted answer: http://stackoverflow.com/a/26937803
has comment: http://stackoverflow.com/comment/42415282
favorite count: 0

http://stackoverflow.com/q/26951541
answer count: 1
tagged with: meteor
favorite count: 0
tagged with: cordova
upvote count: 1
has body: I need to add gestures in my Meteor app. I don't understand how. Now I have put my code in Template.XX.rendered and than I call the gesture inside the events scope: Session.setDefault('deletable', false); Template.xx.rendered = function(){ $('body').hammer(); }; Template.xx.events({ 'swipeleft #hammerDiv': function(e, t) { Session.set('deletable', true); }, 'swiperight #hammerDiv': function(e, t) { Session.set('deletable', false); } }); Template.territories.helpers({ deleteButton : function(){ return Session.get('deletable'); } }); this simple code make possible to appear a delete button in the swiped item. All seems to work with chrome and mouse swipe, but when I emulate the app in my android device (meteor run android-device), swipe gesture don't works. If I test in my device with Chrome browser all works done. Is there any compatibility problem? Is my code wrong? Any suggestions? Thanks a lot!
has title: Meteor/Cordova gesture with hammer.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27057629
score: 1
type: Question
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27057629

http://stackoverflow.com/a/26890377
has comment: http://stackoverflow.com/comment/42334741
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
has body: You can use my script on this answer: Pause and play video when in viewport Fiddle: http://jsfiddle.net/pwhjk232/ $(document).ready(function() { var inner = $(".inner"); var elementPosTop = inner.position().top; var viewportHeight = $(window).height(); $(window).on('scroll', function() { var scrollPos = $(window).scrollTop(); var elementFromTop = elementPosTop - scrollPos; if (elementFromTop &gt; 0 &amp;&amp; elementFromTop &lt; elementPosTop + viewportHeight) { inner.addClass("active"); } else { inner.removeClass("active"); } }); })
accepted answer of: http://stackoverflow.com/q/26890245
score: 1
answers question: http://stackoverflow.com/q/26890245

http://stackoverflow.com/q/26913266
has title: Element and its parent have an ng-click specified, both are called
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26913390
type: Question
has comment: http://stackoverflow.com/comment/42376162
has body: Let's say I have a DIV with a function specified to be called when clicked on it by ng-click. Inside this DIV there's a BUTTON which also have a function to be called when clicked on, specified by ng-click. When I click the button, both the DIV's click and the BUTTON's click functions are called. How do I make that only the BUTTON's function is called? I have set up this fiddle for better illustrate what I mean. Below is the code: HTML: My text My button JavaScript: (function() { var app = angular.module('Test', []); app.controller('TestCtrl', [function() { this.divClick = function() { alert('div clicked'); }; this.buttonClick = function() { alert('button clicked'); } }]); })(); EDIT: As suggested by akonsu, I just need to stop the event propagation. This worked for me. Here's an updated Fiddle showing how it works.
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/26913390
answer count: 1
tagged with: angularjs
linked to: http://stackoverflow.com/q/20300866

http://stackoverflow.com/q/26965058
type: Question
has title: jQuery seems not work inside a function
tagged with: javascript
tagged with: jquery
score: -1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 1
favorite count: 0
upvote count: 0
has body: what I try to do is an button onclick event. When you click the button the other div is sliding down. When it slides down, it also add an onclick event to the button, when you use like alert() , console.log() inside the function it works just fine. But when I use like $('#formHelper').html('New content'); nothing happens. First, I made an jsfiddle here. No errors or anything, the codes looks like: BOOTSTRAP Form-Helpers Show Some text function myFn( ) { $('#formHelper').html('New content'); console.log( 'works?' ); }; $(document).on('click', '.btn', function(e) { e.preventDefault(); var div = '#'+$(this).attr('id'); $(div) .html('Hide') .removeClass('btn-primary') .addClass('btn-danger') .attr('onclick', 'myFn()'); $(div+'Show').slideDown(500); });
has answer: http://stackoverflow.com/a/26965091
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26965091

http://stackoverflow.com/comment/42856387
has text: As some people talks about deep copy, I made some test with [cloning an object in JS](http://web.archive.org/web/20140328224025/http://jsperf.com/cloning-an-object/2). For my example : 780 nodes and 906 links, the cloning takes ~200ms with ```$.extend(true, {}, oldObject);```, ~50ms with ```JSON.parse(JSON.stringify(oldObject));``` and ~1800ms with @ylamaki solution using custom function
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27184175
type: AnswerComment

http://stackoverflow.com/comment/42376276
score: 1
comment on: http://stackoverflow.com/q/26913438
type: Comment
has text: @A.Wolff make an excellent suggestion, indeed I could say that you must take a bps (size/time), not ms difference because you are not getting the same data.
type: QuestionComment

http://stackoverflow.com/comment/42376172
score: 3
type: QuestionComment
type: Comment
has text: Are you sure you aren't setting the secong one as sync, using maybe ajax global setup???
comment on: http://stackoverflow.com/q/26913438

http://stackoverflow.com/a/26905863
has body: In myModule.js you call require. You should call define instead so that your module is defined. A define call with a first argument that is a dependency list and a second argument that is a function is somewhat like a require call with the same arguments but additionally defines your module.
accepted answer of: http://stackoverflow.com/q/26904865
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/26904865
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42364984
type: Answer

http://stackoverflow.com/comment/42496150
score: 1
has text: @UnderTaker: Because when no match is found, `.indexOf()` returns `-1` so that the type of return value is still a number instead of something like `null`.
comment on: http://stackoverflow.com/a/26980297
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42312763
type: Comment
has text: You are going to need to show us what you've done so far
type: QuestionComment
comment on: http://stackoverflow.com/q/26877823
score: 0

http://stackoverflow.com/a/26929946
answers question: http://stackoverflow.com/q/26929891
type: Answer
has body: Use non greedy quantifier: (\[.*?\])\s(\[.*?\])\s(.*)/gmi
score: 0

http://stackoverflow.com/a/26893823
upvote count: 2
answers question: http://stackoverflow.com/q/26893779
downvote count: 0
has body: if (text == '') will only ever be true if the text is an empty string. If you need to match whitespace, you'll either need to trim the text to remove extra whitespace characters, or use a pattern matching regular expression: if (text.trim() === '') or if (/^\s*$/.test(text))
type: Answer
score: 2

http://stackoverflow.com/q/26984555
tagged with: django
has body: I am trying to dynamically format a value as a date in some javascript using a variable as the date format, but I cannot think of a way to get this to work. This code works: function resetFormValues() { $('#id_name_of_date_element').val(''); I have a variable on my template called dd_format and has a value of m/Y or m.Y. I have tested that the variable value is valid and does exist. How would I replace the "m/Y" with the variable, as shown below: $('#id_name_of_date_element').val(''); The error I get when I replace the "m/Y" with the variable is Error during template rendering
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42502924
tagged with: date
type: Question
upvote count: 2
has title: django template - date format issue
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/42502866
favorite count: 0
accepted answer: http://stackoverflow.com/a/26984671
tagged with: python
score: 2
tagged with: django-templates
has answer: http://stackoverflow.com/a/26984671
downvote count: 0

http://stackoverflow.com/a/26917768
type: AcceptedAnswer
type: Answer
has body: Ok so the best solution is to start from scratch from a v3 example, like http://bl.ocks.org/mbostock/4132797 (which I tried and succeeded with) or http://bl.ocks.org/mbostock/4150951 as Lars Kotthoff commented.
answers question: http://stackoverflow.com/q/26874408
score: 0
accepted answer of: http://stackoverflow.com/q/26874408

http://stackoverflow.com/a/26876095
type: Answer
answers question: http://stackoverflow.com/q/26833761
has body: Found a solution using multiple submit buttons in a single form.
accepted answer of: http://stackoverflow.com/q/26833761
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/42409899
comment on: http://stackoverflow.com/q/26932435
score: 1
has text: The most direct answer is to remove the `()` from the end. That's what invokes it. But that may cause another problem. The method being invoked may (and probably does) rely on the object it's being called from. In that case, you'd pass an anonymous function that invokes the method from the object. @Pointy shows how below.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26947729
type: AnsweredQuestion
upvote count: 2
has answer: http://stackoverflow.com/a/26948547
has title: Get an entire string or a substring, depending on a specific character
type: Question
possible better answer: http://stackoverflow.com/a/26947787
tagged with: javascript
has comment: http://stackoverflow.com/comment/42437402
has answer: http://stackoverflow.com/a/26947787
accepted answer: http://stackoverflow.com/a/26948547
answer count: 2
score: 2
tagged with: string-comparison
downvote count: 0
favorite count: 0
has body: I have a string that contains a MIME type, say application/json. Now I want to compare this against an actual HTTP header, in this case content-type. If the header contains the MIME type, then it's as easy as: if (mimeType === contentType) { ... } Unfortunately, the header may contain additional parameters. They always come after the value I'm interested in, and they are separated from it by a ;. E.g., it could be application/json; charset=UTF-8. So now basically I need to run: if (mimeType === contentType.substring(0, contentType.indexOf(';'))) { ... } The problem is that the first case still can happen, so now we have: if (mimeType === contentType || mimeType === contentType.substring(0, contentType.indexOf(';'))) { ... } Things start to get lengthy… I could think of comparing them using if (mimeType === contentType.substring(0, mimeType.length)) { ...} but this would also successfully match the value application/jsonformatter (which is not desired). So, to cut a long story short: Is there a better way to compare these values than my lengthy if described above, e.g. using a regular expression? Basically I'm thinking of an expression that shortens the header if necessary according to the following rules: If it contains a semicolon, return the part before it. If it doesn't contain a semicolon, return everything. What is the most effective way of writing this?
tagged with: regex
tagged with: node.js

http://stackoverflow.com/a/44896334
downvote count: 1
type: Answer
score: 6
has body: In fact, Access-Control-Allow-Origin header should be the same value as the Origin header as long as you want to allow it. So base on your code just cors: { origin: ["www.one.com","www.two.com","www.three.com"] } app.all('*', function(req, res, next) { let origin = req.headers.origin; if(cors.origin.indexOf(origin) &gt;= 0){ res.header("Access-Control-Allow-Origin", origin); } res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); next(); });
has comment: http://stackoverflow.com/comment/100894712
answers question: http://stackoverflow.com/q/26988071
upvote count: 7

http://stackoverflow.com/comment/42332609
type: AnswerComment
has text: Hmm. Good point. It reads as though he wants the button inside, yet the use of before with that selector implies outside.
type: Comment
comment on: http://stackoverflow.com/a/26889218
score: 0

interact.js
tags question: http://stackoverflow.com/q/26973989
type: Tag
tag name: interact.js

http://stackoverflow.com/comment/42482358
comment on: http://stackoverflow.com/a/26973531
type: Comment
has text: This would be working, but the functionallty to close the dialog on enter or on escape after it is opening is getting lost.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42758436
has text: Sorry for my typos in original message. The goal of my experiment is to use `self` that always is linked to current object. Because sometimes when we use calls like this `$.get('...', function () { console.log(this); })` - and if I use `this` it show me `this` that set to unction scope. But I wish to use `self` (magic property) that always a link to a object of this class.
comment on: http://stackoverflow.com/a/26980494
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/26861444
type: Answer
has body: you can use by two ways 1. take a list in action with setter, getter and add data in this list. In jsp page use strcts tag library and in javascript variable put list data. Then call chartjs library function with data like &lt;script type="text/javascript"&gt; var a = new Array(); &lt;s:iterator var="newsVar" value="newsList" status="newsStatus"&gt; a[&lt;s:property value="#newsStatus.index"/&gt;]='&lt;s:property value="id"/&gt;'; &lt;/s:iterator&gt; $(document).ready(function(){ chartjsfunction(a); }); &lt;/script&gt; send ajax call for data to action and send data to chartjs library function.
score: 1
has comment: http://stackoverflow.com/comment/42326844
upvote count: 1
answers question: http://stackoverflow.com/q/26860744
downvote count: 0
has comment: http://stackoverflow.com/comment/42321777

http://stackoverflow.com/a/26902531
score: 2
has comment: http://stackoverflow.com/comment/42356879
accepted answer of: http://stackoverflow.com/q/26902396
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26902396
upvote count: 2
type: Answer
has body: None of this is specific to any framework. What you are seeing is native javascript functionality. Let's go through your examples this.resource('bar', { path: '/:bar_id' }); // &lt;-- semicolon This is not chaining. The semicolon is used to signify the end of a statement in javascript. songsController = Ember.ArrayController.create({ model: songs, // &lt;-- comma sortProperties: ['track'], // &lt;-- comma sortAscending: true // &lt;-- additional things if you want, use commas }); Object Literals {} in javascript are made up of properties. Properties are defined using comma-separated key-value pairs: var myObj = { myKey : "myStringValue", mySecondKey : "mySecondStringValue", myFunctionKey : function() { return "I am a function"; } } More on object literals : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Values,_variables,_and_literals#Object_literals Periods are used as object accessors as such: var obj = { myProp : myVal }; console.log(obj.myProp); // myVal Now your last example is actually function chaining: $routeProvider. when('/phones', { // ... }). // &lt;-- period when('/phones/:phoneId', { // ... }); This occurs when a function returns a reference to it's parent object or another object containing functions: var obj = { funcOne : function() { return this; }, funcTwo : function() { return this; }, funcThree : function() { return "NO more Chaining FOr YOU!"; } } obj.funcOne().funcTwo().funcThree(); // "NO more Chaining FOr YOU!" obj.funcOne().funcTwo().funcThree().funcFour(); // throws an error - a string cannot contain a function Hope this helps!

http://stackoverflow.com/comment/42392780
score: 0
comment on: http://stackoverflow.com/q/26921756
has text: Ok, at the fist time that the button is clicked, it gets green... Did you see that you are always setting the cookie to 1 (in the createCookie function) before reading it (in the changeButton function)?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26939310
answer count: 4
tagged with: typeof
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42424677
possible better answer: http://stackoverflow.com/a/26939342
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/42422910
has body: Several sources suggest, that there are two canonical ways to check whether variable is undefined: foo === undefined typeof foo === 'undefined' But can anyone explain, why would one use === instead of == ? EDIT: the question is not about === vs ==. It is about using correct operator with the 'undefined'. The difference between === and == is obvious. But the question is which operator would be more correct when checking if value is undefined or not.
linked to: http://stackoverflow.com/q/359494
has answer: http://stackoverflow.com/a/26939659
type: Question
has answer: http://stackoverflow.com/a/26939337
has title: Why === instead of == for undefined
duplicate of: http://stackoverflow.com/q/359494
downvote count: 3
accepted answer: http://stackoverflow.com/a/26939337
has comment: http://stackoverflow.com/comment/42422887
has answer: http://stackoverflow.com/a/26939841
tagged with: javascript
has answer: http://stackoverflow.com/a/26939342
has comment: http://stackoverflow.com/comment/42422876
upvote count: 4

http://stackoverflow.com/q/26941945
tagged with: javascript
has body: I am getting the below error when am passing value to $scope.formData.field_happy.und.0.value. Uncaught SyntaxError: Unexpected number But if am passing it binding to a model it seems to work. I can't figure out what am doing wrong. &lt;input type="checkbox" ng-model="formData.field_staff_interaction.und.0.value" &gt; This is for posting to a Drupal services api endpoint. This the format I need.
has comment: http://stackoverflow.com/comment/42427590
has answer: http://stackoverflow.com/a/26942029
has title: Unexpected number when passing value in AngularJs
score: 0
tagged with: typeerror
tagged with: syntax-error
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/42427674

http://stackoverflow.com/a/26940220
type: Answer
answers question: http://stackoverflow.com/q/26940028
has body: alert(a + ',' + b + ',' + c + ((a*a)+(b*b)) = (c*c)); is an invalid expression. This one should work: (note the == operator which checks if two values are the same alert(a + ',' + b + ',' + c + (((a*a)+(b*b)) == (c*c))); Here is a fully working sample: http://codepen.io/anon/pen/VYwXwp (There were numerous issues with your code, I've fixed some of them)
score: 0

http://stackoverflow.com/comment/42391708
type: AnswerComment
score: 0
type: Comment
has text: yeah, I figured that much out. the solution is rather complex and involves checking the result against the original array to see if you can replace more than one trafo with another trafo, and doing that recursively until there are no more candidates available to replace. Maybe you could build on that thought. I'm off to bed now and would be happy to do it tomorrow morning...
comment on: http://stackoverflow.com/a/26921186

http://stackoverflow.com/comment/42486579
comment on: http://stackoverflow.com/a/26965344
type: AnswerComment
score: 0
type: Comment
has text: Thanks a lot. It works. So I understand that for the helpers values (first_name and last_name) to be dynamically updated, we have to store the user object and update it in the variable session.

http://stackoverflow.com/q/26858647
upvote count: 1
has comment: http://stackoverflow.com/comment/42278512
tagged with: javascript
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/26858713
downvote count: 0
has answer: http://stackoverflow.com/a/26858816
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42278473
has title: how to ng-model in ng-repeat?
has body: How to get the selected items if you choose more than one link, for example, I choose the USA and Can, Fra, Ger, China ... So how can I get the selected items from the ng-model? The view is below: Xcountry {{country.name}} done How can I get the results like $scope.(name of ng-model) in the controller? It doesn't work if I obtain them by $scope.country.name. PS: It will create a list of countries in the form of links, if you click one, it will be choosen...
score: 1
type: Question
answer count: 2

http://stackoverflow.com/comment/42336646
type: Comment
type: QuestionComment
has text: The most relevant utility I can think of is underscore.js. It has a bunch of functions for manipulating arrays, but none of them do quite what you want here. You'll have to right your own algorithm, most likely.
comment on: http://stackoverflow.com/q/26891277
score: 0

http://stackoverflow.com/q/26871377
type: AnsweredQuestion
has body: Is there a different outcome (scope etc...) between the following two function declarations? var myObj = { foo: function myName() {} } var myObj = { foo: function() {} }
duplicate of: http://stackoverflow.com/q/15336347
score: 1
upvote count: 3
has answer: http://stackoverflow.com/a/26871438
type: Question
answer count: 2
tagged with: function
has comment: http://stackoverflow.com/comment/42301238
tagged with: javascript
has comment: http://stackoverflow.com/comment/42301307
possible better answer: http://stackoverflow.com/a/26871472
accepted answer: http://stackoverflow.com/a/26871438
has answer: http://stackoverflow.com/a/26871472
favorite count: 0
downvote count: 2
linked to: http://stackoverflow.com/q/15336347
has title: Why is `{foo: function myName() {}}` acceptable syntax?

http://stackoverflow.com/comment/42481342
type: QuestionComment
score: 0
has text: what exactly have you tried and is not working? selected date : {{selectedDate}} isn't getting a value?
type: Comment
comment on: http://stackoverflow.com/q/26972594

http://stackoverflow.com/comment/42369471
has text: Did you include the code to scroll up when you click on the rotated arrow? Because that's not working yet
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26899659

http://stackoverflow.com/a/27043195
type: Answer
answers question: http://stackoverflow.com/q/26985200
score: 0
has body: Looks like your getting a 404 when trying to fetch the users list. You need to change your collection to include the complete service URL: var Users = Backbone.Collection.extend({ url: 'http://backbonejs-beginner.herokuapp.com/users' }); The other solution would be to use an ajaxPrefilter: $.ajaxPrefilter( function( options, originalOptions, jqXHR ) { options.url = 'http://backbonejs-beginner.herokuapp.com' + options.url; });

http://stackoverflow.com/comment/42426554
has text: I want if the checkBookingStatus return data containing string true then the script should halt all together.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/26941298

http://stackoverflow.com/comment/42381970
type: Comment
type: QuestionComment
has text: can u try hosting the html file and try "http://" instead of "file://", it may be because of this bug in wkwebview: http://www.openradar.me/radar?id=5839348817723392
comment on: http://stackoverflow.com/q/26898941
score: 0

http://stackoverflow.com/q/26940360
score: 1
has answer: http://stackoverflow.com/a/63189985
type: Question
has comment: http://stackoverflow.com/comment/42425202
upvote count: 1
has comment: http://stackoverflow.com/comment/83185818
has comment: http://stackoverflow.com/comment/42424932
answer count: 1
tagged with: javascript
has body: some one knows how to send a file in an ajax request? my current problem is that i have the URL of the file in a &lt;input type="file" /&gt; but i don't know how to "load" the file in a variable or js object to can send it to my server Can someone who has done this help me ? if there is any way to do it with AngularJS it would be great
favorite count: 0
linked to: http://stackoverflow.com/q/18571001
has comment: http://stackoverflow.com/comment/42424859
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42425218
has title: how to send a file from front end to back end with javascript or angularjs
downvote count: 0

http://stackoverflow.com/comment/42332171
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26886507
score: 0
has text: You can see the `td` in the original post f you view "source". Whatever.

http://stackoverflow.com/comment/42373841
comment on: http://stackoverflow.com/q/26912129
score: 1
has text: What is `data` and what is the value of `data["rowMax"]`?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26908996
has title: Create objects dynamically out of a dot notation like string
has answer: http://stackoverflow.com/a/71091839
accepted answer: http://stackoverflow.com/a/26909342
has answer: http://stackoverflow.com/a/26909522
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/60605422
has answer: http://stackoverflow.com/a/60605422
type: AnsweredQuestion
score: 7
upvote count: 7
has answer: http://stackoverflow.com/a/26909287
type: Question
has comment: http://stackoverflow.com/comment/42367863
has comment: http://stackoverflow.com/comment/42367822
has body: I'm trying to create a JS object dynamically providing a key and a value. The key is in dot notation, so if a string like car.model.color is provided the generated object would be: { car: { model: { color: value; } } } The problem has a trivial solution if the key provided is a simple property, but i'm struggling to make it work for composed keys. My code: function (key, value) { var object = {}; var arr = key.split('.'); for(var i = 0; i &lt; arr.length; i++) { object = object[arr[i]] = {}; } object[arr[arr.length-1]] = value; return object; }
has answer: http://stackoverflow.com/a/26909342
tagged with: javascript
answer count: 6
has answer: http://stackoverflow.com/a/26909377

http://stackoverflow.com/a/26842149
downvote count: 0
score: 1
has body: Angular JS does not have it's own local storage, it uses the browsers local storage. You can acces this with plain javascript for example: var taste = localStorage.getItem('favoriteflavor'); or localStorage.setItem('favoriteflavor','vanilla'); examples taken from: http://www.smashingmagazine.com/2010/10/11/local-storage-and-how-to-use-it/
answers question: http://stackoverflow.com/q/26841910
accepted answer of: http://stackoverflow.com/q/26841910
upvote count: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/42347423
comment on: http://stackoverflow.com/a/26897019
type: Comment
has text: The explanation is not quite right. It knows what to do with a string, it executes it, as with `eval(string)`. The reason it doesn't work is because variables are evaluated in the global scope, and he wants to access the local variable `sect`.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42348674
score: 0
type: AnswerComment
has text: thanks again Steve; sorry for posting it in the wrong spot. I updated the coding above; it's still not working. I don't know what I'm doing wrong.
type: Comment
comment on: http://stackoverflow.com/a/26893366

http://stackoverflow.com/comment/42260336
type: AnswerComment
type: Comment
has text: @FelixKling yes you are right, I don't know Why I Wrote that. Updated
comment on: http://stackoverflow.com/a/26848401
score: 0

http://stackoverflow.com/q/26980523
has comment: http://stackoverflow.com/comment/42495288
duplicate of: http://stackoverflow.com/q/19310636
score: 0
tagged with: jslint
has comment: http://stackoverflow.com/comment/42495326
has comment: http://stackoverflow.com/comment/42495181
tagged with: javascript
has body: JSLint is throwing problems telling me to Combine this with the previous 'var' statement but I'm not sure how I'd do it correctly with my code: var len = results.rows.length, i; //loop around each record in the database for (i = 0; i &lt; len; i++) { var singleRecord = results.rows.item(i); //create list var individualRecord = ''; individualRecord = '&lt;li&gt;&lt;a href="#info" id="anIndividualRecord" data-key="' + individualRecord.id + '" &gt;'; it's telling me to combine the three var statements in there but if anyone could advise me as to how to do this without creating more problems, that would be much appreciated.
has answer: http://stackoverflow.com/a/26980662
linked to: http://stackoverflow.com/q/19310636
has answer: http://stackoverflow.com/a/26980605
answer count: 4
has comment: http://stackoverflow.com/comment/42495285
has title: Combining 'var' statements
has answer: http://stackoverflow.com/a/26980624
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/26980623

http://stackoverflow.com/q/26990100
answer count: 2
has comment: http://stackoverflow.com/comment/42515630
tagged with: arrays
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42513333
has comment: http://stackoverflow.com/comment/42512215
has comment: http://stackoverflow.com/comment/42513400
has comment: http://stackoverflow.com/comment/42515676
has comment: http://stackoverflow.com/comment/42512116
score: 0
has title: How to extract multidimensional array in jquery?
tagged with: multidimensional-array
has comment: http://stackoverflow.com/comment/42515968
has body: I have an array which is in following format { "items": { "0": 96, "1": 121566, "3": "2014-10-30" }, "name": [ "asdfghj" ], "misc": [ { "VehicleBrandName": "FORD", "VehicleTypeName": "111111" }, { "VehicleBrandName": "BMW", "VehicleTypeName": "75676576" }, { "VehicleBrandName": "FORD", "VehicleTypeName": "2222" } ] } here items,name,misc are values from different table. Items passed as an object and name and misc are arrays. In jquery function var misc = data.misc; var items = data.items; var name = data.customer; $.each(items, function (key, value) {// working function part = $('.check').find('*[data-field="' + key + '"]'); part.val(value); }); $(misc).each(function (key, value) {//not working for (name in value) { if (value.hasOwnProperty(name)) { part = $('.check').find('*[table-field="' + name + '"]'); part.text(value[name]); } } $('tr.active').clone().appendTo('tbody'); }); And HTML code is items are working fine. But misc is getting only single value.Other two values are not getting. I expecting the following output. FORD BMW FORD 111111 75676576 2222 Please help me......
has answer: http://stackoverflow.com/a/26990395
accepted answer: http://stackoverflow.com/a/26990395
possible better answer: http://stackoverflow.com/a/26992807
has comment: http://stackoverflow.com/comment/42512601
has answer: http://stackoverflow.com/a/26992807
has comment: http://stackoverflow.com/comment/42513234
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42512483
has comment: http://stackoverflow.com/comment/42512132
type: Question
has comment: http://stackoverflow.com/comment/42511931

http://stackoverflow.com/q/26964659
score: 5
has body: What I want to do: Take an array of objects, each object with object.timestamp in milliseconds, and order them from newest to oldest. The problem: Angular's orderBy doesn't seem to be putting things in the correct order. The following timestamps are getting put in the following order: 1416187808218 - // Nov/16/2014 5:30:PM 1416187881192 - // Nov/16/2014 5:31:PM 1416189118263 - // Nov/16/2014 5:51:PM 1416189138827 - // Nov/16/2014 5:52:PM 1416130064119 - // Nov/16/2014 1:27:AM The correct/desired order is obviously be: 1416189138827 - // Nov/16/2014 5:52:PM 1416189118263 - // Nov/16/2014 5:51:PM 1416187881192 - // Nov/16/2014 5:31:PM 1416187808218 - // Nov/16/2014 5:30:PM 1416130064119 - // Nov/16/2014 1:27:AM So it's going 4, 3, 2, 1, 5 when it should be, obviously, 1, 2, 3, 4, 5 The relavent code: html: &lt;div class="cardWrapper" ng-repeat="card in cards | orderBy:'timestamp'"&gt; various child elements &lt;/div&gt; javascript: scope.cards = homeData.get().cards; // returns an array of objects // ^this^ becomes something similar to scope.cards = [ {text: 'some text...', timestamp: 1416189138827, other: 'data'}, {text: 'some text...', timestamp: 1416187881192, other: 'data'} //etc... ];
tagged with: angularjs-orderby
has answer: http://stackoverflow.com/a/50576705
answer count: 2
has answer: http://stackoverflow.com/a/47684259
upvote count: 5
has title: Angular orderBy:'timestamp' putting things in the wrong order
tagged with: arrays
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: sorting
favorite count: 0
has comment: http://stackoverflow.com/comment/42467169
tagged with: angularjs
type: Question

http://stackoverflow.com/comment/42359067
comment on: http://stackoverflow.com/q/26903806
type: Comment
type: QuestionComment
has text: node.js is not an application framework, and has no concept of routes. Please tag correctly with the framework you are using (e.g. Sails.js, Total.js, Locomotive.js...)
score: 2

http://stackoverflow.com/comment/67599916
has text: There is a great boilerplate for the implementation of all 3 delegate methods here: https://gist.github.com/davbeck/8613f2e74e8fc335c14d
type: AnswerComment
comment on: http://stackoverflow.com/a/27067168
type: Comment
score: 6

http://stackoverflow.com/a/26916163
accepted answer of: http://stackoverflow.com/q/26915136
score: 0
answers question: http://stackoverflow.com/q/26915136
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42384444
type: Answer
has comment: http://stackoverflow.com/comment/42383637
has comment: http://stackoverflow.com/comment/42384176
has body: What's being said is true, the show inside the ngRepeat is different from the show in myCtrl. However, even if it weren't, there's only one variable show in myCtrl, so every item would be hidden and shown together when toggling. If you want to toggle individual rows, they each need their own flag. There are several ways to accomplish this. But to avoid too much logic in the view, and to avoid the use of $parent, one way would be to use the controller as syntax, and keep a list of show flags, taking advantage of the fact that ngRepeat supplies the array index as $index. var myApp = angular.module("myApp", []); myApp.controller("myCtrl", function() { var myCtrl = this; myCtrl.array = [1,2,3]; myCtrl.show = [false, false, false]; myCtrl.toggle = function (index){ myCtrl.show[index] = !myCtrl.show[index]; console.log(myCtrl.show); }; }); Then the view: Click here to show Something to show You could also use an array of objects if you plan to do something complicated where keeping track of two arrays would be difficult. Something like: myCtrl.array = [ {val: 1, show: false}, {val: 2, show: false}, {val: 3, show: false}, ]; Then the toggle function would be: myCtrl.toggle = function(obj){ obj.show = !obj.show; }; and the view: Click here to show Something to show Edit: here's a plunkr for each. http://plnkr.co/edit/sBhY00c5LU4YMeHlqjG7?p=preview http://plnkr.co/edit/axO9sEB6oHQeDwIRLU4a?p=preview

http://stackoverflow.com/comment/42424585
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/26940259
has text: There's nothing wrong with what you're doing, the question is why you're doing it, do you need an IIFE, if not there's no reason to add one ?
type: Comment

http://stackoverflow.com/comment/42407834
type: Comment
comment on: http://stackoverflow.com/a/26931139
has text: sorry but what will the query for it, if i want to get record for id=5
type: AnswerComment
score: 0

http://stackoverflow.com/comment/42295395
score: 0
has text: FYI,i am throwing that commmand in a controller not a run, or is that wrong?
comment on: http://stackoverflow.com/a/26857178
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42491727
has text: Why didn't you use `new WidgetPlus` in the first case? How do you determine which one you need, and when does that change? What is the difference between the two types? Is `WidgetPlus` a subclass of `Widget`?
comment on: http://stackoverflow.com/q/26977887
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/42303097
has text: `X` is not `x`. You've set `X:x` which is just copying the current value of `x` into `X`. They are not connected in anyway. You need a setter function.
type: QuestionComment
type: Comment
score: 3
comment on: http://stackoverflow.com/q/26872432

http://stackoverflow.com/a/26989638
has comment: http://stackoverflow.com/comment/42511223
has body: Try (more: http://api.jquery.com/scroll/): jQuery( window ).scroll(function() { toggleNavbar(); }); I don´t know why, but the $ is not defined on your page, using the jQuery reference is working fine. You might fix your js as well to: var fixed = 0; function toggleNavbar() { if (jQuery(window).scrollTop() &gt; (150)) { if (fixed == 0) { fixed = 1; jQuery("#navbar").addClass("navbar-fixed-top").css({ opacity: 0, top: -30 }).animate({ opacity: 1, top: 0 }, 200, function() {}); jQuery("#navbar").addClass("websiteHeaderSticky"); jQuery("#navbar").removeClass("websiteHeader"); } } if (jQuery(window).scrollTop() &lt; (150)) { if (fixed == 1) { fixed = 0; jQuery("#navbar").animate({ opacity: 0, top: -30 }, 200, function() { jQuery("#navbar").removeClass("navbar-fixed-top"); jQuery("#navbar").removeClass("websiteHeaderSticky"); jQuery("#navbar").addClass("websiteHeader").animate({ opacity: 1, top: 0 }, 300); }); } } } jQuery(window).scroll(function() { toggleNavbar(); });
has comment: http://stackoverflow.com/comment/42593413
score: 0
has comment: http://stackoverflow.com/comment/42551646
accepted answer of: http://stackoverflow.com/q/26989172
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42522765
has comment: http://stackoverflow.com/comment/42589675
has comment: http://stackoverflow.com/comment/42515367
answers question: http://stackoverflow.com/q/26989172
has comment: http://stackoverflow.com/comment/42531651
type: Answer
has comment: http://stackoverflow.com/comment/42548703

http://stackoverflow.com/comment/123503189
type: Comment
comment on: http://stackoverflow.com/a/26895380
type: AnswerComment
has text: What about when you do not know the locale? For instance, a web page open to all the world asking for the customer name and address? The page could be in English, but the customer is German with a sharp s in her address, or Greek with a final sigma?
score: 0

http://stackoverflow.com/comment/42380296
type: QuestionComment
has text: I don't understand the question. The EventEmitter is a system that lets you assign a callback to fire when an event happens.
comment on: http://stackoverflow.com/q/26915600
score: 0
type: Comment

http://stackoverflow.com/a/26838726
type: Answer
has comment: http://stackoverflow.com/comment/42290304
has body: if you are using jQuery you can get height of viewable part using $(window).height() and if you are using javascript you can get height by following code window.innerHeight I have tested this code with device Moto X.
has comment: http://stackoverflow.com/comment/42242971
has comment: http://stackoverflow.com/comment/42282405
has comment: http://stackoverflow.com/comment/42278540
score: 0
has comment: http://stackoverflow.com/comment/42242853
answers question: http://stackoverflow.com/q/26837854

http://stackoverflow.com/q/26899011
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42351272
has comment: http://stackoverflow.com/comment/42351367
has comment: http://stackoverflow.com/comment/42351401
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/42384268
has comment: http://stackoverflow.com/comment/42351414
has answer: http://stackoverflow.com/a/26899672
linked to: http://stackoverflow.com/q/17030074
type: Question
upvote count: 2
answer count: 2
has comment: http://stackoverflow.com/comment/42351827
has answer: http://stackoverflow.com/a/26918196
has comment: http://stackoverflow.com/comment/42351209
has title: Getting previous page URL instead of current page
tagged with: javascript
tagged with: jquery
has body: I am trying to get the current page URL and parameters but JavaScript and jQuery are returning the previous page's URL. I am currently using: $(document).ready(function() { function getUrlParameter(sParam){ var sPageURL = window.location.search.substring(1); var sURLVariables = sPageURL.split('&amp;'); for (var i = 0; i &lt; sURLVariables.length; i++) { var sParameterName = sURLVariables[i].split('='); if (sParameterName[0] == sParam) { return sParameterName[1]; } } } var charid = getUrlParameter('id'); var charname = getUrlParameter('name'); console.log(charid); console.log(charname); }); Sometimes if I Reload/Refresh the page it will give me the current/correct URL. EDIT: I set the links on the previous page with this code $.getJSON(ip + 'list_query.php', function(data) { // data now contains array for(var i = 0; i &lt; data.length; i++) { var fl = data[i]['superhero_name'].slice(0,1); $("#" + fl).append("&lt;a href='" + ip + "biography.html?id=" + data[i]['id'] + "&amp;name=" + data[i]['superhero_name'] + "'&gt;" + data[i]['superhero_name'] + "&lt;/a"); } });
has comment: http://stackoverflow.com/comment/42351112
tagged with: get
has comment: http://stackoverflow.com/comment/42351237
has comment: http://stackoverflow.com/comment/42351357
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42351881
tagged with: url
favorite count: 0

http://stackoverflow.com/a/26887240
type: AcceptedAnswer
score: 0
answers question: http://stackoverflow.com/q/26886834
type: Answer
accepted answer of: http://stackoverflow.com/q/26886834
has body: In jQuery this could be: numberOfQuestions=0; $("button#newQuestion").click(function() { numberOfQuestions++; $("#container").append(' '+numberOfQuestions+' '); }); Add Question

http://stackoverflow.com/q/26940739
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/8268356
linked to: http://stackoverflow.com/q/133925
tagged with: java
duplicate of: http://stackoverflow.com/q/8268356
type: Question
score: 0
answer count: 2
tagged with: jsp
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/26941099
possible better answer: http://stackoverflow.com/a/26940773
has title: How can i use Javascript variable as argument in java code in JSP?
has answer: http://stackoverflow.com/a/26940773
has body: I want to send code title and price as an argument to the book object but gives illegal start expression error. function addrecord() { code = document.getElementById('code').value; title = document.getElementById('title').value; price = parseFloat(document.getElementById('price').value); &lt;% Book book = new Book(%&gt; code &lt;% ,%&gt; title &lt;% , %&gt; price &lt;% ); bookdb.addRecord(book); %&gt; document.getElementById("code").value = ""; document.getElementById("title").value = ""; document.getElementById("price").value = ""; }
upvote count: 1
has comment: http://stackoverflow.com/comment/42425487
accepted answer: http://stackoverflow.com/a/26941099
downvote count: 1

http://stackoverflow.com/a/26920045
score: 1
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26919841
accepted answer of: http://stackoverflow.com/q/26919841
has comment: http://stackoverflow.com/comment/42437083
type: Answer
has comment: http://stackoverflow.com/comment/42460900
downvote count: 0
has body: Not every even number below 4,000,000 is in the fibonacci sequence. Try the following: var max = 4000000, first = 1, second = 1, next = 0, result = 0; while (second &lt; max) { // until we pass our limit next = first + second; // find the next number in the fibonacci sequence by adding the previous two first = second; // move on to the next numbers in the sequence second = next; if (second % 2 === 0) // if the second number is even result += second; // add it to our result } return result; // result holds the sum of all the even fibonacci numbers below our limit!

http://stackoverflow.com/comment/42311403
score: 0
comment on: http://stackoverflow.com/q/26876906
type: Comment
type: QuestionComment
has text: @ADASein yes, hieroglyph! My problem is very much knowing what I want to do and having very little clue as how best to do it AND ask about it. (shrugs shoulders and shakes head.... so is my plight....)

http://stackoverflow.com/q/26976044
tagged with: javascript
has comment: http://stackoverflow.com/comment/42486867
has answer: http://stackoverflow.com/a/26976743
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/26976842
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/26976743
has title: How to display directive outside current element
has comment: http://stackoverflow.com/comment/42487622
has body: I need to create a directive with a rendering outside of the current element. My current example is based on a directive inside a table cell. I would like the rendering create a row next to the current one <a mydirective> on click it would produce <a mydirective> CLICKED ! Is this can be achieved with the link function ? Can I still use template + controller options ?
possible better answer: http://stackoverflow.com/a/26976842
has comment: http://stackoverflow.com/comment/42487158
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42487840
type: Question
tagged with: angularjs-directive

http://stackoverflow.com/q/26898376
has body: I have an api which is called using ajax (getJSON). Currently it works perfectly if I want to append to a defined div, namely 'open'. However, what I really want to do is update the static values in my javascript for the datetime picker, specifically the minTime and maxTime. My code is as below: AJAX $.getJSON("{{ url('api/openingtimes')}}", { option: $(this).val() }, function(data) { if (data.success != false ) { $('#open').empty(); $.each(data, function(key, value) { $('#open').append('&lt;div&gt;' + value.weekday_start_time +' ' + value.weekday_end_time +'&lt;/div&gt;'); }); } }); JAVASCRIPT datetimepicker var logic = function( currentDateTime ){ if( currentDateTime.getDay()==6 ){ this.setOptions({ minTime:'10:00', maxTime:'21:00' }); } else this.setOptions({ minTime:'08:00', maxTime:'22:00' }); }; jQuery('#start_date_time').datetimepicker({ onChangeDateTime:logic, onShow:logic }); }); API (JSON) { "weekday_start_time": "08:00", "weekday_end_time": "22:00", "weekend_start_time": "10:00", "weekend_end_time": "21:00" } I'm struggling to see how this can work via my JSON feed. If anyone can advise, I would be very grateful.
has answer: http://stackoverflow.com/a/26898515
answer count: 1
score: 0
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/42350351
has title: getJSON to update javascript datetimepicker
has comment: http://stackoverflow.com/comment/42350170
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
tagged with: ajax
type: Question

http://stackoverflow.com/q/26895976
has comment: http://stackoverflow.com/comment/42372568
has title: NVD3.js - MultiLine Chart Multiple x-axis
has comment: http://stackoverflow.com/comment/42372151
upvote count: 1
type: Question
tagged with: charts
downvote count: 0
tagged with: javascript
answer count: 1
has comment: http://stackoverflow.com/comment/42362398
score: 1
has answer: http://stackoverflow.com/a/26911657
favorite count: 0
has comment: http://stackoverflow.com/comment/42371765
tagged with: nvd3.js
tagged with: d3.js
type: AnsweredQuestion
has body: I know that we can have up to three different Y-axis in a single MultiLine Chart. I need to have a second X-axis. Is this possible? I'm trying to create a period-over-period time comparison, in which the user can see the same variable plotted for two different time ranges in the same chart. Thanks!
accepted answer: http://stackoverflow.com/a/26911657

http://stackoverflow.com/a/26986628
has body: The easiest approach would be to clear all the divs, and then replace the content of the one you actually wish to display. If you're using jQuery, check out the empty method for a place to start.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26986590

http://stackoverflow.com/comment/42280459
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26859296
has text: You can use jquery effects (slide,fadeIn or show) while selecting the section A div.

http://stackoverflow.com/a/26935786
has body: I think your problem is being caused due to this line: onClick="editGUI('+ i +','+JSON_csw[i].carerName+','+JSON_csw[i].carerAddress+', '+JSON_csw[i].carerMobile+', '+JSON_csw[i].carerID+');"&gt;\ When you are sending parameters to the editGUI function in your click handler, you do not have quotes to denote strings. For a sample element in JSON_csw, this is how that line is appended to the html: onClick="editGUI(1,test_name,test_address,test_mobile, 5)" You should enclose the strings in quotes, like: onClick="editGUI('+ i +',\''+JSON_csw[i].carerName+'\',\''+JSON_csw[i].carerAddress+'\', \''+JSON_csw[i].carerMobile+'\', '+JSON_csw[i].carerID+');"&gt;\ I think it would then work correctly. I haven't tried the above code too, use Inspect Element to see how the onClick handler is actually being shown in the DOM. Then use appropriate escaping and you should be good to go.
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/26935677
score: 1
has comment: http://stackoverflow.com/comment/42416147
downvote count: 0
has comment: http://stackoverflow.com/comment/42416067
has comment: http://stackoverflow.com/comment/42416272
has comment: http://stackoverflow.com/comment/42416535

http://stackoverflow.com/comment/42440774
type: Comment
comment on: http://stackoverflow.com/a/26949677
has text: Ok but thats what I don't get that controller is in scope no?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/42329857
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26887345
has text: Have you made any attempt to write the javascript? What did you try? I what way did it fail?
score: 0

nodelist
type: Tag
tags question: http://stackoverflow.com/q/26894000
tag name: nodelist

http://stackoverflow.com/q/26834716
has body: I have an HTTP response header with an ISO-8859-1 character in it (é, 0x39). Here is a raw packet capture showing the HTTP response, second line from the bottom: 00000000 48 54 54 50 2f 31 2e 30 20 32 30 30 20 4f 4b 0d HTTP/1.0 200 OK. 00000010 0a 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 61 .Content -Type: a 00000020 75 64 69 6f 2f 61 61 63 70 0d 0a 69 63 79 2d 62 udio/aac p..icy-b 00000030 72 3a 34 30 0d 0a 69 63 79 2d 67 65 6e 72 65 3a r:40..ic y-genre: 00000040 4a 61 7a 7a 20 4c 6f 75 6e 67 65 20 43 61 66 65 Jazz Lou nge Cafe 00000050 0d 0a 69 63 79 2d 6e 61 6d 65 3a 43 61 66 e9 20 ..icy-na me:Caf. 00000060 64 65 20 50 61 72 69 73 20 2d 20 52 41 44 49 4f de Paris - RADIO The header should be: icy-name:Café de Paris I am making a very simple http.get() request: http.get('http://example.com/streamUrl', function (res) { console.log(res.headers); }); On my console, I see: 'icy-name': 'Caf� de Paris', Then I tried converting the string to a buffer: console.log(new Buffer(res.headers['icy-name'])); // <Buffer 43 61 66 ef bf bd 20 64 65 20 50 61 72 69 73 ... > It seems that the original character 0xe9 is already lost before conversion to my Buffer, or during the conversion process. Then, I thought that maybe iconv-lite would be helpful: var iconv = require('iconv-lite'); iconv.extendNodeEncodings(); console.log( (new Buffer(res.headers['icy-name'], 'latin1')).toString('utf8') ); // "Caf? de Paris" with a literal question mark, `0x3F`. I suspect the damage is already done before my code can ever get the response header values. My questions: Is my assumption correct that the string is mis-interpreted by Node.js' HTTP client in the first place? Is there anyway to configure Node.js to properly handle HTTP responses? RFC5987 says that the default character set for HTTP responses is ISO-8859-1. If there is no way to get Node.js to behave, is there any way to undo the conversion damage, recover the original ISO-88591-1 string, and then convert to UTF-8?
favorite count: 0
has comment: http://stackoverflow.com/comment/42235493
has comment: http://stackoverflow.com/comment/42235480
has answer: http://stackoverflow.com/a/26837626
tagged with: node.js
score: 2
upvote count: 2
type: UnansweredQuestion
tagged with: http
has comment: http://stackoverflow.com/comment/42235594
type: Question
has answer: http://stackoverflow.com/a/26837923
tagged with: http-headers
tagged with: character-encoding
has title: Node.js not using ISO-8859-1 encoding for HTTP response headers
answer count: 2
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/42433722
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26945162
has text: Post the code you run on `pageshow`.
score: 0

http://stackoverflow.com/a/26943647
type: Answer
answers question: http://stackoverflow.com/q/26941364
downvote count: 0
has body: This is because you're calling the function newData before assigning values to theta and dtheta. So the first time this function is called, theta and dtheta are undefined (NaN), which makes the sin function return NaN. D3's line function creates an invalid SVG path when the x or y input value is NaN. This continues to happen until the NaN value is "shifted to the left" out of the data array, which is why you don't see the line initially and when it appears, it does so all of a sudden. newData(); var theta = 0; var dtheta = 1; function newData() { theta += dtheta; //var sin = function(){return 0.2*Math.sin(theta);}; var sin = function(){return random();}; data.push({x : new Date(), y : sin()}); }; To fix this, simply move the below two lines to the top before newData is ever called. See working fiddle here: http://jsfiddle.net/bgzsmqmw/4/ var theta = 0; var dtheta = 1;
score: 1
has comment: http://stackoverflow.com/comment/42432234
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26941364

http://stackoverflow.com/q/26965102
tagged with: jquery
has answer: http://stackoverflow.com/a/33547892
answer count: 2
downvote count: 0
favorite count: 0
upvote count: 2
has answer: http://stackoverflow.com/a/26965498
type: UnansweredQuestion
tagged with: plugins
score: 2
has body: Created the boxslider using divs and problem I am having is removing the slide completely I call $('#removeid').remove(); on the slides ID so theoretically it should completely remove the slide right? it reorders the slides after doing so but the slide remains even after calling $('.bxslider').reloadSlider(); I am at a total loss as to what is going on. Any help would be appreciated.
tagged with: bxslider
type: Question
has title: Remove Slide From BxSlider
tagged with: javascript

http://stackoverflow.com/comment/42410994
has text: well thats kinda hard to. I looked in to it some more, I can alter the CSS, but I think I need to create an extension for the legend so it allows scrolling on the legend. or at least disables the scrolling of the map if you hover over the legend.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26912175

http://stackoverflow.com/comment/42683513
comment on: http://stackoverflow.com/a/26858799
has text: It doesn't look like there's much more to say on this question for now, so I'm going to mark your answer as the correct one, and maybe when the matrix-based API is finalised someone else will answer with a reference to official documentation on it.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/26953639
downvote count: 0
answers question: http://stackoverflow.com/q/26953617
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/42447497
score: 1
has body: Assign function to variable var yourFunction = function (req, res) { ... } And you can use it afterwards as parameter passed to app.get() app.get('/:someVar/xxxxx', yourFunction); app.get('/xxxxx', yourFunction);

http://stackoverflow.com/q/26962297
has answer: http://stackoverflow.com/a/26962737
tagged with: javascript
has comment: http://stackoverflow.com/comment/42463789
has body: I'm new to angular, so bear with me here.... I've a simple, but dirty, json results file I am pulling into my angularjs page. I am trying to get just the img src from the first img that is found in the returned info. Here is a fiddle with it setup: var app = angular.module('myApp', ['ngSanitize']); app.controller('MainCtrl', function ($scope) { $scope.data = "HEREHLKSDJFKLFJSLK:FJKFJ:KLJSL:KDfj&lt;img src=\"http://www.sierraavalanchecenter.org/sites/default/files/forecast/201411/20141113-074138-0.png\"/ &gt;asdfsdjflksdfj;kasdfkjs;dklfs;df"; }); app.filter('extractSrcUrl', function () { return function (text) { var output = angular.element(text).attr('src'); return(output); } }); http://jsfiddle.net/j9jst560/ If found the filter idea via this post: getting img src from json data while using AngularJS ng-bind-html If I get rid of all the json data and just leave: http://www.sierraavalanchecenter.org/sites/default/files/forecast/201411/20141113-074138-0.png\"/ > the filter pulls out the src fine. However, with my messy data, no results. Should I be using regex somewhere in my controller rather than running filter? Is my data that bad?
has title: AngularJS regex json data for img src or other selectors
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/26962737
tagged with: angularjs
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/24037549
tagged with: http://stackoverflow.com/tag/json
type: Question

http://stackoverflow.com/a/26971649
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42482449
type: Answer
accepted answer of: http://stackoverflow.com/q/26971617
has comment: http://stackoverflow.com/comment/42482895
answers question: http://stackoverflow.com/q/26971617
has body: When you call .then on a promise - it returns a new promise which resolves with the value you return from the .then. Thus, the correct way to chain promises in your example is: doSomething().then(function(firstResult){ alert(firstResult); return doSomething2(); // this could also return a promise over an async value }).then(function(secondResult){ alert(secondResult); // alerts 2 return doSomething3(); }).then(function(thirdResult){ alert(result(3); }); The reason promise chaining works is because of how .then works, its signature as a function is kind of complex, but makes sense when you grasp it: Promise&lt;A&gt; -&gt; (A -&gt; (Promise&lt;B&gt; | B)) -&gt; Promise&lt;B&gt; This looks complicated, but let's analyze it: It's a function that operates on a Promise (provided implicitly as the this). In our case that's the promise doSomething returns. It takes a callback that works on the unwrapped value: what the promise resolved to. It returns a promise over a new type of value (or just a value in our case). In our case, that value is 1. So we have a Promise and we resolve it with 1. It returns a promise itself over the value our then will resolve - this is why chaining happens. Calling .then on it - we provided a function that accepts that 1 as an argument and returned a 2. So we had a 1 -> 2. This returned a promise over the value 2. A promise in JS is an abstraction over chaining itself. Like others of its kind - it abstracts sequencing, think of then like a semicolon. This is in fact why promises are so useful - you hook on asynchronously, just like you returned 2 from the then you can return an $.ajax call and the chain will only happen when the ajax call completes.
score: 10
upvote count: 10
has comment: http://stackoverflow.com/comment/42479379
has comment: http://stackoverflow.com/comment/42479906

http://stackoverflow.com/a/26964078
score: 2
downvote count: 0
upvote count: 2
has body: Here's a snippets with jQuery and Moment.js that does what you want, I made format into a variable so you can play with is. $('.release-date').each( function() { var format = "Do MMM YYYY"; var $this = $( this ); var old_date = $.trim($this.text()); var new_date = moment(old_date , 'YYYY-MM-DD').format( format ); $this.text($this.text().replace(old_date, new_date)); }); 2014-11-16
has comment: http://stackoverflow.com/comment/42466067
has comment: http://stackoverflow.com/comment/42466112
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26963948
answers question: http://stackoverflow.com/q/26963948
type: Answer

http://stackoverflow.com/comment/42438356
type: QuestionComment
has text: I'm not sure how console.log(a.errors.messages) would display anything, as you are not altering the messages object present inside the errors object. Can you please show whole code?
comment on: http://stackoverflow.com/q/26947904
score: 0
type: Comment

http://stackoverflow.com/q/26951489
has title: 'Uncaught TypeError: undefined is not a function' keeps showing up for different lines of code
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/26952390
upvote count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42443842
favorite count: 0
has body: I am trying to take a set of text, and when I hit a button have it change to a different set of text. I have been trying a lot of different methods, and cannot seem to get it to work. Here is a working Jsfiddle. I keep getting 'Uncaught TypeError: undefined is not a function' for the line var $rep = $update.textContent.substring(1); I have changed this line of code, but will the get the same error on a different line of code within the same function. function createAnswers() { var i; for (i = 0; i &lt; 4; i++) { var $update = $(".answers p")[i]; var $rep = $update.textContent.substring(1); console.log($rep); var answerText = document.createTextNode(randomImage.randomAnswers[i]); if (usedImages.length &gt;= 1) { $rep.replaceWith(answerText); } $update.appendChild(answerText); } } I am still pretty new at Javascript, so I may be missing something very obvious. Any constructive criticism will be helpful.
has answer: http://stackoverflow.com/a/26951882
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42444043
score: 1

http://stackoverflow.com/q/26981244
downvote count: 3
has body: I have made a tooltip with jQuery but the default browser was still there. I got it away with this script, but it also makes the content of my own tooltip dissapear, wich is the title of some images on the page: $('#imagerow img').hover( function () { $(this).data('tooltipText', $(this).attr('title')); $(this).removeAttr('title'); }, function () { $(this).attr('title', $(this).data('title')); $(this).attr('title', $(this).data('tooltipText')); }); Click on the smaller images in #imagerow to see. Here's a link to the page in progress: http://www.beijerland.website/gallerij.html Can someone help me to get my own tooltip content back? (without displaying the default tooltip) Many thanks
type: Question
has answer: http://stackoverflow.com/a/26982097
tagged with: javascript
tagged with: jquery
has title: How to remove the default tooltip and keep my own tooltip's content
answer count: 1
favorite count: 0
type: UnansweredQuestion
score: -3
upvote count: 0

http://stackoverflow.com/comment/42444780
score: 0
comment on: http://stackoverflow.com/q/26952014
type: Comment
type: QuestionComment
has text: @Mihai Thanks for the comment, I added an exit() and still got the same result.

http://stackoverflow.com/a/26845336
score: 1
answers question: http://stackoverflow.com/q/26845287
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/26845287
upvote count: 1
has body: You can do that using the geolocation API. But the user has to allow the location detection for it to work. https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/Using_geolocation

http://stackoverflow.com/comment/42310761
comment on: http://stackoverflow.com/q/26876673
score: 0
type: Comment
type: QuestionComment
has text: NaN stands for "Not a Number". Check if you are have an expression where a variable is not a number as expected.

http://stackoverflow.com/q/26877403
has answer: http://stackoverflow.com/a/26884664
type: Question
has title: Focus on input by using jQuery
answer count: 2
tagged with: javascript
score: 0
has body: I'm working on a webpage where jquery is loaded and there is an input field on the webpage, which supports auto completion, so after typing several characters, a selection of suggestion box shows itself. By using dev tools' console, i can be able force that suggestion list to be generated and be appeared on demand, by executing following jquery functions (in browser console): $('input#PrincipalPolicyHolder_EmploymentOccupationDescription').val("soft"); setTimeout(function() { $('input#PrincipalPolicyHolder_EmploymentOccupationDescription').focus(); }, 5000); setTimeout(function() { $('input#PrincipalPolicyHolder_EmploymentOccupationDescription').keyup(); }, 6000); The delay is required for me to change the focus to the window from console. These jQuery commands are enough to get $('#PrincipalPolicyHolder_EmploymentOccupationDescription').is('focus') true which is required to generate a list of suggestions, as long as i don't click to somewhere else. However, the same steps don't work in casperjs environment. This is how i execute; casper.then(function () { this.evaluate(function () { $('input#PrincipalPolicyHolder_EmploymentOccupationDescription').val("soft"); $('input#PrincipalPolicyHolder_EmploymentOccupationDescription').focus(); $('input#PrincipalPolicyHolder_EmploymentOccupationDescription').keyup(); }); }); I also tried to use sendKeys with keepFocus: true, but never got is(':focus') check positive. Is there any way to accomplish this? Edit: I narrowed down the problem to work on a very simple webpage, Here is the code snippet that captures the issue: var casper = require('casper').create({ verbose: true, loglevel: "debug" }); casper.start('http://jsfiddle.net/vhermL99/embedded/result/'); casper.on('remote.message', function(msg) { this.echo('remote message caught: ' + msg); }); casper.withFrame(0, function () { casper.thenEvaluate( function () { var input = $('#input1'); input.val("value set by jquery"); input.focus(); console.log("is input focussed: " + inpu…
tagged with: casperjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26881212

http://stackoverflow.com/a/26846459
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42256041
type: Answer
answers question: http://stackoverflow.com/q/26846252
accepted answer of: http://stackoverflow.com/q/26846252
has comment: http://stackoverflow.com/comment/42256128
has body: add a separately submit handler $("#add_station").on('click', function () { $(this).closest('form').submit(); }); $("form").on("submit", function (e) { e.preventDefault(); alert("working!"); $.ajax({ url: advoke.base_url + "/new-vendor-user/station/ajax", method: 'post', processData: false, contentType: false, cache: false, dataType: 'json', data: new FormData(this), beforeSend: function () { $('.info').hide().find('ul').empty(); $('.success_message').hide().find('ul').empty(); $('.db_error').hide().find('ul').empty(); }, success: function (data) { if (!data.success) { $.each(data.error, function (index, val) { $('.info').find('ul').append(' ' + val + ' '); }); $('.info').slideDown(); setTimeout(function () { $(".info").hide(); }, 5000); } else { $('.success_message').slideDown(); $('#add_station').remove(); $("#station").append(data.new_station); setTimeout(function () { $(".success_message").hide(); }, 5000); } //success }, error: function () { //db error $('.db_error').append(' Something went wrong, please try again! '); $('.db_error').slideDown(); //Hide error message after 5 seconds setTimeout(function () { $(".db_error").hide(); }, 5000); } //error }); });

http://stackoverflow.com/a/26990670
answers question: http://stackoverflow.com/q/26990586
score: 0
type: Answer
has body: Pretty easy to do it yourself? var args = []; for(var p in par){ args.push(par[p]); } console.log(args); // ["a val", "b cal", Object { id="c.id val"}] foo.apply(this, args); http://jsfiddle.net/9fzg3ehu/

http://stackoverflow.com/q/26962645
has comment: http://stackoverflow.com/comment/42463861
tagged with: mongodb
has body: I've been searching around for some examples for this but none of them seem to work. I'm trying to return only unique values from one field where the conditions from another field are true. Here is what my collection looks like: Records { _id: "XuZcMm2MGCr7CshB5"&lt;br&gt; clientAvailability: "Direct Solutions&lt;br&gt; "enhancementId: "D08F817L"&lt;br&gt; enhancementName: "Allow TN Transfer"&lt;br&gt; follow: false&lt;br&gt; impactedProducts: Array[4]&lt;br&gt; internal: false&lt;br&gt; like: false&lt;br&gt; releaseDate: Wed Aug 27 2014 00:00:00 GMT-0500 (CDT)&lt;br&gt; requestingMso: "Internal"&lt;br&gt; requestingProduct: "Voice Services"&lt;br&gt; required: false&lt;br&gt; } I tried to limit my query to only documents where the 'releaseDate' is in 2014 and return all of the unique values of 'clientAvailability' for those records. Why isn't this working? I'm a noob, so I''m sure I'm missing something simple. Thanks in advance! return Records.distinct('clientAvailability', { $and: [{releaseDate: {$gte: new Date('Jan 1, 2014'), $lte: new Date('Nov 26,2014')}}]} );
tagged with: javascript
type: UnansweredQuestion
has title: Return only distinct values from one field in a MongoDB query
type: Question
has answer: http://stackoverflow.com/a/26964245
score: 0
answer count: 1

http://stackoverflow.com/q/26991891
has comment: http://stackoverflow.com/comment/42515234
has answer: http://stackoverflow.com/a/26992285
has body: I'm trying to delete JQuery from my website: because i use it in a short fraction of the application. I only have one problem: the Event Listener for the elements i created dynamically after create the listener in Javascript. In JQuery i created the listener as follow: $(document).on('click', '.class_ElementTrigger', function() { }); This method works fine: but I don't find the equivalent in which i call "Javascript Pure" This other, the only one I found, don't works with the elements created dynamically : [].forEach.call(document.querySelectorAll('.el'), function (el) { el.addEventListener('click', function() { }, false); }); Anybody know the way to make it? Thanks!
has answer: http://stackoverflow.com/a/26992008
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: addeventlistener
accepted answer: http://stackoverflow.com/a/26992008
tagged with: javascript
tagged with: jquery
answer count: 2
has title: How to create event listener for elements created dynamically without JQuery
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/26992285
has comment: http://stackoverflow.com/comment/42515088

http://stackoverflow.com/comment/42266334
comment on: http://stackoverflow.com/a/26849069
score: 0
type: AnswerComment
type: Comment
has text: Thanks for the response and the jsfiddle link! Your code does work yes. I have added a simple table to your example. I am hoping to be able to click the name of the cell to display the modal window with the cells name as `showPopup`'s input variable. Even better to be able to click anywhere in the cell! Which is my current implementation minus `your_variable`. http://jsfiddle.net/90hrnkbm/2/

http://stackoverflow.com/comment/42400237
score: 0
type: QuestionComment
type: Comment
has text: Also, please don't refer to your code as java
comment on: http://stackoverflow.com/q/26926828

http://stackoverflow.com/q/26836808
has answer: http://stackoverflow.com/a/26903256
downvote count: 0
has answer: http://stackoverflow.com/a/29947746
has comment: http://stackoverflow.com/comment/42239505
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26836857
type: Question
tagged with: recursion
score: 3
has comment: http://stackoverflow.com/comment/42239208
has answer: http://stackoverflow.com/a/26901819
has comment: http://stackoverflow.com/comment/42253744
has title: Reverse array function with one parameter. (JavaScript)
answer count: 8
has answer: http://stackoverflow.com/a/26837066
has comment: http://stackoverflow.com/comment/42239443
tagged with: arrays
linked to: http://stackoverflow.com/q/5164039
tagged with: javascript
has answer: http://stackoverflow.com/a/26836987
has comment: http://stackoverflow.com/comment/42239246
has body: I'm having a problem trying to write a body for a function that recursively reverse an array, but only has one parameter. function ReverseArray(arr) { var i = 0; var j = arr.length - 1; if (i &lt; j) { var temp = arr[i]; arr[i] = arr[j]; arr[j] = temp; return ReverseArray(arr); } return arr; } I realize this won't work because the variables will be re-initialized when the function calls itself. I'm just looking for some ideas at this point, because i'm stuck.
upvote count: 3
has comment: http://stackoverflow.com/comment/42239466
has comment: http://stackoverflow.com/comment/42239464
favorite count: 0
has answer: http://stackoverflow.com/a/26836872
has answer: http://stackoverflow.com/a/26837047

http://stackoverflow.com/comment/42390446
score: 0
has text: @Bergi Bruteforce? Not sure what you mean by that in this case. The number of transformers is not too large. Right now the maximum is 5.
type: Comment
comment on: http://stackoverflow.com/q/26920930
type: QuestionComment

http://stackoverflow.com/q/26962278
possible better answer: http://stackoverflow.com/a/26962315
has comment: http://stackoverflow.com/comment/42462635
has comment: http://stackoverflow.com/comment/42462833
has comment: http://stackoverflow.com/comment/42462917
has answer: http://stackoverflow.com/a/26962315
has comment: http://stackoverflow.com/comment/42462779
favorite count: 0
has comment: http://stackoverflow.com/comment/42462729
has body: Why does the following return false? Object.prototype instanceof Object
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/21505192
tagged with: javascript-objects
has comment: http://stackoverflow.com/comment/42462600
downvote count: 1
has comment: http://stackoverflow.com/comment/42462786
has comment: http://stackoverflow.com/comment/42462931
accepted answer: http://stackoverflow.com/a/26962327
has comment: http://stackoverflow.com/comment/42462819
has comment: http://stackoverflow.com/comment/42462899
tagged with: prototype
score: 8
upvote count: 9
has comment: http://stackoverflow.com/comment/42462634
has comment: http://stackoverflow.com/comment/42462673
has comment: http://stackoverflow.com/comment/42462935
tagged with: javascript
has comment: http://stackoverflow.com/comment/42462846
has title: Why is Object.prototype instanceof Object false?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26962327

http://stackoverflow.com/comment/42591798
score: 0
has text: @IdanAdar - I experience the same problem with ValueDatePicker. Except this starts right away. I also use Worklight and Dojo 1.9.4
comment on: http://stackoverflow.com/q/26974481
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42458985
has text: @skobaljic Thanks. I tried adding this condition both inside & outside the nested array loop; either way the outer loop continues thru the outer array, but still the nested array members are ignored after the first non-included outer array member. So there IS a 'myDiv' generated, each containing a div.nested-array-stuff, but only the first couple of .nested-array-stuff are loading. I'm baffled
comment on: http://stackoverflow.com/q/26949321
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42479463
type: Comment
comment on: http://stackoverflow.com/a/26971883
has text: that's the proper way, be sure to refresh properly and clear cache
type: AnswerComment
score: 0

http://stackoverflow.com/comment/42503300
score: 0
type: Comment
comment on: http://stackoverflow.com/q/26984300
type: QuestionComment
has text: btw, to fix the error in the first line, use `if (app === undefined) {`, or, possibly, `if (app === undefined || app === null) {`

http://stackoverflow.com/a/27029741
has comment: http://stackoverflow.com/comment/43108882
has comment: http://stackoverflow.com/comment/43024008
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/26850747
has body: This is one way to achieve that effect: This will only work for the svg renderer, but you can add event listeners on mouseover and mouseout as well as touchmove events like so: // ... After you've created all the planets ... // This command will create all the dom elements // which you can bind events to. two.update(); var highlight = function() { sun.fill = 'red'; }; var ignore = function() { sun.fill = 'yellow'; }; sun._renderer.elem.addEventListener('mousemove', highlight, false); sun._renderer.elem.addEventListener('mouseout', ignore, false); There is also an example of how to achieve this here.
answers question: http://stackoverflow.com/q/26850747
type: AcceptedAnswer

http://stackoverflow.com/a/26914030
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26879352
has body: From your comments I assume that you already know how to upload and draw an image normally, so I will only explain how to get an image "into shape" when drawing it. Take a look at the compositing settings of the 2d context. These allow you to use a path or an image to perform masking on a canvas. draw your image to your canvas in the desired size create a path which marks the edges of the shape you want to "cut out". 3. set context.fillColor to something solid without an alpha transparency when you don't already did so set context.globalCompositeOperation = 'destination-in' use context.fillPath to draw the path in destination-in mode. This erases everything outside of the path and keeps everything inside the path. set context.globalCompositeOperation = 'source-over'` to restore the normal drawing behavior.

http://stackoverflow.com/comment/42453310
type: Comment
comment on: http://stackoverflow.com/q/26956877
score: 0
has text: yes , include full url and make sure you white list it in phonegap and CORS enable the output
type: QuestionComment

http://stackoverflow.com/a/26964572
answers question: http://stackoverflow.com/q/26964526
downvote count: 0
score: 1
type: Answer
has body: Run the code snippet. Button will display after 1 minute. $(function() { setTimeout(function() { $('#myButton').show(); }, 60000); $('#myButton').click(function() { $('#text1').hide(); $('#text2').show(); }); }); #text2, #myButton { display: none; } Cat Next Page Dog Fiddle for 3 seconds: http://jsfiddle.net/3s192nq8/2/
upvote count: 1

http://stackoverflow.com/q/26966736
tagged with: d3.js
accepted answer: http://stackoverflow.com/a/26978867
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42476977
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/26978867
tagged with: scatter-plot
has body: I am trying to make a visualization using d3 which is basically a scatter plot with links between the points. (I have attached a .gif of the existing java based visualization) The points can be added by double clicking other points. On hovering over a point, I wish to have links drawn between the point and all its partners on screen. I have the part where on double clicking a node, its partners are added. What I need help with is drawing the links (primarily I am not able to understand how can I get the x1,y1,x2,y2 values required to draw the links). This is what my DOM looks like: I have seen a lot of examples online but somehow not able to figure the solution - if anyone could link me to a similar visualization or share a fiddle/ give some pointers on how this can be achieved I would be really grateful.
linked to: http://stackoverflow.com/q/19236149
score: 0
answer count: 1
has title: A scatterplot with links between points using d3?
tagged with: http://stackoverflow.com/tag/svg

http://stackoverflow.com/comment/42351513
has text: Ur right. I changed it . But the error is not because of that
comment on: http://stackoverflow.com/q/26899291
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/42419084
comment on: http://stackoverflow.com/q/26937329
score: 0
type: QuestionComment
type: Comment
has text: Avoid in all case to use same names for nested variables

http://stackoverflow.com/a/26862935
upvote count: 3
has body: The file will be loaded in to the browsers' cache upon first load. For every subsequent request it will be read from the cache to reduce bandwidth requirements and improve speed. If you really want to improve performance, you can load jQuery.js from a global CDN, such as Google, which has the advantage of being fast, and due to it's widespread use it's highly likely that someone already has jQuery in their cache from this location. I would also suggest using a newer version of jQuery as 1.8.2 is quite old now. If you need legacy browser support (IE9 and lower), use 1.11: Otherwise you can use the smaller and more efficient 2.x:
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42285819
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/42285968
has comment: http://stackoverflow.com/comment/42286022
accepted answer of: http://stackoverflow.com/q/26862894
answers question: http://stackoverflow.com/q/26862894
score: 3

http://stackoverflow.com/q/26957091
score: 0
has title: link a checkbox to an object in Javascript
answer count: 1
has body: Suppose I have a table which is populated by filling out a form on a page and clicking the submit button. The last column of the table is a Completed section with a checkbox on each row. On clicking on the checkbox I want to change the .completed property from false to true on that object. How can I distinguish which checkbox was clicked and change the property from that row? this.addRowToTable = function() { return " " + this.app + " " + this.priority + " " + this.date + " " + this.additionalNotes + " " + " " + " "; }; I have all the checkboxes in the checkApp array, but Im not sure where to go from there?. This is called when the form is submitted: function addAppointment() { if (txtApp.value == "" || txtPriority.value == "" || txtDate.value == "" || { alert("Please fill all text fields"); } else { var app = new Appointment(txtApp.value, txtPriority.value, txtDate.value, txtNotes.value, false); apps.push(app); localStorage.setItem("apps", JSON.stringify(apps)); clearUI(); } updateTable(); updateTable() loops through all objects in my array and adds them between table tags: for (var i = 0; i < apps.length; i++) { var app = new Appointment(apps[i].app, apps[i].priority, expenses[i].date, apps[i].notes, false); tblHTML += app.addRowToTable(); } My Appointment Object: function Appointment(app, priority, date, notes, completed) { this.app = app; this.priority = priority; this.date = date; this.additionalNotes = notes; this.completed = completed; this.addRowToTable = function { ... }; }
has comment: http://stackoverflow.com/comment/42453376
tagged with: checkbox
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26957640
type: Question
accepted answer: http://stackoverflow.com/a/26957640
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/comment/42463503
score: 0
comment on: http://stackoverflow.com/q/26962157
type: QuestionComment
has text: @Tom do you have a set of code so that i can understand what you want to say. and i cant use ajax according to my whole applications.
type: Comment

http://stackoverflow.com/comment/42272361
score: 0
has text: Start some basic debugging... On the JS side, use the `error` callback of the AJAX, and on the PHP side, start `var_dump(var);die();`ing everything sequentially...
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26855002

http://stackoverflow.com/comment/80405186
has text: Yes, that works - brilliant! I have been searching long and hard for a way to get my UpdatePanel content to be displayed immediately after (initial content display/) Page Load. That was fairly straightforward but the UI flickered because it was continually looping causing page loads - but no more! Thank you MrCADMan! :)
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/35779512

http://stackoverflow.com/a/27189337
score: 2
downvote count: 0
type: Answer
upvote count: 2
has body: $asyncValidators is available from angularjs 1.3 and above: https://code.angularjs.org/1.2.27/docs/api/ng/type/ngModel.NgModelController
answers question: http://stackoverflow.com/q/26976212

http://stackoverflow.com/a/26922901
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/42393738
downvote count: 0
has body: You may be able to keep a variable that tells you if the user already typed a character. Then only trigger the function if the variable is not yet set. For example: var started = false; $('input.amount').on('input',function(e){ if(!started){ started = true; setTimeout(function() { // code started = false;//to reset so that further typing will trigger again }, 1000); } });
type: Answer
answers question: http://stackoverflow.com/q/26922849

http://stackoverflow.com/comment/42388463
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/26908750
has text: (Untested) Add `target.recompose()` after setting the contents. Composing (i.e., breaking the text into lines) usually happens in the background; ID just may not have the time between your two function calls to do so.
type: Comment

rss
tags question: http://stackoverflow.com/q/26885237
tag name: rss
tags question: http://stackoverflow.com/q/26931073
tags question: http://stackoverflow.com/q/26868159
type: Tag

http://stackoverflow.com/q/26917436
has body: I am trying to understand the methods to call constructor and prototype methods in JavaScript. Here is my try: function A() { this.getId = function() { console.log('A constructor - getId'); } } A.prototype.getId = function() { console.log('A prototype - getId'); } function B() { A.call(this); this.getId = function() { console.log('B constructor - getId'); } } B.prototype = Object.create(A.prototype); B.prototype.constructor = B; B.prototype.getId = function() { console.log('B prototype - getId'); } var p = new A(); var q = new B(); p.getId() //A constructor - getId q.getId() //B constructor - getId p.constructor.prototype.getId() //A prototype - getId q.constructor.prototype.getId() //B prototype - getId Are last two ways are correct way to Call prototype methods? How can I call parents constructor and prototype methods from child object q?
has comment: http://stackoverflow.com/comment/42383760
has title: Call parents constructor and prototype from child object
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42384478
type: Question
has answer: http://stackoverflow.com/a/26917690
has comment: http://stackoverflow.com/comment/42383538
tagged with: javascript
has comment: http://stackoverflow.com/comment/42384656
score: 0
has comment: http://stackoverflow.com/comment/42383803
answer count: 1
has comment: http://stackoverflow.com/comment/42383500

http://stackoverflow.com/comment/42313851
type: AnswerComment
has text: I'll give an example called `Final Example`.
comment on: http://stackoverflow.com/a/26878171
type: Comment
score: 0

http://stackoverflow.com/q/26962233
score: 2
answer count: 0
upvote count: 2
type: Question
has body: I've got a Node application using the Express application and want to mock the calls to the soap web services so that I can write some unit tests. For mocking, i'm using Sinon and Soap for sending requests to the SOAP web services but finding it difficult on how to approach this. before(function(done) { var soapWs = require('../../methods/soapWs'); soapWs.user = soap.createClient(path + '/restsoapproxy/test/specs/testjson/user.wsdl); // following returns undefined sinon.stub(SoapWs.user, 'sessionLogin', function(err) { err.code = '404'; err.message = 'error'; // e.g. "for user not found" return err; }); } The SOAP web service has a method called sessionLogin that takes a username and email but not sure how to use sinon to mock a call to the soap web service - the code snippet above returns 'undefined'
tagged with: javascript
has title: mocking call to soap web service using sinon
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: sinon
tagged with: soap
tagged with: node.js

http://stackoverflow.com/comment/42363551
type: AnswerComment
comment on: http://stackoverflow.com/a/26906381
has text: json_escape(@map) gives me a string like {"name"=\u003e"map", "children"=\u003e[{"
type: Comment
score: 0

http://stackoverflow.com/q/26921414
tagged with: angularjs
has body: I'm struggling to create a line chart that has two X axes and subgroupings for the year. So for example if I have 4 quarters, (Q3,Q4,Q1,Q2) and Q3,Q4 belong to the year 2014 while Q1,Q2 belong to the year 2015 i would be able to depict this on the second X axis. I have an example of this in the imgur link posted below, and a somewhat similar example that uses months instead of quarters. Does anyone have any insight or examples as to how I can accomplish this? https://i.sstatic.net/1Hl6u.jpg http://jsfiddle.net/bhyvn5hv/ var xAxis1 = d3.svg.axis() .scale(x) //.ticks(d3.time.months) .tickFormat(monthformat) .tickSize(5,0) .orient("bottom"); var xAxis2 = d3.svg.axis() .scale(x) .ticks(d3.time.years, 1) .tickFormat(yearformat) .tickSize(5,0) .orient("bottom");
tagged with: d3.js
type: UnansweredQuestion
has title: d3js X axis data by quarter sub grouped by year
linked to: http://stackoverflow.com/q/26878054
type: Question
tagged with: angularjs-directive
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/26921644
answer count: 1

http://stackoverflow.com/comment/42367741
type: Comment
type: QuestionComment
has text: Yes we require a code snippet that returns whether a row is visible in the viewport or not. Even a code snippet returning row ids of all the visible rows will be accepted.
comment on: http://stackoverflow.com/q/26908857
score: 0

http://stackoverflow.com/comment/135218882
has text: Any idea how to clear words added to the “All languages” language? The code in the answer does not clear words added to the it, as "All languages" does not even seem to exist inside app.activeDocument.hyphenationExceptions. Adding, inside the loop, $.write(myHyphenation.name + ": " + myAddedWords.length + "\n") (which reports to the console each language inside the document’s dictionary along with the number of words added to it) before removeException does not list any item with the number of words added to “All languages“ (nor all other items get those words either).
comment on: http://stackoverflow.com/a/26985290
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42410580
comment on: http://stackoverflow.com/a/26932190
type: AnswerComment
type: Comment
has text: You can use `$('#your-form-id input')` as selector to match only inputs of the form in question.
score: 1

http://stackoverflow.com/a/26879517
answers question: http://stackoverflow.com/q/26879364
has body: How about to use as below, var PaymentsReceived1 = Number(document.TransactionForm.PaymentsReceived1.value);
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/26879364
type: AcceptedAnswer

http://stackoverflow.com/comment/42347403
type: Comment
has text: Can I ask why the `[]` brackets are needed here? (i don't mean these ones - `lines[i]` but these - `...push([])` I think it should work this way: `sdata.push(lines[i].split(','))`
type: AnswerComment
comment on: http://stackoverflow.com/a/26897065
score: 0

http://stackoverflow.com/comment/42399204
comment on: http://stackoverflow.com/q/26912927
type: Comment
has text: Glad you found the correct solution. No clue why you accepted my answer since it had nothing to do with the immediate problem, but do try to keep the variable names meaningful. Trust me on this one.
type: QuestionComment
score: 0

http://stackoverflow.com/q/26924508
has answer: http://stackoverflow.com/a/26924601
favorite count: 0
type: UnansweredQuestion
downvote count: 1
type: Question
tagged with: firefox
has title: Open a fullsize window in Firefox
tagged with: javascript
score: -1
has body: I hv a requirement, when I'll click a link, a new fullsize window will open. When I am going for 1st option, it is working fine in Firefox(ESR 26.2.0) But, 2nd option isnt working at all. Fullsize window isn't hetting opened. 1st option: window.open(windowUrl, "popWindow", "height=1000, width=1500, scrollbars=1, resizeable=1"); 2nd option: window.open(windowUrl, "popWindow", "fullscreen=1, scrollbars=1, resizeable=1"); Any solution?
upvote count: 0
answer count: 1

http://stackoverflow.com/comment/42442976
has text: And how would you go about organizing such a project? Could you possibly give me an example?
comment on: http://stackoverflow.com/a/26950841
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/26892572
score: 0
tagged with: webview
answer count: 0
tagged with: javascript
type: UnansweredQuestion
has body: I'm trying to play videos (Not Youtube or Vimeo) in a WebView. I load a HTML file, it runs some Javascript to generate the html5 video tag and the methods to control it. On Kitkat everything works fine, but I'm having trouble supporting Jellybean. The javascript functions that should be called upon time simply don't get called in Jellybean. I can live with this however. The main problem is when I send commands using mWebView.loadUrl("javascript:video.play();"); the behavior is borked. Sometimes it completely ignores the command, sometimes it catches it, but instead of resuming a paused video like on Kitkat, it restarts the video from the beginning. The fact that it doesn't react the same way everytime makes me wonder if somehow the OS's video player is getting affected, or if I need to force focus on the correct element. The initial play command always works, but after the video starts playing and onShowCustomView() get's called, everything goes bad. In Kitkat the video simply loads in the WebView but on Jellbean, nothing shows unless I make a custom WebChromeClient and handle the view called in onShowCustomView(). This gives me another view object (in addition to the WebView) and possibly I'm handling it poorly. I've been reading documentation but I still have a weak understanding of why I'm calling onShowCustomView() (I'm perfectly happy to have everything in my lone Webview like on Kitkat), so it's not obvious what I should be doing with the view it gives me. I do know it is the view that actually displays the video however. I've been banging my head against this wall for days and would appreciate any help or clue. Here's the code for onShowCustomView() // Need custom ChromeClient since android &lt; 19 mWebView.setWebChromeClient(new WebChromeClient() { @Override public void onShowCustomView(View view, CustomViewCallback callback) { super.onShowCustomView(view, callback); ViewGroup.LayoutParams webViewSize = mWebView.getLayoutParams(); FrameLayout frameLayout = (…
type: Question
tagged with: android
tagged with: http://stackoverflow.com/tag/html
has title: JavaScript Trouble in WebView playing Video on Jellybean
has comment: http://stackoverflow.com/comment/49845668
tagged with: video
has comment: http://stackoverflow.com/comment/49804665

http://stackoverflow.com/comment/42350675
has text: @Alain is my answer not what you were looking for?
comment on: http://stackoverflow.com/q/26895730
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42481725
has text: When is `display()` called?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26972941

http://stackoverflow.com/comment/42513054
type: Comment
comment on: http://stackoverflow.com/q/26990812
has text: I just tested but having same value..
score: 0
type: QuestionComment

http://stackoverflow.com/q/26847251
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/42258371
has comment: http://stackoverflow.com/comment/42257437
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Parse JavaScript from html string in C#/Java
has body: I am trying to do some WebScraping of a site and the data is in dynamically loaded containers. It appears that the loading is done via JavaScript. Therefore I would need to execute it, in order to get it. I have written 2 versions of the program, one in Java and one in C#, so helping me with one would be nice enough. I am currently using WebResponse/WebRequest in C# and HttpURLConnection in Java. I have to login into the site first, which already works like a charm. Now I need to parse the content, so the data gets filled in and the containers loaded. Is there an easy way to run the html through a browser control or an already included library?
has answer: http://stackoverflow.com/a/28929323
tagged with: web-scraping
linked to: http://stackoverflow.com/q/720678
type: Question
tagged with: c#
tagged with: java
score: 0

http://stackoverflow.com/a/27073178
answers question: http://stackoverflow.com/q/26986459
has body: You're trying to use browser/DOM Javascript to access native app UI elements. Although this environment uses Javascript like a browser does, the underlying object model is not the DOM you're used to seeing on a web page. That's why you're seeing that document is undefined. As implied by the little snippet in the "UI Automation" section of the docs, you need to access the window and button objects. The exact path you'll use depends on your TestApp, of course, but it might look something like: TestApp.windows[0].buttons[0].click() (It is probably also possible to scrobble through these arrays by control ID using whose, or the like, but don't have experience with that.)
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26986459
type: Answer

http://stackoverflow.com/q/26868499
has answer: http://stackoverflow.com/a/26868568
upvote count: 1
tagged with: fade
type: Question
has body: I am totally new to JavaScript, so I don't know anything about it. What I want is to fade the elements which are in view(center) and fade those in. When they are out of view, i want them to fade out again. for example: So in the start you don't see anything. but if you start scrolling, textblock 1 fades in. when scrolling past this block, textblock 2 fades in under textblock 1. while textblock 2 is fading in, textblock 1 is fading out. When scrolling down further, textblock 1 is completely invisible. textblock 2 starts fading out and textblock 3 starts fading in under textblock 2.
has answer: http://stackoverflow.com/a/26868648
tagged with: javascript
answer count: 2
has title: fade in elements in view and fade out when out of view
downvote count: 0
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/42296135
score: 1

http://stackoverflow.com/a/26965129
upvote count: 1
has body: See the question for more details, but the generic answer that I worked for me when saving a model with a belongsTo relationship (and you specifically need that relationship to be serialized) is to call .get() on the properties and then save() them in then(). It boils down to this: var file = this.store.createRecord('file', { fileName: 'the_name.txt', filePath: '/the/path', type: null, version: null }); // belongsTo set() here file.set('type', selectedType) .set('version', selectedVersion); Ember.RSVP.all([ file.get('type'), file.get('version') ]).then(function(values) { var onSuccess = function() { this.transitionToRoute('files'); }.bind(this); var onFail = function() { alert("failure"); this.set('uploadError', true); }.bind(this); // Save inside then() after I call get() on promises file.save().then(onSuccess, onFail); }.bind(this));
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26940363
type: Answer
accepted answer of: http://stackoverflow.com/q/26940363
score: 1

http://stackoverflow.com/q/26977949
type: Question
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/42498718
tagged with: javascript
tagged with: sorting
has comment: http://stackoverflow.com/comment/42538660
upvote count: 2
has body: I'm trying to sort a list of physicians on a page by name. There is a dropdown and the user can select ascending or descending. Neither one is working. The UI is not updating at all. EDIT: I've changed the sort code to follow the example on the KO website. When i step into the code i get an error when I hover over left and it says "'left' is not defined" function SortDownloadPhysicians(){ var sortDirection = getSortDirection() var sortByParam = getSortByParam() if(sortByParam === "name"){ if(sortDirection === "ascending"){ self.physicians().sort(function (left, right) { return left.name == right.name ? 0 : (left.name < right.name ? -1 : 1) }); }else{ self.physicians().sort(function (left, right) { return left.name == right.name ? 0 : (left.name > right.name ? -1 : 1) }); } } else{ //date of birth if(sortDirection === "ascending"){ self.physicians().sort(function (left, right) { return left.dateOfBirth == right.dateOfBirth ? 0 : (left.dateOfBirth < right.dateOfBirth ? -1 : 1) }); }else{ self.physicians().sort(function (left, right) { return left.dateOfBirth == right.dateOfBirth ? 0 : (left.dateOfBirth > right.dateOfBirth ? -1 : 1) }); } } Here's my sort function function sortDownloadPage() { var sortDirection = getSortDirection(); var sortBy = getSortBy(); // sort by name if (sortDirection === "ascending") { self.physicians().sort(function (a, b) { if (a.name().toLowerCase() > b.name().toLowerCase()) { return 1; } if (a.name().toLowerCase() < b.name().toLowerCase()) { return -1; } // a must be equal to b return 0; }); } else { self.physicians().sort(function (a, b) { if (a.name().toLowerCase() < b.name().toLowerCase()) { return 1; } if (a.name().toLowerCase() > b.name().toLowerCase()) { return -1; } // a must be equal to b return 0; }); } }; and here's part of the view model var ViewModels = ViewModels || {}; (function (ViewModels) { var DownloadVM = function (options) { options = $.extend({ physicians: ko.utils.unwrapObservable(options.physicians || []) }, options);…
has answer: http://stackoverflow.com/a/26979653
answer count: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42502912
has title: Sort Knockout Observable Array
score: 2
downvote count: 0
tagged with: knockout.js

http://stackoverflow.com/comment/42418455
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26936968
has text: it shouldn't it should send you to the new url

http://stackoverflow.com/q/26845287
linked to: http://stackoverflow.com/q/14128960
favorite count: 0
upvote count: 0
linked to: http://stackoverflow.com/q/13409944
has answer: http://stackoverflow.com/a/26845336
has body: I have a div with an img tag. This img tag should display the visitors country flag. However, im getting no progress in trying to find a solution. A first thought was maybe those things are possible via server side and php, but then I again there must be a simple jquery method. I am not asking anyone to code a solution! I just want to know what methods are there for simple tasks like mine? I also tried to look for libraries that do that without the so called "JSON".
score: -4
accepted answer: http://stackoverflow.com/a/26845336
possible better answer: http://stackoverflow.com/a/26845350
duplicate of: http://stackoverflow.com/q/4179000
tagged with: php
downvote count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26845393
has title: Is it possible to change an img depending on the users location?
type: Question
linked to: http://stackoverflow.com/q/4179000
has answer: http://stackoverflow.com/a/26845350
tagged with: javascript
linked to: http://stackoverflow.com/q/19768023
tagged with: jquery
answer count: 3
has comment: http://stackoverflow.com/comment/42253607

http://stackoverflow.com/q/26853173
has title: Why is my date input field in AngularJS throwing type error?
has answer: http://stackoverflow.com/a/29830783
has comment: http://stackoverflow.com/comment/42268940
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42272920
favorite count: 0
upvote count: 9
tagged with: angularjs
answer count: 5
has body: The error occurs when I display the populated, editable form to the user (not when a user enters in data and submits). The data is coming from MySQL over REST/JSON in the service shown below: HTML: &lt;input class="form-control" type="date" name="dateInput" id="dateOfBirth" ng-model="user.dateOfBirth"&gt; CCONTROLLER: .controller('EditCtrl', function ($scope, $routeParams, UserDetail, $window) { $scope.user = UserDetail.find({}, {'id': $routeParams.id}); } SERVICE: service.factory('UserDetail', function ($resource) { return $resource( 'http://localhost:8080/ClearsoftDemoBackend/webresources/clearsoft.demo.users/:id', {id: '@id'}, { find: {method: 'GET'}, }); }); ERROR: Error: [ngModel:datefmt] Expected 2010-05-13T00:00:00-04:00 to be a date
has answer: http://stackoverflow.com/a/36914208
has answer: http://stackoverflow.com/a/33893345
has answer: http://stackoverflow.com/a/35117961
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26853246
downvote count: 0
type: Question
possible better answer: http://stackoverflow.com/a/29830783
score: 9
has answer: http://stackoverflow.com/a/26853246

http://stackoverflow.com/q/26964498
tagged with: javascript
has answer: http://stackoverflow.com/a/26968301
type: AnsweredQuestion
has body: I am newbie to javascript ,Help me to display image and description in list view on html page get from the json object .. Here i am parsed a json object and retrieved image URL and image description. Now I have to display the Image and Description in listview on html page. But I am Not getting How..Plese help me to solve this.. Here is My HTML Page: submit My js file is: function searchAPI(){ var searchText= $("#search1").val(); alert(searchText); $.getJSON('http://api.duckduckgo.com/?q=ashok&format=json&pretty=1&callback=?',function(data){ for (var i = 0; i < data.RelatedTopics.length;i++) { var desc= data.RelatedTopics[i].Text; var url= data.RelatedTopics[i].Icon.URL; } }); } Please help me How to display this Image and Description in list view like this
tagged with: http://stackoverflow.com/tag/html
score: 1
favorite count: 0
tagged with: parsing
type: Question
accepted answer: http://stackoverflow.com/a/26968301
upvote count: 1
answer count: 1
tagged with: css
has title: Displaying Images and Description in listview on html page from JSON object
downvote count: 0

http://stackoverflow.com/a/26982107
answers question: http://stackoverflow.com/q/26981817
score: 0
type: Answer
has body: while(true) drawLine(); is an infinite loop, which will crash your browser as the delayed drawings pileup. Try limiting the number like so : var i = 10; while(i--) drawLine();. Note, since computers are fast, all the lines will be drawn at pretty much the same time - i.e. 1.5 seconds after running your script. If you want to have them drawn in sequence, try setting timeouts, with increasing delays.

http://stackoverflow.com/a/26876507
has comment: http://stackoverflow.com/comment/42310549
has comment: http://stackoverflow.com/comment/42310630
type: Answer
answers question: http://stackoverflow.com/q/26876447
accepted answer of: http://stackoverflow.com/q/26876447
has body: Besides changing your salesTotal variable to zero, you need to update the display representation accordingly. You could easily add this: function removecart() { salesTotal = 0; var table = document.getElementById("shoppingCart"); for(var i = table.rows.length - 1; i > -1; i--){ table.deleteRow(i); } document.getElementById('total').innerHTML = "Sale Price: $" + salesTotal.toFixed(2); } But you could also implement another function to automate this functionality and avoid writing repeatidly the same code within your js: function changeTotal(newTotal){ salesTotal = newTotal; document.getElementById('total').innerHTML = "Sale Price: $" + salesTotal.toFixed(2); }
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/26922500
tagged with: javascript
has title: FormData empty when constructing with element
has body: Trying to construct a new FormData object to send as part of an AJAX request, however constructing the object with a jQuery selected object remains empty. Am I doing something wrong?
upvote count: 1
answer count: 1
tagged with: multipartform-data
tagged with: jquery
linked to: http://stackoverflow.com/q/7752188
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/26922739
accepted answer: http://stackoverflow.com/a/26922739
tagged with: xmlhttprequest
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question

http://stackoverflow.com/comment/42431152
score: 0
type: AnswerComment
has text: How should I used it in my code? Could you put in your answer an example combined with my code please
type: Comment
comment on: http://stackoverflow.com/a/26935399

http://stackoverflow.com/q/26942950
tagged with: javascript
tagged with: linq
score: 0
has comment: http://stackoverflow.com/comment/42446525
has title: How to properly compare UTC dates against Local date in LINQ to Enitites?
has body: I am having trouble getting data on a specified date using LINQ. My dates are stored as UTC in the SQL database (DateTime.UtcNow). I want to get all records for a date I or a user specifies on the browser (from a datepicker). I am based in Australia and my database and site is hosted in another timezone and having trouble getting the results correctly. I have tried using timezoneOffset from JavaScript and passing it to my controller to try converting UTC with the below code but still gives me incorrect results: myRepo.Where(x =&gt; x.Date.AddMinutes(-(timezoneOffset)).Date == date.Date) I've been scratching my head for almost 2 days already and haven't found a clear and proper solution online. Help! :)
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42430043
has comment: http://stackoverflow.com/comment/42446004
has comment: http://stackoverflow.com/comment/42429812
tagged with: date
type: Question
tagged with: c#
tagged with: asp.net-mvc

http://stackoverflow.com/q/26951788
linked to: http://stackoverflow.com/q/4959975
has comment: http://stackoverflow.com/comment/42444612
has answer: http://stackoverflow.com/a/26952049
has comment: http://stackoverflow.com/comment/42444704
has answer: http://stackoverflow.com/a/26952072
has comment: http://stackoverflow.com/comment/42444670
accepted answer: http://stackoverflow.com/a/26952072
answer count: 4
has answer: http://stackoverflow.com/a/26952003
linked to: http://stackoverflow.com/q/3768606
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42444400
has title: Switching images to different images in Javascript
has body: I am in college right now and I am learning Javascript. I have a lab that requires I display three coloured buttons on the screen that are completely random in order. Now when these buttons are all green, all red, or all blue, you get a bonus to how many points you get. The code below is what I have so far, but right now I want to explain my thinking process and maybe get some help from you guys to help me better my thinking process. So basically below I start with 3 button variables. These turn out to be completely useless for me I found out. I thought I could do more complicated if statements with them, but couldn't quite figure it out. So I make a function called randomButton. Then I use a variable called randomNumberOne and set it equal to the Math.ceil and make it so the numbers go from 1 -3. Then I write an if statement saying if the number in that variable gets set as 1, display the red button, if 2 green, if 3 blue. Then I call the function 3 times because I want it to be displayed 3 times. Now what I want to do is make it so if there are 3 blues, reds, or greens in a row it will display something like "You get x10 points" or something like that. I just do not know how to go about doing that. Sorry if what I am typing doesn't make sense, I am still learning and I am eager to learn. Thanks for your time.
has answer: http://stackoverflow.com/a/26952185
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/42444981
possible better answer: http://stackoverflow.com/a/26952003
score: 0

http://stackoverflow.com/q/26910584
has body: I have a 'query builder' page (querybuilder.php) that allows users to build a SQL query and then execute it. All of this works fine. The parameters of the query are POSTED to another PHP page (queryresults.php) that runs a stored proc and then loops through the results to create a table that is inserted into querybuilder.php. The loop includes a checkbox on each row with the value set to the ID of each record being output. Queryresults.php (the innerHTML page) also has some dropdowns to allow the user to perform certain actions on the rows that have been 'checked'. I've made a loop outside the Javascript to execute it once for each successive checkbox. As I understand it - I cannot have script tags in the innerHTML page but I need to interact with the checkboxes that are only created, and assigned a value, when the innerHTML loads. I've looked at a few workarounds including the following: http://24ways.org/2005/have-your-dom-and-script-it-too but none seem to work. $checkboxes = isset($_POST['checkbox']) ? $_POST['checkbox'] : array(); foreach($checkboxes as $value) { echo " "; } The final HTML coming from the innerHTML page looks like this: echo " User 1 User 2 User 3 Submit '; echo $tableheaders; echo ' '; foreach($result as $row) { echo ' '.$row[0].' '; for ($x=1; $x<sizeof($row); $x++) { echo ' '.$row[$x].' '; } echo ' '; } echo ' '; echo ' '; To compound the problem, the element with id=user that the second variable comes from is set by another completely separate innerHTML, so I don't know how to reference that either. Real head-scratcher, I've googled extensively and trawled through StackExchange to no avail. Any help would be really appreciated! Thanks!
has answer: http://stackoverflow.com/a/26910824
has comment: http://stackoverflow.com/comment/42372406
has comment: http://stackoverflow.com/comment/42370819
has comment: http://stackoverflow.com/comment/42372383
tagged with: innerhtml
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/42370894
linked to: http://stackoverflow.com/q/12824549
has title: Executing script tags inside innerHTML to perform an Ajax call
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0

http://stackoverflow.com/q/26839710
favorite count: 0
has body: I need a way to serialize and unserialize dates that are potentially far away in the past, for instance -10000 I first look at ISO8601, but it does not seem to support years with more than four digits. (Or at least, python libraries I tried don't.) The different solutions I can think of: change the year before serializing/deserializing, give it to the parsing/formatting library, and fix it back (sounds hacky) define my own format, like year:month:day:hour:minute:second (that is reinventing the wheel, since I have to handle timezones, etc.) Use a UNIX timestamp without bounds or something equivalent (may overflow in some programming languages, and still the timezone stuff) Store dates before -9999 (or 0) differently than those after, since there was no timezone issue/leap years/… issue at that time. (two different formats at the same place) Do you see any other way that would be better than these ones? Or recommand one of those?
has answer: http://stackoverflow.com/a/26946808
score: 9
type: UnansweredQuestion
tagged with: datetime
tagged with: python
has comment: http://stackoverflow.com/comment/42257862
tagged with: php
has answer: http://stackoverflow.com/a/26848970
has comment: http://stackoverflow.com/comment/42244116
type: Question
upvote count: 9
has answer: http://stackoverflow.com/a/26840522
tagged with: javascript
has title: Storing dates with more-than-4-digits years
tagged with: date
answer count: 3
downvote count: 0

http://stackoverflow.com/q/26960187
accepted answer: http://stackoverflow.com/a/26974767
type: Question
has body: I'm trying to send the following object to my Web API Rest service using jQuery's $.ajax() method. When I make the call with out setting content type explicitly it sets it to application/x-www-form-urlencoded automatically, and the response is a 500. I need it to be application/json. When I set it to contentType: 'application/json' the request method in the header suddenly says OPTIONS in the dev tools and the request returns a 405. Does anyone see anything I'm doing wrong here? I normally never have trouble making requests like this. Here is the data object I'm sending. var TEST_DATA = { PaitentId: "323f0725-b404-4ab3-b227-e64b090ff62f", PracticeId: "2387B1BE-6CEC-41C1-B411-687BD6160556", ReportName: "SOME_REPORT_NAME", DeviceId: 1, GlucoseUnits: 1, HighGlucoseThreshold: 185, LowGlucoseThreshold: 80, TodayDate: "\/Date(1382932800000)\/", StartDate: "\/Date(1357016400000)\/", EndDate: "\/Date(1411876800000)\/" } Here is the call I'm making to the api var GenerateReport = function () { $.ajax({ type: 'POST', url: SERVICE_URL, processData: false, dataType: 'json', contentType: 'application/json', data: TEST_DATA, crossDomain: true, beforeSend: displaySpinner(), success: function (data) { successCallback(data); }, error: function () { errorCallback(); } }); } EDIT: This ended up being something I could fix through Web API, Answer provided below.
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26960322
has answer: http://stackoverflow.com/a/26974767
score: 0
answer count: 2
has title: jQuery $.ajax() method is not setting contentType correctly when using Web API
tagged with: web-services
possible better answer: http://stackoverflow.com/a/26960322
type: AnsweredQuestion

http://stackoverflow.com/a/26939862
accepted answer of: http://stackoverflow.com/q/26937013
answers question: http://stackoverflow.com/q/26937013
type: Answer
has body: First, as the others have said the variable 'table' is not set. Second, when you call var table = $('#datatable2').dataTable({.....}) You are returning a jQuery object that won't have access to any of the DataTables API To get a DataTables API instance you need to make a call like this: var table = $('#datatable2').DataTable({....}); This should work, assuming that your data returned by your url is properly formed. Source: https://datatables.net/faqs/#api
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer

state
tag name: state
tags question: http://stackoverflow.com/q/26902417
type: Tag

http://stackoverflow.com/comment/42506219
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/26986590
has text: where are your codes ?
type: Comment

http://stackoverflow.com/a/26871708
type: AcceptedAnswer
score: 4
has comment: http://stackoverflow.com/comment/42322771
type: Answer
upvote count: 4
accepted answer of: http://stackoverflow.com/q/26869619
answers question: http://stackoverflow.com/q/26869619
has comment: http://stackoverflow.com/comment/42301820
downvote count: 0
has body: The problem here is with your trailing comma in the array of elements. Internet Explorer 7 is incorrectly interpreting a value to the right of the last comma. This makes the length n+1, thus causing jQuery to evaluate a null value on its last cycle: var elements = [ { 'name': 'manuscript_file' }, { 'name': 'non_published_material' }, &lt;-- ] You can see this confirmed by looping over two arrays; one with a trailing comma, and one without. Open http://jsfiddle.net/jonathansampson/mqntjbky/show/ in IE 7 for confirmation. (function () { var elements = [ { name: "Foo" }, { name: "Bar" } ]; var alternatives = [ { name: "Fizz" }, { name: "Buzz" }, ]; // This $.each will not throw an exception $.each( elements, function create ( i, element ) { try { $( "&lt;div&gt;&lt;/div&gt;" ).text( element.name ).appendTo( "body" ); } catch ( e ) { alert( "Top fail: " + e.message ) } }); // This $.each WILL throw an exception $.each( alternatives, function create ( i, element ) { try { $( "&lt;div&gt;&lt;/div&gt;" ).text( element.name ).appendTo( "body" ); } catch ( e ) { alert( "Bottom fail: " + e.message ) } }); }()); Note below that the "Top fail" message is never raised, as it is in the block looping the collection that lacks a trailing comma. The "bottom fail" message, however, is in the affected block, and thus is raised during iteration.

http://stackoverflow.com/comment/42440786
type: Comment
has text: so the answer to your question is in my answer up there. no dynamic content is allowed anymore. use fb.ui share now and only use the url as parameter.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26941400

forms
tags question: http://stackoverflow.com/q/26871709
tags question: http://stackoverflow.com/q/26851371
tags question: http://stackoverflow.com/q/26834361
tags question: http://stackoverflow.com/q/26922999
tags question: http://stackoverflow.com/q/26921674
tags question: http://stackoverflow.com/q/26860760
tags question: http://stackoverflow.com/q/26979565
tags question: http://stackoverflow.com/q/26867436
tags question: http://stackoverflow.com/q/26960608
tags question: http://stackoverflow.com/q/26838894
tags question: http://stackoverflow.com/q/26895466
tags question: http://stackoverflow.com/q/26959373
tags question: http://stackoverflow.com/q/26934620
tags question: http://stackoverflow.com/q/26913938
tags question: http://stackoverflow.com/q/26969562
tags question: http://stackoverflow.com/q/26896737
tags question: http://stackoverflow.com/q/26978472
type: Tag
tags question: http://stackoverflow.com/q/26884928
tags question: http://stackoverflow.com/q/26892584
tags question: http://stackoverflow.com/q/26946617
tags question: http://stackoverflow.com/q/26923002
tags question: http://stackoverflow.com/q/26876625
tags question: http://stackoverflow.com/q/26877714
tags question: http://stackoverflow.com/q/26876135
tags question: http://stackoverflow.com/q/26897166
tags question: http://stackoverflow.com/q/26862190
tags question: http://stackoverflow.com/q/26977723
tags question: http://stackoverflow.com/q/26932082
tags question: http://stackoverflow.com/q/26905209
tags question: http://stackoverflow.com/q/26946990
tags question: http://stackoverflow.com/q/26875049
tags question: http://stackoverflow.com/q/26853385
tags question: http://stackoverflow.com/q/26964332
tags question: http://stackoverflow.com/q/26912652
tags question: http://stackoverflow.com/q/26966840
tags question: http://stackoverflow.com/q/26944613
tags question: http://stackoverflow.com/q/26941851
tags question: http://stackoverflow.com/q/26901358
tags question: http://stackoverflow.com/q/26970004
tags question: http://stackoverflow.com/q/26924830
tags question: http://stackoverflow.com/q/26900956
tags question: http://stackoverflow.com/q/26945701
tags question: http://stackoverflow.com/q/26860422
tags question: http://stackoverflow.com/q/26944424
tags question: http://stackoverflow.com/q/26872826
tags question: http://stackoverflow.com/q/26934138
tags question: http://stackoverflow.com/q/26981315
tags question: http://stackoverflow.com/q/26897615
tags question: http://stackoverflow.com/q/26836644
tags question: http://stackoverflow.com/q/26919487
tags question: http://stackoverflow.com/q/26855400
tags question: http://stackoverflow.com/q/26871211
tags question: http://stackoverflow.com/q/26976930
tags question: http://stackoverflow.com/q/26931755
tags question: http://stackoverflow.com/q/26976449
tags question: http://stackoverflow.com/q/26947837
tags question: http://stackoverflow.com/q/26985224
tags question: http://stackoverflow.com/q/26977941
tags question: http://stackoverflow.com/q/26953802
tags question: http://stackoverflow.com/q/26863246
tags question: http://stackoverflow.com/q/26949870
tags question: http://stackoverflow.com/q/26962873
tags question: http://stackoverflow.com/q/26991128
tags question: http://stackoverflow.com/q/26952224
tags question: http://stackoverflow.com/q/26849748
tags question: http://stackoverflow.com/q/26961835
tags question: http://stackoverflow.com/q/26877912
tags question: http://stackoverflow.com/q/26913931
tags question: http://stackoverflow.com/q/26913046
tag name: forms
tags question: http://stackoverflow.com/q/26934775
tags question: http://stackoverflow.com/q/26890285
tags question: http://stackoverflow.com/q/26962513
tags question: http://stackoverflow.com/q/26974884
tags question: http://stackoverflow.com/q/26869411
tags question: http://stackoverflow.com/q/26842780
tags question: http://stackoverflow.com/q/26950746
tags question: http://stackoverflow.com/q/26891590
tags question: http://stackoverflow.com/q/26836322

http://stackoverflow.com/comment/42434101
has text: Oh. That could maybe be made a little clearer. Do you already have a flash function? If so, could you post it please?
type: Comment
comment on: http://stackoverflow.com/a/26945784
score: 0
type: AnswerComment

http://stackoverflow.com/a/26874076
has body: /** * @param {string} str name to test * @return {boolean} true if str is valid */ function isValidName(str) { return /^[a-zA-Z][a-zA-Z0-9]{7,}$/.test(str) &amp;&amp; /\d/.test(str) } /^[a-zA-Z][a-zA-Z0-9]{7,}$/ tests that it starts with a letter, is at least 8 characters long, and all characters are letters or numbers. /\d/ tests that it contains at least 1 number. See MDN's RegExp documentation for reference in particular about the special characters and the x{n,} syntax described there. If you allow underscores too then you could use /^[a-zA-Z]\w{7,}$/ for the first test.
answers question: http://stackoverflow.com/q/26873729
downvote count: 0
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/comment/42381896
score: 0
has text: ok, I see now... But ask yourself, if in a few years from now, would you still be able to understand this *for loop*?
type: QuestionComment
comment on: http://stackoverflow.com/q/26916593
type: Comment

undefined
tags question: http://stackoverflow.com/q/26919737
tag name: undefined
tags question: http://stackoverflow.com/q/26961731
type: Tag
tags question: http://stackoverflow.com/q/26844248
tags question: http://stackoverflow.com/q/26899844
tags question: http://stackoverflow.com/q/26912096
tags question: http://stackoverflow.com/q/26904865
tags question: http://stackoverflow.com/q/26860189

http://stackoverflow.com/comment/42499187
comment on: http://stackoverflow.com/q/26982344
score: 0
has text: `String myJSON = Newtonsoft.Json.JsonConvert.SerializeObject(Products)` will give you the object serialized as JSON. You may need to **nuget** the NewtonSoft library but trust me it's worth it. You'll still need to add the `var products = ...` to the client-side script, but that's just a detail. If you Google `JsonConvert.SerializeObject` you'll see plenty of references, though the first few I checked weren't terribly readable.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42444116
has text: Extended question with a function `getVideo();`
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26945709
score: 0

http://stackoverflow.com/a/26905698
type: Answer
answers question: http://stackoverflow.com/q/26905573
score: 0
has body: if you are sure that there will only be one element then function test(jqobj) { var el = jqobj[0] }

http://stackoverflow.com/a/39519237
answers question: http://stackoverflow.com/q/26893952
score: 0
type: Answer
has body: In my case, the reason why it was undefined was because the timing was incorrect. Say you have a directive that shows a list of products: &lt;my-products products='httpLoadedProducts'&gt;/&lt;my-products&gt; And you define it like so: .directive('myProducts', function () { return { restrict: 'E', scope: { products: '=', }, templateUrl: 'directives/products-template.html', link: function (scope, element, attrs) { console.log(scope.products); } } }) If the list of products comes from an HTTP request, it is very likely that the directive will be instantatied before the products are loaded, therefore the console.log prints undefined. One solution is to instantiate the directive after the items are loaded. This will ensure that the link function runs after the items are loaded. So, either wrap the directive with an ng-if, like this: &lt;div ng-if='httpLoadedProducts'&gt; &lt;my-products products='httpLoadedProducts'&gt;/&lt;my-products&gt; &lt;/div&gt; Or use wbeange's answer to watch the model for changes.

http://stackoverflow.com/a/26871342
answers question: http://stackoverflow.com/q/26868129
accepted answer of: http://stackoverflow.com/q/26868129
type: AcceptedAnswer
has body: try this: $scope.submitted = true; if ($scope.contactForm.$valid) { $scope.submitted = false; $scope.user = {}; $scope.contactForm.$setPristine(); } The problem with your example is the checkError function is dependent on the submitted flag. If the form is valid, then you can clear the submitted flag to hide the errors.
type: Answer
score: 0

http://stackoverflow.com/a/26851185
score: 0
answers question: http://stackoverflow.com/q/26850517
has body: Have you tried removing the fixed pixel size of the images in the HTML and replacing with CSS or changing the 1280px value to 100% as such: &lt;div class="header"&gt; &lt;div class="headerleft"&gt;&lt;img src="images/rick.png" width="100%" height="200" id="rick" alt="rick" align="middle"&gt;&lt;/div&gt; &lt;div class="headerright"&gt;&lt;img src="images/peter.png" width="100%" height="200" id="peter" alt="peter" align="right"&gt;&lt;/div&gt; &lt;/div&gt; Not sure if that's the desired effect you're after but worth a shot perhaps?
type: Answer

http://stackoverflow.com/q/26856318
has title: Javascript: how to dynamically create nested objects INCLUDING ARRAYS using object names given by an array
has comment: http://stackoverflow.com/comment/42274705
tagged with: arrays
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/42274801
favorite count: 0
linked to: http://stackoverflow.com/q/5484673
answer count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/42274748
score: 1
has body: Very similar to this question: Javascript: how to dynamically create nested objects using object names given by an array Instead of calling assign(obj, keyPath, value) example of usage of the previously answer: var accountinfo = {} assign(accountinfo, ["name", "addressinfo", "zipcode"], "90210"); That will output: accountinfo = {name: "", addressinfo: {zipcode:"90210"}}; Now, I'd like to support arrays... in the above example, I'd like to support multiple addressinfo per account. I'd like to say: assign(accountinfo, ["name", "addressinfo[1]", "zipcode"], "90210"); The result would be: accountinfo = {name: "", addressinfo: [{},{zipcode:"90210"}]} var regex = /\[([0-9]+)\]/ will show me the # inside the brackets, but I'm not sure how I'd have to iterate through each element in the array to make sure it exists (and create it if it doesn't).. and the difficult part, support this for each array element submitted as part of the function (I'd like to say : assign(accountinfo, ["family", "name[3]", "addressinfo[1]", "zipcode"], "90210"); Edit: Figured it out. function assign(obj, keyPath, value) { keyPath = keyPath.split(‘.’); lastKeyIndex = keyPath.length - 1; var re = /^(.+?)\[*(\d+)*\]*$/; for (var i = 0; i &lt; lastKeyIndex; i++) { key = keyPath[i]; var ind; var middle = re.exec(key); key = middle[1]; ind = middle[2]; if (ind) { if (!(obj[key])) obj[key] = []; if (!(obj[key][ind])) obj[key][ind] = {}; } if (!(key in obj)) obj[key] = {}; if (ind) obj = obj[key][ind]; else obj = obj[key]; } obj[keyPath[lastKeyIndex]] = value; }
type: Question

http://stackoverflow.com/comment/42446897
has text: YES!!! THANK YOU!! It works like a charm. Oh and the id's were sorta wrong because I was experimenting. Must've copy pasted the wrong version haha.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26947742

http://stackoverflow.com/q/26976930
has comment: http://stackoverflow.com/comment/42493767
tagged with: http://stackoverflow.com/tag/html
has title: How can I zoom out after input is entered on mobile devices?
favorite count: 0
has comment: http://stackoverflow.com/comment/102994333
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42492701
tagged with: responsive-design
answer count: 0
has comment: http://stackoverflow.com/comment/42491087
has body: When a user focuses on a text input, mobile browsers zoom in for convenience. This is good. But on a single page app, you don't refresh the page upon the form being submitted, so the viewport doesn't return to its non-zoomed state. This makes it difficult for the user to get their bearings again, or navigate as they did before. It is possible for them to double tap, to return the viewport to normal, but many of our users wouldn't know to do that. I believe I am asking the same thing as the following questions, none of which provide a reliable answer. I would strongly prefer not to have to include another JS library. Mobile-friendly web design: How to programmatically zoom out after text input? Mobile Viewport zoom back
tagged with: forms
linked to: http://stackoverflow.com/q/18696251
type: Question
tagged with: mobile
downvote count: 0
tagged with: javascript
score: 4
upvote count: 4
linked to: http://stackoverflow.com/q/20057256

http://stackoverflow.com/comment/42315941
type: Comment
score: 0
comment on: http://stackoverflow.com/a/26879405
type: AnswerComment
has text: Just change the src attribute of the iframe on individual button click.

http://stackoverflow.com/q/26864398
tagged with: drop-down-menu
accepted answer: http://stackoverflow.com/a/26954662
tagged with: angularjs
has comment: http://stackoverflow.com/comment/42291422
linked to: http://stackoverflow.com/q/14410993
type: Question
has body: I am trying to implement an advance filtering options in my ngGrid. I came across idea of Filtering in Ignite UI grid and found it very nice. I am trying to replicate it in AngularJS. The problem can be divided in 4 parts a) Adding dropdowns dynamically b) Selecting options in second dropdown based on first dropdown selection c) Giving numberField or textField or dateField as 3rd entry d) Search By following the approach mentioned in this question, i am able to add dropdowns dynamically and reading values from them, but i am stuck at b and c part of the question. I am new to angular JS, can anybody suggest some idea how can i achieve it? For part b, i am thinking of applying filters in ng-repeat, but i am not getting how can i relate the selection in first dropdown to second and for part c, i think of showing or hiding the input fields depending on selection. For adding dropdown dynamically, there can be other approach, which might help me in solving the other parts. For now, i am exactly following same approach mentioned in the answer
answer count: 1
score: 0
has title: Adding dropdowns dynamically and based on selection in one dropdown select options in other
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26954662
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/23100229

http://stackoverflow.com/comment/42238207
comment on: http://stackoverflow.com/q/26836146
has text: As first element we can take first item, then based on that item we can sort next items. As i explained above if first item is id=279, then nearest one for that will be the second item which is id=13, then third item should be nearest to id=13.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42241506
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/26838141
has text: Still not working :( I updated it - line 278 - http://concepttest.concept9.ca/ - maybe it's related to the CSS elements?:s
score: 0

http://stackoverflow.com/q/26955234
upvote count: 0
answer count: 1
has body: I'm looking for a way to graph this kind of chart. I was trying to do it manually with HTML tables and PHP loops, but the up-and-down nature of the plots makes it seemingly impossible that way. I've tried searching Google for Javascript charting, but not knowing the name I haven't had any success. X-axis is time (hours in a day, broken down as small as possible) and Y-axis is the state. I have 4 in this example, but I could have a variable number in the system.
tagged with: jquery
favorite count: 0
has title: Graphs: jQuery - What kind of graph is this? State/status-vs-time
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
downvote count: 1
type: Question
tagged with: graph
has answer: http://stackoverflow.com/a/26955442
tagged with: javascript
score: -1

http://stackoverflow.com/comment/42285104
type: Comment
has text: http://pastebin.com/6JnWgwXi
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26861888

http://stackoverflow.com/comment/42429952
type: AnswerComment
score: 0
has text: Object1 = {connectorIndex: 1, nodeID: 6, Connectors: Object} Object2 = {connectorIndex: 1, nodeID: 6, Connectors: Object}Object3 = {connectorIndex: 1, nodeID: 6, Connectors: Object} Object4 = {connectorIndex: 1, nodeID: 6, Connectors: Object}
type: Comment
comment on: http://stackoverflow.com/a/26943285

http://stackoverflow.com/a/26891909
accepted answer of: http://stackoverflow.com/q/26880887
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: The solution was deleting the comments collection from mongodb. Starting fresh it works as expected. If anyone runs into a similar problem try deleting the collection of objects that were created before you had added a ref to the model.
answers question: http://stackoverflow.com/q/26880887
score: 2
upvote count: 2

http://stackoverflow.com/q/26846580
has answer: http://stackoverflow.com/a/26846609
type: Question
has body: "Uncaught ReferenceError: jquery is not defined" I'm trying to setup a page scroll-down here's the jquery: Here's the menu: Home Services Features Team Plans Contact thanks in advance for your help
tagged with: javascript
tagged with: jquery
has title: "Uncaught ReferenceError: jquery is not defined" - scroll down menu
has comment: http://stackoverflow.com/comment/42256122
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/6677035
has answer: http://stackoverflow.com/a/26846632
type: UnansweredQuestion

http://stackoverflow.com/comment/42335695
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26890433
has text: Thank you for your assistance! I am always trying to learn more. :)
type: AnswerComment

http://stackoverflow.com/q/26918892
has answer: http://stackoverflow.com/a/26918994
tagged with: jquery
favorite count: 0
tagged with: twitter-bootstrap
type: AnsweredQuestion
has body: I would like to fadeIn a panel form that I've made in Bootstrap 3. I've tried different methods but I cannot figure it out. Here is the JSFiddle. This is my fade function: $( document ).ready(function() { $( ".anim" ).fadeIn( "slow" ); });
score: 1
accepted answer: http://stackoverflow.com/a/26918994
upvote count: 1
has answer: http://stackoverflow.com/a/26919031
type: Question
has title: fadeIn panel using Bootstrap
possible better answer: http://stackoverflow.com/a/26918937
has answer: http://stackoverflow.com/a/26918937
tagged with: javascript
answer count: 3
downvote count: 0

http://stackoverflow.com/comment/42458313
type: Comment
has text: There is no error message. Also, the CSS is called 'main' not 'ads', sorry. Current. `if (e.advertisements !='show') { var customStyles = document.createElement('style'); customStyles.appendChild(document.createTextNode('#RightRailContainer {display: none !important;} .WithRightRail {right: 0 !important;}')); document.documentElement.insertBefore(customStyles);` New. `if (e.advertisements !='show') { var file=document.createElement("link"); file.setAttribute("rel", "stylesheet"); file.setAttribute("type", "text/css"); file.setAttribute("href", "main.css");`
comment on: http://stackoverflow.com/a/26959475
type: AnswerComment
score: 0

http://stackoverflow.com/q/26861417
score: 4
upvote count: 4
has body: In my model definition, I have: appFeatures: [{ name: String, param : [{ name : String, value : String }] }] I want to set default value to appFeatures, for example: name: 'feature', param: [{name:'param1',value:'1'},{name:'param2',value:'2'}] I tried to do it by appFeatures : { type : Array , "default" : ... } But its not working, any ideas? Thanks
has answer: http://stackoverflow.com/a/26861697
answer count: 1
downvote count: 0
tagged with: mongoose
favorite count: 0
type: UnansweredQuestion
tagged with: node.js
tagged with: mongodb-query
type: Question
tagged with: mongodb
tagged with: javascript
has title: set default values to mongoose arrays in node js

http://stackoverflow.com/comment/42468383
has text: Thanks a lot, thats the solution!
comment on: http://stackoverflow.com/a/26965096
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42322500
comment on: http://stackoverflow.com/q/26883314
score: 0
type: Comment
type: QuestionComment
has text: it may not. But my scenario is like a eCommerce site. Where user adds his product to cart. he can remove that product in cart but when he progress to payment or confirmation page there he should not be able to click back or close or reload. if this happens the data which is added to cart need to be changed back in db and i thought java script will be the best for this.if u guys know some other way to do please provide some light.

datetime
tags question: http://stackoverflow.com/q/26856893
tags question: http://stackoverflow.com/q/26973022
tags question: http://stackoverflow.com/q/26911537
tags question: http://stackoverflow.com/q/26907288
tags question: http://stackoverflow.com/q/26919425
tags question: http://stackoverflow.com/q/26839710
tags question: http://stackoverflow.com/q/26925187
tags question: http://stackoverflow.com/q/26907454
tag name: datetime
tags question: http://stackoverflow.com/q/26879127
type: Tag
tags question: http://stackoverflow.com/q/26877782
tags question: http://stackoverflow.com/q/26982420
tags question: http://stackoverflow.com/q/26850727
tags question: http://stackoverflow.com/q/26877859

http://stackoverflow.com/a/51624215
has body: document.write("Welcome to our visitors from "+geoplugin_countryName());
downvote count: 0
type: Answer
score: 1
answers question: http://stackoverflow.com/q/26987953
upvote count: 1

http://stackoverflow.com/comment/42491706
score: 0
comment on: http://stackoverflow.com/a/26938540
type: AnswerComment
type: Comment
has text: Well that would explain things... you need to have this function execute in the callback after you get/parse your JSON.

http://stackoverflow.com/comment/42247598
comment on: http://stackoverflow.com/a/26841394
has text: you should check somewhere in you page load or other events.may be you are assign `null` to you `session "strDwnPath" in your other events.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/26896597
has comment: http://stackoverflow.com/comment/42346614
has comment: http://stackoverflow.com/comment/42382484
tagged with: javascript
linked to: http://stackoverflow.com/q/218181
has comment: http://stackoverflow.com/comment/42380078
score: 0
answer count: 1
tagged with: vba
has comment: http://stackoverflow.com/comment/42379248
type: UnansweredQuestion
has title: XMLHttpRequest How to know what setRequestHeader to send?
tagged with: xmlhttprequest
has answer: http://stackoverflow.com/a/26896673
has body: I just started using MSXML2.XMLHTTP object with VBA and I'm trying to interact with our Content Server (create, move, copy, delete files). I found some random working code on the internet but I still do not fully understand what is going on. Set req As New MSXML2.XMLHTTP req.Open "MKCOL", "https://company/dav/nodes/" & URIsource & "/" & Encoded_FolderName, False req.SetRequestHeader "Content-Type", "text/xml" req.Send URIsource is an objID from the server (ie : 12345678) Encoded_Foldername is the folder name passed into this a function called URLEncode found here From the OpenText website I tought I was supposed to put : req.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded" But it doesn't work with my code. I must use the previous one. I also have a function to copy a file and it uses : req.setRequestHeader "Destination", strDestURL How am I supposed to know what Requestheader to use? Is there a list somewhere for post, put, get, etc. ? I understood that "Content-Type" is used to make sure the server understands the request but that's it. Thank you
type: Question

http://stackoverflow.com/a/26982388
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26982272
score: 0
has body: I hope I understood correctly. $.get('http://www.roblox.com/', function (dataz) { $(dataz).find('.member-name-container a').each(function () { var ga = $(this).attr('title'); console.log(ga); $.get('http://rproxy.tk/rapi/GetIdByUsername/' + ga, function (data) { console.log(data); }); }); });
accepted answer of: http://stackoverflow.com/q/26982272
type: Answer

http://stackoverflow.com/comment/42350036
type: QuestionComment
type: Comment
has text: Look at the `number` production at http://www.json.org/
comment on: http://stackoverflow.com/q/26898431
score: 3

http://stackoverflow.com/comment/42316069
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26849187
has text: @RRajeshwar ok i already i got solution for that, but my problem is i need to get milliseconds as a random for ex: var countdownTimer = setInterval('generate()', 1000); here we will give 1000 milliseconds instead of this i have to give random which means automatically it will take some random milliseconds 100 milliseconds for one number and it will 150 milliseconds for another number so let me know if you know
score: 0

http://stackoverflow.com/comment/42401867
comment on: http://stackoverflow.com/a/26927879
type: Comment
has text: you need to make the asp hidden control ClientIdMode to static to let js get its id
type: AnswerComment
score: 0

http://stackoverflow.com/comment/42447036
has text: I get `0x1.7ffffffffffff1172efp+3` for `pow(1728, 1.0/3.0)`, which rounds as njuffa described. Neato.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26951407

http://stackoverflow.com/comment/42409462
comment on: http://stackoverflow.com/a/26932284
score: 0
type: AnswerComment
type: Comment
has text: Yes it is. But there should be a function that will animate the overlay of the new page?

http://stackoverflow.com/q/26834675
has answer: http://stackoverflow.com/a/26836478
has comment: http://stackoverflow.com/comment/42238106
accepted answer: http://stackoverflow.com/a/26837155
possible better answer: http://stackoverflow.com/a/26836478
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42235407
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/42236253
tagged with: javascript
has comment: http://stackoverflow.com/comment/42237333
tagged with: jquery
has comment: http://stackoverflow.com/comment/42238846
has comment: http://stackoverflow.com/comment/42237070
score: 0
has title: Passing "this" to a function in jQuery problems
has comment: http://stackoverflow.com/comment/42237173
has comment: http://stackoverflow.com/comment/42237630
has body: sorry but couldn't find a solution for my problem so far. I am writing a kind of an email template editor as a little task for my boss. $('a, span').click(function(event){ var editableElement = $(this); if($(this).is('a')){ event.preventDefault(); } if(editableElement.is('span')){ processType(editableElement, 'simpleText', modalContent) When I send the 'editableElement' variable first time, everything's fine, sends object to my function, where I open up a modal window, where there is a textarea, which if i enter text and submit it using only jQuery it will put the text from the textarea (using .val()) to my desired element, in this case a "span" element which is the 'editableElement' using .text() on it. No problem, it works for the first time. After I try to edit a second span, it constantly modifies the previous span too, with whatever I enter in to the textarea (which is cleared out completely, the problem is NOT here) I've ran a fast debug with a simple foreach on the editable element, and the problem is that for some reason it keeps adding objects to the editableElement variable everytime I send it to the function. The number of spans I try to edit, the number of objects will be in my variable all with the index of 0. Any idea what could be the cause of this? Thanks in advance! EDIT: As requested the whole code in one piece which I have problem with, though it was the whole code before too, I'm in an early stage of writing it, I understand that it was hard to read though, perhaps now it is properly formatted as requested. $(window).load(function() { var modalContent = $('#modalContent'); modalOverlay = $('#modalOverlay'); $('a, span').click(function(event) { var editableElement = $(this); if($(this).is('a')) { event.preventDefault(); } if(editableElement.is('span')) { processType(editableElement, 'simpleText', modalContent) } }); $('#codeGenButton').click(function() { var container = $('#codeContainer'); container.empty(); container.text(getPageHTML()); }); $('…
has answer: http://stackoverflow.com/a/26837155

http://stackoverflow.com/q/26926921
accepted answer: http://stackoverflow.com/a/26927201
type: Question
tagged with: http://stackoverflow.com/tag/html
upvote count: 1
has body: I want to get the class name of divs. It works in Chrome, but I have problems with IE5. If I click on an div element, than it returns undefined. HTML: Div Element JavaScript: var x = document.getElementsByTagName("DIV"); for (var i=0; i<x.length; i++) { if (x[i].addEventListener) { x[i].addEventListener('click', redirect, false); } else if (x[i].attachEvent) { x[i].attachEvent('on' + 'click', redirect); } } function redirect() { alert(this.className); } the solution is : function redirect(e){ var elem, evt = e ? e : event; if (evt.srcElement) elem = evt.srcElement; else if (evt.target) elem = evt.target; alert('' + 'You clicked the following HTML element: \n <' + elem.getAttribute('className').toUpperCase() + '>' ) return true; } Thanks for all replies
answer count: 1
has answer: http://stackoverflow.com/a/26927201
tagged with: javascript
tagged with: dom
has title: Get class name of divs on click
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0

http://stackoverflow.com/q/26933468
type: Question
tagged with: parsing
has title: Parsing JSON to get values in array inside a object in javascript
score: 0
has body: I am newbie to JSON and Javascript So,help me to find the array values in an object in JSON.Here I hava a JSON Object like this { "DefinitionSource": "", "ImageWidth": 0, "RelatedTopics": [ { "Result": "Ashok ShindeAn Indian film and stage actor, who works in Marathi cinema, known for films like Rangat Sangat.", "Icon": { "URL": "", "Height": "", "Width": "" }, "FirstURL": "https://duckduckgo.com/Ashok_Shinde", "Text": "Ashok ShindeAn Indian film and stage actor, who works in Marathi cinema, known for films like Rangat Sangat." }, { "Result": "R. AshokR. Ashok is a leader of the Bharatiya Janata Party in Karnataka, India.", "Icon": { "URL": "", "Height": "", "Width": "" }, "FirstURL": "https://duckduckgo.com/R._Ashok", "Text": "R. AshokR. Ashok is a leader of the Bharatiya Janata Party in Karnataka, India." }, { "Result": "Ashok (film)", "Icon": { "URL": "https://duckduckgo.com/i/37704bcf.jpg", "Height": "", "Width": "" }, "FirstURL": "https://duckduckgo.com/Ashok_(film)", "Text": "Ashok (film)A 2006 Telugu film directed by Surender Reddy." } ], "Entity": "", "Results": [], "Answer": "" } In this JSON i want to get "URL" inside the ICON object and "TEXT" from each object inside "RelatedTopics".. But i was unable to find how. Please help to Get out of this problem. Thanks in advance
answer count: 2
has answer: http://stackoverflow.com/a/26933509
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/26933509
type: AnsweredQuestion
tagged with: arrays
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26933566
has answer: http://stackoverflow.com/a/26933566

http://stackoverflow.com/comment/42466540
has text: Could use `x < 5` if starts from `x = 0`. ;-)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26964363
type: AnswerComment

http://stackoverflow.com/q/26876168
accepted answer: http://stackoverflow.com/a/26878269
tagged with: javascript
has comment: http://stackoverflow.com/comment/42313293
score: 0
has comment: http://stackoverflow.com/comment/42313330
tagged with: angularjs
has comment: http://stackoverflow.com/comment/42310785
has comment: http://stackoverflow.com/comment/42310905
has answer: http://stackoverflow.com/a/26878269
has body: I've just noticed that Safari on iOS keeps stale $http.get results in cache, that target my server (REST call). However, Safari claims a status 200 (not 304), even if result is stale... troubling I confirm that the issue comes from Safari since it's easy to check the real result through a rest call to the server. What I do to force Safari to refresh its cache is adding a random parameter: $http.get('myUrl?rnd=' + new Date().getTime()) Is there a better practice? Probably changing the response headers on the server directly? My server returns this response header: HTTP/1.1 200 OK Server: Cowboy Date: Tue, 11 Nov 2014 23:52:59 GMT Connection: keep-alive Content-Type: application/json; charset=utf-8 Content-Encoding: gzip Vary: Accept-Encoding Content-Length: 495 Via: 1.1 vegur
type: AnsweredQuestion
tagged with: mobile-safari
has title: Safari on iOS involving stale $http.get results
tagged with: http
type: Question
linked to: http://stackoverflow.com/q/49547
has comment: http://stackoverflow.com/comment/42310325
tagged with: ios
answer count: 1

http://stackoverflow.com/comment/42482967
score: 0
comment on: http://stackoverflow.com/q/26973521
has text: Because you are reading the html of the cell. It is doing exactly what you told. You need to access the form element in the cell. Look into `getElementsByTagName`
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42424977
comment on: http://stackoverflow.com/q/26940320
type: Comment
type: QuestionComment
has text: @adeneo Of course it's possible. AJAX.
score: 0

http://stackoverflow.com/comment/42274347
comment on: http://stackoverflow.com/q/26855002
type: Comment
score: 0
type: QuestionComment
has text: Or use a second class: `$(this).toggleClass('liked');` (this will add the `liked` class to the button. Followed by `sta: $(this).hasClass('liked') ? 'unlike' : 'like'`;. (So after the first time you clicked the like-button - when it wasn't liked yet - it looks like this: `class="like_button liked"`)

http://stackoverflow.com/a/26878166
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/26877427
type: Answer
has body: The jQuery selector $( ".cal" ).datepicker(); will only select the first instance of multiple classes of the same name. Take a look at .each() to reach all classes. Call this function on duplicateCalendar() along with the existing code: $(function() { $( ".cal" ).each(function() { $( this ).datepicker(); }); });
score: 2

http://stackoverflow.com/comment/42384403
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26916823
has text: ...ultimately your issue seems to be that you're running your test from within the `.ready()` callback, but you have some other code that's trying to use the code that relies on `LobbyMenuGames`. This may result in other issues. Make sure all code that relies on the DOM being ready doesn't run too soon.
score: 0

http://stackoverflow.com/comment/42450244
has text: @FelixKling Oh my god! Spot on. How is it possible that I have missed that?! Thanks a lot mate! :-)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26955191
score: 0

http://stackoverflow.com/q/26984210
score: 0
has comment: http://stackoverflow.com/comment/42502409
has comment: http://stackoverflow.com/comment/42502271
has answer: http://stackoverflow.com/a/26984280
has comment: http://stackoverflow.com/comment/42502406
has answer: http://stackoverflow.com/a/26984323
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42502507
answer count: 7
has answer: http://stackoverflow.com/a/26984427
has answer: http://stackoverflow.com/a/26984529
has answer: http://stackoverflow.com/a/26984293
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26984410
has body: Currently, I have a table and each row has bound a function at the click event. HTML: ...... Action View details Delete JS: $(document).on('click', ".clickable", function (e) { /*something*/ }); I read about e.stopPropagation() method but I need something dynamic because, for example, in the above example, the dropdown-menu is an external plugin that I can't manage. --- EDIT Is there a way to handle the click of the TR but not trigger on the child elements?
has comment: http://stackoverflow.com/comment/42502461
has comment: http://stackoverflow.com/comment/42502251
type: Question
has comment: http://stackoverflow.com/comment/42502253
has title: Clickable tr but not the child
has answer: http://stackoverflow.com/a/26984337
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/26899339
has comment: http://stackoverflow.com/comment/42351467
tagged with: javascript
has comment: http://stackoverflow.com/comment/42352054
tagged with: same-origin-policy
answer count: 2
has comment: http://stackoverflow.com/comment/42352149
has comment: http://stackoverflow.com/comment/42352033
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42352410
tagged with: http://stackoverflow.com/tag/html
has title: Communicate to window from iframe on cross-domain
has comment: http://stackoverflow.com/comment/42352183
score: 1
tagged with: iframe
upvote count: 1
has answer: http://stackoverflow.com/a/26899367
type: Question
has answer: http://stackoverflow.com/a/26899825
has comment: http://stackoverflow.com/comment/42351591
has body: Let's say I have have a webpage with domain name a.example.com which has an iframe with domain b.example.com (Not satisfying same origin policy). Now I open a new window using window.open from the iframe with the same domain, that is b.example.com. My task is to send message back to the iframe. window.opener is empty for the opened window. I read that I can communicate using postMessage, but to what element I should post the data to. How to get the reference of parent window (i.e the iframe).

http://stackoverflow.com/q/26853422
downvote count: 0
has answer: http://stackoverflow.com/a/26853881
has title: function definition in javascript. But what is the actual difference?
type: Question
has comment: http://stackoverflow.com/comment/42271201
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26853587
has comment: http://stackoverflow.com/comment/42269503
upvote count: 2
answer count: 2
has body: I am a java programmer with 15 years experience, but I am struggling to get my head around javascript. Below is an example and I am keen to understand the differences between the 2 definitions. Are these 2 definitions very different or would either be acceptable if I want to create object instances of Subject? var Subject1 = ( function( window, undefined ) { function Subject1() { this._list = []; } // this method will handle adding observers to the internal list Subject1.prototype.observe = function observeObject( obj ) { console.log( 'added new observer' ); this._list.push( obj ); }; Subject1.prototype.unobserve = function unobserveObject( obj ) { for( var i = 0, len = this._list.length; i &lt; len; i++ ) { if( this._list[ i ] === obj ) { this._list.splice( i, 1 ); console.log( 'removed existing observer' ); return true; } } return false; }; Subject1.prototype.notify = function notifyObservers() { var args = Array.prototype.slice.call( arguments, 0 ); for( var i = 0, len = this._list.length; i &lt; len; i++ ) { this._list[ i ].update.apply( null, args ); } }; return Subject1; } )( window ); //Subject2 example but based on the revealing module design pattern. function Subject2() { this._list = []; // this method will handle adding observers to the internal list function observeObject( obj ) { console.log( 'added new observer' ); this._list.push( obj ); } function unobserveObject( obj ) { for( var i = 0, len = this._list.length; i &lt; len; i++ ) { if( this._list[ i ] === obj ) { this._list.splice( i, 1 ); console.log( 'removed existing observer' ); return true; } } return false; } function notifyObservers() { var args = Array.prototype.slice.call( arguments, 0 ); for( var i = 0, len = this._list.length; i &lt; len; i++ ) { this._list[ i ].update.apply( null, args ); } } return { notifyObservers : notifyObservers, unobserveObject : unobserveObject, observeObject : observeObject } } So now we have the function definitions of Subject1 and Subject2 what are the material…
possible better answer: http://stackoverflow.com/a/26853881
has answer: http://stackoverflow.com/a/26853587
has comment: http://stackoverflow.com/comment/42269678
favorite count: 0
has comment: http://stackoverflow.com/comment/42269697
has comment: http://stackoverflow.com/comment/42269418
type: AnsweredQuestion
score: 2

http://stackoverflow.com/q/26961831
has body: just out of fun I made that little toy top (gyroscope?), using Javascript and Canvas. Unfortunately there's an ugly Moiré effect on it (see screenshot below). http://jsfiddle.net/8bac4s9v/1/ function draw() { var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); ctx.imageSmoothingEnabled = false; var colors = [ ['blue', 'yellow'], ['white', 'pink'], ['green', 'red'], ['white', 'black'], ['green', 'blue'], ['red', 'green', 'blue'] ]; for (var i = 0; i &lt; 12; i++) { for (var cIdx = 0, p = 0; p &lt; 120; p += 20, cIdx++) { var cols = colors[cIdx]; for (var r = p; r &lt; p + 20; r++) { ctx.beginPath(); ctx.arc(125, 125, r, (i - 1) * Math.PI / 6.0, i * Math.PI / 6.0); ctx.strokeStyle = cols[i % cols.length]; ctx.stroke(); } } } } I guess, that moiré effect comes from anti-aliasing. So I thought, I could get rid of that Moiré effect when I switch off anti-aliasing with ctx.imageSmoothingEnabled = false. But no, nothing changes. Any ideas? Thanks, Bernhard This is how it looks:
favorite count: 0
upvote count: 5
has answer: http://stackoverflow.com/a/26962111
accepted answer: http://stackoverflow.com/a/26962111
has answer: http://stackoverflow.com/a/26962011
downvote count: 0
possible better answer: http://stackoverflow.com/a/26962011
type: Question
type: AnsweredQuestion
has title: Javascript and Canvas: How to get rid of that Moiré effect in my gyroscope
answer count: 2
score: 5
tagged with: canvas
tagged with: javascript

http://stackoverflow.com/a/26975238
type: AcceptedAnswer
downvote count: 0
has body: Seems like they're using the $ function for something else. Try: jQuery('#mobile-nav-container').hide();
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/26975167
score: 2
has comment: http://stackoverflow.com/comment/42486173
answers question: http://stackoverflow.com/q/26975167
has comment: http://stackoverflow.com/comment/42486982

http://stackoverflow.com/a/26892083
type: Answer
upvote count: 4
score: 4
downvote count: 0
answers question: http://stackoverflow.com/q/26875146
has body: It seems to me that all you are talking about is a plotLine label ? Reference: http://api.highcharts.com/highstock#xAxis.plotLines.label

http://stackoverflow.com/comment/42257728
score: 0
type: Comment
type: QuestionComment
has text: It doesn't answer your question but, did your first line is compiling ? Because usually you should use echo with `" "` to properly print some string, thing you did not do in your first line.
comment on: http://stackoverflow.com/q/26847360

http://stackoverflow.com/q/26972769
downvote count: 1
type: Question
tagged with: canvas
tagged with: javascript
tagged with: jquery
has body: I am creating multiple canvas objects through javascript. I have applied some inline style for like background color, background image, transforms like rotate, scale, object top, left etc etc. Example: function draw(image,flag) { image = image.get(0); can_cnt = $("#canvases").children('canvas').length; $("#canvases").append('&lt;canvas id="case_canvas'+can_cnt+'" data-type="image" width="301" height="501" align="center" style="position: absolute; left: 0px; top: 0px; border:0px solid transparent; z-index:-1; "&gt;&lt;/canvas&gt;'); var ctx = document.getElementById('case_canvas'+can_cnt).getContext('2d'); if(flag) { ctx.drawImage(image,0,0,image.height,image.width); } else { ctx.drawImage(image,startX,startY,200,200); } } By this method I am adding multiple canvases and applying styles on it as per requirements. Now, I want that all canvas objects in one image. I have tried multiple ways like $("#temp_canvas_div").html('&lt;canvas id="temp_canvas" width="301" height="501" align="center" &gt;'); can1 = document.getElementById('temp_canvas'); ctx1 = can1.getContext("2d"); $("#canvases canvas").each(function() { var coll = document.getElementById($(this).attr('ID')); var el = document.getElementById($(this).attr('ID')); var st = window.getComputedStyle(el, null); var tr = st.getPropertyValue("-webkit-transform") || st.getPropertyValue("-moz-transform") || st.getPropertyValue("-ms-transform") || st.getPropertyValue("-o-transform") || st.getPropertyValue("transform") || "FAIL"; // rotation matrix - http://en.wikipedia.org/wiki/Rotation_matrix var a = 0; var b = 0; if(tr != 'none') { var values = tr.split('(')[1].split(')')[0].split(','); var a = values[0]; var b = values[1]; var c = values[2]; var d = values[3]; } var scale = Math.sqrt(a*a + b*b) ? Math.sqrt(a*a + b*b) : 1; var h = (500 * scale) var w = (300 * scale) var x = parseInt((300 - w) / 2); var y = parseInt((500 - h) / 2); var sx = 0; var sy = 0; if(parseInt($("#"+$(this).attr('ID')).css('left')) != 0) { sx = x …
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: css
has title: How to print html5 canvases in which have inline style applied?
score: 1

http://stackoverflow.com/comment/42289475
type: Comment
has text: you cannot get it. you can download data from google and you can save into static JSON.
comment on: http://stackoverflow.com/a/26864782
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42460792
comment on: http://stackoverflow.com/q/26961142
type: Comment
has text: @Oriol You are right that one CAN do that. One could also do `num -= num < 5 ? num : 5` but for someone who just started to learn the language it isn't important right now. Let them learn the basics first.
type: QuestionComment
score: 0

http://stackoverflow.com/comment/42269380
type: Comment
comment on: http://stackoverflow.com/a/26852812
has text: Sorry, I forgot the break in my example.. completely ruined the efficacy of my examples.
score: 0
type: AnswerComment

http://stackoverflow.com/q/26867641
type: Question
score: 5
possible better answer: http://stackoverflow.com/a/57482891
tagged with: javascript
has answer: http://stackoverflow.com/a/57482891
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has body: I am working in SVG tags using javascript. I tried to get group tag &lt;g&gt; midpoint in svg. Is it possible to get mid point value of group tag using javascript? Here's my demo group tag &lt;g&gt; &lt;g id="object_7" transform="translate(573,703) scale(0.5,0.51)" style="pointer-events:inherit"&gt; &lt;path d="m-40,-19l3,-3l74,0l3,3l0,37l-3,3l-74,0l-3,-3l0,-37z" id="uid127" stroke-linejoin="round" stroke-linecap="round" fill="#1e1d19" stroke="#000000"/&gt; &lt;path d="m-9,21l4,2l10,0l4,-2" id="uid129" stroke-linejoin="round" stroke-linecap="round" fill-opacity="0" fill="none" stroke="#000"/&gt; &lt;path d="m-40,-19l3,-3l74,0l3,3l-77,40l-3,-3l0,-37z" id="uid131" stroke-linejoin="round" stroke-linecap="round" fill-opacity="0.12" fill="#000000"/&gt; &lt;/g&gt; Here I need to get midpoint point of group tag. I used to get mouse co-ordinates for getting center of x and y position in group tag, but I did not achieve it. Can anyone please guide me?
has answer: http://stackoverflow.com/a/26869016
favorite count: 0
accepted answer: http://stackoverflow.com/a/26869016
tagged with: http://stackoverflow.com/tag/svg
has title: How to get Mid point of <g> tag in svg using javascript
upvote count: 5
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/42401704
comment on: http://stackoverflow.com/q/26876441
score: 1
has text: For full working example, please take a look at this working fiddle http://jsfiddle.net/themyth92/u1ggxt1j/. There is also a problem about scope related things which solution can be found here : http://stackoverflow.com/questions/23474054/angularjs-datepicker-not-opening-twice-angular-ui-version-0-11-0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26909329
has body: What about :empty? if ($('h2').is(':empty')) {...}
score: 3
upvote count: 3
type: Answer
has comment: http://stackoverflow.com/comment/42368444
downvote count: 0
answers question: http://stackoverflow.com/q/26909300

http://stackoverflow.com/comment/42505696
type: Comment
comment on: http://stackoverflow.com/a/26985940
score: 0
type: AnswerComment
has text: @Anand That is not the input data you placed in your question. Google for parsing ISO8601 datetime strings in JavaScript, and if you still cannot figure it out, ask a new question on this site.

http://stackoverflow.com/a/26989335
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26988347
has body: Found a solution to the problem. After trying it in firefox I realised it was a cross-browser issue (as it worked). This led me to: Strange behavior of "overflow: auto" on Chrome which provides a solution.

http://stackoverflow.com/comment/42296261
comment on: http://stackoverflow.com/a/26868493
has text: try it of course in click event and its better to use (id) for created elements
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/42435990
type: QuestionComment
has text: Forget what I said, you can replace the return false with e.preventDefault() (and add (e) to the .submit(function(e) - but there is likey something else worng too. I for example would not have `if ($("#contactForm")[0]) {` - the event handler will be attached if there is a form and not if not
comment on: http://stackoverflow.com/q/26946769
score: 0
type: Comment

keystroke
type: Tag
tag name: keystroke
tags question: http://stackoverflow.com/q/26904438

http://stackoverflow.com/q/26890416
upvote count: 1
type: Question
tagged with: javascript
has body: I am grabing a rtmp stream video and recording a MP3 file in a server, using java (I can record it in my PC, as well). I need to load this file in Web Audio API, considering that is constantly being updated, and play it like real-time stream. So, I am reloading the file quite often as I need real-time stream. Theses are my options/problems: I try to load the file using &lt; audio > tag (which I have to load every second) (MediaElementAudioSourceNode), I can't play it because the file which I've store in the server is not seekable and when I use play(), I'm not able to play with a offset. I try to load the file server using buffers(XmlhRequest + decodeAudioData)(AudioBufferSource), AudioContext.decodeAudioData causes heap to grow without bound.
downvote count: 0
tagged with: web-audio-api
score: 1
has title: Reloading file often in Web Audio API
favorite count: 0
tagged with: heap-memory
type: UnansweredQuestion
answer count: 0

http://stackoverflow.com/comment/42310461
type: Comment
has text: Thanks for reply, in php what if the $response_message sometime is an array, can I define it before function like, $response_message = array(...); function select($response_message = $response_message') {
comment on: http://stackoverflow.com/a/26876510
score: 0
type: AnswerComment

http://stackoverflow.com/q/26991406
answer count: 2
has comment: http://stackoverflow.com/comment/42522284
has comment: http://stackoverflow.com/comment/42522895
tagged with: geoxml3
has body: OLD POST How can I use parse and parseKmlString together?? I need show a map loading one KML file (I use parse(<kml_file>)) and two XML string (I use parseKmlString(<xml_string>)). How I use useTheData in afterParse property?? I don't know how I must manage this case. Can I use only one geoxml = new geoxml.parser() for three "layers"? How would I manage doc parameter in userTheData to get a "KML file layer" or "XML string layer"? PD: Sorry for my english. It's very difficult to explain what I need. MODIFIED POST I draw a map dinamically with ASP. If I get 3 layers, a write 3 object (geoxml_1, geoxml_2 and geoxml_3). It would be only one object, and show and hidden layer 1 or layer2.... That is my problem. Really it works, but it isn't fine code. When I load de map, it show all layers, and in a few seconds, only show the first layer and hidden the others. I would like whow only the first layer, an when I click the others layers in my buttons inside the map, it would show and hide de layers. This is my code (sorry, its too large): function muestraCapasMapa(){ var objCapa = document.getElementById("capas_mapa"); var objFlecha = document.getElementById("flecha"); if (objCapa.className=="ocultar"){ objCapa.className = ""; objFlecha.className = "plegar"; }else{ objCapa.className = "ocultar"; objFlecha.className = ""; } } var infoWindow; var map_1 = null; var geoXml_1; var bounds_1; var blnKmlServicio_1; var geoXml_2; var bounds_2; var blnKmlServicio_2; var geoXml_3; var bounds_3; var blnKmlServicio_3; var boundsTotal; var SDLLayer; var btnPulsado; function useTheData_1(doc){ var geoXmlDoc = doc[0]; for (var i = 0; i < geoXmlDoc.placemarks.length; i++) { var placemark = geoXmlDoc.placemarks[i]; var bounds_parciales; if (placemark.polyline) { bounds_parciales = placemark.polyline.bounds; bounds_1.union(bounds_parciales); } if (placemark.polygon){ bounds_parciales = placemark.polygon.bounds; bounds_1.union(bounds_parciales); } if (placemark.marker) { bounds_parciales = place…
possible better answer: http://stackoverflow.com/a/27091472
has comment: http://stackoverflow.com/comment/42606333
accepted answer: http://stackoverflow.com/a/27255722
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42716133
has comment: http://stackoverflow.com/comment/42531822
has comment: http://stackoverflow.com/comment/42764318
has comment: http://stackoverflow.com/comment/42761144
has answer: http://stackoverflow.com/a/27255722
has answer: http://stackoverflow.com/a/27091472
type: Question
has comment: http://stackoverflow.com/comment/42985151
tagged with: google-maps
has comment: http://stackoverflow.com/comment/42744312
has comment: http://stackoverflow.com/comment/42717696
tagged with: javascript
has comment: http://stackoverflow.com/comment/42764002
has comment: http://stackoverflow.com/comment/42764547
has title: Load a map with geoxml using parseKmlString() and parse()
score: 0

http://stackoverflow.com/comment/42296631
type: Comment
comment on: http://stackoverflow.com/q/26837424
type: QuestionComment
has text: Related: http://stackoverflow.com/questions/25274930/how-to-write-a-module-that-works-with-node-js-requirejs-as-well-as-without-them
score: 0

http://stackoverflow.com/a/26869930
has comment: http://stackoverflow.com/comment/42298948
has comment: http://stackoverflow.com/comment/42298822
downvote count: 0
has comment: http://stackoverflow.com/comment/42299171
has comment: http://stackoverflow.com/comment/42298638
has comment: http://stackoverflow.com/comment/42298711
has comment: http://stackoverflow.com/comment/42299771
type: Answer
score: 2
upvote count: 2
has body: This is something I learned from ReSharper instead of using expressions like if (2.00001 == 2) {} try if (Math.abs(2.00001 - 2) &lt; tolerance) {} where tolerance should be an aceptable value for you for example .001 so all values wich difference is less than .001 will be equals Do you really need 10^-16 precision I mean that is why 1000 meter = 1 kilometer, just change the unit of the output so you dont have to work with all those decimals
answers question: http://stackoverflow.com/q/26869799
has comment: http://stackoverflow.com/comment/42299658
has comment: http://stackoverflow.com/comment/42299242
has comment: http://stackoverflow.com/comment/42300065

http://stackoverflow.com/a/26975174
type: Answer
upvote count: 4
downvote count: 0
score: 4
answers question: http://stackoverflow.com/q/26974865
has body: function Start(data) { var _this = this; this.move = function() { console.log('mode'); } function load() { _this.move(); } // load(); } Start(); new Start();

http://stackoverflow.com/q/26850993
score: 1
accepted answer: http://stackoverflow.com/a/26851196
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/42264695
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/42264853
tagged with: javascript
favorite count: 0
has title: How can I capture an array of objects that are generated by the user?
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42264450
has comment: http://stackoverflow.com/comment/42264483
has answer: http://stackoverflow.com/a/26851196
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42264565
has comment: http://stackoverflow.com/comment/42264862
has comment: http://stackoverflow.com/comment/42264600
upvote count: 1
has body: I am trying to capture an array of objects that are generated by the user. My problem is that though the array is generated, the objects fail to retain any values entered by the user, thus populating the array with objects that have null properties. Here is the code. Javascript: // add additional employment $scope.addEmployment = function() { $scope.AdditionalEmployment.push( { AddEmploymentStatusId: '', EmploymentTypeId: '', EmployerName: '', EmploymentStartDate: '', EmploymentEndDate: '', EmployerNumber: '', EmployerStAddress: '', EmployerCity: '', EmployerState: '' } ); }; $scope.saveApplication = function() { // create post obj var postObj = { AdditionalEmployment: $scope.AdditionalEmployment }; // api post $http.post('/api/Employment/JobHistory', postObj) .success(function(data) { // success code }) .error(function(data) { // error code }); }; HTML: Additional Employment {{$index + 1}} Employment Status --Select-- Employment Type --Select-- Employer Name Employment Start Date Employment End Date Employer Phone Number Employer St Address Employer City Employer State Remove Add Additional Employment Submit What am I missing here?
has comment: http://stackoverflow.com/comment/42264522
type: Question
has comment: http://stackoverflow.com/comment/42264485

http://stackoverflow.com/q/26879347
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42315499
has comment: http://stackoverflow.com/comment/42315504
downvote count: 3
has title: Make a div slide in on load
tagged with: javascript
type: Question
has answer: http://stackoverflow.com/a/26879652
has comment: http://stackoverflow.com/comment/42315570
answer count: 2
upvote count: 0
has answer: http://stackoverflow.com/a/26879474
tagged with: jquery
has comment: http://stackoverflow.com/comment/42315521
favorite count: 0
has body: I have a website where I have a div for my header, menu, and content the content div is within its own wrapper div. I would like to animate my divs by making the header and menu appear by fading in, and after the fade animations are complete, have the content slide in from the left. Ideally I would want to use jquery to make the animations. How can I do this? Any help would be appreciated, Thanks!
score: -3
tagged with: animation
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42315702
has comment: http://stackoverflow.com/comment/42315559

http://stackoverflow.com/q/26926039
has answer: http://stackoverflow.com/a/26928052
type: AnsweredQuestion
has body: I have a bug in my Highchart axis, when deselecting all products is crashes and the page needs to reload. The code can be viewed here: http://jsfiddle.net/8g5sonpp/18/ The crash happened after I added this code: tickPositioner: function () { var positions = [], tick = Math.floor(this.dataMin), increment = Math.ceil((this.dataMax - this.dataMin) / 6); for (tick; tick - increment &lt;= this.dataMax; tick += increment) { positions.push(tick); } return positions; }, I added it to avoid the y-axis showing minus/negative numbers. But the result is a crash when all series are deselected. How do I fix this?
type: Question
tagged with: crash
has title: Highcharts crash after adding tickpositioner
accepted answer: http://stackoverflow.com/a/26928052
tagged with: javascript
score: 0
tagged with: highcharts
answer count: 1

http://stackoverflow.com/a/26920724
type: Answer
has comment: http://stackoverflow.com/comment/42389718
score: 2
answers question: http://stackoverflow.com/q/26920610
upvote count: 3
downvote count: 1
accepted answer of: http://stackoverflow.com/q/26920610
has comment: http://stackoverflow.com/comment/42389807
has body: One problem you have is that you do not save the number the user inputs. You prompt them, parse it as an int and then nothing. You have to pass the 3 numbers into maxNum() Here is a working example that uses proper left hand assignment and saves the number. Also it is a good idea to use &gt;= instead of &gt; because the user can enter 2 of the same number function maxNum(num1, num2, num3){ var max = 0; if((num1 &gt;= num2) &amp;&amp; (num1 &gt;= num3)){ max = num1; } else if((num2 &gt;= num1) &amp;&amp; (num2 &gt;= num3)){ max = num2; } else{ max = num3; } return max; } var arr = []; for(i=0;i&lt;3;i++){ arr[i] = parseInt(prompt("Enter a number")); } document.write(maxNum.apply(this, arr));
type: AcceptedAnswer

http://stackoverflow.com/a/26853230
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42284850
type: Answer
score: 1
has body: The is inside the and since you're not using Polymer() you'd need to use template.content.querySelector() get at and modified it's content. Instead, you can do this in Polymer:
upvote count: 1
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26849156
answers question: http://stackoverflow.com/q/26849156

http://stackoverflow.com/q/26866063
accepted answer: http://stackoverflow.com/a/26868632
tagged with: google-maps
has comment: http://stackoverflow.com/comment/42294885
tagged with: javascript
has comment: http://stackoverflow.com/comment/42292948
has comment: http://stackoverflow.com/comment/42292061
tagged with: marker
tagged with: google-maps-api-3
score: 0
linked to: http://stackoverflow.com/q/23751623
has answer: http://stackoverflow.com/a/26868632
has comment: http://stackoverflow.com/comment/42291824
answer count: 1
has comment: http://stackoverflow.com/comment/42294307
has comment: http://stackoverflow.com/comment/42291648
has comment: http://stackoverflow.com/comment/42295316
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42295697
has body: I'm trying to make a list of links, correlate to the correct marker on a google map. I have multiple markers and this is what I have: You can see a live example of my code by viewing source on this page: http://79.170.40.181/cranes.co.uk/stockists/ I'm using Wordpress's Advanced Custom Fields plugin to generate the map and its markers. I'm using their example code given on their docs pages but I'm trying to add additional functionality. I just need some advice on where I put this piece of code to enable my list of links to relate to each marker on the map: var name = $('#listdata').find('.clickaway'); google.maps.event.addDomListener(name, 'click', function() { infowindow.open(map,marker); alert('found me'); }); My list of links has a structure of: <ul id="listdata" Location 1 Location 2 ... For reference I have pasted my full Google Maps code here: Here's how I loop through and display the markers: <?php if( have_rows('locations') ): ?> <?php while ( have_rows('locations') ) : the_row(); $location = get_sub_field('stockist_location'); ?> <div class="marker" data-lat="<?php echo $location['lat']; ?>" data-lng="<?php echo $location['lng']; ?>"> Title Address <?php endwhile; ?> <?php endif; ?> Can anyone advise or give me some help how I might get this working?
tagged with: wordpress
has title: Google Maps link to marker from outside map
type: Question
has comment: http://stackoverflow.com/comment/42294368

http://stackoverflow.com/q/26888242
type: Question
has answer: http://stackoverflow.com/a/26892080
accepted answer: http://stackoverflow.com/a/26892080
score: 0
tagged with: sqlite
answer count: 1
tagged with: javascript
has body: I am new to phonegap. i created database containing two table. It showing sql error undefined.I created another table using below code with few modification. that table working fine.but below code is not working.i am unable to find bug.what's the error in it.please help. function insertVehicleData(tx) { var db=window.openDatabase("FuelDatabase","1.0","FuelData",200000); db.transaction(vehicleDB,errorVDB,successVDB); } function vehicleDB(tx) { tx.executeSql('CREATE TABLE IF NOT EXISTS vehicledata (vhname TEXT, vmake TEXT,vtype TEXT,currency TEXT)'); var vhname=document.getElementById('vhname').value; var vmake= document.getElementById('vmake').value; var vtype=document.getElementById('vtype').value; var currency=document.getElementById('currency').value; tx.executeSql("INSERT INTO vehicledata (vhname,vmake,vtype,currency) VALUES ('"+ vhname +"','"+ vmake +"' , "+ vtype+", '"+ currency +"')"); } function errorVDB(tx,error) { alert("error not saved:"+error); } function successVDB() { alert("your data saved"); }
type: AnsweredQuestion
tagged with: cordova
has title: value not insert into database from the input error:undefined in phonegap

http://stackoverflow.com/q/26875157
has comment: http://stackoverflow.com/comment/42308080
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has body: I have a javascript variable (ex: myElement), that holds a div with class name myClass like shown below. My Div Div one Content Headline two Div two Content My Div Div one Content Headline two Div two Content I want to add an attribute (ex: data-index) to the div having class 'myClass' through jascsript or jQuery so that it could look like this: My Div Div one Content Headline two Div two Content My Div Div one Content Headline two Div two Content How can you achieve this? Please note: I have this div in a javascript variable called myElement and the following code myElement.attr('data-index','index') does not work. Update: I could try like First appending the div stored in variable myElement to the DOM, then add the attribute: $('div.myClass').attr('data-index','index'); but the problem is in the DOM I have like 100s of div with the class myClass.
has comment: http://stackoverflow.com/comment/42531588
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26875746
has comment: http://stackoverflow.com/comment/42308302
has answer: http://stackoverflow.com/a/26875372
has comment: http://stackoverflow.com/comment/42309173
type: Question
upvote count: 2
answer count: 2
downvote count: 2
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/42308074
has title: Add attribute to a parent element

http://stackoverflow.com/q/26962482
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/26962499
score: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/26962499
tagged with: node.js
has body: Express view: app.get("/", function (req, res) { res.render("index", { addons: addons }); }); Jade template loop each addon in addons How would update that addons loop after the initial load using appjs/node.js/express/jade?
upvote count: 1
type: AnsweredQuestion
tagged with: javascript
tagged with: express
has title: Update loaded value with node.js express
type: Question
tagged with: appjs
tagged with: pug

http://stackoverflow.com/q/26911058
answer count: 1
tagged with: bootstrap-modal
has comment: http://stackoverflow.com/comment/42372812
has body: Scenario I have a gridview. On clicking a row a modal window is shown. Inside the modal window, there are a few link-buttons. Problem I need to pass the ID of the record clicked to the PostbackURL attribute of the link buttons inside the modal, so that the user is able to click the link and view record details. Example User clicks on a recordID=30; Modal window is shown with links to record detail pages; Links urls contain the correct recordID (30); User clicks on link and details page is displayed. What I've tried (I've used Jquery) row.Attributes["onclick"] = "$('#myModal').on('show.bs.modal',function(e) { $(this).find('#editPosition').attr('href') = ~/People/Details.aspx?PersonID=" + key + ";})$('#myModal').modal('show')"; where 'Key' is the recordID. I thought this would do it, but I'm obviously missing something. Can anyone see what I'm doing wrong? Cheers
has title: On row clicking, pass record id to linkbutton inside Bootstrap modal
has answer: http://stackoverflow.com/a/26934429
type: AnsweredQuestion
tagged with: gridview
tagged with: twitter-bootstrap-3
type: Question
has comment: http://stackoverflow.com/comment/42373086
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26934429
score: 0

http://stackoverflow.com/comment/124270591
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26938167
has text: If you have O'Reilly WebGL from 2012, this fixes their example. Instead of `THREE.Light(0xffffff, 1.5)`, use `THREE.DirectionalLight( 0xffffff )`
score: 0

http://stackoverflow.com/a/26854867
has comment: http://stackoverflow.com/comment/42272229
has body: An answer to summarize the steps required. 1) You inject a content script with webview.executeScript() into the embedded page. 2) Since the page's real window is isolated, you need a page-level script to access it. You inject it with a &lt;script&gt; tag as discussed here. 3) The page-level script can access the window object, but cannot talk to the app script. However, it can fire a custom DOM event, that the content script can catch. Discussed here. 4) Finally, from the content script you need to send a message to your app script. The content script calls chrome.runtime.sendMessage, while the app script listens with chrome.runtime.onMessage. chrome.runtime.sendMessage does not seem to be available to webview content scripts injected with webview.executeScript(). A workaround is to use postMessage as described here. It's a bit of an onion structure, that's why you need 2 steps "in" and 2 steps "out". You can't really do it in the return value that's passed to the executeScript callback, since at least one of the "out" steps will be asynchronous.
has comment: http://stackoverflow.com/comment/42272276
has comment: http://stackoverflow.com/comment/42272216
score: 4
has comment: http://stackoverflow.com/comment/42282101
upvote count: 4
answers question: http://stackoverflow.com/q/26851116
downvote count: 0
has comment: http://stackoverflow.com/comment/42273327
type: Answer

http://stackoverflow.com/comment/42432234
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26943647
has text: Thanks! That makes a lot of sense.

http://stackoverflow.com/comment/42392683
score: 0
comment on: http://stackoverflow.com/a/26922458
type: Comment
has text: Is it possible to do two ng-classes in one tag in the situation where if they are batting more than .250 its success class (green) but if its lower than .200 then its an error class (red)?
type: AnswerComment

http://stackoverflow.com/comment/42494528
type: QuestionComment
comment on: http://stackoverflow.com/q/26979904
has text: didn't understand your comment which line do you mean?
score: 0
type: Comment

http://stackoverflow.com/q/26833670
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/42233688
tagged with: javascript
tagged with: jquery
has body: I recently decided that I want an icon to follow the mouse on my web site. So I added the following to a JavaScript file that every page on my site uses $(document).ready(function() { var mouseFollowerHTML = "&lt;img class='mouse-follower' src='/images/space_needle_icon.png' alt='space needle'/&gt;"; $('.maincontent').append(mouseFollowerHTML); }); $(document).mousemove(function(e) { $('.mouse-follower').offset({ left: e.pageX, top: e.pageY + 20 }); }); with the intention that it would inject an image into the maincontent element (which is on every page) and then have the image follow the mouse. But it's not working. I've tried adding an alert to the $(document).ready(...) function, but nothing happened. Please correct me in the error(s) of my ways.
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42233710
favorite count: 0
type: UnansweredQuestion
upvote count: 1
linked to: http://stackoverflow.com/q/7143806
has comment: http://stackoverflow.com/comment/42233690
has title: Using a JavaScript file to inject HTML into a page
has answer: http://stackoverflow.com/a/26834023
downvote count: 1

http://stackoverflow.com/comment/42267016
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26852151
has text: What is supposed to call your `changeBGImage()` function? Are you getting any console errors?

event-handling
tag name: event-handling
tags question: http://stackoverflow.com/q/26877563
tags question: http://stackoverflow.com/q/26948837
tags question: http://stackoverflow.com/q/26950488
tags question: http://stackoverflow.com/q/26897711
tags question: http://stackoverflow.com/q/26856902
tags question: http://stackoverflow.com/q/26879630
tags question: http://stackoverflow.com/q/26837669
type: Tag
tags question: http://stackoverflow.com/q/26901717

http://stackoverflow.com/comment/42312220
type: Comment
has text: I think in this case your looking for the `--require` options to browserify. That will require the module and expose it to your HTML through a global `require()` function.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/26877541

http://stackoverflow.com/a/26882827
type: Answer
has body: you can do something like t http://jsfiddle.net/naeemshaikh27/y5jaduuf/1/ var arr = []; var obj={}; $("#addToArray").click(function(){ obj.x= $("#x").val(); obj.y=$("#y").val(); arr.push(obj); });
upvote count: 1
answers question: http://stackoverflow.com/q/26882540
downvote count: 0
score: 1

http://stackoverflow.com/q/26987073
score: 0
answer count: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/26989606
tagged with: facebook
has body: I used the following script in my web page In body tag i used the following code &lt;div id="fb-root"&gt;&lt;/div&gt; &lt;script&gt;(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&amp;version=v2.0"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));&lt;/script&gt; In my blog listing I used the following in each blog: &lt;div class="fb-share-button" data-href="http://test.com" data-layout="button"&gt;&lt;/div&gt; Its displayed fine. After 10 blogs while scroll the remaining data are loaded dynamically by using the ajax file. Here also I used the above script and Div share button. But it is not displayed with the ajax loaded file. I googled a lot and I couldn't find a right solution. Please help me to fix this.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26989606
has title: fb share button not displayed with ajax file
type: Question
tagged with: javascript

http://stackoverflow.com/a/26893897
downvote count: 0
answers question: http://stackoverflow.com/q/26892759
type: Answer
upvote count: 1
has body: Most likely you are seeing two separate http requests: the one you explicitly sent and the one sent automatically by the browser for /favicon.ico.
score: 1

http://stackoverflow.com/q/26835769
has body: I'd like to add a small feature to my webpage where a user can write javascript to do some data manipulation (e.g., create a new object from data table - ideally, I'd like to disable non-necessary features in JS such as accessing the server through ajax, etc.). Is this a really bad idea in terms of security? It seems the sites that allow such a feature (e.g., w3school try-it feature) uses server side validation. Someone on Stackoverflow suggested running the user code in a web worker thread is safer, which I can do. But my question is, in general, most browsers these days come with developer tools and console where you can write and execute javascript code. So adding user JS editor feature won't make the application any more vulnerable than it is. Am I thinking it right?
score: 1
has title: User entered javascript less safer than the browser web developer tool?
has answer: http://stackoverflow.com/a/26835822
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/26835833
upvote count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: user-input
type: UnansweredQuestion

webbrowser-control
type: Tag
tags question: http://stackoverflow.com/q/26955920
tag name: webbrowser-control

http://stackoverflow.com/q/26896986
tagged with: javascript
has comment: http://stackoverflow.com/comment/42347296
type: Question
has title: Pass an array from PHP to JS
has comment: http://stackoverflow.com/comment/42347268
has answer: http://stackoverflow.com/a/26897044
has body: hi i have a big problem i try 3 weaks to solve it but i didn't make anything i have or an errors or i don't take nothing from the results. i pas an array from query ST_AsGeoJSON from a php code in the javascript code. there are in the same file html this two codes i get the array from php to javascrypt with this line of code var jsonAr= &lt;?php echo json_encode($Arresu) ?&gt;; if i print the jsonAr i receve with document.write(jsonAr); it is give me this format { "type":"LineString","coordinates":[[25.9980559326738,39.2420282528175],......,,[26.0486275566016,39.2291388086281]]},{"type":"LineString","coordinates":[[26.0486275566016,39.2291388086281],......[]]} if i try to take the coordinates and pot it in an array i try this jsonAr.coordinates[0][0] but i did not take any result , i don't know how i take the coordinates
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/26897128
tagged with: php
has answer: http://stackoverflow.com/a/26897128
accepted answer: http://stackoverflow.com/a/26897044
has comment: http://stackoverflow.com/comment/42349702
type: AnsweredQuestion

http://stackoverflow.com/a/26875569
answers question: http://stackoverflow.com/q/26875454
has body: With html: 0.00 and jQuery script on domReady: $(document).ready(function(){ $("#my_checkbox").change(function(){ if($(this).is(':checked')) { $('#my_total').html('333.45'); } else { $('#my_total').html('0.00'); }; }).trigger('change'); });
accepted answer of: http://stackoverflow.com/q/26875454
type: AcceptedAnswer
score: 0
type: Answer
upvote count: 1
downvote count: 1

http://stackoverflow.com/comment/42411823
type: AnswerComment
comment on: http://stackoverflow.com/a/26933500
score: 0
type: Comment
has text: Sorry, I'm a little confused. Why do you need the session?

http://stackoverflow.com/comment/42508076
has text: `new Date('4-november-2014')` will give you an invalid date in at least some browsers, so then `d.getMonth()` and so forth will return nan.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26987670
type: Comment

http://stackoverflow.com/comment/42269824
has text: Well, new problem now: if I choose a new option in the list (eg. "Chocolate malt 800 EBC") it simply add the digits to the already selected digits from the earlier selection, and is now showing "4800". I want it the clear the field and add the digits from the new selection only. Is there a way around that?
type: AnswerComment
comment on: http://stackoverflow.com/a/26853250
score: 0
type: Comment

http://stackoverflow.com/a/26957938
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/53542135
upvote count: 3
has body: I have solved my question, took me hours to see what i was doing wrong, sometimes stepping away from a problem helps you think about it differently. OK so we know that Joomla uses different plugins and libraries to get its backend to work. One of these Joomla plugins is something called chosen http://harvesthq.github.io/chosen/. this plugin changes or manipulates a select element. this is why it was rendering differently in browser. so what i was missing really from my code is a way to refresh my change on the ui and below is how you do it. dType.val(data.message.discount_type).trigger('liszt:updated');
answers question: http://stackoverflow.com/q/26954087
accepted answer of: http://stackoverflow.com/q/26954087
score: 3

http://stackoverflow.com/a/26936679
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26936508
has comment: http://stackoverflow.com/comment/42417986
has comment: http://stackoverflow.com/comment/42422411
has body: I'm not sure I understand you. I believe you are asking is how to loop through the columns one at a time instead of the rows. If this is not correct, please correct me. To look, you would do something akin to: var onesInRows = []; for(var i = 1; i &lt;= numberOfColumns; i++){ onesInRows.push($('tr') //get all table rows .find('td.one:nth-child('+i+')')) //get the tds, //that have class one, //that are in the row you are currently selecting } The the first one in the first row would be: onesInRows[0].eq(0); First one in the second row would be: onesInRows[1].eg(0); Does that all make sense? Update: and if you want all the ones in a single jQuery object: var onesInAllRows; for(var i = 1; i &lt;= numberOfColumns; i++){ var onesInRow = ($('tr') //get all table rows .find('td.one:nth-child('+i+')')) //get the tds, //that have class one, //that are in the row you are currently selecting if(onesInAllRows.length !== 0){ onesInAllRows.add(onesInRow); } else{ onesInAllRows = onesInRow; } }

twilio
tag name: twilio
tags question: http://stackoverflow.com/q/26853746
type: Tag

http://stackoverflow.com/comment/42247019
type: AnswerComment
comment on: http://stackoverflow.com/a/26834453
type: Comment
has text: Both scripts are just before body close. I dont have a
score: 0

http://stackoverflow.com/comment/42467837
type: Comment
has text: Hi Wittakarn, There is a small issue using scroll no, since there is a payment gateway related to the website, I am unable to use scroll no, is there any other way to fix it ?
comment on: http://stackoverflow.com/a/26944029
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42324822
comment on: http://stackoverflow.com/q/26858670
score: 0
type: Comment
has text: better would be to post a new question ( it will be visible to other users too ).
type: QuestionComment

http://stackoverflow.com/q/26929249
tagged with: javascript
tagged with: jquery
score: 0
accepted answer: http://stackoverflow.com/a/26929359
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: checkbox
type: AnsweredQuestion
tagged with: jqgrid
has answer: http://stackoverflow.com/a/26929359
has title: jqGrid fetch Unchecked Checkbox value in hidden field
has body: jqGrid structure: &lt;script&gt; var call_url = "&lt;?php echo $url;?&gt;"; jQuery("#task-grid").jqGrid({ url:call_url, datatype: "json", height: 'auto', rowNum: 20, rowList: [20,30], colNames:['ID','RESOURCE','ROLE','SITE', 'ALLOCATION TYPE', 'UNIT (%)'], colModel:[ {name:'ID',key:true,index:'ID', width:50, align:'center',search:false,hidden: false}, {name:'RESOURCE',index:'RESOURCE', width:150, sorttype:"text",align:'center',search:true}, {name:'ROLE',index:'ROLE',width:120 ,align:'center',search:false}, {name:'SITE',index:'SITE', width:120, align:'center',search:false}, {name:'ALLOC. TYPE',index:'ALLOCATION_TYPE', align:'center',width:120,search:false }, {name:'UNIT',index:'UNIT',align:'center',search:false}, //{name:'HOURS',index:'HOURS', search:false, align:'center',sortable:false,editable:true} ], pager: "#page", shrinkToFit :true, autowidth: true, viewrecords: true, sortname: 'RESOURCE', sortorder: "asc", multiselect: true, cellEdit: true, cellsubmit : 'clientArray', caption: "Resource List", onSelectRow: function(rowid,iRow,iCol,e){alert(rowid);}, loadComplete: function (data) { var ids = $("#task-grid").jqGrid('getDataIDs'); for (var i = 0; i &lt; ids.length; i++){ var rowId = ids[i]; $("#task-grid").jqGrid('setSelection', rowId, false); //console.log(rowId); } } }).navGrid('#page',{ edit:false,add:false,del:false,search:false,cloneToTop:true,refresh:false}, { },{ //add options },{ //msg: "do you really want delete this keyword? This delete affect on Eqms filter" }); jQuery("#task-grid").jqGrid('filterToolbar', { autosearch: true }); var topPagerDiv = $('#grid_toppager')[0]; jQuery("#grid_toppager_center", topPagerDiv).remove(); &lt;/script&gt; Code to fetch selected ID's &lt;input type="hidden" name="emp_id_checked" value=""/&gt; &lt;script&gt; var Ids = jQuery("#task-grid").jqGrid('getGridParam','selarrrow'); var empIds = $("input[type=hidden][name=emp_id_unchecked]").val(Ids); &lt;/script&gt; I have the ID (12860) when checkbox is selected on page load, …
type: Question

http://stackoverflow.com/a/26846615
upvote count: 1
has body: Try changing famous each function to this: $(".tabs .nieuwe_offerte_table tbody tr td a.product_toevoegen").slice(start_week-1, eind_week).append(product);
answers question: http://stackoverflow.com/q/26846302
has comment: http://stackoverflow.com/comment/42256784
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26846302
has comment: http://stackoverflow.com/comment/42256421
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/42256306

http://stackoverflow.com/q/26903262
has answer: http://stackoverflow.com/a/26903446
has answer: http://stackoverflow.com/a/26903451
has comment: http://stackoverflow.com/comment/42358092
tagged with: datatable
type: AnsweredQuestion
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26903451
has body: I am using datatables for my pagination.When there are more than 5 records I want to show next,previous buttons and show number of pages drop down. For that I am using like this if($("#example").find("tr:not(.ui-widget-header)").length&lt;=10){ console.log('hi'); $('#example_length').addClass('hide'); $('#example_paginate').addClass('hide'); } } enter link description here Lets say initially there are only 5 records so there is no need to show next or previous buttons neither number of records per page. So I am hiding it and it works well.But my problem is if there are 12 records then on the 1st page it shows 10 records and next,previuos buttons all visible and when I click next button then it shows another 2 records and here the buttons disappear. Now the user can not see 1-10 records as there is no button for that So how to overcome this issue. How can I disable the buttons if the total number of records are less than 10 Here is the fiddle
score: 0
answer count: 2
tagged with: datatables
accepted answer: http://stackoverflow.com/a/26903446
tagged with: jquery
has title: How to hide page numbers when records are less

http://stackoverflow.com/a/26934807
has comment: http://stackoverflow.com/comment/42414969
upvote count: 2
has comment: http://stackoverflow.com/comment/42416087
has comment: http://stackoverflow.com/comment/42414543
has comment: http://stackoverflow.com/comment/42416850
has comment: http://stackoverflow.com/comment/42418933
has comment: http://stackoverflow.com/comment/42418435
has comment: http://stackoverflow.com/comment/72488805
has comment: http://stackoverflow.com/comment/42416479
has body: I haven't done this yet myself, but this should be very simple using the pushState: https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history var stateObj = { foo: "bar" }; history.pushState(stateObj, "New Page Title", "newPath.html"); Here's an extended example, where you would replace the content, path, and title with the results from your WordPress query that would grab the next post. Push State Testing Push State Testing Next In answer to the question in the comments. No, you don't need to know the path of the URL until you know the content. You replace the content and do the pushState at the exact same time: $('#mainContent').html( contentFromWp ); history.pushState( state, titleFromWp, pathFromWp ); Okay, so to take the above and try to write it for you, which I can't test, so I can't guarantee that this will be working like my above examples...it would be something like this: jQuery(document).ready(function() { jQuery('#main-content').on('click', '.page a', function(e) { e.preventDefault(); var url = jQuery(this).attr('href'), title = jQuery(this).attr('title') ; jQuery('#main-content').html(' Loading... ').load(url+ ' #main-content'); document.title = title; history.pushState({url:url,title:title}, title, url ); }); }); window.onpopstate = function(event) { document.title = event.state.title; jQuery('#main-content').html(' Loading... ').load(event.state.url+ ' #main-content'); } Note the need for onpopstate to make the back button work. You will also want to call a history.replaceState when your webpage first loads like I did in my example so that when users go back to the very first page the first page they were on will reload...otherwise, the user will only be able to go back to the second page they navigated to since going back to the first won't have a stateObj.
has comment: http://stackoverflow.com/comment/42419017
has comment: http://stackoverflow.com/comment/42414493
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42417570
has comment: http://stackoverflow.com/comment/42417248
accepted answer of: http://stackoverflow.com/q/26934137
has comment: http://stackoverflow.com/comment/42415595
answers question: http://stackoverflow.com/q/26934137
type: Answer
has comment: http://stackoverflow.com/comment/42418133
score: 2

http://stackoverflow.com/comment/42247546
type: Comment
has text: Please don't ask me why. I want to understand why It isn't possible.
type: AnswerComment
comment on: http://stackoverflow.com/a/26841326
score: 0

http://stackoverflow.com/comment/46955862
type: Comment
has text: was trying $(".CheckBox:checked").serialize(); as in my question thanks
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26935873

http://stackoverflow.com/a/26901050
has comment: http://stackoverflow.com/comment/42354735
type: Answer
answers question: http://stackoverflow.com/q/26900748
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/26900748
downvote count: 0
has comment: http://stackoverflow.com/comment/42357042
has body: If i understand right ,you are trying to change the images to a new set of images based on the button click then . This is the simplest way I could think of though this is not the most efficient way but this should work function basketballImg(){ document.getElementById('img1').href = 'img/bbImage1.png'; document.getElementById('img2').href = 'img/bbImage2.png'; document.getElementById('img3').href = 'img/bbImage3.png'; } function footballImg(){ document.getElementById('img1').href = 'img/fbImage1.png'; document.getElementById('img2').href = 'img/fbImage2.png'; document.getElementById('img3').href = 'img/fbImage3.png'; } function hockeyImg(){ document.getElementById('img1').href = 'img/hyImage1.png'; document.getElementById('img2').href = 'img/hyImage2.png'; document.getElementById('img3').href = 'img/hyImage3.png'; } now on click of each button these set of images will be replaced by the ones that are there .
type: AcceptedAnswer

object-literal
tag name: object-literal
type: Tag
tags question: http://stackoverflow.com/q/26849269

http://stackoverflow.com/comment/42303467
comment on: http://stackoverflow.com/q/26869811
has text: My difficulty is being under a tight deadline and not having enough understanding to quickly wrap my mind around the problem. I had been mulling over your previous example and some others and am beginning to grasp how to implement this into my page. Stack overflow is an amazing resource filled with generous people. Thank you most sincerely for sharing your time and knowledge.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26888276
has comment: http://stackoverflow.com/comment/43253326
has answer: http://stackoverflow.com/a/29989524
type: Question
has body: I have a TinyMCE 4.x instance where the text should be in read only mode. But I still have some buttons that I want to have enabled. For example, one button could provide a character count for the part of the text I've selected. But when I turn on read only mode for TinyMCE all buttons are disabled. Can I enable just my buttons while still retaining read only mode?
score: 5
upvote count: 5
tagged with: javascript
answer count: 6
has answer: http://stackoverflow.com/a/40544857
tagged with: tinymce
has answer: http://stackoverflow.com/a/71771364
has answer: http://stackoverflow.com/a/39486077
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42991297
has answer: http://stackoverflow.com/a/40524403
has title: TinyMCE Enable button while in read only mode
has answer: http://stackoverflow.com/a/75947540

http://stackoverflow.com/comment/42273994
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/26855943
has text: What "not working" means? PS: `contact` is a string already

http://stackoverflow.com/q/26865072
has answer: http://stackoverflow.com/a/26865363
favorite count: 0
has answer: http://stackoverflow.com/a/26865134
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26865183
upvote count: 1
has comment: http://stackoverflow.com/comment/42289603
has comment: http://stackoverflow.com/comment/42289538
score: 1
type: Question
has answer: http://stackoverflow.com/a/26865114
has comment: http://stackoverflow.com/comment/42289562
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42289607
has comment: http://stackoverflow.com/comment/42289802
has body: I want to execute some code if this element exists Some text using jquery. my code until now: setInterval(function(){check()}, 100); function check() { var count = document.getElementById("count"); if(document.getElementById("element") && count.value != 1) { //some code count.value = 1; } } It works, but I think this is a very bad way to reach my target. I want an easier solution, but I didn't find.
has title: Execute some code if element exists
tagged with: setinterval
answer count: 4

http://stackoverflow.com/q/26943018
has comment: http://stackoverflow.com/comment/42429239
type: Question
has answer: http://stackoverflow.com/a/26943050
linked to: http://stackoverflow.com/q/17788990
answer count: 1
tagged with: javascript
has body: I can get css of an element in an iframe by this way: var bg_color = $('iframe.#myIframe').contents().find('div#someId').css('background-color'); but I can't get: var bg_color = $('iframe.#myIframe').contents().find('div#someId:hover').css('background-color'); So, how can I get css of a hover element in an iframe (same domain)? Please help me! Thanks!
tagged with: jquery
score: 0
tagged with: css
duplicate of: http://stackoverflow.com/q/17788990
type: UnansweredQuestion
tagged with: iframe
has title: Get css values of a hover element in an iframe
has comment: http://stackoverflow.com/comment/42431317
tagged with: hover

http://stackoverflow.com/q/26972389
tagged with: datatable
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42480176
tagged with: http://stackoverflow.com/tag/json
has body: I have a JSON object like that: { "column1": ["a","b","c","d","e"], "column2": [1,2,3,4,5] } And I'd like to refresh it on a DataTable by calling $ajax function. How it works?
has comment: http://stackoverflow.com/comment/42480578
has comment: http://stackoverflow.com/comment/42480303
type: Question
has title: Refreshing DataTable from JSON object by calling $ajax function
tagged with: javascript
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/42480346

kendo-combobox
tag name: kendo-combobox
tags question: http://stackoverflow.com/q/26986180
type: Tag

http://stackoverflow.com/comment/42314818
type: AnswerComment
score: 0
type: Comment
has text: Operator is not an array, so you can't index it like that. My loop just counts the number of child objects on the operator object by enumerating the properties on the object.
comment on: http://stackoverflow.com/a/26878663

http://stackoverflow.com/q/26972594
type: Question
has answer: http://stackoverflow.com/a/26973347
has title: Get data from data picker using angular js
tagged with: javascript
has comment: http://stackoverflow.com/comment/42481748
has comment: http://stackoverflow.com/comment/42481342
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has body: I download the date picker code which consist html, css and java script. Its working well. But i want to print or get the selected date from the date picker using angular js. I wrote a code that, but it prints undefined. i dn't know where i was wrong. this is my code. Select Date
tagged with: angularjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42481449
score: 1
upvote count: 1

http://stackoverflow.com/comment/42441816
comment on: http://stackoverflow.com/a/26949983
has text: Hi Jason - thanks for your answer. I updated the question with an example and some resulting IL. There does seem to be minor differences.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/26860865
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42282288
tagged with: css
has body: I'm uploading a site that I built using a template from templatemo. http://www.templatemo.com/preview/templatemo_367_shoes I modified it in Dreamweaver CS6 to put my images in the slideshow, background, pages and links,browsing it locally everything looks ok, but when I uploaded it to the server it seems that the index page doesnt recognized the CSS, JS, and image files related to it. the 3 of them has its own folder as the original, I also tried to put them in the root folder and update the index, but it doesn't read it either.the website that I'm building is http://dogodesign.eu/index.html the index page uses several scripts: templatemo_style.css, nivo-slider.css, jquery-1.4.3.min.js, jquery.min.js, ddsmoothmenu.js, ddsmoothmenu.css, I need help as this is my first website. thanks!
has comment: http://stackoverflow.com/comment/42283439
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/26860918
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
score: -1
tagged with: http://stackoverflow.com/tag/html
has title: CSS and JS files not uploading properly

http://stackoverflow.com/q/26866580
tagged with: mysql
possible better answer: http://stackoverflow.com/a/26866942
has answer: http://stackoverflow.com/a/26866942
tagged with: javascript
tagged with: html-table
answer count: 2
tagged with: printing
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26866951
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: I have the following JavaScript code to print a content And in my HTML I have the following code: Print Report Date Remarks Amount Actions 10/11/2014 Hello $14 Edit I want to print only the first 3 columns. I do not want to print the 4th Column "Actions". When I try to print out the content by using the above code it prints all the 4 columns. Please help me with the following.
has title: Print only certain part of the content
accepted answer: http://stackoverflow.com/a/26866951
score: 0

http://stackoverflow.com/q/26918387
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26920912
has answer: http://stackoverflow.com/a/30612771
has answer: http://stackoverflow.com/a/33522762
type: Question
score: 3
tagged with: javascript
has answer: http://stackoverflow.com/a/26918553
has title: Gulp how to save output to file
downvote count: 0
has body: I am using gulp and gulp-shell. How do I save output to a file (created by gulp) ? return gulp.src('.') .pipe(shell([ 'composer install --prefer-source' ]));
tagged with: gulp
favorite count: 0
answer count: 4
upvote count: 3

http://stackoverflow.com/comment/42500054
comment on: http://stackoverflow.com/q/26982577
score: 0
type: Comment
type: QuestionComment
has text: It's on a closed network. I can set up a dumbed down version on a non-closed network tomorrow if need be. I don't know what the meme type is, it's just a .js file I generated with Dreamweaver, to which I then copied code to.

http://stackoverflow.com/q/26876394
tagged with: javascript
tagged with: jquery
tagged with: ajax
has title: Jquery variable to php variable in laravel
accepted answer: http://stackoverflow.com/a/26876850
type: AnsweredQuestion
type: Question
tagged with: php
tagged with: laravel
has body: if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function (position) { $.ajax({ type: "POST", url: "/gethamsters", data: { x: position.coords.latitude, y: position.coords.longitude }, success: function (data) { console.log(data); hamsters = data; } }); }); } @foreach ($hamsters as $hamster) {{ HTML::image($hamster->foto, $hamster->titel, array( 'width' => 200, 'height' => 200 )) }} <?php echo substr($hamster->titel, 0, 20); ?> <?php echo substr($hamster->beschrijving, 0, 50); ?> <?php echo 'id . ' class="btn btn-primary" role="button">Meer info ';?> @endforeach As you can see I got data from my jquery result and I want it to pass it into the $hamsters variable in my php code. How can I do that?
score: 0
has answer: http://stackoverflow.com/a/26876850
has comment: http://stackoverflow.com/comment/42310268
answer count: 1

http://stackoverflow.com/a/26932190
has comment: http://stackoverflow.com/comment/42409344
has comment: http://stackoverflow.com/comment/42409510
has comment: http://stackoverflow.com/comment/42409724
has comment: http://stackoverflow.com/comment/42409586
has body: $('.class-of-your-inputs').change(function(){ $("#you-form").ajaxSubmit({url: 'you_path.php', type: 'post'}) });
type: Answer
has comment: http://stackoverflow.com/comment/42409546
has comment: http://stackoverflow.com/comment/42409276
answers question: http://stackoverflow.com/q/26932082
has comment: http://stackoverflow.com/comment/42409381
has comment: http://stackoverflow.com/comment/42410580
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/q/26952735
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42453304
has comment: http://stackoverflow.com/comment/42446834
tagged with: spring
has comment: http://stackoverflow.com/comment/42447886
has comment: http://stackoverflow.com/comment/42450376
has title: Display bean value from javascript
has body: How can I get the value of my bean to display from my javascript file? My bean - dBean.strIssueDate In the $(document).ready(function() of my jsp, I set the following: $('#content').data("strIssueDate", "&lt;c:out value="${dBean.strIssueDate}"/&gt;"); My problem is that the date is updated (and it's correctly updated in the database), but I would like to call the value from the javascript file. The update begins with a checkbox on another jsp page, which updates the data value via a java file, and then triggers the function in the javascript file, which is where my alert is called. My (incorrect) code in the javascript file (which is not between tags, but just a file consisting of only js: alert("${dBean.strIssueDate}"); which shows on the alert as ${dBean.strIssueDate} I've tried removing the double quotes, substituting for single quotes, swapping the $ for a #, but nothing seems to work.
type: Question
linked to: http://stackoverflow.com/q/14966205
has comment: http://stackoverflow.com/comment/42453235
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/26956264
has comment: http://stackoverflow.com/comment/42446293
has comment: http://stackoverflow.com/comment/42459120
answer count: 1

http://stackoverflow.com/q/26949406
has answer: http://stackoverflow.com/a/26957151
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has body: I am new to jquery. I am using php and jquery to do some task. When I submit a form by clicking image button, I want to get the vertical scroll bar position of the window and save it in the browser. Then I want to retrieve it from window and set the scroll bar position back after page reloaded $(document).ready(function(){ $("#button").click(function(){ // get the scroll bar position // save the scroll bar position }); }); $(document).ready(function(){ If scroll bar position available{ // retrieve the scroll bar position // set the scroll bar position } }); I found some solution where the scroll bar position is passed in a hidden input filed and then they set the position by getting POST variable. I need to do without passing it in a hidden input filed Is it possible? Can you help me on it? Thanks in advance
has title: best way to save and retrieve window scroll position of window using jquery when submit a form
has answer: http://stackoverflow.com/a/26949462
type: Question
answer count: 2
tagged with: php
score: 0

http://stackoverflow.com/comment/42236359
comment on: http://stackoverflow.com/q/26834990
type: Comment
type: QuestionComment
score: 0
has text: @zerkms: Do you mean doing something like `bind(this)` when I call nested methods? Or when I do the `$.extend`?

http://stackoverflow.com/q/26853746
possible better answer: http://stackoverflow.com/a/50295239
answer count: 2
downvote count: 0
tagged with: javascript
has title: Twilio: Where do the params from Twilio.Device.connect() get sent to
favorite count: 0
has answer: http://stackoverflow.com/a/26854201
tagged with: twilio
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/50295239
score: 1
tagged with: twilio-click-to-call
has body: The Twilio JS library has a function called Twilio.Device.connect() which takes params. In the documentation it says these params get sent to the server, but it never specifies which server endpoint it goes to or how to set this up. https://www.twilio.com/docs/client/device Can anybody explain?
accepted answer: http://stackoverflow.com/a/26854201
type: Question

http://stackoverflow.com/a/27091472
type: Answer
score: 1
has body: This works for me: geoXml = new geoXML3.parser({ map: map, infoWindow: infowindow, singleInfoWindow: true }); geoXml.parse(filename); geoXml.parse("TrashDays40.xml"); geoXml.parseKmlString(' Polygon 1 relativeToGround -93.46008301171878,31.329035778926478,0 -98.30505371484378,31.40065516914794,0 -97.37121582421878,30.106233605369603,0 -92.65808105859378,30.14749530904506,0 '); working example (with 4 files)
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/26991406

http://stackoverflow.com/comment/42509797
has text: Have you tried selecting #task-categories-select, and binding it with the .on('',function(){}) method? (Instead of selecting the subset element from the document)
score: 0
comment on: http://stackoverflow.com/q/26963398
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42254209
type: Comment
has text: Thanks again for helping me out, I appreciate it. The problem is not in the omitted code, because I have access to this.map everywhere else, the problem is where I set `pointToLayer : _this.scalePoint` that I call without passing any parameters. If anyone could explain how that works, and how the function get access to the parameters (feature, latlng) without me passing them in, I can figure the rest out myself :)
comment on: http://stackoverflow.com/a/26841288
score: 0
type: AnswerComment

http://stackoverflow.com/a/26851446
score: 0
has comment: http://stackoverflow.com/comment/42265900
accepted answer of: http://stackoverflow.com/q/26851353
answers question: http://stackoverflow.com/q/26851353
type: Answer
has comment: http://stackoverflow.com/comment/42294490
type: AcceptedAnswer
has body: The way that I always do it is to expose properties in your JavaScript file for those URLs. Then when you instantiate that code on your HTML page, allow Razor to set those properties. In your JavaScript: var Widget = function () { var init = function(url1, url2); // Do stuff return { init: init } }; Then in your .cshtml page, do this: &lt;script type="text/javascript"&gt; Widget.init('@Url.Action("Method", "Controller")', '@Url.Action("Method2", "Controller")'); // Assigning directly to the Widget object Widget.url3 = '@Url.Action("Method3", "Controller")'; &lt;/script&gt;
has comment: http://stackoverflow.com/comment/42265840

http://stackoverflow.com/comment/42240545
score: 0
type: Comment
has text: is it possible to give all the values to the parent option ?
comment on: http://stackoverflow.com/a/26837543
type: AnswerComment

http://stackoverflow.com/comment/42266390
type: Comment
score: 1
has text: @georg: the JSON.parse(JSON.stringify(x)) trick works for deep non-custom objects..
type: AnswerComment
comment on: http://stackoverflow.com/a/26851970

http://stackoverflow.com/a/26870878
upvote count: 1
has comment: http://stackoverflow.com/comment/42304326
has body: The problem here is that you do not increment startItem until you receive a response. Your code is probably making multiple requests with startItem === 1 before the first response is even received, and so you will get some really weird behavior (probably will get duplicate responses, and you will only get the first few pages of data). Avoid using synchronous calls because they will tie up other resources (like javascript). In this case if you want to insure that you get the data in order, you can make it a serial chain of AJAX calls. To get serial behavior and enjoy the benefits of AJAX, instead of using a loop make your callback function do the next AJAX request after incrementing startItem. This is easier if you organize your code into functions. To wit: function GetData() { $.ajax({ type: "POST", url:server url here, data:"creativeID=test&amp;CompanyId=BHSR&amp;StartItem="+startItem+"&amp;streetlocation="+choiceTown+"&amp;Location="+sectCode+"&amp;PriceMin="+choiceMin+"&amp;PriceMax="+choiceMax+"&amp;ListingType="+checkRB+"&amp;OpenHouse=false&amp;NewDev=false&amp;AuthenticationId=id&amp;ReturnTotal=false", dataType: "html", success: GetData_Callback }); } function GetData_Callback(data) { data=convert(data); $(data).find('Listing').each(function(){ results_xml.push($(this)); }); result_index=0; result_image_counter=1; startItem += 10; // increment startItem popResults(); if (startItem / 10 &lt; totalPages) { GetData(); // get next "page" of data } } var startItem = 1; // global variable will be mutated by GetData_Callback GetData(); // get first "page" of data To do this in parallel typically requires management of the parallel responses (you can use semaphores, etc.). For example (psuedo code) you could do something like this: var pages = []; var totalPages = GetTotalPages(); // request via ajax like you mentioned (function not shown) var pagesLoaded = 0; for(var i = 0; i &lt; totalPages; i++) { GetData(pageIdx); } function GetData(pageIdx) { $.ajax({ ..., succ…
type: Answer
has comment: http://stackoverflow.com/comment/42337792
has comment: http://stackoverflow.com/comment/42340866
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/26853362

http://stackoverflow.com/comment/42264113
type: QuestionComment
has text: I think this may also be a duplicate of: http://stackoverflow.com/questions/19812091/vimeo-player-api-play-video-with-javascript
comment on: http://stackoverflow.com/q/26850658
score: 0
type: Comment

http://stackoverflow.com/comment/47151249
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26857846
has text: is there any update testing?

http://stackoverflow.com/a/26984937
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26984875
type: Answer
accepted answer of: http://stackoverflow.com/q/26984875
score: 2
downvote count: 0
has body: You have to specify both the object and the property when you delete it. It's not enough with just the value copied from the property that you pass to the function, so you can't do it in that function (unless you also pass in the object reference and the property name). for (x in user) { if (user[x]) { console.log("truthy"); } else { delete user[x]; } }
upvote count: 2

http://stackoverflow.com/q/26910164
has comment: http://stackoverflow.com/comment/42370765
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42370611
has comment: http://stackoverflow.com/comment/42370672
answer count: 0
has comment: http://stackoverflow.com/comment/42372267
has title: multiple nokia maps with infobubbles on one page
has body: I implemented several nokia maps on one page with several markers etc. To accomplish this I created a nokia map object containing the configs and functions needed and extended this object to have an object for each map. Works fine, I get all the markers shown in each map. The problem is, that the infobubble component can only be attached to one map / display. Im using nokia maps api 2.5.4 http://js.api.here.com/se/2.5.4/jsl.js A small js snippet how I initiate those maps: var map1, map2, .., var nokiaMap = { appId : ... authToken : ... infoBubbleContainer : new nokia.maps.map.component.InfoBubbles(), ... init : function(){....}, initMap : function() { var me = this; this.map = new nokia.maps.map.Display(document.getElementById(this.mapContainerId), { zoomLevel: zoom, components: [ new nokia.maps.map.component.Behavior(), new nokia.maps.map.component.ZoomBar (), new nokia.maps.map.component.TypeSelector(), new nokia.maps.map.component.ScaleBar(), me.infoBubbleContainer ], center : [this.lat, this.lon] ... } //call the maps map1 = jQuery.extend(true, {}, nokiaMap); map2 = jQuery.extend(true, {}, nokiaMap); ... The error message: Uncaught Error: IllegalArgument: Error: A component can only be attached to one display! Anyone got a solution for this problem or a workaround?
type: Question
has comment: http://stackoverflow.com/comment/42370561
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42371024

http://stackoverflow.com/q/26908452
has body: I did some manipulations and stored the values in arrays say, miles and type. Now I need to display it as an object with their own specific properties. Now I have obj ={ "miles" : [500,200], "type": ["fer","bug"] }; I need to return object in the format obj = { "fer" : 500 , "bug" : 200 }; Thanks. Any idea is appreciated!
answer count: 4
has title: Javascript object notation
has answer: http://stackoverflow.com/a/26908535
type: Question
downvote count: 5
tagged with: javascript
has answer: http://stackoverflow.com/a/26908506
has comment: http://stackoverflow.com/comment/42366996
has answer: http://stackoverflow.com/a/26908507
favorite count: 0
type: UnansweredQuestion
score: -4
has answer: http://stackoverflow.com/a/26908590
upvote count: 1
has comment: http://stackoverflow.com/comment/42366862

http://stackoverflow.com/comment/42482663
comment on: http://stackoverflow.com/a/26973537
type: Comment
has text: Hrm..strange, there should be nothing specific to the framework. Can you try accessing your js file by typing out the path in the browser? Hard to tell without seeing your project, but this should work to load any script, asset or CSS file. Maybe there is a path issue. Did you try this link out? http://www.sitepoint.com/getting-started-mobile-angular-ui/
score: 0
type: AnswerComment

http://stackoverflow.com/a/26989275
answers question: http://stackoverflow.com/q/26989111
has comment: http://stackoverflow.com/comment/42510501
has comment: http://stackoverflow.com/comment/42510438
score: 2
downvote count: 0
type: Answer
has body: Place it inside your controller with the scope: FF.controller( 'contactListController', ['$scope', '$rootScope', $element, function( $scope, $rootScope, $itemElement ) { $scope.chatWithUser = function( currentContact ) { AppManager.startConversation( currentContact.id ); } $scope.popoverHide = true; $scope.contactItemClick = function( event ) { console.log('test'); // prints. $scope.popoverHide = !$scope.popoverHide; event.stopPropagation(); }; }
upvote count: 2

http://stackoverflow.com/q/26848297
has comment: http://stackoverflow.com/comment/42261230
has body: I have a D3JS visualization that's working by reading in a CSV file with the d3.csv method. Up until now, I've been storing my d3 code and the CSV in the same subdirectory, under web root. Ideally, though, I'd like to protect the CSV from download by users using only their browsers. As of now, they can go through my JS code and discover the location, then just download it. I tried to create a subdirectory under document root and reference it in my D3 code with something like "../d3data/mydata.csv". For some reason, D3 still interprets this as being under public_html. All of this stuff is being hosted in a subdirectory on a Wordpress site, so I'm leery of changing any of my central .php files or .htaccess. Any help?
answer count: 0
tagged with: d3.js
type: UnansweredQuestion
score: 0
has title: How can I protect my D3 data CSV from download by my users?
type: Question
tagged with: apache
tagged with: javascript
has comment: http://stackoverflow.com/comment/42259539

http://stackoverflow.com/q/26982888
answer count: 0
has comment: http://stackoverflow.com/comment/42510071
type: Question
tagged with: google-maps
tagged with: javascript
has title: Leaflet: How can I adjust the width to height ratio of the map
score: 0
has comment: http://stackoverflow.com/comment/42645505
has body: Here I have the global data and the step for latitude and longitude is 0.5. In this way, I have a 360*720(lat*lng) size data. However, when I map my data as an image overlay on the leaflet map and also use method: map.latLngToLayerPoint for converting the layer point to the geographical map points, I find there will emerge many white stripes in the latitude direction. Obviously, it is caused by the improper scale from 360 to 512 in the lat direction. So I want to change the width to height ratio of the map so that I can keep that when the length of the image overlay is 512, the height of the image is 256 instead of 512 too. Is that any existed method in leaflet for this question? Thank you very much!
has comment: http://stackoverflow.com/comment/42646297
type: UnansweredQuestion
tagged with: leaflet

http://stackoverflow.com/q/26976805
tagged with: fullcalendar
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/11537525
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26977086
has body: I have a json file with events, which are loaded in fullcalendar.js . I want to add an image to each event (before the timestamp of the event). I already looked up a solution on here: solution, but it didn't give me the answer because I think fullcalendar updated after that. I like to know these things: First of all: the 'img src' attribute, do I need to reference path from my HTML file or javascript file? Second: I think the .fc-event-title tag was removed from the CSS file, because I can't seem to find in the CSS file. Thanks in advance and sorry for the lack of knowledge.
upvote count: 1
has title: Add image to an event - Full Calendar
accepted answer: http://stackoverflow.com/a/26977086
type: Question
score: 1
tagged with: javascript

http://stackoverflow.com/comment/42502685
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/26982809
has text: also, in `OpenTutorial` function add `alert($("#anc_OpenTutorial").length);` as first line
type: Comment

http://stackoverflow.com/q/26935548
has comment: http://stackoverflow.com/comment/42607839
tagged with: ajax
tagged with: extjs
answer count: 2
has comment: http://stackoverflow.com/comment/42628088
has body: I have a grid Panel in my code as: Ext.create('Ext.grid.Panel', { id : 'frPanel-' + interfaceId, store : frStore, columns : [ { text : 'Sequence', dataIndex : 'ruleId', menuDisabled : true }, { text : 'Source', dataIndex : 'source', renderer : function(value, metaData) { var newValue = convertObjValue(value); if (newValue.match(/[-]+/i)) { metaData.tdAttr = 'data-qtip="' + networkStore(value) + '"'; } return newValue; } }, // paging bar at the bottom dockedItems : [ { xtype : 'pagingtoolbar', store : frStore, // same store GridPanel is using dock : 'bottom', displayInfo : true } ], height : 300, width : '100%', forceFit : true, renderTo : 'frContainer-' + interfaceId }); And these are the helper function i have: // To get the value after 2nd colon for object and object-group function convertObjValue(value) { var result; var exp = /.*?:.*?:(.*)/i; var newValue = value; if ((result = exp.exec(value)) != null) { if (result.index === exp.lastIndex) { exp.lastIndex++; } newValue = result[1]; } return newValue; } The store: function networkStore(value) { //var store = Ext.create('Ext.data.Store', { var store = new Ext.data.Store({ model : 'networkModel', autoLoad : { timeout : 60000 }, proxy : { type : 'ajax', url : networkObjsURL + "&amp;" + Ext.urlEncode({ 'peId' : value }), reader : { type : 'json', idProperty : 'objValue' }, } }); var hoverOutput = ""; if(store.data.length &gt; 0){ store.data.items.forEach(function(item) { hoverOutput += item.data.objectValue + "&lt;/br&gt;"; }); } console.log(hoverOutput); return hoverOutput; and last but not the least is the model: Ext.define('networkModel', { extend : 'Ext.data.Model', fields : [ { name : 'objectValue' } ] }); Now comes the issue. The problem is when i dont place the breakpoint in the browser in store, the values wont show up in qtip. Im guessing thats because of the grid panel not waiting for the response back from the store after ajax response. Can someone help me figure out a workaround for this situation? Thank…
has answer: http://stackoverflow.com/a/27094144
favorite count: 0
has comment: http://stackoverflow.com/comment/42689972
type: UnansweredQuestion
has title: ExtJS Ajax problems for grid panel
has comment: http://stackoverflow.com/comment/42436629
score: 3
has answer: http://stackoverflow.com/a/26970847
downvote count: 1
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/42674523
tagged with: javascript

http://stackoverflow.com/comment/42264508
type: AnswerComment
comment on: http://stackoverflow.com/a/26845256
type: Comment
has text: Of-curse Im checking it in real environment. I think the problem is that the src variable is getting a [object Object] value. I've tried to print the value of src in a tag and it gives a [object Object] not an actual link/string
score: 0

http://stackoverflow.com/a/26873092
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42304550
has comment: http://stackoverflow.com/comment/42304762
type: Answer
score: 2
has body: Use call. When used, it will allow you to bind the this context from World to the called hello function in Player. function Player(x, y) { this.x = x; this.y = y; this.hello = function() { alert("Hello, " + this.npc); // World npc property } } function World() { this.player = new Player(0, 0); this.npc = "villager"; this.player.hello.call(this); } new World();
upvote count: 2
answers question: http://stackoverflow.com/q/26872982
accepted answer of: http://stackoverflow.com/q/26872982

http://stackoverflow.com/q/26944839
type: UnansweredQuestion
has body: I am using three.js and the scene is not rendering. I am getting following errors in console: THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera. Uncaught SecurityError: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The cross-origin image at file:///F:/Study/3rd%20Sem/ES%20XXX%20-20Intro%20to%20Computer%20Graphics/Stick%20Baddy/images/crate.jpg may not be loaded. Here are some of my code snippets: Camera: var scene = new THREE.Scene(); // Create a Three.js scene object var camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 1000); Light: var light = new THREE.DirectionalLight( 0xffffff ); light.position.set( 0, 1, 1 ).normalize(); scene.add(light); Adding a cube: var geometry = new THREE.CubeGeometry(stickLenX, 20, 20); var material = new THREE.MeshPhongMaterial( { map: THREE.ImageUtils.loadTexture('images/crate.jpg', {}, function() { renderer.render(scene); }) } ); var myStick = new THREE.Mesh(geometry, material); // Create a mesh based on the specified geometry (myStick) and material (normal). scene.add(myStick); // at (0,0,0) Rendering: var render = function () { document.addEventListener('mousemove', onDocumentMouseMove, false); move(); renderer.render(scene, camera); // Each time we change the position of the cube object, we must re-render it. requestAnimationFrame(render); }; render(); It works fine with THREE.MeshNormalMaterial() Like var material = new THREE.MeshNormalMaterial(); In my code, there are other cubes and spheres, too. Could any of them be causing the problem? Please can anybody mention what could be the problem? --------UPDATE:---------- Running the file with Wampserver worked. What is the reason for that and how to make it work without server?
tagged with: camera
has title: Error in three.js : camera is not an instance of THREE.Camera
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/50808972
type: Question
upvote count: 4
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/42477640
has answer: http://stackoverflow.com/a/26946935
favorite count: 0
tagged with: three.js
has comment: http://stackoverflow.com/comment/42444217

http://stackoverflow.com/q/26863465
has comment: http://stackoverflow.com/comment/42287584
has comment: http://stackoverflow.com/comment/42287610
has comment: http://stackoverflow.com/comment/42286727
tagged with: jshint
has comment: http://stackoverflow.com/comment/42286783
score: 0
tagged with: function
tagged with: javascript
type: UnansweredQuestion
has title: jshint "function" is defined but never used or how to declare a function
answer count: 0
has comment: http://stackoverflow.com/comment/42286954
type: Question
has body: im getting the jshint notification line 1 col 10 'popUp' is defined but never used. the js looks like that: function popUp(e, element) { do.something(); }; it would be easy to change the jshint config to /* jshint unused:false */ but i want to see if there are other variables which arent used? do i have to improve my function declartion or is it jshint? edit i boiled it down to two failures, these are the functions who are called in the html file onmousemove or mouseover...
has comment: http://stackoverflow.com/comment/42286811
has comment: http://stackoverflow.com/comment/42287451

http://stackoverflow.com/q/26958164
has comment: http://stackoverflow.com/comment/52692364
score: -1
type: Question
upvote count: 0
tagged with: function
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/42455497
has comment: http://stackoverflow.com/comment/42455287
tagged with: chaining
has body: I want to build a library, that is similiar to jquery example of calling the function $('#myDiv'); $('#myDiv').hide(); I am using a template from here (function () { var Q = function (params) { return new Library(params); }; var Library = function (params) { var selector = document.querySelectorAll(params), i = 0; this.length = selector.length; for (; i &lt; this.length; i++) { this[i] = selector[i]; } return this; }; Q.fn = Library.prototype = { hide: function () { var len = this.length; while (len--) { this[len].style.display = 'none'; } return this; }, show: function () { var len = this.length; while (len--) { this[len].style.display = 'block'; } return this; } }; if(!window.Q) { window.Q = Q; } })(); It works perfectly But if I want to get an HTML-Element by selector I have to call $('#myDiv')[0] // Returns the element instead of calling $('#myDiv') // Returns an object How can I get my element without the annoying '[0]' by default?
has comment: http://stackoverflow.com/comment/42455778
has title: jquery like function get element
has answer: http://stackoverflow.com/a/26958999
type: UnansweredQuestion
downvote count: 1

http://stackoverflow.com/comment/42339885
score: 0
comment on: http://stackoverflow.com/q/26893043
type: Comment
type: QuestionComment
has text: Can you please let me know why did you vote down this question?

http://stackoverflow.com/comment/42516491
has text: Edited my answer, please try
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26991855

ecmascript-5
tags question: http://stackoverflow.com/q/26908490
tags question: http://stackoverflow.com/q/26899787
tags question: http://stackoverflow.com/q/26908705
tag name: ecmascript-5
tags question: http://stackoverflow.com/q/26909200
type: Tag

http://stackoverflow.com/a/26985470
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: .push() is not a valid jQuery function. hrefObjects is a jQuery object, not an array. Simplify it to: $(document).ready(function() { $("li a, .welcome-btn, #logo").on("click", null, function(e) { $('html, body').animate({ scrollTop: 0 }, 750, "easeInOutQuart"); return false; // prevents default }); });
answers question: http://stackoverflow.com/q/26985416

http://stackoverflow.com/a/26846267
accepted answer of: http://stackoverflow.com/q/26846069
score: 1
has body: The difference lies in the type of the argument you pass. typeof apple //"string" typeof orange //"object" When passing string literals, you're passing immutable data, and it is passed by value, hence it cannot change. EDIT: That is, the data that window.apple points to cannot change. The only way to change window.apple is to point it to some new data. window.apple = "something new";
downvote count: 1
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/26846069
has comment: http://stackoverflow.com/comment/42334694
upvote count: 2

http://stackoverflow.com/q/26864044
has answer: http://stackoverflow.com/a/26864200
has answer: http://stackoverflow.com/a/26864156
type: Question
has answer: http://stackoverflow.com/a/26864157
has body: Say I have this array: var myArray = [ { "name": "item 1", "id": 123 },{ "name": "item 2", "id": 456 } ]; What would be the proper way to get an item based on the id property? With this example, say I know I want the item for which item.id == 456. I don't want jquery answers.
score: 0
tagged with: arrays
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26864156
has answer: http://stackoverflow.com/a/26864141
answer count: 4
possible better answer: http://stackoverflow.com/a/26864141
has title: Select item of array of objects from deep property
tagged with: object
type: AnsweredQuestion

http://stackoverflow.com/q/26986582
tagged with: javascript
has comment: http://stackoverflow.com/comment/42506438
has comment: http://stackoverflow.com/comment/42506660
linked to: http://stackoverflow.com/q/2700000
has comment: http://stackoverflow.com/comment/42506250
has comment: http://stackoverflow.com/comment/42506347
answer count: 2
has comment: http://stackoverflow.com/comment/42506220
accepted answer: http://stackoverflow.com/a/31250236
has comment: http://stackoverflow.com/comment/42506723
downvote count: 0
linked to: http://stackoverflow.com/q/6190143
has title: How to keep text from being selected
favorite count: 0
linked to: http://stackoverflow.com/q/3779534
linked to: http://stackoverflow.com/q/826782
upvote count: 2
has comment: http://stackoverflow.com/comment/42506245
has comment: http://stackoverflow.com/comment/42506249
tagged with: obfuscation
has body: I've googled and searched around here on SO, but haven't found an answer to this question. I know that this can be done using user-select:none with CSS, but as you can see, this is not a standard property, and I'm trying to find an alternative. NOTE: I don't care if the users can get the text. It's for the design of the site, not to keep users from copy/paste. I know that this CAN be done with JS. I do not know it it's difficult, or how to do it, but if you type HTML or JS code into the HTMLObfuscator, there is an option on the left that can disable text selection. Is this easy to implement into certain parts of my site? Or is it rather complicated (like in the obfuscator)? Thank you for all your help . . .
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/26987192
has comment: http://stackoverflow.com/comment/42506476
has answer: http://stackoverflow.com/a/26987192
has answer: http://stackoverflow.com/a/31250236
tagged with: textselection
type: Question
has comment: http://stackoverflow.com/comment/42507066

http://stackoverflow.com/q/26919445
has answer: http://stackoverflow.com/a/26920700
accepted answer: http://stackoverflow.com/a/26920700
has answer: http://stackoverflow.com/a/26919547
type: Question
has comment: http://stackoverflow.com/comment/42387322
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/42387118
has comment: http://stackoverflow.com/comment/42387182
has title: Is this a correct JSON string?
downvote count: 10
has body: I am not quite clear on how to make a JSON string. I get error and I want to find out how to correct and it make it. This is my JSON string: var drivers = { "driver" : [ { "id" : 1, "name" : "Bob", "age" : "34" "car" : [ { "make" : "BMW", "model" : "3.20", "colour" : "Silver" } ] }, { "id" : 2, "name" : "Rob", "age" : "22" "car" : [ { "make" : "Peugeot", "model" : "306", "colour" : "Blue" } ] }, { "id" : 3, "name" : "Maria", "age" : "23", "car" : [ { "make" : "Mazda", "model" : "3", "colour" : "Red" } ] }]}; This is the get method: var driverData = JSON.parse(drivers); function getDriverData() { return driverData; } return { getDriverData: getDriverData }; And in this controller I try to get it so I can see if it works: var drivers = myDriveApi.getDriverData(); console.log(driverData); Correct me and explain how to make a JSON string, and I want it nested if that's the right term. So each driver has a car, or multiple cars/vehicles. So if I get 1 driver, I want to see his details and his information on owned vehicles.
has comment: http://stackoverflow.com/comment/42387137
answer count: 3
has comment: http://stackoverflow.com/comment/42387218
upvote count: 0
possible better answer: http://stackoverflow.com/a/26919529
tagged with: javascript
has answer: http://stackoverflow.com/a/26919529
favorite count: 0
tagged with: angularjs
score: -10
has comment: http://stackoverflow.com/comment/42387115
type: AnsweredQuestion

http://stackoverflow.com/q/26964846
has body: I'm trying to get the full path of a chrome fileSystem fileEntry. I'm trying to use getDisplayPath to get the "full path of the file or directory on the local file system," but all that get's returned is ~/Documents/current_directory What I was hoping it would be is: /home/user/Documents/current_directory, or in other words, it's missing the home directory, and using ~ instead. I want to get the absolute path of a file so that I can view it via url in the chrome browser. I can use the chrome tabs api to do this: var url = "file:///home/user/Documents/folder/file"; chrome.tabs.create({url: url}, function(tab) { }); I need to give it an exact url. According to this: Display full path instead of ~ prefixed path in linux chrome apps, a solution to my question may not exist. I will accept any answer that helps me get the absolute path of a file or folder that exists in an arbitrary directory that a user selected using chrome's chrome.fileSystem.chooseEntry function. Since a true solution may not exist, I will also accept clever/workaround answers (for example, the very least I can do is use a text input to ask a user for a string representing their home directory).
has answer: http://stackoverflow.com/a/26970252
favorite count: 0
tagged with: google-chrome-app
tagged with: angularjs
has title: getting full absolute path of a directory or file on a user's local system in chrome extension or app
linked to: http://stackoverflow.com/q/23361959
has comment: http://stackoverflow.com/comment/42489951
has answer: http://stackoverflow.com/a/30583691
accepted answer: http://stackoverflow.com/a/30583691
has comment: http://stackoverflow.com/comment/42545173
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42487854
score: 1
has comment: http://stackoverflow.com/comment/42489582
upvote count: 1
tagged with: google-chrome
possible better answer: http://stackoverflow.com/a/26970252
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/42487617
downvote count: 0
tagged with: javascript
tagged with: google-chrome-extension

http://stackoverflow.com/q/26838762
has title: System does not support the specified encoding
type: UnansweredQuestion
has body: My project has one page, but when i am trying to access that page through weblogic server it was working absolutely fine but when i am trying to access the same page with help of jboss, i am getting error like system doesn't support the specific encoding. Below is the code :- &lt;script language="javascript" type="text/javascript"&gt; var properties_xmlDoc = null; var pwPrefix = 'password_'; function loadProperties() { var oXSLContainer = findObject("propertiesXSL"); var oXMLContainer = findObject("propertiesXML"); var oHTMLContainer = findObject("propertiesContainer"); var sortPropertiesXSL = findObject("sortPropertiesXSL"); if (properties_xmlDoc == null) { properties_xmlDoc = loadXMLFromString(oXMLContainer.value); } properties_xmlDoc.transformNodeToObject(sortPropertiesXSL, properties_xmlDoc); findObject("propertiesXML").value = properties_xmlDoc.xml; oHTMLContainer.innerHTML = new String(properties_xmlDoc.transformNode(oXSLContainer)); #if($inlinePropertiesEditor) findObject("propValueDiv").innerHTML = findObject("propertyValueString").innerHTML; #end } i am trying to debug this page with the help of IE debugger the below line throwing error as:- "System does not support the specified encoding" properties_xmlDoc.transformNodeToObject(sortPropertiesXSL, properties_xmlDoc); Any leads would be appreciated.
tagged with: http://stackoverflow.com/tag/xml
has comment: http://stackoverflow.com/comment/42294128
answer count: 0
linked to: http://stackoverflow.com/q/10228764
has comment: http://stackoverflow.com/comment/42316279
tagged with: xslt
type: Question
tagged with: encoding
tagged with: javascript
tagged with: jboss
has comment: http://stackoverflow.com/comment/42243521
score: 0

http://stackoverflow.com/comment/42425109
type: QuestionComment
comment on: http://stackoverflow.com/q/26940320
has text: @Madbreaks - you're not getting it, the `html` method replaces the content immediately when the document is ready, but it's completely useless here, as one could just place the condition directly in PHP and replace the HTML without using any javascript at all. I'm aware that ajax can fetch content from the server BTW.
score: 0
type: Comment

http://stackoverflow.com/comment/42501944
type: Comment
score: 0
type: AnswerComment
has text: Je suis originaire du Val d'Oise, mais ça m'étonnerait beaucoup que ça ait été moi :)
comment on: http://stackoverflow.com/a/26964362

http://stackoverflow.com/comment/42382045
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26916669
has text: @isherwood lol, I know what you mean, but we don't know the whole story of this project. Maybe the user has the decimal form already
score: 0

twitter-bootstrap-3
tags question: http://stackoverflow.com/q/26976812
tags question: http://stackoverflow.com/q/26840578
tags question: http://stackoverflow.com/q/26921742
tag name: twitter-bootstrap-3
tags question: http://stackoverflow.com/q/26911058
tags question: http://stackoverflow.com/q/26957901
tags question: http://stackoverflow.com/q/26833027
tags question: http://stackoverflow.com/q/26977783
tags question: http://stackoverflow.com/q/26920653
tags question: http://stackoverflow.com/q/26916185
type: Tag
tags question: http://stackoverflow.com/q/26892464
tags question: http://stackoverflow.com/q/26868454
tags question: http://stackoverflow.com/q/26879243
tags question: http://stackoverflow.com/q/26841084
tags question: http://stackoverflow.com/q/26963748
tags question: http://stackoverflow.com/q/26873265
tags question: http://stackoverflow.com/q/26961857
tags question: http://stackoverflow.com/q/26910870
tags question: http://stackoverflow.com/q/26896115
tags question: http://stackoverflow.com/q/26883966

http://stackoverflow.com/comment/42293856
comment on: http://stackoverflow.com/q/26867244
type: Comment
score: 0
has text: Is the element with .sub-nav-list really a child of .click?
type: QuestionComment

http://stackoverflow.com/comment/42488524
has text: In general use you would very rarely need to amend `processData`. I would leave it omitted to use the default (which is `true`).
comment on: http://stackoverflow.com/a/26976530
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/42388910
has text: Inner html means? @Oleg
comment on: http://stackoverflow.com/q/26886117
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42422345
has text: no, when i've writen corrected, mean that you was correct in respect of the field name "user_name", but the problem persist.
comment on: http://stackoverflow.com/a/26935921
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/26935807
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26935878
score: 0
answer count: 1
has body: I am trying to show a loading indicator whenever a user clicks the save button. When the button is clicked, the state changes successfully, but reverting back the value of the loading property on scope to the false state doesn't update the UI. Is it something i'm doing wrong with scope properties, or is this a flaw with angular? Here's my jsBin: http://jsbin.com/xafexorope/2/edit?html,output
tagged with: angularjs
has title: Angular binding for loading doesn't update the HTML
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26935878

http://stackoverflow.com/comment/42246181
has text: +1 for being the only answer to actually give the name of the operator.
type: Comment
comment on: http://stackoverflow.com/a/26840996
score: 0
type: AnswerComment

http://stackoverflow.com/a/74679374
type: Answer
answers question: http://stackoverflow.com/q/26898941
score: 0
has body: The viewController ViewController: UIViewController, WKUIDelegate, WKNavigationDelegate Enable JavaScript webView.configuration.preferences.javaScriptEnabled = true In the ViewDidLoad() Function add the below items webView.uiDelegate = self webView.navigationDelegate = self view.addSubview(webView) Add the delegate as follows func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping () -> Void) { let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert) let title = NSLocalizedString("OK", comment: "OK Button") let ok = UIAlertAction(title: title, style: .default) { (action: UIAlertAction) -> Void in alert.dismiss(animated: true, completion: nil) } alert.addAction(ok) present(alert, animated: true) completionHandler() }

http://stackoverflow.com/comment/42466649
type: QuestionComment
comment on: http://stackoverflow.com/q/26964434
type: Comment
has text: You can include external resources using the "External Resources" tab on the left of the fiddle. There is no point creating a fiddle if it does not reproduce the problem.
score: 2

http://stackoverflow.com/comment/42270586
type: AnswerComment
comment on: http://stackoverflow.com/a/26854020
has text: @Just_A_Mainer Did you remove the curly brace as well? It should look like `else {`
type: Comment
score: 0

http://stackoverflow.com/q/26834799
has comment: http://stackoverflow.com/comment/42236759
tagged with: ruby-on-rails-4
has comment: http://stackoverflow.com/comment/42236331
answer count: 1
has title: Paperclip avatar displays image title, not image
accepted answer: http://stackoverflow.com/a/26835697
tagged with: ruby
has comment: http://stackoverflow.com/comment/42236638
has comment: http://stackoverflow.com/comment/42236346
has answer: http://stackoverflow.com/a/26835697
has comment: http://stackoverflow.com/comment/42236792
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42236265
has comment: http://stackoverflow.com/comment/42236221
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/42236797
has comment: http://stackoverflow.com/comment/42236358
has comment: http://stackoverflow.com/comment/42236619
type: Question
has body: I recently cloned my application onto a new computer, and downloaded Imagemagick. I'm using the Paperclip gem to add avatars to Users. On the old computer Paperclip worked perfectly, but on the new one, though the User appears to save the avatar, &lt;%= image_tag @user.avatar_url(:size) %&gt; displays the image's title, not the image itself. The only thing I can think of is that I may have downloaded a different form of Imagemagick, because everything else I bundle installed. Does anyone with Paperclip experience know what might be causing this? Avatars are saved in my application/public/system/users/avatars/000/000 folder. views/users/crop.html.erb &lt;% content_for(:head) do %&gt; &lt;%= stylesheet_link_tag "jquery.Jcrop" %&gt; &lt;%= javascript_include_tag "jquery.Jcrop.min" %&gt; &lt;script type="text/javascript" charset="utf-8"&gt; ready = $(function() { $("#cropbox").Jcrop(); }); &lt;/script&gt; &lt;% end %&gt; $(document).ready(ready); $(document).on('page:load', ready); &lt;%= image_tag @user.avatar.url(:large), :id =&gt; "cropbox" %&gt; Gemfile: gem "paperclip", :git =&gt; "git://github.com/thoughtbot/paperclip.git" # ... models/user.rb class User &lt; ActiveRecord::Base has_attached_file :avatar, :styles =&gt; { :large =&gt; "500x500", :medium =&gt; "300x300&gt;", :thumb =&gt; "50x50!" }, :default_url =&gt; "/images/:style/missing.png" validates_attachment_content_type :avatar, :content_type =&gt; /\Aimage\/.*\Z/ # ... controllers/users.rb class UsersController &lt; ApplicationController def create # ... if @user.save render :action =&gt; "crop" else flash[:notice] = "Failed" redirect_to new_user_path end end private def user_params params.require(:user).permit(:name, :avatar) end views/users/new.html.erb &lt;%= form_for @user, :url =&gt; users_path, :html =&gt; { :multipart =&gt; true } do |f| %&gt; &lt;%= f.text_field :name, :placeholder =&gt; "Name" %&gt; &lt;br&gt; &lt;%= f.label :display_picture %&gt; &lt;%= f.file_field :avatar %&gt; &lt;br&gt; &lt;%…
tagged with: javascript
has comment: http://stackoverflow.com/comment/42236767
tagged with: paperclip
score: 0

http://stackoverflow.com/q/26860716
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/26875221
has body: I just installed the jQuery-form-validator in my project using bower install jquery-form-validator --save and then I ran grunt wiredep. The package was correctly added to bower_components and to the bower.json file, but in the generated HTML, it points to the wrong directory. Grunt wiredep added the following line: while it should be: What is the best way to fix this? Should I just manually place the files in the right directory or can I configure something in Bower to make it point to the right path?
tagged with: bower
type: AnsweredQuestion
tagged with: gruntjs
has title: Bower points to wrong path (jQuery-form-validator)
type: Question
has answer: http://stackoverflow.com/a/26875221

http://stackoverflow.com/comment/42344946
type: Comment
has text: @ZackArgyle That looks like the way to handle it. Thanks EliteOctagon and Pepijn. I will re-architect my controller now.
comment on: http://stackoverflow.com/a/26895645
score: 1
type: AnswerComment

http://stackoverflow.com/q/26975991
has comment: http://stackoverflow.com/comment/42486850
type: Question
answer count: 2
upvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: replace
accepted answer: http://stackoverflow.com/a/26978480
has title: How can I change id in string
favorite count: 0
downvote count: 8
score: -8
possible better answer: http://stackoverflow.com/a/26976110
has answer: http://stackoverflow.com/a/26976110
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26978480
has body: I have this js vars: tab[1] = ' 1 name 1 100.00 '; tab[2] = ' 2 name 1 100.00 '; tab[3] = ' 5 name 1 100.00 '; tab[4] = ' 7 name 1 100.00 '; How can I use js replace to replace ID and first column in each of this vars? The result should look like this: tab[1] = ' 1 name 1 100.00 '; tab[2] = ' 2 name 1 100.00 '; tab[3] = ' 3 name 1 100.00 '; tab[4] = ' 4 name 1 100.00 '; @edit I tried with simple replace: `tab[i]=tab[i].replace('id="'+k+'"> '+k+' ', 'id="'+i+'"> '+i+' ');` but id may be any digit so it not work in all cases :/

http://stackoverflow.com/comment/42458688
has text: Thank you very much. Without you, I would long to understand recursion.
type: AnswerComment
comment on: http://stackoverflow.com/a/26940931
score: 0
type: Comment

http://stackoverflow.com/q/26916658
answer count: 1
tagged with: google-plus
tagged with: google-api
has answer: http://stackoverflow.com/a/26918678
type: AnsweredQuestion
score: 0
type: Question
accepted answer: http://stackoverflow.com/a/26918678
tagged with: javascript
has body: Ok, so on the front page of the google plus api, it clearly states that the API is for read only for public data. If that's true, then what does it mean to insert a moment? When I read through the moments documentation, it seems like it's an API to allow writing to google plus. Am I missing something? Asking because I've been attempting to use the ReviewAction moment API to post a review, but have not been successful. My code seems to be working and I'm receiving no error messages, but the review will not show up on the page. Thanks!
has title: Google+ API read only - what is inserting a moment?

http://stackoverflow.com/comment/42392812
comment on: http://stackoverflow.com/q/26922508
score: 0
type: Comment
type: QuestionComment
has text: No, I couldn't. SO is not a free code-writing service, notwithstanding what some posters and responders seem to think.

http://stackoverflow.com/comment/42466620
type: QuestionComment
has text: I know the error is only in the subtraction (all other data computes correctly) and sorry bout the head section :(
score: 0
comment on: http://stackoverflow.com/q/26964115
type: Comment

typeahead
type: Tag
tags question: http://stackoverflow.com/q/26974309
tag name: typeahead

http://stackoverflow.com/comment/42335206
type: QuestionComment
score: 2
has text: By counting. Async tasks need to be registered with the event loop, and they can be cancelled as well. See the [`unref` and `ref` methods of timers](http://nodejs.org/api/timers.html#timers_unref) for an example.
comment on: http://stackoverflow.com/q/26889873
type: Comment

http://stackoverflow.com/q/26876994
has comment: http://stackoverflow.com/comment/42311180
tagged with: jquery
favorite count: 0
tagged with: ajax
type: Question
has body: $(document).ready(function(){ $('.clickthetext').click(function(){ $.post("submit.php", $("#formbox").serialize(), function(response) { $('#content').html(response); }); return false; }); }); My target to pass content from the form and edit the data and show response at current page. .clickthetext button content: Click here to see the result content inside id #formbox: Part of the form inside this id. rest of the form is out side this id will be processed later. only content/input inside of id "formbox" will be processed. Whatever response we will get, we will show inside of "#content" id. What i am doing wrong here? ----edit---- i didn't add anything on submit.php only to show response, i wrote there: <?php echo 'somthing blah blah blah something'; ?>
has comment: http://stackoverflow.com/comment/42311182
has comment: http://stackoverflow.com/comment/42311222
tagged with: php
score: -1
answer count: 2
has answer: http://stackoverflow.com/a/26877093
possible better answer: http://stackoverflow.com/a/26877147
has comment: http://stackoverflow.com/comment/42311298
downvote count: 1
has answer: http://stackoverflow.com/a/26877147
has comment: http://stackoverflow.com/comment/42311201
has comment: http://stackoverflow.com/comment/42311220
tagged with: javascript
has title: Why this ajax call is not working?
accepted answer: http://stackoverflow.com/a/26877093
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/42311257

http://stackoverflow.com/q/26876401
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/26876456
has comment: http://stackoverflow.com/comment/42310368
answer count: 4
upvote count: 11
has answer: http://stackoverflow.com/a/26876482
score: 11
tagged with: recursion
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26876554
linked to: http://stackoverflow.com/q/24631041
has title: Is this recursion or not
has comment: http://stackoverflow.com/comment/42310274
accepted answer: http://stackoverflow.com/a/26876554
has answer: http://stackoverflow.com/a/27760816
type: Question
has body: function x(){ window.setTimeout(function(){ foo(); if(notDone()){ x(); }; },1000); } My concern being unbounded stack growth. I think this is not recursion since the x() call in the timer results in a brand new set of stack frames based on a new dispatch in the JS engine. But reading the code as an old-fashioned non JS guy it makes me feel uneasy One extra side question, what happens if I scheduled something (based on math rather than a literal) that resulted in no delay. Would that execute in place or would it be in immediately executed async, or is that implementation defined
linked to: http://stackoverflow.com/q/17090292
downvote count: 0
has answer: http://stackoverflow.com/a/26876456

http://stackoverflow.com/q/26883446
answer count: 1
downvote count: 0
has title: Raphael.js animate of image doesn't repaint in chrome
favorite count: 0
has answer: http://stackoverflow.com/a/26921671
has comment: http://stackoverflow.com/comment/42322710
has comment: http://stackoverflow.com/comment/42361638
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42328707
score: 1
has body: It seems to happen only when I try to animate an image on Chrome. All I want to do is make an image to move back an forth in Raphaël.js. I created a jsfiddle that illustrates the problem. I'm very sure that it used to work in Chrome since I use it to develop and it seems to be broken in later versions of Chrome. When I change the image to a rect for example it seems to render fine. When you resize the screen that contains the animation it repaints. http://jsfiddle.net/k69yzz0o/1/ var moveForth = function () { useControl.animate({x : 38, y: 0}, 900, moveBack); }; var moveBack = function () { useControl.animate({x : 0, y: 0}, 600, moveForth); }; var R = Raphael("holder", 500, 500); useControl = R.image("http://i.imgur.com/ta8zlD2.png", 0, 0, 189, 18); moveForth(); It only happens in Chrome and I use latest Raphael.js 2.1.2. How can I resolve this issue?
upvote count: 1
accepted answer: http://stackoverflow.com/a/26921671
type: Question
tagged with: javascript
tagged with: raphael

http://stackoverflow.com/a/26964363
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/42467101
has comment: http://stackoverflow.com/comment/42466573
type: Answer
accepted answer of: http://stackoverflow.com/q/26964235
answers question: http://stackoverflow.com/q/26964235
upvote count: 1
has comment: http://stackoverflow.com/comment/42467520
has comment: http://stackoverflow.com/comment/42467055
has comment: http://stackoverflow.com/comment/42466540
has body: There are few mistakes in your code. You are doing only 4 times you start at 1 and end at 4 (x&lt;5) Move the math that should run once after the loop You don't have to parseFloat sum, you can be sure it's a float already, it starts at 0 and you add only floats to it. Your code fixed: function Q1() { var scores = 0; var x = 1; alert("problem #2 find the average of five game scores"); while (x &lt;= 5) { scores += parseFloat(prompt("enter the score from game # " + x)); x++; } document.write(scores/5); } Or: function Q1() { var average = 0; alert("problem #2 find the average of five game scores"); for (var x=0; x &lt; 5; x++) average += parseFloat(prompt("enter the score from game # " + x))/5; document.write(average); } Even better, dont' hard-code the 5 function Q1(games) { var average = 0; alert("problem #2 find the average of five game scores"); for (var x=0; x &lt; games; x++) average += parseFloat(prompt("enter the score from game # " + x))/games; document.write(average); }
has comment: http://stackoverflow.com/comment/42467445
type: AcceptedAnswer

http://stackoverflow.com/comment/42251958
type: AnswerComment
has text: Thanks very much for your reply actually I alredy made it work . The last line is already doing what i wanted and it could just be embeded inthe html. The original code can be found here http://www.htmldrive.net/items/show/144/A-Drop-Down-with-Icon-CSS-and-jQuery.html
type: Comment
comment on: http://stackoverflow.com/a/26840200
score: 0

http://stackoverflow.com/comment/42279889
type: Comment
type: QuestionComment
has text: Maybe problem with it - Reflection not support anonymous inner classes.
comment on: http://stackoverflow.com/q/26846078
score: 0

http://stackoverflow.com/comment/42367546
type: Comment
comment on: http://stackoverflow.com/a/26908788
has text: IT WORKED! I have been trying to do this for ages for I did not know how to manually call the markdown initializer. I did not really understand what this function meant: http://stackoverflow.com/questions/26907794/what-does-this-jquery-function-mean and couldnot decipher how the library worked
score: 0
type: AnswerComment

console
tags question: http://stackoverflow.com/q/26971818
tags question: http://stackoverflow.com/q/26912096
type: Tag
tag name: console

http://stackoverflow.com/q/26890810
tagged with: javascript
tagged with: ng-grid
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/26893864
tagged with: angularjs
upvote count: 2
has title: How to filter the entire table with text instead of per column ng-grid 3.0 (ui-grid)
type: AnsweredQuestion
score: 2
tagged with: angular-ui-grid
has body: I looked at the docs and didn't see an easy way too accomplish this in ng-grid 3. In ng-grid 2 you could bind a text field to $scope.filterOptions = { filterText: '' }; and then in gridOptions... $scope.gridOptions = { data: 'someData', filterOptions: $scope.filterOptions }; I could roll my own filtering, but I'm hoping there is a simpler way to do this that I am missing.
accepted answer: http://stackoverflow.com/a/26893864
type: Question
downvote count: 0

http://stackoverflow.com/comment/42300674
comment on: http://stackoverflow.com/q/26868882
type: QuestionComment
score: 0
has text: You don't want to use jQueryUI's `.draggable()` and `.droppable()`? I've never used them myself, just thinking it might get around the problem.
type: Comment

http://stackoverflow.com/q/26864529
tagged with: node.js
answer count: 1
has answer: http://stackoverflow.com/a/26864795
has title: How do i restrict my node express application to localhost only?
linked to: http://stackoverflow.com/q/10068714
has comment: http://stackoverflow.com/comment/42289397
tagged with: javascript
score: 6
tagged with: express
has comment: http://stackoverflow.com/comment/42289946
type: AnsweredQuestion
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/26864795
has body: I have a node express application that I want to only be available to the localhost client. How can I prevent other hosts from accessing my node express app?
type: Question
upvote count: 6

datetimepicker
type: Tag
tags question: http://stackoverflow.com/q/26921742
tag name: datetimepicker
tags question: http://stackoverflow.com/q/26977783

http://stackoverflow.com/q/26869426
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/42298120
score: 2
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/42298405
has comment: http://stackoverflow.com/comment/42298367
has comment: http://stackoverflow.com/comment/42298276
has comment: http://stackoverflow.com/comment/42298136
type: Question
has comment: http://stackoverflow.com/comment/42298669
has comment: http://stackoverflow.com/comment/42298017
tagged with: javascript
has title: ajax html response custom show
has comment: http://stackoverflow.com/comment/42298088
has comment: http://stackoverflow.com/comment/42298447
has answer: http://stackoverflow.com/a/26869965
upvote count: 2
accepted answer: http://stackoverflow.com/a/26869965
has comment: http://stackoverflow.com/comment/42298461
answer count: 1
has body: I have a PHP survey form in which one of the question is "What are your favourite movies?" For this question, there is a radio button with values "By Title" and "By actor". If user select "By actor", a textbox appears where he can write an actor name (with jQuery auto-complete feature). Then, if click a button "Movies by this actor", a new window appears where he/she will see list of movies by that actor inserted in the textbox. Below is the image to explain better: My question: How can I show this list of movies as selectable links or icons with a small image beside them? (like amazon search, that when we write an actor name in the textbox, by clicking "Go" button, it shows list of movies with link and image). This is my code: $('#btnRight').on('click', function (e) { popupCenter("movieByactor.php","_blank","400","400"); }); and here is a child code(movieByactor.php): prepare("SELECT DISTINCT movieName FROM cast_movie WHERE castName = :q"); $sql->execute(array(':q' => $_GET['q'])); while($rows = $sql->fetch(PDO::FETCH_ASSOC)){ $option = ' ' . $rows['movieName'] . ' '; $html .= $option; } } catch(PDOException $e){ echo 'ERROR: ' . $e->getMessage(); } echo $html; exit;
tagged with: jquery
has comment: http://stackoverflow.com/comment/42298526
favorite count: 0

http://stackoverflow.com/comment/42366644
comment on: http://stackoverflow.com/q/26907752
type: Comment
type: QuestionComment
has text: Check this [answer](http://stackoverflow.com/questions/12148188/d3-js-yaxis-not-drawing-all-the-ticks-properly). arraytime also has duplicated value and it is the one which is missing.
score: 0

http://stackoverflow.com/q/26981155
has answer: http://stackoverflow.com/a/27111972
has answer: http://stackoverflow.com/a/27113657
tagged with: profiling
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/42594301
favorite count: 0
has comment: http://stackoverflow.com/comment/61722351
score: 7
has comment: http://stackoverflow.com/comment/69785470
type: UnansweredQuestion
has body: I'm wondering is there any (un)official spec to .cpuprofile file format, which is generated when JavaScript profiling is used in Chromium-based browser's developer tools. It is plain-text JSON so it is easy to get call tree data but I don't understand how to get timing information for each function. Also I'm interested in hit count for every function.
upvote count: 7
tagged with: google-chrome
type: Question
tagged with: google-chrome-devtools
has title: Google Chrome developer tools - Profiling results file format
has answer: http://stackoverflow.com/a/41291519
answer count: 3

http://stackoverflow.com/comment/42413349
comment on: http://stackoverflow.com/a/26905899
type: Comment
has text: If you insert script somewhere outside the template, it won't be removed on view's destroy. Regarding the resources problem, that's normal because Ember-based application is single-page one, and it can't be fixed with JS because of security restrictions.
score: 1
type: AnswerComment

http://stackoverflow.com/comment/42333296
type: QuestionComment
score: 0
has text: If you put `alert('Here');` inside the unbind callback do you see it?
comment on: http://stackoverflow.com/q/26889447
type: Comment

http://stackoverflow.com/comment/42270663
score: 0
has text: @Paul Richter Yeah, it still gives me the same error though.
type: AnswerComment
comment on: http://stackoverflow.com/a/26854020
type: Comment

http://stackoverflow.com/a/26896343
answers question: http://stackoverflow.com/q/26895466
score: 0
has body: I've used some of the suggestions in comments above, and changed around a few things myself and cleaned up the code. I've made it work... The primary changes were change the form method to post change your &lt;button&gt; to &lt;input type="submit"&gt; please see this jsFiddle to see a working example of your code. Hope you're able to see your mistakes by comparing with your own code!
accepted answer of: http://stackoverflow.com/q/26895466
has comment: http://stackoverflow.com/comment/42346464
type: Answer
type: AcceptedAnswer

http://stackoverflow.com/comment/42260990
type: QuestionComment
comment on: http://stackoverflow.com/q/26847017
has text: Absolutely! I use it all the time for dynamic server-side data that I've retrieved from the server via AJAX. Seriously worth looking into :)
score: 0
type: Comment

http://stackoverflow.com/comment/42422989
has text: That is the section given me the error.
score: 0
comment on: http://stackoverflow.com/q/26893197
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26882960
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has title: Is it possible to show satisfied validation rule in different colour using jquery validation engine?
has body: I am using multiple conditions for validating a field in my form using jquery validation engine. I want to show the user if a condition is satisfied with a green background colour. currently my validation looks like this: Now when the first condition is satisfied, The background colour of first line should turn green.But it is disappearing now. Is that possible using jquery validation engin js? I want something like this:
has answer: http://stackoverflow.com/a/26883107
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/42336332
tagged with: javascript
score: -1
tagged with: jquery-validation-engine

http://stackoverflow.com/comment/42397048
type: Comment
comment on: http://stackoverflow.com/a/26925191
has text: Thanks! Just saw this same explanation in the Meteor github repo: https://github.com/meteor/meteor/issues/2057
score: 0
type: AnswerComment

http://stackoverflow.com/q/26840322
has title: Empty received value from evaluateJavascript function in Android 4.4
type: Question
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: android-4.4-kitkat
tagged with: android
answer count: 1
has body: I am using webview with Android 4.4(Kitkat) to view htmls, and using javascript for searching, highlighting and so on. When I equal string selected by string s inside onReceiveValue the selected still empty so how can i get string s from onReceiveValue out to my android code This is my code: String selected=""; webview.evaluateJavascript("javascript:(function(){" + "var txt = window.getSelection();" +"return txt;" + "})();" ,new ValueCallback&lt;String&gt;() { @Override public void onReceiveValue(String s) { Log.d("LogName", s); //s is empty! selected=s; }} ); Many thanks.
upvote count: 3
has answer: http://stackoverflow.com/a/26853783
type: UnansweredQuestion
score: 3
tagged with: android-webview

http://stackoverflow.com/comment/42512965
comment on: http://stackoverflow.com/a/26990357
type: AnswerComment
score: 0
type: Comment
has text: Why do I not need to do this under normal execution?

http://stackoverflow.com/comment/42361649
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26905378
score: 0
has text: @Raptor name="name"[] = name="real_name"[]

http://stackoverflow.com/comment/42364265
comment on: http://stackoverflow.com/a/26904966
type: Comment
score: 0
type: AnswerComment
has text: i am testing in firefox.

http://stackoverflow.com/comment/42518070
type: AnswerComment
has text: How can i check if in the first function i get the right value? I tried: alert($(this.text()) and alert("text:" + $("$liarea").text()) but no alert is showed!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26986186

http://stackoverflow.com/q/26919599
has body: What difference ( if any ) is there between the name property of person and person2? var person = function(){ var _name; var _person = {}; Object.defineProperties(_person, { name: { get: function(){ return _name }, set: function(n) { _name = n; }, enumerable: true, configurable: true } }); return _person; }(); person.name='john'; console.log(person.name); function Person2() { this.name = undefined; } var person2 = new Person2(); person2.name = 'john'; console.log(person2.name);
has title: Difference between Object.defineProperty and object property literal
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/42387734
answer count: 2
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/26920526
has answer: http://stackoverflow.com/a/26919676
has comment: http://stackoverflow.com/comment/42387509
downvote count: 0
has comment: http://stackoverflow.com/comment/42387993
type: UnansweredQuestion
tagged with: javascript-objects
score: 2

http://stackoverflow.com/comment/42417606
has text: `setInterval` wants a function reference: `setInterval(countdownTest, 1000)`. `countdownTest()` just calls `countdownTest` immediately.
type: Comment
type: QuestionComment
score: 4
comment on: http://stackoverflow.com/q/26936704

http://stackoverflow.com/q/26887918
has comment: http://stackoverflow.com/comment/42330364
answer count: 1
tagged with: ajax
has answer: http://stackoverflow.com/a/26888623
has comment: http://stackoverflow.com/comment/42330202
accepted answer: http://stackoverflow.com/a/26888623
has comment: http://stackoverflow.com/comment/42330344
has comment: http://stackoverflow.com/comment/42330682
has comment: http://stackoverflow.com/comment/42330387
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42330742
has comment: http://stackoverflow.com/comment/42330291
has body: I have this function to fetch new ads in every 10 seconds, but im getting the error function getnewads(){ var newer ; // This fetches old value from 'data-value' attribute var old_val = $("#new_data").data('value'); $.ajax({ type: "POST", url: "users/process.php", data:{ getnewads: "getnewads" }, cache: false , dataType: 'json', async: false }).success(function(dat){ if(dat.status == 'success'){ $("#new_data").empty(); for(i = 0;i &lt; dat.counts; i++){ newer = dat.counts + old_val; alert(old_val); /// problem att old_val alerts Object object. if(newer &gt; 0){ $("#new_data").html('&lt;div class="added_ad"&gt;'+ newer +' new ads &lt;/div&gt;'); // This set 'data-value' attribute to #new_data element $("#new_data").data('value',newer); $("#new_data").show(); }else{$("#new_data").hide();$("#new_data").data('value',0);} } } }); } and this is my html div &lt;div id="new_data" class="new_data"&gt; &lt;/div&gt; I have tested everything works just this old_val is alerting Object object What am I doing wrong ? thanks If I alert old_val it shows Object object If I alert old_val.val() its shows undefined old_val
has comment: http://stackoverflow.com/comment/42330413
type: Question
has title: Error: Undefined data
has comment: http://stackoverflow.com/comment/42330407
has comment: http://stackoverflow.com/comment/42330282
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42330210
score: 0
has comment: http://stackoverflow.com/comment/42330545

http://stackoverflow.com/q/26847217
type: Question
linked to: http://stackoverflow.com/q/25496826
answer count: 1
tagged with: javascript
has title: Ember Data ajax call
has answer: http://stackoverflow.com/a/26848590
score: 0
has comment: http://stackoverflow.com/comment/42257646
tagged with: ember.js
accepted answer: http://stackoverflow.com/a/26848590
type: AnsweredQuestion
tagged with: ember-data
has body: I've recently started learning Ember, and am now trying to understand how to use Ember Data to make an ajax call for data. I would like to get data and log the response to the console when I navigate to the pages'route. Here is the code I have but cannot get it to log the data: Handlebars and JS: &lt;script type="text/x-handlebars"&gt; &lt;nav&gt; {{#link-to 'home'}}Home{{/link-to}} {{#link-to 'pages'}}Pages{{/link-to}} &lt;/nav&gt; &lt;div class="container"&gt; {{outlet}} &lt;/div&gt; &lt;/script&gt; &lt;script type="text/x-handlebars" id="pages"&gt; Info here {{log}} &lt;/script&gt; App = Ember.Application.create(); App.Router.map(function() { this.route('home', {path: '/'}); this.route('home', {path: 'home'}); this.route('pages', {path: 'pages'}); }); App.Pages = DS.Model.extend({ status: DS.attr('string'), startDate: DS.attr('string'), lastModifiedDate: DS.attr('string'), author: DS.attr('string'), lastModifiedBy: DS.attr('string'), title: DS.attr('string'), items: {} }); App.PagesAdapter = App.ApplicationAdapter = DS.RESTAdapter.extend({ host: 'https://api.mongolab.com/api/1/databases/emberdatatest/collections/itemdata?apiKey=somekey' }); App.PagesRoute = Ember.Route.extend({ model: function() { this.store.find('pages'); } }); Here is the data I cam getting back as a response: { "_id": { "$oid": "5460cc6be4b0933065794003" }, "start": 0, "count": 5, "total": 1549, "pages": [ { "status": "published", "startDate": "2014-09-24 12:56", "lastModifiedDate": "2014-10-02 12:01", "author": "Luke Skywalker", "lastModifiedBy": "Darth Vader", "title": "home page", "items": {} }, { "status": "published", "startDate": "2014-10-13 08:03", "lastModifiedDate": "2014-10-02 12:01", "author": "Sauran", "lastModifiedBy": "Gandolf", "title": "Blog page", "items": {} }, { "status": "review", "startDate": "2014-11-22 13:03", "lastModifiedDate": "2014-11-14 14:01", "author": "Jean-Luc Piccard", "lastModifiedBy": "Worf", "title": "Vacuum Cleaners page", "items": {} } ] }

http://stackoverflow.com/a/26971694
has body: For completeness I dropped the fusion layer as it wasn't really required and the solution, thanks to assistance from amenadiel, now looks like this: /* get row id if user clicks on the map */ google.maps.event.addListener(map, "click", function(e) { placeMarker(e.latLng, map); }); function getROWID(lat,lng){ var queryStr = []; queryStr.push("SELECT id "); queryStr.push(" FROM " + fusionTableId); // set coordinates and tolerance radius queryStr.push(" WHERE ST_INTERSECTS(geometry, CIRCLE(LATLNG("+lat+", "+lng+"), 1))"); var sql = encodeURIComponent(queryStr.join(" ")); $.ajax({ url: "https://www.googleapis.com/fusiontables/v2/query?sql="+sql+"&amp;key="+googleApiKey, dataType: "json" }).done(function (response) { document.getElementById("MY_HIDDEN_FIELD").value = response.rows[0][0]; }); } function placeMarker(position, map) { addMarker(map,true,position); map.panTo(position); document.getElementById("latlon").value = position; document.getElementById("latitude").value = position.lat(); document.getElementById("longitude").value = position.lng(); getROWID(position.lat(),position.lng()); } function addMarker(map,draggable,position){ deleteMarkers(); if (infowindow) { infowindow.close(); } draggable = typeof draggable !== "undefined" ? draggable : true; var icon = document.getElementById("map-icon").value; var marker = new google.maps.Marker({ map: map, draggable: true, position: position, icon: icon }); arr_markers.push(marker); }
has comment: http://stackoverflow.com/comment/42479659
has comment: http://stackoverflow.com/comment/42496207
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26936287

http://stackoverflow.com/q/26963556
tagged with: d3.js
type: AnsweredQuestion
has body: I am trying to make my tree have a straight links between the parent node and the children nodes. I have straight links now but the links are not connecting to the right places. I think this may be because there is a transformation of rotation and translate to the nodes and the x and y didn't change somehow. I have tried following the answer in this question but result is the same. D3: Substituting d3.svg.diagonal() with d3.svg.line() var lines = svg.selectAll('line') .data(links) .enter() .append('line') .attr('stroke','#000') lines.attr('x1',function(d){return d.source.x }) .attr('y1',function(d){return d.source.x}) .attr('x2',function(d){return d.target.x }) .attr('y2',function(d){return d.target.y }) Here is the full code: var diameter = 1000; var tree = d3.layout.tree() .size([360, diameter / 2 - 100]) .separation(function(a, b) { return (a.parent == b.parent ? 1 : 2) / a.depth; }); // var diagonal = d3.svg.diagonal.radial() // .projection(function(d) { // return [d.y, d.x ]; }) var svg = d3.select("body").append("svg") .attr("width", diameter) .attr("height", diameter ) .append("g") .attr("transform", "translate(" + diameter / 2 + "," + diameter / 2 + ")"); d3.json("flare.json", function(error, root) { var nodes = tree.nodes(root), links = tree.links(nodes); var link = svg.selectAll(".link") .data(links) .enter().append("path") .attr("class", "link") var lines = svg.selectAll('line') .data(links) .enter() .append('line') .attr('stroke','#000') lines.attr('x1',function(d){return d.source.x }) .attr('y1',function(d){return d.source.x}) .attr('x2',function(d){return d.target.x }) .attr('y2',function(d){return d.target.y }) var node = svg.selectAll(".node") .data(nodes) .enter() .append("g") .attr("class", "node") .attr("transform", function(d) { return "rotate(" + (d.x - 90 ) + ")translate(" + d.y + ")"; }) node.append("circle") .attr("r", 10); node.append("text") .attr("dy", ".81em") .attr("text-anchor", function(d) { return d.x &lt; 180 ? "start" : "end"; }) .a…
accepted answer: http://stackoverflow.com/a/26968057
type: Question
has title: D3.js Straight links in tree after transformation
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/26968057
linked to: http://stackoverflow.com/q/16070150
tagged with: http://stackoverflow.com/tag/svg

http://stackoverflow.com/a/26882736
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26880316
answers question: http://stackoverflow.com/q/26880316
has body: Let all the persons having hasSpouse property value true to have a spouse_id(Instead of spouse1_id or spouse_id) and generate links array from the node array as shown below. couple object is used for preventing redundancy of links like links from 0->1 and 1->0. var couple = {}, links = []; nodes.forEach(function(d, i) { if (d.hasSpouse) { var link = {}; link["source"] = i; var targetIdx; nodes.forEach(function(s, sIdx) { if (s.id == d.spouse_id) targetIdx = sIdx; }); link["target"] = targetIdx; if (!couple[i + "-&gt;" + targetIdx] &amp;&amp; !couple[targetIdx + "-&gt;" + i]) { couple[i + "-&gt;" + targetIdx] = true; links.push(link); } } }); Now, you will need to make a small change in the code for finding child nodes in your drawLines method. Find the subnodes by matching it's parent ids. function drawLines(d) { var src = nodes[d.source]; var tgt = nodes[d.target]; var x1 = src.x, y1 = src.y, x2 = tgt.x, y2 = tgt.y; var childNodes = nodes.filter(function(d) { //Code change return ((d.hasParent === true) &amp;&amp; (d.parent1_id == src.id &amp;&amp; d.parent2_id == tgt.id)) }); ...................... } Here is the updated fiddle
type: Answer

http://stackoverflow.com/comment/42503432
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26984875
has text: how do i make the loop specify which variable it's looping through at that time?
score: 0

http://stackoverflow.com/q/26860769
accepted answer: http://stackoverflow.com/a/26860803
type: Question
possible better answer: http://stackoverflow.com/a/26860801
has comment: http://stackoverflow.com/comment/42282115
tagged with: javascript
score: 0
answer count: 3
has body: I need to count how many of an element I have, but I'm not having much luck. Element sample: &lt;textarea type="text" data-class-changer="question" class="questioninputcss" data-integer-question="866"&gt;&lt;/textarea&gt; Moving on to my code, I've tried two things. Here's the first, with its response: var testCountPre = document.getElementByClassName('questioninputcss'); var testCount = testCountPre.getElementsByTagName('textarea').length; Uncaught TypeError: undefined is not a function And the second, with its response: var testCount = ($(".questioninputcss textarea").length); var_dump(testCount); Number(1) 0 Edit for clarification: I'm using a var_dump script that works in javascript.
tagged with: jquery
has answer: http://stackoverflow.com/a/26860803
type: AnsweredQuestion
has title: How do I count the number of elements by classname, and turn the result into a variable?
has comment: http://stackoverflow.com/comment/42282139
has answer: http://stackoverflow.com/a/26860801
has answer: http://stackoverflow.com/a/26860971

http://stackoverflow.com/q/26900099
accepted answer: http://stackoverflow.com/a/26912806
upvote count: 1
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/26912806
favorite count: 0
has body: DEMO: http://jsfiddle.net/uwh7Lgyo/ If possible, I'd like the hover to be applied by background-color, instead of highlighting each state individually. That means, hover effects entire group of blue states when hovered over a blue state, entire group of green states when hovered over a green state, etc.
tagged with: hover
type: AnsweredQuestion
has title: How to enable hover effect for entire series instead of individual data
score: 1
type: Question
tagged with: highmaps
tagged with: highcharts
tagged with: javascript

http://stackoverflow.com/q/26859207
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
tagged with: nginfinitescroll
upvote count: 6
accepted answer: http://stackoverflow.com/a/27049601
type: Question
type: AnsweredQuestion
has body: I am using ngInfiniteScroll to enable infinite scrolling on my website. It works partly as expected, once I scroll to the bottom of the page it calls the method I want it to call to show more posts, except that it keeps calling posts without end after it is triggered once. Does anybody know what could be causing this? This is what my code looks like where I am implementing ngInfiniteScroll, I don't know that this specific code will help much though. I suspect it is getting thrown off by code in another file. Your feed is currently empty, visit the Users page and find some more people to follow! Show more
has title: How to prevent ngInfiniteScroll from being triggered multiple times after the initial trigger?
answer count: 1
has answer: http://stackoverflow.com/a/27049601
downvote count: 0
tagged with: javascript
score: 6
favorite count: 0

http://stackoverflow.com/q/26911215
answer count: 2
has answer: http://stackoverflow.com/a/26911281
score: 0
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42372089
has body: I want to add more than one calendar in a single page by calling the javascript onclick function with jQuery-UI, does anyone know how to achieve that? &lt;script&gt; function openCalander(element) { $("#datepicker").datepicker('slow'); }); &lt;/script&gt;
has title: How to add more than one calendar using onclick javascript function
has answer: http://stackoverflow.com/a/26911410
type: Question

angular-ui-bootstrap
tags question: http://stackoverflow.com/q/26976812
tags question: http://stackoverflow.com/q/26863397
tags question: http://stackoverflow.com/q/26864410
type: Tag
tags question: http://stackoverflow.com/q/26876441
tags question: http://stackoverflow.com/q/26884880
tags question: http://stackoverflow.com/q/26850470
tag name: angular-ui-bootstrap

http://stackoverflow.com/a/26983938
type: Answer
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26983831
has body: Well, what happens is that Ajax.ActionLink cancels the default action in order to send the ajax request. You might add the onclick event in the OnBegin option of Ajax.ActionLink.
answers question: http://stackoverflow.com/q/26983831

http://stackoverflow.com/comment/42471864
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26967351
has text: i´ve added more information in the answer. about the comments: you can´t disable that.

http://stackoverflow.com/a/26923298
answers question: http://stackoverflow.com/q/26923229
type: Answer
has comment: http://stackoverflow.com/comment/42395227
score: 2
has body: To get the selected Text of Id year and trimester function getVal(clicked_id){ $('#year :selected').text(); $('#trimester :selected').text(); } To get the selected Value function getVal(clicked_id){ $('#year').val(); $('#trimester').val(); }
downvote count: 0
has comment: http://stackoverflow.com/comment/42393976
upvote count: 2

http://stackoverflow.com/a/35548678
type: Answer
has body: Code is using snap.svg.zpd as well, so zoom is possible. Problem is at onStopMove function. Events are fired when group is moved arround. In group is one circle(this.select('#main-inner-circle')) which does not have predefined location inside group. Im trying to get correct cx and cy of that inner circle after moving group. self.onMove = function (dx, dy, ev, x, y) { var clientX, clientY; var tdx, tdy; if ((typeof dx == 'object') &amp;&amp; (dx.type == 'touchmove')) { clientX = dx.changedTouches[0].clientX; clientY = dx.changedTouches[0].clientY; dx = clientX - this.data('ox'); dy = clientY - this.data('oy'); } var snapInvMatrix = this.transform().diffMatrix.invert(); snapInvMatrix.e = snapInvMatrix.f = 0; tdx = snapInvMatrix.x(dx, dy); tdy = snapInvMatrix.y(dx, dy); this.transform("t" + [tdx, tdy] + this.data('ot')); } self.onStartMove = function (x, y, ev) { if ((typeof x == 'object') &amp;&amp; (x.type == 'touchstart')) { x.preventDefault(); this.data('ox', x.changedTouches[0].clientX); this.data('oy', x.changedTouches[0].clientY); } this.data('ot', this.transform().local); if (callbacks.onStartMove) { callbacks.onStartMove(); } } self.onStopMove = function () { var self = this.select('#main-inner-circle'); this.data('ot', this.transform().local); //self.data('ot', self.transform().local); console.log(self.getTransformedBBox()); console.log(this.getBBox()); //console.log($(self.node).offset().left - $(self.node).parent().offset().left); var bBox = this.getBBox(); //var x = bBox.x + $(self.node).offset().left - $(self.node).parent().offset().left + self.getBBox().width / 2; //var y = bBox.y + $(self.node).offset().top - $(self.node).parent().offset().top + self.getBBox().height / 2; model.updateElementCoordinates(index, $(this.node).attr("rel"), { x: self.getTransformedBBox().cx, y: self.getTransformedBBox().cy }); if (callbacks.onStopMove) { callbacks.onStopMove(); } }
upvote count: 1
answers question: http://stackoverflow.com/q/26963600
downvote count: 0
score: 1

http://stackoverflow.com/a/26979189
type: Answer
answers question: http://stackoverflow.com/q/26978472
has body: Well to make things easier give your iframe an ID first: Then in your function: And your "submit" button (changing it to a button element will prevent it from actually submitting the form, which we don't need to do since we're just firing a function): Test Server EDIT (Responding to Updates in Question): Regarding the issue with your refreshing the iframe button/function, the problem is your button. When a button is in a form, it will default to a submit button. So when you click it, it actually submits the form, and since you have no action specified on the form, it defaults to the same page. The query string in your URL is the form submission data. To prevent a button in a form from submitting when it is clicked, change its type attribute to "button": Refresh Results Regarding a custom error message when the iframe fails to load the source -- browser security restrictions will prevent you from accessing the contents of the iframe. There isn't much you can do from the parent page to edit the iframe innards if you're loading a domain different from the requesting domain. I'd suggest creating a new server-side script as a "proxy", then have that script do the work of checking the URL to see if its open/closed, and return a response to your iframe. So instead of applying the source URL to the iframe directly, you'd source your own server-side script "mydomain.com/test-url.php?src=ipaddress1" and return the error from your own script.
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/26978472

http://stackoverflow.com/a/26973077
type: Answer
has body: @expose was created for just this purpose. /** @expose */ MyConstructor.prototype.aValue
score: 0
accepted answer of: http://stackoverflow.com/q/26958582
has comment: http://stackoverflow.com/comment/42515750
answers question: http://stackoverflow.com/q/26958582
type: AcceptedAnswer

http://stackoverflow.com/comment/42513968
type: Comment
comment on: http://stackoverflow.com/a/26933296
has text: Well the UI looks just like it apart from the textual dropdown button! I'll have to see if WP itself has some hooks for the menu generation in the `init` method.
score: 0
type: AnswerComment

http://stackoverflow.com/a/26888971
score: 1
type: Answer
answers question: http://stackoverflow.com/q/26864235
upvote count: 1
has body: Check that the svg resource URL is available (that it's not a 404) Check that it's sent with the correct mediatype, image/svg+xml Check that it's served with a Content-Encoding: gzip HTTP header You might want to consider using Transfer-Encoding: gzip instead, but that's up to you. See e.g https://stackapps.com/questions/916/why-content-encoding-gzip-rather-than-transfer-encoding-gzip.
has comment: http://stackoverflow.com/comment/68924805
downvote count: 0

http://stackoverflow.com/a/26861401
has comment: http://stackoverflow.com/comment/42284707
accepted answer of: http://stackoverflow.com/q/26861294
has comment: http://stackoverflow.com/comment/42284431
has body: Using jQuery ajax, your code will be like: function submitForm () { var sessionId = document.getElementById("session-id").value; var description = document.getElementById("description").value; $.ajax({ url: 'http://localhost:8080/PatientRefund/WebService', type: 'GET', data: {urnId: sessionId, batchDescription: description} }).done(function(response) { console.log(response); // do something with your response }); } If you want the clients to download a file after submit, you should not use ajax request. You should create a form dynamically and submit it. Example code: function submitForm() { var sessionId = document.getElementById("session-id").value; var description = document.getElementById("description").value; var newForm = jQuery('&lt;form&gt;', { 'action': 'http://localhost:8080/PatientRefund/WebService', 'method': 'GET', 'target': '_top' }).append(jQuery('&lt;input&gt;', { 'name': 'urnId', 'value': sessionId, 'type': 'hidden' })).append(jQuery('&lt;input&gt;', { 'name': 'batchDescription', 'value': description, 'type': 'hidden' })); newForm.submit(); return false; }
has comment: http://stackoverflow.com/comment/42283809
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42283450
answers question: http://stackoverflow.com/q/26861294
upvote count: 2
type: Answer

http://stackoverflow.com/q/26928603
type: Question
has answer: http://stackoverflow.com/a/26928787
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26928787
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Javascript: Switch text on select
has comment: http://stackoverflow.com/comment/42403280
favorite count: 0
has body: I have: Simple block of html text: &lt;p&gt; The future of manned space exploration and development of space depends critically on the creation of a dramatically more proficient propulsion architecture for in-space transportation. A very persuasive reason for investigating the applicability of nuclear power in rockets is the vast energy density gain of nuclear fuel when compared to chemical combustion energy... &lt;/p&gt; Question: How to insert a notion BELOW (between existing rows of text) some phrase with help of JavaScript? I.e. I want to explain in a few words what is nuclear power at the text above, so I want to insert a few words below that phrase (say on mouse over).
upvote count: 2
tagged with: css
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42403695

http://stackoverflow.com/comment/42442931
score: 0
has text: I mean quotes not parentheses
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26950789

http://stackoverflow.com/q/26857906
answer count: 2
upvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/26858056
has answer: http://stackoverflow.com/a/26858378
has body: Here is my json http://jsbin.com/wagomomuda/1/edit when I try to run, I get an error as unexpected token :, i tried validating my json, in many sites, it says its valid.Can anyone please help me out with this, as I am new to json.
score: -1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42277676
downvote count: 1
has title: JSON error in console: Unexpected token :
type: Question
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/42300344
has text: I got the solution to the answer. It was that I displayed wrong array; it should have been `$SITE['theme_options']->effects_select`
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26870691

http://stackoverflow.com/a/26854890
downvote count: 1
score: 1
answers question: http://stackoverflow.com/q/26854862
type: Answer
upvote count: 2
has body: If you are using jQuery you can do something like this: $( "li[id^='hide']" ).each(function(){ $(this).hide(); });

http://stackoverflow.com/q/26895597
score: 0
has answer: http://stackoverflow.com/a/26895635
has title: How do I write the AJAX to post data
has comment: http://stackoverflow.com/comment/42344579
upvote count: 1
downvote count: 1
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26895992
accepted answer: http://stackoverflow.com/a/26895992
answer count: 2
has body: Fiddle I am trying to learn AJAX from a tutorial. I am able to grab the data I want and populate it in the DOM pretty easily. What I'm struggling with is using 'POST' to edit it. I created a simple page that lists 'friends' and 'ages' that pulls that data from here http://rest.learncode.academy/api/learncode/friends The names and ages populate correctly, but the code I'm writing to 'POST' to it is not. Here is my javascript HTML AJAX Container Friends Add a friend Name: Age: submit
possible better answer: http://stackoverflow.com/a/26895635
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax

http://stackoverflow.com/comment/42508254
score: 0
type: AnswerComment
has text: You're right, it doesn't work on all browsers, the new version works as it constructs a date string that can be parsed
type: Comment
comment on: http://stackoverflow.com/a/26987670

http://stackoverflow.com/comment/42498523
has text: I have edited the code, but nothing is displaying in the iframe. I checked for basic syntax, but to no avail. Any ideas? Thanks for all the help. I ran the developer console, f12 and i get this `Uncaught ReferenceError: e is not defined` Also is there a way to display a message if the page doesn't load?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/26978472

http://stackoverflow.com/a/26849069
has comment: http://stackoverflow.com/comment/42266334
has comment: http://stackoverflow.com/comment/42270748
has comment: http://stackoverflow.com/comment/42268076
answers question: http://stackoverflow.com/q/26847017
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/42269789
upvote count: 3
score: 3
has comment: http://stackoverflow.com/comment/42269910
has comment: http://stackoverflow.com/comment/42270097
has body: Here's an alternative using jQuery and jQueryUI: exampleName EXAMPLE: http://jsfiddle.net/xaqtawog/1/
has comment: http://stackoverflow.com/comment/42270575
accepted answer of: http://stackoverflow.com/q/26847017

http://stackoverflow.com/comment/42389443
type: Comment
comment on: http://stackoverflow.com/a/26920612
has text: I agree, I was thinking of append
score: 0
type: AnswerComment

http://stackoverflow.com/q/26868454
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42296069
has comment: http://stackoverflow.com/comment/42296405
downvote count: 1
tagged with: twitter-bootstrap-3
has comment: http://stackoverflow.com/comment/42303547
has comment: http://stackoverflow.com/comment/42296364
type: Question
has comment: http://stackoverflow.com/comment/42298085
has comment: http://stackoverflow.com/comment/42298341
upvote count: 0
has comment: http://stackoverflow.com/comment/42303625
has comment: http://stackoverflow.com/comment/42297324
has comment: http://stackoverflow.com/comment/42296108
tagged with: javascript
tagged with: jquery
score: -1
has title: Bootstrap modal fire but no display
has answer: http://stackoverflow.com/a/26874110
answer count: 1
has comment: http://stackoverflow.com/comment/42296295
has body: I trying to use bootstrap modal, event 'show' is fired but I can't see it on screen. home.js $(document).ready(function(){ console.log("Log..."); $(document).on('click', '#btnSignIn', function(){ console.log("Starting modal.."); $('#modal').on('show.bs.modal', function(){ alert("Modal show.."); }).modal('show'); }); }); modal in home.jsp × Modal header AKA Close Save changes alert is fired but then, no modal is shown. Anybody can help me? Please
favorite count: 0

http://stackoverflow.com/q/26918243
has answer: http://stackoverflow.com/a/26918614
has answer: http://stackoverflow.com/a/26918566
has body: I have a pretty simple task at hand. Build a list, highlight the active item. Using ng-class and setting the currently selected item in scope works on a click, but not initially. What am I overlooking here? Here's the data. $scope.adminTabs = [{"name": "Agent"}, {"name": "Agent Queue"}, {"name": "Skills"} ] and here's the click in the controller along with setting the initial value: $scope.adminTabs = adminInfo.adminTabs; //Default $scope.activeAdminTab = $scope.adminTabs[0].name; $scope.loadAdminTab = function(){ $scope.activeAdminTab = this.tab.name; } and finally, the ng-class directive itself in action &lt;ul&gt; &lt;li data-ng-click="loadAdminTab()" data-ng-repeat="tab in adminTabs" data-ng-model = "admin.selectedTab" data-ng-class="tab.name == activeAdminTab ? 'selected' : '' "&gt;{{tab.name}}&lt;/li&gt; &lt;/ul&gt; Problem is, that first item is never set to use the "selected" class, although the scope variable that drives it is indeed set correctly.
type: UnansweredQuestion
type: Question
tagged with: javascript
has title: Having an issue with ng-class during initial load
score: 0
answer count: 2
tagged with: angularjs-ng-repeat
tagged with: angularjs

http://stackoverflow.com/q/26890514
upvote count: 4
has body: I am trying to convert a lat long string (53.3603, -6.315050000000042) into a google maps object in this format: B: -6.26747649999993 k: 53.339251 I have used this function which works for the long but returns Nan for the lat. function getLatLngFromString(ll) { var lat = ll.replace(/\s*\,.*/, ''); // first 123 var lng = ll.replace(/.*,\s*/, ''); // second ,456 var locate = new google.maps.LatLng(parseFloat(lat), parseFloat(lng)); return locate; } ; I am storing the lat long in a html tag as it called to a list view connected to a map. It is stored here in the correct format however when I retrieve it using the jQuery .attr it converts it to a string. var location = $(this).closest('.allList').attr("position"); Any help would be greatly appreciated.
answer count: 1
tagged with: jquery
tagged with: latitude-longitude
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26891191
downvote count: 1
type: Question
has title: Convert lat long string into google maps API LatLng Object
score: 3
tagged with: javascript
tagged with: google-maps-api-3

http://stackoverflow.com/q/26910029
has answer: http://stackoverflow.com/a/26910461
tagged with: php
type: Question
has body: I have a button that is now inside a little form: &lt;form name="picSubmit" method="post"&gt; &lt;button class="btn btn-block btn-default" id="upload"&gt;&lt;?php echo $lrow[10]; ?&gt; &lt;span class="glyphicon glyphicon-forward"&gt;&lt;/span&gt;&lt;/button&gt; &lt;/form&gt; then my code on top of the page: &lt;script language="JavaScript" src="js/cameraUserScript.js"&gt;&lt;/script&gt; &lt;?php if ($_SERVER['REQUEST_METHOD'] == 'POST'){ header('Location: view-subscribe'); } ?&gt; This is some javascript/jQuery ajax code to send the content inside a &lt;div&gt; and a picture that i have taken to a php page where i use this content to get some data out of my database and to rename and save that picture into a folder document.getElementById("upload").addEventListener("click", function(){ var dataUrl = canvas.toDataURL(); var idVal = $('.hiddenId').html(); $.ajax({ type: "POST", url: "incl/camsave.php", data: { imgBase64: dataUrl, idVal: idVal } }).done(function(msg) { console.log('saved'); }); I added a click event on that submit button ID so that when i click this script has to run. It works in Chrome, but because in Chrome you allways have to click the trust button if you use mediahandling i want to use Mozilla but there it isn't working... Does it has something to do with the combination of the submit button and the click event? Thanks for the help!
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has title: combine jQuery click handler with php header on same button
type: UnansweredQuestion

http://stackoverflow.com/comment/42241552
type: Comment
type: QuestionComment
has text: @JOnathanCrowe : Now $("span.error").empty(); does the work
comment on: http://stackoverflow.com/q/26838195
score: 0

http://stackoverflow.com/comment/42276879
comment on: http://stackoverflow.com/a/26857092
score: 0
type: AnswerComment
has text: @badkitty72 - I revised my answer, adding `.each(function(){`. This should do the trick, explanation is in the answer. Let me know if you're still having problems
type: Comment

http://stackoverflow.com/q/26974240
has title: Test progress with a promise notify for $httpBackend
upvote count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/26983659
has body: I'm using https://github.com/danialfarid/angular-file-upload for my file uploads. It provides a progress method that is called, when the xhr requests receives the progress event. This is from the source code of angular-file-upload: xhr.upload.addEventListener('progress', function(e) { deferred.notify(e); }, false); My problem is now, how should I test this using $httpBackend? I can test the success and error methods with $httpBackend.expectPOST("http://localhost:9001/").respond('ok'); $httpBackend.expectPOST("http://localhost:9001/").respond(500, 'some error'); but I can't get the notify of the promise to fire. Is there a way to do this? EDIT The part that I want to test, is inside the progress method: $upload.http({url: url, method: 'POST', data: file}) .progress(function(evt) { // here is more code, that needs to be tested self.$deferreds.upload.notify((100.0 * evt.loaded / evt.total).toFixed(2)); }).success(function(data, status, headers, config) { self.$deferreds.upload.resolve(data); }).error(function(response) { self.$deferreds.upload.reject(response); });
answer count: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26983659
downvote count: 0
score: 1
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/26975062
type: Question
has answer: http://stackoverflow.com/a/26975062

http://stackoverflow.com/a/26842825
has comment: http://stackoverflow.com/comment/42249445
type: AcceptedAnswer
has body: Anything that wraps HTML/JS code into a native app is a hybrid. The difference is that the hybrid app relies on the UIView (think of it as a minimalistic web browser) to show all the content, while the native apps usually use the UIView only for browsing and have everything else coded in the native language. Basically, the hybrid app is always laid on the UIView and everything happens inside it. Similar to opening a dedicated web page in fullscreen and having access to all (or most) of the native phone features (vibration, sensors, notifications, etc...). Think of a simple button made using HTML vs. a simple button made using Java/Objective C/C#... That's what hybrid frameworks are trying to make work and look as similar as possible. Hybrid apps require none (or almost none) native language coding. "So actually what is the difference between Mobile web app and Hybrid mobile apps?" None of the frameworks above say that. More specifically: none of them mentions mobile web apps with a contrast to hybrid apps because those are the same thing, just different semantics. What the frameworks offer is: web version of the app (web app) mobile version of the app (mobile app) Bottom line: Anything that is written in HTML/JS/CSS and functions as a native mobile app is a hybrid app. This article shows the difference between the native app, hybrid app, and a "mobile web app": http://blogs.telerik.com/appbuilder/posts/12-06-14/what-is-a-hybrid-mobile-app- Be careful, the last one is nothing but a website optimized for phones that can't be installed on a phone as an app, and it should definitely not be mixed with phone apps (native or hybrid). Excerpt from the URL above: Native apps are built for a specific platform with the platform SDK, tools and languages, typically provided by the platform vendor (e.g. xCode/Objective-C for iOS, Eclipse/Java for Android, Visual Studio/C# for Windows Phone). Hybrid apps, like native apps, run on the device, and are written with web technologies (…
has comment: http://stackoverflow.com/comment/42256075
has comment: http://stackoverflow.com/comment/42252059
has comment: http://stackoverflow.com/comment/42249407
score: 1
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/42250232
accepted answer of: http://stackoverflow.com/q/26842243
downvote count: 1
answers question: http://stackoverflow.com/q/26842243

http://stackoverflow.com/comment/42301949
score: 0
type: Comment
has text: 1 + ".00" is "1.00"...
type: QuestionComment
comment on: http://stackoverflow.com/q/26871820

http://stackoverflow.com/q/26885825
has body: I'm writing a piece of code to easily save error logs in an object for debugging. What I'm trying to achieve is to get the Object name from the function it was called from like so: var MainObject = { test : function() { return MainObject.test.caller; // When called from MainObject.testcaller, // it should return MainObject.testcaller. }, testcaller : function() { return MainObject.test(); // Should return MainObject.testcaller, Returns own function code. }, anothercaller : function() { return MainObject.test(); // Should return MainObject.anothercaller, Returns own function code. } } However when I run this code it returns the function code from MainObject.testcaller. JSFiddle example Is there any way this is possible? Update After looking at Rhumborl's answer, I discovered that assigning the value through another function would lead it to point back at the function name without the object itself. Code: (function (name, func) { MainObject[name] = func; })('invalid', function() { return MainObject.test("blah"); }); // This now points at invalid() rather than MainObject.invalid() Updated fiddle
has comment: http://stackoverflow.com/comment/42326692
has answer: http://stackoverflow.com/a/26887337
has comment: http://stackoverflow.com/comment/42326399
has title: Get object caller name by function call JavaScript
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26886326
type: Question
accepted answer: http://stackoverflow.com/a/26887337
possible better answer: http://stackoverflow.com/a/26886326
tagged with: javascript
has comment: http://stackoverflow.com/comment/42326989
score: 0
answer count: 2

http://stackoverflow.com/a/26865802
has body: If you are using the Google Maps API v3 use the geocoding service var geocoder = new google.maps.Geocoder(); var latlng = new google.maps.LatLng(55.75320193022759, 37.61922086773683); geocoder.geocode({'latLng': latlng}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { alert(results[1].formatted_address); } else { alert("Geocoder failed due to: " + status); } }); See: https://developers.google.com/maps/documentation/javascript/geocoding
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26865593
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26865593
score: 1

http://stackoverflow.com/q/26903358
tagged with: nested-function
has comment: http://stackoverflow.com/comment/42674010
has body: Unfortunately .bind has been giving me grief when creating more complex closures. I am quite interested in why .bind seems to work differently once you nest functions. For example : function t(){ t = t.bind({}); //correctly assigns *this* to t function nested_t(){ nested_t = nested_t.bind({}); // fails to assign *this* to nested_t return nested_t; } return nested_t(); } //CASE ONE alert(t()); // alerts the whole function t instead of nested_t //CASE TWO aleft(t.call(t)); // alerts the global object (window) In both cases I was expecting a behavior like this: function t(){ var nested_t = function nested_t(){ return this; }; return nested_t.call(nested_t); } alert(t.call(t)); If someone could explain the behavior of .bind in the first (and/or) second case it would be much appreciated!
favorite count: 0
has comment: http://stackoverflow.com/comment/42462975
has answer: http://stackoverflow.com/a/27071729
has answer: http://stackoverflow.com/a/26950124
downvote count: 2
has comment: http://stackoverflow.com/comment/42674950
has title: Nested .bind not working as expected
tagged with: bind
type: AnsweredQuestion
tagged with: call
upvote count: 3
has comment: http://stackoverflow.com/comment/42660230
accepted answer: http://stackoverflow.com/a/26950124
type: Question
has comment: http://stackoverflow.com/comment/42441312
tagged with: closures
tagged with: javascript
has comment: http://stackoverflow.com/comment/42674874
score: 1
has comment: http://stackoverflow.com/comment/42668785
has comment: http://stackoverflow.com/comment/42463031
possible better answer: http://stackoverflow.com/a/27061537
answer count: 3
has answer: http://stackoverflow.com/a/27061537

http://stackoverflow.com/a/26986434
answers question: http://stackoverflow.com/q/26986358
score: 0
type: Answer
has body: are you trying to render your page through javascript? If yes the following tutorial may help. http://www.w3schools.com/js/js_htmldom_html.asp Recommend reading the following API of the tutorial document.getElementById(id).innerHTML = new HTML Hope this helps.

http://stackoverflow.com/a/26880202
has comment: http://stackoverflow.com/comment/106752182
downvote count: 0
has comment: http://stackoverflow.com/comment/130162712
upvote count: 8
has body: Legacy Browsers .target returns the element that was clicked on. In the case of link 2, this will always be the span tag; on a properly formed version of link 3 sometimes it would be the a tag, sometimes it would be the img tag depending where you click. In order to figure out if the .target is inside of an a tag you need to climb up the DOM tree using parentNode until you reach an a node or the document itself, which has a .parentNode of null. var getParentAnchor = function (element) { while (element !== null) { if (element.tagName && element.tagName.toUpperCase() === "A") { return element; } element = element.parentNode; } return null; }; document.querySelector("body").addEventListener('click', function(e) { var anchor = getParentAnchor(e.target); if(anchor !== null) { console.log(anchor.textContent); } }, false); Link 1 Link 2 Link 3 Non link text The standard .textContent should be preffered over .text. It's easier to use querySelector to grab the body, unless you need to support IE7 or less. Modern Browsers If you don't need to support older browsers like IE or Opera mini, the code can be simplified by using the Element.closest method. You can completely get rid of the getParentAnchor and replace it with a single .closest call, shortening the code quite a bit: document.querySelector("body").addEventListener('click', function(e) { var anchor = e.target.closest('a'); if(anchor !== null) { console.log(anchor.textContent); } }, false); Link 1 Link 2 Link 3 Non link text
has comment: http://stackoverflow.com/comment/118073010
score: 8
has comment: http://stackoverflow.com/comment/106752190
answers question: http://stackoverflow.com/q/26879630
type: Answer

http://stackoverflow.com/q/26860351
linked to: http://stackoverflow.com/q/8076341
type: Question
has body: EDIT: I found a good solution in this post Remove highlight added to selected text using JavaScript? I´m making a script to highlight texts. I´m using tags. This part was easy but now I come across a problem. When highlighting includes different nodes I need to close the tag before the parent close, and open again de in the new node. Is not a very good explanation so I put an example: Lorem ipsum dolor sit amet I select for highlighting : ipsum dolor sit Then I have to close before and open after programatically. Any ideas how can I do it? I prefer to do all the script with pure JavaScript, but any help will be appreciated. Here its my function to highlight: function surroundSelection(element) { if (window.getSelection) { var sel = window.getSelection(); if (sel.rangeCount) { console.log (sel); var range = sel.getRangeAt(0).cloneRange(); range.surroundContents(element); sel.removeAllRanges(); sel.addRange(range); } } } Where element will be the tag ( in my case ) Here it is what I have, with still the problem of highlight different nodes http://jsfiddle.net/nacles/4L6d57bs/
tagged with: javascript
score: 0
answer count: 1
has title: Highlight including different nodes
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42281485
has answer: http://stackoverflow.com/a/26860568

http://stackoverflow.com/comment/42297763
score: 0
has text: `foo` refers to the same object in both scopes.
type: Comment
comment on: http://stackoverflow.com/a/26869304
type: AnswerComment

http://stackoverflow.com/a/26878016
type: Answer
has body: You could try and use if(val.match(/^(\d,?)*$/g)) It will allow an empty string, numbers and numbers seperated by commas. It does allow commas at the end of the string, though. So, 1,2,3,4, 1234 and 1234, all pass, but ,12,34 and foo will fail.
score: 0
answers question: http://stackoverflow.com/q/26877876

http://stackoverflow.com/comment/42353507
comment on: http://stackoverflow.com/a/26888075
score: 1
type: AnswerComment
type: Comment
has text: I get it in static method, but how to use it in instance method like this.lean().password?

http://stackoverflow.com/q/26838131
tagged with: angularjs
has title: ngTable filter with comma separated
type: AnsweredQuestion
score: 1
has body: I have created an application in AngularJs with ngTable, the table is having filter as well as sorting feature, the application is working fine but as well as filtering and sorting also working fine, but the problem is that i need to filter the designation column with comma separated like as shown below scientist,doctor right now it will filter based on a single value JSFiddle can anyone please tell me some solution for this var app = angular.module('app', ['ngTable']); app.controller('IndexCtrl', function ($scope, $filter, ngTableParams) { $scope.peoples = [{ "id": 145, "desig": "doctor", "name": "Manu", "place": "ABCD", "group": "ime123" }, { "id": 148, "desig": "engineer", "name": "John", "place": "POLK", "group": "ime148" }, { "id": 150, "desig": "scientist", "name": "Mary", "place": "USE", "group": "ime148" }]; $scope.peoplesCopy = $scope.peoples; $scope.mytable = new ngTableParams({ page: 1, // show first page count: 10, // count per page sorting: { name: 'desc' } }, { getData: function ($defer, params) { $scope.peoples = angular.copy($scope.peoplesCopy); var filteredData = $filter('filter')($scope.peoples, params.filter()); $scope.peoples = $filter('orderBy')(filteredData, params.orderBy()); $defer.resolve($scope.peoples); } }); }); {{people.id}} {{people.desig}} {{people.name}} {{people.place}}
upvote count: 1
tagged with: ngtable
type: Question
accepted answer: http://stackoverflow.com/a/26839420
linked to: http://stackoverflow.com/q/1963102
tagged with: filtering
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/26839420

http://stackoverflow.com/comment/42412313
score: 0
type: Comment
type: QuestionComment
has text: you could then simulate a click on a fictional tag that would work like a get for a new page
comment on: http://stackoverflow.com/q/26933127

http://stackoverflow.com/a/26934683
has comment: http://stackoverflow.com/comment/42416155
has body: This can be achieved by changing the following css rules: .main-width-nav { width: 75%; min-width: 1005px; // this is what is breaking your layout max-width: 1428px; height: 45px; margin: 0 auto; position: relative; } to: .main-width-nav { width: 100%; // gave it 100% to give it more room to move around min-width: 0px; max-width: 100%; height: 45px; margin: 0 auto; position: relative; }
has comment: http://stackoverflow.com/comment/42427745
has comment: http://stackoverflow.com/comment/42427647
score: 0
has comment: http://stackoverflow.com/comment/42427547
has comment: http://stackoverflow.com/comment/42414153
type: Answer
answers question: http://stackoverflow.com/q/26934579
has comment: http://stackoverflow.com/comment/42414908
has comment: http://stackoverflow.com/comment/42427785
has comment: http://stackoverflow.com/comment/42428682
has comment: http://stackoverflow.com/comment/42414102

http://stackoverflow.com/comment/42290291
comment on: http://stackoverflow.com/a/26865333
type: Comment
has text: i mean to say that no element found so it is **undefined**
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42386090
comment on: http://stackoverflow.com/q/26896712
score: 0
has text: I know, and I do not want that to happen because the link would be (www.blog.com) and not the post, the way I want: (www.blog.com/post1)
type: Comment
type: QuestionComment

webdriver
tags question: http://stackoverflow.com/q/26848268
tags question: http://stackoverflow.com/q/26932762
type: Tag
tags question: http://stackoverflow.com/q/26909533
tag name: webdriver
tags question: http://stackoverflow.com/q/26863359

http://stackoverflow.com/q/26984483
answer count: 1
downvote count: 1
favorite count: 0
upvote count: 0
has comment: http://stackoverflow.com/comment/42502827
type: UnansweredQuestion
has body: What would be the best way to check for new elements on a specific part of a webpage, looping infinitely? When a new element is added/found, the script continues. I'm currently thinking about using function checkDOMChange() for this purpose, but i'm not sure if it would work. As you can see, i'm new to JavaScript and coding in general.
type: Question
tagged with: javascript
tagged with: jquery
score: -1
tagged with: element
linked to: http://stackoverflow.com/q/4780822
has title: Checking for new elements on a existing webpage
has answer: http://stackoverflow.com/a/26984602

http://stackoverflow.com/comment/42302143
comment on: http://stackoverflow.com/a/26871890
type: Comment
score: 0
type: AnswerComment
has text: so you just stored "1" now

http://stackoverflow.com/comment/42262401
comment on: http://stackoverflow.com/q/26849113
has text: How does your context differ from the duplicate? I don't see how input vs. button would change the answer here.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/26906961
type: Question
accepted answer: http://stackoverflow.com/a/26907147
tagged with: javascript
tagged with: jquery
score: 0
has title: Stuck with simple calculation from form elements
answer count: 1
has answer: http://stackoverflow.com/a/26907147
type: AnsweredQuestion
has body: I'm using a script template to create chunks of code when a user clicks a button, this works fine, but I want to be able to calculate a total within these cloned regions so I have a in-line onBlur statement as follows onblur = "multiply.call(this, this.form.elements.Qty{{ID}}.value, this.form.elements.Cost{{ID}}.value, this.form.elements.Total{{ID}})" As the cloning function updates ID to a value this evaluates to onblur = "multiply.call(this, this.form.elements.Qty1.value, this.form.elements.Cost1.value, this.form.elements.Total1)" My function is function multiply(one, two, three) { console.dir(three); document.getElementById(three).value = (parseFloat(one) + parseFloat(two)).toFixed(2); // error here }; If I display one and two they have the values from the form, however I get an error writing back to the for of Uncaught TypeError: Cannot set property 'value' of null. The console shows the ID of the element three as Total1 I think this might be something to do with the jQuery clone and the DOM not being updated. The values are passed OK, but the object might not be. Any ideas?
tagged with: dom

http://stackoverflow.com/q/26939801
score: 3
has comment: http://stackoverflow.com/comment/42424384
has comment: http://stackoverflow.com/comment/42484576
upvote count: 3
tagged with: reactjs
answer count: 1
tagged with: javascript
favorite count: 0
has body: I'm working on the React example from their website. What I have so far is: Hello React I'm currently just opening the HTML file in my web browser, but my console is giving me the following error: Error: Parse Error: Line 41: Unexpected token : at file:///C:/Users/jkm144/Desktop/React_Example/template.html render:function(){ For some reason, it doesn't like the ":", pointing to the first time on the page it's used. I've gone through the code to look for syntax errors, but I don't see anything. Has anyone else had this problem?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26977874
downvote count: 0
accepted answer: http://stackoverflow.com/a/26977874
type: Question
has title: Getting a parsing error in with React.js

http://stackoverflow.com/comment/42360177
score: 0
has text: You could do this client side when your database has been updated : http://stackoverflow.com/questions/5404839/how-can-i-refresh-a-page-with-jquery
type: QuestionComment
comment on: http://stackoverflow.com/q/26904433
type: Comment

http://stackoverflow.com/a/42983430
has body: Anyone else looking to do this, if you have the longitude and latitude avaliable, you can just sort linearly on it to get a simple line diagram like below. this will give you a rise/run linear result. var $array = [ [79.853239, 6.912283, 279], [79.851187, 6.912220, 13], [79.853346, 6.899757, 281], [79.854786, 6.894039, 16], [79.865699, 6.885697, 284], [79.858904, 6.87104, 282] ] function sortLngLat(a, b){ var x = a[0] / a[1]; var y = b[0] / b[1]; } var sortedArray = $array.sort(sortLngLat); console.log(sortedArray); output should be like graph below and you can tweak your values with negatives and positives to get different angles and directions. --------------- | | / | | -1/1 | / 1/1 | | |/ | |-------------- | /| | |-1/-1/ | 1/-1 | | / | | ---------------
answers question: http://stackoverflow.com/q/26836146
upvote count: 4
downvote count: 0
score: 4
type: Answer

http://stackoverflow.com/q/26850749
has title: How to make a function run on the current page when the browser navigates backwards?
tagged with: navigation
type: Question
tagged with: browser
accepted answer: http://stackoverflow.com/a/26850966
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42264088
score: 0
has answer: http://stackoverflow.com/a/26850966
answer count: 1
has body: BACKGROUND: To transition between pages on my site, I'm using a white opaque overlay layer which faded in/out. For example, when you click on a link, a script prevents default, fades the invisible white overlay from hidden to visible (making the screen completely white), then directs the browser to follow the original link. The destination page is initially also completely white because the overlay layer is visible by default. Once the destination page has loaded, a script tells it to fadeout, revealing the page beneath. PROBLEM: by using the "onpageshow" tag within the "body" tag, I got the fade-from-white-to-clear effect to work when the user clicks the browser's backward navigation button. But I can't get the "onpagehide" tag to work they way I'd like--the browser just jumps straight to white (without the gradual fade to white effect) when the user clicks the browser's backward navigation button. Lorem ipsum omet orem ipsum omet orem ipsum omet orem ipsum omet orem ipsum omet orem ipsum omet orem orem...
has comment: http://stackoverflow.com/comment/42263933
type: AnsweredQuestion

http://stackoverflow.com/a/32871527
has body: The comment of zella was helpful for me. Did not work: DatumFunction&lt;Double&gt; datumFunction = new DatumFunction&lt;Double&gt;(){ @Override public Double apply(int d) { String result = "" + d; return value; } }; Does work: DatumFunction&lt;Double&gt; datumFunction = new DoubleDatumFunction(); with public class DoubleDatumFunction implements DatumFunction&lt;Double&gt; { @Override public String apply(int d) { String result = "" + d; return value; } } If I would remove the public modifier from the class for the second example, the example would not work any more.
answers question: http://stackoverflow.com/q/26846078
score: 0
type: Answer

http://stackoverflow.com/q/26847948
answer count: 0
type: UnansweredQuestion
tagged with: fortran
tagged with: web-hosting
has comment: http://stackoverflow.com/comment/42267477
has body: This is somewhat of a general question but I'm happy to provide specifics... I'm currently working on a project that involves building a form based web interface for a program that calculates food requirements of animals based on environmental inputs and returns the output back to the web page for display. What I'm struggling with is that the 'back end' code (the code that does the complex calculations) is written in Fortran (which can then be compiled to a .exe file). I've found methods in PHP to execute exe files using a dynamically generated csv as an input but I'm wondering if there are remote web hosts that allow this kind of command line functionality. Any advice? As a last resort we would set up our own web server but we would love to find a long term solution that uses 3rd party hosting. I'm also open to better ways of doing this...thanks!
has comment: http://stackoverflow.com/comment/42259300
type: Question
score: 0
has comment: http://stackoverflow.com/comment/42259397
tagged with: javascript
tagged with: windows
has title: Running compiled fortran as an .exe on remote web hosting
tagged with: php

http://stackoverflow.com/a/26857158
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42291505
type: Answer
answers question: http://stackoverflow.com/q/26856635
accepted answer of: http://stackoverflow.com/q/26856635
has body: Fixed your code and tried to comment it. You need to add class 'tattleTower' to EVERY tile element for this to work. Just a couple of points: 1) getElementsByClassName returns a live NodeList. That means it looks for elements every time you access it(like when you access it's length property); 2) You can avoid using 4 loops and use just 1 loop with if statements, if you add a common class to ALL elements. Like in this example you could add a class 'tattleTower'. So each element would have 2 classes. eg: class='tattleTower tattleTowerLeft'. 3) I don't quite understand why you decided to change border styles with js. You could do it in CSS in those classes. You can explicitly define what properties you want transitions to work on if you're worried about it. 4) You don't need to use id to access a particular element within a loop. You can use el[i]. Eg. el[0] will give you the first element of the array. 5) Try to cache as much as possible by using variables if you perform expensive operations. function rotateTile(){ // set up all variables at the top of the function // use querySelectorAll for static NodeList, instead of live nodeList var tattleTowerArray = document.querySelectorAll(".tattleTower"), el, i, len, elClassList, elStyle; // use one loop instead of four // cache array's length for performance (to avoid asking for it on each iteration) for (i = 0, len = tattleTowerArray.length; i &lt; len; i++){ el = tattleTowerArray[i]; // cache element for performance elClassList = el.classList; // cache element's classList elStyle = el.style; // cache element's style object // use 'if-else if' statements to check for class (you can change it to switch block, but i don't think it'd be best here) if (elClassList.contains('tattleTowerUp')) { elStyle.borderTopColor = "black"; elStyle.borderLeftColor = "red"; elClassList.remove("tattleTowerUp"); elClassList.add("tattleTowerLeft"); } else if (elClassList.contains('tattleTowerLeft')) { elStyle.borderLeftColor = "black"; elStyle.…
has comment: http://stackoverflow.com/comment/42277527
has comment: http://stackoverflow.com/comment/42276610
score: 0
has comment: http://stackoverflow.com/comment/42276504

http://stackoverflow.com/a/26843064
answers question: http://stackoverflow.com/q/26842683
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26842683
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42249590
has body: First change all menu template string building to: menuTemplate += ' '; menuTemplate += ' '+obj.menuTitle; menuTemplate += ' '; menuTemplate += ' '; menuTemplate += ' '; $.each(obj.documentTitle, function(mainkey, title) { menuTemplate += ' '+title+' '; }); menuTemplate += ' '; menuTemplate += ' '; $.each(obj.link, function(region, files) { menuTemplate += ' '; $.each(files, function(key, file) { menuTemplate += ' '+file+' '; }); menuTemplate += ' '; }); menuTemplate += ' '; menuTemplate += ' '; menuTemplate += ' '; Second you have an error in your data json file, change this: "documentTitle":["Apple, Pear"], To this: "documentTitle":["Apple", "Pear"],

http://stackoverflow.com/q/26905855
has comment: http://stackoverflow.com/comment/42363131
accepted answer: http://stackoverflow.com/a/26943083
has answer: http://stackoverflow.com/a/26906414
linked to: http://stackoverflow.com/q/1885557
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26943083
has comment: http://stackoverflow.com/comment/42363865
has title: Javascript find common values between two 2-D arrays
type: Question
score: 0
answer count: 2
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26906414
tagged with: multidimensional-array
has body: I have two 2-D arrays like: var data_consumed_dollars = [[1356998400000, 0.030380282850000006], [1357002000000, 0.0395505288], [1357005600000, 0.04084797307500001]]; var data_solargeneration_dollars = [[1356998400000, 0.030972182850000006], [1357178400000, 0], [1357182000000, 0], [1357185600000, 0], [1357189200000, 0], [1356998400000, 0.030380282850000006]]; I need to find the common values in these two arrays. I have tried this so far var ab = []; var data_consumed_dollars_common = []; for (var i = 0; i &lt; data_consumed_dollars.length; i++) { var a, b; if (parseFloat(data_solargeneration_dollars[i][0]) &gt; parseFloat(data_consumed_dollars[i][0])) { a = data_consumed_dollars[i][0]; ab.push(data_consumed_dollars[i][0]); } else a = data_solargeneration_dollars[i][0]; b = data_solargeneration_dollars[i][1]; data_consumed_dollars_common.push([ a, b ]); } But data_consumed_dollars_common is not returning the desired result.

http://stackoverflow.com/a/26918512
type: Answer
score: 1
upvote count: 1
downvote count: 0
has body: First, as mentioned in the comments, use filter instead of forEach here: function stripOutPremium(element, index, array) { if (element.is_premium === true) { var elementDescAdjustment = element.description; element.description = 'Premium content! ' + elementDescAdjustment.substr(0,15) + '...'; } return true; } return articles.filter(stripOutPremium); filter builds a new array, so you don't need to make one yourself. By return true in the callback, you include every element of the original array, but you can conditionally mutate each element as you process it. If you need to exclude any elements in the future, you can return false for that element instead. (You can also do the same thing with map, but do return element instead of return true.) To answer your actual question: if you want a use a general function as a callback but have it mutate some particular local array, you can write a function that returns another function. The outer function takes the array as an argument and returns a newly-created inner function that uses the array: function generateStriptOutPremiumForArray(someArray) { return function stripOutPremium(element, index, array) { if (element.is_premium === true) { var elementDescAdjustment = element.description; element.description = 'Premium content! ' + elementDescAdjustment.substr(0,15) + '...'; someArray.push(element); } else { someArray.push(element); } } } Here, the outer function returns a new function that has the outer function's someArray variable in its scope chain. Since you passed in regularArray as the outer function's someArray argument, the generated inner function has access to the local regularArray. Call it with: var regularArray = []; var generatedCallbackForThisRegularArray = generateStripOutPremiumForArray(regularArray); articles.forEach(generatedCallbackForThisRegularArray); // or just: articles.forEach(generateStripOutPremium(regularArray));
answers question: http://stackoverflow.com/q/26918171

http://stackoverflow.com/comment/94804422
has text: @QMaster install WebEssentials
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26882116

http://stackoverflow.com/q/26838738
accepted answer: http://stackoverflow.com/a/26838775
answer count: 2
downvote count: 1
has comment: http://stackoverflow.com/comment/42242208
upvote count: 0
has answer: http://stackoverflow.com/a/26838793
has answer: http://stackoverflow.com/a/26838775
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26838793
type: Question
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/1981673
has title: Regarding javascript variables
favorite count: 0
score: -1
has body: So I am working on a shopping cart that does not use cookies. In my first page (the store) I define several variables such as item quantities,item names,etc. In my second page (the checkout) I need to access the variables from the first page and display them to the user. How can I do so?

http://stackoverflow.com/a/26990608
has body: create a directive app.directive('focusMe', function($timeout) { return { scope: { trigger: '=focusMe' }, priority: -1, link: function(scope, element) { scope.$watch('trigger', function(value) { if (value === true) { $timeout(function() { element[0].focus(); scope.trigger = false; }, 300); } }); } }; }); add directive to the input field &lt;input type="text" focus-me="focusInput" data-ng-model="myModel" required .. /&gt; within controller $scope.focusInput=true; when $scope.focusInput is true the input field will be focused
downvote count: 0
type: Answer
score: 4
answers question: http://stackoverflow.com/q/26990533
upvote count: 4

http://stackoverflow.com/comment/42415295
has text: I understand. So I normally hide the links to those page and make the page itself redirect back to safety. But I really wouldn't care about them temporarily seeing that page, as long as they can't modify the data. If such an approach is not good enough for your application, you'll need a server-side solution that redirects the users away from your admin page.
type: QuestionComment
comment on: http://stackoverflow.com/q/26933357
score: 0
type: Comment

http://stackoverflow.com/q/26914849
favorite count: 0
possible better answer: http://stackoverflow.com/a/26916714
upvote count: 1
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42378798
has answer: http://stackoverflow.com/a/26914952
type: Question
has body: After asking a question and getting a very helpful answer on what the 'Async Juggling' assignment in learnyounode was asking me to do, I set out to implement it myself. The problem is, my setup isn't having any success! Even though I've referred to other solutions out there, my setup simply isn't returning any results when I do a learnyounode verify myscript.js. GIST: jugglingAsync.js var http = require('http'); var app = (function () { // Private variables... var responsesRemaining, urls = [], responses = []; var displayResponses = function() { for(var iterator in responses) { console.log(responses[iterator]); } }; // Public scope... var pub = {}; pub.main = function (args) { responsesRemaining = args.length - 2; // For every argument, push a URL and prep a response. for(var i = 2; i &lt; args.length; i++) { urls.push(args[i]); responses.push(''); } // For every URL, set off an async request. for(var iterator in urls) { var i = iterator; var url = urls[i]; http.get(url, function(response) { response.setEncoding('utf8'); response.on('data', function(data) { if(response.headers.host == url) responses[i] += data; }); response.on('end', function() { if(--responsesRemaining == 0) displayResponses(); }); }); } }; return pub; })(); app.main(process.argv); Question: What am I doing wrong?
accepted answer: http://stackoverflow.com/a/26914952
tagged with: javascript
answer count: 3
has comment: http://stackoverflow.com/comment/42378970
has answer: http://stackoverflow.com/a/28472258
downvote count: 0
score: 1
tagged with: asynchronous
has title: 'Juggling Async' - Why does my solution not return anything at all?
has answer: http://stackoverflow.com/a/26916714

http://stackoverflow.com/comment/42464747
has text: i got the score part working but im not sure how to make the image appear at a random location when the user clicks it
type: Comment
score: 0
comment on: http://stackoverflow.com/q/26962865
type: QuestionComment

createjs
tags question: http://stackoverflow.com/q/26865500
tags question: http://stackoverflow.com/q/26961285
tags question: http://stackoverflow.com/q/26977000
type: Tag
tag name: createjs
tags question: http://stackoverflow.com/q/26963722
tags question: http://stackoverflow.com/q/26927051

http://stackoverflow.com/comment/42264838
type: Comment
comment on: http://stackoverflow.com/a/26850960
score: 0
has text: Sorry, I mistake to import library, the version is incorrect, now you can see http://plnkr.co/edit/7UBGtsExGtoqCHJkeRpz?p=preview
type: AnswerComment

http://stackoverflow.com/q/26886585
tagged with: media
favorite count: 0
tagged with: audio-recording
tagged with: audio
type: AnsweredQuestion
has body: How to record an audio being played through my own page? I want to use JavaScript.
accepted answer: http://stackoverflow.com/a/26886727
type: Question
has title: Record sound played back using javascript
score: -2
linked to: http://stackoverflow.com/q/26263132
has answer: http://stackoverflow.com/a/26886727
tagged with: javascript
upvote count: 2
downvote count: 4
answer count: 1

http://stackoverflow.com/comment/42344038
comment on: http://stackoverflow.com/q/26894083
has text: "`This is my first question here so if you need anything I'll be glad to answer. Thanks.`" No it's not you have asked already the same question. Go edit your old one.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26939769
has body: globals is an array, not true false, here is my example. lookup works just like you were thinking. gulp.src(files.backend) .pipe(jshint({ "lookup": false, /* other options */ "globals": ['$']})) .pipe(jshint.reporter(stylish)) .on('error', gutil.log);
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/42423730
score: 4
answers question: http://stackoverflow.com/q/26937805
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26937805
type: Answer

http://stackoverflow.com/a/26974238
type: Answer
has body: Please see 18131834, which has this answer: Another way is to use the ui-router which supports regular expressions for route params: $stateProvider.state("artists-index", { url: "/artists/{page:[0-9]*}", templateUrl: "/www/artists/index.html", controller: "ArtistsIndexController" }); $stateProvider.state("artists-profile", { url: "/artists/{name}", templateUrl: "/www/artists/profile.html", controller: "ArtistsProfileController" });
answers question: http://stackoverflow.com/q/26974112
score: 0

http://stackoverflow.com/q/26870819
favorite count: 0
has answer: http://stackoverflow.com/a/26870926
has answer: http://stackoverflow.com/a/26870894
has answer: http://stackoverflow.com/a/75277153
possible better answer: http://stackoverflow.com/a/26870861
has answer: http://stackoverflow.com/a/26870861
type: AnsweredQuestion
has body: I have a div called box and I want to change it's content using javascript. document.getElementById("box").innerHTML = 'This is a sentence'; But i want it to look like This is a sentence I tried document.getElementById("box").innerHTML = 'This is\ a sentence'; and document.getElementById("box").innerHTML = 'This is\na sentence'; but none of them works.
accepted answer: http://stackoverflow.com/a/26870871
upvote count: 1
downvote count: 1
type: Question
answer count: 6
has comment: http://stackoverflow.com/comment/42300216
score: 0
has answer: http://stackoverflow.com/a/26870863
tagged with: javascript
has answer: http://stackoverflow.com/a/26870871
has title: Break line in innerHTML - javascript

http://stackoverflow.com/q/26889988
tagged with: javascript
tagged with: jquery
has title: jquery ui constrain draggable element inside smaller container
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/42334793
has comment: http://stackoverflow.com/comment/42334382
has comment: http://stackoverflow.com/comment/42334221
has comment: http://stackoverflow.com/comment/42335554
has comment: http://stackoverflow.com/comment/42335160
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/26890638
tagged with: jquery-ui
score: 1
linked to: http://stackoverflow.com/q/5279558
has comment: http://stackoverflow.com/comment/42334265
has body: I'm trying to drag an &lt;img&gt; inside a container that has fixed width and height. I already searched on SO and found this but it does not work for me. Here it is a fiddle of what I'm trying to achieve; there is a container which is the only part of the image I want the user to show, and a draggable image under it. It has to be constrained in the .container element depending on the orientation of the image and the container must include always a part of the image, never a blank part, in other words the image's borders must always stay inside the container. I tried to work with the containment property, but I don't understand how does the Array option works ( http://api.jqueryui.com/draggable/#option-containment ).
downvote count: 0
answer count: 1

http://stackoverflow.com/a/26963066
has body: You'll want to use canvasData.data[index + 3] = 255; Instead of canvasData.data[index + 3] = 1; While the canvas fillStyle uses an alpha value between 0-1, when you want to actually update the raw data for the canvas, alpha values are ranged between 0 and 255.
downvote count: 0
score: 3
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/26962949
accepted answer of: http://stackoverflow.com/q/26962949
upvote count: 3

http://stackoverflow.com/q/26859483
answer count: 1
type: UnansweredQuestion
has title: how to make responsive tabs to accordion with customized scrollbar inside content container ??
tagged with: css
has answer: http://stackoverflow.com/a/26859873
has comment: http://stackoverflow.com/comment/51825044
has body: I want to make the design given below.I am new to Jquery and javascript and can't find anything useful from last few hours.Suggest any Plugin or fiddle kindly.
type: Question
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/26929909
type: Question
tagged with: javascript
tagged with: search
score: 0
answer count: 1
has body: I try to add a search field in the todo app example of meteorjs, but I don't know how to do it. I can get the value of the search field with a event but after that I don't know how to filter the "Tasks" collection. Anyone know how to handle this ? Thanks
tagged with: meteor
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26933770
has title: How to add search in meteor todo app example

sqldatasource
tag name: sqldatasource
type: Tag
tags question: http://stackoverflow.com/q/26944435

http://stackoverflow.com/tag/json
tags question: http://stackoverflow.com/q/26901971
tags question: http://stackoverflow.com/q/26844401
tags question: http://stackoverflow.com/q/26946207
tags question: http://stackoverflow.com/q/26873403
tags question: http://stackoverflow.com/q/26967200
tags question: http://stackoverflow.com/q/26916227
tags question: http://stackoverflow.com/q/26883760
tags question: http://stackoverflow.com/q/26890338
tags question: http://stackoverflow.com/q/26917802
tags question: http://stackoverflow.com/q/26922148
tags question: http://stackoverflow.com/q/26933468
tags question: http://stackoverflow.com/q/26893388
tags question: http://stackoverflow.com/q/26973957
tags question: http://stackoverflow.com/q/26991125
tags question: http://stackoverflow.com/q/26899602
tags question: http://stackoverflow.com/q/26958735
tags question: http://stackoverflow.com/q/26944249
tags question: http://stackoverflow.com/q/26915183
tags question: http://stackoverflow.com/q/26875146
tags question: http://stackoverflow.com/q/26901547
tags question: http://stackoverflow.com/q/26898431
tags question: http://stackoverflow.com/q/26884937
tags question: http://stackoverflow.com/q/26906282
tags question: http://stackoverflow.com/q/26930387
tags question: http://stackoverflow.com/q/26926561
tags question: http://stackoverflow.com/q/26966572
tags question: http://stackoverflow.com/q/26880173
tags question: http://stackoverflow.com/q/26881956
tags question: http://stackoverflow.com/q/26953466
tags question: http://stackoverflow.com/q/26884341
tags question: http://stackoverflow.com/q/26908923
tags question: http://stackoverflow.com/q/26888627
tags question: http://stackoverflow.com/q/26900764
tags question: http://stackoverflow.com/q/26979904
tags question: http://stackoverflow.com/q/26919445
tags question: http://stackoverflow.com/q/26955378
tags question: http://stackoverflow.com/q/26910816
tags question: http://stackoverflow.com/q/26991421
tags question: http://stackoverflow.com/q/26844412
tags question: http://stackoverflow.com/q/26958689
tags question: http://stackoverflow.com/q/26960041
tags question: http://stackoverflow.com/q/26905527
tags question: http://stackoverflow.com/q/26916169
tags question: http://stackoverflow.com/q/26937171
tags question: http://stackoverflow.com/q/26930142
tags question: http://stackoverflow.com/q/26984391
tags question: http://stackoverflow.com/q/26851666
tags question: http://stackoverflow.com/q/26956267
tags question: http://stackoverflow.com/q/26982749
tags question: http://stackoverflow.com/q/26893298
tags question: http://stackoverflow.com/q/26971055
type: Tag
tags question: http://stackoverflow.com/q/26871754
tags question: http://stackoverflow.com/q/26945442
tags question: http://stackoverflow.com/q/26956383
tags question: http://stackoverflow.com/q/26963098
tags question: http://stackoverflow.com/q/26940782
tags question: http://stackoverflow.com/q/26987780
tags question: http://stackoverflow.com/q/26903393
tags question: http://stackoverflow.com/q/26909917
tags question: http://stackoverflow.com/q/26887578
tags question: http://stackoverflow.com/q/26963668
tags question: http://stackoverflow.com/q/26834671
tags question: http://stackoverflow.com/q/26869817
tags question: http://stackoverflow.com/q/26910647
tags question: http://stackoverflow.com/q/26850183
tags question: http://stackoverflow.com/q/26867252
tags question: http://stackoverflow.com/q/26957401
tags question: http://stackoverflow.com/q/26975929
tags question: http://stackoverflow.com/q/26884286
tags question: http://stackoverflow.com/q/26942968
tags question: http://stackoverflow.com/q/26964778
tags question: http://stackoverflow.com/q/26990646
tags question: http://stackoverflow.com/q/26897975
tags question: http://stackoverflow.com/q/26910346
tags question: http://stackoverflow.com/q/26861915
tags question: http://stackoverflow.com/q/26863927
tags question: http://stackoverflow.com/q/26879524
tags question: http://stackoverflow.com/q/26881873
tags question: http://stackoverflow.com/q/26947286

http://stackoverflow.com/q/26923655
type: UnansweredQuestion
has title: Counter array in Javascript
upvote count: 0
has comment: http://stackoverflow.com/comment/42394886
type: Question
has answer: http://stackoverflow.com/a/26924078
has answer: http://stackoverflow.com/a/26924069
score: -2
tagged with: arrays
tagged with: javascript
downvote count: 2
answer count: 3
has answer: http://stackoverflow.com/a/26924041
has body: I am trying to make two arrays. the unique array can get the elements (no repeats) from the text array, and the counter one can count the frequency of each elements. but something is wrong with the counter one. var unique_array=new Array(); var counter_array=new Array(); var unique=true; for (i=0;i&lt;text_array.length;i++){ if (unique_array.length==0){ unique_array.push(text_array[0]); counter_array.push(1); } else if(unique_array.length&gt;0&amp;&amp;unique_array.length&lt;=text_array.length){ for (j=0; j&lt;unique_array.length;j++){ if (text_array[i]==unique_array[j]){ counter_array[j]=counter_array[j]+1;// something wrong with the alert(counter_array[j]); var unique=false; } } if (unique==true){ unique_array.push(text_array[i]); counter_array.push[1]; } unique=true; }
has comment: http://stackoverflow.com/comment/42394406
favorite count: 0

http://stackoverflow.com/q/26966064
tagged with: dom
has answer: http://stackoverflow.com/a/26966107
upvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/26966107
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
downvote count: 1
type: Question
has body: Following is my PLNKR CODE for creating dynamic script elements. But it is throwing following error - TypeError: Argument 1 of Node.appendChild is not an object. document.head.appendChild("script1"); I also tried document.getElementsByTagName('head')[0] for targeting but it again throw the same error. Please let me know what I am doing wrong with the concept. This is the answer I followed for this - Stack Link My JS code - (function(){ var script1 = document.createElement('script'); script1.src= "script1.js"; //document.getElementsByTagName('head')[0].appendChild("script1"); document.head.appendChild("script1"); var add = document.createElement('script'); add.src= "add.js"; //document.getElementsByTagName('head')[0].appendChild("add"); document.head.appendChild("add"); var subtract = document.createElement('script'); subtract.src= "subtract.js"; //document.getElementsByTagName('head')[0].appendChild("subtract"); document.head.appendChild("subtract"); $("#add").find('.result').text(c); $("#subtract").find('.result').text(d); })();
tagged with: appendchild
score: -1
has title: Add scripts dynamically in a page JavaScript

http://stackoverflow.com/comment/42480797
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26972639
has text: do you mean something like this? [comments plugin](https://developers.facebook.com/docs/plugins/comments)
score: 0

http://stackoverflow.com/comment/42245478
comment on: http://stackoverflow.com/a/26840464
has text: @torazaburo OP doesn't say anything about not using jQuery and it's included in the tags.
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/q/26890849
answer count: 2
has comment: http://stackoverflow.com/comment/42336423
has answer: http://stackoverflow.com/a/26891435
has comment: http://stackoverflow.com/comment/42336486
has comment: http://stackoverflow.com/comment/42336034
tagged with: javascript
has body: I'm busy on a site, and it needs to be colorfull, so I got a list of colors, and I was like: "Hey! Lets switch container tops on click of certain menu items." So I decided to use the jQuery data attribute: Leden Game Radio Nieuws Home So I defined the data-color at every item, lets get onto the actual jQuery code: $(".item").click(function(){ backgroundKleur = '#' + $(this).data('color'); changeColors(backgroundKleur); $(".item").removeClass('bold-font'); $(this).addClass('bold-font'); }); function changeColors(backgroundKleur){ $("#submenu-container").css('background-color', backgroundKleur); $(".content_small_top").css('background-color', backgroundKleur)); } But now, when the color switches I want to fade out the old color and fade in the new one. I tried various options like fadeToggle or using slideUp and slideDown at once, but non of it worked like I wanted it. Is it possible to achieve what I want? Thanks
has answer: http://stackoverflow.com/a/26893071
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26891435
tagged with: jquery
has comment: http://stackoverflow.com/comment/42336648
possible better answer: http://stackoverflow.com/a/26893071
has comment: http://stackoverflow.com/comment/42335731
type: Question
has title: Animation on color switch
score: 0

http://stackoverflow.com/q/26948819
tagged with: ajax
answer count: 2
has title: how to get some data column and header by onclick in table jquery
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/26948991
favorite count: 0
has answer: http://stackoverflow.com/a/26949719
upvote count: 1
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/26949719
has body: Now I have a table that generate by using javascript .Below is my code to generate table : $.ajax({ type:"POST", url:"../cdc/load/jsonTrack.php?", data:dataString, dataType: 'json', success: function(data){ if(data.status === "success") { var elements = data.elements; if(elements.length === 0) { $('#cdcTracking-list tbody').append( ' ' + ' No session to display ' + ' '); } for( var i = 0; i < elements.length; i++){ var element = elements[i]; //console.log('session id:' + element.vesselCode); $('#cdcTracking-list tbody').append( ' ' + ' ' + element.vesselCode + ' ' + ' ' + element.voyage + ' ' + ' ' + element.chasisNo + ' ' + ' ' + element.chasisNo + ' ' + ' ' + element.plateNo + ' ' + ' ' + element.bookingRef + ' ' + ' ' + element.serviceTerm +' '+ ' ' ); } }else { $('#cdcTracking-list tbody').append( ' No session to display '); } } }); Does anyone know how can I get some column data and it header by onclick ,because my current code seem not working and I dont know if I'm missing something here.Below is my code to get : $('#cdcTracking-list tr td').click(function() { var header = $('#cdcTracking-list th').eq($(this).index()).text(); //to get clicked column's header var trackid = $(this).siblings('td:nth-child(36)').text(); //get column at column 36 var date = $(this).text(); //get clicked column value }); Does anyone have a experience with this ,and please help me out
accepted answer: http://stackoverflow.com/a/26948991
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/42463298
score: 0
type: Comment
type: QuestionComment
has text: instead of giving us the JS tell us what you want to do
comment on: http://stackoverflow.com/q/26962585

http://stackoverflow.com/q/26956250
has answer: http://stackoverflow.com/a/26956343
tagged with: arrays
has body: my html code script for check null textbox if null alert and focus that textbox but it doesn't work array i use add textbox with button i have problem to use id for autocomplete search
has comment: http://stackoverflow.com/comment/42452232
has comment: http://stackoverflow.com/comment/42451961
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: How to get value form name[] of textbox [script]
has answer: http://stackoverflow.com/a/26956473
type: Question
tagged with: javascript
score: 0
answer count: 2

http://stackoverflow.com/comment/42236482
comment on: http://stackoverflow.com/a/26834747
score: 0
type: AnswerComment
has text: +1 really good to know that it would wait for an attribute to exist.
type: Comment

http://stackoverflow.com/a/26849752
score: 2
has comment: http://stackoverflow.com/comment/65647150
answers question: http://stackoverflow.com/q/26849677
downvote count: 1
upvote count: 3
has body: You can't, you'll need to provide the request with the credentials. See How to use Basic Auth with jQuery and AJAX?
type: Answer

http://stackoverflow.com/q/26965996
tagged with: javascript
has body: This piece of code places 5 random number in 5 lines and when user clicks on each number the cursor shape changes to pointer and text back ground color changes randomly. I meant to do it in a way that when mouse goes on a text itself it turns to a pointer and color of only the text changes not the whole line. But I am not sure how to do that. Any hint ? var div = document.getElementById("div1"); // There is a html file with a div tag which its ID is div1 var bgColors = ["yellow","red","green","blue","orange"]; for(counter = 0 ; counter&lt;5; counter++){ p = document.createElement("p"); node = document.createTextNode(generateRandomNumer()); p.appendChild(node); div.appendChild(p); } function bgColorChange(element){ element.style.backgroundColor = bgColors[Math.floor((Math.random()*5))]; } pTags = document.getElementsByTagName("p"); for (counter = 0; counter&lt;pTags.length ; counter++ ){ console.log(pTags[counter]); pTags[counter].style.cursor = "pointer" pTags[counter].addEventListener("click",function(){ bgColorChange(this)}); };
score: 0
has comment: http://stackoverflow.com/comment/42469264
type: UnansweredQuestion
has title: Javascript / changing text background color
answer count: 0
has comment: http://stackoverflow.com/comment/42470001
type: Question
has comment: http://stackoverflow.com/comment/42469405

http://stackoverflow.com/q/26935908
has comment: http://stackoverflow.com/comment/42416600
has body: I want to replace the part of an URL like "/wiki/home/de/wikihome.md".replace("/wiki/home/(..)/.*\.md ", "en"); why doesn't this work (ie return /wiki/home/en/wikihome.md). It returns the unmodified string. How to do it correctly?
type: Question
has answer: http://stackoverflow.com/a/26936127
has comment: http://stackoverflow.com/comment/42416421
tagged with: javascript
score: -1
possible better answer: http://stackoverflow.com/a/26936051
has comment: http://stackoverflow.com/comment/42416142
has answer: http://stackoverflow.com/a/26936051
downvote count: 1
has comment: http://stackoverflow.com/comment/42416274
accepted answer: http://stackoverflow.com/a/26936053
favorite count: 0
has comment: http://stackoverflow.com/comment/42416362
has answer: http://stackoverflow.com/a/26936090
has comment: http://stackoverflow.com/comment/42416183
has answer: http://stackoverflow.com/a/26936053
answer count: 4
type: AnsweredQuestion
upvote count: 0
has title: RegEx replace in Javascript doesn't replace
has comment: http://stackoverflow.com/comment/42416159

http://stackoverflow.com/q/26882039
has comment: http://stackoverflow.com/comment/42319873
type: Question
downvote count: 2
tagged with: jquery-ui
score: -2
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26882189
tagged with: joomla
favorite count: 0
upvote count: 0
type: UnansweredQuestion
has body: I try to use jQuery on a Joomla site. For this I have tried to use the very simple example code in the jQuery UI documentation. So on my site I have this: &lt;script type="text/javascript"&gt; $(function() { $( "#datepicker" ).datepicker(); }); &lt;/script&gt; &lt;input class="hasDatepicker" id="datepicker" type="text" /&gt; jQuery and jQueryUI should be loaded like I see in the source. But, it still doesn't work. What is wrong here? I tried to use $.noConflict(); but still no luck. You can see my site here: http://www.schlitteln-berguen.ch/mieten Thanks for your help.
has title: Can't use jQuery in Joomla
has comment: http://stackoverflow.com/comment/42319903

http://stackoverflow.com/q/26955440
downvote count: 1
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
score: 1
has title: change font color when clicking on menu with jquery
has answer: http://stackoverflow.com/a/26955818
accepted answer: http://stackoverflow.com/a/26955818
type: Question
has answer: http://stackoverflow.com/a/26955956
has body: I want to change the item color and its parent when clicking on the menu and sub-menu. like this menu. but when I click on sub-menu, the color of the parent menu is removed. $('li a').click(function() { $(' li a').removeClass('active'); { $(this).parent('a').addClass('active'); $(this).addClass('active'); } }); .active { color: #DC0000 !important; } main menu menu1
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26955956
upvote count: 2
answer count: 2

http://stackoverflow.com/comment/42295755
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26868169
score: 0
has text: No I don't use jQuery

http://stackoverflow.com/comment/42401599
has text: Please do a "save-as" from the page in your browser, and show us the generated HTML that jQuery sees. :)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26927632
score: 0

http://stackoverflow.com/comment/42288299
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26864339
has text: You are loading the scripts in body of master page. Are you trying to access the scripts before it is loaded. Kindly place the loading of scripts in head section just to see is it changing any thing....
score: 0

http://stackoverflow.com/comment/42298094
type: AnswerComment
has text: @Scimonster, For me it returns `{}` - not the (by me) awaited `'b'`.
type: Comment
comment on: http://stackoverflow.com/a/26869348
score: 0

http://stackoverflow.com/comment/42362686
has text: @Sebastian Plu - If you look at http://c3js.org/samples/timeseries.html, the equivalent to what I want is for the x-axis to only start labelling the axis at '2013-01-02', and have a label every 2 days. So it will miss out '2013-01-01', '2013-01-03'... even though the data point is still there.
score: 0
comment on: http://stackoverflow.com/q/26878054
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42333520
type: QuestionComment
comment on: http://stackoverflow.com/q/26889337
has text: @aquinas "add logic **before**". I sholud have said: on the server side. I am searching for a solution on the client side.
score: 0
type: Comment

http://stackoverflow.com/q/26889186
has title: Where does jquery UI Autocomplete store the ui.conent
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/26889424
type: UnansweredQuestion
has body: When the menu is open I would like to access the ui.content array but I can't find it in the object anywhere. I can find the menu with this code but that doesn't have all the elements that are passed to the ui.content. $(selector).data("ui-autocomplete").menu.element[0] Any suggestions. What i'd like to do is add items to the menu after the menu has opened. EDIT My question is where is the equivalent of ui.content stored when the menu is open?
downvote count: 0
score: 1
type: Question
tagged with: jquery-ui-autocomplete
tagged with: jquery-ui
tagged with: javascript

http://stackoverflow.com/comment/42488519
type: Comment
type: QuestionComment
has text: First part of your problem: http://stackoverflow.com/questions/750486/javascript-closure-inside-loops-simple-practical-example, but there are better ways to implement it.
score: 0
comment on: http://stackoverflow.com/q/26976925

http://stackoverflow.com/q/26845325
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/26845892
has body: I'm trying to do a simple javascript menu for a web page, and everything seems to work well. The function that fades the menu in (by changing the opacity of the element) is linked to an onmouseover event in the menu title element, and the functions to fade it out is linked to a onmouseleave event. The menus partially overlap (position attribute is set to absolute, and I need that for the page design), but it isn't a problem because only one at a time is showed. I've noticed that whenever the mouse enters the space occupied by the next menu, the onmouseleave event is triggered, fading the current menu out, even if that space is shared. Is there a way to solve this?
has comment: http://stackoverflow.com/comment/42253993
tagged with: javascript
score: -1
has title: onmouseleave triggered when the mouse enters the space of another element, even if that space is shared with the first element?
upvote count: 0
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/42254014

http://stackoverflow.com/q/26861795
has comment: http://stackoverflow.com/comment/42283839
linked to: http://stackoverflow.com/q/26184530
has comment: http://stackoverflow.com/comment/42283997
has comment: http://stackoverflow.com/comment/42284014
type: Question
has title: Datatable in not updating after successful ajax call
tagged with: asp.net-mvc
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/42284152
tagged with: datatable
has comment: http://stackoverflow.com/comment/42284173
has body: I'm deleting row from datatable , and then after deleting record , I'm binding table row again then calling dataTable function again but it is not updating the total number of record showing at bottom . from server side I'm getting updated number of record , and also in my table updated number of row. but total number shown by dataTable is not updated. this is my ajax code $(document).delegate('.Delete', 'click', function () { var getDeleteID = parseInt($(this).closest('tr').find('td:eq(0)').find('span').text()); BootstrapDialog.confirm('Are you sure you want to delete person?', function (result) { if (result) { $.ajax({ type: 'GET', contentType: 'application/json; charset=utf-8', url: '/Home/DeleteData', data: { Id: getDeleteID }, dataType: "json", success: function (data) { BindTable(data); }, error: function (data) { alert("Error In Deleting Person "); } }); } }); }); }); this is my BindTable Function function BindTable(data) { var tabHtml = ''; $.each(data, function (i, d) { tabHtml += " " + d.ID + "" + d.Name + " " + d.Position + " " + d.Age + " " + d.Salary + " EditDelete "; }); $('#dbTable').find('tbody').html(tabHtml); $('#dbTable').dataTable(); } HTML : Name Position Age Salary Action
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42284283
has comment: http://stackoverflow.com/comment/42284079

http://stackoverflow.com/a/26949813
score: 0
accepted answer of: http://stackoverflow.com/q/26949741
type: Answer
answers question: http://stackoverflow.com/q/26949741
has body: Your syntax is all jacked up: if(document.getElementById("class_angel") value="Angel") see how you have a random ")" at the end of your line? edit: I think you probably meant to write: function continueCheck() { if(document.getElementById("class_angel").checked) { console.log("You pressed Angel"); } else if(document.getElementById("class_beast").checked) { console.log("You pressed Beast"); } else if(document.getElementById("class_spirit").checked) { console.log("You pressed Spirit"); } }
type: AcceptedAnswer

http://stackoverflow.com/q/26853241
tagged with: javascript
has title: Instafeed.js doesn't show images on page
score: 0
tagged with: instagram
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/42272539
type: UnansweredQuestion
tagged with: instafeedjs
has answer: http://stackoverflow.com/a/28621092
has body: I trying to use instafeed.js for my local site. But I don't understand why images from my account don't show? My code Connected instafeed.js and file where I write the script Section for images Latest Photos and app.js with instafeed value $(function() { var feed = new Instafeed({ get: 'user', userId: ID, accessToken: 'Token', target: 'inst', links: true, limit: 8, useHttp: true, sortBy: 'most-recent', resolution: 'standard_resolution', template: ' {{caption}} ' }); feed.run(); });
has comment: http://stackoverflow.com/comment/42278389
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27028809

http://stackoverflow.com/comment/42382518
comment on: http://stackoverflow.com/q/26914990
type: Comment
score: 1
type: QuestionComment
has text: the nice thing about the existential operator in coffeescript is that it is contextually aware (because of the compilation step). http://tinyurl.com/nqx2aja but I would consider it a code smell to chain it this deep. I like that reduce solution a lot.

http://stackoverflow.com/comment/114602592
type: Comment
comment on: http://stackoverflow.com/a/26946318
has text: @ImShogun any ideas on how to "support" the case when the input is changed via JS?
type: AnswerComment
score: 2

http://stackoverflow.com/a/26879659
downvote count: 0
has comment: http://stackoverflow.com/comment/42316455
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/42337780
has body: parseFromString will not load the data from the address.xml file. As the name says, it will only parse an XML doc from a string, like this: var dom = new DOMParser(); var xmlDoc = dom.parseFromString(" test ","application/xml"); You'll need a separate XHR (Ajax) request to load the data from that file. Also, you should be using console.log instead of an alert to debug this. You'll be able to actually see what's in that object (an error message in your case).
score: 2
answers question: http://stackoverflow.com/q/26879580
has comment: http://stackoverflow.com/comment/42316028
accepted answer of: http://stackoverflow.com/q/26879580
has comment: http://stackoverflow.com/comment/42316570
type: AcceptedAnswer

http://stackoverflow.com/comment/42343037
has text: I was just wrapping the controller logic in $timeout to test for your hypothesis, not to solve the problem, for that I used $watch as you suggested! :)
type: Comment
comment on: http://stackoverflow.com/a/26894034
score: 0
type: AnswerComment

http://stackoverflow.com/q/26968298
has answer: http://stackoverflow.com/a/26968467
accepted answer: http://stackoverflow.com/a/26968467
possible better answer: http://stackoverflow.com/a/26970599
has title: jQuery CSS Attributes not Applying
has comment: http://stackoverflow.com/comment/42473124
has answer: http://stackoverflow.com/a/26970599
type: Question
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I am centering a element inside a div horizontally and vertically, however the jQuery CSS code seems to be only resulting in style="margin: 0px" any ideas? Example (script src) jQuery: image.css({ 'margin-top': '-'+(style['img-width']/2)+'px', 'margin-left': '-'+(style['img-height']/2)+'px', }); Alternatively I tried: image.css({ 'marginTop': '-'+(style['img-width']/2)+'px', 'marginLeft': '-'+(style['img-height']/2)+'px', }); CSS: #theater-img { position: absolute; text-align: center; margin: 0; padding: 0; } #theater-img img { position: absolute; top: 50%; left: 50%; -webkit-box-shadow: 0 0 20px 20px rgba(0,0,0,0.5); box-shadow: 0 0 20px 20px rgba(0,0,0,0.5); }
has answer: http://stackoverflow.com/a/26969549
has comment: http://stackoverflow.com/comment/42473161
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42473121

http://stackoverflow.com/comment/42317096
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26860789
has text: This causes more problems actually, I need to to be an actual date/time, not just a day of the month. Another problem is that Google sheets and javascript handle dates differently. 2/24 means 2/24ths of 1 day, or 2 hours as google handles the time of a datetime as a fraction of the day. Basically, as the datetime in google is just a count of days since 1900, I just want to add to that number then have sheets interpret that as a date again. But the code wants to interpret it as a string rather than a number.
score: 0

http://stackoverflow.com/comment/42363830
comment on: http://stackoverflow.com/a/26886203
has text: I found the links using the Network tab in Chrome DevTools window. If you get an address error after a while it could be that too many consecutive requests are made to the server. Try using a delay between requests.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/26843787
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/26843728
answers question: http://stackoverflow.com/q/26843728
has body: Move the line var content = "data=1"; out of the function: var content = "data=1"; setInterval (function () { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { content = "data=" + xmlhttp.responseText; alert (xmlhttp.responseText); } } xmlhttp.open("POST" , "execute-page.php" , true); xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlhttp.send(content); },5000);

http://stackoverflow.com/a/26846332
score: 1
has body: You should block the default submit trigger by using e.preventDefault(); $(this).closest('form').submit(function (e) { e.preventDefault(); &lt;!--rest of the code--&gt; })
has comment: http://stackoverflow.com/comment/42255797
answers question: http://stackoverflow.com/q/26846252
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/q/26894554
has comment: http://stackoverflow.com/comment/42342672
has body: I have an HTML page that uses a php file as a script file, like this: &lt;!doctype html&gt; &lt;html lang="en"&gt; &lt;head&gt; ... &lt;script src="../script.js.php"&gt;&lt;/script&gt; &lt;/head&gt; ... The script.js.php file has something like this: &lt;?php header('Content-type:text/javascript; charset=utf-8'); $someVar = []; foreach (glob('*.txt') as $filename) { $someVar[] = $filename; } ?&gt; ... here starts the javascript code As can be seen, script.js.php is in a parent folder of the HTML file so what happens is that the PHP glob() function sees the parent folder, not the folder where the HTML page is, so it will list all text files inside that folder. Is there a way to modify this code so that I can have $someVar with the list of the text files inside the folder of the HTML file? Thank you. EDIT: I think it needs a clarification. The same PHP file will be used by some other HTML files, different HTML files, located in different folders, using the same PHP/Javascript file. This is the problem, the PHP file should be ideally able to know the directory of its "caller", the HTML page that uses it. If I hard-code a solution into the PHP file for a certain HTML file, then the PHP file would not be useful anymore for the others. I could then simply use the PHP file inside the folder of each HTML file but then I would have theh same file repeated many times, which is very bad for maintenance purposes. EDIT 2: I may have found a way to solve the problem. My HTML file becomes: ... &lt;script src="script.js.php"&gt;&lt;/script&gt; ... script.js.php becomes: &lt;?php header('Content-type:text/javascript; charset=utf-8'); $curDir = getcwd(); include('../newfile.js.php'); echo file_get_contents("../rest.of.js.code.js"); ?&gt; and newfile.js.php is: &lt;?php $someVar = []; foreach (glob($curDir . '/*.txt') as $filename) { $someVar[] = basename($filename); } echo "var someVar = " . json_encode($someVar) . ";\r\n"; ?&gt; rest.of.js.code.js will now contain the Javascript cod…
answer count: 1
tagged with: javascript
score: 0
tagged with: directory
has comment: http://stackoverflow.com/comment/42342774
has answer: http://stackoverflow.com/a/26894701
type: UnansweredQuestion
tagged with: php
has title: Get directory of HTML page in PHP file that is called by the HTML page
type: Question

http://stackoverflow.com/a/26903982
has body: javascript:resizeTo(1024,768); vbscript:resizeto(1024,768) Will work in IE7, But consider using something like javascript:moveTo(0,0);resizeTo(1024,768); because IE7 doesn't allow the window to "resize" beyond the screen borders. If you work on a 1024,768 desktop, this is what happens... Firefox: 1024x768 Window, going behind the taskbar. If you drop the moveTo part, the top left corner of the window won't change position.(You still get a 1024x768 window) IE7: As close as possible to the requested size without obscuring the taskbar or allowing any part of the window to lie beyond the screen borders. safari: As close as possible to the requested size without obscuring the taskbar or allowing any part of the window to lie beyond the screen borders, but you can ommit the moveTo part. Safari will move the top left corner of the window for you. Opera: Nothing happens. Chrome: Nothing happens. This quote is from: Tolle you can find his post here: How do you resize an IE browser window to 1024 x 768 Hopefully this is help full to you!
downvote count: 2
upvote count: 0
score: -2
has comment: http://stackoverflow.com/comment/42399106
has comment: http://stackoverflow.com/comment/42359620
type: Answer
answers question: http://stackoverflow.com/q/26902297

http://stackoverflow.com/comment/42719045
comment on: http://stackoverflow.com/q/26917801
has text: call $scope.$apply(); after setting player.profileUpdated
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/42544694
has text: I got an solution for this issue. Simply add one more line series with the chart. This will create a hr line in chart. We can manage also.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26846884

http://stackoverflow.com/a/26973110
score: 0
answers question: http://stackoverflow.com/q/26972818
type: Answer
has comment: http://stackoverflow.com/comment/42481601
has comment: http://stackoverflow.com/comment/42482007
has body: $(document).ready(function () { /********************************************************************************/ /* Parallax Scrolling */ // Cache the Window object var $window = $(window); $('[data-type]').each(function () { $(this).data('offsetY', parseInt($(this).attr('data-offsetY'))); $(this).data('Xposition', $(this).attr('data-Xposition')); $(this).data('speed', $(this).attr('data-speed')); }); // For each element that has a data-type attribute $('div[data-type="background"]').each(function () { var $self = $(this), offsetCoords = $self.offset(), topOffset = offsetCoords.top; $(window).bind('scroll', function () { if (($window.scrollTop() + $window.height()) &gt; (topOffset) &amp;&amp; ((topOffset + $self.height()) &gt; $window.scrollTop())) { var yPos = -($window.scrollTop() / $self.data('speed')); if ($self.data('offsetY')) { yPos += $self.data('offsetY'); } var coords = '50% ' + yPos + 'px'; $self.css({ backgroundPosition: coords }); }; }); }); // For each element that has a data-type attribute $('div[data-type="content"]').each(function () { $(window).bind('scroll', function () { var scrolledY = $(window).scrollTop(); $('.parallax-content').css('bottom', '+' + ((scrolledY * 1.3)) + 'px'); }); }); $(window).scroll(function(){ if ($(this).scrollTop() &gt; 150) { $('.sidebar').addClass('fixed'); } else { $('.sidebar').removeClass('fixed'); } }); }); CSS .fixed {position:fixed; top:0;} DEMO
has comment: http://stackoverflow.com/comment/42481695
has comment: http://stackoverflow.com/comment/42481488

http://stackoverflow.com/q/26927324
has comment: http://stackoverflow.com/comment/42401207
tagged with: templates
has answer: http://stackoverflow.com/a/26940507
tagged with: mustache
has comment: http://stackoverflow.com/comment/42403658
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/42404338
has title: Understanding {{.0}} {{.1}} in stache templates
accepted answer: http://stackoverflow.com/a/26940507
has comment: http://stackoverflow.com/comment/42404733
has comment: http://stackoverflow.com/comment/42400962
score: 0
has body: I'm working on a project with stache (a version of mustache, the templating system) and I've come across &lt;a href="{{.0}}" data-set="{{.1}}"&gt;&lt;/a&gt; If I was guessing, I'd say that those numbers are indexes in an array? But I'm not sure and I can't find a reference to them in the docs... Do you know what they are? Help greatly appreciated... James
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/42404165
has comment: http://stackoverflow.com/comment/42404121

http://stackoverflow.com/a/31351523
score: 16
answers question: http://stackoverflow.com/q/26932402
upvote count: 16
has comment: http://stackoverflow.com/comment/119968224
has body: "Unbuffered" means that the code is executed, but the results are not sent to the output buffer. "Buffered" also means that the code is executed, and the results are sent to the output buffer. For example, this Jade: .unbuffered - 'unbuffered vs buffered' .buffered = 'unbuffered vs buffered' Produces this HTML: unbuffered vs buffered
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/120198024

http://stackoverflow.com/a/26964776
has comment: http://stackoverflow.com/comment/42467383
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/26964751
upvote count: 2
has comment: http://stackoverflow.com/comment/42467340
has comment: http://stackoverflow.com/comment/42467305
has body: You can use plain JavaScript as follows: var theId = this.id; //or $(this).attr('id'); and var newValue = this.value; //or $(this).val(); THE HOW &amp; WHERE var showText = function () { $(this).hide();//show text $(this.nextElementSibling).show();//hide input $.ajax({ url: '....', data: {id: this.id, value: this.value}, .... }); };
type: Answer

http://stackoverflow.com/q/26952790
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26953136
downvote count: 0
has body: A standard input field with type="date" in AngularJS 1.3 provides a "Clear field" icon. Here is what I mean. Is there a way to add such "Clear field" icon to an input field with type="text"?
type: Question
tagged with: angularjs-directive
score: 1
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/26957149
tagged with: javascript
has title: How to add a remove/clear field icon to an input field
favorite count: 0
has comment: http://stackoverflow.com/comment/42446566
tagged with: angularjs

http://stackoverflow.com/a/42567980
type: Answer
has body: I have come across the same scenario. I have come across the problem with the below given solution //Function to open export modal scope.openExportModal(); expect( uibModal.open ).toHaveBeenCalledWith(options); expect( uibModal.open.calls.mostRecent().args[0].resolve.modalData() ).toEqual(modalData); Hope this may help if you want a quick fix.
answers question: http://stackoverflow.com/q/26853603
score: 0

http://stackoverflow.com/comment/42462479
comment on: http://stackoverflow.com/a/26960935
has text: Even if he uses YQL he will only get the source of the page as returned by the server, not with any javascripts executed (as he specifically requested).
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/a/26874396
has comment: http://stackoverflow.com/comment/42317413
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/26873654
has body: You can use the Node.inRegion method to test if the node is inside another node, passing true as the second parameter will ensure that it is fully inside the target region. http://jsfiddle.net/ab1cjrcj/16/ YUI().use('dd-constrain', function(Y) { var dragNode = Y.one('#dd-demo-1'), innerCanvasNode = Y.one('#dd-demo-canvas3'), dd1; dd1 = new Y.DD.Drag({ node: dragNode }).plug(Y.Plugin.DDConstrained, { constrain2node: '#dd-demo-canvas1' }); dd1.on('drag:end', function(e){ if (dragNode.inRegion(innerCanvasNode, true)){ dragNode.replaceClass('dd-demo-outside', 'dd-demo-inside'); } else { dragNode.replaceClass('dd-demo-inside', 'dd-demo-outside'); } //console.log(dragNode.inRegion(innerCanvasNode, true)); }); });
downvote count: 0
type: Answer

http://stackoverflow.com/comment/42563911
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/26986653
has text: @DiegoLópez I did that, my fix was just changing the hello.js file I was using (I got it from the GitHub repo and is called hello.js) for the one they use in their website which is called hello.all.js and it works now. Thanks.

http://stackoverflow.com/comment/42311356
type: AnswerComment
type: Comment
has text: @Cyber Hamlet: it was an attention issue to be precise.
comment on: http://stackoverflow.com/a/26877056
score: 0

http://stackoverflow.com/a/26863794
has comment: http://stackoverflow.com/comment/42288214
has comment: http://stackoverflow.com/comment/42287623
score: 0
type: Answer
has body: full view in videoiframe I think you have your answer here. When the iframe is taking up the whole window, any keyup will occur within the iframe not in the parent document.
answers question: http://stackoverflow.com/q/26863601
has comment: http://stackoverflow.com/comment/42288012
has comment: http://stackoverflow.com/comment/42288592

http://stackoverflow.com/q/26926330
has title: How to get variable of a textbox in a non-angular page using Protractor?
has body: I am trying to test a non-angular page using Protractor. I am getting one input value of non-angular page with: console.log(browser.driver.findElement(by.ID('username')).getText()); It's displaying like [object][object] I need to get the value of text field. How can i get that?
type: Question
answer count: 2
tagged with: protractor
tagged with: javascript
has answer: http://stackoverflow.com/a/26936664
score: 0
has answer: http://stackoverflow.com/a/26978631
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/comment/42399469
type: Comment
score: 1
has text: Because Internet Explorer hates us all
comment on: http://stackoverflow.com/q/26926672
type: QuestionComment

http://stackoverflow.com/comment/42269013
type: Comment
comment on: http://stackoverflow.com/a/26852883
type: AnswerComment
has text: Thanks... am going to go and have a look at that now... obviously need to do a bit more homework. As an aside - is there a way of doing this just with native js - as you'll have guessed, I'm learning atm and want to try and get right down to the bones of it.
score: 0

http://stackoverflow.com/a/26939260
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/26939206
has body: Because if($("input[name='first_name']")=="") is not checking the value, you are comparing a jQuery object to a blank string. $("input[name='first_name']").val()
answers question: http://stackoverflow.com/q/26939206
score: 0

http://stackoverflow.com/q/26976148
has body: I'm trying to activate cycle2 on a list of images when the window gets too small to fit all the images and show all the images when the browser is big enough to display them. (#bignav is element containing the images.) I did some testing and the function stops working after I destroy it as it wont start it again. Is their another way of going about it? Could I activate it and deactivate by changing the name of the class? $(window).resize(function() { var width = $(window).width(); if (width &lt; 1325) { $('#bignav').cycle(); } else { $('#bignav').cycle('destroy'); } });
tagged with: jquery-cycle
has answer: http://stackoverflow.com/a/28620071
type: Question
tagged with: javascript
tagged with: jquery
has title: How do you undo the 'destroy' command in cycle2?
score: 0
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/q/26929303
type: Question
tagged with: c#
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26929470
has comment: http://stackoverflow.com/comment/42404517
upvote count: 1
has body: I've this javascript function: function modifica(txtValoreID, txtRicalcolatoID, lblDeltaID) { // Ricalcolo il valore aggiornato var Valore = parseFloat($("#" + txtValoreID).val()).toFixed(2); var Ricalcolato = parseFloat($("#" + txtRicalcolatoID).val()).toFixed(2); $("#" + lblDeltaID).html(parseFloat(Valore - Ricalcolato).toFixed(2).replace('.', ',')); } That refers to textbox and label in a gridview: <asp:TemplateField> <asp:TextBox ID="txtValore" Width="90%" Text='<%# string.Format("{0:N}", Eval("Valore"))%>' runat="server" /> </asp:TemplateField> <asp:TemplateField> <asp:TextBox ID="txtRicalcolato" Text='<%# string.Format("{0:N}", Eval("Ricalcolato")) %>' runat="server" /> </asp:TemplateField> (...) <asp:TemplateField HeaderText="Delta"> <asp:Label ID="lblDelta" Text='<%# string.Format("{0:N}", Eval("Delta"))%>' runat="server" /> </asp:TemplateField> And I'm assigning it in the DataBound: txtValore.Attributes.Add("onchange", "modifica('" + txtValore.ClientID + "', '" + txtRicalcolato.ClientID + "','" + lblDelta.ClientID + "')"); txtRicalcolato.Attributes.Add("onchange", "modifica('" + txtDaLiquidare.ClientID + "', '" + txtRicalcolato.ClientID + "','" + lblDelta.ClientID + "')"); and it's working perfectly. The problem is that when the gridview have a lot of records, databound is affecting the performance, so my first question is, am I improving this performance moving the assignment from databound server code to aspx page? And if yes, how can I do that? Because I'm trying like this: asp:TextBox ID="txtValore" onchange="test(this.id)" Text='<%# string.Format("{0:N}", Eval("PremioLiquidare"))%>' runat="server" /> and this: function test(txtID) { alert('TEST ' + $(this)); alert('TEST ' + $(this).val()); alert('TEST ' + $("#" + txtID).val()); alert('TEST ' + $("#" + txtID).find("[id*='txtRicalcolato']").val()); alert('TEST ' + $("#" + txtID).closest("[id*='txtRicalcolato']").val()); alert('TEST ' + $(this).find("[id*='txtRicalcolato']").val()); alert('TEST ' + $(this…
answer count: 1
has comment: http://stackoverflow.com/comment/42404241
tagged with: jquery
has answer: http://stackoverflow.com/a/26929470
tagged with: asp.net
favorite count: 0
has title: JQuery closest elements, from TextBox in a GridView
type: AnsweredQuestion
tagged with: closest
linked to: http://stackoverflow.com/q/26934872
downvote count: 0
score: 1

http://stackoverflow.com/a/26860675
has body: You can try also this one: success: function(response) { // check your console console.log(response); //this two will give you same result console.log(response.output); console.log(response['output']); //either of this two var output = response.output; var output = response['output']; if(output){ //code here } }
type: Answer
answers question: http://stackoverflow.com/q/26860192
score: 0

http://stackoverflow.com/q/26857375
type: Question
has body: I want someone to help me in resolving this issue. The issue is, I have 5 anchor tags each holding an image. On mouse-over the image should change to a different image and on mouse-out should be rolled back to the same previous image. I did this using some codes, but its not working at all. Sometime mouse-over works sometimes mouse-out works but both do not work simultaneously. Also can somebody help me in simplifying this JavaScript coding into compact jQuery coding. Fiddle HTML: JavaScript: function roll(a) { var a; //alert(a); var alloc = document.getElementById(a); if (a == 1) { alloc.innerHTML = ' '; } else if (a == 2) { alloc.innerHTML = ' '; } else if (a == 3) { alloc.innerHTML = ' '; } else if (a == 4) { alloc.innerHTML = ' '; } else if (a == 5) { alloc.innerHTML = ' '; } else if (a == 6) { alloc.innerHTML = ' '; } else if (a == 7) { alloc.innerHTML = ' '; } } function rollback(obj) { var obj; alert(obj); var disalloc = document.getElementById(obj); if (obj == 1) { disalloc.innerHTML = ' '; } } CSS: .home_wrapper { border: 1px solid black; width: 100%; height: 700px; } .header { //border:1px solid red; width: 100%; height: 14.5%; } .left_head { //border:2px solid black; width: 25.5%; height: 100%; float: left; margin-left: 1%; background-image: url(Images/bg.png); //background-repeat:repeat-x; //background-repeat:repeat-y; background-repeat: repeat; } .left_head img { width: 100%; height: 89% } .right_head { margin-left: 0.2%; //border:1px solid red; width: 73%; height: 100%; float: left; background-image: url(Images/bg.png); //background-repeat:repeat-x; //background-repeat:repeat-y; background-repeat: repeat; } .menu_but img { margin-top: 2.8%; width: 12%; height: 70%; } .menu_line { margin-bottom: 3%; } .empty { //border:1px solid black; width: 8%; height: 100%; float: left; }
tagged with: javascript
has answer: http://stackoverflow.com/a/26857701
score: 0
answer count: 3
tagged with: jquery
has title: mouseover & mouseout event in a single anchor tag
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26857798
has answer: http://stackoverflow.com/a/26857394

http://stackoverflow.com/comment/42282028
score: 0
has text: Upon closer exmination I now found this part in the source code: lib/jquery/table2CSV.js But I can't locate any table2CSV.csv nor table2.csv (?) in any subfolder.
comment on: http://stackoverflow.com/q/26860643
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26864801
downvote count: 0
score: 3
has body: Try match() var text = "top 50 right 100 left 33"; var arr = text.match(/[0-9]{1,3}/g); console.log(arr); //Returns an array with "50", "100", "33" You can also use [\d+] (digits) instead of [0-9]
has comment: http://stackoverflow.com/comment/42289266
answers question: http://stackoverflow.com/q/26864672
has comment: http://stackoverflow.com/comment/42289041
upvote count: 3
type: Answer

http://stackoverflow.com/comment/42444634
comment on: http://stackoverflow.com/a/26911173
type: Comment
score: 0
type: AnswerComment
has text: Hey Frank, I updated the question, see if you would like to help me understand this :) Thanks again !

http://stackoverflow.com/a/26856908
downvote count: 0
has body: What I would use is a combination of class and a custom attribute like $('.datapoint').click(function() { var popout = $(this).data('popout'); $(".popout-" + popout).toggle(); }); 1 p-1 2 p-2 Here as you can see the class datapoint is used to have the click handler(or you can target the elements using the attribtue selector 'div[data-popuot]'), then the attribute data-popout is used to target a specific popout element
type: Answer
answers question: http://stackoverflow.com/q/26856868
score: 4
upvote count: 4
accepted answer of: http://stackoverflow.com/q/26856868
type: AcceptedAnswer

http://stackoverflow.com/a/26947922
type: Answer
has comment: http://stackoverflow.com/comment/42442407
has comment: http://stackoverflow.com/comment/42447704
has comment: http://stackoverflow.com/comment/42440932
has body: Wrap the Ladda.bind( 'input[type=submit]' ); part into $(document).ready wrapper. If you use Turbolinks, use: $(document).on('ready page:load', function(){ Ladda.bind('.ladda-button'); });
score: 0
answers question: http://stackoverflow.com/q/26947879
has comment: http://stackoverflow.com/comment/42437807
has comment: http://stackoverflow.com/comment/42442748
has comment: http://stackoverflow.com/comment/42449984

http://stackoverflow.com/comment/42306647
type: QuestionComment
comment on: http://stackoverflow.com/q/26874420
has text: @JayBlanchard From my very basic understanding of algorithms, all they are is algebra. Am I correct?
score: 1
type: Comment

http://stackoverflow.com/q/26950677
has answer: http://stackoverflow.com/a/26950841
upvote count: 2
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/42442695
favorite count: 0
has title: JavaScript and Node.js RESTful web application
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/42442805
score: 2
tagged with: web-applications
type: Question
has body: I've been doing a lot of research because I would like to create a web application using JavaScript and Node.js with an SQL back-end, but I'm getting really confused. There are so many different frameworks and tools out there and I've found some and tried some that I would really like to use, but I just don't know how to use them all together in 1 project. Some are client-side, some are server-side, some are both and for some I'm not even sure. Could it be possible to use all of the following frameworks/tools in 1 project in a sensible way? Client side: jQuery Bootstrap Server side: ExpressJS (I like it being RESTful) Other tools: Grunt (JSHint task, automated testing, ...) QUnit (Is this only a client side testing framework? Are there server side testing frameworks?)
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/26913024
has body: I would create a helper: var TimeHelper = function(days, hours, minutes, callback) { this.subtractMinute = function() { minutes = (minutes + 60 - 1) % 60; if (minutes === 0) { hours = (hours + 60 - 1) % 60; if (hours === 0) { days = (days + 24 - 1) % 24; if (days === 0) { days = 24; hours = 0; minutes = 0; } } } callback(days, hours, minutes); } } function refreshUI(days, hours, minutes) { //refresh my ui elements } var timeHelper = new TimeHelper(24, 0, 0); And then you can call timeHelper.subtractMinute once/minute this on every minute
has comment: http://stackoverflow.com/comment/42377443
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26912599

http://stackoverflow.com/comment/42377033
score: 1
comment on: http://stackoverflow.com/q/26913625
type: Comment
type: QuestionComment
has text: Is it possible there needs to be a short amount of "settling time" after that? Have a look at https://www.google.com/search?q=selenium+clicks+fail+randomly and see if some of those suggestions help. Let us know if any of them do.

http://stackoverflow.com/q/26923087
tagged with: php
has comment: http://stackoverflow.com/comment/42425992
has comment: http://stackoverflow.com/comment/42393511
type: Question
has body: I'm developing a facebook login (FB SDK Javascript) for joomla site to add alternative way to register/login. What I've done are: Create FB app Insert relevant code to my site Get connected stat from FB.login(). Got basic information: name, email...etc I got found below function that use to login in joomla, but this way require me to provide username &amp; password. $result = JFactory::getApplication()-&gt;login(array('username' =&gt; $username, 'password' =&gt; $password), array('remember' =&gt; true)); My question is: After I got the permission from FB, I wish to login to Joomla without enter email and password, so which module/helper/function should I use?
tagged with: javascript
has comment: http://stackoverflow.com/comment/42393587
score: 0
has comment: http://stackoverflow.com/comment/42393756
has comment: http://stackoverflow.com/comment/42394090
has title: Facebook Login - Tell joomla to login
tagged with: joomla
answer count: 0
type: UnansweredQuestion
tagged with: facebook
has comment: http://stackoverflow.com/comment/42393849

http://stackoverflow.com/comment/42510438
comment on: http://stackoverflow.com/a/26989275
score: 0
type: AnswerComment
has text: What about the `contactItemClick` function ?
type: Comment

http://stackoverflow.com/q/26890606
answer count: 1
tagged with: angular-ui
tagged with: jquery
has comment: http://stackoverflow.com/comment/42337778
tagged with: angularjs
has answer: http://stackoverflow.com/a/26919304
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42335233
has comment: http://stackoverflow.com/comment/42386015
has comment: http://stackoverflow.com/comment/42335956
has comment: http://stackoverflow.com/comment/42337547
type: Question
has comment: http://stackoverflow.com/comment/42355571
has body: I have a form in my modal(angular ui). I need to set the attributes of the form from my controller. my HomepageController: var iframeModal = $modal.open({ templateUrl: 'immdModal.html', controller: 'immdController', scope: $scope }); iframeModal.result.then(function(selectedItem) { $scope.selected = selectedItem; }, function() { }); And I have : &lt;div id="immdPwdResetFrame"&gt; &lt;form id="myForm"&gt;&lt;/form&gt; &lt;iframe name="hidden_form_for_iframe"&gt;&lt;/iframe&gt; &lt;/div&gt; &lt;script&gt; $(document).ready(function() { document.forms["myForm"].submit(); }); &lt;/script&gt; in my modal HTML(immdModal.HTML), and I have angular.element(document).ready(function() { var form = document.getElementById("myForm"); form.setAttribute("method", "post"); }); in my immdController controller. But I get the error in console as : form is undefined. How can I set the attributes of the form from the controller?
tagged with: javascript
has title: Set form attributes on angular.ready function
score: 0
has comment: http://stackoverflow.com/comment/42335131

http://stackoverflow.com/q/26974515
tagged with: javascript
tagged with: share
score: 0
has body: I'm trying to implement a facebook share-dialog on my site through the Facebook Javascript SDK. I'm using the 'share' method as recommended in FB docs. FB.ui({ method: 'share', href: 'https://developers.facebook.com/docs/', }, function(response){}); The share dialog works fine when I'm logged in as the admin of the FB app. However, when logged in with an account that doesn't have a role defined for the app, I get the following error. App Not Setup: The developers of this app have not set up this app properly for Facebook Login. I made sure that: The app is public The website platform was added to the app (cf. this post) My app doesn't implement the Facebook login. What am I missing? Thanks!
answer count: 1
tagged with: facebook
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26997089
accepted answer: http://stackoverflow.com/a/26997089
has title: Facebook share dialog requires login
linked to: http://stackoverflow.com/q/25407764
type: Question

http://stackoverflow.com/comment/42364074
score: 0
has text: Im using href to navigate to my contents so cant remove `#` need to remove it dynamically
type: Comment
comment on: http://stackoverflow.com/a/26905049
type: AnswerComment

http://stackoverflow.com/a/60955182
answers question: http://stackoverflow.com/q/26962995
has body: Late to the party, but I solved this by wrapping my TinyMCE function in an event listener. This way I don't have to disable turbo links completely, because yeah, I like it. document.addEventListener("turbolinks:load", function() { tinymce.init({ selector: '.tinymce', height: 500, skin: false, menubar: false, plugins: [ 'wordcount' ], toolbar: 'undo redo | formatselect | ' + 'bold italic backcolor | alignleft aligncenter ' + 'alignright alignjustify | bullist numlist outdent indent | ' + ' removeformat' }); });
score: 0
type: Answer

http://stackoverflow.com/comment/42476971
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26970367
type: AnswerComment
has text: @feeela You are right, sorry. Anyway better to omit `value` all together as redundant.

http://stackoverflow.com/q/26852912
type: AnsweredQuestion
has title: how to access input element in a polymer web-component
has answer: http://stackoverflow.com/a/26853100
type: Question
tagged with: polymer
tagged with: javascript
has answer: http://stackoverflow.com/a/34445250
score: 0
answer count: 2
tagged with: web-component
accepted answer: http://stackoverflow.com/a/26853100
possible better answer: http://stackoverflow.com/a/34445250
has body: I've managed to setup a simple registration form with Polymer: It works fine, however, within the handleSubmit callback I'm not able to query the values from the other input fields. Whatever I query paper-input or by classname I receive null. Any suggestion how to do this ?
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/26981216
has answer: http://stackoverflow.com/a/26981521
tagged with: angularjs
type: UnansweredQuestion
has title: Pro AngularJS Book Cart Widget not showing up
has answer: http://stackoverflow.com/a/33382412
has body: I'm working through the Pro AngularJS book by Adam Freeman and in Chapter 7, when creating the widget for the cart, it won't render in the navbar like it should. I've compared and even gone back to paste the provided source code over mine and both ways, the widget still does not render, (where <cart-summary /> is, but everything else does. I've checked the errata for the book and there is nothing published so I'm completely stuck at this point. I have a feeling it might be one of those things that is looking me right in the face but I'm not having any luck. Thanks in advance! Here is my code: -app.html file: SportsStore SPORTS STORE <cart-summary /> Error ({{ data.error.status }}). The product was not loaded. Click here to try again -views/cartSummary.html file: Your Cart: {{ itemCount() }} item(s), Checkout -components/cart/cart.js file: angular.module("cart", []) .factory("cart", function () { var cartData =[]; return { addProduct: function(id, name, price) { var addedToExistingItem = false; for (var i = 0; i < cartData.length; i++) { if (cartData[i].objectId == id) { cartData[i].count++; addedToExistingItem = true; break; } } if (!addedToExistingItem) { cartData.push({ count: 1, objectId: id, price: price, name: name }); } }, removeProduct: function(id) { for (var i = 0; i <cartData.length; i++) { if (cartData[i].objectId == id) { cartData.splice(i, 1); break; } } }, getProducts: function () { return cartData; } }; }) .directive("cartSummary", function(cart) { return { restrict: "E", templateUrl: "components/cart/cartSummary.html", controller: function ($scope) { var cartData = cart.getProducts(); $scope.total = function () { var total = 0; for (var i = 0; i < cartData.length; i++) { total += (cartData[i].price * cartData[i].count); } return total; }; $scope.itemCount = function () { var total = 0; for (var i =0; i <cartData.length; i++) { total += cartData[i].count; } return total; }; } }; });
type: Question
answer count: 2
tagged with: javascript
score: 0

http://stackoverflow.com/comment/42419132
type: Comment
comment on: http://stackoverflow.com/a/26926166
has text: Thanks @scott_trinh. Is pre-filtering a reasonable workaround for now?
score: 0
type: AnswerComment

http://stackoverflow.com/q/26969851
tagged with: javascript
has body: Hello I have a file structure that looks like this, |-App |------|src |----------|js |----------|img |----------|css |----------|less |----------|tpl |----------|index.php |- Gruntfile.js (withing parent app folder) |- package.json (withing parent app folder) What I am trying to do is move all the contents of the src folder into a build folder, the build folder gets created but outside of the App folder, and I don't really understand why, secondly when it does copy the src folder it copies the actual src folder, I want to copy all its children but no the parent src folder, and thirdly the copy ignores the index.php file why? Below is my current Gruntfile.js module.exports = function(grunt) { // Project configuration. grunt.initConfig({ copy: { build: { cwd: '.', src: ['src/*/*'], dest: '../build', expand: true } }, clean: { build: { cwd: '.', src: ['build'] } } }); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.registerTask('move', 'Moves the project to the build folder', ['copy', 'clean']); };
tagged with: gruntjs
has answer: http://stackoverflow.com/a/26970038
type: AnsweredQuestion
type: Question
answer count: 1
tagged with: node.js
accepted answer: http://stackoverflow.com/a/26970038
has title: grunt copy moving build folder outside of project
score: 0

http://stackoverflow.com/a/26906061
answers question: http://stackoverflow.com/q/26894702
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26894702
type: Answer
has comment: http://stackoverflow.com/comment/42376885
has body: Unfortunately it is known bug, reported to our developers here

http://stackoverflow.com/a/26970536
type: Answer
has body: Set httpauthmode to '0' (value of None) when httprestype changes to '2': _self.httprestype.subscribe(function(value) { if(value === '2') { _self.httpauthmode('0'); } }); JSFiddle
answers question: http://stackoverflow.com/q/26970284
has comment: http://stackoverflow.com/comment/42504305
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26970284

http://stackoverflow.com/comment/42286050
score: 0
has text: Thank you so such I really don't know how to thank you.
comment on: http://stackoverflow.com/a/26862928
type: Comment
type: AnswerComment

http://stackoverflow.com/a/26935688
type: Answer
has body: Merge n arrays using priority queue (based on binary heap, for example). Overall element count is m*n, so algorithm complexity is O(m * n * Log(n)). algorithm sketch: Add numbers 1..n to priority queue, using 1st element of every array as sorting key (you may also use pairs (first element/array number). At every step - J = pop_minimum add current head of Jth array to result move head of Jth array to the right if Jth array is not exhausted, insert J in queue (with new sorting key) 1st algoritm complexity is 2*m + 3*m+ 4*m+...+n*m = m * (n*(n-1)/2-1) = O(n^2 * m)
accepted answer of: http://stackoverflow.com/q/26935447
upvote count: 3
answers question: http://stackoverflow.com/q/26935447
has comment: http://stackoverflow.com/comment/42418462
score: 3
has comment: http://stackoverflow.com/comment/42424964
has comment: http://stackoverflow.com/comment/42415959
has comment: http://stackoverflow.com/comment/42415838
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42415893

http://stackoverflow.com/q/26901282
score: 2
tagged with: typescript
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42354844
type: Question
has comment: http://stackoverflow.com/comment/52520076
has answer: http://stackoverflow.com/a/26901379
has answer: http://stackoverflow.com/a/26901352
has answer: http://stackoverflow.com/a/26916911
has body: If I create a simple TypeScript module named test it would look like the following: module test { export class MyTest { name = "hello"; } } The resulting JavaScript creates an IIFE that looks like the following: var test; (function (test) { var MyTest = (function () { function MyTest() { this.name = "hello"; } return MyTest; })(); test.MyTest = MyTest; })(test || (test = {})); What I can't understand are what is the purpose of the following line at the end of the IIFE that contains arguments for the function: (test || (test = {})); The resulting function also takes in the parameter test: (function (test) { I understood when using the arguments to pass in say a 'jQuery object like })(jquery); and the resulting function could take the alias like (function ($) {. However I just am not seeing the purpose of the (test || (test = {})); arguments. I understand that test.MyTest = MyTest; is exposing the public method MyTest, but why (test || (test = {})); and how do those arguments work?
downvote count: 0
tagged with: javascript
has title: What are the purpose of default arguments in JavaScript IIFE from a TypeScript module?
tagged with: iife
possible better answer: http://stackoverflow.com/a/26901370
has answer: http://stackoverflow.com/a/26901370
favorite count: 0
accepted answer: http://stackoverflow.com/a/26901352
upvote count: 2
answer count: 4

http://stackoverflow.com/a/26887972
answers question: http://stackoverflow.com/q/26887435
has comment: http://stackoverflow.com/comment/42330805
type: Answer
accepted answer of: http://stackoverflow.com/q/26887435
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/42331536
has body: It depends on the markup. Here's a simple example: html &lt;div&gt; &lt;input type="checkbox" /&gt; &lt;input type="checkbox" /&gt; &lt;input type="checkbox" /&gt; &lt;/div&gt; &lt;div&gt; &lt;input type="checkbox" /&gt; &lt;input type="checkbox" /&gt; &lt;input type="checkbox" /&gt; &lt;/div&gt; &lt;div&gt; &lt;input type="checkbox" /&gt; &lt;input type="checkbox" /&gt; &lt;input type="checkbox" /&gt; &lt;/div&gt; jquery $('input[type="checkbox"]').on('change', function() { // uncheck sibling checkboxes (checkboxes on the same row) $(this).siblings().prop('checked', false); // uncheck checkboxes in the same column $('div').find('input[type="checkbox"]:eq(' + $(this).index() + ')').not(this).prop('checked', false); }); Here's a fiddle Here's another example using classes
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/26895027
has title: Javascript detect click but no function
tagged with: audio
has answer: http://stackoverflow.com/a/26895313
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/42343535
score: 0
answer count: 1
type: UnansweredQuestion
has body: I'm setting up an audio player in javascript, however when I want to detect onclick by user, the code breaks and everything results in Loading... messages and no sound on the actual player. This is the code: /*else if (document.getElementById("batar-btn").onclick = function()) { player.src = 'http://live.shockradio.co.uk/ob'; }*/ I want for the stream address to change after the page loads for the user, AND the button with batar-btn ID is clicked. How can I do this similarly with the above code? player = document.createElement("audio"); if (typeof player.canPlayType === "function" &amp;&amp; player.canPlayType("audio/mpeg") !== "") { backend = 'html'; var format = "mp3"; player = new Audio(); if (isMobile) { $('#muteIcon').css('display', 'none'); $('#playIcon').css('display', 'inline-block'); if (player.canPlayType("audio/mp4; codecs=\"mp4a.40.5\"") !== "") { player.src = 'http://live.shockradio.co.uk/mobile'; } else { player.src = 'http://live.shockradio.co.uk/mp3'; } } /*else if (document.getElementById("batar-btn").onclick = function()) { player.src = 'http://live.shockradio.co.uk/ob'; }*/ else { player.src = 'http://live.shockradio.co.uk/mp3'; } player.mozAudioChannelType = 'content'; player.addEventListener("playing", showStopIcon, false); player.addEventListener("pause", showPlayIcon, false); player.addEventListener("ended", showPlayIcon, false); player.load(); player.play(); } else { backend = 'flash'; swfobject.embedSWF('swf/player.swf', 'flashPlayer', '1', '1', '10'); document.title = '\u25b6 Shock Radio Player'; _gaq.push(['_trackEvent', 'Player', 'Play']); }

http://stackoverflow.com/a/26958154
has comment: http://stackoverflow.com/comment/42455231
score: 19
has comment: http://stackoverflow.com/comment/42455272
has comment: http://stackoverflow.com/comment/42455309
has comment: http://stackoverflow.com/comment/42455378
type: AcceptedAnswer
upvote count: 19
answers question: http://stackoverflow.com/q/26951407
type: Answer
accepted answer of: http://stackoverflow.com/q/26951407
has body: A couple of general remarks up front: As explained in this seminal paper, due to finite precision and range limits, floating-point arithmetic is sufficiently different from real mathematics (for example, lack of associativity) that mathematically equivalent expressions are not necessarily equivalent when evaluated in floating-point arithmetic. Standards for computer languages do not typically guarantee any particular accuracy for math functions, or identical error bounds between different math functions such as cbrt() or pow(). But math libraries that deliver correctly rounded results for a given precision do exist, such as CRlibm. In this case however, cbrt(x) will deliver more accurate results than pow(x,1.0/3.0) even when both functions are correctly rounded for all inputs. The issue is that 1.0/3.0 cannot be represented exactly as a floating-point number, whether in binary or decimal. The IEEE-754 double precision number closest to one third is 3.3333333333333331e-1 (or 0x1.5555555555555p-2 when expressed in the C/C++ hexadecimal floating-point format). The relative representational error is -5.5511151231257827e-17 (-0x1.0000000000000p-54), meaning the best double-precision representation of 1/3 is somewhat smaller than the desired mathematical value. This initial error in one of the inputs of pow() is not only passed through to the output, it is magnified due to the error magnification property of exponentiation. As a result, pow(x,1.0/3.0) will generally deliver results that are too small compared to the desired cube root, even if pow() delivers correctly rounded results. For the example in the question, the correctly rounded results are cbrt(1728.0) = 1.2000000000000000e+1 (0x1.8000000000000p+3) pow(1728.0,1.0/3.0) = 1.1999999999999998e+1 (0x1.7ffffffffffffp+3) that is, the result from pow() is one ulp smaller than the result from cbrt(). For arguments large in magnitude, the difference will be much larger. For example, if x is 21022, the respective results d…
downvote count: 0

http://stackoverflow.com/q/26981680
upvote count: 1
type: Question
tagged with: phantomjs
accepted answer: http://stackoverflow.com/a/26981908
tagged with: javascript
has body: I am trying to pass an argument from the command line and check or uncheck a check box on my local website. If I substitute the system.args[4] in the returnVars function with a true or false it works, but the argument I pass from the command line doesn't affect the check box. var returnVars = function(){ if (system.args.length &gt; 4) { console.log(system.args[4]); // this is getting the correct value from the args return system.args[4]; } }; page.open(address, function (status) { if (status !== 'success') { console.log('Unable to load the address!'); phantom.exit(1); } else { var returnable = page.evaluate(function(r,s) { return document.getElementById(r).checked = s; }, 'returnable', returnVars()); window.setTimeout(function () { page.render(output); phantom.exit(); }, 200); } }); I am using the rasterize.js example and replacing the zoom option with my own. I call it with: phantomjs rasterize.js mywebsite.com c:\foo.pdf "letter" false
has comment: http://stackoverflow.com/comment/42497664
downvote count: 0
answer count: 1
has title: Pass argument from PhantomJS command line to page evaluate to change the checkbox state
favorite count: 0
linked to: http://stackoverflow.com/q/359494
has answer: http://stackoverflow.com/a/26981908
type: AnsweredQuestion
score: 1

http://stackoverflow.com/q/26904865
has title: Can't access dependency object fields in require.js - Cannot read property of undefined
tagged with: javascript
upvote count: 1
has answer: http://stackoverflow.com/a/26905863
accepted answer: http://stackoverflow.com/a/26905863
answer count: 1
tagged with: undefined
has body: I have created module myModule.js require(['jquery'],function($){ return { init: function(){ $('.test').hide(); } } }); config: require.config({ baseUrl : "js/", paths : { jquery : 'lib/jquery/jquery-2.1.1', myModule : 'lib/modules/myModule }, shim : { } }); Now I want to use mymodule.init function in other module in proper place (lets say after AJAX load) require(['jquery', 'myModule'],function($, myModule){ ... myModule.init(); ... }); Here I have an error: Cannot read property 'init' of undefined What I did wrong?
favorite count: 0
tagged with: requirejs
tagged with: module
tagged with: js-amd
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question

http://stackoverflow.com/a/26877531
has body: This took me forever to debug. There were a number of issues most importantly of which was that you are using a very backlevel version of prettyCheckable. However, after changing to the latest level and starting again, I have a fully working solution for you. See this jsFiddle. I started again from the beginning but here is the code: HTML &lt;fieldset&gt; &lt;div class="group"&gt; &lt;input type="checkbox" class="parentCheckBox" data-label="Africa"/&gt; &lt;div class="content"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;input type="checkbox" value="1" class="childCheckBox" data-label="Algeria" /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;input type="checkbox" value="2" class="childCheckBox" data-label="Angola" /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;input type="checkbox" value="3" class="childCheckBox" data-label="Benin" /&gt; &lt;br /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/fieldset&gt; JavaScript $(function () { $('input:checkbox').each(function () { $(this).prettyCheckable(); }); $(".parentCheckBox").change(function (e) { var checked = $(this).prop("checked"); $(".childCheckBox", $(this).closest(".group")).each(function (i, e) { $(e).prettyCheckable(checked?"check":"uncheck"); }); }); $(".childCheckBox").change(function(e) { var checkedCount = unCheckedCount = 0; $(e.currentTarget).closest(".content").find(".childCheckBox").each(function(i,e2) { if ($(e2).prop("checked")) { checkedCount++; } else { unCheckedCount++; } }); if (unCheckedCount == 0) { $(e.currentTarget).closest(".group").find(".parentCheckBox").prettyCheckable("check"); } else { $(e.currentTarget).closest(".group").find(".parentCheckBox").prettyCheckable("uncheck"); } }); }); I'll be delighted to answer any questions you may have. The semantics of checking or unchecking all children could have an alternate solution shown in this jsFiddle. It talks to when the parent checkbox should be checked or unchecked as a function of the children.
answers question: http://stackoverflow.com/q/26875131
score: 0
type: Answer

http://stackoverflow.com/a/26936137
has comment: http://stackoverflow.com/comment/42416981
has body: You seem to be using an old ember-data syntax and applying it to 1.0beta11. I don't have a link at the moment, but check on the official repository or the guides. The model hook in your route should change from: return App.Bodypart.find(); to return this.store.find('bodypart'); Also you seem to be declaring your adapter incorrectly as well. It should be: App.ApplicationAdapter = DS.RESTAdapter.extend({ host: 'http://example.com', namespace: 'api' }); Also, consider changing the request from the ApplicationRoute to a child route, or you may experience "fake frozen" application as shown here
type: Answer
has comment: http://stackoverflow.com/comment/42419147
downvote count: 0
score: 3
answers question: http://stackoverflow.com/q/26935940
has comment: http://stackoverflow.com/comment/42418714
upvote count: 3
accepted answer of: http://stackoverflow.com/q/26935940
type: AcceptedAnswer

http://stackoverflow.com/a/26922899
type: Answer
has body: You can use sortProperties: propertyName &amp; sortAscending: true/false Here is the Demo I have modified your model to include id fields so that it is sorted by id. App.PostsRoute = Ember.Route.extend({ model: function() { return [ {id: 1, title: 'post 1'}, {id: 2,title: 'post 2'}, {id: 3,title: 'post 3'}, {id: 4,title: 'post 4'}, {id: 5,title: 'post 5'} ]; } }); And your controller will go like this - App.PostsController = Ember.ArrayController.extend({ itemController: 'post', selectedPost: null, actions: { up: function() { this.set('sortProperties', ['id']); this.set('sortAscending', true); if (this.get('selectedPost')) { var selectedPost = this.get('selectedPost'); var index = this.get('model').lastIndexOf(selectedPost); if (index &gt; 1) { // up } } }, down: function() { this.set('sortProperties', ['id']); this.set('sortAscending', false); if (this.get('selectedPost')) { var selectedPost = this.get('selectedPost'); var index = this.get('model').lastIndexOf(selectedPost); if (index &lt; this.get('model.length')) { // down } } } } });
has comment: http://stackoverflow.com/comment/42394963
answers question: http://stackoverflow.com/q/26920613
has comment: http://stackoverflow.com/comment/42394995
score: 0

http://stackoverflow.com/q/26837522
accepted answer: http://stackoverflow.com/a/26857867
answer count: 4
possible better answer: http://stackoverflow.com/a/29804922
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26843434
has answer: http://stackoverflow.com/a/26851733
score: 6
has title: Sails.js: How to actually run tests
upvote count: 7
downvote count: 1
tagged with: unit-testing
type: Question
has body: I'm completely new to sails, node and js in general so I might be missing something obvious. I'm using sails 0.10.5 and node 0.10.33. In the sails.js documentation there's a page about tests http://sailsjs.org/#/documentation/concepts/Testing, but it doesn't tell me how to actually run them. I've set up the directories according to that documentation, added a test called test/unit/controllers/RoomController.test.js and now I'd like it to run. There's no 'sails test' command or anything similar. I also didn't find any signs on how to add a task so tests are always run before a 'sails lift'.
tagged with: sails.js
tagged with: javascript
tagged with: mocha.js
has answer: http://stackoverflow.com/a/29804922
favorite count: 0
has answer: http://stackoverflow.com/a/26857867

http://stackoverflow.com/comment/42488658
has text: You can use like pickupFromTpkr.value("7.30");
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26976928
score: 0

http://stackoverflow.com/q/26936892
type: Question
accepted answer: http://stackoverflow.com/a/26937127
has title: Variable from $rootScope data also modifies $rootScope data
tagged with: javascript
score: 0
answer count: 1
has body: Due to the fact that it is used by multiple controllers, I have assigned data to $rootScope.currentCache. On initial load, that data looks (roughly) like this: { System: "Foo Bar", StartDateTime: "2014-11-27T12:35:00" } (ignore formatting errors, they are irrelevant to the question). In my (abridged) controller I run the following: app.controller("CurrentController", function ($rootScope, $scope) { console.log($rootScope.currentCache); var currentData = $rootScope.currentCache; //processDate() converts StartDateTime into a friendly format currentData = processDate(currentData); console.log($rootScope.currentCache); }); The first console.log() outputs the date as: 2014-11-27T12:35:00 However, the second console.log() outputs the date as: Nov 27th 2014 at 12:35pm This confuses me, as the date processing occurs on the separate currentData variable. The other controllers need the date in the original format. So, my question is why is this happening, and how can I stop it?
tagged with: angularjs
linked to: http://stackoverflow.com/q/13287297
has answer: http://stackoverflow.com/a/26937127
type: AnsweredQuestion

http://stackoverflow.com/q/26947320
has body: As shown below, I have a dummy memory store which returns a complex object. I would like to bind this complex object to the form. Because it's a complex object, I am binding the object through two MVC groups. The problem happens when the model is refreshed (through the "Fetch" button). The outer MVC group is refreshed, but the inner one is not. It works only if I manually re-set the target property of the inner MVC group: dijit.byId('sub-group').set('target', model.prop7); Is there any other, better way to do this? Fetch Text: Text 2:
answer count: 1
has answer: http://stackoverflow.com/a/27079830
favorite count: 0
accepted answer: http://stackoverflow.com/a/27079830
tagged with: requirejs
tagged with: dojo
type: AnsweredQuestion
score: 3
has title: Refreshing Dojo MVC Groups on model change doesn't work for complex objects
tagged with: dom
downvote count: 1
type: Question
upvote count: 4
tagged with: javascript
has comment: http://stackoverflow.com/comment/42551003
has comment: http://stackoverflow.com/comment/42534142

http://stackoverflow.com/comment/42449119
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26951651
score: 0
has text: Would be helpful if you could show your relevant CSS as well. And your Javascript doesn't match up your HTML. Please strip out PHP code and show the generated markup.

http://stackoverflow.com/q/26849994
tagged with: web-content
tagged with: ckeditor
score: 0
has body: I am using jquery and CKEditor on the project. I want users can write/edit their html codes in CKEditor. When I input multiple textarea tag in the editor, they look fine because they both stay inside of the textarea as follows, Then I save it, and I confirmed it is saved correctly because I checked the source code in the file. However, if I open the file in CKEditor again, it is not being shown properly as follows, The following is the sample codes I used. It is not the completed codes though. &lt;textarea id="eidtArea" name="editScriptContent"&gt;&lt;!--Load the saved file here (I will skip this part here)--&gt;&lt;/textarea&gt; &lt;script type="text/javascript"&gt; CKEDITOR.replace( 'eidtArea'); &lt;/script&gt; My questions are : Do I miss setting anything in this plugin or is there workaround I can do ? In fact, I do not really need to use this plugin. I can simply use textarea for users to edit codes. Basically the main reason I want to use this plugin is because I want users can create textarea tag in the editor. However, if I simply use textarea tag as the editor, they cannot add any other textarea tag inside this editor. If there is any workaround for this approach? If so, then I do really need to use CKEditor in this case.
has answer: http://stackoverflow.com/a/26855522
has title: javascript - how to show multiple textarea in code editor (one of my attempt is to use CKEditor)
type: AnsweredQuestion
tagged with: wcm
accepted answer: http://stackoverflow.com/a/26855522
type: Question
tagged with: textarea
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/42427875
comment on: http://stackoverflow.com/a/26941986
type: AnswerComment
score: 0
type: Comment
has text: Giri thank you for answering my question, I am using contact form 7 for my forms. how would I apply this to my form, I am new to this

http://stackoverflow.com/q/26937506
possible better answer: http://stackoverflow.com/a/28056652
downvote count: 0
tagged with: meteor
favorite count: 0
has answer: http://stackoverflow.com/a/28056652
tagged with: service
tagged with: cordova
tagged with: iron-router
answer count: 5
has answer: http://stackoverflow.com/a/34373134
has title: Meteor: Different (iron-)routes for Cordova and Website
has answer: http://stackoverflow.com/a/26942540
accepted answer: http://stackoverflow.com/a/26940553
type: AnsweredQuestion
score: 2
upvote count: 2
has body: I want to build a Service with the Smartphone-App differing from the Website or WebApp respectively. My idea was to have different routing tables in iron router, like so: /client routes.js /cordova routes.js ... Additionally the files could be enclosed by "if (Meteor.isCordova) {" and "if (Meteor.isClient) {" brackets. So far I tried this: Router.map(function() { if (Meteor.isCordova) { this.route('homeCordova', { path: '/' }); } if (Meteor.isClient) { this.route('homeWeb', { path: '/' }); } } and it works for the paths, but not for the layout, so if (Meteor.isCordova) { Router.configure({ layoutTemplate: 'mainLayoutCordova', loadingTemplate: 'loadingCordova', ... if (Meteor.isClient) { Router.configure({ layoutTemplate: 'mainLayout', loadingTemplate: 'loading', ... doesn't go. As an alternative I could have two different Meteor-Apps running at the same time on my server? Does that make any sense? Any idea how to fix it or how to solve this issue? The example-app localmarket only has the smartphone app, so only 1 router.js file, also verso, if you're logged in, the WebApp looks pretty much the same as on the phone. Regards
linked to: http://stackoverflow.com/q/13115723
type: Question
has answer: http://stackoverflow.com/a/26940553
has answer: http://stackoverflow.com/a/32621031
tagged with: javascript

http://stackoverflow.com/comment/42352508
has text: When question 5 is not answered, it is recording the answer as "yes." It's not checked but for some reason, jquery thinks it is. Even if I select "no", it records the answer as yes in the console log.
type: AnswerComment
comment on: http://stackoverflow.com/a/26834312
score: 0
type: Comment

http://stackoverflow.com/q/26850517
score: 0
answer count: 2
has title: Responsive header width two overlapping images
tagged with: header
tagged with: javascript
has comment: http://stackoverflow.com/comment/42266394
tagged with: http://stackoverflow.com/tag/html
has body: I am creating a responsive header with two overlapping images. A div can be larger or smaller, based on the current mouse position. The problem is to create this header responsive. The center of both images should be in the center of the webpage. This is hard to achieve as the div's that contain the images are not in the center of the document. You can see my current progress here. Whenever the browser is around 1200 pixels it looks fine (the image width is 1280 px). However, when i resize the browser to a smaller size the effect is not how it is meant to be. HTML &lt;div class="header"&gt; &lt;div class="headerleft"&gt;&lt;img src="images/rick.png" width="1280" height="200" id="rick" alt="rick" align="middle"&gt;&lt;/div&gt; &lt;div class="headerright"&gt;&lt;img src="images/peter.png" width="1280" height="200" id="peter" alt="peter" align="right"&gt;&lt;/div&gt; &lt;/div&gt; CSS .header{ height: 200px; width: 100%; background-size: 50%; background-position: center; background-repeat: no-repeat; } .headerleft{ background-color: red; width: 100%; height: 100%; float: left; margin: 0; padding: 0; overflow:hidden; background-image: url('images/rick.png'); background-position: left; } .headerright{ background-color: blue; width: 50%; height: 100%; float: right; margin: 0; padding: 0; overflow:hidden; /*background-image: url('images/peter.png');*/ background-position: right; } Javascript $(document).on('mousemove', function(e){ page = $( document ).width(); pagecrop = page/2; $('.headerright').css({ width: e.pageX/2+pagecrop/2, }); }); $(document).on('mousemove', function(e){ page = $( document ).width(); pagecrop = page/2; $('.headerleft').css({ width: pagecrop-e.pageX/2+pagecrop/2, }); });
tagged with: css
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26851185
has comment: http://stackoverflow.com/comment/42265693
has comment: http://stackoverflow.com/comment/42263871
has comment: http://stackoverflow.com/comment/42263771
has comment: http://stackoverflow.com/comment/42265592
type: Question
has comment: http://stackoverflow.com/comment/42265358
has answer: http://stackoverflow.com/a/26852102
has comment: http://stackoverflow.com/comment/42265771
has comment: http://stackoverflow.com/comment/42265748
has comment: http://stackoverflow.com/comment/42265757
has comment: http://stackoverflow.com/comment/42263506

http://stackoverflow.com/q/26890598
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
score: -4
has comment: http://stackoverflow.com/comment/42335906
has answer: http://stackoverflow.com/a/26891102
has title: Which method to save dom should keep less memory?
has body: If we need to save a slice of dom elements in memory(we will insert it into dom tree dynamically later) which method will keep less memory? method 1: var a = parentDom.innerHTML; parentDom = null; method2: var a = parentDom;
type: AnsweredQuestion
tagged with: dom
has comment: http://stackoverflow.com/comment/42335563
type: Question
upvote count: 0
accepted answer: http://stackoverflow.com/a/26891102
tagged with: javascript
downvote count: 4

http://stackoverflow.com/a/26985743
has body: I think you're looking for .append? $(document).ready(function(){ var ddl = $("#mainDDL").clone(); ddl.attr("id", "ddlCloned"); ddl.attr("name", "ddlCloned"); var innerDiv = $("&lt;div /&gt;").appendTo('body'); innerDiv.append(ddl); }) http://jsfiddle.net/3ojex7f5/1/
type: Answer
answers question: http://stackoverflow.com/q/26985684
score: 0

http://stackoverflow.com/comment/42454648
score: 0
type: QuestionComment
type: Comment
has text: What exactly does this mean: _The field doesn't seem to be able to read the contents of the boxes on the same form that the calling control is on._? Why not just call it in form Javascript with with the parameters you want to pass `executeSigning(param1, param2, ...)`? Javascript supports optional parameters so have `executeSigning` accept every prefetched value it might use, but only pass in parameters the form "knows" about.
comment on: http://stackoverflow.com/q/26951887

http://stackoverflow.com/comment/42411874
has text: When I double click a word I get an alert `anchor: [word]` where `[word]` is the word I clicked. Isn't that what you want? What browser are you using? I've tested in Chrome, Firefox, and IE11
comment on: http://stackoverflow.com/q/26933332
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/42310462
comment on: http://stackoverflow.com/q/26873199
type: Comment
type: QuestionComment
has text: I want to control which API endpoints see the auth token. Doing it with interceptors allows me to control them within the request handler. I guess I could set default headers and then remove them in a HTTP interceptor which doesn't depend on Auth, but that seems kinda messy.
score: 0

http://stackoverflow.com/comment/42261372
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26849302
has text: Good point! That's definitely a little more elegant that my solution.

http://stackoverflow.com/a/42398535
type: Answer
downvote count: 0
has body: $(document).on('click', 'div.selectize-input div.item', function(e) { var select = $('#services').selectize(); var selectSizeControl = select[0].selectize; // 1. Get the value var selectedValue = $(this).attr("data-value"); // 2. Remove the option select[0].selectize.removeItem(selectedValue); // 3. Refresh the select select[0].selectize.refreshItems(); select[0].selectize.refreshOptions(); }); This do not remove the item from the select, just remove it from the selected options.
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/26923751

http://stackoverflow.com/a/26874122
has comment: http://stackoverflow.com/comment/42314000
type: Answer
accepted answer of: http://stackoverflow.com/q/26868882
score: 2
answers question: http://stackoverflow.com/q/26868882
has body: This is far from ideal, but works. You can capture "mouseup" event of the container and reset width and height of the control there: $('#container').mouseup(function(e){ var $btn = $("#test"); $btn.css('width',''); $btn.css('height','') }) This doesn't remove resizing squares and visually user can temporarily resize the control but as soon as mouse button is released - control snaps to the original size. Demo: http://jsfiddle.net/5swkeqh9/2/
upvote count: 2
has comment: http://stackoverflow.com/comment/42315170
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/26965737
has body: This is the JavaScript code you need: // If no child DIV, add one if ($("#div1 > div").size() == 0) { $("#div1").append(' '); } // Append a span to the child DIV $("#div1 > div").append('This is a span.'); DEMO with child DIV: if ($("#div1 > div").size() == 0) { $("#div1").append(' '); } $("#div1 > div").append('This is a span.'); DEMO without child DIV: if ($("#div1 > div").size() == 0) { $("#div1").append(' '); } $("#div1 > div").append('This is a span.');
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/26965720
downvote count: 0
score: 1

http://stackoverflow.com/q/26836319
accepted answer: http://stackoverflow.com/a/26836588
has title: Getting the last string of a link
favorite count: 0
tagged with: slug
upvote count: 2
possible better answer: http://stackoverflow.com/a/26836375
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26836375
has answer: http://stackoverflow.com/a/26836588
type: Question
has body: I have been searching for a while with no success, I found ways to get the current URL but can't figure out how to get the last string for a specific link. The Url would be something like http://www.mywebsite.com/slug/ What I would need to get is the "slug" part out of the link's URL My current function: $('.filters a').click(function(e){ e.preventDefault(); var slug = ''; alert ( slug ); }); Any help will be appreciated :)
tagged with: javascript
tagged with: jquery
answer count: 2
downvote count: 0
tagged with: url

http://stackoverflow.com/q/26917889
has answer: http://stackoverflow.com/a/26919068
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/42384325
has comment: http://stackoverflow.com/comment/42384461
answer count: 4
tagged with: curl
has answer: http://stackoverflow.com/a/26918088
accepted answer: http://stackoverflow.com/a/26919068
tagged with: angularjs
tagged with: php
has title: Passing a php variable to angular
possible better answer: http://stackoverflow.com/a/26927532
has answer: http://stackoverflow.com/a/26927532
type: AnsweredQuestion
has body: I am building a webapp and I'm using angular for the first time. I tried yesterday to get data from an API but it will not work in Angular cause of cross origin resource restrictions. Lucky I can get the json date over a simple CURL request in PHP. So here I am now. I have the JSON Data in a PHP Variable and want to use this data in my Angular Application. How can I achieve that? Is there a way to pass the data directly to angular? Or should i create a json file with php and then load it into my funcion? What suggestions do you have? I want to fill the $scope.posts with the content of the php variable $content. Here's the php code: &lt;?php /* gets the data from a URL */ function get_data($url) { $ch = curl_init(); $timeout = 5; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $data = curl_exec($ch); curl_close($ch); return $data; } $returned_content = get_data('http://fingerzeig.ch/api/agenda/list'); $content = json_decode($returned_content); //print_r ($content); //Get first title //$firstitle = $content[0] -&gt; ID; //print_r($firstitle); ?&gt; The Angular code: //MYAPP var app = angular.module("MyApp", []); app.controller("PostsCtrl", function($scope, $http) { $http.get(' WHAT SHOULD GO HERE? '). success(function(data, status, headers, config) { console.log("success!"); console.log(data); $scope.posts = data; }). error(function(data, status, headers, config) { // log error }); });
upvote count: 5
tagged with: http://stackoverflow.com/tag/json
type: Question
score: 5
has answer: http://stackoverflow.com/a/26917971

http://stackoverflow.com/q/26840106
score: 1
favorite count: 0
tagged with: cordova
type: UnansweredQuestion
answer count: 0
has body: I want to get the image uri after select an image form gallery, my current code only returns the encoded image data itself, how do I modify this to get the uri? Thanks navigator.camera .getPicture( $scope.onFileSelectSuccess, $scope.onFail, { quality : 50, correctOrientation: true, encodingType: Camera.EncodingType.JPEG, destinationType : navigator.camera.DestinationType.DATA_URL, sourceType : navigator.camera.PictureSourceType.PHOTOLIBRARY });
upvote count: 1
type: Question
tagged with: javascript
has title: Cordova get image uri after select from gallery
downvote count: 0

http://stackoverflow.com/q/26949769
tagged with: google-maps
tagged with: google-maps-embed
answer count: 1
favorite count: 0
type: UnansweredQuestion
score: 2
has body: For a school project we are making an application that can track the location of a garbage truck. To calculate the fastest direction for the truck we are using the Google Maps embed API, but there is one "problem". The API returns 3 optional directions but we only need one. Is there an possibility to show only one direction, or do we need the JavaScript API of Google Maps then? Thanks in advance.
downvote count: 0
has answer: http://stackoverflow.com/a/28871874
type: Question
has title: Show only 1 direction for Google Maps embed API
tagged with: javascript
tagged with: google-maps-api-3
upvote count: 2

http://stackoverflow.com/comment/42267202
score: 0
has text: Just a guess, if you are returning the HTML in the AJAX request you should probably add the CSS and JS references to that. You are not really returning a view that would normally have a layout attached.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26846519

http://stackoverflow.com/comment/42288589
has text: There's still a problem with keys such as 'hasOwnProperty' and '\_\_proto__', and generally messing about with `Object.prototype`. Granted, this is a pretty unlikely scenario, but not impossible. Using `var flags = Object.create(null);`, prefixing `entry.key` with e.g. '#', and removing the `hasOwnProperty` check will help.
comment on: http://stackoverflow.com/a/26863418
type: AnswerComment
score: 0
type: Comment

partial-application
type: Tag
tags question: http://stackoverflow.com/q/26837946
tag name: partial-application

http://stackoverflow.com/a/26905284
has body: You can't perform click event for file input because of security reasons. You can do that by creating custom element which behave like file input element.
type: Answer
has comment: http://stackoverflow.com/comment/42361510
score: 0
answers question: http://stackoverflow.com/q/26905038

http://stackoverflow.com/a/27697112
answers question: http://stackoverflow.com/q/26908253
type: Answer
upvote count: 1
score: 1
has body: I had eactly the same issue with https:// URLs and the CKEditor's image selector. And I'm also on Opencart 1.5.5.1 :) Needed to change CKE configuration so it inserts the pictures with the relative URLs that do not include the protocol, domain name/IP address etc. I've tried to search for the piece of code responsible for building the full URL but could not find it. Thank you for pointing it out, that helped a lot. My solution is based on yours. However, the original code I had looked a bit different. Anyway, I took the following part from my admin/controller/common/filemanager.php: $this->data['directory'] = HTTP_IMAGE . 'data/'; ... and replaced it with: $this->data['directory'] = str_replace(HTTP_CATALOG, '/', HTTP_IMAGE) . 'data/'; This does not do the checks for whether HTTPS is enabled because that doesn't matter really - the path to the file selected is relative to the root regardless of the protocol. Here's a full vQmod I've made: forcing ckeditor to use relative paths for images 1.5.5.x Stackoverflow Comunity $this->data['directory'] = HTTP_IMAGE . 'data/'; // make sure HTTP_CATALOG has a trailing slash // check admin/config.php $this->data['directory'] = str_replace(HTTP_CATALOG, '/', HTTP_IMAGE) . 'data/'; Again, @Tibor B. thank you for sharing your solution. It helped a lot
downvote count: 0

http://stackoverflow.com/q/26863339
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26864248
tagged with: knockout.js
type: Question
answer count: 1
tagged with: button
tagged with: javascript
has title: Knockout Array buttons one Function
has body: I've started learning Knockout and I'm having some trouble. I've observable Array, which have some buttons. I need: Example: I click first button 'lock' and visible first span 'lock', hide first span 'unlock'. And this should be one function 'lock'. I click first button 'unlock' and hide first span 'lock', visible first span 'unlock'. And this should be one function 'unlock'. I click second button 'lock' and visible second span 'lock', hide second span 'unlock'. And this should be one function 'lock'. etc. I don't know... How to do it ? Help, please! This is my model: function newNames() { var self = this; self.btnClick = ko.observable(true); self.newName = ko.observable(); self.names = ko.observableArray([ {id: 1, name: 'Name1'}, {id: 2, name: 'Name2'}, {id: 3, name: 'Name3'} ]); self.lock = function () { self.btnClick(false); }; self.unlock = function () { self.btnClick(true); }; self.clickRename = function () { for (var i = 0; i < self.names().length; i++) { if (self.btnClick() == false) { } else { self.names.replace(self.names()[i], { name: self.newName() }); } } }; }; ko.applyBindings(new newNames()); This is the html: RENAME unlock lock LOCK UNLOCK
accepted answer: http://stackoverflow.com/a/26864248
tagged with: http://stackoverflow.com/tag/html
tagged with: ko.observablearray
score: 0

http://stackoverflow.com/q/26890144
tagged with: innerhtml
tagged with: shadow
type: Question
has comment: http://stackoverflow.com/comment/42334878
has answer: http://stackoverflow.com/a/26890255
tagged with: javascript
has answer: http://stackoverflow.com/a/26890242
has body: would like to add in a shadow around the right side and bottom to give a 3d effect(see below) not sure on how to do this...any help or a start would be great. so far my pop up is created inside a DIV and passed back as an innerHTML
score: 0
answer count: 2
has title: add shadow effect as innerHTML
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42334422

http://stackoverflow.com/comment/42284718
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26861499
has text: Thanks. I had to add data-dismiss="modal" because the webpage was still dark even when the modal was closed.
type: AnswerComment

http://stackoverflow.com/comment/42284250
score: 0
comment on: http://stackoverflow.com/a/26862013
type: AnswerComment
type: Comment
has text: It is deprecated since version 1.7 and removed from version 1.9.

http://stackoverflow.com/q/26982643
answer count: 2
has comment: http://stackoverflow.com/comment/42499909
has comment: http://stackoverflow.com/comment/42501527
has answer: http://stackoverflow.com/a/26982865
type: UnansweredQuestion
has title: Tricky Javascript logic with Objects, Array and Booleans
tagged with: http://stackoverflow.com/tag/html
tagged with: javascript-objects
has answer: http://stackoverflow.com/a/26982857
has body: I am having a lot of issue trying to figure out this logic. Let me set the stage here: In the HTML there are some form/input elements type radio. Each of them have an ID assigned to it. &lt;form&gt; &lt;input type="radio" name="oneAllowed" id="yesterday" /&gt; &lt;input type="radio" name="oneAllowed" id="today" /&gt; &lt;input type="radio" name="oneAllowed" id="tomorrow" /&gt; &lt;/form&gt; Using Javascript essentially what I am trying to do is loop through the 3 objects, since they all have same name assigned within HTML only a single one can be selected, whichever one is returning true I want grab hold of that result then access the second key:value pair, for example for 'commitYesterday' it would be 'commitYesterday.hasValue();' and dispatch that to a different function for other calculation. var urgentOrderSelector = function(){ var commitYesterday = { isChecked: document.getElementById("yesterday").checked, hasValue: function(){ if (this.isChecked == true) { return 3; }; }; }; var commitToday = { isChecked: document.getElementById("today").checked, hasValue: function(){ if (this.isChecked == true) { return 2; }; }; }; var commitTomorrow = { isChecked: document.getElementById("tomorrow").checked, hasValue: function(){ if (this.isChecked == true) { return 1; }; }; }; var urgentArray = [commitYesterday.isChecked, commitToday.isChecked, commitTomorrow.isChecked]; for(var i = 0; i &lt;= urgentArray.length-1; i++){ if (urgentArray[i].isChecked == true) { //This is where I am stuck. I was thinking of doing perhaps the following: return urgentArray[i].hasValue(); }; } };
tagged with: dom
has comment: http://stackoverflow.com/comment/42499358
type: Question
tagged with: javascript
score: 0

timezone
tags question: http://stackoverflow.com/q/26919425
type: Tag
tag name: timezone

http://stackoverflow.com/comment/42458580
score: 0
comment on: http://stackoverflow.com/q/26949321
type: Comment
type: QuestionComment
has text: You go with `if typeof nestedArrayStuff!='undefined'`

http://stackoverflow.com/a/26985260
score: 0
answers question: http://stackoverflow.com/q/26985213
type: Answer
has body: Use something simple like the following: http://jsfiddle.net/Godisgood/xbm4feoy/ You can incorporate this JS into your current code like this: Hope this helps!

http://stackoverflow.com/a/26877975
answers question: http://stackoverflow.com/q/26875131
score: 0
type: Answer
has body: What prettyCheckable does behind the scenes, is it hides the checkboxes and adds an a tag to the page, and updates the hidden checkboxes when the a tag is clicked. The a tag also gets a style of checked when the checkbox is checked. There appears to be a bug though, that the checked class is not added to or removed from the a tag when the state of the checkboxes is manipulated through code. Anyway, your JavaScript was correctly updating the state of the checkboxes, but prettyCheckable wasn't detecting that and failed to update its classes. Anyway, I rewrote your script so all the logic is handled in 1 event handler, and I included a work-around for the prettyCheckable bug, but I left your HTML alone so you should only have to replace your JavaScript code. See below for a runnable example: $('input:checkbox').prettyCheckable(); $("input:checkbox").on("change", function() { var checkbox = $(this); var parent = checkbox.closest("fieldset"); if (checkbox.hasClass("parentCheckBox")) { //this is a parent, check or uncheck all children var isChecked = checkbox.is(":checked"); //add checked attribute in the DOM and add the class for prettyCheckable on all children parent.find("input.childCheckBox:checkbox").prop("checked", isChecked).each(function() { if (isChecked) $(this).next("a").addClass('checked'); else $(this).next("a").removeClass('checked'); }); } else { //this is a child, check or uncheck the parent var parentCheckbox = parent.find("input.parentCheckBox:checkbox"); var isChecked = !parent.find("input.childCheckBox:checkbox").get().some(function(item) { return !$(item).is(":checked"); }); //add the checked attribute to the dom and add the class for prettyCheckable parentCheckbox.prop("checked", isChecked); if (isChecked) parentCheckbox.next("a").addClass('checked'); else parentCheckbox.next("a").removeClass('checked'); } }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="http://qfuse.com/js/util…

http://stackoverflow.com/a/36914208
has body: For date value in an array one can use this as: var dates = [ { id: "1" , date: "2015-04-20T11:24:20.882Z"}, { id: "2" , date: "2015-05-20T11:24:20.882Z"}, { id: "3" , date: "2015-06-20T11:24:20.882Z"}, ]; function dateStringToObject (data) { for(var i=0; i &lt; data.length; i++ ){ data[i].date = new Date(data[i].date); } return data; } dateStringToObject(dates);
score: 1
upvote count: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/26853173

http://stackoverflow.com/q/26983837
tagged with: css
possible better answer: http://stackoverflow.com/a/26984083
type: AnsweredQuestion
has title: Html Default Select Option - Different Color - Doesn't Work On Current Jquery
has body: I'd like to have a select field with a default option, which is not intended as a selection, be gray/faded out, while the other selectable options be black. I've tried jquery but it doesn't seem to work on my site, the problem seems to lie with jquery no longer supporting the implemetation. In the jsfiddle link below it works as it should, but only up to 1.72. How do I support/implement this. Thank you for any and all help! Jquery Implementation jQuery(document).ready(function($) { function colorgray() { if($(this).val() == "0") $(this).addClass("empty"); else $(this).removeClass("empty"); } $("select.loan-type").change(colorgray); $("select.loan-type").change(); $("select.loan").change(colorgray); $("select.loan").change(); }); JSfiddle Example
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/42501977
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/42501910
has comment: http://stackoverflow.com/comment/42501870
has answer: http://stackoverflow.com/a/26984031
accepted answer: http://stackoverflow.com/a/26984031
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26984083

http://stackoverflow.com/a/34464295
has body: I think that you need to call "alert" with "window.name" instead of just "name". runJSCode(context, (char*)"window.name =33; alert(window.name);"); "window.name" means a property "name" of object "window", but just "name" means property name of objet "this" (that is in this case the object you get by calling "context->Global()" in C++ code). You set "window" as a property of the global object not as global object.
has comment: http://stackoverflow.com/comment/122197249
type: Answer
score: 0
answers question: http://stackoverflow.com/q/26985630

http://stackoverflow.com/comment/42414172
has text: @2astalavista that wont help here - the ip address of the client isn't relevant
comment on: http://stackoverflow.com/q/26934654
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/42449392
score: 2
comment on: http://stackoverflow.com/q/26954796
has text: Can you show us your code? If you have new task, just add a classname to button and set new styles.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26894349
has comment: http://stackoverflow.com/comment/42342427
has comment: http://stackoverflow.com/comment/42342398
tagged with: http://stackoverflow.com/tag/html
tagged with: input
tagged with: css
has body: I have an input field. In which I want to fix a value. I am able to fix the value by putting readonly but it's not passing the value which I have put as fixed. what I am doing is:- &lt;input name="txt_zip_code" class="z-con-input adj-z-con-input" style="background:#eee" type="text" maxlength="13" field="txt_zip_code" value="98052" readonly="readonly" /&gt; I want to make the value same for every user. Can I get any help in this.
has comment: http://stackoverflow.com/comment/42342561
has comment: http://stackoverflow.com/comment/42342668
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42342574
has comment: http://stackoverflow.com/comment/42342313
type: Question
has comment: http://stackoverflow.com/comment/42342497
tagged with: javascript
has title: Disable the input value
score: 0
has answer: http://stackoverflow.com/a/26895920
has comment: http://stackoverflow.com/comment/42342263
answer count: 1
tagged with: jquery

http://stackoverflow.com/q/26971021
has comment: http://stackoverflow.com/comment/42559917
tagged with: revmobads
accepted answer: http://stackoverflow.com/a/27032566
tagged with: cordova
type: AnsweredQuestion
type: Question
has body: Hi I am new to the Ads Monetization in RevMob.. I am trying phonegap plugins for android and followed this link to implement http://sdk.revmobmobileadnetwork.com/phonegap_cordova.html but nothing is displaying on the screen.. I have tried with their example also BUT in that also getting error "Session has not been start. Call the start session method" in logcat. I called startSession method then also getting same error. Please anybody help to resolve this.. I have googled BUT no luck
has answer: http://stackoverflow.com/a/27032566
answer count: 1
tagged with: javascript
tagged with: phonegap-plugins
has title: PhoneGap Android RevMob plugin ads not showing..
score: 0
tagged with: android

http://stackoverflow.com/q/26869340
upvote count: 2
tagged with: spring
has body: I am trying to load an js script source in a html page that is in a Spring MVC server. Folder in Spring MVC The html page is located here: src/main/webapp/WEB-INF/view/mapa.html The js is located in a view subfolder: src/main/webapp/WEB-INF/view/js/infobox.js This is my html page mapa.html //code... ` I am trying to load the infobox.js in the mapa.html using but it is not loading. is this source route correct??
type: AnsweredQuestion
score: 2
possible better answer: http://stackoverflow.com/a/26869422
type: Question
tagged with: javascript
answer count: 2
downvote count: 0
has title: How to load a js source in Spring MVC
has answer: http://stackoverflow.com/a/26870425
accepted answer: http://stackoverflow.com/a/26870425
has answer: http://stackoverflow.com/a/26869422
favorite count: 0

http://stackoverflow.com/q/26985042
type: Question
has comment: http://stackoverflow.com/comment/42506762
tagged with: javascript
has body: I want to implement carousel on my web page.I have created a plunker page for the same. In that link, i have used CSS3 transformations to create circle effects. In the above link i have removed the code which i had for carousel implementation because it was not working.Actually what happens is that most of the jquery caosuel available like(elastslide,liquidcarosel,flexslider) etc work only if the img(which needs to be slided) is directly under "li" tag.But in my case, i can't keep img directly under "li" because of the css3 transformations i need.(See index.html page) http://plnkr.co/edit/PxTtJ2expidIamWUqXLj?p=preview&s=carousel for eg Java7 Could anyone please suggest how can i implement it.
score: 0
tagged with: jquery
type: UnansweredQuestion
tagged with: css
answer count: 0
has comment: http://stackoverflow.com/comment/42520069
has title: Issue in carousel implementation

http://stackoverflow.com/comment/42380899
has text: Will it break the quantity into a number?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26916121
type: Comment

http://stackoverflow.com/a/26917255
type: Answer
has body: LcSalazar is correct in regards to handling to rotation state of your cube, but my impression is that you're also interested in animating the rotation? If so, you'll want to check out CSS animations to handle those in-between states. This question covers dynamic values in CSS keyframed animations, which might be a bit beyond your current knowledge of CSS/JS, but spend some time with it and you'll be surprised how quickly it starts making sense. Good luck!
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/26913970
downvote count: 0

http://stackoverflow.com/q/26898122
tagged with: javascript
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/26911965
answer count: 1
downvote count: 0
favorite count: 0
tagged with: cordova
has title: I can't seem to post an array of objects
upvote count: 1
accepted answer: http://stackoverflow.com/a/26911965
type: AnsweredQuestion
score: 1
has body: Alrighty, so here is where I am at. I have some code that sends an array of goodies to a .NET WebAPI (c#). var questions = []; $('#questions').find('input').each(function(){ var text = $(this).val(); questions.push({ ID: 123, Question: text }); }); $.ajax({ type: 'POST', url: _apiPath + '/main/savequestions', data: { "" : questions } }).done(function(data){ alert(JSON.stringify(data)); }); So I learned on a while back that .NET Web API gets confused with arrays and there is a known bug which is why you have to send the data with "" as the property name. Here is my web api controller: [Route("main/savequestions")] [HttpPost] public List&lt;Question&gt; SaveQuestions(List&lt;Question&gt; questions) { using (var mc = new MyContext()) { List&lt;Question&gt; list = new List&lt;Question&gt;(); if (questions != null) { foreach (var item in questions) { var dbQ = new Question(); dbQ.ID = Guid.NewGuid(); dbQ.ToolID = item.ID; dbQ.Question = item.Question; mc.Questions.Add(dbQ); list.Add(dbQ); } } mc.SaveChanges(); return list; } } This works fine when we are on a desktop. Everything saves...works...awesome. So we are using PhoneGap and when we use the phonegap app to emulate the app running this code will not save any data. We have checked and made sure that the JSON we are sending is the same...but when we run it the controller seems to be getting an empty array and so it isn't saving anything. The inconsistency is enough to drive me batty. Help! David
type: Question
tagged with: asp.net-web-api

http://stackoverflow.com/comment/42245937
type: QuestionComment
comment on: http://stackoverflow.com/q/26838239
score: 0
has text: @User089247 Sorry for that i discribed my question not so clearly. I have added html code to make question more clear. week_array and weekday_array is like a CONST. The first part of the code is writing by rails and haml. U can think the weekday_array is [Mon Tues .. Sun] and week_array is sth like [week_1, week_2]
type: Comment

http://stackoverflow.com/q/26914013
type: Question
linked to: http://stackoverflow.com/q/14290316
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26914665
score: 0
tagged with: ember.js
answer count: 1
linked to: http://stackoverflow.com/q/16878473
accepted answer: http://stackoverflow.com/a/26914665
has body: In my ember.js-app, Ive got one template which includes a javascript-jQuery-script. Within this script I want to call ember to read out some variables, safe them, and then change the template Like so finishedGame = function() { // ember create model-entry by using "this.points" // ember change the template to "game/credits" }; How can I use ember to hook into an independent-running script and start functionality like switching templates etc. or ist it possible to access the controller functions from elsewhere than the ember-scripts itselv?
has title: How to change current template/route by an external script?
type: AnsweredQuestion

http://stackoverflow.com/q/26864784
has body: Here I need to get the selected radio button value (123,456,789) and assign it to valueee div element? I used document.getElementsById, but couldn't get what I need. Any help would be highly appreciated. Radio Button Selection Choose option: 123 CSS 456 html 678 jquery 675 JS Show Selected Radio
has answer: http://stackoverflow.com/a/26864835
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/26865705
type: AnsweredQuestion
has title: jQuery how to get div element value from radio button and assign value to a specific div
has answer: http://stackoverflow.com/a/26865705
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26864887
accepted answer: http://stackoverflow.com/a/26864887
score: 0
answer count: 3
upvote count: 1
downvote count: 1
favorite count: 0

wordpress
tags question: http://stackoverflow.com/q/26852730
tags question: http://stackoverflow.com/q/26913498
tags question: http://stackoverflow.com/q/26877003
tags question: http://stackoverflow.com/q/26915208
tags question: http://stackoverflow.com/q/26912391
tags question: http://stackoverflow.com/q/26942416
tags question: http://stackoverflow.com/q/26916089
tags question: http://stackoverflow.com/q/26924350
tags question: http://stackoverflow.com/q/26977402
tags question: http://stackoverflow.com/q/26936935
tags question: http://stackoverflow.com/q/26847573
tags question: http://stackoverflow.com/q/26937030
tags question: http://stackoverflow.com/q/26851666
tags question: http://stackoverflow.com/q/26932349
tags question: http://stackoverflow.com/q/26931124
tags question: http://stackoverflow.com/q/26984477
tags question: http://stackoverflow.com/q/26866063
tags question: http://stackoverflow.com/q/26964332
tags question: http://stackoverflow.com/q/26933351
tag name: wordpress
tags question: http://stackoverflow.com/q/26952544
tags question: http://stackoverflow.com/q/26914257
tags question: http://stackoverflow.com/q/26907945
tags question: http://stackoverflow.com/q/26918404
tags question: http://stackoverflow.com/q/26934137
tags question: http://stackoverflow.com/q/26852073
tags question: http://stackoverflow.com/q/26898556
tags question: http://stackoverflow.com/q/26864066
tags question: http://stackoverflow.com/q/26974329
tags question: http://stackoverflow.com/q/26910573
tags question: http://stackoverflow.com/q/26977941
tags question: http://stackoverflow.com/q/26964760
tags question: http://stackoverflow.com/q/26899107
tags question: http://stackoverflow.com/q/26930999
type: Tag
tags question: http://stackoverflow.com/q/26940938
tags question: http://stackoverflow.com/q/26857594

http://stackoverflow.com/a/26837394
has comment: http://stackoverflow.com/comment/42240121
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42240254
has comment: http://stackoverflow.com/comment/42240412
accepted answer of: http://stackoverflow.com/q/26837230
type: Answer
answers question: http://stackoverflow.com/q/26837230
has body: Working for me , EDIT 3 JSFIDDLE ***NOTE : Email validation you need to add* Try this, $(function() { $('.checkboxfile').keyup(function(){ var isCheckedCB = false; $('input:checkbox').each(function(){ if($(this).is(':checked')){ isCheckedCB = true; } }); if( $('#firstname').val()=='' || $('#company').val()=='' || $('#email').val()=='' || !isCheckedCB) $('#cadandrivitbutton').attr('disabled', true); else $('#cadandrivitbutton').attr('disabled', false); }) $('input:checkbox').click(function() { var buttonsChecked = $('input:checkbox:checked'); if (buttonsChecked.length &amp;&amp; $('#firstname').val()!='' &amp;&amp; $('#company').val()!='' &amp;&amp; $('#email').val()!='') { $('#cadandrivitbutton').removeAttr('disabled'); } else { $('#cadandrivitbutton').attr('disabled', 'disabled'); } }); });
has comment: http://stackoverflow.com/comment/42240779
has comment: http://stackoverflow.com/comment/42240131
downvote count: 0
score: 1

http://stackoverflow.com/comment/42481227
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/26917059
has text: @SunilD. Please read the question against : `" in if condition"`.
score: 4

http://stackoverflow.com/q/26865989
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26866017
has answer: http://stackoverflow.com/a/26866406
has comment: http://stackoverflow.com/comment/42291266
has body: here is my code: &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"&gt;&lt;/script&gt; &lt;?php $url = "http://api.wunderground.com/api/7d5339867b063fd0/geolookup/conditions/q/UK/".$area.".json"; ?&gt; &lt;script&gt; jQuery(document).ready(function($) { $.ajax({ url : , dataType : "jsonp", success : function(parsed_json) { var location = parsed_json['location']['city']; var temp_f = parsed_json['current_observation']['temp_f']; alert("This is an example of a web service outputting using Json. The current temperature in " + location + " is: " + temp_f); } }); }); &lt;/script&gt; How can i add the "$url" variable into the javascript code at the location " url : "here", Thanks
accepted answer: http://stackoverflow.com/a/26866018
type: Question
has title: How can i add a php variable into javascript?
possible better answer: http://stackoverflow.com/a/26866040
has answer: http://stackoverflow.com/a/26866040
has answer: http://stackoverflow.com/a/26866018
score: 0
linked to: http://stackoverflow.com/q/23740548
linked to: http://stackoverflow.com/q/7141860
upvote count: 1
downvote count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/42291702
has comment: http://stackoverflow.com/comment/42291247
favorite count: 0
has comment: http://stackoverflow.com/comment/42291245
tagged with: php

http://stackoverflow.com/a/26956131
score: 0
type: Answer
has body: Spring Tool Suite (STS) uses the pivotal tc server will automatically deploy resources without redeploying the application. Download it and give it a go, STS is just eclipse anyway with different branding. Maybe you can just download it, copy the pivotal server folder to your eclipse folder and add it to your servers view in your eclipse version. One thing I have noticed is that the application must be running under a context for this to work, deploying to root does not automatically deploy resources for some reason (at least this was the case when I was using the previous vfabric server about a year ago).
answers question: http://stackoverflow.com/q/26945246

http://stackoverflow.com/comment/42426760
type: Comment
has text: Uhm, PHP comes to mind, and especially the built in methods in Wordpress for actually including headers and footers ?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/26941474

http://stackoverflow.com/comment/42347587
has text: Hey cport1 sorry could you explain in a bit more detail?
type: QuestionComment
comment on: http://stackoverflow.com/q/26897129
score: 0
type: Comment

http://stackoverflow.com/comment/42470785
score: 0
has text: i try to create a windows service in c ++, so when I was called from my javascript, open a program or some script in gstreamer in the same host
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26966501

http://stackoverflow.com/q/26856229
tagged with: filter
has title: Filtering specific range of numbers from an array
has comment: http://stackoverflow.com/comment/42369981
has answer: http://stackoverflow.com/a/26910263
has comment: http://stackoverflow.com/comment/42392922
score: 14
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42369865
upvote count: 14
tagged with: image-processing
has comment: http://stackoverflow.com/comment/42375545
type: Question
accepted answer: http://stackoverflow.com/a/26910263
tagged with: canvas
tagged with: arrays
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has body: I'm creating an algorithm that will blur the border of a canvas(image). Before applying the blur effect, I am creating an array filtered that includes all pixel values that needs to be blurred. I've created an example with a 10×10px image. function compute(w, h, bW) { w *= 4; var ignored = []; for (y = bW; y &lt; (h - bW); y++) { for (x = 0; x &lt; (w - (bW * 4 * 2)); x++) { ignored.push(w * y + x + bW * 4); } } console.log(ignored); function range(limit) { return Array.apply(null, Array(limit)).map(function(_, i) { return i; }) } Array.prototype.diff = function(array) { return this.filter(function(elem) { return array.indexOf(elem) === -1; }) } var filtered = range(w * h).diff(ignored); console.log(filtered); return filtered; } compute(10, 10, 2); ////////////////////////////////////////////////////////////////// // Below is just to display the numbers that are being filtered // // Here, the size is 100 x 100 px with 10px border width // ////////////////////////////////////////////////////////////////// var pixels = compute(100, 100, 10); var c = document.getElementsByTagName('canvas')[0]; var ctx = c.getContext('2d'); var imgD = ctx.createImageData(100, 100); for (var i = 0; i &lt; imgD.data.length; i += 4) { if (pixels.indexOf(i) &gt; 0) { imgD.data[i + 0] = 0; imgD.data[i + 1] = 0; imgD.data[i + 2] = 0; imgD.data[i + 3] = 255; } else { imgD.data[i + 0] = 255; imgD.data[i + 1] = 0; imgD.data[i + 2] = 0; imgD.data[i + 3] = 255; } } ctx.putImageData(imgD, 10, 10); &lt;canvas&gt;&lt;/canvas&gt; The array filtered contains all the numbers that has the background color and ignored contains all the numbers that has the background color and in the image. My question is: How do I change my code so that the array filtered will have the numbers with background color and and not ? An Example on a bit high resolution(65×65px):

http://stackoverflow.com/q/26989402
answer count: 2
upvote count: 1
has body: With the help of the stackoverflow community, I have been able to adapt some code to work as +/- buttons with minimum & maximum limits of 1 & 10. All seems to be ok except when I add multiple products into the cart of my testing Opencart website. The first input field works ok, but all following +/- buttons only adjust the first. You can see what I mean in the demo, I have duplicated the html blocks to illustrate the problem I am getting - http://jsfiddle.net/aeuLx9nt/5/ This must be something in the javascript causing this. I'm not sure where to start, any suggestions greatly appreciated...many thanks. This is the javascript $(function(){ $("#quantity").parent().children().css("vertical-align","middle") }); function btnminus(a){ document.getElementById("quantity").value>a? document.getElementById("quantity").value--: document.getElementById("quantity").value=a } function btnplus(a){ document.getElementById("quantity").value<a? document.getElementById("quantity").value++: document.getElementById("quantity").value=a } This is the html Qty - + Qty - + Qty - +
favorite count: 0
tagged with: opencart
type: AnsweredQuestion
downvote count: 0
has title: + / - Quantity box with children
has answer: http://stackoverflow.com/a/26989646
score: 1
accepted answer: http://stackoverflow.com/a/26989646
type: Question
possible better answer: http://stackoverflow.com/a/26989558
tagged with: javascript
has answer: http://stackoverflow.com/a/26989558

dom
tags question: http://stackoverflow.com/q/26887264
type: Tag
tags question: http://stackoverflow.com/q/26915193
tags question: http://stackoverflow.com/q/26947320
tags question: http://stackoverflow.com/q/26887038
tags question: http://stackoverflow.com/q/26932862
tags question: http://stackoverflow.com/q/26872182
tags question: http://stackoverflow.com/q/26964628
tags question: http://stackoverflow.com/q/26892254
tags question: http://stackoverflow.com/q/26875260
tags question: http://stackoverflow.com/q/26922749
tags question: http://stackoverflow.com/q/26961731
tags question: http://stackoverflow.com/q/26854525
tags question: http://stackoverflow.com/q/26890598
tags question: http://stackoverflow.com/q/26895366
tags question: http://stackoverflow.com/q/26877051
tags question: http://stackoverflow.com/q/26981406
tags question: http://stackoverflow.com/q/26843566
tags question: http://stackoverflow.com/q/26954569
tags question: http://stackoverflow.com/q/26876256
tags question: http://stackoverflow.com/q/26953866
tags question: http://stackoverflow.com/q/26981549
tags question: http://stackoverflow.com/q/26956007
tags question: http://stackoverflow.com/q/26965069
tags question: http://stackoverflow.com/q/26882599
tags question: http://stackoverflow.com/q/26886009
tags question: http://stackoverflow.com/q/26848289
tags question: http://stackoverflow.com/q/26869913
tags question: http://stackoverflow.com/q/26982643
tags question: http://stackoverflow.com/q/26926921
tags question: http://stackoverflow.com/q/26918317
tags question: http://stackoverflow.com/q/26842834
tags question: http://stackoverflow.com/q/26905560
tags question: http://stackoverflow.com/q/26835270
tags question: http://stackoverflow.com/q/26876514
tags question: http://stackoverflow.com/q/26917681
tags question: http://stackoverflow.com/q/26985648
tags question: http://stackoverflow.com/q/26969644
tags question: http://stackoverflow.com/q/26863342
tags question: http://stackoverflow.com/q/26933020
tag name: dom
tags question: http://stackoverflow.com/q/26906961
tags question: http://stackoverflow.com/q/26853816
tags question: http://stackoverflow.com/q/26908373
tags question: http://stackoverflow.com/q/26844196
tags question: http://stackoverflow.com/q/26947208
tags question: http://stackoverflow.com/q/26940845
tags question: http://stackoverflow.com/q/26919289
tags question: http://stackoverflow.com/q/26966064
tags question: http://stackoverflow.com/q/26895092
tags question: http://stackoverflow.com/q/26873332
tags question: http://stackoverflow.com/q/26954034

http://stackoverflow.com/comment/42378931
has text: I'll take a look and let you know
type: Comment
comment on: http://stackoverflow.com/a/26914246
type: AnswerComment
score: 0

http://stackoverflow.com/q/26856903
has body: What is the easiest way to check if the window scroll is at the bottom—without using jQuery? I've come across some methods, but most of them don't work cross browser.
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42275935
score: 2
downvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26856995
has title: Check if the scroll is currently at the bottom - no jQuery
type: Question
upvote count: 2
answer count: 1
linked to: http://stackoverflow.com/q/2817042
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/26950731
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27350253
type: UnansweredQuestion
has title: Browserify-hogan .render() returns empty string
tagged with: mustache
has body: Does any of you have experience working with gulp + browserify + browserify-hogan? I'm trying to include a mustache template into my browserified JS controller, and apparently it works fine, my gulp task runs without an error, and I can require the template in the js file: var tpl = require('./my-template.mustache'); But when I call tpl.render() all I get is an empty string. I've looked into my compiled js file, and the transformed mustache template looks like this: var t = new (require('hogan.js/lib/template')).Template(function(c,p,i){var _=this;_.b(i=i||"");_.b("// my-template.mustache");_.b("\n" + i);_.b("test");_.b("\n" + i);_.b("\n" + i);_.b("\n");return _.fl();;});module.exports = { render: function () { return t.render.apply(t, arguments); }, r: function () { return t.r.apply(t, arguments); }, ri: function () { return t.ri.apply(t, arguments); }}; Looking at this I'd assume everything is fine as my .mustache file contains a single line with the string test in it. But I don't understand why render() doesn't return anything. Thanks for any input!
downvote count: 0
score: 1
type: Question
tagged with: javascript
tagged with: browserify
upvote count: 1

http://stackoverflow.com/q/26927396
has comment: http://stackoverflow.com/comment/42401027
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42400896
score: 0
has comment: http://stackoverflow.com/comment/42401053
answer count: 2
has comment: http://stackoverflow.com/comment/42401012
has comment: http://stackoverflow.com/comment/42400986
has answer: http://stackoverflow.com/a/26928234
tagged with: asp.net-ajax
has comment: http://stackoverflow.com/comment/42401294
has comment: http://stackoverflow.com/comment/42400974
linked to: http://stackoverflow.com/q/2640526
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26928102
has body: I tried draw route of click truck marker on google map.But I get this eror "Internal Server Error" Javascript codes : function Route(Param) { $.ajax({ type: "POST", url: "Mainpage.aspx/Route", data: '{"data":"' + Param+ '"}', contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { if (msg.d) { alert(msg.d); } else { alert("Error..."); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("Status: " + textStatus); alert("Error: " + errorThrown); } }); //Click truck marker // call and set parameter Route function Route(parseInt(dataTruck.TruckId)); Code behind Mainpage.aspx.cs static string _Route; [WebMethod] public static string Route (int TruckId) { _Route = _DrawRoute(TruckId); return _Route ; } public static string _DrawRoute(int TruckId) { // return Serialize rows } Route method return this format : [{"Lat":37.9137,"Lng":28.3708},{"Lat":37.9138,"Lng":28.3707},{"Lat":37.9137,"Lng":28.3709},{"Lat":37.9138,"Lng":28.3708}]
accepted answer: http://stackoverflow.com/a/26928234
has title: How to send a parameter in ajax POST?
type: Question
possible better answer: http://stackoverflow.com/a/26928102
tagged with: c#

http://stackoverflow.com/q/26958701
tagged with: http://stackoverflow.com/tag/html
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42456343
linked to: http://stackoverflow.com/q/750486
duplicate of: http://stackoverflow.com/q/750486
has title: use a variable for window.open in a loop
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/42456364
has body: I have 4 divs on an HTML page which represent links to social media sites. Rather thank have 4 different blocks of Javascript is there a way to loop this code so I don't have to write it out for every option pair in the two arrays? var socialDiv=["facebook","twitter","google","linkedin"]; var URL=["http://www.facebook.com","http://www.twitter.com","http://www.google.com","http://www.linkedin.com"]; document.getElementById(socialDiv[0]).onclick=function(){ window.open(URL[0],'_blank'); } I have tried using For and While loops which half worked. All the divs listed in the first array became clickable, but all opened blank windows. This is what I had previously tried: var socialDiv=["facebook","twitter","google","linkedin"]; var URL=["http://www.facebook.com","http://www.twitter.com","http://www.google.com","http://www.linkedin.com"]; var i=0; while(i&lt;socialDiv.length){ document.getElementById(socialDiv[i]).onclick=function(){ window.open(URL[i],'_blank'); } i++; }
score: 0

http://stackoverflow.com/a/26918566
has comment: http://stackoverflow.com/comment/42439966
downvote count: 0
has comment: http://stackoverflow.com/comment/42423548
type: Answer
score: 1
upvote count: 1
has body: This isn't an answer so please don't accept it or vote it up. Only here because I created a code snippet showing the code working: angular.module('MyModule', []) .controller('MyController', function($scope) { $scope.adminTabs = [{"name": "Agent"}, {"name": "Agent Queue"}, {"name": "Skills"} ]; $scope.activeAdminTab = $scope.adminTabs[0].name; $scope.loadAdminTab = function(){ $scope.activeAdminTab = this.tab.name; } }); .selected { color: red } {{tab.name}}
answers question: http://stackoverflow.com/q/26918243
has comment: http://stackoverflow.com/comment/42406660

margin
tags question: http://stackoverflow.com/q/26884654
tag name: margin
type: Tag

php
tags question: http://stackoverflow.com/q/26965955
tags question: http://stackoverflow.com/q/26869426
tags question: http://stackoverflow.com/q/26941219
tags question: http://stackoverflow.com/q/26835093
tags question: http://stackoverflow.com/q/26947268
tags question: http://stackoverflow.com/q/26940432
tags question: http://stackoverflow.com/q/26933901
tags question: http://stackoverflow.com/q/26908215
tags question: http://stackoverflow.com/q/26956877
tags question: http://stackoverflow.com/q/26925214
tags question: http://stackoverflow.com/q/26959968
tags question: http://stackoverflow.com/q/26961835
tags question: http://stackoverflow.com/q/26886472
tags question: http://stackoverflow.com/q/26975232
tags question: http://stackoverflow.com/q/26909804
tags question: http://stackoverflow.com/q/26922623
tags question: http://stackoverflow.com/q/26854333
tags question: http://stackoverflow.com/q/26987746
tags question: http://stackoverflow.com/q/26892093
tags question: http://stackoverflow.com/q/26961187
tags question: http://stackoverflow.com/q/26858783
tags question: http://stackoverflow.com/q/26966512
tags question: http://stackoverflow.com/q/26903700
tags question: http://stackoverflow.com/q/26894490
tags question: http://stackoverflow.com/q/26977402
tags question: http://stackoverflow.com/q/26903134
tags question: http://stackoverflow.com/q/26944713
tags question: http://stackoverflow.com/q/26978505
tags question: http://stackoverflow.com/q/26883244
tags question: http://stackoverflow.com/q/26842369
tags question: http://stackoverflow.com/q/26877003
tags question: http://stackoverflow.com/q/26930455
tags question: http://stackoverflow.com/q/26839623
tags question: http://stackoverflow.com/q/26935818
tags question: http://stackoverflow.com/q/26980656
tags question: http://stackoverflow.com/q/26847077
tags question: http://stackoverflow.com/q/26985380
tags question: http://stackoverflow.com/q/26918853
tags question: http://stackoverflow.com/q/26864590
tags question: http://stackoverflow.com/q/26959925
tags question: http://stackoverflow.com/q/26962464
tags question: http://stackoverflow.com/q/26971024
tags question: http://stackoverflow.com/q/26865040
tags question: http://stackoverflow.com/q/26967614
tags question: http://stackoverflow.com/q/26941739
tags question: http://stackoverflow.com/q/26880359
tags question: http://stackoverflow.com/q/26946769
tags question: http://stackoverflow.com/q/26960924
tags question: http://stackoverflow.com/q/26874662
tags question: http://stackoverflow.com/q/26971220
tags question: http://stackoverflow.com/q/26895299
tags question: http://stackoverflow.com/q/26972175
tags question: http://stackoverflow.com/q/26901940
tags question: http://stackoverflow.com/q/26920522
tags question: http://stackoverflow.com/q/26922657
tags question: http://stackoverflow.com/q/26902956
tags question: http://stackoverflow.com/q/26905925
tags question: http://stackoverflow.com/q/26859554
tags question: http://stackoverflow.com/q/26911801
tags question: http://stackoverflow.com/q/26965111
tags question: http://stackoverflow.com/q/26950746
tags question: http://stackoverflow.com/q/26954796
tags question: http://stackoverflow.com/q/26941861
tags question: http://stackoverflow.com/q/26905577
tags question: http://stackoverflow.com/q/26891590
tags question: http://stackoverflow.com/q/26850887
tags question: http://stackoverflow.com/q/26877823
tags question: http://stackoverflow.com/q/26927108
tags question: http://stackoverflow.com/q/26900313
tags question: http://stackoverflow.com/q/26947792
tags question: http://stackoverflow.com/q/26842804
tags question: http://stackoverflow.com/q/26914223
tags question: http://stackoverflow.com/q/26986651
tags question: http://stackoverflow.com/q/26877360
tags question: http://stackoverflow.com/q/26899515
tags question: http://stackoverflow.com/q/26884797
tags question: http://stackoverflow.com/q/26845287
tags question: http://stackoverflow.com/q/26877148
tags question: http://stackoverflow.com/q/26892714
tags question: http://stackoverflow.com/q/26864247

http://stackoverflow.com/q/26858946
downvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/42281536
has comment: http://stackoverflow.com/comment/42287589
favorite count: 0
tagged with: hash
has title: Encryption Function returning Set Length
type: UnansweredQuestion
has body: I am attempting to write a hash function (writing in JavaScript for easier testing) though I have a bit of an issue. Larger, more popular cryptographic hash functions such as md5, sha1, etc. have a fixed length. How is this done exactly? For example, "0" and "0123456789" hashed are the same length. This is my function at the moment: String.prototype.encrypt = function() { var l = this.length, a = [], s = this.split(''); s.forEach(function(v) { a.push(v.charCodeAt() &lt;&lt; l); }); s.forEach(function(v,i) { s[i] = (v.charCodeAt() &lt;&lt; a[i]) &lt;&lt; l; }); return s.join(''); }; What can I do to have this return a string of a set length? P.S: I know this isn't secure, I'm still working on that.
has comment: http://stackoverflow.com/comment/106281816
has comment: http://stackoverflow.com/comment/42291663
answer count: 0
has comment: http://stackoverflow.com/comment/103637816
upvote count: 2
score: 1

http://stackoverflow.com/comment/43903691
type: QuestionComment
has text: @Stevangelista - It might be a bit late, but that is a great pointer. Thanks! Do you have any advice on how to use those demos to answer this question?
score: 0
comment on: http://stackoverflow.com/q/26984834
type: Comment

http://stackoverflow.com/a/35779512
has comment: http://stackoverflow.com/comment/80405186
score: 6
downvote count: 0
answers question: http://stackoverflow.com/q/26978112
type: Answer
upvote count: 6
has body: You can create a function like this: function IsPostBack() { var ret = '&lt;%= Page.IsPostBack%&gt;' == 'True'; return ret; }

http://stackoverflow.com/comment/42298405
comment on: http://stackoverflow.com/q/26869426
has text: @JayBlanchard: No actually at the beginning I showed them in dropdown, then my supervisor asked me not to show them in dropdown, instead I have to show them exactly like what amazon does... --> http://www.amazon.com/s/ref=nb_sb_ss_i_5_7?url=search-alias%3Daps&field-keywords=leonardo%20dicaprio&sprefix=leonard%2Caps%2C208&rh=i%3Aaps%2Ck%3Aleonardo%20dicaprio
score: 0
type: Comment
type: QuestionComment

deserialization
type: Tag
tags question: http://stackoverflow.com/q/26920395
tag name: deserialization

http://stackoverflow.com/a/26853431
type: Answer
has body: if you are using gulp, there is a module called gulp-tap that you can use to grab the file, split it between some type of identifier, minify the parts you want, and then concatenate it back together. I'm sure that grunt or other task runners have similar capabilities
has comment: http://stackoverflow.com/comment/42269534
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/26853217
has comment: http://stackoverflow.com/comment/42412614
upvote count: 1
has comment: http://stackoverflow.com/comment/42270136
has comment: http://stackoverflow.com/comment/42447927
has comment: http://stackoverflow.com/comment/42269510

http://stackoverflow.com/comment/42352591
type: Comment
score: 0
has text: Updated, simply add `$form.find` like so: `return $form.find('input[type="radio"]:checked').length;`
comment on: http://stackoverflow.com/a/26834312
type: AnswerComment

http://stackoverflow.com/a/26887574
score: 0
has body: Try This one $('div.list').prepend("&lt;div&gt; Hello &lt;/div&gt;");
answers question: http://stackoverflow.com/q/26887506
type: Answer

http://stackoverflow.com/comment/42681251
score: 0
type: Comment
has text: $('#menu').unbind('click'); to disable click in the div
comment on: http://stackoverflow.com/a/26967961
type: AnswerComment

http://stackoverflow.com/q/26982459
tagged with: javascript
tagged with: angularjs-validation
has body: Let's say I have a simple form with some Angular validation: Field is required. Now let's say I want to use a variable for the form name instead of a hard-coded string: How can I modify myForm[myField].$invalid and myForm[myField].$error.required to still reference my form?
type: Question
has title: AngularJS validation referencing form object with variable name
tagged with: angularjs
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/26982637
accepted answer: http://stackoverflow.com/a/26982637
type: AnsweredQuestion

http://stackoverflow.com/comment/90323677
has text: have the same issue. $rootScope.__global from MainCtrl showing data in Header Ctrl but fail tests
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26936222

http://stackoverflow.com/a/26854695
type: Answer
score: 2
answers question: http://stackoverflow.com/q/26854588
has body: How do I ignore the mouseup event when user is selecting text? Check if the text input has focus. Ex: if ( $(input).is(':focus') ) { ... }
accepted answer of: http://stackoverflow.com/q/26854588
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42271925
downvote count: 0
upvote count: 2

search-engine
type: Tag
tag name: search-engine
tags question: http://stackoverflow.com/q/26961639

http://stackoverflow.com/q/26947275
type: Question
has answer: http://stackoverflow.com/a/26947378
tagged with: javascript
has answer: http://stackoverflow.com/a/26947305
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26949739
has body: I am using setInterval() and clearInterval() methods for timer and stopping the timer respectively. I am using two buttons "start Timer" and "stop timer". when I click the "stop timer" button the time stops and after clicking "start timer" button it stops and after that when I click "stop timer" button again the time won't stop. Can you please help me in this? here is my code: Document Start Timer Stop Timer
has title: Button is not after starting timer

http://stackoverflow.com/q/26842210
tagged with: internet-explorer
tagged with: javascript
has comment: http://stackoverflow.com/comment/42549381
has title: Local storage and Internet Explorer 9 adventures
has comment: http://stackoverflow.com/comment/42346703
has comment: http://stackoverflow.com/comment/42549304
answer count: 1
has answer: http://stackoverflow.com/a/27004124
accepted answer: http://stackoverflow.com/a/27004124
downvote count: 0
has comment: http://stackoverflow.com/comment/42541553
has body: I have interesting issue in Internet Explorer 9 using localStorage. I use client-side localization in my web project using i18next library and as a localization storage we decided to use localStorage. We are loading all localization at the user first visit(whole localization for one language ~ 450kb). All is working well in all browser, except Internet explorer 9. After some time and switching between languages I start receiving error - "SCRIPT5022: DOM Exception: QUOTA_EXCEEDED_ERR (22)", when it trying to load localization from server-side. When I try - localStorage.remainingSpace it returns: 120776 However when i try to look what is stored in localStorage with a command - JSON.stringify(localStorage) it returns - "{}". So nothing is stored in localStorage however it writes that only 120kb is free. When I try on any other web site, for the command - localStorage.remainingSpace it shows - 5000000. Also localStorage.clear() is not helping to stop receiving that message - "SCRIPT5022: DOM Exception: QUOTA_EXCEEDED_ERR (22)" The question is - 'Why internet explorer 9 thinks that localStorage is almost full while it don't contain any data?' Thanks for any advance.
favorite count: 0
has comment: http://stackoverflow.com/comment/42557508
has comment: http://stackoverflow.com/comment/42499726
has comment: http://stackoverflow.com/comment/42343954
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
score: 1
upvote count: 1
tagged with: local-storage
type: Question
has comment: http://stackoverflow.com/comment/42356688
has comment: http://stackoverflow.com/comment/42589125

http://stackoverflow.com/comment/42274212
comment on: http://stackoverflow.com/a/26855094
type: AnswerComment
score: 0
type: Comment
has text: `$().fadeOut();` sets `style="display: none;"` after the animation completes, if the container of the element in question has `auto` height, this will cause the container's height to change which usually isn't desired in cases such as a banner slider.

http://stackoverflow.com/a/26976341
score: 0
answers question: http://stackoverflow.com/q/26976284
has body: You can use mouseout() to check for the cursor leaving the elemnt $('.mail img').mouseout(function(){ alert('off hover'); });
type: Answer

http://stackoverflow.com/q/26976000
accepted answer: http://stackoverflow.com/a/26976378
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/42486894
score: -3
has comment: http://stackoverflow.com/comment/42486794
has comment: http://stackoverflow.com/comment/42487243
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42486837
has comment: http://stackoverflow.com/comment/42486871
has comment: http://stackoverflow.com/comment/42487368
downvote count: 3
has comment: http://stackoverflow.com/comment/42487273
has comment: http://stackoverflow.com/comment/42486934
has comment: http://stackoverflow.com/comment/42486753
type: Question
has comment: http://stackoverflow.com/comment/42486972
has comment: http://stackoverflow.com/comment/42487167
has body: I have my html, css and jquery working totally fine on jsfiddle http://jsfiddle.net/mwjqpqra/4/ World Wide Web Profect WWW What Who How When Awesome! WW What? Project World Wide Web. The World Wide Web (abbreviated as WWW or W3, commonly known as the Web) is a system of interlinked hypertext documents that are accessed via the Internet. With a web browser, one can view web pages that may contain text, images, videos, and other multimedia and navigate between them via hyperlinks. Explore!Don’t worry it’s for free Who made it ? O.o Tim Berners-Lee, a British computer scientist and former CERN employee,and Belgian computer scientist Robert Cailliau are considered the inventors of the Web. On March 12, 1989, Berners-Lee wrote a proposal for what would eventually become the World Wide Web. The 1989 proposal was meant for a more effective CERN communication system but Berners-Lee eventually realised the concept could be implemented throughout the world. Berners-Lee and Belgian computer scientist Robert Cailliau proposed in 1990 to use hypertext "to link and access information of various kinds as a web of nodes in which the user can browse at will",and Berners-Lee finished the first website in December of that year. The first test was completed around 20 December 1990 and Berners-Lee reported about the project on the newsgroup alt.hypertext on 7 August 1991. Wix is an online website builder with a simple drag & drop interface, meaning you do the work online and instantly publish to the web. © 2025 Dark Virtuality. Java.js $(document).ready(function(){ $('a[href^="#"]').on('click',function (e) { e.preventDefault(); var target = this.hash; $target = $(target); $('html, body').stop().animate({ 'scrollTop': $target.offset().top }, 900, 'swing', function () { window.location.hash = target; }); }); }); But the webpage doesn't even seem to pick up the .js code and jquery and java.js don't work locally on my PC. I have already tried on different browsers such as chrome, firefox de…
upvote count: 0
has answer: http://stackoverflow.com/a/26976378
tagged with: javascript
tagged with: jquery
has title: Javascript and jquery working fine on jsfiddle but not locally

http://stackoverflow.com/comment/42324082
type: Comment
has text: @Arun P Johny how about function bind and unbind? there are no selector at second argument -(
comment on: http://stackoverflow.com/a/26883438
type: AnswerComment
score: 0

zingchart
type: Tag
tags question: http://stackoverflow.com/q/26935796
tag name: zingchart

http://stackoverflow.com/comment/42511872
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26974618
has text: you don't need to use object name to display data on view. just use id instead of Timesheetrow.id in template. if you want to use property in js file you need object.

http://stackoverflow.com/comment/42504905
has text: Thanks Arun-- does doing say create any problems that you can think of, though? What if a plugin initialization is called and the underlying library is not present? Can this interrupt/disturb the functionality of other scripts on the page?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26985765

http://stackoverflow.com/q/26909300
type: Question
has answer: http://stackoverflow.com/a/26909335
has answer: http://stackoverflow.com/a/26909338
tagged with: javascript
has comment: http://stackoverflow.com/comment/42368485
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/42368299
has answer: http://stackoverflow.com/a/26909371
has title: JQuery Node check if not empty
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26909329
answer count: 4
linked to: http://stackoverflow.com/q/6813227
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/6813227
has body: My html markup can look as following: text text / Is there a way to check if the h2-element itself or the h2-element with n-children nodes contains any html-content. So far I have tried if ( $('h2').html() !== '' ) ... if ( $('h2 *').html() !== '' ) ... if ( $('h2').html().length ) ... EDIT: Just to clarify, I want this code working for every h2. The number of children nodes/nested children nodes within the h2-node is unknown.
has comment: http://stackoverflow.com/comment/42369150

http://stackoverflow.com/a/26963179
type: Answer
has comment: http://stackoverflow.com/comment/42464519
answers question: http://stackoverflow.com/q/26963130
score: 0
has body: You're giving the element as a parameter. Try onkeypress="validateLetter(this)"

http://stackoverflow.com/comment/42300072
type: Comment
has text: in this case the simplest is to check with a few console.log() if it enters the 1st response, 2nd response and the loop. see a quick edit of the code
comment on: http://stackoverflow.com/a/26853596
score: 0
type: AnswerComment

http://stackoverflow.com/q/26836740
linked to: http://stackoverflow.com/q/11255230
accepted answer: http://stackoverflow.com/a/26852054
possible better answer: http://stackoverflow.com/a/26837692
has title: Meteor.JS Use External Script (on the server)
score: 0
answer count: 3
has body: I'm new to Meteor.JS and trying to use a script on the server. When I needed a script on the client, I just used jQuery's $.getScript(my-script.js) to load it, but on the server, I get a $ is not defined error, presumably because jQuery isn't loaded on the server. How can I achieve a similar result server-side to the $.getScript() call?
tagged with: server
has answer: http://stackoverflow.com/a/26856847
has comment: http://stackoverflow.com/comment/42239515
has comment: http://stackoverflow.com/comment/42242857
has answer: http://stackoverflow.com/a/26852054
tagged with: javascript
type: AnsweredQuestion
tagged with: jquery
tagged with: meteor
has answer: http://stackoverflow.com/a/26837692
type: Question

http://stackoverflow.com/q/26910089
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26910314
score: 0
answer count: 1
has title: Directive Title AngularJS not it works
tagged with: angularjs
has comment: http://stackoverflow.com/comment/42369785
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42369866
has answer: http://stackoverflow.com/a/26910314
has body: I wonder of you with experience in angularJS, it is possible to create a directive for the title of the page. title that he comes from a database and am bringing through the ng-model. however every time I create a directive for him to carry this title for the application to function, as if he could not run the directive. app.directive('titlepage', [function () { return { restrict: 'E', replace: true, templateUrl: 'partials/directives/titlepage.html', scope: { titleapp: '=' } }; }])
type: Question

http://stackoverflow.com/comment/42345840
comment on: http://stackoverflow.com/q/26895834
type: Comment
type: QuestionComment
has text: Something like this?? : http://jsfiddle.net/robertrozas/hvgnzbwq/5/
score: 0

http://stackoverflow.com/a/26864887
has body: jQuery $(document).ready(function() { $("#radio_submit").click(function (e) { var checked_option_radio = $("input[name=user_options]:checked").val(); }); }); Full Code $(document).ready(function() { $("#radio_submit").click(function (e) { var checked_option_radio = $("input[name=user_options]:checked").val(); if(checked_option_radio===undefined){ alert('Please select options!'); }else{ alert("inside else"); $('#valueee').html(checked_option_radio); } }); }); Choose option: 123 CSS 456 html 678 jquery 675 JS Show Selected Radio Check jsFiddle
has comment: http://stackoverflow.com/comment/42317620
has comment: http://stackoverflow.com/comment/42289973
has comment: http://stackoverflow.com/comment/42290106
has comment: http://stackoverflow.com/comment/42290349
has comment: http://stackoverflow.com/comment/42289944
has comment: http://stackoverflow.com/comment/42289474
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/42317998
accepted answer of: http://stackoverflow.com/q/26864784
downvote count: 0
answers question: http://stackoverflow.com/q/26864784
score: 1

http://stackoverflow.com/comment/42376874
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26913573
score: 0
has text: [See here for the difference it makes](http://jsfiddle.net/2vztrqyx/)

http://stackoverflow.com/q/26856737
has answer: http://stackoverflow.com/a/26856789
type: UnansweredQuestion
answer count: 4
has answer: http://stackoverflow.com/a/26856767
type: Question
tagged with: if-statement
tagged with: javascript
has title: if-statement not working with curly brackets
has answer: http://stackoverflow.com/a/26856818
score: 0
has body: Excerpt code: var x=0, direction=1; function fun_1() { var dom_obj=document.getElementById("dir"); x+=direction; if(x&gt;=300 || x&lt;=-300) direction=-direction; dom_obj.style.left=x; window.setTimeout("fun_1();",5); }; This works fine. However, if I add curly brackets in the if statement, it doesn't work. What am I doing wrong? Working, without {} Not working, with {} Your help will be greatly appreciated. Thank you.
has answer: http://stackoverflow.com/a/26856952

http://stackoverflow.com/comment/42374792
comment on: http://stackoverflow.com/a/26911173
has text: David explains the asynchronous nature of Firebase in one of his earlier videos.
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/comment/42405114
type: AnswerComment
score: 0
type: Comment
has text: @user3138436 If it still gets inside the loop it is a bug, but like Jack I doubt it. You should try it in a different browser.
comment on: http://stackoverflow.com/a/26929647

google-fusion-tables
type: Tag
tags question: http://stackoverflow.com/q/26936287
tag name: google-fusion-tables

http://stackoverflow.com/comment/42314000
type: Comment
has text: In *IE v11.0.9600.17358* this does work for me on the input button, but not on the image (I know OP specifically targets IE10, but thought I'd just give a heads up)
comment on: http://stackoverflow.com/a/26874122
score: 1
type: AnswerComment

http://stackoverflow.com/a/26945638
upvote count: 1
has body: You can put the target index on the elements, get them in an array, sort the array on the index, and then rearrange the elements according to the array: var partsOrder = $('#control input').attr("data-order").split(','); var parts = $('#parts'); // set target index for elements $.each(partsOrder, function(i, v){ $('.' + v, parts).data('index', i); }); // sort array on index var items = parts.find('.part'); items.sort(function(a,b){ return $(a).data('index') - $(b).data('index'); }); // move elements into array order parts.append(items); Demo: http://jsbin.com/fejegeyoco/2/edit
score: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26945484
has comment: http://stackoverflow.com/comment/42437298
accepted answer of: http://stackoverflow.com/q/26945484
has comment: http://stackoverflow.com/comment/42437226
type: Answer

http://stackoverflow.com/q/26879115
answer count: 1
has title: Transition on axis -- losing grid lines (ticksize), how to transition in correct order?
accepted answer: http://stackoverflow.com/a/26880463
tagged with: d3.js
has body: I've got a horizontal bar graph with transition on the x-axis. It looks exactly how I want, almost. Sadly, the red gridlines (tickSize(-h)) are in the back. I need to bring them to the front. Code is here: http://bl.ocks.org/greencracker/1cb506e7375a2d825e24 I'm new to transitions and I suspect I'm calling something in the wrong order. Any suggestions on gridlines to front and/or suggestions how to DRY this code? It is fairly not DRY, but I'm starting with easy baby steps. Key parts: d3.csv("georgia_counties_vmt.csv", function(input) { data = input; data.forEach(function(d) { d.value = +d.value; }); data.forEach(function (d) {d.n1 = +d.n1; }) data.sort(function(a, b) { return b.value - a.value; }); x.domain([0, d3.max(data, function(d) { return d.value; })]); y.domain(data.map(function(d) { return d.name; })); initAxes(); // draws tiny axes that transition into proper size change(); // calls redraw() // skip some, then: function redraw() { // unrelated bar drawing stuff here: //calls regular-size axes svg.selectAll("g.y_axis").call(yAxis) svg.selectAll("g.x_axis").call(xAxis) } function initAxes() // initializes axes with range at [0,1] { var initXscale = d3.scale.linear() .range([0, 1]) .domain([0, d3.max(data, function(d) { return d.value; })]); var initXaxis = d3.svg.axis() .scale(initXscale) .tickSize(-h) .orient("top"); svg.append("g") .attr("class", "x_axis") .call(initXaxis); var initYscale = d3.scale.ordinal() .rangeBands([0, 1], 0.1) .domain(data.map(function(d) { return d.name; })); var initYaxis = d3.svg.axis() .scale(initYscale) .orient("left") .tickSize(0); svg.append("g") .attr("class", "y_axis") .call(initYaxis); }
score: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26880463
tagged with: javascript
has comment: http://stackoverflow.com/comment/42315346
type: Question

http://stackoverflow.com/comment/42317986
comment on: http://stackoverflow.com/a/26880902
has text: Why I got a negative feedback? I was trying to help... I don't have enough reputation to do a comment. :(
type: AnswerComment
type: Comment
score: 0

waveform
tag name: waveform
type: Tag
tags question: http://stackoverflow.com/q/26952281

http://stackoverflow.com/comment/42402898
comment on: http://stackoverflow.com/q/26928545
score: 0
type: Comment
type: QuestionComment
has text: what do you mean? Just select something different than `window` then? `$('textarea').resize();`?

http://stackoverflow.com/comment/42429031
has text: Yes, the second argument is a filter to catch dynamic elements by targeting the non-dynamic elements, and it has to be a string. What would be the point of referencing a variable with elements, when the dynamic elements aren't in that variable.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/26942783
score: 0

http://stackoverflow.com/a/26863340
has comment: http://stackoverflow.com/comment/42286907
accepted answer of: http://stackoverflow.com/q/26863246
answers question: http://stackoverflow.com/q/26863246
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42286673
type: Answer
downvote count: 0
score: 1
has body: You need to define the rules as you are upon load. Then upon button click, you can use the valid() method to check the forms' state. $("#btn1").on('click',function(){ if ($("#detailForm").valid()) { // form is fine, send data as needed } else { // form was not valid. Messages should have been shown. } });

http://stackoverflow.com/a/26944029
has body: adding scrolling="no" to the iframe. iFrame tag on page:
type: Answer
has comment: http://stackoverflow.com/comment/42467837
answers question: http://stackoverflow.com/q/26944007
accepted answer of: http://stackoverflow.com/q/26944007
type: AcceptedAnswer
score: 0

http://stackoverflow.com/q/26865419
tagged with: jquery
has answer: http://stackoverflow.com/a/28632892
has body: I'm sorry for the question it maybe easy but I tried many and many with no result, I can't understand the concept of using json with plugin selectize .. I'm trying to load json file contains countries, to display it in select field in my form. I found countries json file on github. this is my js code $('select#country').selectize({ valueField: 'item', labelField: 'item', options: 'countries.json' }); I read plugin usage documentation but i had confused. I need help example of using json or parsing json to object to use it with selectize plugin !
score: 0
tagged with: selectize.js
has comment: http://stackoverflow.com/comment/42318243
accepted answer: http://stackoverflow.com/a/28632892
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has title: using countries json with selectize plugin
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/42250085
has text: There's a `left` and `top` attribute in `style` which has the pixel results of your current picture position (but from bottom right which is (0,0)). You can access it like this: $("#inner").css("left");
type: AnswerComment
comment on: http://stackoverflow.com/a/26839691
score: 1
type: Comment

http://stackoverflow.com/comment/42459000
comment on: http://stackoverflow.com/a/26922661
has text: i have Wordpress running on my website. The thing is that i would like my user to use a javascript application with their login/pass used to authenticate in wordpress (and vanilla forum). From what i undertand, there is no way to check that a user is registered (on wordpres) outside wordpress ?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42493471
score: 0
type: Comment
type: QuestionComment
has text: It's pretty clearly telling you that there's something wrong on style.css.map, line 3, char 1. Have you checked your mapfile?
comment on: http://stackoverflow.com/q/26979433

http://stackoverflow.com/comment/42467865
has text: The `.imagesRotation()` code doesn't do a fade. Unless it has such a feature that you can specify with an option, you will have to change the actual `.imagesRotation()` code to get a fade (not something you can add outside that code). What exact code have you tried so far? FYI, I don't think your issue has anything to do with preload.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26965154
score: 1

http://stackoverflow.com/comment/42317226
type: Comment
has text: I want the links to wrap inside the container. I don't want the container to change. If you view the fiddle you can see the desired result below the overflow.
comment on: http://stackoverflow.com/a/26880529
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42516004
score: 0
type: AnswerComment
type: Comment
has text: I missed that right brace as well. I fixed that and the action seems to work but it is displayed completely wrong now and when I click on one of the radio buttons, it now gives me a dropdownlist with every option being completely blank. I'm going to try to put a screenshot on here
comment on: http://stackoverflow.com/a/26991774

http://stackoverflow.com/q/26858448
has answer: http://stackoverflow.com/a/26858916
type: AnsweredQuestion
has title: How to set the scrolltop() method to the sliding div?
has comment: http://stackoverflow.com/comment/42279094
type: Question
has comment: http://stackoverflow.com/comment/42278201
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/26858916
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/42413176
has body: I have a sliding div, or we can say that its a on click expand and collapse div(toggle). I want to apply the .scrollTop() to the div. when the button is clicked to expand the div before expand set to top, and then expand. I tried it more then hundreds times with different ways but i unable to get the desired result. Any help will be appreciated. Click me var currentscrollpos; currentscrollpos = $(window).scrollTop(); $(document).ready(function(){ $(".slidingDiv").hide(); $(".show_hide").show(); $('.show_hide').click(function(){ $(".slidingDiv").slideToggle(); $('body').animate({scrollTop:100}, 'slow') return false; }); }); $(document).click(function() { $('body').animate({ scrollTop: currentscrollpos }, 0); }); //This is my css #mainarea{width:550px; height:300px;background-color: yellow;} .slidingDiv { height:200px; background-color: white; margin-top:10px; width:261px; background-color: black; } .show_hide { display:none; } #notificationFooter { background:#FFFFFF; margin:0 auto; height:8px; width:96px; } This is the fiddle http://jsfiddle.net/muheetmehfooz/wmwn5424/
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/a/26966975
has comment: http://stackoverflow.com/comment/42471300
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42471212
has comment: http://stackoverflow.com/comment/42471141
type: Answer
has comment: http://stackoverflow.com/comment/42471421
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/26966833
has comment: http://stackoverflow.com/comment/42471073
has body: You could use data-attributes for this one: Define your buttons like that: Open Close And your open/close-code like that: $('.openButton').click(function() { var personNumber = $(this).attr("data-person"); $('.person'+personNumber+"-profile").fadeIn(); }); $('.closeButton').click(function() { var personNumber = $(this).attr("data-person"); $('.person'+personNumber+"-profile").fadeOut(); }); In action: http://jsfiddle.net/ndx4fn9n/
answers question: http://stackoverflow.com/q/26966833
has comment: http://stackoverflow.com/comment/42470970

http://stackoverflow.com/a/26857867
downvote count: 0
score: 4
type: Answer
answers question: http://stackoverflow.com/q/26837522
accepted answer of: http://stackoverflow.com/q/26837522
has body: See my test structure in we.js: https://github.com/wejs/we-example/tree/master/test You can copy and paste in you sails.js app and remove we.js plugin feature in bootstrap.js And change you package.json to use set correct mocha command in npm test: https://github.com/wejs/we-example/blob/master/package.json#L10 -- edit -- I created a simple sails.js 0.10.x test example, see in: https://github.com/albertosouza/sails-test-example
has comment: http://stackoverflow.com/comment/42279757
upvote count: 4
type: AcceptedAnswer

http://stackoverflow.com/a/70259132
has body: Okay I'm late to the party but hope I should be able to add some value here. My TypeScript implementation in an Angular app to handle WebSocket Connection lost. This does not use PING PONG strategy in order to avoid keeping server busy all the time. This starts attempting to establish connection only after a connection is lost and keep trying after every 5 seconds till its connected successfully. So here we go: export class WebSocketClientComponent implements OnInit { webSocket?: WebSocket; selfClosing = false; reconnectTimeout: any; ngOnInit(): void { this.establishWebSocketConnection(); } establishWebSocketConnection() { this.webSocket = new WebSocket('YourServerURlHere'); this.webSocket.onopen = (ev: any) =&gt; { if (this.reconnectTimeout) { clearTimeout(this.reconnectTimeout); } } this.webSocket.onclose = (ev: CloseEvent) =&gt; { if (this.selfClosing === false) { this.startAttemptingToEstablishConnection(); } } } private startAttemptingToEstablishConnection() { this.reconnectTimeout = setTimeout(() =&gt; this.establishWebSocketConnection(), 5000); } } And thats it. If you want to close websocket connection at some point set selfClosing = true. This would stop attempting to reconnect again. Hope this helps. I'm sure, same code can be used in native JS as well.
score: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/129909488
type: Answer
answers question: http://stackoverflow.com/q/26971026

http://stackoverflow.com/comment/42398891
score: 0
type: Comment
type: QuestionComment
has text: My question is not whether this is a good practice or bad practice. Even if it is a bad, doomed, unpleasant, ridiculous, useless pattern, unclean, dirty, and just plain wrong -- it still deserves a name to be referred to.
comment on: http://stackoverflow.com/q/26925812

http://stackoverflow.com/q/26954389
has comment: http://stackoverflow.com/comment/42454006
has comment: http://stackoverflow.com/comment/42469142
type: Question
has body: I'm can't access the value of the select in the controller when the select is inside an ng-repeat. Here is the sample of Html (Everything display properly): Choose </options> `` In the controller, inside the function haha() I try to get the value of the selected dropdown: $scope.haha = function(index){ console.log(index); console.log($scope.detail); } The first console.log always show 0 The second console.log always shows undefined Can someone tell me how to access the value of a select inside a nested from a controller. ? Thanks
tagged with: javascript
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/42469118
score: 0
has answer: http://stackoverflow.com/a/26954438
answer count: 1
has comment: http://stackoverflow.com/comment/42469153
tagged with: angularjs
has comment: http://stackoverflow.com/comment/42448715
type: UnansweredQuestion
has title: Angularjs - Access the value of dropdown in a nested ng-repeat

http://stackoverflow.com/q/26836306
score: 8
downvote count: 0
tagged with: javascript
favorite count: 0
upvote count: 8
has title: Ensuring that the value returned by Window.prompt contains only letters
has answer: http://stackoverflow.com/a/26836368
possible better answer: http://stackoverflow.com/a/26836347
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26837281
has answer: http://stackoverflow.com/a/26836347
answer count: 5
type: Question
has body: I'm trying to check to see if user input assigned to a variable can be checked to make sure it is a string, and not a number. I've tried using typeof(), but no matter what, the user input is tagged as a string, even if the user enters a number. For example: var x = prompt("Enter a string of letters"); var y = typeof x; if (y !== "string") { alert("You did not enter a string"); } Is there something I could use that's similar to the NaN function, but for strings?
has answer: http://stackoverflow.com/a/26836360
has answer: http://stackoverflow.com/a/26836342
accepted answer: http://stackoverflow.com/a/26837281

ebnf
type: Tag
tags question: http://stackoverflow.com/q/26899381
tag name: ebnf

http://stackoverflow.com/a/26868913
type: Answer
has comment: http://stackoverflow.com/comment/42297495
has comment: http://stackoverflow.com/comment/42297285
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/26868667
has comment: http://stackoverflow.com/comment/42297626
answers question: http://stackoverflow.com/q/26868667
type: AcceptedAnswer
downvote count: 0
has body: Can you try just this one. I think it should work. Please let me know. If not then you have to change convert_accented_characters function. var emailad = (convert_accented_characters(firstname) + "." + convert_accented_characters(lastname) + "@superenterprisecompany.com")

http://stackoverflow.com/comment/42369065
has text: makes sense since months have varying number of days..
comment on: http://stackoverflow.com/q/26909477
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/26865768
has body: I'm dealing with the calling classes with document write. I defined two classes in CSS. First is "sahovnica" (chessboard) and second are "svetlo" (light) and "temno"(dark). With both classes I defined style for my table. And then I wanted to built a table with: document.write( document.write(' ');); Tried many different ways, but my code don't works. If I comment document.write(), page show up. Šahovska partija 2014
has answer: http://stackoverflow.com/a/26865844
type: AnsweredQuestion
type: Question
tagged with: javascript
tagged with: document.write
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/26865887
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/2360076
tagged with: css
has comment: http://stackoverflow.com/comment/42290872
has title: JS: document.write (calling CSS)
has answer: http://stackoverflow.com/a/26866237
accepted answer: http://stackoverflow.com/a/26866237
possible better answer: http://stackoverflow.com/a/26865844

http://stackoverflow.com/q/26890938
has title: Class in dynamic version doesn't work
has answer: http://stackoverflow.com/a/26891626
has comment: http://stackoverflow.com/comment/42336064
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42335869
possible better answer: http://stackoverflow.com/a/26891036
has answer: http://stackoverflow.com/a/26891044
accepted answer: http://stackoverflow.com/a/26891044
type: Question
score: 0
has body: I have a problem. when i click on my link in the static version: + the page and the javascript function works perfectly. BUT, when i make a dynamic content: the effect doesn't work correctly. doesn't work correctly, because i got a new window. in the static version the page of the link open in a part of my page. the problem must be, that the class doesn't work in the dynamic version. Has someone a solution? Please. Thanks in advance!!
tagged with: addclass
tagged with: javascript
tagged with: jquery
answer count: 3
has comment: http://stackoverflow.com/comment/42336001
has answer: http://stackoverflow.com/a/26891036

http://stackoverflow.com/a/26961565
answers question: http://stackoverflow.com/q/26961525
has comment: http://stackoverflow.com/comment/42461408
score: 0
type: Answer
has body: Use .prev() to get the previous ul element. If the index is less than 0 change its value to the "no. of li elements - 1 and change $('ul.target li a') to $('.target'): Fiddle $('.target').on('click', function() { var index = $(this).prev().index(); index = index &lt; 0 ? $('ul').length-1 : index; alert(index); return false; }); Or if you don't want to change $('ul.target li a') you can do the following: Fiddle $('ul.target li a').on('click', function() { var index = $(this).parent().parent().prev().index(); index = index &lt; 0 ? $('ul').length-1 : index; alert(index); return false; });
has comment: http://stackoverflow.com/comment/42461460
has comment: http://stackoverflow.com/comment/42461420

http://stackoverflow.com/comment/42505013
type: AnswerComment
comment on: http://stackoverflow.com/a/26977341
has text: thank you! @user2758326 I applied your code and now my page no longer scroll downward (yay!) but also no longer scrolls horizontally... what can I do to fix that? also to clarify, I want to be able to scroll each of the 98 divs individually while the window remains in the same position. I also want to be able to scroll horizontally to access all 98 divs. thanks so much for your help!
type: Comment
score: 0

http://stackoverflow.com/q/26911152
has body: I have the following code and I need to create a button to reverse the moving direction everytime the user clicks on it. I need some help, please. var div_width = 87; var div_count = 15; var reset_offset = div_width * (div_count -1); function init() { // Set initial position - note that the first div will // be off the lefthand side for(i=0;i&lt;div_count;i++) { var foo = document.getElementById('fooObject' + i); foo.style.left = ''+(i*div_width)+'px'; } doMove(); } function doMove() { for(i=0;i&lt;div_count;i++) { var foo = document.getElementById('fooObject' + i); var left = parseInt(foo.style.left); foo.style.left = '' + (left+1) + 'px'; if (left &gt;= reset_offset) { foo.style.left = '' + (-div_width) + 'px'; } } setTimeout(doMove, 20); } init(); Thank you! More detailed here: http://jsfiddle.net/usjpzcbq/
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: reverse
tagged with: carousel
has title: Reverse carousel javascript
answer count: 0
type: UnansweredQuestion
tagged with: loops
upvote count: 1
type: Question
score: 1

http://stackoverflow.com/comment/42264948
score: 0
has text: kinds. It's just so funny that the progressbar disappeared so fast just it showed 1 second I can see you put show 5000, 5 second,but I have another one in front of it. see the code. I have to hide the progress bar before calender date selected.
type: Comment
comment on: http://stackoverflow.com/a/26850733
type: AnswerComment

http://stackoverflow.com/a/26859951
answers question: http://stackoverflow.com/q/26859621
score: 0
type: Answer
has body: To restate what was already suggested in the comments: In order of execution: handler2() handler1() handler3()

http://stackoverflow.com/comment/42265592
has text: I really would go "back to square one" on this and change the approach. If I get time I'll create a Proof of Concept for you.
comment on: http://stackoverflow.com/q/26850517
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26870701
type: Answer
answers question: http://stackoverflow.com/q/26861110
has body: Use CSS position property : horizontal fixed ,vertical relative .scroll_fixed { position:absolute; } See a working example
score: 0

http://stackoverflow.com/q/26887038
has comment: http://stackoverflow.com/comment/42328629
has answer: http://stackoverflow.com/a/26887120
has body: I want to get the ID of clicked element. The element is not created initially, but later. $(document).on('click', '.sub_nav_node', function(event) { var name = event.target.id + "|Screen" alert(name); }); so basically the "event.target.id" is not working for me. I tried the following solutions I found on stack overflow: $(event.target).id $(event.target)[0].id event.target.id this.id $(this).id I always used $ ( this ), however i cannot use it in this context since $( ".sub_nav_node" ).click() doesnt work, because the elements are not availalbe initally...
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
score: -1
has comment: http://stackoverflow.com/comment/42328799
accepted answer: http://stackoverflow.com/a/26887120
type: AnsweredQuestion
tagged with: dom
downvote count: 1
has comment: http://stackoverflow.com/comment/42328502
type: Question
has title: Get ID of clicked Object which has been created later
tagged with: javascript

http://stackoverflow.com/a/26931131
has body: There is a flaw in your logic. Inside the loop you are repeatedly overwriting the string variable: string = product_name.replace(...) At the end of loop you will have "Color green".replace("blue", " ") -> "Color green". Change these lines: var string; // ... string = product_name.replace(jQuery(this).attr('title').trim(),' '); To these: var string = product_name; // ... string = string.replace(jQuery(this).attr('title').trim(),' '); Updated Fiddle Having said all that, I would rather change the markup to this: Color green And overwrite the contents of .chosen-color instead of get/match/replace the entire text inside .h1. Your jQuery code will be reduced to one line.
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/26930994
score: 2
answers question: http://stackoverflow.com/q/26930994

http://stackoverflow.com/q/26832702
has title: Jquery autocomplete font: change font in the box
tagged with: fonts
type: Question
has body: I am new to jquery. I am exploring the autocomplete feature of jquery. I was able to change the font of the dropdown list, but while I am unale to change the font of the field itself. How do I change that? Thank you. .ui-autocomplete.ui-widget { font: 400 1.5em/125% 'Sofia', Helvetica, Sans-serif; cursor: default; height: 200px; overflow-y: scroll; } .ui-autocomplete.ui-menu{ font: 400 1.5em/125% 'Sofia', Helvetica, Sans-serif; } #input autocomplete { font: 400 1.5em/125% 'Sofia', Helvetica, Sans-serif; } .input{ font: 400 1.5em/125% 'Sofia', Helvetica, Sans-serif; }
has answer: http://stackoverflow.com/a/26845611
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/42335752
has text: I freehanded my example. The above code works for ID (I just double checked and indeed misstyped the example.)
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26890774

http://stackoverflow.com/q/26890877
answer count: 1
tagged with: momentjs
tagged with: angularjs
has answer: http://stackoverflow.com/a/26891338
accepted answer: http://stackoverflow.com/a/26891338
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42335926
has title: Issue when adding momentJS objects in AngularJS
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/42336158
has body: I have an object that looks like this: var carsDict = { 391: [ { arrival: "17.43.49", car: "391", date: "11/11/2014", duration: "00:00:06", time: "17.43.43" } ], 396: { 0: { arrival: "17.20.48", car: "396", date: "11/11/2014", duration: "00:00:11", time: "17.20.37", }, 1: { arrival: "17.21.27", car: "396", date: "11/11/2014", duration: "00:00:17", time: "17.21.10" } } }; The duration property is a MomentJS object constructed by the following line: record.duration = moment.utc(moment(record.arrival,'HH:mm:ss') .diff(moment(record.time,'HH:mm:ss'))).format("HH:mm:ss"); The next step is to add all duration objects from each array together. I get to do that by using the following piece of code: for (record in carsDict) { var totalduration = ''; for (item in carsDict[record]) { // get totalduration figured out.. totalduration += moment.utc(carsDict[record][item].duration, 'HH:mm:ss'); } for (item in carsDict[record]) { // now add totalduration to each record carsDict[record][item]['totalduration'] = totalduration; } }; Given the example above, the totalduration for the first array should be "00:00:06" and for the second "00:00:28" ("00:00:11" + "00:00:17"), but I'm getting other results, 1415750406000 for the first one, and 14157504110001415750417000 for the second one. I assume the error is in this line, but I can't see exactly why is not adding the moment() objects correctly. totalduration += moment.utc(carsDict[record][item].duration, 'HH:mm:ss'); Here's a JSFiddle. Any idea about what am I doing wrong?
score: 0

http://stackoverflow.com/q/26939033
has answer: http://stackoverflow.com/a/26939154
answer count: 5
has body: I'm working with a results api that gives me a JSON file. With this, I need to go over the file and look for a specific property. So I push the JSON into an empty array, loop over that, and get the first object. That works great. Where I'm a bit stumped is inside of the array, all the objects from the JSON file are stored in one large object. So naturally I figured I would have to then loop over that object to get inside of it, but when I try, I get nothing back. Do I need an additional loop for this? I'll include all I can below. Also, I searched high and low for a solution to this, so apologies if this is a duplicate. If that's the case I am more than happy with a simple link to read. Thanks for your help. JSON: { "0":{ "person_id":"001583133371", "source":"lexis", "phone_number":"", "first_name":"Brian", "middle_name":"JOSEPH", "last_name":"Name", "aliases":[ { "first_name":"B", "middle_name":"", "last_name":"Name" }, { "first_name":"Brianj", "middle_name":"", "last_name":"Name" }, { "first_name":"Brian", "middle_name":"J", "last_name":"Name" }, { "first_name":"Brian", "middle_name":"J", "last_name":"Name" } ], "street":"", "city":"Newbury Park", "state":"CA", "zip":"91320", "priorAddresses":[ { "street":"", "city":"Sacramento", "state":"CA" }, { "street":"", "city":"Las Cruces", "state":"NM" }, { "street":"", "city":"Big Bear Lake", "state":"CA" }, { "street":"", "city":"Camarillo", "state":"CA" } ], "age":56, "dob":"1958\/11\/01", "yob":"1958", "relatives":[ { "first_name":"SHARON", "middle_name":"J", "last_name":"Name", "person_id":"001583349299" }, { "first_name":"COREY", "middle_name":"D", "last_name":"Name", "person_id":"036454253754" }, { "first_name":"KATHLEEN", "middle_name":"", "last_name":"Name", "person_id":"003096670145" }, { "first_name":"KELSEY", "middle_name":"MAYER", "last_name":"Name", "person_id":"080603146279" } ], "middle_initial":"J.", "gender":"m", "f_phone_number":"N\/A", "f_relatives":"Sharon Name Corey Name Kathleen Name Kelsey Name", "a…
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/26939065
type: Question
has answer: http://stackoverflow.com/a/26939615
has answer: http://stackoverflow.com/a/26939234
accepted answer: http://stackoverflow.com/a/26939234
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/26939596
score: 0
has title: Looking for object properties in JSON file
possible better answer: http://stackoverflow.com/a/26939065

http://stackoverflow.com/a/26949842
answers question: http://stackoverflow.com/q/26948516
has comment: http://stackoverflow.com/comment/84793273
score: 9
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 9
accepted answer of: http://stackoverflow.com/q/26948516
has body: Did you double-check your login credentials? Also did you double-check your "from" adress to match your email? I used the nodemailer for some tests 3 weeks ago with the gmail example given on the github page and it worked like a charm: https://github.com/andris9/Nodemailer Invalid login indicates mistyped/wrong credentials.

http://stackoverflow.com/q/26983356
answer count: 1
has comment: http://stackoverflow.com/comment/42500823
accepted answer: http://stackoverflow.com/a/26983403
tagged with: parse-platform
type: AnsweredQuestion
has title: Parse Query "Cannot call method 'equalTo' of undefined"
type: Question
has body: I am trying to send an email parameter in the format {"email":"test@example.com"} to my Parse Cloud code, but when I do, I get the following error: Failed with: TypeError: Cannot call method 'equalTo' of undefined at main.js:19:8 Here is my code (in main.js, starting on line 16): Parse.Cloud.define("searchFriendViaEmail", function(request, response) { console.log(request.params); var query = Parse.Query("_User"); query.equalTo("email", request.params.email); query.find({ success: function(results) { response.success(results[0]); }, error: function() { response.error("user lookup failed"); } }); }); Can anyone tell me what's going wrong?
has answer: http://stackoverflow.com/a/26983403
tagged with: javascript
score: 0
tagged with: types

http://stackoverflow.com/comment/42265693
type: QuestionComment
comment on: http://stackoverflow.com/q/26850517
has text: i'm getting close but did not manage to fix the Jquery
score: 0
type: Comment

http://stackoverflow.com/a/26943268
has body: You can use built-in DOMParser awesome topic and solution by MJ Saedy: https://stackoverflow.com/a/23207820/1828637 documenation on it here: https://developer.mozilla.org/en-US/docs/Web/API/DOMParser?redirectlocale=en-US&amp;redirectslug=DOM%2FDOMParser I'm not sure how to do this from XPCOM though but there has to be a way. edit: found out how to do it from XPCOM and addon-sdk. do it like this: var DOMParser = Cc["@mozilla.org/xmlextras/domparser;1"].createInstance(Ci.nsIDOMParser); see here for addon sdk details: https://stackoverflow.com/a/9172947/1828637 111 /** 112 * Parse the given string into a DOM tree 113 * 114 * @param str The string to parse 115 * @param docUri (optional) The document URI to use 116 * @param baseUri (optional) The base URI to use 117 * @return The parsed DOM Document 118 */ 119 cal.xml.parseString = function(str, docUri, baseUri) { 120 let parser = Components.classes["@mozilla.org/xmlextras/domparser;1"] 121 .createInstance(Components.interfaces.nsIDOMParser); 122 123 parser.init(null, docUri, baseUri); 124 return parser.parseFromString(str, "application/xml"); 125 }; http://mxr.mozilla.org/comm-central/source/calendar/base/modules/calXMLUtils.jsm#120
answers question: http://stackoverflow.com/q/26942592
accepted answer of: http://stackoverflow.com/q/26942592
type: AcceptedAnswer
score: 0
type: Answer

http://stackoverflow.com/q/26925609
has comment: http://stackoverflow.com/comment/42399354
has comment: http://stackoverflow.com/comment/42397645
tagged with: menu
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42397825
upvote count: 2
tagged with: mmenu
has title: How to make the mmenu default expanded
has answer: http://stackoverflow.com/a/26926602
type: Question
accepted answer: http://stackoverflow.com/a/26926602
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I am using Jquery mmenu for my application. My menu contains sub menus. Sub menus are expanded only when user clicks on the main menu item. I want that expanded by default when user clicks on the menu button. How is this possible? I have initialized as follows. $(document).ready(function () { console.log('mmenu loading'); $("#menu").mmenu({ slidingSubmenus: false }); }); Any help is really appreciated. Thank You

http://stackoverflow.com/q/26977821
has comment: http://stackoverflow.com/comment/42490406
tagged with: pagination
type: Question
has body: I've been following a pretty in depth tutorial on PHP pagination using Ajax and JQuery and I'm trying to modify it in such a way that I can show a next button in the pagination tabs. This is the code I use to generate the pagination bar: $results = mysqli_query($connecDB,"SELECT COUNT(*) FROM paginate"); $get_total_rows = mysqli_fetch_array($results); //total records $pages = ceil($get_total_rows[0]/$item_per_page); //create pagination if($pages > 1) { $pagination = ''; $pagination .= ' '; for($i = 1; $i<=$pages; $i++) { $pagination .= ' '.$i.' '; } $pagination .= ' >> ';//Next $pagination .= ' '; } Following this I then wait until the document is ready and run this script: $(document).ready(function() { $("#results").load("fetch_pages.php", {'page':0}, function() { $("#1-page").addClass('active'); }); $(".paginate_click").click(function (e) { $("#results").prepend(' Loading... '); var clicked_id = $(this).attr("id").split("-"); var page_num = parseInt(clicked_id[0]); $('.paginate_click').removeClass('active'); $("#results").load("fetch_pages.php", {'page':(page_num-1)}, function(){ }); $(this).addClass('active'); return false; }); }); This is the html: <?php echo $pagination; ?> It then outputs a list of results and a pagination bar below them and it is working perfectly. The issue I'm having is how I could include a "Next" button? I'm currently working on this so any new code I try I'll post into this question. Would appreciate any help.
answer count: 2
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/26978249
has comment: http://stackoverflow.com/comment/42490315
type: UnansweredQuestion
tagged with: php
has title: PHP Pagination Next button in existing Code
has answer: http://stackoverflow.com/a/26978019

http://stackoverflow.com/comment/42436190
type: QuestionComment
has text: I get min is not a function because I don't know what type s and e are that's passed to the Interval constructor. Nor does your code show what type is returned by min and max. The code should work if you create instances: `var one = new Interval(?,?);...one['*='](two)` The problem doesn't seem to be with the prototype function but with the passed arguments to the prototype function or the returned value of min and max.
comment on: http://stackoverflow.com/q/26942633
score: 0
type: Comment

http://stackoverflow.com/a/26956999
score: 1
accepted answer of: http://stackoverflow.com/q/26956951
downvote count: 0
has body: In your Main page, of course have that link that will open then child (other) file: Open new window Then on that other file: Redirect Parent to google.com Of course change that value of google.com to that other value that you desire.
answers question: http://stackoverflow.com/q/26956951
type: AcceptedAnswer
type: Answer
upvote count: 1

http://stackoverflow.com/comment/42411610
comment on: http://stackoverflow.com/a/26933037
score: 0
type: AnswerComment
has text: Can you access rootscope from an angular expression?
type: Comment

http://stackoverflow.com/q/26911622
has answer: http://stackoverflow.com/a/26911878
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42373032
downvote count: 1
has comment: http://stackoverflow.com/comment/42372767
score: -1
has comment: http://stackoverflow.com/comment/42374718
type: Question
linked to: http://stackoverflow.com/q/2450954
answer count: 2
has title: How to display a div with random ID without repeating it using jQuery?
has comment: http://stackoverflow.com/comment/42376747
has comment: http://stackoverflow.com/comment/42372860
has body: I have a function to select a random number from 0 to 45 and then I show the div with the specific ID. It's working fine but it repeats a number. Can anyone advise so it won't repeat numbers? I call the function onclick like this $(".skip").click(function () { scared++; $("#counter").html("My current count is: " + dared); var d = 50; /*$(".question").addClass("hideMe"); $(this).parents("div").next("div").removeClass("hideMe");*/ var r = Math.round(Math.random() * 44) + 1; var newquestion = "q" + r; $('.active').removeClass("active"); $("#" + newquestion).addClass("active"); if (scared &gt; 44) { $('.main').fadeOut('fast'); $('.logo').switchClass("logo", "share"); $('.progress').css("display", "none"); $('.share-game').css("display", "block"); $('.hero').css("right", "-240px"); $('#score-total').html(score + ''); } else { } $('.red-line').append('&lt;div id="children' + (d++) + '" class="red"&gt;&lt;/div&gt;'); return false; });
upvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26911806

http://stackoverflow.com/q/26972009
favorite count: 0
tagged with: cmis
answer count: 0
upvote count: 2
type: UnansweredQuestion
score: 2
type: Question
has title: Build up correct form Data
has body: I am attempting to preform File Upload with Kendo UI. The file is stored in an ECM which I upload to with CMIS utilizing Browser Binding. My original AJAX function which is working is like: $.ajax({ url: 'MY CMIS URL', type: 'POST', data: new FormData($('#myForm')[0]), processData: false, contentType: false, success: function () { alert("Document Uploaded"); }, error: function (xhr, ajaxOptions, thrownError) { alert(xhr.status + " " + thrownError); } }); So my form has CMIS properties on it - this successfully gets added to my Request when I look at fiddler - as shown: However now I am using Kendo UI for upload and the code is as below: $("#target").kendoUpload({ multiple: false, async: { saveUrl: 'MY CMIS URL', autoUpload: true, withCredentials: false, }, upload: function (e) { $('#propertyValue_0_').val(e.files[0].name); // e.data = new FormData($('#uploadForm')[0]); - did not work var formData = $('#uploadForm').serializeArray(); e.data = formData; } }); First I had the data set similar to my AJAX call but this did not work. Doing a serialize and setting e.data = formData; is closer to what I need. When I check the fiddler request I see the below: If I set a breakpoint in Dev Tools I can see that formData variable contains the array of objects with the name and value as "cmisaction" "createDocument" and the same for the rest of the propeties but instead in my fiddler trace I am geting name="0" and [Object Object] sent. How can I correctly set e.data to the name and values in formData?
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
tagged with: kendo-ui

http://stackoverflow.com/comment/42517105
score: 0
comment on: http://stackoverflow.com/q/26978841
type: Comment
type: QuestionComment
has text: @davidkonrad Ok. So the answer here is 'it's not possible', right?

http://stackoverflow.com/q/26888912
tagged with: facebook
type: Question
tagged with: javascript
score: 0
has body: I want to use Facebook Authorization JavaScript SDK with AngularJS. Here is my service file: carApp.factory('facebook', function($window) { return $window.FB; //OR // return FB; }); window.fbAsyncInit = function() { FB.init({ appId : '**************', cookie : true, // enable cookies to allow the server to access the session xfbml : true, // parse social plugins on this page version : 'v2.1' // use version 2.1 }); } // Load the SDK Asynchronously (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&amp;appId=***********&amp;version=v2.0"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); And I get the following error in console; Uncaught ReferenceError: FB is not defined And it point on this line: FB.init({ How can I fix this issue?
has comment: http://stackoverflow.com/comment/42334586
has comment: http://stackoverflow.com/comment/42397929
has title: FB is not defined using AngularJS with Facebook JS SDK?
answer count: 0
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/a/26839594
answers question: http://stackoverflow.com/q/26839559
has comment: http://stackoverflow.com/comment/42243626
upvote count: 1
score: 0
has body: use $scope.$apply(); like below $timeout(function() { $scope.nodes = { 1:{node_id:1, text:'foo text', parent_id:null, child_ids:[2,3]}, 2:{node_id:2, text:'bar text', parent_id:1, child_ids:[]}, 3:{node_id:3, text:'abc text', parent_id:1, child_ids:[]} } $scope.top_ids = [1]; $scope.$apply(); }, 1000) or you can wrap model changes like below, $timeout(function() { $scope.$apply(function () { $scope.nodes = { 1:{node_id:1, text:'foo text', parent_id:null, child_ids:[2,3]}, 2:{node_id:2, text:'bar text', parent_id:1, child_ids:[]}, 3:{node_id:3, text:'abc text', parent_id:1, child_ids:[]} } $scope.top_ids = [1]; }); }, 1000) here is a good demo, Here is the working plunker if you change any model outside of the Angular context, then you need to inform Angular of the changes by calling $apply() manually..... For example, if you use JavaScript’s setTimeout() function to update a scope model, Angular has no way of knowing what you might change. In this case it’s your responsibility to call $apply() manually
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/42243757

http://stackoverflow.com/q/26837230
has title: Disable form submit button untill required field is not populated
has answer: http://stackoverflow.com/a/26837394
has comment: http://stackoverflow.com/comment/42239869
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26837450
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/26837450
tagged with: jquery
has body: Hello I have below form to validate. Form has three text box and checkbox i want to validate form like all three text box is not empty and from check box atleast one of them must be selected for enable form submit button I hava tried below jquery but it not valdate form. <form id="cadandrivit" name="cadandrivit" method="post" action="<?php echo $this->getUrl('revitgallery/index/download')?>"> *Name: *Company Name: *Email: Artesian - Revit Campaspe - Revit Glacier Frameless - Revit Oxbow - Revit Tanaro - Revit Amazon - Revit Atlantic - Revit Niagara - Revit Panama - Revit Miami - Revit Download
accepted answer: http://stackoverflow.com/a/26837394
has comment: http://stackoverflow.com/comment/42240003
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/42316869
comment on: http://stackoverflow.com/q/26839239
score: 0
has text: possible duplicate of [How do I display image in Alert/confirm box in Javascript?](http://stackoverflow.com/questions/19659173/how-do-i-display-image-in-alert-confirm-box-in-javascript)
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42479906
type: Comment
comment on: http://stackoverflow.com/a/26971649
score: 0
type: AnswerComment
has text: Just last one clarification,if you start in doSomething function you should call to the next function in the chain inside the then ? always ,and if you should send parameters from one to another how should I do that?can you please provide example?

http://stackoverflow.com/q/26861465
linked to: http://stackoverflow.com/q/25093905
favorite count: 0
possible better answer: http://stackoverflow.com/a/26861700
has body: I have following PHP code where 4 buttons are displaying dynamically from database table. Different content is displaying on page based on clicked button. Now, I want to do so when I click 1st button then button bg color should be changed so visitor can know which button is pressed. When 2nd button is clicked then bg color of that button should be changed and previously clicked button (1st button in this example) should be restored with original color. Please let me know easiest way to do this using either CSS or Javascript. &lt;form name="frm_list" action="toptipper.php" method="post" enctype="multipart/form-data"&gt; &lt;?php while(!$rs_tab_list-&gt;eof()) { ?&gt; &lt;button type="submit" name="btn_tab" value="&lt;?php print($rs_tab_list-&gt;fields("tabpkid")); ?&gt;"&gt;&lt;?php print($rs_tab_list-&gt;fields("title")); ?&gt;&lt;/button&gt; &lt;?php $rs_tab_list-&gt;movenext(); } ?&gt; &lt;/form&gt;
answer count: 9
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/39402149
tagged with: php
tagged with: css
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26861689
has title: HTML - How to change button background color on OnClick event
has answer: http://stackoverflow.com/a/26861781
has answer: http://stackoverflow.com/a/26861700
type: Question
has answer: http://stackoverflow.com/a/26861513
has answer: http://stackoverflow.com/a/26862465
tagged with: javascript
has answer: http://stackoverflow.com/a/26861737
upvote count: 2
has answer: http://stackoverflow.com/a/26862268
has answer: http://stackoverflow.com/a/26861723
accepted answer: http://stackoverflow.com/a/26862268
downvote count: 0

http://stackoverflow.com/a/26838785
upvote count: 5
accepted answer of: http://stackoverflow.com/q/26837424
has body: I would recommend putting your code in a module factory function like this: var context_blender_factory = function(CanvasRenderingContext2D) { var defaultOffsets = { // ... }; // Applies to the parameter passed to the module factory function CanvasRenderingContext2D.prototype.blendOnto = // ... // ... } This essentially abstracts away where do you get your CanvasRenderingContext2D. Then, after declaring your function you could write the initialization routine where you check your environment and call the module factory accordingly. If you just want to consider pure NodeJS, this would be something like: if (typeof require === 'function') { // Assume NodeJS environment context_blender_factory(require('canvas').Context2d); } else if (window &amp;&amp; window.CanvasRenderingContext2D &amp;&amp; window.CanvasRenderingContext2D.prototype.getImageData) { // Assume browser environment context_blender_factory(window.CanvasRenderingContext2D); } This pattern would also allow supporting AMD-style module environments like RequireJS or amdefine. Backstory I had a similar situation with my JS library (see the backstory below). I have initially implemented my library for the browser. Then people started asking if it could work in NodeJS. That was not hard at all as Node had all the relevant modules to mimic/implement functions just as in browser. So I have added require/export constructs for NodeJS. Then some other people started asking about RequireJS/AMD-style module support. I have asked around: How to write a module that works with Node.js, RequireJS as well as without them And finally arrived to the following solution to support browser, NodeJS, RequiredJS/AMD/amdefine.
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/42265128
answers question: http://stackoverflow.com/q/26837424
has comment: http://stackoverflow.com/comment/42258045
has comment: http://stackoverflow.com/comment/42490613
score: 5

http://stackoverflow.com/comment/42424859
score: 1
has text: ` ` is not for URLs. If you have an URL, use ` ` (HTML5) or plain ` `. Send the URL unchanged to the server, and let the server download it. If you in fact have a *file* (and not a file URL) in a ` ` element, you'll use `FormData` to get the file contents into the AJAX request; you will also have to handle them at serverside, which is very language-dependent.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26940360

http://stackoverflow.com/comment/42415764
comment on: http://stackoverflow.com/q/26921489
score: 0
type: Comment
type: QuestionComment
has text: Hi @Squint, Thanks for your quick replay. I have used classList.js polyfill but still its not working. Let me know if there is any other way to fix this.

http://stackoverflow.com/a/26877809
upvote count: 0
has body: var words = (function(){ var sWords = document.body.innerText.toLowerCase().trim().replace(/[,;.]/g,'').split(/[\s\/]+/g).sort(); var iWordsCount = sWords.length; // count w/ duplicates // array of words to ignore var ignore = ['and','the','to','a','of','for','as','i','with','it','is','on','that','this','can','in','be','has','if']; ignore = (function(){ var o = {}; // object prop checking &gt; in array checking var iCount = ignore.length; for (var i=0;i&lt;iCount;i++){ o[ignore[i]] = true; } return o; }()); var counts = {}; // object for math for (var i=0; i&lt;iWordsCount; i++) { var sWord = sWords[i]; if (!ignore[sWord]) { counts[sWord] = counts[sWord] || 0; counts[sWord]++; } } var arr = []; // an array of objects to return for (sWord in counts) { arr.push({ text: sWord, frequency: counts[sWord] }); } // sort array by descending frequency | http://stackoverflow.com/a/8837505 return arr.sort(function(a,b){ return (a.frequency &gt; b.frequency) ? -1 : ((a.frequency &lt; b.frequency) ? 1 : 0); }); }()); (function(){ var iWordsCount = words.length; // count w/o duplicates for (var i=0; i&lt;iWordsCount; i++) { var word = words[i]; console.log(word.frequency, word.text); } }());
answers question: http://stackoverflow.com/q/26876946
type: Answer
downvote count: 1
score: -1

http://stackoverflow.com/q/26934654
accepted answer: http://stackoverflow.com/a/26934815
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/42414255
has comment: http://stackoverflow.com/comment/42414172
has comment: http://stackoverflow.com/comment/42414029
score: 0
has comment: http://stackoverflow.com/comment/42413898
tagged with: http://stackoverflow.com/tag/html
has body: Couldn't quite find this exact question but I may have missed it. I was wondering whats the best way to load certain page elements based on the IP address of the site the visitor is coming from. In other words I only want to load a certain navigation button if the site visitor came from site X. We are testing some cross-domain navigation on an e-commerce site and I want to provide a link that will get people back to their shopping cart if they navigate away from it to our main site. But I only want the link to show up if the people came from e-commerce site, hence I want to only load the link element if the referring IP address is a certain one. I found the below code but I'm kind of a php newb so i don't know if this is the best way, or if there is a better way using javascript. If ($_SERVER[“HTTP_REFERER”] == “ip address X”) { echo “ Back to shopping cart ”; } Thanks in advance
has answer: http://stackoverflow.com/a/26934815
tagged with: php
type: Question
type: AnsweredQuestion
has title: Loading certain page elements based on IP address

http://stackoverflow.com/comment/42446219
score: 0
type: Comment
has text: Interesting link indeed, but I don't see any use case to solve the problem here.
comment on: http://stackoverflow.com/a/26952456
type: AnswerComment

http://stackoverflow.com/comment/42393067
has text: I think the error is that you have to remove the cookie to see the red case... Here is a [demo](http://jsfiddle.net/rosberglinhares/7278m2o8/)
comment on: http://stackoverflow.com/q/26921756
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42350316
type: Comment
has text: @TravisJ exactly. just looking to replicate this particularly method as the project it's for in extremely small in scope and optimization is key
comment on: http://stackoverflow.com/q/26897924
score: 1
type: QuestionComment

http://stackoverflow.com/comment/42258264
has text: @Grengas, that doesnt work :(
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26847360

http://stackoverflow.com/comment/42342552
has text: @ntgCleaner I don't think there is a need to update the font size for every width. You just need a few break points to increase/decrease the font size. You should really be using media query to achieve this
comment on: http://stackoverflow.com/q/26894361
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/42331331
score: 0
type: AnswerComment
type: Comment
has text: No, it's my fault for not explaining clearly. Here is another demo http://codepen.io/anon/pen/PwowPM, if you hover over caravan, notice the sub-menu is sitting flush against the black bar. This is the effect I am looking for when you hover over any sub-menu
comment on: http://stackoverflow.com/a/26887443

http://stackoverflow.com/a/26898968
score: 4
upvote count: 4
answers question: http://stackoverflow.com/q/26898635
downvote count: 0
has body: You can create an intermediate data structure to keep track of both countries and visits to each country; then you map that structure into the final output: var tmp = {}; visits.forEach(function(item) { var obj = tmp[item.city_name] || (tmp[item.city_name] = {}); obj[item.visited] = (obj[item.visited] || 0) + 1; }); var result = Object.keys(tmp).map(function(key) { return { key: key, values: Object.keys(tmp[key]).map(function(date) { return [date, tmp[key][date]]; }) }; });
type: Answer

http://stackoverflow.com/q/26978128
type: Question
has title: javascript add option item
score: 0
has comment: http://stackoverflow.com/comment/42491413
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42491320
has body: I have a requirement to move an Option from one List to a second List, at the same time each item added to the second list should also be added to a drop down list. I have the following javascript $("#MoveRight,#MoveLeft").click(function (event) { var id = $(event.target).attr("id"); var selectFrom = id == "MoveRight" ? "#Items" : "#SelectedCustomFields"; var moveTo = id == "MoveRight" ? "#SelectedCustomFields" : "#Items"; var selectedItems = $(selectFrom + " :selected").toArray(); $.each(selectedItems, function (val, text) { createOption(val, text, $('#SortBy')); createOption(val, text, $(moveTo)); }); selectedItems.remove(); }); function createOption(value, text, list) { var myList = list; myList .append($("&lt;option&gt;&lt;/option&gt;") .val(value).html(text)); } The issue with this seems to be that it adds to one of the Select Lists fine. In the above case the second createOption call works fine, the 1st one adds a blank item, if i swap those function calls around it also flips the results. I have also tried changing the createOption function to hard code it to add the same values to the second select list (the drop down) but this gets the same results. Any help would be appreciated Thanks.
has comment: http://stackoverflow.com/comment/42490947
has comment: http://stackoverflow.com/comment/42491058
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42491944
has comment: http://stackoverflow.com/comment/42490869

http://stackoverflow.com/comment/42381969
type: QuestionComment
comment on: http://stackoverflow.com/q/26916669
has text: what about the user inputting a decimal and you convert it to a fraction? Is that acceptable?
score: 0
type: Comment

http://stackoverflow.com/q/26869191
has comment: http://stackoverflow.com/comment/80330673
answer count: 2
has body: A little background about the app that I'm working in: Spring MVC, Java EE Web application, Maven. Basically, what I'm looking for is a mechanism to refresh all JS and CSS files upon each deployment of our application. As it stands right now, the application is referencing static files (e.g. "js/app.js"). Every time there is a change to this file, after redeploying locally, we get a 304 when the browser goes to download it (file has not been modified). My questions are: 1) Would it be better to serve these files up again upon redeployment of application and use maybe the application version as a cache busting mechanism (e.g. "js/v1.0.0/app.js"). This can maybe be done via a servlet filter. 2) Since the project is a maven dynamic web project, is there some sort of plugin that does this sort of thing. I was looking at wro4j to see if it can do this, but from the very little I read about it, it's mostly used to handle minification of these JS and CSS, which is something also very useful. Which is the right approach? Thanks in advance
downvote count: 0
tagged with: javascript
tagged with: caching
has answer: http://stackoverflow.com/a/46407830
has comment: http://stackoverflow.com/comment/57083317
tagged with: browser
favorite count: 0
type: UnansweredQuestion
tagged with: maven
tagged with: css
score: 14
has comment: http://stackoverflow.com/comment/45453213
upvote count: 14
has answer: http://stackoverflow.com/a/29454873
has title: Cache busting mechanism for Java/SpringMVC/Maven project
type: Question

http://stackoverflow.com/comment/42260620
type: Comment
type: QuestionComment
has text: So it never executes `tx.executeSql('delete from [data] where [id] = ?', [cachedDataId]....`? Like, at all? Are you sure [cachedDataID] is good?
score: 0
comment on: http://stackoverflow.com/q/26847587

http://stackoverflow.com/a/26898542
has comment: http://stackoverflow.com/comment/42350198
answers question: http://stackoverflow.com/q/26898378
downvote count: 0
has comment: http://stackoverflow.com/comment/42350926
has body: Here you go. I added a function to convert the numbers to 2 digit strings if the value is &lt; 10. Demo: http://jsfiddle.net/biz79/hh13ewLa/ Edit 1: countdown.innerHTML = makeTwoDigit(days) + " : " + makeTwoDigit(hours) + " : " + makeTwoDigit(minutes) + " : " + makeTwoDigit(seconds) + " "; Edit 2: function makeTwoDigit(num) { if (num &lt; 10) { return "0" + num; } return num; } New Source: // creating a reusable CountDownTimer class with TargetDate /* targetDate = Expiration date displayCountDownOnElement = on what element you need the countdown displayed at. hideOnExpire = on what element you need to hide when it expires. */ var CountDownTimer = function(targetDate, displayCountDownOnElement, hideOnExpire){ var target_date = new Date(targetDate).getTime(); var countdown = document.getElementById(displayCountDownOnElement); var hideExpire = document.getElementById(hideOnExpire); // variables for time units var days, hours, minutes, seconds; timer(); var interval = setInterval(timer, 1000); // give interval a reference function timer() { // find the amount of "seconds" between now and target var current_date = new Date().getTime(); var seconds_left = (target_date - current_date) / 1000; // do some time calculations days = parseInt(seconds_left / 86400); seconds_left = seconds_left % 86400; hours = parseInt(seconds_left / 3600); seconds_left = seconds_left % 3600; minutes = parseInt(seconds_left / 60); seconds = parseInt(seconds_left % 60); // format countdown string + set tag value countdown.innerHTML = makeTwoDigit(days) + " : " + makeTwoDigit(hours) + " : " + makeTwoDigit(minutes) + " : " + makeTwoDigit(seconds) + " "; if(seconds_left &lt; 0) { hideExpire.style.display = "none"; countdown.innerHTML = ""; clearInterval(interval); // clears interval } } function makeTwoDigit(num) { if (num &lt; 10) { return "0" + num; } return num; } } // Sample Timer to Dec. 1, 2014 1:30:00 PM var c = new CountDownTimer("Dec 1, 2014 1:30:00 PM GMT -0800","cyber-timer", "cyber-timer"…
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/42351170
score: 1

http://stackoverflow.com/comment/42382718
type: QuestionComment
comment on: http://stackoverflow.com/q/26916943
score: 1
has text: What is this? `"images/img:="status":.png?"`
type: Comment

http://stackoverflow.com/q/26899734
type: UnansweredQuestion
answer count: 0
score: 1
upvote count: 1
type: Question
tagged with: c#
has title: Creating Controls Dynamically with JQuery .Clone() Method and then Accessing them on Button Click in asp.net
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I am trying to create Controls of asp.net Dynamically. I have placed few checkboxes for controls like TextBox, Label, CheckBox and when these checkboxes are checked, a div is opened in which user can set the properties of these controls and Add multiple controls of that type on Button Click( with JQuery .Clone() method ). And at the last when user Clicks on "Create Form" Button than a new webForm opens and all that controls are displayed on it with the specified properties. I am actually having trouble accessing these dynamically created controls. mycontrol = FindControl("txttextboxText_0"+i); In this line, I am getting the first control with ID "txtttextboxText_00" but i am not getting other controls with the IDs "txtttextboxText_01,txtttextboxText_02,txtttextboxText_03,...." I am not getting that what I am doing wrong and where is the problem. Please guide. Here is my code of JQuery. //duplicate divs var current_id = 0; var id = 0; $("#btn_atxt").click(function () { $('#textboxdiv').css({ height: '+=77' }, 500); id = current_id + 1; document.getElementById("hiddentxtcount").value = id+1; current_id = id; if (id &lt; 10) id = "0" + id; var klon = $("#txtdiv_00").clone(true); klon.attr("id", "#txtdiv_" + id); klon.attr("name", "#txtdiv_" + id); klon.find("*[id]").each(function () { $(this).attr("id", $(this).attr("id").split("_")[0] + "_" + id); $(this).appendTo("#txtdiv_" + id); }); klon.find("*[name]").each(function () { $(this).attr("name", $(this).attr("name").split("_")[0] + "_" + id); $(this).appendTo("#txtdiv_" + id); }); klon.appendTo("#d_txt").insertBefore("#btn_atxt"); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt; &lt;/script&gt; and for c#, if (chk_txt.Checked == true) { Control mycontrol = new Control(); StaticControls.CreateTextBoxes(txtcount); //For Dynamically Created TextBoxes.. //"txttextBoxText_00" is the TextBox in first Div //Similarly "txttextBoxText_01" is the TextBox of dynamically created 2nd div w…
tagged with: asp.net
favorite count: 0

http://stackoverflow.com/a/26863418
has comment: http://stackoverflow.com/comment/42286725
has comment: http://stackoverflow.com/comment/42288589
type: Answer
answers question: http://stackoverflow.com/q/26863253
has comment: http://stackoverflow.com/comment/42288708
score: 0
has comment: http://stackoverflow.com/comment/42287698
has body: It's really unclear from the question and from your comments below what result you're looking for, but you've said you need to know which values are duplicated, and what the duplicate values are, so here's a way to do that&nbsp;&mdash; adjust it as needed: If the things you're comparing are strings or readily converted to strings, I usually use a flag object for this, something like this: // Returns an object keyed by the "GroupX" string. // Each entry is an array of the duplicate values // for that key. function findDuplicateGroups(a) { var singles = {}; var duplicates = {}; a.forEach(function(entry) { var parts, key, value, dups; // Get the parts of the entry // The `key` and `value` vars are just for clarity parts = entry.split(":"); key = parts[0]; value = parts[1]; // Have we seen this key before? if (singles.hasOwnProperty(key)) { // Yes, get the duplicates array for the key if any dups = duplicates[key]; if (!dups) { // New duplicate, add an entry with the two // values we've seen so far duplicates[key] = [singles[key], value]; } else { // Existing duplicate, add this entry dups.push(value); } } else { // First entry we've seen for this key singles[key] = value; } }); return duplicates; } // An array that does have duplicates var yes = [ "Group1:111", "Group2:111", "Group3:111", "Group1:222", // Duplicate in group 1 "Group2:222", // Duplicate in group 2 "Group1:333" // Duplicate in group 1 ]; var yesDups = findDuplicateGroups(yes); var yesKeys = Object.keys(yesDups); snippet.log("'yes' array has " + yesKeys.length + " dups"); yesKeys.forEach(function(key) { snippet.log("* " + key + ": " + yesDups[key].join(", ")); }); // An array that doesn't var no = [ "Group1:111", "Group2:111", "Group3:111" ]; var noDups = findDuplicateGroups(no); var noKeys = Object.keys(noDups); snippet.log("'no' array has " + noKeys.length + " dups"); noKeys.forEach(function(key) { snippet.log("* " + key + ": " + noDups[key].join(", ")); }); &lt;!-- Script provides the `snippet` object,…
has comment: http://stackoverflow.com/comment/42287950
has comment: http://stackoverflow.com/comment/42288690
has comment: http://stackoverflow.com/comment/42286833
has comment: http://stackoverflow.com/comment/42286858

http://stackoverflow.com/q/26970730
has comment: http://stackoverflow.com/comment/42480867
has comment: http://stackoverflow.com/comment/42482434
score: 0
has title: Regarding autocomplete textbox
has answer: http://stackoverflow.com/a/26988198
answer count: 1
tagged with: jquery-ui
tagged with: javascript
has comment: http://stackoverflow.com/comment/42479990
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26988198
has comment: http://stackoverflow.com/comment/42480508
tagged with: asp.net
tagged with: ajax
type: Question
has body: ## Regarding autocomplete textbox ## In below code i want autocomplete textbox first search from database ,if data not find from database then search from google api in asp.net, but in this case search data from databae and google api. &lt;link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function () { $('#Address').autocomplete({ source: function (request, response) { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Root.aspx/GetAutoCompleteData", data: "{'Address':'" + document.getElementById('Address').value + "'}", dataType: "json", success: function (data) { response(data.d); if (response(data.d) == null) { var svalue = /** @type {HTMLInputElement} */(document.getElementById('Address')); var svalueBox = new google.maps.places.SearchBox(/** @type {HTMLInputElement} */(svalue)); } }, error: function (result) { alert("Error"); } }); } }); }); &lt;input id="Address" type="text" style="width: 305px" placeholder="From..."/&gt; [WebMethod] public static List&lt;string&gt; GetAutoCompleteData(string Address) { List&lt;string&gt; result = new List&lt;string&gt;(); using (SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["ConnectionString"])) { using (SqlCommand cmd = new SqlCommand("select DISTINCT Address from Locations where Address LIKE '%'+@SearchText+'%'", con)) { con.Open(); cmd.Parameters.AddWithValue("@SearchText", Address); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { result.Add(dr["Address"].ToString()); } return result; } } }

testing
tags question: http://stackoverflow.com/q/26965850
tags question: http://stackoverflow.com/q/26952574
tag name: testing
tags question: http://stackoverflow.com/q/26908288
tags question: http://stackoverflow.com/q/26883663
type: Tag
tags question: http://stackoverflow.com/q/26922498
tags question: http://stackoverflow.com/q/26836561
tags question: http://stackoverflow.com/q/26833966

http://stackoverflow.com/q/26974768
tagged with: jquery
has title: Creating Dynamic nested HTML tags using jquery
score: 0
has body: I have a class like this var htmlElements=function(){ var __this=this; this.type=''; this.parentDiv=''; this.id=''; this.draw=function(){ if(__this.type=='div'){ $('&lt;div/&gt;', { 'id': __this.id, }) .appendTo(__this.parentDiv); } } } From my consumer class I create the object of this class fill properties and call the draw method. Like this. In dom i have a div with id staticDiv I didn't create it dynamically var htmlElementsobj=htmlElements(); htmlElements.type='div'; htmlElements.id='firstDiv'; htmlElements.parentDiv='#staticDiv' htmlElements.draw(); To this point it works fine but when I try to draw another element inside a dynamic created div like this var htmlElementsobj=htmlElements(); htmlElements.type='div'; htmlElements.id='nestedDiv'; htmlElements.parentDiv='#firstDiv' htmlElements.draw(); It didnt draw. But If I change its parent property to staticDiv it works fine.
has answer: http://stackoverflow.com/a/26975081
type: UnansweredQuestion
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/42396907
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26913759
has text: If you namespace everything (`app.BookView` instead of just `BookView`) then it becomes easier to stub things for testing, no? You want to do that anyway in a real app.

http://stackoverflow.com/comment/42354652
comment on: http://stackoverflow.com/q/26901027
score: 0
type: Comment
type: QuestionComment
has text: @jfriend00 ok, thank you for clarification. I've not been programming much under JS and looks like really need to learn this design approaches. Voted up.

http://stackoverflow.com/a/26848737
has body: It appears that the tag can actually be used to run PHP code, if you use: &lt;script language="php"&gt; echo("hello"); &lt;/script&gt; I assume that setting a type in the script tag makes it only evaluate a single language within the tags - leaving it without a type allows it to stay a multi-language script tag. Source: http://php.about.com/od/advancedphp/qt/mixed_scripting.htm Therefore, using something like &lt;script&gt; var json = &lt;?php echo($var); ?&gt;; &lt;/script&gt; will evaluate both languages (obviously PHP server side), but setting a type or language in the script tag will prevent other languages / types within the tags from being evaluated.
score: 0
answers question: http://stackoverflow.com/q/26848206
type: Answer

http://stackoverflow.com/comment/42332261
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26889018
has text: This question sure gets asked a lot.
score: 0

http://stackoverflow.com/q/26942405
type: UnansweredQuestion
has body: I have a cropping utility, built with AngularJs, part of the utility is that it can crop any image in the browser using the canvas.toDataURL method, the problem is that it's not possible to call this method on and image that is not from the same origin, doing so will cause a SecurityError breaking up the rest of the code. So my question is: Is there a way to validate if an image complies with the same origin policy before trying the toDataURL method? I've been searching about this but all answers I find relate to making changes to the request in the server so that all images show up as same origin, but I want to distribute this code so I have no way of making sure the user will always use a same origin image, so I want to automatically disable the canvas cropping for images that don't comply with this.
type: Question
tagged with: image
has title: Javascript - Validate if image is same origin before doing a canvas.toDataURL
tagged with: canvas
has comment: http://stackoverflow.com/comment/42440450
has comment: http://stackoverflow.com/comment/42428688
tagged with: javascript
has comment: http://stackoverflow.com/comment/42428342
tagged with: angularjs
answer count: 0
score: 0

http://stackoverflow.com/comment/42312393
score: 0
comment on: http://stackoverflow.com/a/26867925
type: Comment
type: AnswerComment
has text: thanks for the answer.. i did but i didn't really understand how to do it .. i used json with android and its much easier than this .. can you please explain the example code for me?

http://stackoverflow.com/a/26870871
has body: You need to do document.getElementById("box").innerHTML = 'This is&lt;br/&gt;a sentence';
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26870819
type: Answer
answers question: http://stackoverflow.com/q/26870819

google-chrome
tags question: http://stackoverflow.com/q/26935147
tags question: http://stackoverflow.com/q/26946308
tags question: http://stackoverflow.com/q/26851012
tags question: http://stackoverflow.com/q/26902859
tags question: http://stackoverflow.com/q/26950982
tags question: http://stackoverflow.com/q/26948298
tags question: http://stackoverflow.com/q/26858571
tags question: http://stackoverflow.com/q/26931925
tags question: http://stackoverflow.com/q/26964846
tags question: http://stackoverflow.com/q/26854218
tags question: http://stackoverflow.com/q/26900787
tags question: http://stackoverflow.com/q/26884140
tags question: http://stackoverflow.com/q/26910846
tags question: http://stackoverflow.com/q/26887553
tags question: http://stackoverflow.com/q/26938614
tags question: http://stackoverflow.com/q/26980446
tags question: http://stackoverflow.com/q/26949982
tags question: http://stackoverflow.com/q/26907100
tags question: http://stackoverflow.com/q/26970538
tags question: http://stackoverflow.com/q/26920942
tags question: http://stackoverflow.com/q/26977225
tags question: http://stackoverflow.com/q/26930429
tags question: http://stackoverflow.com/q/26934511
tags question: http://stackoverflow.com/q/26864531
tags question: http://stackoverflow.com/q/26975929
tags question: http://stackoverflow.com/q/26894708
tags question: http://stackoverflow.com/q/26840266
tags question: http://stackoverflow.com/q/26905560
tags question: http://stackoverflow.com/q/26841143
tags question: http://stackoverflow.com/q/26960344
tags question: http://stackoverflow.com/q/26974466
type: Tag
tags question: http://stackoverflow.com/q/26844031
tags question: http://stackoverflow.com/q/26943442
tags question: http://stackoverflow.com/q/26943301
tags question: http://stackoverflow.com/q/26964963
tags question: http://stackoverflow.com/q/26908170
tag name: google-chrome
tags question: http://stackoverflow.com/q/26978241
tags question: http://stackoverflow.com/q/26906456
tags question: http://stackoverflow.com/q/26963435
tags question: http://stackoverflow.com/q/26898441
tags question: http://stackoverflow.com/q/26981155
tags question: http://stackoverflow.com/q/26850491
tags question: http://stackoverflow.com/q/26864571
tags question: http://stackoverflow.com/q/26917064
tags question: http://stackoverflow.com/q/26867709
tags question: http://stackoverflow.com/q/26940484
tags question: http://stackoverflow.com/q/26918789
tags question: http://stackoverflow.com/q/26958705
tags question: http://stackoverflow.com/q/26985630
tags question: http://stackoverflow.com/q/26879573
tags question: http://stackoverflow.com/q/26883915
tags question: http://stackoverflow.com/q/26845747
tags question: http://stackoverflow.com/q/26921469
tags question: http://stackoverflow.com/q/26872387
tags question: http://stackoverflow.com/q/26877066
tags question: http://stackoverflow.com/q/26918001
tags question: http://stackoverflow.com/q/26851116
tags question: http://stackoverflow.com/q/26985561

http://stackoverflow.com/comment/42363661
comment on: http://stackoverflow.com/q/26906456
has text: It's for personal use in-house script
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/26928444
tagged with: javascript
type: Question
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/42402646
has title: change the width of dimple js chart
has body: I am working with dimple js and I want to change the width of chart and redraw it again how can I do this. I tried chart.width() and even chart.newSvg() but these came to nothing I have sample javascript line chart and I put it in jsfiddle Jsfiddle Javascript Code: var svg = dimple.newSvg("#chartContainer", 600, 400), data = [ { "Value" : 10, "Year" : 2009 }, { "Value" : 5, "Year" : 2010 }, { "Value" : 4, "Year" : 2011 }, { "Value" : 7, "Year" : 2012 }, { "Value" : 10, "Year" : 2010 }, { "Value" : 50, "Year" : 2020 }, { "Value" : 40, "Year" : 2015 }, { "Value" : 100, "Year" : 2014 }, { "Value" : 200, "Year" : 2014 } ]; var chart = new dimple.chart(svg, data); var x = chart.addCategoryAxis("x", "Year"); x.addOrderRule("Year"); var y = chart.addMeasureAxis("y", "Value"); chart.addColorAxis("Value", ["green", "yellow", "red"]); var lines = chart.addSeries(null, dimple.plot.line); lines.lineWeight = 4; lines.lineMarkers = true; chart.ease = "bounce"; chart.staggerDraw = true; chart.draw(2000);
tagged with: dimple.js
tagged with: d3.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42403050
has answer: http://stackoverflow.com/a/26928977

http://stackoverflow.com/comment/42352149
comment on: http://stackoverflow.com/q/26899339
score: 0
type: Comment
type: QuestionComment
has text: I'm not really understanding your intent. Do you control `a.example.com` or `b.example.com`? Which one do you code `window.open()` on?

http://stackoverflow.com/a/26844319
has comment: http://stackoverflow.com/comment/42251842
has body: You can use lt for this (don't forget about the :checkbox selector too): $(":checkbox:lt(5)") Or if performance is your worry (and you're working with large lists), you can use the much more efficient JavaScript's slice for this: $(':checkbox').slice(0, 5)
type: Answer
upvote count: 4
downvote count: 0
answers question: http://stackoverflow.com/q/26844259
score: 4
has comment: http://stackoverflow.com/comment/42252685

http://stackoverflow.com/a/26945045
has comment: http://stackoverflow.com/comment/42432854
has body: Check the JSFiddle :- JSFiddle $('.myDatepicker').each(function() { var $picker = $(this); $picker.datepicker(); var pickerObject = $picker.data('datepicker'); //HIDE THE CALENDER $picker.on('changeDate', function(ev){ $picker.datepicker('hide'); }); });
has comment: http://stackoverflow.com/comment/42433535
type: Answer
has comment: http://stackoverflow.com/comment/42433331
answers question: http://stackoverflow.com/q/26944912
has comment: http://stackoverflow.com/comment/42432807
has comment: http://stackoverflow.com/comment/42432904
score: 0

http://stackoverflow.com/q/26955798
type: Question
tagged with: mobile
has title: Javascript animation rectangle
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26955853
tagged with: canvas
answer count: 1
downvote count: 0
has body: I try to develop a mobile game. Following Problem: The rectangle, what you can see in the code should be animated. That mean it should came from above and run to the bottom and so forth. If I run this code all become drawed, but the rectangle dont move. I dont know where the mistake is. window.onload = window.onresize = function() { var C = 1; // canvas width to viewport width ratio var W_TO_H = 2 / 1; // canvas width to canvas height ratio var el = document.getElementById("myCanvas"); var viewportWidth = window.innerWidth; var viewportHeight = window.innerHeight; var canvasWidth = viewportWidth * C; var canvasHeight = canvasWidth / W_TO_H; el.style.position = "fixed"; el.setAttribute("width", canvasWidth); el.setAttribute("height", canvasHeight); el.style.top = (viewportHeight - canvasHeight) / 2; el.style.left = (viewportWidth - canvasWidth) / 2; var x = canvasWidth / 100; var y = canvasHeight / 100; window.ctx = el.getContext("2d"); ctx.clearRect(0, 0, canvasWidth, canvasHeight); // draw triangles function init() { return setInterval(main_loop, 10); } function draw() { recty = canvasHeight / 100 * 20; rectheight = canvasHeight / 100 * 30; ctx.clearRect(0, 0, canvasWidth, canvasHeight); // draw rect ctx.beginPath(); fillStyle = "#000000"; ctx.rect(x * 30, recty, x * 20, rectheight); ctx.fill(); // draw triangles ctx.beginPath(); ctx.moveTo(x * 90, y * 50); ctx.lineTo(x * 99, y * 75); ctx.lineTo(x * 99, y * 25); ctx.closePath(); ctx.stroke(); ctx.beginPath(); ctx.moveTo(x * 10, y * 50); ctx.lineTo(x * 1, y * 25); ctx.lineTo(x * 1, y * 75); ctx.closePath(); ctx.stroke(); // ballx ballx = canvasWidth / 100; // draw ball ctx.beginPath(); ctx.fillStyle = "#FF4422"; ctx.arc(ballx * 50, y * 50, x * 5, 0, 2 * Math.PI); ctx.fill(); } function update() { recty += 1; if (recty > canvasHeight) { recty = -rectheight; } if (recty > canvasHeight) { recty -= 1; } } function main_loop() { draw(); update(); } init(); } <div="gameArea">
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26955853
score: 1
upvote count: 1

http://stackoverflow.com/comment/42384511
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26898244
has text: I added the class="myClass" to the two date fields. I haven't changed the ids as you said. I updated the post in order you can watch the code I have rigth now.
score: 0

http://stackoverflow.com/comment/42318487
comment on: http://stackoverflow.com/q/26881240
score: 0
has text: possible duplicate of [What does "this.\_events || (this.\_events = {});" mean?](http://stackoverflow.com/questions/23212926/what-does-this-events-this-events-mean)
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45419568
comment on: http://stackoverflow.com/a/26928493
score: 0
type: AnswerComment
type: Comment
has text: Any idea how to do this without knowing the name of the attribute?

http://stackoverflow.com/a/26944343
has comment: http://stackoverflow.com/comment/42431771
has body: Convert $scope.visa.rdate (looks like it's a string) to Date object before you pass it into $filter: $filter('date')(new Date($scope.visa.rdate), 'dd/MM/yyyy');
has comment: http://stackoverflow.com/comment/42431714
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/42431907
has comment: http://stackoverflow.com/comment/42431849
answers question: http://stackoverflow.com/q/26944299

http://stackoverflow.com/q/26873434
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/26873480
favorite count: 0
upvote count: 0
possible better answer: http://stackoverflow.com/a/26873582
has answer: http://stackoverflow.com/a/26873480
has comment: http://stackoverflow.com/comment/42305023
has title: Button doesn't trigger an event
has comment: http://stackoverflow.com/comment/42304963
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42304951
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/42304980
has answer: http://stackoverflow.com/a/26873582
score: -2
has body: Please help me with the following code because I don't know what I am missing. A click on button Compute should trigger function computeAll(). Instead the script doesn't react to my actions: the html code: Real part Imaginary part(i) Enter the first complex number Enter the secound complex number Enter your choice Addition Substraction The answer is: and java script code
tagged with: javascript
downvote count: 2

http://stackoverflow.com/comment/42295196
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26867481
score: 1
has text: The link that @ashfaq.p provided should get you started. There isn't going to be one definitive answer that will fit every architecture, but that should get you going.

http://stackoverflow.com/a/26978825
downvote count: 0
upvote count: 8
has body: I'm really starting to sound like a broken record on here, but as your charts become really complicated forget the plugins and do it yourself. Here's modified code from my links above catered for how you drew your plots: // after initial plot draw, then loop the data, add the labels // I'm drawing these directly on the canvas, NO HTML DIVS! // code is un-necessarily verbose for demonstration purposes var ctx = somePlot.getCanvas().getContext("2d"); // get the context var allSeries = somePlot.getData(); // get your series data var xaxis = somePlot.getXAxes()[0]; // xAxis var yaxis = somePlot.getYAxes()[0]; // yAxis var offset = somePlot.getPlotOffset(); // plots offset ctx.font = "12px 'Segoe UI'"; // set a pretty label font ctx.fillStyle = "black"; for (var i = 0; i &lt; allSeries.length; i++){ var series = allSeries[i]; var dataPoint = series.datapoints.points; // one point per series var x = dataPoint[0]; var y = dataPoint[1]; var text = x + '%'; var metrics = ctx.measureText(text); var xPos = xaxis.p2c(x)+offset.left - metrics.width; // place at end of bar var yPos = yaxis.p2c(y) + offset.top - 2; ctx.fillText(text, xPos, yPos); } Updated fiddle.
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26976161
answers question: http://stackoverflow.com/q/26976161
type: Answer
score: 8

http://stackoverflow.com/a/26982773
score: 4
has body: Uncaught TypeError: Cannot read property 'value' of null That is because there is no element with the ID "#history_comment". Only one with the ID "history_comment". Also, changing a textarea's value works by changing its .innerHTML opposed to .value. Same for reading the value from a textarea. Why do you want to do this via Javascript? Wouldn't it be better to do that after the post is submitted via PHP? The way you are doing it right now, if I "blur" the textarea several times the text you add gets added several times.
type: Answer
upvote count: 4
downvote count: 0
answers question: http://stackoverflow.com/q/26982671
has comment: http://stackoverflow.com/comment/42499930
has comment: http://stackoverflow.com/comment/42499993
has comment: http://stackoverflow.com/comment/42500021

http://stackoverflow.com/comment/42511294
score: 0
type: Comment
has text: 1+ for elaborting :) ,just to verify that I got it,Q is identical to then with Q but like writing it in short.if so how do you chain using Q? im not talking about Q.all since the order is importent...
type: AnswerComment
comment on: http://stackoverflow.com/a/26976735

http://stackoverflow.com/q/26871407
tagged with: node.js
tagged with: stormpath
score: 0
accepted answer: http://stackoverflow.com/a/26872629
has body: I get JSON data from my client and want to save it to Stormpaths custom data using node.js with express.js: I've got my basic post route: app.post('/post', stormpath.loginRequired, function(req, res){ var data = req.body; res.locals.user.customData.test = data; res.locals.user.customData.save(); }); I basically want to overwrite the given data in customData.test and than save it, but right now it's adding the given data to customData.test. How do i fix that?
has title: How to reset and post custom data to Stormpath
tagged with: javascript
tagged with: express
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26872629
type: Question
answer count: 1

http://stackoverflow.com/q/26927947
has comment: http://stackoverflow.com/comment/42407692
has answer: http://stackoverflow.com/a/26928174
accepted answer: http://stackoverflow.com/a/26928013
tagged with: php
upvote count: 6
has title: Accessing php file outside root directory via jquery ajax request
has comment: http://stackoverflow.com/comment/90061379
answer count: 3
has body: I read it's good practice to store php files containing potentially security risk stuff outside the root directory. Now I have php files containing stuff for proccessing a registration/login. Those are outside the root directory. Now I catch the form content via jquery and send it to this php file. But this seems not to be possible with js/jquery: $.ajax({ type: "POST", url: "../php_includes/register.inc.php", //beyond root path data: data, }) .done(function(data, status) { //... }); Do I have a design error or just doing something wrong? Whats the "best practice" solution here?
tagged with: javascript
has answer: http://stackoverflow.com/a/26928013
score: 6
has answer: http://stackoverflow.com/a/26928017
has comment: http://stackoverflow.com/comment/42403922
type: AnsweredQuestion
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
possible better answer: http://stackoverflow.com/a/26928174
type: Question

http://stackoverflow.com/q/26848605
has answer: http://stackoverflow.com/a/26849254
tagged with: twitter-bootstrap
type: Question
has body: I am new to Bootstrap. As i have started with DashBoard example in BootStrap. i see the below code in html page. &lt;img data-src="holder.js/200x200/auto/vine" class="img-responsive" alt="Generic placeholder thumbnail"&gt; And i did a search of entire html code, no where i found holder.js being loaded. Can someone explain me from where does holder.js get loaded ? All i see is the above reference inside a image tag. But i am just wondering where or how will the browser be aware of holder.js
tagged with: javascript
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/26849254
upvote count: 1
downvote count: 1
has title: holder.js not referenced or loaded in html document
favorite count: 0
has answer: http://stackoverflow.com/a/26849465
accepted answer: http://stackoverflow.com/a/26849465
tagged with: holder.js
type: AnsweredQuestion

http://stackoverflow.com/comment/42334222
comment on: http://stackoverflow.com/q/26890030
type: Comment
type: QuestionComment
has text: Its up to _you_ to do some effort, this is not a do-it-for-you service.
score: 1

http://stackoverflow.com/comment/42374718
has text: Reading between the lines, it sounds rather like you want to create and array then [shuffle it](http://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array).
comment on: http://stackoverflow.com/q/26911622
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42310500
has text: If you need to pass in an array, you can just run it like you'd expect `select(array('foo', 'bar'))`. 'whatever' is only assigned if you leave out the argument when you call it.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26876510
score: 0

http://stackoverflow.com/q/26863691
linked to: http://stackoverflow.com/q/8557869
accepted answer: http://stackoverflow.com/a/26864322
tagged with: angularjs
type: Question
has answer: http://stackoverflow.com/a/26864183
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to write a list that show 5 items then some additional content then the next 5 items in the list and keep doing this until the list has finished using ng-repeat. eg 1 2 3 4 5 extra content 6 7 8 9 10 extra content 11 12 13 14 15 I have it working with the below example however I want the extra content to appear after every 5 items. Using my method below it would be very manual to implement this if I had for example 100 items in the list. Is there a way to inject a break after every x items in the list using ng-repeat or is there a better way to approach this? see fiddle <div ng-init="friends = [ {name:'John', age:25, gender:'boy'}, {name:'Jessie', age:30, gender:'girl'}, {name:'Johanna', age:28, gender:'girl'}, {name:'Joy', age:15, gender:'girl'}, {name:'Mary', age:28, gender:'girl'}, {name:'Peter', age:95, gender:'boy'}, {name:'Sebastian', age:50, gender:'boy'}, {name:'Erika', age:27, gender:'girl'}, {name:'Patrick', age:40, gender:'boy'}, {name:'Samantha', age:60, gender:'girl'} ]"> [{{$index}}] {{friend.name}} is {{friend.age}} years old. extra content 5"> [{{$index}}] {{friend.name}} is {{friend.age}} years old.
tagged with: angularjs-ng-repeat
favorite count: 0
possible better answer: http://stackoverflow.com/a/26864183
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/26864322
has comment: http://stackoverflow.com/comment/42287141
has title: ng-repeat list with different content after every x items
downvote count: 0
tagged with: javascript
score: 1

http://stackoverflow.com/comment/42402962
has text: just put `pageNo = pageNo + 1;` inside the `success:` callback, ajax means asynchronous. javascript doesnt wait until ajax has finished
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26928352

http://stackoverflow.com/comment/42482360
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26972941
score: 0
has text: do you want the user to stay on the same page but the div showing the results should update on enter of a new letter as the search term

http://stackoverflow.com/q/26862593
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 0
has title: Strange behaviour in angular template
has comment: http://stackoverflow.com/comment/42285483
type: Question
has comment: http://stackoverflow.com/comment/42285538
has comment: http://stackoverflow.com/comment/42289797
has comment: http://stackoverflow.com/comment/42285314
score: 0
tagged with: javascript
has body: I'm doing angular app. And after dynamically including a template, the included html messes up. Here's how my app looks: index.html HTML where we use dynamic include title.html And the included template: checkjob.html checkjob -l -n -q -v [-l policylevel] [-n nodeid] [-q qosid] [-r reservationid] [-v] [--flags=future] jobID: Enter The thing is that in jsfiddle my html looks normal, but in my app it looks bad. My app: JSfiddle: http://jsfiddle.net/y1hkmkse/
tagged with: angularjs

http://stackoverflow.com/q/26933117
type: Question
score: 0
answer count: 2
has body: I have a thumbnail scroller where I want to trigger some action only when the mouse is hovered for 3 seconds on thumbnails. I have the following code but the inner setTimeOut function is not getting the arguments from the outer function--the sourceURL console output gets 'undefined' error. But the 'hover' function I do see correct sourceURL value. Thanks in advance! var tOut; $('img.thumb').hover(function(){ var sourceURL = $(this).attr('src'); var lat = $(this).attr('lat'); var lng = $(this).attr('lng'); tOut = setTimeout(function(sourceURL,lat,lng){ console.log(sourceURL);//undefined map.setView(new L.LatLng(lat, lng), (init_mapzoom+2)); },3000); },function(){ clearTimeout(tOut); });
possible better answer: http://stackoverflow.com/a/26933291
tagged with: javascript
has answer: http://stackoverflow.com/a/26933291
accepted answer: http://stackoverflow.com/a/26933268
tagged with: arguments
has title: Javascript: Passing arguments to an inner setTimeOut function?
has comment: http://stackoverflow.com/comment/42411064
has comment: http://stackoverflow.com/comment/42411090
type: AnsweredQuestion
tagged with: settimeout
has answer: http://stackoverflow.com/a/26933268

http://stackoverflow.com/comment/42293531
type: QuestionComment
comment on: http://stackoverflow.com/q/26866750
has text: FYI, this problem stems from a fundamental misunderstanding of the way ERB works. ERB just fills in the blanks before sending the script to the browser. It can't get information out of JavaScript variables, since as far as it is concerned that's not even JavaScript: just a lump of text that it's about to send to the user's browser.
score: 0
type: Comment

http://stackoverflow.com/comment/42393362
comment on: http://stackoverflow.com/q/26920560
type: Comment
has text: After the button click you may need another Do While loop waiting for IE to load the next form.
type: QuestionComment
score: 0

http://stackoverflow.com/a/26965935
type: Answer
has body: use find() selector to find the next p then change text $(img).next(".carousel-caption").find( "p").text("After"); DEMO
score: 0
answers question: http://stackoverflow.com/q/26965901

http://stackoverflow.com/comment/42838940
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26976537
has text: Why not just use javascript? `"http://mysite/responses/103".split("/").pop()` will give you "103". Or didn't I understand?

http://stackoverflow.com/comment/42826968
has text: That's too bad, suspected it would be slow. To answer your question why root does not work even though the data looks the same. The problem is that in your three the same object is added multiple times but it needs to be added as a different instance. For example both 1 and 5 has a child that points to the same instance of 4.
type: AnswerComment
comment on: http://stackoverflow.com/a/27160538
score: 0
type: Comment

http://stackoverflow.com/a/26875718
accepted answer of: http://stackoverflow.com/q/26874420
type: AcceptedAnswer
type: Answer
downvote count: 1
has body: Upvote for wanting someting to learn and actually asking. As @jbarker2160 wrote: Computer-programs are algorithms. If you know MySQLs SQL dialect you might run into the PROCEDURE command. A good example for that. If you read about Computer history you will soon learn that some early computer programs were nothing else than a series of switch-combinations (on/off) represented by little holes in a paper. Modern programming languages like JavaScript are a high-level abstraction from that "binary" code but deep in their core they still just talk "on" and "off". Good luck with your programming!
score: -1
upvote count: 0
answers question: http://stackoverflow.com/q/26874420

http://stackoverflow.com/q/26924076
favorite count: 0
type: UnansweredQuestion
score: -1
has comment: http://stackoverflow.com/comment/42395223
tagged with: cookies
has comment: http://stackoverflow.com/comment/42395097
downvote count: 1
type: Question
upvote count: 0
has answer: http://stackoverflow.com/a/26924293
tagged with: javascript
has body: i don't want to change class after page loaded. How to add class cookie in my project. HTML Red Green Testing Text1 Testing Text2 CSS .red{ color: red; font-weight: bold; } .green { color: green; font-weight: bold; }` Javascript function changeClass(value) { var color1 = 'red'; var color2 = 'green'; if (value == 2) { color1 = 'green'; color2 = 'red'; }; var elems = document.getElementsByClassName(color1); var i = elems.length; while (i--) { var item = elems[i]; if (hasClass(item, color1)) { removeClass(item, color1); addClass(item, color2); } }; return false; }; function hasClass(ele, cls) { return ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')); } function addClass(ele, cls) { if (!hasClass(ele, cls)) ele.className += " " + cls; } function removeClass(ele, cls) { if (hasClass(ele, cls)) { var reg = new RegExp('(\\s|^)' + cls + '(\\s|$)'); ele.className = ele.className.replace(reg, ' '); } }
answer count: 1
has title: How to add class cookie by javascript?

http://stackoverflow.com/q/26959219
has answer: http://stackoverflow.com/a/54212642
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/42457060
has comment: http://stackoverflow.com/comment/42457026
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/42457165
upvote count: 16
has title: JavaScript onClick addClass
has answer: http://stackoverflow.com/a/26959339
type: AnsweredQuestion
tagged with: onclick
score: 16
has answer: http://stackoverflow.com/a/46628233
has body: I am kind of confused why my code doesn't work correctly, I hope You will tell me what I've done wrong. I want to highlight navigation tab while clicked. HTML: Home O mnie Kurs Kontakt JavaScript: function dodajAktywne(elem) { var a = document.getElementsByTagName('a') for (i = 0; i < a.length; i++) { a[i].classList.remove('active'); } elem.classList.add('active'); } CSS: .active { color: blue; background-color: #cf5c3f; }
has comment: http://stackoverflow.com/comment/42457125
type: Question
possible better answer: http://stackoverflow.com/a/46628233
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26959339
has comment: http://stackoverflow.com/comment/42457144
has comment: http://stackoverflow.com/comment/42459220
answer count: 3
has comment: http://stackoverflow.com/comment/42457410

http://stackoverflow.com/comment/130319625
has text: Looks like less secure apps is no longer supported. Nodemailer GitHub issue on this (https://github.com/nodemailer/nodemailer/issues/1424) has the updated steps.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29378438

http://stackoverflow.com/q/26851585
has title: register adwords conversion using jQuery
has answer: http://stackoverflow.com/a/26852961
type: AnsweredQuestion
tagged with: javascript
type: Question
score: 0
answer count: 1
has body: I have seen a few questions asked on here about tracking conversions on Adwords with jQuery. However, there doesn't seem to be a definitive answer. I'm trying to register a conversion using the following code after an ajax form has been submitted. It seems to return a 1x1 image when I look at Firebug network tools, but the conversion hasn't registered yet in my account. But I am told it can take up to 24 hours. Will this work? $('&lt;img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/xxxx/?label=xxxx&amp;amp;guid=ON&amp;amp;script=0"/&gt;').appendTo('body');
tagged with: jquery
tagged with: google-ads-api
accepted answer: http://stackoverflow.com/a/26852961
tagged with: ajax

mongoose
tags question: http://stackoverflow.com/q/26882041
tags question: http://stackoverflow.com/q/26966666
tags question: http://stackoverflow.com/q/26880249
type: Tag
tags question: http://stackoverflow.com/q/26838319
tags question: http://stackoverflow.com/q/26835128
tags question: http://stackoverflow.com/q/26856233
tags question: http://stackoverflow.com/q/26892660
tags question: http://stackoverflow.com/q/26898022
tags question: http://stackoverflow.com/q/26877111
tags question: http://stackoverflow.com/q/26962210
tags question: http://stackoverflow.com/q/26883326
tag name: mongoose
tags question: http://stackoverflow.com/q/26944424
tags question: http://stackoverflow.com/q/26853292
tags question: http://stackoverflow.com/q/26975854
tags question: http://stackoverflow.com/q/26909509
tags question: http://stackoverflow.com/q/26880887
tags question: http://stackoverflow.com/q/26897802
tags question: http://stackoverflow.com/q/26856041
tags question: http://stackoverflow.com/q/26915116
tags question: http://stackoverflow.com/q/26861417
tags question: http://stackoverflow.com/q/26962571

http://stackoverflow.com/comment/42440882
comment on: http://stackoverflow.com/a/26948991
score: 0
type: AnswerComment
type: Comment
has text: There is still a lot of repeated code with this answer. Why not DRY it up and then attach the click event to the newly created object at time of creation instead of re-querying / filtering after the fact?

http://stackoverflow.com/comment/42485873
comment on: http://stackoverflow.com/q/26975349
has text: @RokoC.Buljan Yep, corrected the comment.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/26955393
has comment: http://stackoverflow.com/comment/42450839
upvote count: 4
type: AcceptedAnswer
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/42450765
has body: It starts at the end of the array wrapping the previous result in a new object each time, meaning the structure gets deeper and deeper. Going though it loop by loop for array [1,2,3] The first loop: i = 2 array[2] is 3 list = {value: 3, rest: null} The second: i = 1 array[1] is 2 list = {value: 2, rest: {value: 3, rest: null}} The third and final: i = 0 array[0] is 1 list = {value: 1, rest: {value: 2, rest: {value: 3, rest: null}}} As for printing undefined, I don't understand why, but this works: function arrayToList(array) { var list = null; for (var i = array.length-1; i>=0; i--) { list = {value: array[i], rest: list}; } return list; } $('#A').html(JSON.stringify(arrayToList([1, 2, 3]))); test
type: Answer
accepted answer of: http://stackoverflow.com/q/26955308
answers question: http://stackoverflow.com/q/26955308
has comment: http://stackoverflow.com/comment/42450965
has comment: http://stackoverflow.com/comment/42450785
has comment: http://stackoverflow.com/comment/42450899

http://stackoverflow.com/a/26966817
answers question: http://stackoverflow.com/q/26966740
upvote count: 1
has body: Try below code HTML CODE : &lt;asp:TextBox ID="txtMemoName" runat="server" Width="200px" onblur="alertevent(this);" &gt;&lt;/asp:TextBox&gt; JQUERY : function alertevent(elem) { var value = $(elem).val(); if (value == "") { $(elem).focus(); $(elem).css({border:'1px solid red',color: 'read !important'}); } } OR try unobtrusive $('input[id$=txtMemoName]').on('blur', function () { var value = $(this).val(); if (value == "") { $(this).focus(); $(this).css({border:'1px solid red',color: 'read !important'}); } });
has comment: http://stackoverflow.com/comment/42474586
has comment: http://stackoverflow.com/comment/42474678
type: Answer
has comment: http://stackoverflow.com/comment/42475910
has comment: http://stackoverflow.com/comment/42476868
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/42475639

relative-path
type: Tag
tags question: http://stackoverflow.com/q/26851353
tag name: relative-path

http://stackoverflow.com/a/26861888
has comment: http://stackoverflow.com/comment/42285104
has comment: http://stackoverflow.com/comment/42304073
type: Answer
has body: Try this: Please fill in the form
has comment: http://stackoverflow.com/comment/42284327
answers question: http://stackoverflow.com/q/26861753
score: 0

http://stackoverflow.com/comment/42311401
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26876946
has text: because when you have space you shouldn't count it as a word

http://stackoverflow.com/comment/42333388
has text: Can you copy your code into a Stack Snippet (use the icon after the 'picture', that way we can see what's going on, and it forces you to post a complete/verifiable example...)?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26889299
score: 0

http://stackoverflow.com/comment/64556314
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26978481
has text: How to do it for dynamically added elements??

http://stackoverflow.com/a/26947184
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26936024
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/26936024
has body: In the end the whole problem was that the button does not react to a 'click' event but to a 'tap' one. The following code works: Ext.get('ext-button-8').fireEvent('tap'); It probably can be done in plain Javascript too but firing a touch event is a bit more complicated that way.

http://stackoverflow.com/comment/42355900
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26901801
has text: @MichaelLemaire Can you try to use $promise.then ?
score: 0

http://stackoverflow.com/comment/42395727
has text: That works like a charm, thanks! I've only used $scope.$apply once before to get a GoogleChart directive to work, but I can't say I really understand its use, I'd never have figured this out. I actually tried $setViewValue and $render, but didn't give me anything, so like regular expressions I'll have to look into $scope.$apply and stop apparently avoiding it.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26924086
type: Comment

http://stackoverflow.com/q/26867832
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42295212
has answer: http://stackoverflow.com/a/26868521
accepted answer: http://stackoverflow.com/a/26868521
type: Question
has title: Slideshow css layouts interfere with html body
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/42295842
has body: First of all I have 4 layouts in css which I wanna add a slide transition, first to second slide transition is ok but the second to third slide transition is not okay because if I add fadeIn or fadeOut effect in jquery the third layout for 1 second overlap the entire html body, and for 1 second I have 2 layouts on the screen after 1 second he looks fine in the normal position. If i dont add any effect (fadeIn or fadeOut) the transition is ok and it doesn't appear the overlap layout in the body! Any ideas? Here is my jQuery code: $('.next').click(function(){ var currentSlide=$('.active-slide'); var nextSlide=currentSlide.next(); if(nextSlide.length === 0){ nextSlide= $('.slide').first(); } currentSlide.fadeOut(600).removeClass('active-slide'); nextSlide.fadeIn(600).addClass('active-slide'); }); } Here is my CSS code: .slide{ display:none; } .active-slide{ display:block; } .layout7{ float: left; width: 970px; height: 340px; } .layout7-2{ float: left; width: 970px; height: 340px; } .layout7-3{ float: left; width: 970px; height: 340px; } .layout7-4{ float: left; width: 970px; height: 340px; } Picture attached for visibility: Link Website link for visibility: Website
tagged with: css

http://stackoverflow.com/a/26928787
has comment: http://stackoverflow.com/comment/42407364
upvote count: 2
has comment: http://stackoverflow.com/comment/42407678
has comment: http://stackoverflow.com/comment/42409984
has comment: http://stackoverflow.com/comment/42403620
accepted answer of: http://stackoverflow.com/q/26928603
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42410278
downvote count: 0
has body: This will do it. Please let me know if you need more details. The future of manned space exploration and development of space depends critically on the creation of a dramatically more proficient propulsion architecture for in-space transportation. A very persuasive reason for investigating the applicability of nuclear power in rockets is the vast energy density gain of nuclear fuel when compared to chemical combustion energy... Here's a version with a generic function you can use for any element. The future of manned space exploration and development of space depends critically on the creation of a dramatically more proficient propulsion architecture for in-space transportation. A very persuasive reason for investigating the applicability of nuclear power in rockets is the vast energy density gain of nuclear fuel when compared to chemical combustion energy... To insert it right next to a word. I used span tags with red color for emphasis. You can of course add what ever you like. The future of manned space exploration and development of space depends critically on the creation of a dramatically more proficient propulsion architecture for in-space transportation. A very persuasive reason for investigating the applicability of nuclear power in rockets is the vast energy density gain of nuclear fuel when compared to chemical combustion energy... I've also added the words parameter to the switchText function to make it more generic as well. The fourth, and final condition is settled. The following will allow text on a specifically hovered word, or phrase. The future of manned space exploration and development of space depends critically on the creation of a dramatically more proficient propulsion architecture for in-space transportation. A very persuasive reason for investigating the applicability of nuclear power in rockets is the vast energy density gain of nuclear fuel when compared to chemical combustion energy... As a reminder using this method with certain types o…
type: Answer
answers question: http://stackoverflow.com/q/26928603
has comment: http://stackoverflow.com/comment/42403369
score: 2

http://stackoverflow.com/a/26857334
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26856929
answers question: http://stackoverflow.com/q/26856929
type: Answer
upvote count: 1
has body: First you have to understand your data structure. It is array of object with date property. For those every dates there are histogram array. So there will be array of array that need to iterate. I assume you will create one table for every stats date and in every row of that table you want to list histogram data. So we need to iterate date in table level. Later in row level we will iterate histogram array. The structure of the html will be like this below. You can see it live in this link. The example show the data initiated in local. But it will work same with data fetched from server. Furthermore read this documentation to get understand more with angular data iteration. Date age avg num_payments {{data.date}} {{histo.ages}} {{histo.avg}} ?

http://stackoverflow.com/comment/42454787
comment on: http://stackoverflow.com/a/26957781
score: 0
type: AnswerComment
type: Comment
has text: @Aravind got it... x is a reference and a copy of x is passed as obj. When modifying, it modifies the same object. When assigning a new object, the reference of the new object is assigned to obj. x doesn't change... Thanks..

http://stackoverflow.com/a/48053218
type: Answer
score: 0
has body: More information about onDomready. Below is how JSFiddle actually wraps our codes to run. They support the browsers which do not have addEventListener method to listen to DOMContentLoaded event. &lt;script type="text/javascript"&gt; //&lt;![CDATA[ var VanillaRunOnDomReady = function() { // Your own JS codes are placed here. } var alreadyrunflag = 0; if (document.addEventListener) document.addEventListener("DOMContentLoaded", function(){ alreadyrunflag=1; VanillaRunOnDomReady(); }, false); else if (document.all &amp;&amp; !window.opera) { document.write('&lt;script type="text/javascript" id="contentloadtag" defer="defer" src="javascript:void(0)"&gt;&lt;\/script&gt;'); var contentloadtag = document.getElementById("contentloadtag") contentloadtag.onreadystatechange=function(){ if (this.readyState=="complete"){ alreadyrunflag=1; VanillaRunOnDomReady(); } } } window.onload = function(){ setTimeout("if (!alreadyrunflag){VanillaRunOnDomReady}", 0); } //]]&gt; &lt;/script&gt;
answers question: http://stackoverflow.com/q/26985800

http://stackoverflow.com/q/26848289
has comment: http://stackoverflow.com/comment/42259393
has title: querySelector vs. getElementById
has comment: http://stackoverflow.com/comment/42259289
has answer: http://stackoverflow.com/a/26848360
score: 213
tagged with: dom
has answer: http://stackoverflow.com/a/26848416
type: Question
has body: I have heard that querySelector and querySelectorAll are new methods to select DOM elements. How do they compare to the older methods, getElementById and getElementsByClassName in terms of performance and browser support? How does the performance compare to using jQuery's query selector? What is the difference between querySelector and getElementById? When should we use querySelector instead of getElementById? Is there any example which is not possible using getElementById?
answer count: 2
has comment: http://stackoverflow.com/comment/99653534
tagged with: queryselector
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: getelementbyid
has comment: http://stackoverflow.com/comment/42259288
has comment: http://stackoverflow.com/comment/42259529
has comment: http://stackoverflow.com/comment/134309995
has comment: http://stackoverflow.com/comment/94636101
downvote count: 5
type: UnansweredQuestion
upvote count: 218

http://stackoverflow.com/comment/42272301
type: Comment
type: QuestionComment
has text: never extend the prototype of something like the native Array object inside a function called by an event handler like that.
score: 2
comment on: http://stackoverflow.com/q/26854934

http://stackoverflow.com/a/26877965
score: 0
has comment: http://stackoverflow.com/comment/42313291
has body: You could give this a try: EDITED //create new style element var style = document.createElement("style"); //append the style document.head.appendChild(style); //take the stylesheet object sheet = style.sheet //add the rule to your stylesheet -- changed this line to .insertRule sheet.insertRule('.progressbar::after { width: 50% }', 0); Updated fiddle
type: Answer
answers question: http://stackoverflow.com/q/26877850

http://stackoverflow.com/comment/42368130
score: 0
type: AnswerComment
type: Comment
has text: correct. it goes for list comprehensions as well. or if you do something like a `console.log` statement at the end of a function, it will return void, which is equally confusing.
comment on: http://stackoverflow.com/a/26906249

http://stackoverflow.com/comment/42302979
type: QuestionComment
has text: The form would need an `id` or a `name` to be referred to like that.
score: 2
comment on: http://stackoverflow.com/q/26872387
type: Comment

http://stackoverflow.com/comment/42503367
type: QuestionComment
comment on: http://stackoverflow.com/q/26984834
type: Comment
has text: Is this a homework problem?
score: 0

http://stackoverflow.com/a/54501728
type: Answer
score: 1
upvote count: 1
has body: You can use also $("div:eq(3)") to get the exact element. Best example is $("ul li:eq(3)")
downvote count: 0
answers question: http://stackoverflow.com/q/26988901

http://stackoverflow.com/comment/42386972
has text: Thanks for the quick reply. My real code uses if statements and business logic. I just wanted to simplify it for posting here `if(false && true || true) { /* do stuff */ }`. I guess I don't understand how precedence affects the outcome. I always thought that the first failed condition short circuits the operation and further evaluation stops.
comment on: http://stackoverflow.com/a/26919346
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/26895675
has answer: http://stackoverflow.com/a/26911313
tagged with: datatables
has comment: http://stackoverflow.com/comment/42345414
has body: I need an elegant way to store repeat data in select dropdowns within DataTables. For example, I have 2 questions and each question can have various answers. In this instance, question 1 (keyno 1) has 2 possible answers and question 2 (keyno 2) has 3 possible answers. In the fiddle example, there are 5 rows (which holds repeat information) yet there should only be 2 (one for each keyno). How can I dynamically create dropdowns holding the answers and only show my 2 rows, like a for loop? I'm not certain. http://jsfiddle.net/s827x/28/ var data = [ {'keyno': '1', 'quest': 'Does a cat meow?', 'ans': 'yes'}, {'keyno': '1', 'quest': 'Does a cat meow?', 'ans': 'no'}, {'keyno': '2', 'quest': 'What color is a stop sign?', 'ans': 'red'}, {'keyno': '2', 'quest': 'What color is a stop sign?', 'ans': 'yellow'}, {'keyno': '2', 'quest': 'What color is a stop sign?', 'ans': 'green'} ] $('#questtable').DataTable({ "data": data, "columns": [ { data: 'keyno' }, { data: 'quest' }, { data: 'ans' } ] });
tagged with: dynamic
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/42345991
score: 0
tagged with: for-loop
has title: Store repeat DataTables data in select dropdown?
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42345677

http://stackoverflow.com/q/26920027
has comment: http://stackoverflow.com/comment/42388382
tagged with: http://stackoverflow.com/tag/html
has title: Refactor Jquery function to be reusable
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26920179
accepted answer: http://stackoverflow.com/a/26920397
has answer: http://stackoverflow.com/a/26920205
type: Question
possible better answer: http://stackoverflow.com/a/26920179
has answer: http://stackoverflow.com/a/26920397
score: 1
tagged with: refactoring
has body: I wrote a Function that takes the offset of a container compares it to the windows scrolltop on scroll and fades in the content once the container is "X" amount of pixels from the top of viewport. Right now the function is specific to one container. I have another container on the page which I would like to run the same function on but being fairly new to jquery/javascript cannot figure out a way to refactor for reuse. $(function(){ // Get the offset of container and compare it to $(window).scrollTop var cont = $('.intro__skills-cont'); var contPos = cont.offset().top; var windowPos = $(window).scrollTop(); // Hide skillsContainer cont.addClass('is-hidden'); $(window).scroll(function(event){ windowPos = $(this).scrollTop(); if(windowPos > contPos - 250) { cont.removeClass('.is-hidden'); cont.addClass('is-fading-up'); } }); // end window scroll }); This is my current HTML Structure I would like to be able to run function on <use xlink:href="#shape-design" /> Design Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquam fugit illo pariatur ad dicta mollitia nulla provident repellendus doloribus at quam veniam cumque vitae neque, cupiditate, iusto, accusamus, tenetur perferendis. <use xlink:href="#shape-dev" /> Development Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquam fugit illo pariatur ad dicta mollitia nulla provident repellendus doloribus at quam veniam cumque vitae neque, cupiditate, iusto, accusamus, tenetur perferendis. Portfolio I know this may seem like I am asking for free work but really just looking for a push in the right direction. This is my latest attempt but it errors out on contPos any help is greatly appreciated. Cheers! function fadeUp(containerClass) { var cont = "$('." + containerClass + "')"; var contPos = cont.offset().top; var windowPos = $(window).scrollTop(); cont.addClass('is-hidden'); $(window).scroll(function(event){ windowPos = $(this).scrollTop(); if(windowPos > contPos - 250) { cont.removeClass('.is-hidden…
answer count: 3
upvote count: 1
tagged with: function
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/42337420
type: QuestionComment
has text: So what isn't working about your code?
score: 1
comment on: http://stackoverflow.com/q/26891802
type: Comment

http://stackoverflow.com/comment/42376763
type: Comment
comment on: http://stackoverflow.com/a/26913257
type: AnswerComment
score: 0
has text: correct, you now need a page with og tags for EVERYTHING you want to share.

http://stackoverflow.com/a/26974821
has comment: http://stackoverflow.com/comment/132207968
score: 0
downvote count: 2
answers question: http://stackoverflow.com/q/26965171
has body: Unfortunately, you would need an equivalent of the C function frexp. The best I've been able to find is in JSFiddle, and its code uses Math.pow. There are a couple of alternatives you could benchmark, using real data, along with your current attempt: Starting at 1.0, multiply repeatedly by 2.0 until it is greater than or equal to the input, then multiply by 0.5 until it is less than or equal to the input. You would need special handling for values at the ends of the double range. Store an ascending value array of all the exact powers of two in the double range, and do a binary search. The first one is likely to be fastest if your data is typically close to 1.0. The second one requires up to 11 conditional branches.
upvote count: 2
type: Answer

http://stackoverflow.com/a/26833181
has comment: http://stackoverflow.com/comment/42236007
has comment: http://stackoverflow.com/comment/42233227
type: Answer
answers question: http://stackoverflow.com/q/26832580
score: 0
has body: Here's a jsFiddle that will remove duplicates in the middle column of your data array: http://jsfiddle.net/bonneville/xv90ypgf/ var sortedAr = ar.sort(sortOnMiddleText); var noDupsAr = removeDups(sortedAr); Firstly is sorts on the middle column, and then it removes the duplicates. The code is pure javascript but uses jQuery to display the results. (I would prefer to use javaScript forEach instead of the for loop but it is not supported on all browsers so you would need a polyfill.)

http://stackoverflow.com/q/26879501
has comment: http://stackoverflow.com/comment/42328221
accepted answer: http://stackoverflow.com/a/26888775
has comment: http://stackoverflow.com/comment/42330640
has comment: http://stackoverflow.com/comment/42329761
has comment: http://stackoverflow.com/comment/42327558
has comment: http://stackoverflow.com/comment/42329181
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42328458
has title: Jquery function not executing properly
has comment: http://stackoverflow.com/comment/42330250
has comment: http://stackoverflow.com/comment/42328830
has comment: http://stackoverflow.com/comment/42325014
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42323542
has comment: http://stackoverflow.com/comment/42330026
has comment: http://stackoverflow.com/comment/42330083
possible better answer: http://stackoverflow.com/a/26883791
tagged with: jcrop
has answer: http://stackoverflow.com/a/26888775
type: Question
has comment: http://stackoverflow.com/comment/42330066
score: 0
has comment: http://stackoverflow.com/comment/42327067
answer count: 2
has answer: http://stackoverflow.com/a/26883791
has comment: http://stackoverflow.com/comment/42330383
tagged with: php
has body: Okay, so here is my code: //Other Jquery codes // show_popup_crop : show the crop popup function show_popup_crop(url) { alert("Called show_popup_crop!"); // change the photo source $('#cropbox').attr('src', url); // destroy the Jcrop object to create a new one try { jcrop_api.destroy(); } catch (e) { // object not defined } // Initialize the Jcrop using the TARGET_W and TARGET_H that initialized before $('#cropbox').Jcrop({ aspectRatio: 1, setSelect: [ 100, 100, TARGET_W, TARGET_H ], onSelect: updateCoords },function(){ jcrop_api = this; }); // store the current uploaded photo url in a hidden input to use it later $('#photo_url').val(url); // hide and reset the upload popup $('#display_pic_input_first').val(''); // show the crop popup $('#popup_crop').show(); } // crop_photo : function crop_photo() { var x_ = $('#x').val(); var y_ = $('#y').val(); var w_ = $('#w').val(); var h_ = $('#h').val(); var photo_url_ = $('#photo_url').val(); // hide thecrop popup $('#popup_crop').hide(); // display the loading texte $('.loading').css('display','inherit'); // crop photo with a php file using ajax call $.ajax({ url: 'crop_photo.php', type: 'POST', data: {x:x_, y:y_, w:w_, h:h_, photo_url:photo_url_, targ_w:TARGET_W, targ_h:TARGET_H}, success: function(data){ // display the croped photo } }); } // updateCoords : updates hidden input values after every crop selection function updateCoords(c) { $('#x').val(c.x); $('#y').val(c.y); $('#w').val(c.w); $('#h').val(c.h); } //document.ready function calls What is happening: The function show_popup_crop(url){} ain't working. Now the function is being called, because the alert("Called show _popup_crop!"); is being executed. But it isn't executing the rest of the code that is the part where it needs to change the attributes of the image tag and the divisions. I have tried changing the position of this script in the JS file but it doesn't help. A PHP code automatically generates a script which is included in the body: PHP code within the s…
has comment: http://stackoverflow.com/comment/42330369
has comment: http://stackoverflow.com/comment/42333089
has comment: http://stackoverflow.com/comment/42326356
has comment: http://stackoverflow.com/comment/42329288
has comment: http://stackoverflow.com/comment/42331822
linked to: http://stackoverflow.com/q/3698200
has comment: http://stackoverflow.com/comment/42325487
has comment: http://stackoverflow.com/comment/42322399

http://stackoverflow.com/comment/42467138
has text: can you please make jsfiddle?
score: 0
comment on: http://stackoverflow.com/q/26964664
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/42482193
comment on: http://stackoverflow.com/a/26971964
type: Comment
has text: actually i done using the auto complete input text, if the user search for a particular lat long than it shows the marker on the google maps , and now according to requirement i have to add the border to the particular lat long border with blink...i am struggling for this since 10 days..please help
score: 0
type: AnswerComment

http://stackoverflow.com/q/26981785
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/42498423
has comment: http://stackoverflow.com/comment/42497832
has comment: http://stackoverflow.com/comment/42498003
type: Question
tagged with: file-get-contents
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/42497589
has answer: http://stackoverflow.com/a/26983107
score: 0
has body: I have one file named ad.php. In this file i load some ads from external pages. (ad.php): &lt;script type='text/javascript' src='www.example.org'&gt;&lt;/script&gt;... And one file named: (index.php). I want to load the contents of the file ad.php finished and then spend it in the index.php file. I don't want, that the user loads the javascript files. i tried some ways: file_get_contents curl But the javascript files were loaded in the index.php by the user. Is it possible to load the ad.php externally using php?
tagged with: external
tagged with: curl
has title: Load a file with javascript externally using php
has comment: http://stackoverflow.com/comment/42497642

http://stackoverflow.com/q/26832650
tagged with: javascript
answer count: 1
has body: I'm trying to create a web app with an image upload feature which will upload an image to a user's google drive &amp; returns absolute path of the uploaded image by making use of google drive picker my Generate Picker function var picker=new google.picker.PickerBuilder() .addView(new google.picker.DocsUploadView()) .addView(new google.picker.DocsView()) .setOAuthToken(oauthToken) .setDeveloperKey("[MY_API]") .setCallback(imageReceived) .build(); picker.setVisible(true); callback function function imageReceived(data) { if (data.action == google.picker.Action.PICKED) { console.log(data.docs[0].url); } I'm able to generate the picker and the file upload also works however in my upload callback function url is returned in this form https://docs.google.com/file/d/[something]/edit?usp=drive_web this url can't be used in an img tag as it is not the absolute path of the image uploaded So how should I get the absolute path ?
favorite count: 0
tagged with: google-drive-api
upvote count: 2
has answer: http://stackoverflow.com/a/26832705
type: AnsweredQuestion
score: 2
has title: files absolute path after upload in Google drive picker
type: Question
accepted answer: http://stackoverflow.com/a/26832705
downvote count: 0

http://stackoverflow.com/comment/54577112
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26837604
type: AnswerComment
has text: 100vh may be bigger than window.innerHeight if viewing on safari mobile, for example, due to the overlayed nav buttons

http://stackoverflow.com/a/37874335
score: 0
has body: Can you try the below simple logic. Convert js object into new String and again convert as object. E.g: var car = {type:"Fiat", model:"500", color:"white"}; var cloneStr = new String(JSON.stringify(car)); var carClone = JSON.parse(cloneStr); carClone.type = "Maruthi"; alert(JSON.stringify(car)) ; alert(JSON.stringify(carClone)) ;
answers question: http://stackoverflow.com/q/26877597
type: Answer

http://stackoverflow.com/q/26951994
has answer: http://stackoverflow.com/a/26952039
possible better answer: http://stackoverflow.com/a/26952156
type: Question
has answer: http://stackoverflow.com/a/26952156
accepted answer: http://stackoverflow.com/a/26952039
tagged with: javascript
tagged with: jquery
answer count: 2
has body: I have the following html Home About Contact I want to override some css property of a li only if the next li class is active. My css is ul li{ color:#eee } ul li.active{ color:#000; } So I want to add a border to that li whose next li class is active.So in this case I want to add a border to home.It can't be same all the time as if the active class is set for contact then I would like to add a border for about us. I am not sure if this can be done using css or javascript. Any suggestion/hint is highly welcomed. Thanks in advance.
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
favorite count: 0
upvote count: 1
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42444667
has title: Get previous li of active class

http://stackoverflow.com/comment/42432587
type: Comment
comment on: http://stackoverflow.com/a/26944273
has text: "Only if the index is a numeric value" is a bit misleading -- anything but numeric property names does *not* behave like indices for arrays, and you certainly won't have these properties come up in any typical loop over an array.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42415631
has text: Could be, but that's beyond my knowledge so then I don't think I can help any further :(
type: Comment
comment on: http://stackoverflow.com/a/26935380
score: 0
type: AnswerComment

http://stackoverflow.com/a/26895757
has comment: http://stackoverflow.com/comment/42345609
upvote count: 4
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/42345377
answers question: http://stackoverflow.com/q/26895684
type: Answer
has body: You can kill the sentinel before creating the new event. The rootScopeOn variable will stay untouched after creating new controllers, so you can kill it every time you initialize it again. app.factory('HelloWorldFactory', function($rootScope) { var rootScopeOn; // setup event subscription on initialization function HelloWorldFactory() { console.log('init helloWorldFactory'); if (typeof rootScopeOn === 'function') { rootScopeOn(); } rootScopeOn = $rootScope.$on('test', function() { console.log('test sub', Math.random()); }); } return HelloWorldFactory; }); // child ctrl will init a new factory instance app.controller('ChildCtrl', function($scope, HelloWorldFactory) { $scope.name = 'Child'; var helloWolrdFactory = new HelloWorldFactory($scope); });

http://stackoverflow.com/a/26899895
score: 0
has comment: http://stackoverflow.com/comment/42353907
answers question: http://stackoverflow.com/q/26899445
type: Answer
has comment: http://stackoverflow.com/comment/42356611
has comment: http://stackoverflow.com/comment/42353978
has comment: http://stackoverflow.com/comment/42352884
has comment: http://stackoverflow.com/comment/42353619
has comment: http://stackoverflow.com/comment/42391159
has body: Instead of $.post('views/articles_list.php', {'page':(page_num)}); try $.post('views/articles_list.php', {page:page_num}, function(data){ console.log(data); },'json'); And also double check if 'views/articles_list.php' is the correct path. If you were using Chrome, kindly read the parsing via right click -> inspect elements -> Network. Addition(After posted your edit code) :- Please remove the Doctype and HTML and leave something like this. <?php include("../config/connection.php"); include('../config/css.php'); $results = mysqli_query($dbc_connection,"SELECT COUNT(*) FROM articles"); $get_total_rows = mysqli_fetch_array($results); //total records //break total records into pages $pages = ceil($get_total_rows[0]/$item_per_page); //create pagination if($pages > 1) { $pagination = ''; $pagination .= ' '; for($i = 1; $i<=$pages; $i++) { $pagination .= ' '.$i.' '; } $pagination .= ' '.$page_number.' '; // only to check if variable is passed $pagination .= ' '; } //Assuming you're doing ajax here. so either pagination or page number posting back? if both try below. $page_number = $_POST["page"]; echo json_encode(array("pagination"=>$pagination,"pageNumber"=>$page_number)); ?> Hope it helps.
has comment: http://stackoverflow.com/comment/42353806

http://stackoverflow.com/q/26929693
has comment: http://stackoverflow.com/comment/42404828
has answer: http://stackoverflow.com/a/26929762
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26931825
tagged with: css
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/26931825
accepted answer: http://stackoverflow.com/a/26929762
type: Question
score: 0
answer count: 2
has body: I am trying to make a menu. The problem is, when i try to reduce the screen below 600width, the menu disappears because of responsive nature. I want so that the menu items go to next line just like text. How can i achieve this behavior? <li <?php echo $menuItem=='dashboard' ? 'class="current-menu-item"' : 'parent'?>>Home <li <?php echo $menuItem=='submitForm' ? 'class="current-menu-item"' : 'parent'?>>Submit Sale <li <?php echo $menuItem=='sales' ? 'class="current-menu-item"' : 'parent'?>>My Sales <li <?php echo $menuItem=='help' ? 'class="current-menu-item"' : 'parent'?>>Help <li <?php echo $menuItem=='intro' ? 'class="current-menu-item"' : 'parent'?>>Incentive Program Code My CSS File @import url(http://fonts.googleapis.com/css?family=Open+Sans); body { background-color: #eee; background-image: url(../images/patterns/light_toast.png); color: #666; font-family: 'Open Sans', sans-serif; font-size: 12px; margin:0px; padding:0px; } a { color: #23dbdb; text-decoration: none; } a:hover { color: #000; } ol, ul { list-style: none; padding:0px; margin:0px; } #wrap { margin: 0 auto; } .inner { margin: 0 auto; max-width: 940px; padding: 0 40px; } .relative { position: relative; } .right { float: right; } .left { float: left; } /* HEADER */ #wrap > header { background-color: #333; padding-bottom: 20px; } .logo { display: inline-block; font-size: 0; padding-top:15px; } #navigation { position: absolute; right: 40px; bottom: 0px; } #menu-toggle { display: none; float: right; } /* HEADER > MENU */ #main-menu { float: left; font-size: 0; margin: 10px 0; } #main-menu > li { display: inline-block; margin-left: 30px; padding: 2px 0; } #main-menu > li.parent { background-image: url(../images/plus-gray.png); background-size: 7px 7px; background-repeat: no-repeat; background-position: left center; } #main-menu > li.parent > a { padding-left: 14px; } #main-menu > li > a { color: #666; font-size: 13px; line-height: 14px; padding: 30px 0; text-decoration:none; } #main-menu > li:hover > a, …
has title: How to adjust responsive behaviour of menu bar's elements
tagged with: javascript
tagged with: jquery

skype-uri.js
type: Tag
tag name: skype-uri.js
tags question: http://stackoverflow.com/q/26911276

http://stackoverflow.com/comment/42338215
has text: You're welcome (*de rien*) Pierre. No need to make it more complicated, I was just pointing it out. The OP can Google the rest ;)
type: AnswerComment
comment on: http://stackoverflow.com/a/26892053
score: 0
type: Comment

http://stackoverflow.com/a/26854507
has body: I had this problem once, It was something to do with JavaScript not liking the Razor Objects: I fixed it like this: @foreach (var cartItem in (List<LoginTest.Models.CartItem>)ViewBag.Data) { } Then you don't need toString() var AddRows = function (productName,productPrice,productQty) { var $html = $(' ' ' '+productName+' ' + ' '+productPrice+' ' + ' '+productQty+' ' + ' '); //$(html).appendTo($("#Table1")); $('#Table1 > tbody:last').append($html); };
score: 0
accepted answer of: http://stackoverflow.com/q/26854386
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26854386
has comment: http://stackoverflow.com/comment/42272413
has comment: http://stackoverflow.com/comment/42282212
type: Answer

http://stackoverflow.com/q/26918724
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42385773
type: Question
has title: Bootstrap side menu navigation issue
has body: I have totally 5 pages for my site. In that, 2 main pages have sub menus/pages. I am using + and - icons for users to know there is sub menus in the website. When I click on submenu li it toggles + and - icon. However, when I click on + button and again I click on second + button the previous submenu closes however the icon is not changing from - to +. Jquery: if (li.hasClass("open") &amp;&amp; li.children("ul:visible").size()) { li.children("ul").slideUp().parent('li').removeClass("open"); li.children("ul").slideUp().parent('li').children("a").children("span").removeClass("open") ; } else { li.children("ul").slideDown().parent('li').addClass("open"); li.children("ul").slideDown().parent('li').children("a").children("span").addClass("open"); } html page structure: home about services 3.1 service 1 3.2 Service 2 Works 4.1. Works1 4.2. works 2 Contact I am using bootstrap 3. Looking for side menu similar to http://startbootstrap.com/template-overviews/sb-admin-2/
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/26921791
has comment: http://stackoverflow.com/comment/42386120
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42391238
answer count: 1
has comment: http://stackoverflow.com/comment/42391122
tagged with: twitter-bootstrap

http://stackoverflow.com/comment/42254229
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/26845218
has text: as html and .data('val1') in jQuery
type: Comment

http://stackoverflow.com/a/26877437
upvote count: 1
score: 1
has body: Ok. Looking through the source it appears that the AngularStrap typeahead is "label" aware. Meaning if an "label" object property is found it will use that. Updated Fiddle: http://jsfiddle.net/cyberwombat/nur5oqqa/2/ So the object needs to be: { label: '1001 Main St', geo: { lat: '123', lng: '234' } } And code: &lt;input type="text" class="form-control" ng-model="item.venue" ng-options="address as address.label for address in getLocation($viewValue)" placeholder="Enter address" bs-typeahead&gt;
downvote count: 0
answers question: http://stackoverflow.com/q/26874562
type: Answer

http://stackoverflow.com/comment/42326127
has text: I can't understand with this html?Will give more details what is your code? Which framework you are using if any?
comment on: http://stackoverflow.com/q/26885573
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26904972
type: Question
upvote count: 2
has body: I saw some similar questions, but they didn't give me a solution. I would like my footer show (slideUp) when reaching the bottom of the page and hide again when scrolling towards the top. Now i'm using a script that shows the footer after a certain amount of scrolling. Here the Fiddle Does anyone know how? $(window).scroll(function() { if ($(this).scrollTop() &gt; 10) { $( 'footer').slideDown(300); } else { console.log('there'); $('footer').slideUp(300); } });
tagged with: javascript
tagged with: footer
favorite count: 0
answer count: 3
has answer: http://stackoverflow.com/a/26905090
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Show footer when reaching bottom of page
downvote count: 0
has answer: http://stackoverflow.com/a/26905294
tagged with: scroll
accepted answer: http://stackoverflow.com/a/26905294
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/26905090
has answer: http://stackoverflow.com/a/26905080

http://stackoverflow.com/q/26963836
tagged with: http://stackoverflow.com/tag/html
has title: How to make list items clickable upon append?
tagged with: list
has answer: http://stackoverflow.com/a/26963855
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26963855
linked to: http://stackoverflow.com/q/203198
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
tagged with: click
duplicate of: http://stackoverflow.com/q/203198
has body: (I'll try to keep the question simple for now, since I don't really know how to go about this.) I have to change unordered list elements inside an html file by 1.) Create a DOM fragment ( for each of the new &lt;li&gt; ) in javascript. 2.) Remove the original batch of &lt;li&gt; in the ul. 3.) Append each new DOM fragment into the ul 4.) Make each of the new &lt;li&gt; elements clickable again Clicking on a &lt;li&gt; element removes the contents of the ul and replaces it with a new batch (the batch varies from 0 &lt;li&gt; to 6 &lt;li&gt; elements (depending on which element you clicked)) The first problem I'm having is that there is no way to create multiple elements clickable in one go (for loops doesnt work) so at the moment im just repeating the functions I have. $( "#choices" ).children().eq(0).click(function() { selectChoice(allChoices, $( "#choices" ).children().eq(0).text()); }); $( "#choices" ).children().eq(1).click(function() { selectChoice(allChoices, $( "#choices" ).children().eq(1).text()); }); // more li elements to make clickable Second, when you remove a li element and put back a new element, you have to make it clickable, but since you dont know the number of elements and for loops dont work, I can't add a function upon creation. Not all elements follow the same format also, so simply modifying the existing li isnt an option. Is there a simple way that I don't know about that does what I want it to do..?

http://stackoverflow.com/comment/42406661
comment on: http://stackoverflow.com/q/26916104
type: QuestionComment
has text: So nobody knows this?
type: Comment
score: 0

http://stackoverflow.com/a/26924175
type: Answer
answers question: http://stackoverflow.com/q/26923194
has body: Never mind. I was able to solve the problem. I removed all this from the index method: respond_to do |format| format.json { render :update do |page| page.replace_html 'messages', :partial =&gt; 'list', :locals =&gt; {:messages =&gt; @messages} end } format.html end And then I created a create.js.erb file, identical to the list.html.erb file, but replacing: &lt;% messages.each do |message| %&gt; &lt;%= message.stuff %&gt; &lt;%= message.moreStuff %&gt; etc.. &lt;% end %&gt; with: &lt;%= @the_message.stuff %&gt; &lt;%= @the_message.moreStuff %&gt; etc..
score: 0

http://stackoverflow.com/comment/42334379
has text: @Rhumborl I am trying it from console ,how do i change the context in console so that commands from console can work their magic on the elements in the frame
comment on: http://stackoverflow.com/q/26890065
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42345194
type: QuestionComment
comment on: http://stackoverflow.com/q/26895761
has text: @VahidND Yeah, this code isn't correct, but sometimes Codecademy doesn't accept answers that are correct, but are not permitted as "acceptable" answers because of the rigid/specific syntax that is sometimes required. If Andrew believed his code *was* correct, which he wasn't sure about, Codecademy's Q/A section would be a good resource for him in addition to S.O.
score: 1
type: Comment

http://stackoverflow.com/q/26847292
has body: I have jquery javascript file that calls modal this way, this is in the js script $("#dialog_f").dialog({autoOpen: false, modal: true, width: 400}); $("#dialog_p").click(function() { $("#dialog_f").dialog('open'); console.log('modal called'); }); And this is in the jsf xhtml page Update Fault This works fine in a normal page but in a jsf dataTable i noticed it calls the last Object in the list from a managed bean and doesnt popup the modal. i noticed this by printing the console.log in the js file. is there a possibility that the id is been rendered in the list and the controller doesnt know which button is supposed to call the modal ? <ui:define name="content"> <h:dataTable var="fau" value="#{faultController.allFaultsT}" > <h:column > <f:facet name="header" > Fault Id </f:facet> <h:outputText value="#{fau.faultId}" /> </h:column> <h:column > <f:facet name="header" > action </f:facet> Update Fault </h:column> </h:dataTable> </ui:define> N.B Alternatively, using a class pops up the all the modals which is a bad idea ;)
type: AnsweredQuestion
tagged with: jsf
accepted answer: http://stackoverflow.com/a/26862766
type: Question
tagged with: jsf-2
has answer: http://stackoverflow.com/a/26862766
possible better answer: http://stackoverflow.com/a/26847504
has title: how to call a j-query modal dialog in jsf dataTable
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/26847504

http://stackoverflow.com/q/26965171
type: Question
tagged with: ieee-754
has answer: http://stackoverflow.com/a/35111029
answer count: 8
has comment: http://stackoverflow.com/comment/42468060
accepted answer: http://stackoverflow.com/a/74916422
score: 18
tagged with: javascript
has comment: http://stackoverflow.com/comment/42467902
has comment: http://stackoverflow.com/comment/42483320
has body: Is there any faster alternative to the following expression: Math.pow(2,Math.floor(Math.log(x)/Math.log(2))) That is, taking the closest (smaller) integer power of 2 of a double? I have such expression in a inner loop. I suspect it could be much faster, considering one could just take the mantissa from the IEEE 754 representation of the double.
has comment: http://stackoverflow.com/comment/42468013
has title: Fast nearest power of 2 in JavaScript?
has answer: http://stackoverflow.com/a/74915483
has answer: http://stackoverflow.com/a/42799104
has comment: http://stackoverflow.com/comment/132208090
favorite count: 0
linked to: http://stackoverflow.com/q/9383593
has answer: http://stackoverflow.com/a/26974821
has answer: http://stackoverflow.com/a/75115534
possible better answer: http://stackoverflow.com/a/42799104
tagged with: double
has comment: http://stackoverflow.com/comment/72750833
has answer: http://stackoverflow.com/a/74915038
has answer: http://stackoverflow.com/a/74916422
downvote count: 1
type: AnsweredQuestion
upvote count: 19
has answer: http://stackoverflow.com/a/74915402
has comment: http://stackoverflow.com/comment/42467890
tagged with: bit-manipulation
linked to: http://stackoverflow.com/q/466204

http://stackoverflow.com/a/26845292
has comment: http://stackoverflow.com/comment/42253858
downvote count: 0
answers question: http://stackoverflow.com/q/26845161
score: 1
has body: try the following $(document).ready(function(){ $("div[id$=Serv]").each(function(){ if($(this).is(':empty')){ $(this).hide(); } else{ $(this).show(); } }); }); Hope it helps ....
upvote count: 1
type: Answer

http://stackoverflow.com/q/26934029
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26934194
type: Question
has comment: http://stackoverflow.com/comment/42414729
has comment: http://stackoverflow.com/comment/42412883
has title: slideshow jumping from slide 2 to 5 js
answer count: 1
has body: Im working with this slide show that i found online, the slideshow is working fine it has some indicator buttons(those buttons that show in what picture you are) also has some arrows that allow you to move to the next photo or to go back. this slide show is using boostrap. Thanks to newman now the play/pause is included, but for some reason it jumps from slide 2 to slide 5, how can fix this :/ HTML code: Slide 1 Slide 2 Slide 3 Slide 4 Slide 5 Slide 6 Js $(document).ready(function(){ initSlideshow(); play() }); var slideCount, currentSlide; play() function initSlideshow(){ slideCount = 0; //count the slides in slideshow $('#slideshow .slide').each(function(){ slideCount++; }); currentSlide = 1; jump(); } function play() { next(); setInterval(function() { play()}, 1000 ); } function next(){ //remove active class from current slide & indicator $('#slideshow #s' + currentSlide).removeClass('active'); $('#slideshow #i' + currentSlide).removeClass('active'); //increment index if(currentSlide == slideCount){ currentSlide = 1; } else{ currentSlide++; } //add active class to new current slide & indicator $('#slideshow #s' + currentSlide).addClass('active'); $('#slideshow #i' + currentSlide).addClass('active'); } function previous(){ //remove active class from current slide & indicator $('#slideshow #s' + currentSlide).removeClass('active'); $('#slideshow #i' + currentSlide).removeClass('active'); //decrement index if(currentSlide == 1){ currentSlide = slideCount; } else{ currentSlide--; } //add active class to new slide & indicator $('#slideshow #s' + currentSlide).addClass('active'); $('#slideshow #i' + currentSlide).addClass('active'); } function jump(){ $('#indicators a').click(function(e){ e.preventDefault(); //remove active class from current slide & indicator $('#slideshow #s' + currentSlide).removeClass('active'); $('#slideshow #i' + currentSlide).removeClass('active'); //change current slide index currentSlide = $(this).attr('href').slice(2); //add active class to n…
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/42412939
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/26934194
has comment: http://stackoverflow.com/comment/42414862
has comment: http://stackoverflow.com/comment/42412732

http://stackoverflow.com/comment/42447447
comment on: http://stackoverflow.com/a/26953534
has text: cheers for the answer mate, as you said, your method is slightly longer. So i think i'll just stick with the method im using. Just thought there was an easier way to do it. cause adding each one together like that looks so amateur :P
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/42345405
has text: what you just said is exactly what I was trying to do with desk_# ID because I thought that going through it that way was a good idea, but now that you mention using "desk_B20" as ID is even better. I will change the PHP script to replace the those values. How will the JS part change in that case? thanks
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26895448

http://stackoverflow.com/q/26895267
answer count: 1
tagged with: mongodb
tagged with: javascript
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26895401
downvote count: 0
score: 1
favorite count: 0
type: Question
has body: Pretty simple one, I have the following query and output: &gt; db.TRACKING_DATA.find({'_id': ObjectId('5463b1e3454208dd1bcfbc5c')},{'lastruntime':1, _id:0}) { "lastruntime" : ISODate("2014-11-07T19:12:12Z") } I want it to return just: ISODate("2014-11-07T19:12:12Z") So I can use this is an input for a cron script, I am doing all of this on the mongoshell. Cheers,
accepted answer: http://stackoverflow.com/a/26895401
has title: Mongodb returning value without fieldname
upvote count: 1

http://stackoverflow.com/comment/43620719
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26978745
has text: Seems there are so many odd issues. I can get the page to load w/ your code, but there are no errors showing up, and it's not working quite right. Do you know what would cause that?
type: AnswerComment

http://stackoverflow.com/q/26840571
score: 0
has body: I give example with google maps, than we zooming in google maps sending new pictures of maps, but problem in my project is than i use zoom one time it's good because load new images, but than i use two or more zooms, example if i zoom three times very fast: me browser making queue first download first zoom images, second download second zoom images, and third download third zoom images, but i need just download only third zoom images. Maybe somebody can advise to try something load images script example: var imageURLs=[]; imageURLs.push('https://developer.chrome.com/webstore/images/calendar.png'); imageURLs.push('http://www.w3schools.com/html/html5.gif'); imageURLs.push('http://www.linosartele.lt/wp-content/uploads/2014/08/images-9.jpg'); var imgs=[]; var imagesOK=0; loadAllImages(start); function loadAllImages(callback){ for (var i=0; i&lt;imageURLs.length; i++) { var img = new Image(); imgs.push(img); img.onload = function(){ imagesOK++; if (imagesOK&gt;=imageURLs.length ) { callback(); } }; img.src = imageURLs[i]; } } function start(){ bgCtx.drawImage(imgs[0], 000,0, 100, 100); bgCtx.drawImage(imgs[1], 100,0, 100, 100); bgCtx.drawImage(imgs[2], 200,0, 100, 100); }
tagged with: canvas
answer count: 1
has answer: http://stackoverflow.com/a/26840777
type: UnansweredQuestion
has title: JavaScript how to cancel downloading images
tagged with: http://stackoverflow.com/tag/html
type: Question
tagged with: javascript

http://stackoverflow.com/comment/42541344
type: QuestionComment
has text: I never knew that html & body tags did not default to 100% width/height. Lesson learned.
score: 0
comment on: http://stackoverflow.com/q/26917348
type: Comment

http://stackoverflow.com/q/26962135
score: 0
has answer: http://stackoverflow.com/a/26962330
answer count: 1
tagged with: jquery
type: UnansweredQuestion
tagged with: slider
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42462481
has body: I have a very simple jquery slider that rotates elements. http://jsfiddle.net/cQdTq/9/ Issue #1: I can't figure out how to reverse the sliding direction. Currently slides bottom to top, and I'd like to slide top to bottom. Issue #2: When run in JSFiddle, it doesn't keep cycling through in CHROME (only cycles once and stops). FireFox and IE work ok. When I run in a different simulator (codepen.io), it seems to work in Chrome. Issue #3: (because I'm supper jquery newbie) what exactly do I need to put in the HTML file to call the script, and what should I name the script file? Code: HTML: slide 1 slide 2 slide 3 slide 4 JS: jQuery(document).ready(function ($) { setInterval(function () { move(); }, 1500); var slideCount = $('#slider ul li').length; var slideHeight = $('#slider ul li').height(); function move() { $('#slider ul').animate({bottom: - slideHeight}, 1000, function () { $('#slider ul li:last-child').prependTo('#slider ul'); $('#slider ul').css('bottom', ''); }); }; }); CSS: body { background: #888; } #slider { position: relative; overflow: hidden; margin: 20px auto; background:#fff; width: 300px; height: 200px; } #slider ul { position: relative; list-style: none; } #slider ul li { font-size: 50px; position: relative; width: 300px; height: 200px; text-align: center; line-height: 200px; }
has title: simple jquery slider - (1) Reverse slide direction and (2) Chrome compatible
has comment: http://stackoverflow.com/comment/42462373
type: Question
tagged with: jquery-ui-slider
tagged with: javascript

http://stackoverflow.com/q/26969352
linked to: http://stackoverflow.com/q/14220321
has comment: http://stackoverflow.com/comment/42505813
has body: I have this below AJAX function that will access an ASMX web service and generate a JSON response. The JSON is generating well. I want to pass this generated JSOn to an outside variable that in another function. function setJsonSer() { var strWsUrl = 'https://www.googleapis.com/analytics/v3/data/ga? ids=ga%3A76546294&amp;dimensions='+ 'ga%3Asource&amp;metrics=ga%3Ausers&amp;sort=-ga%3Ausers&amp;start- date='+retStartDate()+'&amp;end-date='+retEndDate()+'&amp;max-results=10'; formData = { 'Email': 'clientlink@client.com', 'Password': 'password', 'URL': strWsUrl }; $.ajax({ url: "/APIWebService.asmx/AnalyticsDataShowWithPost", type: 'POST', data: formData, complete: function(data) { var responseText = data.responseText; /****01****/ var responseJson = JSON.parse(responseText.match(/[{].*.[}]/)); console.log(responseJson); Load(JSON.stringify(responseJson)); } }); } You can see that /****01****/ is showing the JSON response is passing to another variable within the same function. I tried 'return' statement but it was not helpful. So what do I have to do to solve this problem? Could you someone to solve this? UPDATE I want to pass this responseJson to the follwoing function Load(). It should replace the rowData value. So what are you guys suggesting me? function Load(){ //----------------------------------------------- Rohan var labels = new Array(); var values = new Array(); var catogories = new Array(); var arrayOfArray = new Array(); var rowData = ??????????????; console.log("'RowData' is " + typeof rowData ); inData = JSON.parse(rowData); var count = 0; var headers = new Array(); for (var i = 0; i &lt; inData.columnHeaders.length; i++) { headers[i] = inData.columnHeaders[i].name; } var dates = new Array(); var pageViews = new Array(); var uniqueViews = new Array(); for (var key in inData.rows) { dates[key] = inData.rows[key][0]; pageViews[key] = parseInt(inData.rows[key][1]); uniqueViews[key] = parseInt(inData.rows[key][2]); } $('#container_2').highcharts({ chart: {…
linked to: http://stackoverflow.com/q/5316697
type: AnsweredQuestion
has title: Getting a variable value from an AJAX function to outside
has comment: http://stackoverflow.com/comment/42481493
accepted answer: http://stackoverflow.com/a/26969477
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/42477927
type: Question
has answer: http://stackoverflow.com/a/26969477
answer count: 1
has comment: http://stackoverflow.com/comment/42476932
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/42475096

http://stackoverflow.com/q/26934602
accepted answer: http://stackoverflow.com/a/26936521
has comment: http://stackoverflow.com/comment/42416813
answer count: 1
tagged with: javascript
tagged with: sharepoint
tagged with: rest
tagged with: angularjs
has comment: http://stackoverflow.com/comment/42416933
has answer: http://stackoverflow.com/a/26936521
has title: $resource:badcfg when calling sharepoint rest service using angular
has body: I have an old sample app that calls a rest service and its something like this: This app does not use angularJS. var listName = "Events"; // the url to use for the REST call. var url = SPAppWebUrl + "/_api/SP.AppContextSite(@target)" + // this is the location of the item in the parent web. This is the line // you would need to change to add filters, query the site etc // "/web/lists/getbytitle('" + listName + "')/items?" + "/web/lists/getbytitle('" + listName + "')/items?$select=Title,Category,EventDate,Description,EncodedAbsUrl,ID" + "&amp;@target='" + SPHostUrl + "'"; // create new executor passing it the url created previously var executor = new SP.RequestExecutor(SPAppWebUrl); // execute the request, this is similar although not the same as a standard AJAX request executor.executeAsync( { url: url, method: "GET", headers: { "Accept": "application/json; odata=verbose" }, success: function (data) { // parse the results into an object that you can use within javascript var results = JSON.parse(data.body); var events = []; The problem is in my new app, I have created an app using angular that reads data from a sharepoint list using rest, however I am struggling with the $resource.query and its options. I get the error in the title of this post, BADCFG, which means I am not using the right options, I didnt find in the documentation, how to set the Headers, Accept option in my code. The code is as follows: App.Js var SPHostUrl; var SPAppWebUrl; var ready = false; $(document).ready(function () { var params = document.URL.split("?")[1].split("&amp;"); for (var i = 0; i &lt; params.length; i = i + 1) { var param = params[i].split("="); switch (param[0]) { case "SPAppWebUrl": SPAppWebUrl = decodeURIComponent(param[1]); break; case "SPHostUrl": SPHostUrl = decodeURIComponent(param[1]); break; } } }); (function () { "use strict"; var app = angular.module("productManagement", ["common.services", "ui.router", "ui.mask", "ui.bootstrap"]); app.config(["$stateProvider", "$urlRou…
score: 0
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/42388121
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26919841
has text: You're looking for even values of i. Will that give you even numbers in the Fibonacci sequence? (Hint: No)

http://stackoverflow.com/a/26930930
answers question: http://stackoverflow.com/q/26930558
upvote count: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/26930558
has comment: http://stackoverflow.com/comment/42407319
has comment: http://stackoverflow.com/comment/42411044
downvote count: 0
score: 1
has body: That should be a scope issue, I guess you are missing ng-controller="HomeController" on your html (view).
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42409940

http://stackoverflow.com/a/26849860
type: Answer
answers question: http://stackoverflow.com/q/26849748
has body: var un = window.document.userform.formuser.value; var pw = window.document.userform.formpass.value; When those lines are being evaluated by the browser your form is still empty, you need to assign a handler to your &lt;input type="submit" value=" Sign In "&gt;
score: 0

http://stackoverflow.com/comment/42326356
comment on: http://stackoverflow.com/q/26879501
has text: Well, yes the coding part is right because I have copied this code from another tutorial and it works over there. And $target_file is a variable...and I know it works because again I have copied this code from a tutorial and yes it is working over there.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/32379121
answers question: http://stackoverflow.com/q/26850592
upvote count: 4
downvote count: 0
score: 4
type: Answer
has body: $("#player2").select2('data')[0].id; $("#player2").select2('data')[0].value;

heap-memory
tag name: heap-memory
tags question: http://stackoverflow.com/q/26890416
type: Tag

http://stackoverflow.com/a/26845771
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42254803
type: Answer
answers question: http://stackoverflow.com/q/26845723
accepted answer of: http://stackoverflow.com/q/26845723
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/42254602
has body: what about? currElem = $('.navi a', spaceImageContainer); if (currElem.hasClass("active")) { // do stuff here. for instence, hide it. currElem.hide('slow'); } EDIT: As @demo said: $('.navi a', spaceImageContainer).each(function() { if ($(this).hasClass("active")) { currElem = $(this); naviIndex = $(this).index(); } });

http://stackoverflow.com/a/26890493
accepted answer of: http://stackoverflow.com/q/26890401
type: Answer
has body: Use the change event, and bind it to both radio buttons (using the labAutoScroll class) so it fires when you click either of them. $('.labAutoScroll').change(function() { if($("#radAutoScroll0").is(':checked')){ // scroller code..... } });
answers question: http://stackoverflow.com/q/26890401
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/26834990
has answer: http://stackoverflow.com/a/26835065
has body: How do you extend an object prototype with a nested namespace? http://jsfiddle.net/2t5314nu/2/ I want to be able to call nested methods from Obj.prototype like this.nested.method and be able to access prototype properties and methods from nested as this.prop. However, when I use jQuery $.extend, the init method from nested overrides the one from Obj.prototype. In fact, Obj.prototype.init is never called. I want to avoid overriding Obj.prototype.init with nested.init. I would be fine with using something other than $.extend. function Obj() { this.prop = 'val'; this.init(); } Obj.prototype = { init: function() { console.log('object init'); console.log('prop in object init: ' + this.prop); $('#object-init').text('object init'); this.nested.init(); this.nested.method(); } }; var nested = { init: function() { console.log('nested init'); console.log('prop in nested init: ' + this.prop); $('#nested-init').text('nested init'); }, method: function() { console.log('nested method'); console.log('prop in nested method: ' + this.prop); $('#nested-method').text('nested method'); } }; $.extend(true, Obj.prototype, nested); new Obj();
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/42236328
has comment: http://stackoverflow.com/comment/42236503
has comment: http://stackoverflow.com/comment/42236439
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/42237023
has title: jQuery $.extend namespacing
upvote count: 1
has comment: http://stackoverflow.com/comment/42236012
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42236359
favorite count: 0
has comment: http://stackoverflow.com/comment/42235996
has comment: http://stackoverflow.com/comment/42235926
has comment: http://stackoverflow.com/comment/42236380
has answer: http://stackoverflow.com/a/26835910
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42236306
linked to: http://stackoverflow.com/q/16063394
has comment: http://stackoverflow.com/comment/42236402
has comment: http://stackoverflow.com/comment/42236604

http://stackoverflow.com/comment/42498318
type: Comment
comment on: http://stackoverflow.com/q/26982040
has text: I was getting 403 forbidden. I hate to say it after going to the trouble of posting the question, but it looks like the solution is actually to just put localhost and/or localhost/* in the approved referrers. I am now seeing the data on localhost webserver, not file://
score: 0
type: QuestionComment

http://stackoverflow.com/comment/42419147
type: AnswerComment
score: 0
has text: Makes pretty good sense. Thanks for the tip concerning the router, i will get that fixed.
type: Comment
comment on: http://stackoverflow.com/a/26936137

http://stackoverflow.com/comment/42415065
score: 0
type: Comment
type: QuestionComment
has text: Have you verified that you are not getting any errors in the console?
comment on: http://stackoverflow.com/q/26933979

http://stackoverflow.com/a/26847228
answers question: http://stackoverflow.com/q/26847064
type: Answer
has body: You can load your content and use the callback function to load your JS and css. Something like this: $(function() { function loadJS( scrpt, fn ) { var el = document.createElement('script'), body = document.body; el.type = 'text/javascript'; el.src = scrpt; if ( typeof fn === 'function' ) { el.onload = fn(); } body.appendChild(el); } function loadCSS( scrpt, fn ) { var el = document.createElement('link'), body = document.head; el.type = 'text/css'; el.media = 'all'; el.rel = 'stylesheet'; el.href = scrpt; if ( typeof fn === 'function' ) { el.onload = fn(); } body.appendChild(el); } $("#tab_gad").click(function() { $('.loadContent').load('portfolio_gad.html #content', function() { loadJS('/path/to/whatever.js'); loadCSS('/path/to/whatever.css'); }); }); });
accepted answer of: http://stackoverflow.com/q/26847064
has comment: http://stackoverflow.com/comment/42257740
score: 0
has comment: http://stackoverflow.com/comment/42258234
type: AcceptedAnswer

http://stackoverflow.com/q/26933092
has title: ReferenceError: CSV is not defined
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26933166
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/42411071
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/14220321
tagged with: jquery-csv
tagged with: http://stackoverflow.com/tag/csv
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/26933166
type: Question
has comment: http://stackoverflow.com/comment/42412218
type: AnsweredQuestion
has body: I am using the jquery.csv-0.71.min.js lib to load a csv file and convert it to an array. However, when loading my webpage: &lt;script src="assets/lib/jquery/dist/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="assets/lib/bootstrap/dist/js/bootstrap.min.js"&gt;&lt;/script&gt; &lt;!-- Jquery-csv --&gt; &lt;script src="assets/js/jquery.csv-0.71.min.js"&gt;&lt;/script&gt; &lt;script&gt; (function() { var data; var url = 'data/data.csv'; function makeRequest(url) { var xhr = new XMLHttpRequest(); xhr.open('GET', url); xhr.onload = function() { if (xhr.readyState === 4 &amp;&amp; xhr.status === 200) {/*run code*/} }; xhr.send(null); } })(); data = CSV.toArrays(xhr.responseText); console.log(data); &lt;/script&gt; I get in the console: ReferenceError: CSV is not defined at 'data = CSV.toArrays(xhr.responseText);' Any recommendations what I am doing wrong? I appreciate your replies! UPDATE I put my code into the document read funciton, however, I still get the same error as above. $(document).ready(function() { (function() { var data; var url = 'data/data.csv'; function makeRequest(url) { var xhr = new XMLHttpRequest(); xhr.open('GET', url); xhr.onload = function() { if (xhr.readyState === 4 &amp;&amp; xhr.status === 200) {/*run code*/ } }; xhr.send(null); } })(); data = CSV.toArrays(xhr.responseText); console.log(data); });

http://stackoverflow.com/comment/42369898
has text: `on` is an event listener, so check out [`AddEventListener`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget.addEventListener)
score: 4
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26910162

http://stackoverflow.com/comment/42298017
type: QuestionComment
comment on: http://stackoverflow.com/q/26869426
has text: Are you looking for jQuey autoComplete?
score: 0
type: Comment

http://stackoverflow.com/comment/42421551
has text: Did you see this question http://stackoverflow.com/questions/25709324/grunt-wiredepapp-no-such-file-or-directory-bower-json
score: 0
comment on: http://stackoverflow.com/q/26932057
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/42467688
has text: Thanks. Had to use negative top value.
type: Comment
comment on: http://stackoverflow.com/q/26962671
score: 0
type: QuestionComment

http://stackoverflow.com/comment/42327006
comment on: http://stackoverflow.com/a/26886177
type: AnswerComment
score: 0
has text: This works perfectly but not the way I wanted it to, I want the button to replace the current image with one of the other images
type: Comment

http://stackoverflow.com/comment/42432272
type: Comment
comment on: http://stackoverflow.com/a/26944603
has text: Thanx for quick replies. I did something like this after parsing the JSON as u have shown in the answer. value = $scope.data; console.log(value[0].time); but it gives a error. "cannot read property 0"
type: AnswerComment
score: 0

http://stackoverflow.com/q/26958022
has comment: http://stackoverflow.com/comment/42487941
has comment: http://stackoverflow.com/comment/42455540
has comment: http://stackoverflow.com/comment/42455591
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26972438
has comment: http://stackoverflow.com/comment/42455500
has comment: http://stackoverflow.com/comment/42456667
has comment: http://stackoverflow.com/comment/42487841
has comment: http://stackoverflow.com/comment/42455386
tagged with: fullcalendar
linked to: http://stackoverflow.com/q/3150371
type: Question
has comment: http://stackoverflow.com/comment/42461327
has body: I have a jQuery Full Calendar in my UI and it looks as follows: The problem is the 10:00-10:00am portion of the event title, which seemingly is added to the element based upon the event startTime and endTime parameters in the JSON which sets up the UI element. Please see my code section for this here: jQuery(document).ready(function() { jQuery('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month, agendaWeek, agendaDay' }, allDayText: 'All Day', columnFormat: { month: 'ddd', week: 'ddd d/M', day: 'dddd d/M' }, editable: false, weekends: true, timeFormat: 'h:mm-h:mma ', axisFormat: 'hh:mma', firstDay: 1, slotMinutes: 15, defaultView: 'month', minTime: '10:00', maxTime: '17:00', monthNames: ["January","February","March","April","May","June","July", "August", "September", "October", "November", "December" ], monthNamesShort: ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","nov","Dec"], dayNames: ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"], dayNamesShort: ["Sun","Mon", "Tue", "Wed", "Thus", "Fri", "Sat"], buttonText: { today: "Today", day: "Day", week:"Week", month:"Month" }, selectable: true, selectHelper: false, select: function(start, end, allDay) { }, events: [ { id: "3", title: "My event title", start: new Date(2014,10,03,10,0), end: new Date(2014,10,03,12,0), allDay: false, backgroundColor : "#7F97FF", textColor: "white" }, The problem is in the UI it shows 10:00-10:00am which doesnt make sense. According to my events code it should start at 10,00,00 and end at 12,00,00 so why doesnt the title match this? Can somebody please help me!
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42455064
has title: jQuery Full Calendar event title time is wrong
score: 0
has answer: http://stackoverflow.com/a/26972438
answer count: 1
has comment: http://stackoverflow.com/comment/42459979
has comment: http://stackoverflow.com/comment/42456780
has comment: http://stackoverflow.com/comment/42459710

http://stackoverflow.com/comment/42375890
type: Comment
has text: This is just an example that I had, to detect mobile browsers. using this you could test for any browser that doesn't support html5 and css3
type: AnswerComment
comment on: http://stackoverflow.com/a/26913197
score: 0

http://stackoverflow.com/a/26877741
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26877680
type: Answer
answers question: http://stackoverflow.com/q/26877680
has body: or use this pattern ^(?!.*[&lt;&gt;]).{6,13}$ Demo ^ beginning of line (?! Negative Look-Ahead . Any character except line break * (zero or more)(greedy) [&lt;&gt;] Character Class [&lt;&gt;] ) End of Negative Look-Ahead . Any character except line break {6,13}$ (repeated {6,13} times) to the end
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/42273949
comment on: http://stackoverflow.com/q/26854950
has text: i don't know why you would want to do this, there's not enough context, but check out `file_put_contents()`
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42442151
has text: What does the rest of your application look like?
comment on: http://stackoverflow.com/q/26947286
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/42330946
has text: If you want a better explanation, edit you question to include some information about your data structure. @Ankita gave an example in the answer below.
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/26859554

http://stackoverflow.com/q/26914968
tagged with: browserify
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
has title: Browserify: override package and use different main file
score: 1
type: Question
accepted answer: http://stackoverflow.com/a/26918685
tagged with: javascript
has body: Browserify's "browser" field in the package.json seems overloaded and I can't figure out a way to get around this issue How would I shim several packages not necessary in the browser (such as ws and canvas) while also changing the "main" file for browserify's use I was hoping something like this would work { "browser": { "ws": "./src/browser/ws-shim", "main": "./src/BrowserVersion" } } src/browser/ws-shim module.exports = global.WebSocket; Repository in question has some specific Node functionality such as services over TCP and stream support which won't make sense in the browser. Meanwhile, we use node ports of several browser APIs to share code between the Node and Browserifyied versions of the lib
upvote count: 1
has answer: http://stackoverflow.com/a/26918685
answer count: 1
favorite count: 0

http://stackoverflow.com/q/26874367
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/42306721
has comment: http://stackoverflow.com/comment/42342099
tagged with: javascript
score: 4
tagged with: express
answer count: 2
has comment: http://stackoverflow.com/comment/42325317
has comment: http://stackoverflow.com/comment/42341420
downvote count: 0
has comment: http://stackoverflow.com/comment/42307324
has comment: http://stackoverflow.com/comment/42323370
has comment: http://stackoverflow.com/comment/42324291
has comment: http://stackoverflow.com/comment/42306800
tagged with: passport.js
has comment: http://stackoverflow.com/comment/42324340
favorite count: 0
has body: My directory structure is like this: collegesapp ├── node_modules │ ├── express │ ├── connect │ ├── jade │ └── passport ├── routes │ └── routes.js ├── views │ ├── index.jade │ └── signin.jade ├── app.js └── package.json exports.serialized_user = serialized_user; //in app.js file *The variable serialized_user returns "Alex" var serialized_user = require('../app.js').serialized_user; //in routes.js file So, when I add console.log(typeof(serialized_user)) to my routes.js file and run the application, I end up seeing undefined in the console instead of "string" and when I add console.log(serialized_user) to my routes.js file and run the application, I end up seeing nothing in console instead of "Alex". What do you think is my problem? Thank you in advance :) Here is my entire app : //app.js file var express = require('express'); var connect = require('connect'); var passport = require('passport'); var localStrategy = require('passport-local').Strategy; var mongoose = require('mongoose'); var mongodb = require('mongodb'); var bodyParser = require('body-parser'); var methodOverride = require('method-override');; var serveStatic = require('serve-static'); var errorHandler = require('errorhandler'); var routes = require('./routes/routes.js'); var user_model = require('./models/user_model.js'); var app = express(); //configuration app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({extended: false})); app.use(methodOverride()); app.use(express.Router()); app.use(serveStatic(__dirname + '/public_assets')); app.use(passport.initialize()); app.use(passport.session()); if('development' == app.get('env')){ app.use(errorHandler({dumpExceptions:true,showStack:true})); } if('production' == app.get('env')){ app.use(errorHandler()); } //user authentication on sign in passport.use('signin_local_strategy', new localStrategy( function(username,password,done){ user_model.findOne({username: username}, function(e…
type: UnansweredQuestion
tagged with: circular-dependency
tagged with: node.js
has title: How can I export a string from a file and require() the exported string on another file in NODE.js?
has answer: http://stackoverflow.com/a/26874943
has answer: http://stackoverflow.com/a/26894414
linked to: http://stackoverflow.com/q/26871996
has comment: http://stackoverflow.com/comment/42311826

http://stackoverflow.com/q/26925277
tagged with: reactjs-flux
favorite count: 0
tagged with: sinon
upvote count: 4
has answer: http://stackoverflow.com/a/48804761
type: UnansweredQuestion
has body: I'm having problems testing a Store in flux, wanting to stub out the dispatcher. I've seen how it's done with jest, but I Want to achieve the same with sinon. Here's what I have Source lib/Dispatcher. Full code here var invariant = require('./invariant'); //... function Dispatcher() { this.$Dispatcher_callbacks = {}; } Dispatcher.prototype.register=function(callback) { var id = _prefix + _lastID++; this.$Dispatcher_callbacks[id] = callback; return id; }; // ... module.exports = Dispatcher; Dispatcher: module.exports.Dispatcher = require('./lib/Dispatcher') AppDispatcher: var Dispatcher = require('flux').Dispatcher; var copyProperties = require('react/lib/copyProperties'); var AppDispatcher = copyProperties(new Dispatcher(), { handleViewAction: function(action) { this.dispatch({ source: 'VIEW_ACTION', action: action }); } }); module.exports = AppDispatcher; ItemStore, the one I want to test var AppDispatcher = require('../dispatcher/AppDispatcher'); var EventEmitter = require('events').EventEmitter; var ItemConstants = require('../constants/ItemConstants'); var merge = require('react/lib/merge'); var CHANGE_EVENT = 'change'; var _items = []; var ItemStore = merge(EventEmitter.prototype, { getSoekeresultat: function() { return _items; }, emitChange: function() { this.emit(CHANGE_EVENT); } }); AppDispatcher.register(function(payload) { var action = payload.action; switch(action.actionType) { case ItemConstants.ITEMS_FETCHED: _items = action.payload; ItemStore.emitChange(); break; default: } return true; // No errors. Needed by promise in Dispatcher. }); module.exports = ItemStore; So what I want to stub is AppDispatcher.register. How do I do that? I've tried doing it several ways, the last I tried was this: var sinon = require("sinon"); require("jasmine-sinon"); describe("ItemStore", function(){ var AppDispatcher = require('js/dispatcher/AppDispatcher.js'); sinon.stub(AppDispatcher, 'register', function () { console.log("stub"); }); it("should use stub when called dire…
type: Question
tagged with: javascript
score: 4
has title: How do I stub/mock a dependency's method copied from "superclass" with sinon
tagged with: browserify
answer count: 1
downvote count: 0

http://stackoverflow.com/q/26855832
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42277097
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
tagged with: mapbox
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42292690
has comment: http://stackoverflow.com/comment/42316725
has title: div over map still allowing drag/click on iOS
has comment: http://stackoverflow.com/comment/42424286
tagged with: leaflet
answer count: 0
downvote count: 0
score: 1
has body: edit: solved this myself. function disableMap() { map.dragging.disable(); map.touchZoom.disable(); map.doubleClickZoom.disable(); map.scrollWheelZoom.disable(); map.boxZoom.disable(); map.keyboard.disable(); if (map.tap) map.tap.disable(); console.log("map off"); } function enableMap() { map.dragging.enable(); map.touchZoom.enable(); map.doubleClickZoom.enable(); map.scrollWheelZoom.enable(); map.boxZoom.enable(); map.keyboard.enable(); if (map.tap) map.tap.enable(); console.log("map on"); } $('form.filterbar').on('mouseover mousedown touchstart', function() { disableMap(); }); $('form.filterbar').on('mouseout mouseup touchend', function() { enableMap(); }); in CSS, set the cursor of the element so it can handle the click/touch events... form.filterbar { cursor: pointer; }

http://stackoverflow.com/a/38992063
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/26883915
has body: Old question but I think answer is important. The creation of the alarm looks ok. Here is how I would calculate the whenToRing for example if you want an alarm event on 08:00 am. var whenToRing = new Date().setHours(8);
downvote count: 0
type: Answer

http://stackoverflow.com/comment/42470215
has text: Place it with you code.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26966512

http://stackoverflow.com/comment/42298918
type: AnswerComment
score: 0
type: Comment
has text: I'll add that this could have been more easily spotted by viewing the source (view-source:example.com in chrome) rather than using the developer tools. Dev tools will show you how the markup is being rendered rather than how it was generated. Viewing the source, OP probably would have spotted the problem faster.
comment on: http://stackoverflow.com/a/26870021

http://stackoverflow.com/comment/42390529
has text: Well neither of those numbers are valid in JavaScript (SyntaxError) so it seems reasonable to me.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26898499
score: 1

http://stackoverflow.com/q/26901472
has answer: http://stackoverflow.com/a/51414490
favorite count: 0
tagged with: firefox-addon
type: UnansweredQuestion
has title: Javascript debug in Firefox: how to show the stack of calls with error
has body: I am doing a web application. In Firefox, I am able to use Web Developer's Debugger tool. In my Javascript code, I got the error in Firefox TypeError: a is undefined The above error happened in jQuery. I know that the data I pass to jQuery is not right. However, there are many jQuery calls in my code and I don't know which call leads to this error. Anyway to show the stack of calls that lead to an error via Debugger? The way Java shows error stack trace? Thanks!
tagged with: javascript-debugger
has comment: http://stackoverflow.com/comment/50095227
type: Question
upvote count: 5
answer count: 2
score: 5
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/26902012

http://stackoverflow.com/comment/42276235
type: AnswerComment
type: Comment
has text: The code in the pastebin above works. Thank you though.
comment on: http://stackoverflow.com/a/26857015
score: 0

http://stackoverflow.com/comment/42498690
score: 0
type: Comment
type: QuestionComment
has text: Even if you do the actual logic on the controller, you'll need to either wire up a submit when the user makes a selection or you'll need to use javascript to send the selection across the wire. Basically, if there's a way to do this, it's well beyond me.
comment on: http://stackoverflow.com/q/26981942

http://stackoverflow.com/comment/42468470
has text: Thank You Reinmar. I am not sure but the Chrome debug tool does not show that html is set to this.$.innerHTML. Perhaps it is, but with the Chrome Debug tool its impossible to track who is doing the escaping for code tags such as "<?php" to <!--?php before or after setting it to this.$.innerHTML on the same line. Where is the escaping executed? what triggers it (what event)? how is it referenced? if you can help, I will much appriciate
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26883242

http://stackoverflow.com/comment/91131562
comment on: http://stackoverflow.com/a/26916974
score: 0
type: AnswerComment
type: Comment
has text: `tracker` is undefined, what should I do?

http://stackoverflow.com/q/26918757
tagged with: arrays
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/26918852
type: AnsweredQuestion
has title: comparing arrays to dom elements check for same IDs
type: Question
has body: I am trying to compare 2 arrays to check if the same id exists in the array as on the elements in a ul i am comparing them to. I am reducing down some incoming data (in the success of an ajax call) to just an array of ids like so var storeLibIds = data.libraries( function(obj){ return obj.id; }); Then, I want to compare that array to some li's on the dom, and if the id exists in both - check off a check box inside the element So I am tryin to loop through the li's like so $.each(".lessonList li"), function(){ //if $(this).attr("id") exists in storeLibIds, then $(this).find(".otherLibCheck").prop("checked", true); then check off the checkbox inside }); So my basic idea is to loop through the li's and check their arrt("id") vs the array and if it exists check off the box. The problem I am having is I'm not sure if I want to loop through all of them or if there is a way with .filter to check if exists to check off the checkbox. I am having trouble getting this logic down, any help wold be appreciated. Thanks!
tagged with: javascript
has answer: http://stackoverflow.com/a/26918852
score: 0
answer count: 1

http://stackoverflow.com/a/26940773
answers question: http://stackoverflow.com/q/26940739
type: Answer
upvote count: 2
score: 1
downvote count: 1
has body: See here: Assign JavaScript variable to Java Variable in JSP As that states, it's really not possible as the JSP executes on the server, and the javascript executes later in the browser.

http://stackoverflow.com/a/26906156
has comment: http://stackoverflow.com/comment/42362933
type: Answer
score: 2
downvote count: 0
has body: Firstly attach click event to next button and give call to populateQuestion() using counter to iterate through allQuestions array and use i as counter variable. nextButton.onclick = function() { /*itterate through questions*/ if(i&gt;allQuestions.length -1){/*go to first when reached last*/ i=0; } populateQuestion(i); i++; }; Iterate through allQuestions array for question title and choices as: function populateQuestion(qNum) { var individualQuestion = allQuestions[i]; questionTitle.innerText = individualQuestion.question; selectionList.innerHTML = ""; //reset choices list for(key in individualQuestion.choices){ var radioBtnName = "question"+i+"_choice"; var choiceText = individualQuestion.choices[key]; selectionList.appendChild(createLi(radioBtnName,choiceText)); } } Write dynamic li and radio button creation function as: function createLi(name, choiceText) { var e = document.createElement('li'); var radioHtml = '&lt;input type="radio" name="' + name + '"'; radioHtml += '/&gt;'; radioHtml += choiceText; e.innerHTML = radioHtml; return e; } Please refer to this fiddle for same.
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26904763
has comment: http://stackoverflow.com/comment/42364354
answers question: http://stackoverflow.com/q/26904763

http://stackoverflow.com/q/26902396
score: 1
has title: Javascript chaining syntax in various APIs?
accepted answer: http://stackoverflow.com/a/26902531
has comment: http://stackoverflow.com/comment/42356643
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/26902531
has body: I was wondering if there is a term / concept / name for the various chaining styles I've seen in various javascript libraries. I don't consider myself a "javascript person" so I stumble on the various styles of "chaining" syntax quite a bit. Here are some examples: // ember.js this.resource('products', function() { this.resource('foo', { path: '/:foo_id' }); // &lt;-- semicolon this.resource('bar', { path: '/:bar_id' }); // &lt;-- semicolon // additional things can go here as long as semicolons are above }); // ember.js songsController = Ember.ArrayController.create({ model: songs, // &lt;-- comma sortProperties: ['track'], // &lt;-- comma sortAscending: true // &lt;-- additional things if you want, use commas }); // jasmine beforeEach(function() { foo = { setBar: function(value) { bar = value; }, // &lt;-- comma getBar: function() { return bar; // &lt;-- additional things if you want, use commas } }; // angular.js $routeProvider. when('/phones', { // ... }). // &lt;-- period when('/phones/:phoneId', { // ... }). // &lt;-- period // additional things can go here as long as periods are above Specifically, it seems that just the trailing characters are confusing. Do you guys grok what the API is really doing or do you just look for examples and memorize/get comfortable with it? If it is grok'ing javascript, when you see that Ember.ArrayController.create() takes something with commas and braces then do you think: Braces with commas eh? That looks like an object. I bet .create() takes an object. Is there a name for this chaining / stacking? Maybe there's no name for it and it's just Javascript that I don't grok.
upvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/comment/42441785
type: AnswerComment
comment on: http://stackoverflow.com/a/26919628
type: Comment
has text: Added a simple example. You'll have to tweak it to meet your situation, but that the syntax and such.
score: 0

http://stackoverflow.com/comment/42408889
comment on: http://stackoverflow.com/a/26931615
type: AnswerComment
type: Comment
score: 0
has text: I edited my questions. This is not to be used as a trigger... but rather to validate input from a POST.

http://stackoverflow.com/a/26932900
has body: I think its bad idea to call ajax on every input field keyup event. You can put counter displaying that user has to fill form in some amount of time. Then use timeout to submit form. If all the required fields are filled then do your desired task. Else you can ask inputs again.
score: 0
answers question: http://stackoverflow.com/q/26932082
type: Answer

http://stackoverflow.com/comment/42293125
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26866966
has text: Can you provide an interactive demo? Like jsfiddle.
score: 0

http://stackoverflow.com/comment/42309112
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26845064
has text: Thanks for the info Chris! Check my answer if you like. Have a nice one!

http://stackoverflow.com/q/26960901
tagged with: android
has comment: http://stackoverflow.com/comment/42461355
tagged with: cordova
has comment: http://stackoverflow.com/comment/42460292
type: Question
has body: Building my first Cordova 4.0 app, and I would really need some help since I'm gonna show a demo of this app tmrw... When I try to access the Network info API and the Camera API (navigator.connection and navigator.camera respectively) they always return undefined. I have these right in my Android manifest: &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;uses-permission android:name="android.permission.CAMERA" /&gt; &lt;uses-feature android:name="android.hardware.camera" /&gt; &lt;uses-feature android:name="android.hardware.camera.autofocus" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt; And here are the installed plugins: org.apache.cordova.camera 0.3.3 "Camera" org.apache.cordova.console 0.2.11 "Console" org.apache.cordova.device 0.2.12 "Device" org.apache.cordova.network-information 0.2.13 "Network Information" I have also copied the cordova.js file from the platform-folder and added the &lt;SCRIPT TYPE="text/javascript" src="js/cordova.js"&gt;&lt;/SCRIPT&gt; tag to my index.html. Also here's an example of my code where I try to access the camera API: document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { $(document).on('click', '.camera', function(){ if (!navigator.camera) { alert("Camera API not supported", "Error"); return; } var options = { quality: 50, destinationType: Camera.DestinationType.DATA_URL, sourceType: 1, // 0:Photo Library, 1=Camera, 2=Saved Album encodingType: 0 // 0=JPG 1=PNG }; navigator.camera.getPicture( function(imgData) { return imgData; }, function() { alert('Error');}, options); }); } When I run this I always get the "Camera API not supported" alert, meaning it's undefined. What am I missing?
tagged with: javascript
has comment: http://stackoverflow.com/comment/42461010
tagged with: phonegap-plugins
has title: Cordova Network and Camera API returns undefined
has comment: http://stackoverflow.com/comment/42460366
has answer: http://stackoverflow.com/a/26974873
score: 0
has comment: http://stackoverflow.com/comment/42460166
answer count: 1
has comment: http://stackoverflow.com/comment/42461943
tagged with: cordova-plugins
type: UnansweredQuestion

http://stackoverflow.com/q/26902859
has comment: http://stackoverflow.com/comment/42357439
linked to: http://stackoverflow.com/q/773639
upvote count: 1
tagged with: google-chrome
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/503093
has answer: http://stackoverflow.com/a/26902982
score: 1
type: Question
has title: jQuery: Clicking on Chrome after DOM is loaded with .on() and .click()
tagged with: firefox
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42357579
favorite count: 0
accepted answer: http://stackoverflow.com/a/26902982
has comment: http://stackoverflow.com/comment/42357416
has body: I have a UI page to test where there are is a lot of room for automation. For example there are buttons that might be clicked all at once or sequentially and they perform some action. Therefore I tried automating the clicking with JS and jQuery, starting from Firefox and moving on to chrome (using greecemonkey and tempermonkey). The transition from these two browsers was not as easy as I first thought as what seems to be not working is the .click(); method on chrome (at least trying to click some buttons from browsers console). A simpliefied version when run from browsers console (chrome) and firebug (firefox): $(".div.tab-pane.active").find(".delete-link").click(); On chrome: just prints out an array of matched elements; On firefox: actually clicks the link; Running: $(".div.tab-pane.active").find(".delete-link").text(); Indicates that the elements are targeted correctly. Questions: Do I need to attach an event listener with .on() method to the button I try to click? As I tried this code and it still is not working: function notify() { $(".div.tab-pane.active").find(".delete-link").click(); alert( "clicked" ); } $(".div.tab-pane.active").find(".delete-link").on( "click", notify ); or $(".div.tab-pane.active").find(".delete-link").on("click", function(){ alert("clicked"); }); $(".div.tab-pane.active").find(".delete-link").click(); // causes a stack overflow Why does it work with Firefox (both from firebug and greecemonkey) and not in chrome? What is different in those two browsers that makes the working of .click() different? How to make it work?
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/26907567
has comment: http://stackoverflow.com/comment/42366155
type: Answer
answers question: http://stackoverflow.com/q/26907295
has comment: http://stackoverflow.com/comment/42365528
upvote count: 5
accepted answer of: http://stackoverflow.com/q/26907295
has comment: http://stackoverflow.com/comment/108062833
downvote count: 0
score: 5
type: AcceptedAnswer
has body: Check this fiddle $(selector).on('click', function(){ var $item = $(this).closest("tr").find('td'); }) Using the above code you are binding a direct event but the one which you want is delegated event To use delegated event you should use like $(document).on('click',selector, function(){ var $item = $(this).closest("tr").find('td'); }) so your final code will look something like $(document).on('click','.get-data' ,function(){ var $item = $(this).closest("tr").find('td'); $.each($item, function(key, value){ alert($(value).text()); }) }); document can be anything which is parent to the table which is going to be created. Dont forget to add the selector while adding a new table element

http://stackoverflow.com/q/26858569
score: 0
has body: Hi I am a newbie on angularjs. I wanted to implement a code where when I click on a button,I should be able to make an api call and display data inside the HTML. Now I have implemented a directive and the HTML is generated,but however when I click on favicon or reminder,It is not working. The following is implemented in the controller called usercontroller(It has a lot of other functionalities).However I am not very sure how to call the controller,only for specifically favicon. The below is the directive I have written:- 'use strict'; var pageno=1; function MainCtrl($scope) { $scope.count = 0; } //Directive that returns an element which adds buttons on click which show an alert on click.Here we can put woi.directive("yes",['userAPI','$rootScope', function(userAPI,$rootScope){ return { restrict: "E", template: " please click for Top Rated " //Directive for adding buttons on click that show an alert on click woi.directive("addbuttons",['$rootScope','userAPI','$compile','$filter', function($rootScope,userAPI,$compile,$filter,){ return function(scope, element, attrs){ element.bind("click", function(){ // var pageno=1; scope.count++; var pageno=1; pageno++; scope.pageNo=pageno; //var abc= scope.loadRated(pageno); userAPI.topRated({userid: $rootScope.getUser().userid,pageno:pageno}, function (r, $scope, div){ if(!$rootScope.device.isMobile && !$rootScope.device.isTablet && !$rootScope.device.isTouch ) { var topRatedList = r.gettopratedhomepage.topratedprogrammelist; console.log(r) var str=''; if(r !=null && r.gettopratedhomepage!=null && r.gettopratedhomepage.topratedprogrammelist!=null) if(r.gettopratedhomepage.topratedprogrammelist.length>0){ for(var i=0;i<topRatedList.length;i++) { // str+="topRatedList[i].actualname"; var programNameEncode=$filter('encodeUrl')(topRatedList[i].programmename); // | encodeUrl; topRatedList[i].programmename; var program=topRatedList[i].programmename; var channelId=topRatedList[i].channelid; var programId=topRatedList[i].programmeid; var c…
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
tagged with: model-view-controller
has answer: http://stackoverflow.com/a/26859900
type: Question
tagged with: angularjs-directive
has title: Angularjs:-How to call controller actions with the help of directive
tagged with: javascript

http://stackoverflow.com/comment/42681321
comment on: http://stackoverflow.com/a/26967961
type: AnswerComment
has text: check question i have changed java script
score: 0
type: Comment

http://stackoverflow.com/q/26960704
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26960943
score: 0
type: Question
has title: Google Maps re-opening the modal issue
tagged with: google-maps
answer count: 1
has answer: http://stackoverflow.com/a/26960943
tagged with: javascript
tagged with: jquery
has body: I know this question has already been asked earlier but my scenario is little different. I too had the problem in displaying Google Map in the modal then I found the solution here i.e to call the resize function on map so that it can be shown in the modal. It exactly worked fine. But only for the first time i.e when I open the modal once it shows the map fine but when I close and open it again then it again renders partially. Here is my code: $('#view-on-map').on('click', function () { initialize(); }); function initialize() { var latitude = $("#latitude").text(); var longitude = $("#longitude").text(); var myCenter = new google.maps.LatLng(latitude, longitude); var mapProp = { center: new google.maps.LatLng(latitude, longitude), zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("seller-map") , mapProp); var marker = new google.maps.Marker({ position: myCenter, }); google.maps.event.trigger(map, "resize"); marker.setMap(map); } What I am doing wrong? I would also like to point out that I am only creating the map when modal is loaded (as demonstrated in the code), I tried to load it on window.load event and then call the resize function on that when modal is opened but that did not work. My markup uses Simple Modal and not the bootstrap one. Looking for help. Thank You.

http://stackoverflow.com/a/26905899
has comment: http://stackoverflow.com/comment/42389793
has body: You can try to insert the necessary scripts from didInsertElement hook of the corresponding view. And, if so, in order to avoid duplicates, remove that scripts in willDestroyElement hook of the same view.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26878348
has comment: http://stackoverflow.com/comment/42413349

http://stackoverflow.com/q/26893042
upvote count: 4
has answer: http://stackoverflow.com/a/26911797
downvote count: 0
has body: I have noticed with the latest level of firefox(33.1)/firebug (2.0.6), my Javascript just stops. The console doesn't report any errors, there is no sign of any problems. Just when I click on clickable items, there is no action. By closing firebug, the Javascript works again. This does not happen for Chrome(open with Development tools) or Opera (open with Dragonfly). I have tried a couple of different websites with the same results. Is this a firebug bug? Or am I missing a setting somewhere? I have the following other plug-ins with firefox: fireQuery (1.41), HTML Validator (0.9.5.8) Pocket (3.0.5) View source Char (3.05)
accepted answer: http://stackoverflow.com/a/26915064
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26915064
possible better answer: http://stackoverflow.com/a/26911797
type: Question
answer count: 2
tagged with: firebug
tagged with: firefox
tagged with: javascript
has title: Opening Firebug stops javascript from running
score: 4
favorite count: 0

http://stackoverflow.com/comment/42501336
score: 0
has text: @Dmitry I say accidentally works without problems. Try that again with mutable instance specific members on the Parent. Or certain constructor arguments that are not available when defining Child. So I'll repeat it again: it's better to use Object.create or it's polyfil (like inherits in google closure compiler that has existed for many many years)
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/26971329

http://stackoverflow.com/comment/42442898
score: 0
type: Comment
has text: Cool package, I didn't know it so far... but seems to be proper, 'cause published by the guys from Percolate Studio. I will have a deeper look into it the next days. Thanks for this hint.
type: AnswerComment
comment on: http://stackoverflow.com/a/26950848

http://stackoverflow.com/q/26960924
accepted answer: http://stackoverflow.com/a/26961048
has body: I'm trying to dynamically generate a table with JavaScript using AJAX and displayed using Bootstrap but I can't seem to get the table to show.It only shows the header fields. Any help would be greatly appreciated. Generate Table function display(){ var HTML = " "; HTML += " Place Description "; var search = 106; makeRequest('findplace.php?searchbynumber='+search,function(data){ var data = JSON.parse(data.responseText); for(var i = 0;i<data.length;i++){ HTML += " " + data[i].place + " " + data[i].description + " "; } }); HTML += " "; document.getElementById('myTable').innerHTML = HTML; } function makeRequest(url, callback) { var request; if (window.XMLHttpRequest) { request = new XMLHttpRequest(); // IE7+, Firefox, Chrome, Opera, Safari } else { request = new ActiveXObject("Microsoft.XMLHTTP"); // IE6, IE5 } request.onreadystatechange = function() { if (request.readyState == 4 && request.status == 200) { callback(request); } } request.open("GET", url, true); request.send(); }
has comment: http://stackoverflow.com/comment/42460162
has comment: http://stackoverflow.com/comment/42460262
has comment: http://stackoverflow.com/comment/42460193
has comment: http://stackoverflow.com/comment/42469496
has title: Generate Table dynamically with AJAX data using Javascript
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/26961048
score: 2
has comment: http://stackoverflow.com/comment/42460115
upvote count: 2
tagged with: php
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/42501064
type: AnswerComment
score: 0
has text: You'd see errors in the console. If there is no error, then whatever problem you have is likely elsewhere in the code
comment on: http://stackoverflow.com/a/26965141
type: Comment

http://stackoverflow.com/q/26951407
has comment: http://stackoverflow.com/comment/42445716
has comment: http://stackoverflow.com/comment/42447036
has comment: http://stackoverflow.com/comment/42453498
has comment: http://stackoverflow.com/comment/42465163
linked to: http://stackoverflow.com/q/18063755
has comment: http://stackoverflow.com/comment/42444623
downvote count: 0
has comment: http://stackoverflow.com/comment/42443793
has title: Why does Math.cbrt(1728) produce a more accurate result than Math.pow(1728, 1/3)?
has comment: http://stackoverflow.com/comment/42453521
score: 13
has answer: http://stackoverflow.com/a/26958154
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26958154
tagged with: floating-point
has comment: http://stackoverflow.com/comment/42453351
has comment: http://stackoverflow.com/comment/42453398
type: Question
has comment: http://stackoverflow.com/comment/42453208
has comment: http://stackoverflow.com/comment/42453449
has body: In JavaScript, Math.cbrt(1728) evaluate to the exact result of 12. However, the seemingly-equivalent expression Math.pow(1728, 1/3) evaluates to 11.999999999999998. Why do these results vary in precision?
has comment: http://stackoverflow.com/comment/42453302
has comment: http://stackoverflow.com/comment/42454108
answer count: 1
has comment: http://stackoverflow.com/comment/42459042
tagged with: javascript
upvote count: 13
favorite count: 0

http://stackoverflow.com/a/74868616
score: 1
answers question: http://stackoverflow.com/q/26981034
upvote count: 1
type: Answer
has body: I still had issues where createElementNs would attach an attribute of "xmls" on my string about using new XMLSerializer().serializeToString(xmlDoc). I ended up using the following function to create elements with case sensitive tag names: function createElement(tagName) { const doc = new DOMParser().parseFromString(`<${tagName}></${tagName}>`, 'text/xml') return doc.children[0] }
downvote count: 0

http://stackoverflow.com/comment/42536079
comment on: http://stackoverflow.com/a/26995043
type: AnswerComment
score: 6
type: Comment
has text: Just beware though, using `.data()` doesn't assign it as an attribute, and it's possible that the OP needs it as an attribute. Of course, it's also possible that this way is fine.

http://stackoverflow.com/comment/42346137
comment on: http://stackoverflow.com/q/26896349
type: QuestionComment
score: 0
type: Comment
has text: do you need to keep the _code? If not and your list is a string, do a str_replace with a regex then prefix the string with and suffix with

http://stackoverflow.com/comment/42372767
score: 2
has text: add your used random number to an array, and check if this random number exists in that array, and do it while not in a loop.
comment on: http://stackoverflow.com/q/26911622
type: QuestionComment
type: Comment

knockout.js
tags question: http://stackoverflow.com/q/26911093
tags question: http://stackoverflow.com/q/26970284
tags question: http://stackoverflow.com/q/26949338
tags question: http://stackoverflow.com/q/26909074
tags question: http://stackoverflow.com/q/26863339
tags question: http://stackoverflow.com/q/26887659
tags question: http://stackoverflow.com/q/26947455
tags question: http://stackoverflow.com/q/26977949
tags question: http://stackoverflow.com/q/26964714
tag name: knockout.js
tags question: http://stackoverflow.com/q/26952903
tags question: http://stackoverflow.com/q/26866516
tags question: http://stackoverflow.com/q/26940423
tags question: http://stackoverflow.com/q/26888991
tags question: http://stackoverflow.com/q/26990384
tags question: http://stackoverflow.com/q/26884509
tags question: http://stackoverflow.com/q/26949320
tags question: http://stackoverflow.com/q/26888661
tags question: http://stackoverflow.com/q/26846306
tags question: http://stackoverflow.com/q/26839399
tags question: http://stackoverflow.com/q/26954034
type: Tag
tags question: http://stackoverflow.com/q/26929674
tags question: http://stackoverflow.com/q/26981558
tags question: http://stackoverflow.com/q/26942423
tags question: http://stackoverflow.com/q/26910468
tags question: http://stackoverflow.com/q/26886188
tags question: http://stackoverflow.com/q/26964692
tags question: http://stackoverflow.com/q/26845459
tags question: http://stackoverflow.com/q/26933979

http://stackoverflow.com/comment/42258789
score: 0
comment on: http://stackoverflow.com/q/26847841
type: Comment
type: QuestionComment
has text: Sorry, yes I am using bootstrap.

http://stackoverflow.com/comment/42479589
has text: Thanks for the answer, I hadn't considered anything like this. The only problem I can see with this approach is that I couldn't have multiple instances of the router handler with different "routeHandlerConfigData" for each. e.g. `var handlerOne = new RouteHandler("configDataOne");` `var handlerTwo = new RouteHandler("configDataTwo");` `app.get('/firstRoute', handlerOne.read); app.get('/secondRoute', handlerTwo.read);`
comment on: http://stackoverflow.com/a/26971714
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/26982449
score: 0
type: Answer
has body: I figured it out. I was recycling an old Tomcat 5 server.xml because I wanted to make sure it would work with my old tomcat config. Turns out it was causing this strange issue. Apologies.
answers question: http://stackoverflow.com/q/26979083
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26979083

http://stackoverflow.com/comment/42264600
type: QuestionComment
has text: When `saveApplication` gets triggered?
comment on: http://stackoverflow.com/q/26850993
score: 0
type: Comment

http://stackoverflow.com/comment/42541553
type: QuestionComment
comment on: http://stackoverflow.com/q/26842210
score: 0
type: Comment
has text: Out of curiosity, since you say the problem only occurs after switching between languages, what happens when you switch a language? Do you override the current localstorage key for the localization? Do you add a new entry into localstorage? Does the server-side append each new localization to the request (making it bigger every time)?

http://stackoverflow.com/q/26888290
has answer: http://stackoverflow.com/a/26888353
type: AnsweredQuestion
score: 1
upvote count: 3
downvote count: 2
has comment: http://stackoverflow.com/comment/42330842
type: Question
has title: Javascript unescape doesn't seem to work
has comment: http://stackoverflow.com/comment/42330794
has comment: http://stackoverflow.com/comment/42330810
accepted answer: http://stackoverflow.com/a/26888353
tagged with: javascript
answer count: 2
linked to: http://stackoverflow.com/q/18106164
has body: I have a simple string which is Company&amp;#39;s Now I have some javascript which is ran when a form is submitted var jsCompanyName = '@Model.Name'; var unescapedCompanyName = unescape(jsCompanyName); $('.selector-input').val(unescapedCompanyName); $('.selector-input-id').val('@Model.Id'); Going thought with a debugger, my var unescapedCompanyName is still "Company&amp;#39;s" even after the unescape function, does anyone have any idea on why this isn't removing &amp;#39; and replacing it with a '
possible better answer: http://stackoverflow.com/a/26888342
favorite count: 0
has answer: http://stackoverflow.com/a/26888342
duplicate of: http://stackoverflow.com/q/18106164
tagged with: http://stackoverflow.com/tag/html
tagged with: razor
has comment: http://stackoverflow.com/comment/42330821

http://stackoverflow.com/q/26909215
has comment: http://stackoverflow.com/comment/42368509
upvote count: 2
has body: How I can call "click" event on input type="file" by calling "context" event on other element? I am trying this code: HTML Markup: Title Click JavaScript file: window.onload = function() { window.oncontextmenu = function(){ return false; }; $("#trigger").on("contextmenu", function(){ $("#file").trigger("click"); }); } But I haven't got window to choose file, when I click the right mouse button on button with id="trigger".
accepted answer: http://stackoverflow.com/a/26912218
has comment: http://stackoverflow.com/comment/42372195
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26909935
linked to: http://stackoverflow.com/q/706655
has comment: http://stackoverflow.com/comment/42368397
possible better answer: http://stackoverflow.com/a/26909935
type: Question
answer count: 2
has title: How to call "click" on input type "file" by calling context on other element?
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: jquery-events
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/26912218
score: 2
has comment: http://stackoverflow.com/comment/42368400

http://stackoverflow.com/q/26893524
has body: I am creating a website at the moment where scrolling will be disabled on the entire website (it's made out of sections, all are as tall as screen height except for 1 section, because that one is too large..). I've been looking around to see if any plug-ins exist for this yet, but haven't had any luck, yet. Would anyone know a plug-in or how to do this? It would help me a great deal.
tagged with: scroll
type: Question
has comment: http://stackoverflow.com/comment/42340826
tagged with: javascript
has answer: http://stackoverflow.com/a/26893646
possible better answer: http://stackoverflow.com/a/26893760
has comment: http://stackoverflow.com/comment/42340759
has answer: http://stackoverflow.com/a/26893760
answer count: 2
accepted answer: http://stackoverflow.com/a/26893646
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has title: Disable scroll except for 1 section
score: 0

http://stackoverflow.com/a/26964362
has comment: http://stackoverflow.com/comment/42501944
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42542089
has comment: http://stackoverflow.com/comment/42501683
type: Answer
has body: Drop the /, it tells the navigator that what you're giving him is an absolute path from your domain. So just do: on_sent_ok: "location.replace('thanks');" That is if you're on some yourdomainname.com/somepage and want to go to yourdomainname.com/thanks. If you want to go to yourdomainname.com/somepage/thanks, then one solution is to concatenate your path complement to the current path: on_sent_ok: "location.replace(location + '/thanks');" EDIT: It seems changing the pathname inside location works too. It will completely ignore any GET variables present in the URL. on_sent_ok: "location.pathname += "/thanks";" This will take you from yourdomainname.com/somepage?gclid=XYZ to yourdomainname.com/somepage/thanks?gclid=XYZ.
has comment: http://stackoverflow.com/comment/42500563
accepted answer of: http://stackoverflow.com/q/26964332
downvote count: 0
answers question: http://stackoverflow.com/q/26964332
score: 1

http://stackoverflow.com/a/26927002
score: 2
answers question: http://stackoverflow.com/q/26926435
type: AcceptedAnswer
downvote count: 0
has body: The token id is on the response body as id, there is no token object returned by the stripe.js call, check the docs. So in Node your line: var stripeToken = req.body.token.id; should be: var stripeToken = req.body.id;
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/26926435

http://stackoverflow.com/q/26886411
answer count: 1
has comment: http://stackoverflow.com/comment/42328218
tagged with: javascript
tagged with: dropzone.js
has comment: http://stackoverflow.com/comment/42327516
has answer: http://stackoverflow.com/a/26886499
accepted answer: http://stackoverflow.com/a/26886499
tagged with: php
type: AnsweredQuestion
has body: Am using Dropzone to upload files in Laravel 4.2, Below is my function which process the files after uploading. public function postDropFiles() { $file = Input::file('file'); $destinationPath = 'uploads/'.Auth::user()-&gt;username.'/files/'.date('Y-m-d'); $extension = File::extension($file-&gt;getClientOriginalName()); $filename = time().str_random(12).'.'.$extension; $upload_success = Input::file('file')-&gt;move($destinationPath, $filename); if( $upload_success ) { return Response::json('success', 200);//-&gt;with('uploaded','Succesiful uploaded'); } else { return Response::json('error', 400); } } The codes works fine , as you can see when response is 200 (success) am trying to pass variable name called "uploaded" (Commented) so that I can display the message to the user that the files successifully uploaded. In my View I have something like this: @if(Session::has('uploaded')) &lt;div class="notice-box"&gt;&lt;strong&gt;{{Session::get('uploaded')}}&lt;/strong&gt;&lt;/div&gt; @endif My aim is to create a session variable after uploading and then use it to display message in View. I would appreciate any help. By the way am new to Laravel.
tagged with: laravel
type: Question
has title: Success Message after uploading using Dropzone in Laravel
score: 0
tagged with: laravel-4

http://stackoverflow.com/a/26858058
type: Answer
score: 2
answers question: http://stackoverflow.com/q/26858012
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26858012
has body: When it's an array you should be using indexOf, but you have two major issues. Firstly the type has to match. The array has numbers, but the value of an element is always a string. The easy solution is to parse the value as an integer var value = parseInt( this.value, 10 ); Secondly, indexOf returns the index, and it will return 0 for the first item in the array, and 0 is falsy, so you have to actually check for -1, which is what indexOf returns if there is no match if (mines.indexOf(value) != -1) { ... FIDDDLE A little simplified you'd end up with var mines = []; while (mines.length &lt; 9){ var randomnumber = Math.ceil(Math.random() * 30); if ( mines.indexOf(randomnumber) == -1 ) mines.push(randomnumber); } $(document).ready(function() { $(".blank").click(function() { var isBomb = mines.indexOf( parseInt( this.value, 10 )) != -1; $(this).removeClass('blank').addClass(isBomb ? 'bomb' : 'safe'); }); }); FIDDLE
downvote count: 0
upvote count: 2

http://stackoverflow.com/q/26937389
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Javascript Cursor Zooming
has comment: http://stackoverflow.com/comment/42418985
tagged with: panning
has body: Is there a way to zoom on the cursor point using this code? I can't get my head around to doing it. The canvas zooms but it only zooms in and out from the top left corner. var previousMousePosition = new Vector(0, 0); function OnMouseWheel (event) { var delta = event.wheelDelta ? event.wheelDelta/40 : event.detail ? -event.detail : 0; var mousePosition = new Vector(event.clientX, event.clientY); var scaleFactor = 1.1; if (delta) { var factor = Math.pow(scaleFactor,delta); context.scale(factor,factor); } }
linked to: http://stackoverflow.com/q/5189968
duplicate of: http://stackoverflow.com/q/5189968
type: Question
tagged with: javascript
score: 0
answer count: 2
tagged with: canvas
has answer: http://stackoverflow.com/a/26938338
has answer: http://stackoverflow.com/a/26938517
tagged with: zooming

http://stackoverflow.com/a/26985709
has comment: http://stackoverflow.com/comment/42505071
has comment: http://stackoverflow.com/comment/42505472
has comment: http://stackoverflow.com/comment/42505197
answers question: http://stackoverflow.com/q/26985146
downvote count: 0
type: Answer
has body: Where is this behaviour documented? The XHR's open method parses its URL argument with the basic url parser, which - in its first step - strips leading and trailing whitespaces from its input. Should I be encoding the URL myself before calling XHR.open()? Yes. Just use encodeURI on it: var x = new XMLHttpRequest(); x.open('GET', encodeURI('http://example.com/a?b= c d ')); x.send(); But also consider to get rid of this invalid url string right from the beginning, i.e. before the string is constructed. I'm not sure where you are getting the parameter value from, but it could look like x.open('GET', 'http://example.com/a?b='+encodeURIComponent(…));
score: 3
upvote count: 3

e-commerce
tags question: http://stackoverflow.com/q/26991704
tag name: e-commerce
type: Tag

http://stackoverflow.com/q/26881949
has comment: http://stackoverflow.com/comment/42319915
upvote count: 1
downvote count: 1
type: Question
has title: JavaScript Addition Operators not work
tagged with: javascript
has body: I try using javascript but the addition is not correct, live code here function hitung2() { var a = $(".a2").val(); var b = $(".b2").val(); c = a * b; //a kali b d = c + a; $(".c2").val(c); $(".d2").val(d); }
has answer: http://stackoverflow.com/a/26882279
score: 0
has answer: http://stackoverflow.com/a/26882010
has comment: http://stackoverflow.com/comment/42319731
has answer: http://stackoverflow.com/a/26882040
favorite count: 0
answer count: 5
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26882048
has answer: http://stackoverflow.com/a/26882003

http://stackoverflow.com/q/26844031
score: 0
tagged with: google-chrome
tagged with: local-storage
has body: I have a Chrome Packaged Web App with a text editor (CodeMirror), and I'd like to implement what (I thought!) was a simple feature: When the app is closed, it should remember the contents of the editor so that it's there when it is opened again. Loading the text from storage is easy, and it works fine. I just can't seem to make save on exit work. I'd like to save the code in chrome.storage.sync which means I can't just save every time a character is pressed - what I need to do is detect when the web app exits and then save the contents of the window. I might just be doing something really stupid, but because I can't seem to debug what happens in background.js I have no idea - I can't even tell if my code is getting called when the window closes :( Does anyone have an example of how to detect when a Packaged App's window is closed and then write something (anything!) into chrome.storage.sync? Hopefully I can work onwards from there! (and sorry - I would have posted the code I used last time, but I can't find it now) thanks!
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26844661
has comment: http://stackoverflow.com/comment/42251638
type: Question
has comment: http://stackoverflow.com/comment/42251674
answer count: 1
tagged with: javascript
tagged with: google-chrome-app
has title: Saving Chrome Packaged App data to storage on exit
has comment: http://stackoverflow.com/comment/42251314
has answer: http://stackoverflow.com/a/26844661
has comment: http://stackoverflow.com/comment/42251395

marker
tag name: marker
tags question: http://stackoverflow.com/q/26866063
type: Tag

jquery-globalize
tag name: jquery-globalize
type: Tag
tags question: http://stackoverflow.com/q/26946511

http://stackoverflow.com/q/26977531
type: UnansweredQuestion
has body: I have created a parse register and login, and where the JavaScript functions work and respond well in Firefox and Chrome, but does not seem to respond in internet explorer. I am using Internet Explorer 11, and when attempting to login, the following error occurred in the developer console: Unable to get property 'getItem' of undefined or null reference under exception -> stack: stack "TypeError: Unable to get property 'getItem' of undefined or null reference\n at current (http://www.parsecdn.com/js/parse-1.2.12.min.js:3:6125)\n at Anonymous function (file:///C:/Users/test/Desktop/test/js/functions.js:6:3)\n at d (https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js:27:220)\n at Anonymous function (https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js:29:377)\n at m (https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js:6:190)\n at sb (https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js:29:358)\n at c (https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js:16:23)\n at rb (https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js:16:226)\n at jc (https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js:15:415)\n at Anonymous function (https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js:163:151)" for the following line: $scope.currentUser = Parse.User.current(); Below is the Parse JavaScript functions: Parse.initialize("ID", "ID"); angular.module('AuthApp', []) .run(['$rootScope', function($scope) { $scope.scenario = 'Sign up'; $scope.currentUser = Parse.User.current(); $scope.signUp = function(form) { var user = new Parse.User(); user.set("First Name", form.fname); user.set("Last Name", form.lname); user.set("password", form.password); user.set("email", form.email); user.signUp(null, { success: function(user) { window.location = 'myprofile.php' }, error: function(user, error) { alert("Unable to sign up: " + error.code + " " + error.message); } }); }; $…
has title: Internet Explorer: Unable to get property 'getItem' of undefined or null reference
type: Question
upvote count: 4
downvote count: 0
tagged with: javascript
score: 4
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
tagged with: parse-platform
tagged with: angularjs
answer count: 0

http://stackoverflow.com/comment/42469153
score: 0
type: QuestionComment
type: Comment
has text: and haha($index) appears to be providing you with what index you want to query on the action...pass reservationItem instead of $index and you'd have your whole object with the chosen detail loaded
comment on: http://stackoverflow.com/q/26954389

http://stackoverflow.com/q/26836424
tagged with: performance
has body: My dilema is as follows: I have been using the delete method for removing object keys, keys which some functions try to access after removal and I discovered that this has been causing a small, tiny... huge memory leak over time. I have been trying to find a good answer for this, but so far no luck. The only light reference I found explained that it is best to turn the object key into null instead of using delete to avoid memory leaks. Now I have been wondering about which method will be the best for the case that I described (and perhaps as an overall best practice): 1 - delete Object.key 2 - Object.key = null 3 - Object.key = "" 4 - Object.key = void(0) 5 - Object.key = function(){} 6 - Another method(s) that I didn't list - provide the method as example So far number 1 seems to be pretty much out of the question for this case where functions try to access the deleted keys, does anyone else have any knowledge that could advise me on this? If possible please provide comparison(s) or an explanation showing the advantage(s) of the method(s) that you know to be the best for this scenario. PS: The object keys that need to be removed can be anything; a function, boolean, string, etc.
tagged with: javascript
has comment: http://stackoverflow.com/comment/42238664
tagged with: optimization
score: 0
has comment: http://stackoverflow.com/comment/42307342
answer count: 1
accepted answer: http://stackoverflow.com/a/26836635
has comment: http://stackoverflow.com/comment/42238705
has comment: http://stackoverflow.com/comment/42238609
has title: Which method is the most appropriate for removing object keys which might be accessed after removal?
has comment: http://stackoverflow.com/comment/42238716
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42238755
has comment: http://stackoverflow.com/comment/42238654
has answer: http://stackoverflow.com/a/26836635
has comment: http://stackoverflow.com/comment/42238601
type: Question

http://stackoverflow.com/q/26950620
has body: I'm augmenting a scriptlet that handles shipping methods for a NetSuite web shopping cart. The goal is to read in the shopping cart items and detect the presence of two items. If the items are present in the cart and if the shipping country is not the US, we want an alert shown. The function is as follows: function shipPoster(){ for (var i = 0; i &lt; rows; i++) { var ctr = "carttablerow" + i; if (ctr.NameNumber in ('5454','5458')){ if (shpCty != "US"){ showtext ="These item(s) cannot be shipped outside the United States. Please remove these items prior to check out." } goShip() } } I've deployed the script and tested with the items in question. However, the alert is not thrown. How can I modify the above to ensure the cart items are read and the alert is triggered? Also, how do I prevent the user from proceeding? Is there a way to remove the item from the cart?
has title: NetSuite Scriptlet Not Reading Items from Shopping Bag
type: AnsweredQuestion
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/27313978
tagged with: netsuite
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26959668
score: 0
has answer: http://stackoverflow.com/a/27313978
has answer: http://stackoverflow.com/a/26959668

http://stackoverflow.com/comment/42263393
comment on: http://stackoverflow.com/a/26844901
score: 0
type: AnswerComment
type: Comment
has text: This helped me create a solution to use searchterms. Thanks!

http://stackoverflow.com/comment/42383301
type: Comment
comment on: http://stackoverflow.com/a/26916984
has text: I'm actually more interested in "negative `LOOKAHEAD`" than in solving it specificaly for `ExpressionStatement`.
score: 0
type: AnswerComment

http://stackoverflow.com/a/26978846
type: Answer
answers question: http://stackoverflow.com/q/26977587
has body: You need using javascript to discover the dynamic height. We have some functions in this links: make iframe height dynamic based on content inside- JQUERY/Javascript and call when the browser resize.
score: 0

http://stackoverflow.com/a/26889586
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42334448
has comment: http://stackoverflow.com/comment/42333620
type: Answer
has comment: http://stackoverflow.com/comment/42333322
has comment: http://stackoverflow.com/comment/42334390
has comment: http://stackoverflow.com/comment/42333398
accepted answer of: http://stackoverflow.com/q/26889447
has comment: http://stackoverflow.com/comment/42334064
downvote count: 1
answers question: http://stackoverflow.com/q/26889447
has body: You want to use the following, since, you say submit event is already prevented. This will submit the form in the default manner: $("#form")[0].submit(); Instead of: $("#form").unbind('submit', function(){ $("#form").submit(); }); Special Note: For this to work, ensure you do not have any form field with name="submit". UPDATE Given the updated code, here is my recommendation: $("#form").submit(function(e){ e.preventDefault(); $( "#container" ).fadeOut( "slow", function() { $("#form")[0].submit(); }); }); The fadeOut code should be moved to inside the submit handler DEMO
upvote count: 5
has comment: http://stackoverflow.com/comment/42334233
score: 4
has comment: http://stackoverflow.com/comment/42379246
has comment: http://stackoverflow.com/comment/42333674
has comment: http://stackoverflow.com/comment/42334001
has comment: http://stackoverflow.com/comment/42334519
has comment: http://stackoverflow.com/comment/42334595

http://stackoverflow.com/q/26927347
has answer: http://stackoverflow.com/a/26927635
has answer: http://stackoverflow.com/a/26927539
type: AnsweredQuestion
has title: Code runs on jsfiddle but not on website
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26927539
score: 0
answer count: 3
has body: This is probably a simple question and I believe it is to do with "on load", script not actually being called. When I run the code on jsfiddle it works fine, when I run it as a script file on my site it doesn't do anything. The code in the script file goes straight into it: var VELOCITY = 0.3; // Half speed is var PARTICLES = 200; ... .. Should I have a separate line in my HTML to specially call the function or is it better to wrap my javascript in something like this: window.onload=function(){ /* your js here */ } PS: This is not jQuery.
has answer: http://stackoverflow.com/a/26927580
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/26927635
has comment: http://stackoverflow.com/comment/42400828
has comment: http://stackoverflow.com/comment/42400798

http://stackoverflow.com/comment/42501910
has text: It hasn't got a `.` or a `#` in front of it because it is not a class or an ID. `select` is an element.
score: 0
comment on: http://stackoverflow.com/q/26983837
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26896291
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/26896536
upvote count: 1
tagged with: appendto
type: Question
possible better answer: http://stackoverflow.com/a/26896483
tagged with: addclass
has answer: http://stackoverflow.com/a/26896483
accepted answer: http://stackoverflow.com/a/26896536
tagged with: javascript
has comment: http://stackoverflow.com/comment/42346057
has answer: http://stackoverflow.com/a/26896413
answer count: 3
downvote count: 0
has body: I'm fairly new to jQuery and am trying to understand some piece of code I just wrote. I have a simple HTML This is the div And my script looks like this $(document).ready(function(){ $("button").on("click",function(){ $(" ").attr("id","myDiv").appendTo("#theDiv"); $(" ").addClass("mySelects").appendTo("#myDiv"); }); $(".mySelects").on("click",function(){ console.log("Do some stuff here"); $(' Text ').appendTo(".mySelects") }); }); So what I want to do is add a new div with a select and add the select to a class. The scpipt above does not work, I'm not sure why, whereas the code below does the trick $(document).ready(function(){ $("button").on("click",function(){ $(" ").attr("id","myDiv").appendTo("#theDiv"); $(" ").addClass("mySelects").appendTo("#myDiv"); $(".mySelects").on("click",function(){ console.log("Just added the class"); $(' Text ').appendTo(".mySelects") }); }); }); I hope some of you jQuery Gurus can explain me what's going on since I don't really know enough to understand it by myself. Here's the fiddle I've been using http://jsfiddle.net/k1stLsft/2/ Cheers.
tagged with: jquery
favorite count: 0
has title: Issue creating new elements in jQuery

http://stackoverflow.com/comment/42405081
type: AnswerComment
score: 0
has text: 600 was just a rough idea :) I have tried removing display block, but again it is showing same behaviour.Removing itself at 700 instead of flowing to next line
type: Comment
comment on: http://stackoverflow.com/a/26929762

http://stackoverflow.com/q/26931274
has body: I have: Simple block of html text: The future of manned space exploration and development of space depends critically on the creation of a dramatically more proficient propulsion architecture for in-space transportation. A very persuasive reason for investigating the applicability of nuclear power in rockets is the vast energy density gain of nuclear fuel when compared to chemical combustion energy... I want: wrap word into span when user click on it. I.e. User clicked at manned word, than I should get The future of manned space exploration and development of space depends critically on the creation of a .... Question: How to do that? Is there way more efficient that just wrap all words into span at loading stage? P.S. I'm not interested in window.getSelection() because I want to imply some specific styling for touched words and also keep collection of touched words Special for @DavidThomas: example where I get selected text, but do not know how to wrap it into span.
has answer: http://stackoverflow.com/a/62768831
linked to: http://stackoverflow.com/q/7563169
has comment: http://stackoverflow.com/comment/42407757
has comment: http://stackoverflow.com/comment/42407735
has comment: http://stackoverflow.com/comment/42407731
upvote count: 3
has answer: http://stackoverflow.com/a/26931506
linked to: http://stackoverflow.com/q/12321511
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42407827
has answer: http://stackoverflow.com/a/26932185
has comment: http://stackoverflow.com/comment/42407804
answer count: 4
has comment: http://stackoverflow.com/comment/42407931
score: 3
downvote count: 0
has answer: http://stackoverflow.com/a/26931648
has comment: http://stackoverflow.com/comment/42407768
has comment: http://stackoverflow.com/comment/42407973
tagged with: jquery
has comment: http://stackoverflow.com/comment/42407818
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/42407945
has title: How to wrap word into span on user click in javascript
has comment: http://stackoverflow.com/comment/42408698
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/42411657
comment on: http://stackoverflow.com/a/26933221
type: Comment
score: 0
has text: when i click back on the textbox and type a low value the error doesnt appear anymore. its not good this way to many problems, thats why am looking for another solution
type: AnswerComment

http://stackoverflow.com/q/26904565
has body: I have a login screen which the user logs in using Jquery and AJAX. That's fine. Now what I want is that if the user logs in correctly, I want to load another page. I tried using document.location = "home.html"; but that refreshes my page. What I want is like that transition that normally we have when we click on tag like &lt;a href="SchoolMaterials.html"&gt; &lt;!-- this does not refresh --&gt; I don't know if I explained myself clearly. Thanks
tagged with: ajax
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42360535
tagged with: http://stackoverflow.com/tag/html
has title: Call/load Jquery Page
has answer: http://stackoverflow.com/a/26905071
has comment: http://stackoverflow.com/comment/42360988
has comment: http://stackoverflow.com/comment/42360595
type: Question
has answer: http://stackoverflow.com/a/26904953
has comment: http://stackoverflow.com/comment/42360308
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/42360516
has comment: http://stackoverflow.com/comment/42362204
tagged with: jquery

http://stackoverflow.com/q/26944414
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26944677
has title: Function to split a phrase of the form "fooBar" into "foo bar" in javascript?
downvote count: 1
tagged with: algorithm
score: -1
linked to: http://stackoverflow.com/q/10064683
type: Question
upvote count: 0
duplicate of: http://stackoverflow.com/q/10064683
tagged with: javascript
tagged with: string
has answer: http://stackoverflow.com/a/26944481
answer count: 3
has answer: http://stackoverflow.com/a/26944497
has body: What's the best way to have a function that takes in a phrase of the form fooBar and returns the words foo bar? My current approach of iterating over all characters to find a capitalized letter and then splitting on that index seems suboptimal is there a better way? Thanks!
has comment: http://stackoverflow.com/comment/42431644
tagged with: regex
favorite count: 0

http://stackoverflow.com/comment/42360957
score: 0
type: Comment
has text: @Rodge - can it be because of the html syntax : `calss="thumbs_img"` that should be `class=` ?
comment on: http://stackoverflow.com/a/26904712
type: AnswerComment

http://stackoverflow.com/a/26876146
answers question: http://stackoverflow.com/q/26875802
type: Answer
has body: You can videoBg = null to enable the object to the garbage collector. Although you need to append it to the dom in order to play the video. Example jsbin http://jsbin.com/wefuyiqate/1/edit?js,console
score: 0

http://stackoverflow.com/comment/42335289
type: Comment
type: QuestionComment
has text: Erm... `var person = [{firstName:"John"},{firstName:"Peter"}];` gives `person[0].firstName` as `John`. Note that arrays are zero-based.
comment on: http://stackoverflow.com/q/26890677
score: 0

http://stackoverflow.com/q/26889805
has answer: http://stackoverflow.com/a/26890181
upvote count: 1
has comment: http://stackoverflow.com/comment/42333767
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42333729
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/26889964
has title: Set background-image for button to element already contained within page
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42333770
favorite count: 0
has body: Basically I want to specify the background-image for a button using something other than an image url. Being able to set the background-image to an already loaded element contained within the DOM would be ideal. This is so that I can cache a loading gif (displayed on the button) within the DOM and don't have to fetch it when the button is clicked. I didn't think code was necessary to illustrate the problem but here is some anyway Not ideal due to image loading on click: that.submitButtonSelector.css('background-image', 'url(/Content/_activity/ajax-loader.gif)'); Ideal (but no obvious way to achieve) that.submitButtonSelector.css('background-image', '#precachedImage');
possible better answer: http://stackoverflow.com/a/26890181
has answer: http://stackoverflow.com/a/26889964

http://stackoverflow.com/q/26939593
accepted answer: http://stackoverflow.com/a/26940011
has body: can anybody suggest me how can i convert a given Tick format number to decimal sing JavaScript ? Tick Format Decimal 10-8 10+8/32 == 10.25 10-16/32 10+ 16/32 == 10.50 10-8+ 10 + 8/32 + 1/64 == 10.265625 The format consists of an integer part, followed by '-' and then a fractional part specified in multiples of 1/32 (called a quote). There can be an optional '+' at the end to indicate a half-quote (1/64). As I am a beginner in JS it would be a great a help if anybody can suggest basic idea ( not full length code) to get started. Thanks
possible better answer: http://stackoverflow.com/a/26940178
type: Question
has answer: http://stackoverflow.com/a/26940178
answer count: 3
tagged with: javascript
has title: Tick Format to Decimal Format Conversion
has answer: http://stackoverflow.com/a/26940431
has answer: http://stackoverflow.com/a/26940011
type: AnsweredQuestion
score: 0

http://stackoverflow.com/q/26897802
answer count: 1
has title: Serializing JSON array and parse it as an array too
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26897923
accepted answer: http://stackoverflow.com/a/26897923
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: arrays
tagged with: mongoose
tagged with: javascript
has body: I have a trouble serializing and parsing arrays. I show you code and after explain: Code Client POST request: jQuery('.upload').on('click', function() { var flats = []; var data_building_id = jQuery(this).attr('data-building-id'); jQuery('#setup-' + data_building_id).find('.flat-value').each(function() { flats.push(jQuery(this).html()); }); flats.sort(); var data = 'building={"flats":' + JSON.stringify(flats) + ',"_id":"' + data_building_id + '"}' ; makeTheRequest('post', 'admin_buildings', data, 'json', onSuccessSignLog, onErrorGenericAJAX); }); Building Controller Code: router.post('/admin_buildings', function(req, res) { var building = req.body.building; if(req.session &amp;&amp; req.session.user &amp;&amp; (req.session.user.rol=="Admin" || req.session.user.rol=="superAdmin") &amp;&amp; building) { building = JSON.parse(building); building.flats = new Array(building.flats); if(building.flats instanceof Array) console.log("buildings.js-&gt; admin_building-&gt; flats is array"); buildingDB.updateBuilding(building, function(results) { //here goes the returning values to the client. }); } }); Building Model Code: this.updateBuilding = function(building, callback) { Model.findById(building._id, function(err, doc) { if(err) callback({success:0, error:1, result: err}); else if(!doc || doc.lenght==0) callback({success:0, error:1}); else { if(building.flats &amp;&amp; building.flats instanceof Array)doc.flats = [building.flats]; for (var x=0;x&lt;doc.flats.length;x++) console.log("The element " + x + " on the array flat doc is: " + doc.flats[x]); if(building.flat) doc.flats.push(building.flat); doc.save(function(err) { if(err)callback({success:0, error:1, result: err}); else callback({success:1, error:0, result:doc}); }); } }); } Ok!! I try to summarize the most that I can, but... What I do is, on the client side: take some data, put them into array and sort it alphabetically (eg: 1a, 1b, 2a, 2b... flat and door), finally I serialize this array and send on a post. The con…
score: 0

http://stackoverflow.com/comment/42274159
has text: @skobaljic: you can already use an to select any file on the local PC or network shared folders...
comment on: http://stackoverflow.com/q/26855938
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/42316193
type: Comment
has text: Please see my updated question, why is it not inserting the values to my dataArray2.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26879583

http://stackoverflow.com/comment/42426317
type: AnswerComment
comment on: http://stackoverflow.com/a/26940876
has text: @kAlmAcetA - Then you have commas to worry about, the OP's code has no such thing, it's like saying try this string `foobar bar,,foo footerot, barkeeper`, it's just not the same thing anymore
type: Comment
score: 0

http://stackoverflow.com/comment/42639991
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27011772
type: Comment
has text: @confile Ah. I couldn't directly run the original fiddle either and I thought you worked around it. I have change the image to data uri so that the fiddle can run, both on desktop and on my android. I cannot help more with iPhone rings since I do not use Apple and all six browsers I tested does not show the observed pattern.

http://stackoverflow.com/comment/42295341
type: Comment
type: QuestionComment
has text: put quotes around it like so.. "childfilm.php"
comment on: http://stackoverflow.com/q/26868057
score: 0

http://stackoverflow.com/comment/42523676
type: Comment
comment on: http://stackoverflow.com/a/26891044
type: AnswerComment
has text: can you help me again?
score: 0

http://stackoverflow.com/q/26845032
favorite count: 0
has body: I have a situation where the client will set the name that will appear in the &lt;title&gt; of the page. Wanted to know how best to do this with AngularJS. It will define and save thus leaving the &lt;title&gt; Custom.
has title: How to set title page with angular js
tagged with: angularjs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26845104
downvote count: 1
type: Question
upvote count: 0
tagged with: javascript
score: -1
accepted answer: http://stackoverflow.com/a/26845104
answer count: 1

http://stackoverflow.com/q/26856783
answer count: 4
type: AnsweredQuestion
has title: size of a function in memory
score: 3
downvote count: 0
has answer: http://stackoverflow.com/a/26856839
tagged with: memory
type: Question
has answer: http://stackoverflow.com/a/26856888
tagged with: function
tagged with: javascript
upvote count: 3
accepted answer: http://stackoverflow.com/a/26856826
favorite count: 0
has body: I have been exploring the size of various objects in javascript using sizeof.js. When I examine the size of a function I get zero bytes no matter how many lines of code the function contains. For example: alert(sizeof( function(){ return 1; } )); This returns a size of zero. Even if I give the function many lines of code I get a size of zero bytes. The amount of memory needed to store a string is dependent on the length of the string. But the complexity or size of a function seems to be irrelevant. Why is this so?
possible better answer: http://stackoverflow.com/a/26856842
has answer: http://stackoverflow.com/a/26856826
has answer: http://stackoverflow.com/a/26856842

http://stackoverflow.com/q/26861097
has comment: http://stackoverflow.com/comment/42282650
type: UnansweredQuestion
has title: How to insert script in head of iframe have a src?
has comment: http://stackoverflow.com/comment/42282588
answer count: 0
score: 0
tagged with: iframe
type: Question
has body: How to insert script in head of iframe? i have a iframe like this how to insert script(see below) in head of above iframe
tagged with: javascript
has comment: http://stackoverflow.com/comment/42282646
tagged with: jquery

http://stackoverflow.com/comment/42412126
type: Comment
type: QuestionComment
has text: Please do not use the [tag:jquery-validate] tag unless you're asking about the jQuery Validate plugin. Edited. Thanks.
comment on: http://stackoverflow.com/q/26933041
score: 0

http://stackoverflow.com/a/26936321
answers question: http://stackoverflow.com/q/26936022
type: Answer
has comment: http://stackoverflow.com/comment/42421497
has body: http://docs-origin.sencha.com/extjs/4.2.2/#!/api/Ext.grid.feature.Grouping-cfg-collapsible collapsible : Boolean Set to false to disable collapsing groups from the UI. This is set to false when the associated store is buffered. Defaults to: true Use features: [{ftype:'grouping', collapsible: false}], on your grid Ext.application({ name: 'Fiddle', launch: function() { var store = Ext.create('Ext.data.Store', { storeId: 'employeeStore', fields: ['name', 'seniority', 'department'], groupField: 'department', data: { 'employees': [{ "name": "Michael Scott", "seniority": 7, "department": "Management" }, { "name": "Dwight Schrute", "seniority": 2, "department": "Sales" }, { "name": "Jim Halpert", "seniority": 3, "department": "Sales" }, { "name": "Kevin Malone", "seniority": 4, "department": "Accounting" }, { "name": "Angela Martin", "seniority": 5, "department": "Accounting" }] }, proxy: { type: 'memory', reader: { type: 'json', root: 'employees' } } }); Ext.create('Ext.grid.Panel', { title: 'Employees', store: Ext.data.StoreManager.lookup('employeeStore'), columns: [{ text: 'Name', dataIndex: 'name', flex: 1 }, { text: 'Seniority', dataIndex: 'seniority', flex: 1 }], features: [{ ftype: 'grouping', collapsible: false }], width: 500, renderTo: Ext.getBody() }); } }); &lt;script src="https://extjs.cachefly.net/ext/gpl/4.2.1/ext-all-debug.js"&gt;&lt;/script&gt; &lt;link href="https://extjs.cachefly.net/ext/gpl/4.2.1/packages/ext-theme-classic/build/resources/ext-theme-classic-all.css" rel="stylesheet"/&gt;
score: 0
accepted answer of: http://stackoverflow.com/q/26936022
type: AcceptedAnswer

http://stackoverflow.com/q/26894708
tagged with: google-chrome
has answer: http://stackoverflow.com/a/28020681
type: Question
score: 3
tagged with: cloud9-ide
has comment: http://stackoverflow.com/comment/42365015
tagged with: javascript
tagged with: ubuntu-14.04
has comment: http://stackoverflow.com/comment/42388950
upvote count: 3
answer count: 1
favorite count: 0
has body: I have installed cloud9 on an ocean digital server 10.04 I installed it using the latest version from git git clone https://github.com/ajaxorg/cloud9.git and following the github install procedure: installation-and-usage The install went well and the server started successfully and runs in the browser: ~/cloud9/bin/cloud9.sh -l 0.0.0.0 --username user --password pass -w ~/workspace/myproject/ When I open it in Chrome, workspace loads correctly, I can see my files, but when I try to edit a file the editor window does not open. Checking the network tab in Chrome developer tools I can see ace.js has a 404 error Request URL:http://myname.com:3131/static/ace/build/ace.js I then tried running it in Firefox and I can open and edit files without problems. Can anyone suggest what the problem might be in Chrome?
type: UnansweredQuestion
has title: cloud9 on ubuntu getting ace.js 404 error in chrome
has comment: http://stackoverflow.com/comment/42372259
downvote count: 0

http://stackoverflow.com/q/26918140
has comment: http://stackoverflow.com/comment/42397823
has title: jQuery cropper doesn't work on dynamically generated image
has comment: http://stackoverflow.com/comment/42385317
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42385122
has body: I have just downloaded this jQuery plugin that helps in cropping an image. I have the following function which is called on an file input field's change event: function loadPreview(input) { if (input.files &amp;&amp; input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $(".photoBox div").hide(); var cropBox = $(".photoPreview").show(); var $img = $(document.createElement('img')); $img.attr("src", e.target.result); cropBox.append($img); $(".photoPreview img").cropper({ aspectRatio: 1, dashed: false, zoomable: false, rotatable: false }); }; reader.readAsDataURL(input.files[0]); } } The cropper code doesn't show up in Mozilla, but in Opera it does. Where am I wrong?
has comment: http://stackoverflow.com/comment/42385084
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/38453509
has comment: http://stackoverflow.com/comment/42385177
score: 0
answer count: 1

http://stackoverflow.com/comment/42530712
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26973645
has text: That would be the `df` [utility](http://unixhelp.ed.ac.uk/CGI/man-cgi?df)
score: 0

http://stackoverflow.com/comment/42502251
score: 0
comment on: http://stackoverflow.com/q/26984210
type: QuestionComment
type: Comment
has text: What are you trying to do?

http://stackoverflow.com/q/26835537
has answer: http://stackoverflow.com/a/26835562
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26835562
score: 0
has body: I have this snippet of code that I have been using to check to see if a user is online on hitbox.tv or not. However I would like to make it so instead of printing out a text string it would print out an image to display whether the user is online of not. Is there a way to use a default image and display it with the username overlay-ed on it? http://jsfiddle.net/foz3dL53/ $(document).ready(function () { $("#formButton").click(function () { var channel = $("#channelName").val(); $.getJSON("http://api.hitbox.tv/media/live/" + channel.toLowerCase(), function (data) { var mediaIsLive = data.livestream[0].media_is_live; if (mediaIsLive == 1) { return $("#liveNotification").text(channel + " is online"); } return $("#liveNotification").text(channel + " is offline"); }).error(function () { $("#liveNotification").text("I'm not sure :o"); }); }); }); Stream status: - Type the channel's name below
answer count: 1
tagged with: jquery
has title: Print image instead of text
type: AnsweredQuestion

http://stackoverflow.com/comment/42281168
type: QuestionComment
has text: Lol - so you are primarily a PHP guy, who needs to write a little JS? If so, you might also consider AJAX - have the JS call a function on your server which you know is calling the PHP regex function, which you understand.
type: Comment
comment on: http://stackoverflow.com/q/26860178
score: 0

http://stackoverflow.com/q/26849156
tagged with: web-component
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: custom-element
accepted answer: http://stackoverflow.com/a/26853230
has body: Hey I'm beginning with Webcomponents and I built a little HTML Import Example, where I import a calander from another Website with VanillaJs and it works perfekt. As the 2. Step I wanted to HTML import into a Polymer element, so that I can use the element over and over again. Here is my code: &lt;link rel="import" href="http://www.testsite.com"&gt; &lt;link rel="import" href="bower_components/polymer/polymer.html"&gt; &lt;polymer-element name="event-calendar-element"&gt; &lt;template&gt; &lt;div id="container" style = "width:220px;"&gt;&lt;/div&gt; &lt;/template&gt; &lt;script&gt; var owner = document._currentScript.ownerDocument; var link = owner.querySelector('link[rel="import"]'); var content = link.import; var container = document.getElementById('container'); var el = content.querySelector('.slider-teaser-column'); container.appendChild(el.cloneNode(true)); &lt;/script&gt; &lt;/polymer-element&gt; In the other HTML document I use the custom element and I can see, that the import worked(the resources from testsite.com are loaded), but my Polymer element has no shadowDOM - the imported and selected element is not appended to my &lt;event-calendar-element&gt; :/ the container &lt;div&gt; is null and therefore the following error occurs: Cannot read property 'appendChild' of null Any help appreciated ;)
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26853230
type: Question
tagged with: polymer
has title: Polymer HTML Import into Custom Element
tagged with: javascript
score: 0

http://stackoverflow.com/comment/42410518
has text: lol. sure, I'm a JavaScript ninja! I can take anything you can throw at me.
type: Comment
comment on: http://stackoverflow.com/a/26931944
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42284133
has text: @JamesThorpe I'm not sure. But I'm interested - why would `keypress` be any different?
comment on: http://stackoverflow.com/q/26861939
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42262750
score: 0
type: AnswerComment
type: Comment
has text: So the "return statusIndex[text.genre()]" returns true/false to the arrayFilter, and that´s what filtering the array, right?
comment on: http://stackoverflow.com/a/26847339

http://stackoverflow.com/comment/42255245
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26845850
type: Comment
has text: My intention was to put the function call where the function was... didnt check the circumstances of the function. Its right, that this version calls the function immediately.

encryption
tags question: http://stackoverflow.com/q/26989798
tags question: http://stackoverflow.com/q/26974375
tags question: http://stackoverflow.com/q/26861912
tag name: encryption
tags question: http://stackoverflow.com/q/26835411
type: Tag

http://stackoverflow.com/a/31128902
type: Answer
score: 0
has body: You can also use $localStorage if you want the login to persist outside of the current session. I've found this library has been super helpful for these types of situations. (https://github.com/grevory/angular-local-storage)
answers question: http://stackoverflow.com/q/26920217

iframe
tags question: http://stackoverflow.com/q/26899339
tags question: http://stackoverflow.com/q/26984251
tags question: http://stackoverflow.com/q/26861097
tags question: http://stackoverflow.com/q/26928889
tags question: http://stackoverflow.com/q/26877424
tags question: http://stackoverflow.com/q/26969764
tags question: http://stackoverflow.com/q/26855126
tags question: http://stackoverflow.com/q/26889362
tags question: http://stackoverflow.com/q/26893061
tag name: iframe
tags question: http://stackoverflow.com/q/26872504
tags question: http://stackoverflow.com/q/26936638
tags question: http://stackoverflow.com/q/26951248
tags question: http://stackoverflow.com/q/26866342
tags question: http://stackoverflow.com/q/26864287
tags question: http://stackoverflow.com/q/26925411
tags question: http://stackoverflow.com/q/26916816
tags question: http://stackoverflow.com/q/26944007
tags question: http://stackoverflow.com/q/26852730
tags question: http://stackoverflow.com/q/26965150
tags question: http://stackoverflow.com/q/26952014
tags question: http://stackoverflow.com/q/26947223
tags question: http://stackoverflow.com/q/26941474
tags question: http://stackoverflow.com/q/26905605
tags question: http://stackoverflow.com/q/26985213
tags question: http://stackoverflow.com/q/26953645
tags question: http://stackoverflow.com/q/26921603
tags question: http://stackoverflow.com/q/26850491
tags question: http://stackoverflow.com/q/26990992
tags question: http://stackoverflow.com/q/26986841
tags question: http://stackoverflow.com/q/26910680
tags question: http://stackoverflow.com/q/26855339
type: Tag
tags question: http://stackoverflow.com/q/26990014
tags question: http://stackoverflow.com/q/26889281
tags question: http://stackoverflow.com/q/26909580
tags question: http://stackoverflow.com/q/26983125
tags question: http://stackoverflow.com/q/26966922
tags question: http://stackoverflow.com/q/26849240
tags question: http://stackoverflow.com/q/26978472
tags question: http://stackoverflow.com/q/26943018
tags question: http://stackoverflow.com/q/26888178
tags question: http://stackoverflow.com/q/26910870
tags question: http://stackoverflow.com/q/26957051
tags question: http://stackoverflow.com/q/26904167
tags question: http://stackoverflow.com/q/26960434
tags question: http://stackoverflow.com/q/26945950
tags question: http://stackoverflow.com/q/26887991
tags question: http://stackoverflow.com/q/26955795
tags question: http://stackoverflow.com/q/26863601

http://stackoverflow.com/comment/42478814
type: AnswerComment
type: Comment
has text: Thanks @WHITECOLOR, I'd misunderstood that bit whilst skim-reading the docs. :) Good knowledge...
comment on: http://stackoverflow.com/a/26968006
score: 0

http://stackoverflow.com/q/26863048
has answer: http://stackoverflow.com/a/26863164
favorite count: 0
has title: Javascript insertBefore method cannot be called mulitple times adding same child node?
has answer: http://stackoverflow.com/a/26863208
has answer: http://stackoverflow.com/a/26863091
has answer: http://stackoverflow.com/a/26863093
answer count: 4
type: AnsweredQuestion
has body: I tried to add same element to the HTML document multiple times, but it doesn't work, I don't know the reason. The code is following: Very Secret why the result is Very Secret **Child** instead of Very Secret **Child** **Child** **Child**
possible better answer: http://stackoverflow.com/a/26863091
accepted answer: http://stackoverflow.com/a/26863208
type: Question
tagged with: javascript
score: 4
upvote count: 4
downvote count: 0

http://stackoverflow.com/q/26860089
has title: How to check whether javascript is enabled on browser on server side using c# in asp.net
tagged with: asp.net
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42281007
tagged with: c#-4.0
answer count: 0
has comment: http://stackoverflow.com/comment/42281073
has comment: http://stackoverflow.com/comment/42285911
type: Question
tagged with: javascript
score: 0
has body: How to check whether javascript is enabled on browser on server side using c# in asp.net I tried the following code but its not working. if (Request.Browser.JavaScript) { Response.Redirect("~/enabledpage.aspx", false); } else { Response.Redirect("~/disabledpage.aspx", false); }

http://stackoverflow.com/q/26931694
has comment: http://stackoverflow.com/comment/42408473
has body: I have made a method for adding an image to the page for user feedback. I have tried the method on its own and now want to use it over and over again so it matches the validation on the site. function ValidateFields(div, imgDiv) { var validPass = true; var elem = document.getElementById(div).value; if (elem == "") { var img = document.createElement("img"); img.src = "/assets/img/errorIcon.png"; var src = document.getElementById(imgDiv); src.appendChild(img); validPass = false; //document.getElementById('lbl_pdf_title').innerText = ("Please enter a title for the PDF"); } return (validPass); } When I used this method by passing in the correct values it works ok, but now I want to use the method like this: function ValidatePdf() { ValidateFields('txt_pdf_title', 'imgPdfError'); if (!ValidateFields()) { // make it false } } I want to use the method lots of times in the ValidatePdf() but it shows the symbol then carries on to run the serverside method. This is my button click: &lt;button id="btn_submit_pdf" runat="server" class="btn btn-default" title="Submit PDF" onclick="if (!ValidatePdf()) return false;" onserverclick="btn_submit_pdf_Click"&gt; Submit &lt;/button&gt; Do I need to pass another value to the ValidateFields() I am at a loss as why it doesn't work.But does when you pass the original values in and call the method on the button click
accepted answer: http://stackoverflow.com/a/26931818
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/42408566
score: 0
answer count: 3
has title: How do I stop server side event getting called
possible better answer: http://stackoverflow.com/a/26932040
has answer: http://stackoverflow.com/a/26932040
has answer: http://stackoverflow.com/a/26931818
has answer: http://stackoverflow.com/a/26931810
type: AnsweredQuestion

http://stackoverflow.com/comment/42364226
has text: Could you include the HTML code? In any case, if you want to append data, you shouldn¡t be reasigning values with this line: $scope.programs.rated = r.gettopratedhomepage.topratedprogrammelist; You should just loop over the returned data and append them to the existing array
comment on: http://stackoverflow.com/q/26906879
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42350114
has text: You probably want a memory mapped file. The [mmap](https://github.com/geocar/mmap) module should be useful here.
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/26898270

http://stackoverflow.com/q/26991030
tagged with: jssor
has body: is it possible to keep the aspect ratio within the thumbnailnavigator? I've tried the option $FillMode for $ThumbnailNavigatorOptions but that changes nothing.
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/26991482
tagged with: javascript
score: 0
answer count: 1
has title: Keep aspect ratio in JSSOR Thumbnailnavigator
accepted answer: http://stackoverflow.com/a/26991482

http://stackoverflow.com/a/26942766
score: 0
has body: var $obj=$(".btn"); $(document).on("click",$obj,function() { // ".on" is missing ... });
answers question: http://stackoverflow.com/q/26942705
type: Answer
has comment: http://stackoverflow.com/comment/42428844

http://stackoverflow.com/comment/42336034
score: 0
comment on: http://stackoverflow.com/q/26890849
type: Comment
type: QuestionComment
has text: @David Is it possible to do this from my current JS file?

http://stackoverflow.com/q/26840694
type: Question
answer count: 1
tagged with: bower
has title: serving grunt managed UI in sinatra based web-app
score: 0
has answer: http://stackoverflow.com/a/26844565
tagged with: javascript
tagged with: gruntjs
type: AnsweredQuestion
tagged with: ruby
has body: I'm in early stage of web-app development, where: API: ruby + sinatra (using bundler) UI: html+js (angular + yeoman => grunt+bower) dir layout: fooApp - contains API fooApp/ui - contains UI I can nicely unit test these separately. Up to now, I used for manual testing: bundle exec rackup (backend) grunt serve (for UI) However I'm in a phase when I need to serve the UI from sinatra. And here I'm stuck. How should I proceed? How should I reference grunt/bower managed stuff from sinatra?
accepted answer: http://stackoverflow.com/a/26844565
tagged with: sinatra

http://stackoverflow.com/comment/42492481
type: QuestionComment
has text: Can you show how you're including all the relevant javascript? I have a feeling you might not be loading the files properly. Are you receiving any errors within console?
comment on: http://stackoverflow.com/q/26978637
score: 0
type: Comment

http://stackoverflow.com/q/26884197
answer count: 1
tagged with: responsive-design
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42355347
has comment: http://stackoverflow.com/comment/42332637
score: 2
has answer: http://stackoverflow.com/a/26904780
has title: Responsive tabs in foundation 5
tagged with: zurb-foundation
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: how can I make the tabs responsive by using foundation framework? I am getting the output like this in the responsive window: Tab 1 Tab 2 Tab 3 Tab 4 First panel content goes here... Second panel content goes here... Third panel content goes here... Fourth panel content goes here...
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
upvote count: 2

http://stackoverflow.com/a/26886041
has body: You use the change event. function checkNumber(box) { if (box.value.match("^[0-9]{2}\-[0-9]{8}$") !== null) { alert("You entered the phone number correctly"); } else { alert("You entered the phone number incorrectly"); } } &lt;input type="text" onchange="checkNumber(this)" value="" placeholder="Phone Number" /&gt;
accepted answer of: http://stackoverflow.com/q/26885898
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26885898
type: Answer
has comment: http://stackoverflow.com/comment/43550620
has comment: http://stackoverflow.com/comment/43551398
score: 4
upvote count: 4

regex
tags question: http://stackoverflow.com/q/26855757
tags question: http://stackoverflow.com/q/26852609
tags question: http://stackoverflow.com/q/26896956
tags question: http://stackoverflow.com/q/26866790
tags question: http://stackoverflow.com/q/26910567
tags question: http://stackoverflow.com/q/26900561
tag name: regex
tags question: http://stackoverflow.com/q/26891550
tags question: http://stackoverflow.com/q/26957296
tags question: http://stackoverflow.com/q/26961021
tags question: http://stackoverflow.com/q/26840562
tags question: http://stackoverflow.com/q/26843230
tags question: http://stackoverflow.com/q/26957693
tags question: http://stackoverflow.com/q/26942503
tags question: http://stackoverflow.com/q/26853343
tags question: http://stackoverflow.com/q/26891396
tags question: http://stackoverflow.com/q/26894542
tags question: http://stackoverflow.com/q/26935337
tags question: http://stackoverflow.com/q/26928387
tags question: http://stackoverflow.com/q/26880499
tags question: http://stackoverflow.com/q/26889868
tags question: http://stackoverflow.com/q/26857934
tags question: http://stackoverflow.com/q/26861727
tags question: http://stackoverflow.com/q/26905431
tags question: http://stackoverflow.com/q/26940479
tags question: http://stackoverflow.com/q/26844646
tags question: http://stackoverflow.com/q/26888555
tags question: http://stackoverflow.com/q/26934470
tags question: http://stackoverflow.com/q/26947583
tags question: http://stackoverflow.com/q/26944414
tags question: http://stackoverflow.com/q/26902272
tags question: http://stackoverflow.com/q/26952540
tags question: http://stackoverflow.com/q/26991825
tags question: http://stackoverflow.com/q/26947729
tags question: http://stackoverflow.com/q/26860126
tags question: http://stackoverflow.com/q/26981549
tags question: http://stackoverflow.com/q/26924055
tags question: http://stackoverflow.com/q/26929891
tags question: http://stackoverflow.com/q/26963948
tags question: http://stackoverflow.com/q/26871008
tags question: http://stackoverflow.com/q/26870428
tags question: http://stackoverflow.com/q/26989168
tags question: http://stackoverflow.com/q/26896811
tags question: http://stackoverflow.com/q/26934703
tags question: http://stackoverflow.com/q/26991337
tags question: http://stackoverflow.com/q/26861776
tags question: http://stackoverflow.com/q/26951003
tags question: http://stackoverflow.com/q/26877604
tags question: http://stackoverflow.com/q/26876497
tags question: http://stackoverflow.com/q/26856867
tags question: http://stackoverflow.com/q/26852849
tags question: http://stackoverflow.com/q/26895005
tags question: http://stackoverflow.com/q/26961307
tags question: http://stackoverflow.com/q/26914652
tags question: http://stackoverflow.com/q/26842192
tags question: http://stackoverflow.com/q/26986026
tags question: http://stackoverflow.com/q/26990226
tags question: http://stackoverflow.com/q/26956430
tags question: http://stackoverflow.com/q/26934527
tags question: http://stackoverflow.com/q/26956208
tags question: http://stackoverflow.com/q/26856470
tags question: http://stackoverflow.com/q/26958329
tags question: http://stackoverflow.com/q/26931798
tags question: http://stackoverflow.com/q/26923015
tags question: http://stackoverflow.com/q/26928323
tags question: http://stackoverflow.com/q/26920364
tags question: http://stackoverflow.com/q/26877680
tags question: http://stackoverflow.com/q/26850931
tags question: http://stackoverflow.com/q/26908373
tags question: http://stackoverflow.com/q/26919093
tags question: http://stackoverflow.com/q/26883047
tags question: http://stackoverflow.com/q/26972839
tags question: http://stackoverflow.com/q/26888654
tags question: http://stackoverflow.com/q/26855889
tags question: http://stackoverflow.com/q/26875266
tags question: http://stackoverflow.com/q/26885941
tags question: http://stackoverflow.com/q/26859317
tags question: http://stackoverflow.com/q/26911910
tags question: http://stackoverflow.com/q/26861732
tags question: http://stackoverflow.com/q/26846663

http://stackoverflow.com/comment/42281811
score: 0
type: AnswerComment
type: Comment
has text: Wow that is nice, I will apply this in some project, but in my case I want to do is, the part with black background must have white fontcolor and part with white background must have black fontcolor, is it possible?
comment on: http://stackoverflow.com/a/26853006

http://stackoverflow.com/comment/42255112
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26838033
score: 0
has text: I want the div slider responsive every time I stretch the browser but the problem is the picture is to big evrytime I stretch it.

http://stackoverflow.com/q/26875454
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/26875569
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42308606
score: -6
has title: Is it possible to have a checkbox contain a function?
has body: What I am hoping to achieve is when I tick a checkbox it applies an integer to a total. When it is unchecked, the default value is zero.
accepted answer: http://stackoverflow.com/a/26875569
downvote count: 6
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42308624

http://stackoverflow.com/comment/42396420
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26924830
has text: That is because you are binding the AJAX call to the subscription button, but you create a new click event trigger whenever a validation attempt is made. Therefore, with increasing number of validations (triggered by form submission), you have more and more click handlers being bound to the button, causing duplication of the AJAX call.

http://stackoverflow.com/comment/42513979
type: QuestionComment
has text: Correct your code in your message please, some is missing
comment on: http://stackoverflow.com/q/26991305
score: 0
type: Comment

http://stackoverflow.com/q/26857407
answer count: 1
favorite count: 0
has body: I want to create an app in Node.js. This app modified a document, lets say : {_id: xxx, text: "Hello"} every time this document is changed, i want to execute a function in my node.js app. So it's something roughly like this $db.on('update', function(id){ console.log("There are changes in " + id) }) How can I do this with Node.js ?
has title: Couchdb's Update Event Handler in Node.js
tagged with: node.js
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/26865089
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/26865089
downvote count: 0
tagged with: javascript
tagged with: couchdb

http://stackoverflow.com/comment/50869179
comment on: http://stackoverflow.com/a/26900300
type: AnswerComment
type: Comment
has text: Parse.com upgraded its import system to support the insertion of new rows. Any duplicates will be skipped.
score: 0

http://stackoverflow.com/a/26845649
has comment: http://stackoverflow.com/comment/42254510
score: 14
has comment: http://stackoverflow.com/comment/42254513
upvote count: 14
has comment: http://stackoverflow.com/comment/42254333
has comment: http://stackoverflow.com/comment/132172594
answers question: http://stackoverflow.com/q/26845535
has comment: http://stackoverflow.com/comment/42254438
type: Answer
has comment: http://stackoverflow.com/comment/42254302
has body: Unfortunately, you cannot do that. You need to have a reference to the event handler function in order to remove it by removeEventListener. Your only option if you cannot get that reference would be by entirely replacing that Node.
has comment: http://stackoverflow.com/comment/42254487
downvote count: 0

http://stackoverflow.com/comment/42333728
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26887337
has text: After playing around with your code for a little bit, It appears that when the function is set through another function, it points to the function name itself without the Object name, is there any way to fix this? (Check my updated answer)
type: AnswerComment

http://stackoverflow.com/comment/42241219
type: AnswerComment
comment on: http://stackoverflow.com/a/26837676
has text: I have two images inside .sidebar one below another which fit full view height.so I want those img height will equally resize when window resize.I use img{max-height:50vh} for those img but is there any better way to do that?
type: Comment
score: 0

appendchild
tags question: http://stackoverflow.com/q/26966064
tag name: appendchild
type: Tag
tags question: http://stackoverflow.com/q/26963668

http://stackoverflow.com/comment/42514464
score: 0
type: Comment
comment on: http://stackoverflow.com/q/26990992
type: QuestionComment
has text: is the frame served by the same domain as your page?

http://stackoverflow.com/q/26940990
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/26941149
answer count: 3
has body: I'm working on an HTML page with a small navigation that starts out about halfway down the page. I want the navigation bar to stick to the top of the page (become fixed) when it reaches the top of the page. My attempt looked like this: The script: The HTML: Perks Growth Technology Apply The CSS: .scrollHeader { position: relative !important;} .fixedHeader {position: fixed !important; } Nevertheless, this code doesn't work. Any suggestions? I have jQuery 1.9.1 loaded. Fiddle
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26941120
tagged with: http://stackoverflow.com/tag/html
has title: Add and Remove Class On Scroll
tagged with: css
has comment: http://stackoverflow.com/comment/42425880
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/42426086
score: 0
has answer: http://stackoverflow.com/a/26941245
has comment: http://stackoverflow.com/comment/42426237
tagged with: javascript

http://stackoverflow.com/comment/42469499
comment on: http://stackoverflow.com/q/26966137
type: Comment
type: QuestionComment
has text: on your fiddle, you are using jQuery 1.6 --- you need to use jQuery 1.7 or above when using ".on", otherwise you will need to use ".delegate()", instead of ".on" - if you are using a lower version of jQuery. Once I selected a higher revision of jQuery - your code worked.
score: 4

http://stackoverflow.com/q/26991215
score: 1
has answer: http://stackoverflow.com/a/26991526
favorite count: 0
tagged with: angularjs
type: Question
accepted answer: http://stackoverflow.com/a/26991526
has title: ngAnimate is not working with Angular 1.2.16
has body: My problem is already stated, thus here's the plunker with the code: http://plnkr.co/edit/p8LGG7STxjd8gFr2OJhy?p=preview the html ROI &lt;div class="check-element animate-show" ng-show="checked"&gt; &lt;span class="glyphicon glyphicon-thumbs-up"&gt;&lt;/span&gt; I show up when your checkbox is checked. &lt;/div&gt; and the css one .animate-show { -webkit-transition:all linear 0.5s; transition:all linear 0.5s; line-height:20px; opacity:1; padding:10px; border:1px solid black; background:white; } .animate-show.ng-hide { line-height:0; opacity:0; padding:0 10px; } As you can see, I just took angularJs ngAnimate doc for ngShow and changed the plunker with angular and ngAnimate versions to match the one I am intested in. Anyone has a tip on this? Thanks in advance.
tagged with: ng-animate
upvote count: 1
answer count: 1
tagged with: javascript
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/q/26951675
upvote count: 3
has comment: http://stackoverflow.com/comment/42445461
has body: I am in the process of integrating post processing effects into my 3D engine. I have hit a roadblock with capturing depth data using a FrameBuffer Object with WebGL. There has been no issue capturing color data into the FrameBuffer. However, I am not able to get any Depth data even with the Depth Extension enabled for Chrome/Firefox. var DepthEXT = webGLContext.getExtension( "WEBKIT_WEBGL_depth_texture" ) || webGLContext.getExtension( "MOZ_WEBGL_depth_texture" ); I have tried many different settings to see if it was a configuration issue, but no matter what I try I just see a white texture. The screenshot at the end of the post shows the color attachment rendered as a texture and the depth attachment rendered as a texture. Is there a problem with my initialization of the FrameBuffer or should I be looking elsewhere to solve this issue? Below is my code for initializing the FrameBuffer Object: // Frame Buffer this.m_frameBuffer = gl.createFramebuffer(); gl.bindFramebuffer( gl.FRAMEBUFFER, this.m_frameBuffer ); // Render Buffer this.m_renderBuffer = gl.createRenderbuffer(); gl.bindRenderbuffer( gl.RENDERBUFFER, this.m_renderBuffer ); gl.renderbufferStorage( gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, sharedRenderer.canvasDOMElement.width, sharedRenderer.canvasDOMElement.height ); // Diffuse Component this.m_diffuseComponentTexture = gl.createTexture(); gl.bindTexture( gl.TEXTURE_2D, this.m_diffuseComponentTexture ); gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR ); gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR ); gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); gl.texImage2D( gl.TEXTURE_2D, 0, gl.RGBA, sharedRenderer.canvasDOMElement.width, sharedRenderer.canvasDOMElement.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null ); // Depth this.m_depthComponentTexture = gl.createTexture(); gl.bindTexture( gl.TEXTURE_2D, this.m_depthComponentTexture ); gl.te…
answer count: 1
has answer: http://stackoverflow.com/a/26952869
accepted answer: http://stackoverflow.com/a/26952869
favorite count: 0
has comment: http://stackoverflow.com/comment/42445285
has title: WebGL FrameBuffer - Render Depth Texture
tagged with: depth-buffer
type: AnsweredQuestion
score: 3
downvote count: 0
tagged with: webgl
tagged with: webgl-extensions
linked to: http://stackoverflow.com/q/16762159
type: Question
tagged with: framebuffer
tagged with: javascript
has comment: http://stackoverflow.com/comment/75716891

http://stackoverflow.com/comment/42389507
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26913364
has text: I can't see myself regularly changing the email address with which I registered with an application. I **add** mail addresses of course, but I hardly every **change** it.

http://stackoverflow.com/q/26835940
type: Question
has answer: http://stackoverflow.com/a/26836052
tagged with: javascript
has answer: http://stackoverflow.com/a/26835997
answer count: 2
favorite count: 0
has body: Basically a toggle. I have this button: Hover, don't click And this js: function changeColor () { document.getElementById('btn').style.color = 'red'; } Now: document.getElementById('btn').addEventListener('mouseover', changeColor); Worked as commanded, but: document.getElementById('btn').removeEventListener('mouseout', changeColor); Disobedient. JS Fiddle thought all are behaving correctly: http://jsfiddle.net/jimges/roq9x1os/ I disagree. Thanks!
type: UnansweredQuestion
has title: Basic Remove Event Listener Javascript
has comment: http://stackoverflow.com/comment/42239680
has comment: http://stackoverflow.com/comment/42237638
has comment: http://stackoverflow.com/comment/42239733
upvote count: 2
score: 1
tagged with: event-listener
downvote count: 1

http://stackoverflow.com/q/26991857
score: 0
has title: get multiple values from dc.js filters
has comment: http://stackoverflow.com/comment/42682138
tagged with: d3.js
type: UnansweredQuestion
has body: I have 5 charts related in one dashboard, and I used dc.js it's working find, what I want is: get dynamic overall data as a value by each click, like I have pie chart, I have bar chart, I have row chart and a J SON map, pie chart is total projects (executed, on process, canceled) bar-chart show the number of projects executed in month map show the city of the project what I want total executed , on process, canceled project in other place like in a div box each time the use click somewhere like bar-chart to show June project, or city that want to what projects done in DC. I want it to be updated in filters, how can I do that, and I also want to get count of project group by type like (how much project in web design category, web development, software development) ? please let know if you need more information. I already have the data statically using PHP, but I need it to be update with dc.js filters.
answer count: 0
has comment: http://stackoverflow.com/comment/42679540
tagged with: dc.js
type: Question
has comment: http://stackoverflow.com/comment/42558865
tagged with: javascript

http://stackoverflow.com/a/26891073
accepted answer of: http://stackoverflow.com/q/26888273
has comment: http://stackoverflow.com/comment/42336527
has body: Meteor determines what functionality should be added to a project using the packages file. It contains the names of packages such as email or iron:router. It is agnostic of the version of Meteor you are running, which will eventually lead to serious issues unless you have a mapping of which versions of the packages are good to go (i.e. known to work well together). The versions file further specifies which actual versions of the packages you are using in a project. You may specify a version using meteor add package:name@x.y.z. There is a third (hidden) versions information inside each package that defines what other packages it plays well with (see for example this). They define which minimum version they require, something better will probably also work. Here is where a smart versioning scheme comes into play. Meteor packages use semantic versioning, so you can better tell whether things will break with an upgrade. Semantic versioning means each release consists of major.minor.patch, e.g. x.y.z or 1.1.0. Patches don't change functionality, so any change to z will be harmless. Changes to the minor or y should not break the existing API. New functionality may be added or existing APIs may be changed/deprecated. Changes to major/x are likely to introduce breaking changes and also break dependent packages. You can find some more info on Arunoda's page: https://meteorhacks.com/meteor-packaging-system-understanding-versioning.html Technically you are right, why have redundant information in both files, packages seems superfluous when all required info is inside versions already. You will notice that packages only lists the packages you explicitely added to your project while versions includes all dependencies as well. Meteor is smart enough to know that if you remove a package to not bundle the unneeded package dependencies any more. You need both files to better differentiate what was added by the user and what was added automatically using the package manager.
type: Answer
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/26888273
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/42240207
type: Comment
type: QuestionComment
has text: @HeadCode, weird, whenever i console i always get the value of the chip i clicked on. So if i click on a 100 wager and then a 50, I get 100 and 50 logged to the console respectively. Instead it should be adding them. In that case i should return a value of 150.
comment on: http://stackoverflow.com/q/26837141
score: 0

http://stackoverflow.com/comment/42453513
type: QuestionComment
has text: Works fine for me: http://jsfiddle.net/t2d4adxr/ You need to be a bit more specific. What does "not work" mean? What happens when you click the link? Do you see errors in the browser's error console?
score: 0
comment on: http://stackoverflow.com/q/26957119
type: Comment

http://stackoverflow.com/a/26835342
type: Answer
score: 2
downvote count: 0
upvote count: 2
accepted answer of: http://stackoverflow.com/q/26834749
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26834749
has body: The key here is whatever has exported the data has done it wrong. Possibly someone has run something from the MongoDB shell and redirecting console output to a file. That is basically "doing it wrong". There is a concept called MongoDB Extended JSON and has in fact been picked up in a few other areas, notably the EJSON project.What this tries to do is make sure that any exported JSON maintains "type" information to the BSON type identifier ( or other Object Type, in the purpose of EJSON ) so that a similar "extended JSON" parser can "re-construct" the object to it's intended form. For a "date" object, the intented JSON representation is this: { "death": { "$date": "2007-03-17T04:00:00Z" } } Since com.mongodb.util.JSON.parse is enabled with knowledge of the Extended JSON spec, then any such JSON contruct will result in a correct date object being constructed from the parsed data. So what you have right now is just a "string". In fact, if it is not "quoted" like this: ´ { "death" : "Date('2007-03-17T04:00:00Z')" } Then it is not in fact even valid JSON and would even need to be manipulated to a correct form before even a basic JSON parser would not error. At any rate, the result is just a "string" still, so you would need to make a regex match for the numerical data, then pass that to a date object construct. Clearly the "best" thing to do here is to fix the "export" source of the data so that it is doing this date parsing to JSON in the correct extended way. Then the parser you are using will do the right thing.

http://stackoverflow.com/a/26954664
has body: getCurrentPosition takes a callback, and within that function you end up with a different internal scope (and may not execute immediately). So the only way you can do this is to either return a future or take in a callback, e.g.: function getCurrentLat(callback){ if(navigator.geolocation){ navigator.geolocation.getCurrentPosition(function(position) { callback(position.coords.latitude); }); }else{ console.log("Unable to access your geolocation"); } } otherwise, it's very clear why lat would be undefined, since getCurrentPosition will not even have a chance to execute and call the callback until after the function exits.
score: 0
has comment: http://stackoverflow.com/comment/109228167
has comment: http://stackoverflow.com/comment/42466064
type: Answer
answers question: http://stackoverflow.com/q/26953429
has comment: http://stackoverflow.com/comment/42467938

http://stackoverflow.com/q/26905209
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42362277
tagged with: forms
has body: My page is composed of a table in which each cell is a form. I want those forms to submit when I change the value of the input (onchange) but I don't want the whole page to refresh when I do it. For example, I want the user to be able to enter a value in one cell and then TAB to the next cell whithout losing focus when the first form (the first cell they filled) is submitted. I have read quite a few pages on the web about this, but none fit my needs since I have one more constraint. The forms my table is made of, are generated via Django so they all have the same id. So I can't use the id to select the form from inside the (java)script. I have been trying to use this.form or event.form or $(this).form but to no avail. Here is what those forms look like : &lt;form action="" method="POST" id="progress_form"&gt; {% csrf_token %} &lt;input type="number" id="percent_cell" name="percentdone" min="0" max="100" onchange="progressChange(event)" placeholder=&gt;%&amp;nbsp; &lt;input type="hidden" id="percent_cell2" name="task" value={{ task.id }}&gt; &lt;input type="hidden" id="percent_cell3" name="date" value=&gt; &lt;input type="hidden" id="percent_cell4" name="update_progress" value=True&gt; &lt;input type="hidden" id="percent_cell5" name="tab" value="track"&gt; &lt;/form&gt; And here is what my script looks like : function progressChange(e) { var form = e.form; var dataString = form.serialize(); alert(dataString); $.ajax({ type: "POST", url: $(form).attr( 'action' ), data: dataString, success: function() { alert("prout"); }, }); }
type: Question
has comment: http://stackoverflow.com/comment/42361740
tagged with: javascript
tagged with: jquery
score: 0
has title: Onchange submit of a form with ajax and without the form id
has comment: http://stackoverflow.com/comment/42362340
answer count: 1
tagged with: ajax
has answer: http://stackoverflow.com/a/26905652
has comment: http://stackoverflow.com/comment/42361724
tagged with: django
has comment: http://stackoverflow.com/comment/42361864
accepted answer: http://stackoverflow.com/a/26905652

angularjs-ng-repeat
tags question: http://stackoverflow.com/q/26925995
tags question: http://stackoverflow.com/q/26957664
tags question: http://stackoverflow.com/q/26880454
tags question: http://stackoverflow.com/q/26946207
tags question: http://stackoverflow.com/q/26984735
tags question: http://stackoverflow.com/q/26877936
tags question: http://stackoverflow.com/q/26839773
tags question: http://stackoverflow.com/q/26853850
tags question: http://stackoverflow.com/q/26881956
tags question: http://stackoverflow.com/q/26878052
tags question: http://stackoverflow.com/q/26965043
tags question: http://stackoverflow.com/q/26901910
tags question: http://stackoverflow.com/q/26955516
tags question: http://stackoverflow.com/q/26921090
type: Tag
tags question: http://stackoverflow.com/q/26846958
tags question: http://stackoverflow.com/q/26928133
tags question: http://stackoverflow.com/q/26832929
tags question: http://stackoverflow.com/q/26879281
tags question: http://stackoverflow.com/q/26973279
tags question: http://stackoverflow.com/q/26907428
tags question: http://stackoverflow.com/q/26863691
tag name: angularjs-ng-repeat
tags question: http://stackoverflow.com/q/26985797
tags question: http://stackoverflow.com/q/26918243
tags question: http://stackoverflow.com/q/26921824
tags question: http://stackoverflow.com/q/26979749
tags question: http://stackoverflow.com/q/26942674
tags question: http://stackoverflow.com/q/26856929

http://stackoverflow.com/comment/42464079
type: Comment
has text: Now I see. Including something like... `var head = data.getColumnLabel(0); var headerDiv = document.getElementById('header_div'); headerDiv.textContent = head;` ...in the selectHandler() function means the div will only appear when the table fires the "select" event: http://jsfiddle.net/gregpearl/u2ydom1q/7/ Instead, I'll add a ready event (and rearrange my spreadsheet column labels) to get the desired results: http://jsfiddle.net/gregpearl/u2ydom1q/8/ Thank you again for all your help, sir!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26941823

http://stackoverflow.com/comment/65696517
type: AnswerComment
comment on: http://stackoverflow.com/a/39128002
type: Comment
score: 0
has text: @jab if you make iframe invisible browser may not make any request hence no authentication dialog. better make it 1x1 px or use absolute position for it and use very large top & left to make it disapear from document view port. one way to push data to success function from iframe is by making the success function globally accessible and call it from iframe like **window.top.success(data)**

http://stackoverflow.com/q/26868169
upvote count: 1
has comment: http://stackoverflow.com/comment/42295755
tagged with: javascript
has comment: http://stackoverflow.com/comment/42295521
favorite count: 0
has body: I have this JavaScript block code: var trows = table.getElementsByTagName('tbody')[0].rows; for(var j = ((pageNumber - 1) * rowsPerPage); j &lt; ((pageNumber) * rowsPerPage); j++) { trows[j].style.display = 'table-row'; } Before I implement this row: trows[j].style.display = 'table-row'; I need to check if table row with scpecific index exists. How to check in JavaScript if table row with specific index exist?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26868231
downvote count: 0
type: Question
has answer: http://stackoverflow.com/a/26868305
score: 1
has title: How to check in JavaScript if table row with specific index exist?
has comment: http://stackoverflow.com/comment/42295470
answer count: 2

http://stackoverflow.com/comment/42263271
type: Comment
score: 0
comment on: http://stackoverflow.com/a/26849616
type: AnswerComment
has text: so for the this.name there isn't a chain?

http://stackoverflow.com/comment/42471159
type: Comment
has text: In that case I would suggest that you use an autocomplete plugin which will fire an ajax query to retrieve matched records from the server. You will have a to write a webservice which will respond to the AJAX call. The service may return raw JSON or pre-formed list items as HTML.
comment on: http://stackoverflow.com/a/26966441
score: 0
type: AnswerComment

babylonjs
tags question: http://stackoverflow.com/q/26865545
tags question: http://stackoverflow.com/q/26907686
type: Tag
tag name: babylonjs

http://stackoverflow.com/q/26846266
score: 3
tagged with: javascript
has answer: http://stackoverflow.com/a/26846643
tagged with: scrollbar
has comment: http://stackoverflow.com/comment/42257790
has body: Sorry I have tried searching but I think my problem is pretty specific. So I have 2 divs, one with anchor tags, then main content div. In the main content div I have the following script to hide differen't divs within the content div to hide and show active anchor links. function showonlyone(thechosenone) { var newboxes = document.getElementsByTagName("div"); for(var x=0; x<newboxes.length; x++) { name = newboxes[x].getAttribute("class"); if (name == 'newboxes') { if (newboxes[x].id == thechosenone) { newboxes[x].style.display = 'block'; } else { newboxes[x].style.display = 'none'; } } } } Everything is working fine, but when I scroll down after clicking one anchor, and then I click another anchor, it's scrolled to where I was on the last anchor. I have tried adding the following to the anchor links with no luck: function scrollWin() { scrollTo(0,0); } Any thoughts or help would be appreciated Update: 1 Introduction 1.1 What version am I using? Newboxes div: CSS: #bigbox { position: fixed; margin-left:31.7%; margin-right:auto; overflow-y:scroll; overflow-x:hidden; width:53.25%; height: 89%; background-color:#fff; padding:2em; border-right:1px grey solid; border-left:1px grey solid; padding-bottom: 3em; }
answer count: 1
downvote count: 0
has title: Anchor link scrollbar starting in middle
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
upvote count: 3
type: Question
tagged with: anchor

http://stackoverflow.com/comment/42327505
type: QuestionComment
has text: Let me telepathically know what `countUp` does... a moment please.
score: 3
comment on: http://stackoverflow.com/q/26886507
type: Comment

knockout-components
type: Tag
tags question: http://stackoverflow.com/q/26884509
tag name: knockout-components

http://stackoverflow.com/q/26966663
type: Question
has body: I´m using the elevatezoom plugin for my website. (the gallery-lightbox) http://www.elevateweb.co.uk/image-zoom/examples#gallery-lightbox It works on every device except on my iphone. The zoom works fine, but as soon as i click on the picture, no fancybox opens. I think, ios somehow has a problem with this code. ("#zoom_03").bind("click", function(e) { var ez = $('#zoom_03').data('elevateZoom'); $.fancybox(ez.getGalleryList()); return false; }); is there a way to get it working? I read: Just add: cursor: pointer to your link a problem solved! and i read: try $(document).on("click touchstart", "#id", function(event) {... I tried all of that, but it don´t work. Please help me with this. :)
tagged with: ios
tagged with: javascript
has answer: http://stackoverflow.com/a/54009260
score: 0
answer count: 1
tagged with: jquery
has title: Elevatezoom click not working on ios. cursor:pointer?
has comment: http://stackoverflow.com/comment/46033828
type: UnansweredQuestion

http://stackoverflow.com/a/76614543
upvote count: 0
has body: You can use: window.addEventListener("offline", closeHandler) // works for me in 1 seconds after break LAN connection in code: const createChannel = () => { ws && closeChannelCommon() ws = new WebSocket( "wss://social-network.samuraijs.com/handlers/ChatHandler.ashx" ) ws?.addEventListener( 'open', openHandler ) ws?.addEventListener( 'message', messageHandler ) ws?.addEventListener( 'close', closeHandler ) window.addEventListener( 'offline', closeHandler ) } const closeHandler = () => {console.log("The network connection has been lost.");}
type: Answer
downvote count: 1
score: -1
has comment: http://stackoverflow.com/comment/135124828
answers question: http://stackoverflow.com/q/26971026

http://stackoverflow.com/q/26947208
has answer: http://stackoverflow.com/a/28612724
favorite count: 0
type: UnansweredQuestion
has body: I have one script file which will be injected to any website on the fly. I don't have access to that website code. What i want to do is when someone click on any Element of web page, the list of events associated with that element should be displayed. In DOM 3 spec, earlier it was mentioned to add EventListenerList. But unfortunately it was removed from specification. I have already checked Visual Event 2. But they are only able to steal events of custom libraries and DOM events with on attribute. In jQuery 1.8+ also we can easily access events of element using $._data(element,'events'); In chrome, we can access it using getEventListeners(element) If i had access to webpage then i can override prototype's addEventListener method like HTMLElement.prototype.realAddEventListener = HTMLElement.prototype.addEventListener; HTMLElement.prototype.addEventListener = function(a,b,c){ this.realAddEventListener(a,b,c); //do whatever want }; But this is not the case with me as i am not able to inject this code before event listener binding. Can any one help me for Vanilla JS?
score: 1
tagged with: dom
type: Question
tagged with: browser
has title: Is it possible to get Events associated with a DOM Element in JavaScript(not jQuery)
tagged with: javascript
tagged with: jquery
upvote count: 2
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 1

http://stackoverflow.com/a/26969456
has body: The easiest way is bind the validate function to input's event, such as: Furthermore, you can use $watch to watch the myprofile.postCode instead. But, form controls are specially treated in angular. That means angular has many built-in validation function/directives. And you can create your own validation directive. Here is a demo: app.directive('postCodeValidation', function () { function checkPostCodeError(postCode) { if(/*your check logic*/) { return true; } else { return false; } } return { require: 'ngModel', link: function (scope, elem, attrs, ctrl) { ctrl.$parsers.unshift(function (viewValue) { if (checkPostCodeError(viewValue)) { // it is valid ctrl.$setValidity('postCode', true); return viewValue; } else { // it is invalid, return undefined (no model update) ctrl.$setValidity('postCode', false); return undefined; } }); } }; }); // how to use in template This is not valid postCode!
upvote count: 1
answers question: http://stackoverflow.com/q/26968588
has comment: http://stackoverflow.com/comment/42476125
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42476277
has comment: http://stackoverflow.com/comment/42476470
type: Answer
has comment: http://stackoverflow.com/comment/42475300
accepted answer of: http://stackoverflow.com/q/26968588
score: 1

http://stackoverflow.com/a/26977518
has comment: http://stackoverflow.com/comment/42494064
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/42497655
has comment: http://stackoverflow.com/comment/42494269
answers question: http://stackoverflow.com/q/26977429
has comment: http://stackoverflow.com/comment/42497710
has comment: http://stackoverflow.com/comment/42498034
upvote count: 2
has comment: http://stackoverflow.com/comment/42497939
has body: Code Example for Local Question's already been answered here. Edited Bind your alert as such: var shown = document.getElementById("page").children; function callback () { alert('end of div'); } function isElementInViewport(el) { var eap, rect = el.getBoundingClientRect(), docEl = document.documentElement, vWidth = window.innerWidth || docEl.clientWidth, vHeight = window.innerHeight || docEl.clientHeight, efp = function (x, y) { return document.elementFromPoint(x, y) }, contains = "contains" in el ? "contains" : "compareDocumentPosition", has = contains == "contains" ? 1 : 0x14; // Return false if it's not in the viewport if (rect.right &lt; 0 || rect.bottom &lt; 0 || rect.left &gt; vWidth || rect.top &gt; vHeight) return false; // Return true if any of its four corners are visible return ( (eap = efp(rect.left, rect.top)) == el || el[contains](eap) == has || (eap = efp(rect.right, rect.top)) == el || el[contains](eap) == has || (eap = efp(rect.right, rect.bottom)) == el || el[contains](eap) == has || (eap = efp(rect.left, rect.bottom)) == el || el[contains](eap) == has ); } function fireIfElementVisible (el, callback) { return function () { if ( isElementInViewport(el) ) { callback(); } } } var handler = fireIfElementVisible (shown[shown.length - 1], callback); $(document).on('DOMContentLoaded load resize scroll', handler); Above function will return boolean on whether your element is currently viewable on screen.
type: Answer
has comment: http://stackoverflow.com/comment/42495634

http://stackoverflow.com/comment/42319997
has text: Thank you very much, Max! I understand and did it! You are cool!
type: Comment
comment on: http://stackoverflow.com/a/26864248
type: AnswerComment
score: 0

http://stackoverflow.com/q/26913615
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42486568
tagged with: css
has comment: http://stackoverflow.com/comment/42486663
has answer: http://stackoverflow.com/a/26933639
upvote count: 3
has comment: http://stackoverflow.com/comment/42376617
has title: Moving caret in the contents of a read-only div allowing for dynamic highlighting
has comment: http://stackoverflow.com/comment/42376521
type: AnsweredQuestion
score: 3
has body: I've been struggling with getting a field working properly. This field displays a lot of data, and the user wants to select and copy a large portion of it. The data is basically a big list and the user wants to select all entries below a certain point. The way that they achieve the selection is by highlighting a word or two in the first entry they want then pressing ctrl+shft+end to select everything to the bottom. This was working until a new feature on the page was added below the contents of the list. Now the hot key select also selects the contents of the rest of the page. The current implementation is simply : [content here] blah blah blah... I have tried a read-only input field: This works in Firefox to some extent however the contents contains HTML, and the input field show html literally, not rendered. In addition to that Chrome doesn't show a blinking caret and the hot keys do nothing, so the input field is sadly not viable for me in this situation. How can I make a selectable field that maintains focus for the cursor and shows a blinking caret but is not editable using javascript, CSS, HTML, or JQuery? Edit: jsfiddle example that should clarify a bit.
type: Question
linked to: http://stackoverflow.com/q/10478
accepted answer: http://stackoverflow.com/a/26933639
has comment: http://stackoverflow.com/comment/42377308
answer count: 2
has answer: http://stackoverflow.com/a/26914386
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/26914386

http://stackoverflow.com/a/26862127
has comment: http://stackoverflow.com/comment/42284379
downvote count: 0
has comment: http://stackoverflow.com/comment/42284737
has body: You have to stop the current animation queue for each element first (as non-animated CSS changes will not add to that queue): Also, as mentioned elsewhere show() is a better option to css visibility as hide sets display: none and not visibility. success : function(result) { alert("Success"); $('#sidebar-container').stop().show(); $('#overall-status').stop().show(); } Additionally you are possibily not stopping the form from submitting, so the page would reload and rehide the divs. Try stopping the default behavior of that button. $('#submit-date').click(function(e) { e.preventdefault()
accepted answer of: http://stackoverflow.com/q/26861990
answers question: http://stackoverflow.com/q/26861990
upvote count: 2
type: AcceptedAnswer
type: Answer
score: 2

function-parameter
type: Tag
tag name: function-parameter
tags question: http://stackoverflow.com/q/26894748
tags question: http://stackoverflow.com/q/26879922

http://stackoverflow.com/q/26849240
tagged with: iframe
has answer: http://stackoverflow.com/a/26849302
accepted answer: http://stackoverflow.com/a/26849302
has answer: http://stackoverflow.com/a/26849318
type: Question
tagged with: javascript
has body: I have following iframe in a parent page: .... ... Is there any way that make Javascript from child.html to get the name value or the id of the iframe that included it? I need this because I want to add some markup around the iframe that is going to include child.html in the parent page using window.parent
possible better answer: http://stackoverflow.com/a/26849318
upvote count: 2
answer count: 3
downvote count: 0
has title: Get the iframe name from the source document
has answer: http://stackoverflow.com/a/26849454
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion

http://stackoverflow.com/comment/42493086
comment on: http://stackoverflow.com/a/26978456
has text: @royhowie kind of has a point. dfsq's solution when he started wasn't quite as good as mine, he didn't map the results to numbers. But after his edit it's just as generic of a solution, just seems more compact.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/42517131
comment on: http://stackoverflow.com/a/26990499
score: 0
type: AnswerComment
has text: The operation with the original code is that it won't match if there is a hash character inside it, and I think that's what refered to as "doesn't work" for the second point, so the desired behaviour would be that it did match.
type: Comment

http://stackoverflow.com/q/26885681
tagged with: validation
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42326136
has comment: http://stackoverflow.com/comment/42326252
has title: jQuery Form Validation - Can't Submit After preventDefault
has comment: http://stackoverflow.com/comment/42326133
possible better answer: http://stackoverflow.com/a/26885868
has answer: http://stackoverflow.com/a/26885868
accepted answer: http://stackoverflow.com/a/26885756
type: AnsweredQuestion
has body: I'm just starting to learn jQuery and attempting to create my own form validation as a method of learning. What I'm trying to achieve is so that when the form is submitted it will check if any of the fields with the class .required are empty and if so highlight the field. This works fine, however when the form is properly filled out it won't submit. I really can't see where I'm going wrong. If anyone can help it would be much appreciated. $('#contact').submit(function(event) { event.preventDefault(); var isFormValid = true; $('.required').each(function() { if ($(this).val() == '') { $(this).removeClass("valid").addClass('invalid'); isFormValid = false; } }); if(isFormValid = true) { $('#contact').submit(); } });
type: Question
tagged with: forms
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/26885775
has answer: http://stackoverflow.com/a/26885756

youtube-javascript-api
type: Tag
tags question: http://stackoverflow.com/q/26844274
tag name: youtube-javascript-api
tags question: http://stackoverflow.com/q/26951011
tags question: http://stackoverflow.com/q/26984718

http://stackoverflow.com/q/26897312
has answer: http://stackoverflow.com/a/26897398
type: Question
tagged with: asp.net-mvc-5.2
has title: jQuery Ajax Success nor Fail methods hit
upvote count: 1
answer count: 1
accepted answer: http://stackoverflow.com/a/26897398
has comment: http://stackoverflow.com/comment/42347816
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/42348118
tagged with: javascript
type: AnsweredQuestion
has body: I've got the following code below which is supposed to make a call to the controller when a link is clicked. The controller is getting called successfully, but the only method on the javascript side that is hit is always which displays a pop up stating "undefined". Adding Method to Link $('.retrieveTeam').click(function () { _getData($(this).data("teamkey")); }); jQuery AJAX Call function _getData(postdata) { var request = $.ajax({ url: 'RetrieveTeam', type: 'POST', data: JSON.stringify({ TeamKey: "331.l.542488.t.1" }), datatype: JSON, contentType: "application/json" }); request.success = function (result) { alert(result); } request.error = function (result, xh) { alert("error"); } request.fail = function () { alert("failure"); } request.always = function (result) { alert(result); } } Controller [HttpPost] public JsonResult RetrieveTeam(string TeamKey) { List&lt;Team&gt; objTeams = (List&lt;Team&gt;)Session["Teams"]; Team objTeam = objTeams.Where(x =&gt; x.TeamKey == TeamKey).FirstOrDefault(); objTeam.AddPlayer(new FootballPlayer(new Position("QB", "QB", "QB"), "Brett Favre", "QB")); return Json(objTeam); }
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/42347728

http://stackoverflow.com/a/26965012
has comment: http://stackoverflow.com/comment/42538230
score: 0
has comment: http://stackoverflow.com/comment/42494982
accepted answer of: http://stackoverflow.com/q/26964714
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26964714
type: Answer
has comment: http://stackoverflow.com/comment/43295157
has body: Found it! ko.unwrap(activateProduct).name() Problem is that ko.unwrap(activateProduct) == null until it is activated by the click. Thus setting it simply to that will result in a binding error. Unable to process binding "text: function (){return ko.unwrap(activateProduct).name() }" Message: ko.unwrap(...) is null; Thus you must first check for a null value for the activator before attempting to bind it's observables.
has comment: http://stackoverflow.com/comment/43303674
has comment: http://stackoverflow.com/comment/43646857

http://stackoverflow.com/q/26937244
tagged with: twitter-bootstrap
possible better answer: http://stackoverflow.com/a/59076175
accepted answer: http://stackoverflow.com/a/27321332
type: AnsweredQuestion
tagged with: ruby-on-rails
has body: I have a Rails app that displays a Googe Form in a Bootstrap modal. Here is a picture of the browser: I would like to add a default to the name input field. This is the coffeescript code - that doesn't work: $(document).ready -&gt; $("#gformshow2").click -&gt; alert "hi" document.getElementById("entry_252495961").value="david" return The "hi" alert displays just before the modal is opened.
has answer: http://stackoverflow.com/a/27321332
type: Question
tagged with: javascript
has title: Google Form embed default value for a field
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/59076175

http://stackoverflow.com/a/26837100
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/26834835
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26834835
has body: A node module can return a constructor that is both a constructor AND also has properties (since functions are objects that can have properties). Your first method allows you to access any other properties or methods that the constructor might have. The second method does not permit that since it doesn't retain a reference to the constructor. In the ExpressJS documentation, I do see some items that are referenced via the express object such as: var express = require('express'); var app = express(); var router = express.Router(); router.get('/', function (req, res, next) { next(); }); app.use(router); and var express = require('express'); var app = express(); app.use(express.static(__dirname + '/public')); If you don't need to retain a reference to the constructor in order to access these other methods on it, then there is no difference between your two options as they execute the same code. Your second one just doesn't retain a reference to an intermediate step that can be used later to access other things.

backbone.js
tags question: http://stackoverflow.com/q/26970737
tags question: http://stackoverflow.com/q/26978637
tags question: http://stackoverflow.com/q/26940445
tags question: http://stackoverflow.com/q/26876608
tags question: http://stackoverflow.com/q/26912115
tags question: http://stackoverflow.com/q/26855938
tags question: http://stackoverflow.com/q/26940327
tags question: http://stackoverflow.com/q/26958655
tags question: http://stackoverflow.com/q/26957639
tags question: http://stackoverflow.com/q/26982062
tags question: http://stackoverflow.com/q/26903562
tags question: http://stackoverflow.com/q/26969463
tags question: http://stackoverflow.com/q/26847518
tags question: http://stackoverflow.com/q/26865905
tags question: http://stackoverflow.com/q/26942490
tags question: http://stackoverflow.com/q/26862323
tags question: http://stackoverflow.com/q/26973646
tags question: http://stackoverflow.com/q/26845150
tags question: http://stackoverflow.com/q/26960126
tags question: http://stackoverflow.com/q/26967621
tags question: http://stackoverflow.com/q/26843428
tags question: http://stackoverflow.com/q/26981685
tags question: http://stackoverflow.com/q/26832602
tags question: http://stackoverflow.com/q/26872935
tags question: http://stackoverflow.com/q/26937444
tags question: http://stackoverflow.com/q/26861006
tags question: http://stackoverflow.com/q/26985200
tags question: http://stackoverflow.com/q/26948522
tags question: http://stackoverflow.com/q/26907283
tags question: http://stackoverflow.com/q/26851785
tags question: http://stackoverflow.com/q/26930917
tags question: http://stackoverflow.com/q/26944298
tags question: http://stackoverflow.com/q/26835682
tags question: http://stackoverflow.com/q/26869785
type: Tag
tags question: http://stackoverflow.com/q/26907648
tags question: http://stackoverflow.com/q/26895551
tags question: http://stackoverflow.com/q/26840317
tags question: http://stackoverflow.com/q/26913759
tags question: http://stackoverflow.com/q/26851342
tags question: http://stackoverflow.com/q/26877541
tags question: http://stackoverflow.com/q/26923588
tag name: backbone.js

http://stackoverflow.com/q/26858449
score: 2
type: AnsweredQuestion
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/26859016
has answer: http://stackoverflow.com/a/26859016
type: Question
upvote count: 2
has body: Demo Using jquery and highchart.js (+ exporting.js module) I am trying to export the chart by a custom button like below PDF While the code is exporting the chart in hard-coded format like this chart1.exportChart({type: "application/pdf"}); it is not working when trying to dynamically get the chart1 from the element data attribute data-chart="chart1" $(document).on("click", ".pdf-download", function(){ $(this).data('chart').exportChart({type: "application/pdf"}); }); can you please let me know how to fix this? Thanks
accepted answer: http://stackoverflow.com/a/26858945
has answer: http://stackoverflow.com/a/26859149
answer count: 3
has title: How to Cache DOM Variable in jQuery
tagged with: highcharts
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26858945

http://stackoverflow.com/comment/42433283
type: QuestionComment
comment on: http://stackoverflow.com/q/26945359
type: Comment
has text: @user1760979 how to use post function. Please explain in detail
score: 0

http://stackoverflow.com/comment/42426569
type: Comment
type: QuestionComment
has text: Ok, now I'll know. I painted a job this function like this: [screenshot of Sublime Text](http://savepic.su/4412659.png).
score: 0
comment on: http://stackoverflow.com/q/26940845

http://stackoverflow.com/a/26981828
has comment: http://stackoverflow.com/comment/42497724
has comment: http://stackoverflow.com/comment/42519856
type: Answer
accepted answer of: http://stackoverflow.com/q/26981501
has comment: http://stackoverflow.com/comment/42497696
has comment: http://stackoverflow.com/comment/42502910
answers question: http://stackoverflow.com/q/26981501
has comment: http://stackoverflow.com/comment/42497676
has comment: http://stackoverflow.com/comment/42510288
score: 1
downvote count: 1
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42498623
has comment: http://stackoverflow.com/comment/42497997
has body: An alternate way with a simple loop; hidden = "a,b,c,d,e,f,g"; arr = hidden.split(","); groups = [] for(var i = 0; i &lt; arr.length; i+=4) groups.push(arr.slice(i,i+4).join(',')) console.log(groups) &gt; [ 'a,b,c,d', 'e,f,g' ]

http://stackoverflow.com/comment/42370754
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26910535
has text: How come this got upvoted? It's clearly off-topic...
score: 2

http://stackoverflow.com/comment/42375855
comment on: http://stackoverflow.com/a/26912808
has text: This is ideal. I just need to make sure that a registered listener can be called back without issue when an event arrives that matches the supplied topic. I will probably go with #1
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/42346752
has text: @LoganMurphy You're right, my bad.
comment on: http://stackoverflow.com/q/26895466
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42442552
comment on: http://stackoverflow.com/q/26950399
type: QuestionComment
type: Comment
has text: @MohammadRahchamani I'll give it a go again and get back with you with some code.
score: 0

http://stackoverflow.com/comment/42450689
score: 0
type: QuestionComment
has text: So make a new function that creates the string and calls your other function.
type: Comment
comment on: http://stackoverflow.com/q/26955516

http://stackoverflow.com/comment/42470646
type: Comment
comment on: http://stackoverflow.com/q/26961857
has text: You are initializing the multiselect before options are added.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/42395613
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26924346
has text: you can't mix javaScript and php as you do... and do you even run your function, I don't think so, because it is anonymous
score: 0

http://stackoverflow.com/q/26847110
has body: I have search StackOverflow for a solution to this problem but have not found one that works. I am validating a form with Bootstrap Validator and it works well. I want to disable the submit button until the entire form is valid and Bootstrap Validator has an isValid() function. Using this function, the best I can do is on keyup, which is ugly. Whenever the form is evaluating its validity, there is a lag time and the submit button blinks from valid to not valid very quickly. Is there a way to fix this blinking with setTimeout or .delay() and still have the form function like it does now? Alternatively, is there a pure Bootstrap Validator solution for this? (This would be ideal) I have looked through the documentation, but could not find anything helpful. There are only ways to set the time of which the form is validated, which does not help my cause. Here is a JSFiddle that demonstrates the problem.
tagged with: javascript
tagged with: jquery
tagged with: validation
answer count: 1
tagged with: jqbootstrapvalidation
favorite count: 0
accepted answer: http://stackoverflow.com/a/26847347
tagged with: twitter-bootstrap
score: 6
type: AnsweredQuestion
has title: disabling bootstrap validator submit button until entire form is valid
upvote count: 7
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/26847347

http://stackoverflow.com/q/26856512
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/26860693
type: AnsweredQuestion
tagged with: angularjs
type: Question
score: 0
answer count: 2
has title: How do you disable an img in Angular?
has answer: http://stackoverflow.com/a/26860693
has body: I have an img that has an attribute directive that handles click events. I want to be able to disable and enable the handler. How do I do that? JS .directive('choose', function() { return { restrict: 'A', link: function(scope, el, attrs) { el.on('click', function() { scope.$apply(function() { // stuff // disable el }); }); } }; }) .controller('QuizCtrl', function ($scope, Quiz, $routeParams) { this.next = function() { // enable ALL els }; }); HTML Next
possible better answer: http://stackoverflow.com/a/26856949
has answer: http://stackoverflow.com/a/26856949

http://stackoverflow.com/comment/42438220
has text: Try removing the href.
score: 0
comment on: http://stackoverflow.com/q/26899714
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26910824
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/42371767
has body: I think your code could work if it didnt have so many syntax errors. It's document.getElementById, not document.getElementbyId. Beside that you should also end a variable declaration with ; It all depends on the final rendered page though. We dont know what the final php output is. I strongly advice you to use a external JavaScript file. Inline JS is bad.
answers question: http://stackoverflow.com/q/26910584

http://stackoverflow.com/q/26970571
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 0
upvote count: 2
type: UnansweredQuestion
has title: jQuery scrolling sidebar, stop and start
downvote count: 1
score: 1
type: Question
has body: so i have just made a JSFiddle: http://jsfiddle.net/06qwtgt6/1/ - it has a main container and a sidebar and the sidebar scrolls perfectly as I need. However I'm stuck with how to make it stop as the right bar hits the top and once the bottom of the container comes up at hits the bottom of the right bar needed it to then continue to scroll out of view with the main container if that makes sense. Thanks in adavnce UPDATE: I found this http://www.waypointarts.com/blog/2013/06/29/fixing-a-side-bar-while-scrolling-until-bottom - which is something i am after but of course for my scroll parallax-content part of the code. Really stuck with this so help would be greatly appriciated all! :) UPDATE: Attempted update, its not working but im trying - thanks everyone for any help. $(window).bind('scroll', function () { //var scrolledY = $(window).scrollTop(); var scroll = $(window).scrollTop(); //$('.parallax-content').css('bottom', '+' + ((scrolledY * 1.3)) + 'px'); if (scroll < $('#story-intro').offset().top) { $('.parallax-content').css('bottom', '+' + ((scroll * 1.3)) + 'px'); } else if (scroll > length) { $('.parallax-content').css({ 'top': '0' }); } }); HTML: Two reporters use Skype to put Kiribati in the spotlight There's a small island in the middle of the Pacific Ocean called Kirbati. It's home to about 100,000 people and in roughly 40 years the entire island will be under water due to rising sea levels from climate change. The people that live there will have no other option than to abandon their homes and their lives to find refuge in neighboring countries and traditions will be washed away forever. JS $(document).ready(function () { /********************************************************************************/ /* Parallax Scrolling */ // Cache the Window object var $window = $(window); $('[data-type]').each(function () { $(this).data('offsetY', parseInt($(this).attr('data-offsetY'))); $(this).data('Xposition', $(this).attr('data-Xposition')); $(this).data('speed'…
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/42251525
has text: Thank You! The link is exactly the answer what you are looking for and the code snippet had some syntax error which I suppose now solved.
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/26843879

http://stackoverflow.com/comment/42486762
type: Comment
comment on: http://stackoverflow.com/a/26973512
score: 0
type: AnswerComment
has text: i actually wasn't being sarcastic. it was a novel approach i hadn't considered, even if it isn't practical for file transferring between machines.

http://stackoverflow.com/q/26972941
tagged with: ajax
has comment: http://stackoverflow.com/comment/42481959
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has comment: http://stackoverflow.com/comment/42481725
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/42481879
has comment: http://stackoverflow.com/comment/42481752
has title: How to create a dynamic search page
has comment: http://stackoverflow.com/comment/42482395
has comment: http://stackoverflow.com/comment/42482029
score: 1
has comment: http://stackoverflow.com/comment/42482360
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/42481876
tagged with: jquery
has body: I am new to javacript. I used an API for implementing custom search feature. But in my search page results show only after I enter the first search key. If I enter another search key, the results for the second key don't show up until I refresh the page. How can I get the results to auto-update when entering more characters into the search box? HTML code: submit My JS Code: function searchAPI(){ var key= $("#search1").val(); var htmlContent=" "; $.getJSON('http://api.duckduckgo.com/?q=' + key + ' &format=json&pretty=1&callback=?', function(data) { var htmlContent = ' '; for (var i = 0; i < data.RelatedTopics.length; i++) { var desc = data.RelatedTopics[i].Text; var url = data.RelatedTopics[i].Icon.URL; var link = data.RelatedTopics[i].FirstURL; document.getElementById('link').href = link; var y = document.getElementById("link"); y.innerHTML = link; htmlContent += " " + " " + desc + " " + "go to website "; } htmlContent += " "; $('#div1').html(htmlContent); }); } Can anyone help me to solve this issue...Thanks in advance.

image-upload
tags question: http://stackoverflow.com/q/26891234
tag name: image-upload
type: Tag

http://stackoverflow.com/comment/42270632
type: QuestionComment
type: Comment
has text: `var sleepCheck = function(numHours); ` The error comes from this semicolon. You can't declare a function like that.
comment on: http://stackoverflow.com/q/26853999
score: 0

http://stackoverflow.com/a/26918638
has comment: http://stackoverflow.com/comment/42385603
has comment: http://stackoverflow.com/comment/42385724
has comment: http://stackoverflow.com/comment/42385686
type: AcceptedAnswer
downvote count: 0
has body: Use this $("button[id^='requestbtn']").click(function() { var lgid = String(this.id).replace("requestbtn", ""); alert("Request for slip " + lgid); var $this = $(this); Sthis.html("Done"); Sthis.addClass("btn-primary"); Sthis.removeClass("btn-success"); });
accepted answer of: http://stackoverflow.com/q/26918588
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/42385760
upvote count: 1
has comment: http://stackoverflow.com/comment/42385639
has comment: http://stackoverflow.com/comment/42385658
answers question: http://stackoverflow.com/q/26918588

http://stackoverflow.com/comment/42491268
comment on: http://stackoverflow.com/q/26918595
score: 0
type: Comment
type: QuestionComment
has text: I don't quite understand the question... What do you want to store in the session?

http://stackoverflow.com/q/26957697
tagged with: css
linked to: http://stackoverflow.com/q/7347532
answer count: 0
downvote count: 0
type: Question
has title: Set Browser Vertical Scrollbar Left or Right
score: 3
has comment: http://stackoverflow.com/comment/42454594
tagged with: javascript
has comment: http://stackoverflow.com/comment/42454602
tagged with: scrollbar
has body: Is there a CSS or JS solution to move browser's vertical scroll bar? It is said here, that since 2006, Firefox supports layout.scrollbar.side; ,which at least latest Firefox versions don't. IE pays attention to the direction of the : body:{ direction:rtl; } Is it possible to do the same for latest versions of Firefox,Chrome?
upvote count: 3
has comment: http://stackoverflow.com/comment/42455030
favorite count: 0
linked to: http://stackoverflow.com/q/1455708
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/26973211
type: Answer
has comment: http://stackoverflow.com/comment/42482250
has comment: http://stackoverflow.com/comment/42481940
has comment: http://stackoverflow.com/comment/42481917
has comment: http://stackoverflow.com/comment/42481811
has comment: http://stackoverflow.com/comment/42482403
answers question: http://stackoverflow.com/q/26973172
score: 0
has body: Declare $("#my_table").on("mouseenter", ".row", handle_zooming_in); after the rows are added with javascript. And maybe change that code to $('.row').on("mouseenter", handle_zooming_in); ?

http://stackoverflow.com/q/26984150
has comment: http://stackoverflow.com/comment/42502200
tagged with: javascript
has comment: http://stackoverflow.com/comment/42502343
score: 0
has comment: http://stackoverflow.com/comment/42502209
has comment: http://stackoverflow.com/comment/42502230
has body: Javascript function click() { var event = new MouseEvent('click', { 'view': window, 'bubbles': true, 'cancelable': true }); document.getElementById('a').dispatchEvent(event); document.getElementById('b').dispatchEvent(event); document.getElementById('c').dispatchEvent(event); } var recycle = setInterval(click, 500); HTML click click click My current function is having issues with the MouseEvent. I want this javascript to be able to cycle through clicking a, b, and c. This seems to only trigger a click for the first instance. What modifications do I need to make?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42502181
has comment: http://stackoverflow.com/comment/42502313
answer count: 0
has title: Click function raw javascript
type: Question

arrays
tags question: http://stackoverflow.com/q/26891277
tags question: http://stackoverflow.com/q/26915574
tags question: http://stackoverflow.com/q/26840305
tags question: http://stackoverflow.com/q/26892746
tags question: http://stackoverflow.com/q/26886098
tags question: http://stackoverflow.com/q/26898363
type: Tag
tags question: http://stackoverflow.com/q/26990351
tags question: http://stackoverflow.com/q/26932201
tags question: http://stackoverflow.com/q/26949425
tags question: http://stackoverflow.com/q/26964659
tags question: http://stackoverflow.com/q/26876906
tags question: http://stackoverflow.com/q/26980796
tags question: http://stackoverflow.com/q/26947972
tags question: http://stackoverflow.com/q/26871106
tags question: http://stackoverflow.com/q/26870715
tags question: http://stackoverflow.com/q/26858012
tags question: http://stackoverflow.com/q/26864895
tags question: http://stackoverflow.com/q/26918757
tags question: http://stackoverflow.com/q/26858197
tags question: http://stackoverflow.com/q/26860380
tags question: http://stackoverflow.com/q/26897802
tags question: http://stackoverflow.com/q/26856041
tags question: http://stackoverflow.com/q/26923655
tags question: http://stackoverflow.com/q/26869811
tags question: http://stackoverflow.com/q/26976954
tags question: http://stackoverflow.com/q/26956250
tags question: http://stackoverflow.com/q/26872274
tags question: http://stackoverflow.com/q/26902621
tags question: http://stackoverflow.com/q/26968345
tags question: http://stackoverflow.com/q/26840421
tags question: http://stackoverflow.com/q/26935675
tags question: http://stackoverflow.com/q/26933468
tags question: http://stackoverflow.com/q/26959814
tags question: http://stackoverflow.com/q/26896189
tags question: http://stackoverflow.com/q/26835173
tags question: http://stackoverflow.com/q/26912097
tags question: http://stackoverflow.com/q/26977801
tags question: http://stackoverflow.com/q/26929168
tags question: http://stackoverflow.com/q/26890359
tags question: http://stackoverflow.com/q/26850076
tags question: http://stackoverflow.com/q/26856822
tags question: http://stackoverflow.com/q/26858874
tags question: http://stackoverflow.com/q/26851534
tags question: http://stackoverflow.com/q/26963098
tags question: http://stackoverflow.com/q/26859533
tags question: http://stackoverflow.com/q/26862175
tags question: http://stackoverflow.com/q/26836808
tags question: http://stackoverflow.com/q/26880173
tags question: http://stackoverflow.com/q/26957091
tags question: http://stackoverflow.com/q/26980203
tags question: http://stackoverflow.com/q/26963668
tags question: http://stackoverflow.com/q/26924827
tags question: http://stackoverflow.com/q/26938880
tags question: http://stackoverflow.com/q/26957188
tags question: http://stackoverflow.com/q/26975713
tags question: http://stackoverflow.com/q/26891821
tags question: http://stackoverflow.com/q/26857871
tags question: http://stackoverflow.com/q/26913846
tags question: http://stackoverflow.com/q/26844316
tags question: http://stackoverflow.com/q/26876946
tags question: http://stackoverflow.com/q/26843876
tags question: http://stackoverflow.com/q/26871382
tags question: http://stackoverflow.com/q/26945484
tags question: http://stackoverflow.com/q/26943242
tags question: http://stackoverflow.com/q/26940118
tags question: http://stackoverflow.com/q/26858066
tags question: http://stackoverflow.com/q/26981766
tags question: http://stackoverflow.com/q/26856318
tags question: http://stackoverflow.com/q/26911398
tags question: http://stackoverflow.com/q/26956140
tags question: http://stackoverflow.com/q/26935447
tags question: http://stackoverflow.com/q/26882540
tags question: http://stackoverflow.com/q/26961778
tags question: http://stackoverflow.com/q/26857162
tags question: http://stackoverflow.com/q/26868343
tags question: http://stackoverflow.com/q/26950238
tags question: http://stackoverflow.com/q/26984391
tag name: arrays
tags question: http://stackoverflow.com/q/26946322

http://stackoverflow.com/q/26855002
has comment: http://stackoverflow.com/comment/42272615
score: 1
has comment: http://stackoverflow.com/comment/42274347
has comment: http://stackoverflow.com/comment/42272456
has answer: http://stackoverflow.com/a/26857063
has comment: http://stackoverflow.com/comment/42274151
type: Question
has comment: http://stackoverflow.com/comment/42274436
has comment: http://stackoverflow.com/comment/42272598
has title: like button on click ajax not working
has comment: http://stackoverflow.com/comment/42272433
answer count: 1
has comment: http://stackoverflow.com/comment/42274719
downvote count: 0
has comment: http://stackoverflow.com/comment/42274516
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42274998
has comment: http://stackoverflow.com/comment/42294740
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/42275733
has comment: http://stackoverflow.com/comment/42276112
has comment: http://stackoverflow.com/comment/42272349
has body: I want to make an ajax request on click with jquery, but it's not working: This is what I have: The button: $photos_box .= '&lt;a id="' . $imgID . '" class="like_button"&gt;' . $like . '&lt;/a&gt;'; Maybe there's an error in the script: // Like function $('.like_button').click(function() { $(this).toggleClass('liked'); var status = ''; if ($(this).hasClass('liked')) { status = 'like'; $(this).html('Ya no me gusta'); console.log('like_works'); } else { status = 'unlike'; $(this).html('Me gusta'); console.log('unlike_works'); } var data = { img_id : this.id, sta : status }; $.ajax({ type : 'POST', url : '/includes/like.php', data : data }).done(function(reslike) { if (reslike == 1) console.log('ajax_works'); }); }); And this is the like.php file: if ($_SERVER['REQUEST_METHOD'] == 'POST') { sec_session_start(); // User id if (login_check($mysqli) == true) { $user_id = $_SESSION['user_id']; } $img_id = $_POST['img_id']; $status = $_POST['sta']; $stmt = $mysqli-&gt;prepare("SELECT * FROM img_likes WHERE img_id = ? AND user_id = ?"); $stmt-&gt;bind_param("ii", $img_id, $user_id); $stmt-&gt;execute(); $result = $stmt-&gt;get_result(); $usr_likes = $result-&gt;num_rows; if ($status == 'like') { if ($usr_likes == 0) { $stmt-&gt;close(); $stmt = $mysqli-&gt;prepare("INSERT INTO img_likes (img_id, user_id) VALUES(?, ?)"); $stmt-&gt;bind_param("ii", $img_id, $user_id); $stmt-&gt;execute(); } } else if ($status == 'unlike') { if ($usr_likes != 0) { $stmt-&gt;close(); $stmt = $mysqli-&gt;prepare("DELETE FROM img_likes WHERE img_id = ? AND user_id = ?"); $stmt-&gt;bind_param("ii", $img_id, $user_id); $stmt-&gt;execute(); } } } At last! Thanks to everyone. Hope my code help someone.
has comment: http://stackoverflow.com/comment/42272929
has comment: http://stackoverflow.com/comment/42276079
has comment: http://stackoverflow.com/comment/42275577
has comment: http://stackoverflow.com/comment/42272589
has comment: http://stackoverflow.com/comment/42275125
has comment: http://stackoverflow.com/comment/42274825
has comment: http://stackoverflow.com/comment/42274913
has comment: http://stackoverflow.com/comment/42275532
has comment: http://stackoverflow.com/comment/42272398
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42274205
has comment: http://stackoverflow.com/comment/42275067
upvote count: 1
has comment: http://stackoverflow.com/comment/42274255
tagged with: php
has comment: http://stackoverflow.com/comment/42275022
has comment: http://stackoverflow.com/comment/42272361

http://stackoverflow.com/q/26910100
answer count: 1
has title: How bad is to have a lot of $(function(){}); in code?
favorite count: 0
has comment: http://stackoverflow.com/comment/42369815
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/26910193
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/26910193
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: Thanks to an engine we have a template that puts a lot of that functions in code(for blocks with empty functionality): $(function(){ // Code here }); Does it influence memory/speed?

http://stackoverflow.com/a/26847339
downvote count: 0
has comment: http://stackoverflow.com/comment/42265116
has comment: http://stackoverflow.com/comment/42262019
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/42262750
accepted answer of: http://stackoverflow.com/q/26846306
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26846306
has body: You have various problems, most of them can be simply fixed with checking your browser's JavaScript console and reading the exceptions... So here is the list what you need to fix: You have miss-typed Textbatches in the declaration so the correct is self.Textbatches = ko.observableArray(); You have scoping problem in filteredRows with the this. So if you are using self you should stick to it and use that: this.flags() should be self.flags() this.Textbatches() should be self.Textbatches() Your genre property has to be an array if you want to use it in ko.utils.arrayFirst Finally your Textbatch takes individual parameters but you are calling it with an object, so you need to change it to look like: Textbatch = function(data) { var self = this; self.id = ko.observable(data.id); self.name = ko.observable(data.name); self.statuses = ko.observableArray(data.status); self.genre = ko.observableArray(data.genre); self.createdBy = ko.observable(data.createdBy); }; or you can of course change the calling places to use individual arguments instead of an object. Here is a working JSFiddle containing all the above mentioned fixes.
has comment: http://stackoverflow.com/comment/42260132

http://stackoverflow.com/a/26897691
answers question: http://stackoverflow.com/q/26897141
type: Answer
has body: This is a common problem in Twitter Bootstrap. The "computed" CSS height of the input field is different than that of the actual button. Open your "developer tools" on your browser, and inspect the element styles, then find where it is overwritten | OR - fix the bootstrap CSS of the drop-down button, append: !important so it cannot be overridden.
score: 0

http://stackoverflow.com/q/26969283
has comment: http://stackoverflow.com/comment/42475429
linked to: http://stackoverflow.com/q/7486085
has comment: http://stackoverflow.com/comment/42474957
type: Question
has comment: http://stackoverflow.com/comment/42474843
has body: EDIT: the problem I came across was that I did not know that js arrays are treated as objects and any as so are referenced not copied. If you were interested in simply reversing a js array you can use...reverse(); I thought I would be able to simply do the following in javascript var originalArray = [1,2,3,5,8,13]; var originalArrayCOPY = originalArray; console.log ("new copy = "+originalArrayCOPY); for(var zyx = 0; zyx &lt;6; zyx++){ var xyz = 5-zyx; originalArray[zyx] = originalArrayCOPY[xyz]; } console.log("original now "+originalArray); console.log("copy ="+originalArrayCOPY); But my results are so strange that I feel I must not understand javascript at all!! new copy = 1,2,3,5,8,13 original now 13,8,5,5,8,13, copy =13,8,5,5,8,13, I can-t see why this wouldn-t work and I honestly am not sure why the COPY of the original array is changed at all. If I could at least name the problem I could ask google, also if you tell me the name of the problem I will rename by SO question.
has comment: http://stackoverflow.com/comment/42475041
has answer: http://stackoverflow.com/a/26969687
answer count: 1
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/42475005
score: 0
tagged with: reference
has comment: http://stackoverflow.com/comment/42474908
accepted answer: http://stackoverflow.com/a/26969687
linked to: http://stackoverflow.com/q/5276953
has comment: http://stackoverflow.com/comment/42474950
has title: Copying an array produces strange results ('copying'==referencing)
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42474830

http://stackoverflow.com/comment/42267477
score: 0
has text: I guess both! This is one of those cases where I don't know where to start. I wrote a php script that generates inputs for a Fortran program that was written by someone else. The fortran program can then be compiled to an .exe file which I'm assuming can only run on a windows server. I'm basically looking for a solution to run this .exe file once the input file is generated but I'm not sure where to start. Sorry if this is the wrong place to post this. I'm guessing it's hard to find web hosts that will allow you to run exe files for security reasons...
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26847948

http://stackoverflow.com/comment/42472135
type: QuestionComment
comment on: http://stackoverflow.com/q/26967508
has text: if i am not injecting `lodash` in `app` module then i wont be able to access those user defined lodash methods
score: 0
type: Comment

http://stackoverflow.com/q/26948400
has answer: http://stackoverflow.com/a/61633902
has comment: http://stackoverflow.com/comment/77815146
answer count: 12
downvote count: 0
has answer: http://stackoverflow.com/a/55601197
has answer: http://stackoverflow.com/a/26961710
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/72768918
has body: I want to save my time and reuse common code across classes that extend PIXI classes (a 2d webGl renderer library). Object Interfaces: module Game.Core { export interface IObject {} export interface IManagedObject extends IObject{ getKeyInManager(key: string): string; setKeyInManager(key: string): IObject; } } My issue is that the code inside getKeyInManager and setKeyInManager will not change and I want to reuse it, not to duplicate it, here is the implementation: export class ObjectThatShouldAlsoBeExtended{ private _keyInManager: string; public getKeyInManager(key: string): string{ return this._keyInManager; } public setKeyInManager(key: string): DisplayObject{ this._keyInManager = key; return this; } } What I want to do is to automatically add, through a Manager.add(), the key used in the manager to reference the object inside the object itself in its property _keyInManager. So, let's take an example with a Texture. Here goes the TextureManager module Game.Managers { export class TextureManager extends Game.Managers.Manager { public createFromLocalImage(name: string, relativePath: string): Game.Core.Texture{ return this.add(name, Game.Core.Texture.fromImage(&quot;/&quot; + relativePath)).get(name); } } } When I do this.add(), I want the Game.Managers.Manager add() method to call a method which would exist on the object returned by Game.Core.Texture.fromImage(&quot;/&quot; + relativePath). This object, in this case would be a Texture: module Game.Core { // I must extend PIXI.Texture, but I need to inject the methods in IManagedObject. export class Texture extends PIXI.Texture { } } I know that IManagedObject is an interface and cannot contain implementation, but I don't know what to write to inject the class ObjectThatShouldAlsoBeExtended inside my Texture class. Knowing that the same process would be required for Sprite, TilingSprite, Layer and more. I need experienced TypeScript feedback/advice here, it must be possible to do it, but not by multiple extends sinc…
type: Question
has answer: http://stackoverflow.com/a/63068905
has answer: http://stackoverflow.com/a/74281475
has answer: http://stackoverflow.com/a/68177695
favorite count: 0
upvote count: 157
has answer: http://stackoverflow.com/a/26952456
tagged with: extends
has answer: http://stackoverflow.com/a/45493827
linked to: http://stackoverflow.com/q/53699482
has answer: http://stackoverflow.com/a/72125116
tagged with: typescript
tagged with: oop
has title: Typescript: How to extend two classes?
has answer: http://stackoverflow.com/a/54084281
linked to: http://stackoverflow.com/q/49002
has comment: http://stackoverflow.com/comment/72755670
score: 157
has answer: http://stackoverflow.com/a/62000379
has answer: http://stackoverflow.com/a/77934396

http://stackoverflow.com/comment/42759636
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/26979867
has text: This question should be closed as primarily opinion based. What the OP wants to do makes no sense, and there seem to be multiple opinions on how to solve the problem.

http://stackoverflow.com/a/26893864
accepted answer of: http://stackoverflow.com/q/26890810
type: AcceptedAnswer
has body: Alright so I rolled my own. Here it is. $scope.$watch('filter.filterText', function(newVal, oldVal) { $scope.filteredData = $scope.data.filter(function(data) { if (data.fullName.toLowerCase().indexOf($scope.filter.filterText) &gt; -1 || data.someField.toLowerCase().indexOf($scope.filter.filterText) &gt; -1 || data.someOtherField.toLowerCase().indexOf($scope.filter.filterText) &gt; -1) { return true; } else { return false; } }); }, true); $scope.filter.filterText is bound to an input box and is watched in a controller. Whenever a user modifies the text, the filteredData is updated. The ui-grid uses filteredData as its data source. Short and sweet, but I do miss the old functionality in 2.0.
downvote count: 0
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/26890810

http://stackoverflow.com/comment/42824088
comment on: http://stackoverflow.com/q/26990192
score: 0
type: Comment
has text: I'm sure that the problem doesn't come from the library of viz. And I made a little jsfiddle demo, I have a lot of code in background using d3js.
type: QuestionComment

http://stackoverflow.com/comment/42321185
comment on: http://stackoverflow.com/a/26870463
score: 0
type: AnswerComment
type: Comment
has text: Hi. I am running 1.3. If I copy your directive into my code it doesnt work! I cant understand what is missing?

http://stackoverflow.com/comment/42489068
comment on: http://stackoverflow.com/q/26977008
score: 0
type: Comment
type: QuestionComment
has text: The problem is the image is floating, and always will be a different height/width, up to 5MP.

http://stackoverflow.com/q/26852827
downvote count: 0
possible better answer: http://stackoverflow.com/a/26852879
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/42270781
has comment: http://stackoverflow.com/comment/42268479
has answer: http://stackoverflow.com/a/26853934
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26852879
tagged with: css
answer count: 4
has answer: http://stackoverflow.com/a/62755461
type: AnsweredQuestion
has title: How to customize the step of a number input field?
accepted answer: http://stackoverflow.com/a/26855547
type: Question
tagged with: input-field
tagged with: javascript
has answer: http://stackoverflow.com/a/26855547
score: 4
has comment: http://stackoverflow.com/comment/42270890
upvote count: 4
has body: I have an input field of type number which ranges from 1 to 4096 as follows: Iam currently using a step = 2, that result in numbers 2, 4, 6, 8, 10, ... How can I modify the step to double the value 1 , 2, 4, 8, 16,...? Note: The field can contain only these values (The user shoudn't be able to insert 3 , 5 , 6, 7, ...). And it should work on both increment and decrement.
has comment: http://stackoverflow.com/comment/42269924
has comment: http://stackoverflow.com/comment/42268604

http://stackoverflow.com/comment/82834154
score: 0
type: AnswerComment
has text: Would this also work without using ng-click directive, but specifying ? In this case the button look visually disabled, but triggers "submit" events on my controller.
comment on: http://stackoverflow.com/a/26917009
type: Comment

http://stackoverflow.com/q/26981620
tagged with: css
has comment: http://stackoverflow.com/comment/42498212
has comment: http://stackoverflow.com/comment/42497954
has answer: http://stackoverflow.com/a/26981735
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42497678
has answer: http://stackoverflow.com/a/26981757
has comment: http://stackoverflow.com/comment/42498014
type: Question
has answer: http://stackoverflow.com/a/26982887
tagged with: javascript
has comment: http://stackoverflow.com/comment/42498368
tagged with: jquery
has body: I have some JavaScript on a site I am building that I just can't get to not default when another script is used. Interestingly not all of the javascripts on the page cause the issue. This is the script that I am using: $(document).ready(function() { $('.verdana').click(function(e) { $('#changeMe').css('font-family','verdana'); e.preventDefault(); }); $('.arial').click(function(e) { $('#changeMe').css('font-family','arial'); e.preventDefault(); }); $('.tahoma').click(function(e) { $('#changeMe').css('font-family','tahoma'); e.preventDefault(); }); $('.times').click(function(e) { $('#changeMe').css('font-family','times'); e.preventDefault(); }); $('.copperplatebold').click(function(e) { $('#changeMe').css('font-family','copperplatebold'); e.preventDefault(); }); $('swiss721').click(function(e) { $('#changeMe').css('font-family','swiss721'); e.preventDefault(); }); $('.baskerville').click(function(e) { $('#changeMe').css('font-family','baskerville'); e.preventDefault(); }); $('.oldenglish').click(function(e) { $('#changeMe').css('font-family','oldenglish'); e.preventDefault(); }); $('.timesnewroman').click(function(e) { $('#changeMe').css('font-family','timesnewroman'); e.preventDefault(); }); $('.castellar').click(function(e) { $('#changeMe').css('font-family','castellar'); e.preventDefault(); }); $('.calibri').click(function(e) { $('#changeMe').css('font-family','calibri'); e.preventDefault(); }); $('.scriptmtbold').click(function(e) { $('#changeMe').css('font-family','scriptmtbold'); e.preventDefault(); }); $('.lucidacal').click(function(e) { e.preventDefault(e); }); // select font in dropdown list to change font-family of #changeMe $('select').change(function() { if($(this).val() == "Default font"){ $('#changeMe').css('font-family',""); } else { $('#changeMe').css('font-family',$(this).val()); } }); e.preventDefault(e); }); Anyway I have tried putting "e.preventDefault(e);" in many places but no joy. And another possible clue is that it seems to be my javascripts t…
score: 0
answer count: 3
has title: Javascript keeps defaulting when other scripts are used
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/42339026
comment on: http://stackoverflow.com/q/26890359
type: QuestionComment
type: Comment
has text: var forest would *already* be an object (if you'd do: `forest.src=/*somehting*/`). Likewise: just like adding attributes/properties, you can also attach functions: `forest.burn=function(){/*burning forrest*/};` You *really* want to look into: http://stackoverflow.com/questions/572897/how-does-javascript-prototype-work (for *starters* you might see this as a way of providing *default* functions(=methods) (every tile's terrain is of a parent-type like forrest and can inherit from them, but can *also* have specific attributes/methods.
score: 0

http://stackoverflow.com/q/26948149
has title: Inspect Element and data security
has comment: http://stackoverflow.com/comment/42438980
answer count: 0
score: 1
type: Question
has comment: http://stackoverflow.com/comment/42454562
has comment: http://stackoverflow.com/comment/42438649
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42438588
tagged with: ajax
has comment: http://stackoverflow.com/comment/42455110
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42438615
has body: I am trying to create a message system, where the user logged in (UserA) will insert a username inside a search box and it will return a result(UserB, if any). If there is a result, UserA will be able to send a message to UserB. The way i did it, was: 1) stored the ID of userA and userB inside an HTML element (Ex. hidden field) 2) accessed these values using JavaScript and DOM 3) sent these values over to a PHP script (using AJAX), which is responsible to send the message to UserB The problem is that if i use "Inspect Element" on my page, i can see/alter the value of the sender(UserA) or/and receiver(UserB) ID. This way any one can send a message as another user, if he changes the value of the ID of userA. Is there another way to do this? Do i have to send the values using sessions to the PHP script directly? Thanks
favorite count: 0
has comment: http://stackoverflow.com/comment/42438149
type: UnansweredQuestion
upvote count: 1
tagged with: php

http://stackoverflow.com/comment/42327663
type: AnswerComment
comment on: http://stackoverflow.com/a/26886535
score: 0
type: Comment
has text: This is just snippet sample. You can take the idea for your code if it works. Try it in your console whether you are getting the expected result.

http://stackoverflow.com/comment/42234070
type: QuestionComment
has text: You can do anything with PHP. It runs on the server, and you can communicate with it via Ajax for eg. But if you're asking these types of questions really you need to start with reading a book or three, covering basic website building using PHP, jQuery, and probably MySQL (because you're talking about a dynamic site, even if it's a single seemingly trivial page).
score: 1
comment on: http://stackoverflow.com/q/26833075
type: Comment

http://stackoverflow.com/a/26911321
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/26911191
downvote count: 0
has body: If you mean re-add all the removed options, just save them somewhere not visible. e.g. a hidden select like: &lt;select id="hidden" style="display: none"&gt;&lt;/div&gt; change your code to append them to the hidden select when detached: if (reason == '10' || reason == '11') { $("#ddlOverride option").each(function () { if (!(parseInt($(this).val()) === 0 || parseInt($(this).val()) === 15077 || parseInt($(this).val()) === 20660)) { // Store it (e.g. in a hidden select) $('#hidden').append($(this).detach()); } }); } else { $("#ddlOverride option").each(function () { $("#ddlOverride").append($(this)); }); Note: you do not need to detach if you append it elsewhere (as it is moved in the DOM), so you can reduce it to: $('#hidden').append($(this)); To restore them simply append the stored child elements: $("#ddlOverride").append($('#hidden').children());

http://stackoverflow.com/comment/42584015
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26876441
has text: Nope its not there. it comes out as 20/0/2014.

http://stackoverflow.com/a/26965218
has comment: http://stackoverflow.com/comment/42467943
has comment: http://stackoverflow.com/comment/42467965
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/42468097
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/42467979
has comment: http://stackoverflow.com/comment/42468052
has comment: http://stackoverflow.com/comment/42467952
accepted answer of: http://stackoverflow.com/q/26965191
has comment: http://stackoverflow.com/comment/42467994
has body: It is not easy to tell exactly what you're trying to do, but if what you're trying to do is make it so that some other code that calls initApp() will cause nothing to happen when it calls that, then you can simply redefine the function to a do-nothing function like this: initApp = function() {} The most recent definition of a function takes precedence (e.g. replaces any prior definitions). If your newly loaded code contains an implementation of initApp() that you don't want called the second time the script is loaded, then you're out of luck. You can't stop that. You will need to change the structure of your code so that the dynamically loaded code doesn't execute stuff you don't want to be executed. There are many different ways you could do that. For example, you could have a global boolean that keeps track of whether the init code has been called yet. var initCalled = false; function initApp() { if (!initCalled) { initCalled = true; // rest of initialization code here } } initApp(); // will only actually do anything the first time it's called // even if it is loaded more than once It appears from the comments that you seem to think that reloading a script tag with different code will somehow make code from the previous script go away. It will not. Once a function is loaded, it stays loaded unless it is redefined to mean something else or unless some code explicitly removed a property from an object. It does not matter how the code was loaded or whether it was in the core page or an external script file.
answers question: http://stackoverflow.com/q/26965191
has comment: http://stackoverflow.com/comment/42468168
has comment: http://stackoverflow.com/comment/42468085

http://stackoverflow.com/q/26858485
has body: Trying to do some DOM manipulation, but link() is never called so nothing happens: app.js var app = angular.module('app', ['directives', ...]); var directives = angular.module('directives', []); ... directives.js directives.directive('doIt', ['$window', function($window) { return { restrict: 'A', link: function(scope, element, attrs) { console.log('Inside link()'); // Do stuff with $window } }; ]}); HTML &lt;html ng-app="app"&gt; &lt;body&gt; &lt;div ng-view&gt; &lt;div do-it&gt; // .... &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; What am I missing?
accepted answer: http://stackoverflow.com/a/26858656
type: Question
tagged with: angularjs-directive
tagged with: javascript
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/26858965
has answer: http://stackoverflow.com/a/26858656
has answer: http://stackoverflow.com/a/26858965
tagged with: angularjs
tagged with: dom-manipulation
type: AnsweredQuestion
has title: AngularJS directive DOM manipulation not executing link()

http://stackoverflow.com/comment/42307428
type: Comment
has text: So is there no way of kind of blanket resetting the html markup in the DOM with jqm? I'm presenting many figures in various and tags, with a new user do I have to effectively change them all back manually? Can I not recreate the same as a new app session somehow?
score: 0
comment on: http://stackoverflow.com/q/26871615
type: QuestionComment

webdriver-io
type: Tag
tag name: webdriver-io
tags question: http://stackoverflow.com/q/26909533

http://stackoverflow.com/comment/42267684
score: 0
type: AnswerComment
type: Comment
has text: I had updated the answer - please see up (http://stackoverflow.com/a/26848082/3365805) :)
comment on: http://stackoverflow.com/a/26850212

http://stackoverflow.com/comment/42443909
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26942019
type: Comment
has text: are either of the methods "safe" for passing passwords around? Thanks

http://stackoverflow.com/q/26864531
tagged with: css
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/26896724
upvote count: 3
has body: When using Chrome mobile on iOS and Android, we noticed that when "Reduce Data Usage" is turned on, the images on our modelling agency website get compressed by a significant amount. We would like to somehow disable this, since our portfolio has to consist of high quality photos. Is there any HTML meta tag, CSS rule or any JS hack to force disable this function?
tagged with: image
accepted answer: http://stackoverflow.com/a/26864650
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/26896724
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/26864650
has title: Disable image compression in Chrome mobile browser
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
tagged with: google-chrome

http://stackoverflow.com/a/26979338
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/42493794
downvote count: 0
has comment: http://stackoverflow.com/comment/42493079
score: 1
answers question: http://stackoverflow.com/q/26979176
has body: Both s and id is used in more than one place so adding them as variables makes the code shorter. There may not be a head-tag. There is always a script tag because you need to put that code in a script tag.

http://stackoverflow.com/a/26870143
type: Answer
answers question: http://stackoverflow.com/q/26870013
score: 2
downvote count: 0
has body: If you want to create android applications with html, js, css you should use: http://phonegap.com/ http://cordova.apache.org/
upvote count: 2

http://stackoverflow.com/q/26932748
tagged with: loops
has body: Here is the code I have. I am trying to add an onclick to each square so that when you click on that square you change it from a gray square to a square with its value. I have an 8 x 8 table. Also when I reveal a square I need to change its status so its no longer closed and shows its value. Also I need to randomly place 8 mines into the minefield without placing two mines in the same spot. I can not figure out the code for this. Please help! Thanks! var aiSquareValue = [[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]] var aiSquareStatus = [["c", "c", "c", "c", "c", "c", "c", "c"], ["o", "o", "o", "o", "o", "o", "o", "o"], ["f", "f", "f", "f", "f", "f", "f", "f", "f"]] var aiGridValue = 0 var bIsMatch = false function vBuild() { var strHTML var i, j //Start building the table strHTML = " " strHTML += " " strHTML += " Minesweeper " strHTML += " " strHTML += " " strHTML += " " strHTML += " " strHTML += " " strHTML += " " //Loop through the rows in the table for (i = 0; i < 6; i++) { strHTML += " " //loops through the columns for (j = 0; j < 6; j++) { strHTML += " " //add image tag strHTML += " " strHTML += " " } strHTML += " " } strHTML += " " strHTML += " " strHTML += " " strHTML += " " strHTML += " " strHTML += " " //insert function in to document frmGrid.innerHTML = strHTML } function vMines() { var i, j; var iRow = (Math.floor(Math.random()*8)) var iCol = (Math.floor(Math.random()*8)) while (i <= 7) { aiSquareValue[iRow][iCol] = 9 } } function vNewGame() { } function vClick() { }
type: Question
has comment: http://stackoverflow.com/comment/42411615
tagged with: javascript
has comment: http://stackoverflow.com/comment/42411264
score: 0
tagged with: arrays
has title: microsoft visual studio minesweeper code
tagged with: minesweeper
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42410466
has comment: http://stackoverflow.com/comment/42410833
has comment: http://stackoverflow.com/comment/42411487
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/26841221
tagged with: javascript
has body: so i have a variable which as this point has a static definition, i want it to get now the value dynamically from an if-else statement but the above mentioned error pops out: var x = [{a:b},{c:d},{e:f}] and i want to change it to get the value from a function: var x = function(){ if(true){ return [{a:b},{c:d},{e:f}] }else{ return [{f:g},{h:i}] } } But I get an error x.slice is not a function Can what am i doing wrong? Looked around but cant manage to fix this... isn't it possible?
possible better answer: http://stackoverflow.com/a/26841244
answer count: 2
has answer: http://stackoverflow.com/a/26841244
downvote count: 0
accepted answer: http://stackoverflow.com/a/26841265
favorite count: 0
has title: avoid .slice is not a function (javascript)
score: 2
type: AnsweredQuestion
upvote count: 2
has answer: http://stackoverflow.com/a/26841265
type: Question

http://stackoverflow.com/a/26837155
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26834675
has body: Your problem is here function fillData(targetDomElement, modalObject) { $('#modalSubmit').click(function(){ targetDomElement.text($('#simpleTextEdit').val()); closeModalWindow(); }); } Each time this function is called it adds a new click handler with the perameters at the time the handler was created. This handler is added in addition to the already created handlers. See a demo here. After successive clicks on the spans notices how fillData is called multiple times for a single click. To give you the best possible answer I need to know where your modalSubmit button is in relation to modalContent. Also is is modalSubmit dynamic or static on the page? Here is a fairly hacky fix in the mean time using on and off to bind and remove the handler respectively: function fillData(targetDomElement, modalObject) { $('#modalSubmit').off("click"); /*Clear Hanlders*/ $('#modalSubmit').on("click", function(){ console.log("fill data"); console.log(targetDomElement); targetDomElement.text($('#simpleTextEdit').val()); /*closeModalWindow(); Don't have anything for this so ignoring it*/ }); } Demo
answers question: http://stackoverflow.com/q/26834675
score: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42240147

http://stackoverflow.com/comment/42410331
type: Comment
has text: Yes you are right, I just copy/pasted it from a project i did once. The other answers(yours) are also correct.. use which you prefer. :)
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/26932269

http://stackoverflow.com/a/26990613
has body: At the point of object creation neither monster nor any of it's properties are defined. You can't use variable from the same object you're in the process of constructing. Also, Javascript uses function scoping, which means that the value of this will either be the window object or will be scoped to the closest instance you're creating using new (or other instance creation techniques).
accepted answer of: http://stackoverflow.com/q/26990534
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42512674
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/42512718
downvote count: 0
answers question: http://stackoverflow.com/q/26990534

http://stackoverflow.com/comment/42500217
has text: Well, `removeNode` simply doesn't exist. Why do you think it does?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26982757
score: 0

http://stackoverflow.com/q/26890030
type: AnsweredQuestion
upvote count: 0
has body: I want to add button on HTML page dynamically using java-script. Please let me know how to do it.
has comment: http://stackoverflow.com/comment/42334222
has comment: http://stackoverflow.com/comment/42334183
has title: How to add button using javascript in html page dynamically
has answer: http://stackoverflow.com/a/26890118
type: Question
score: -5
downvote count: 5
answer count: 1
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/26890118

http://stackoverflow.com/a/26895679
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26895208
has body: If A is the array of objects. function return_Max_Object(A) { var M = -Infinity; var Max_index = -1; for(var i =0;i&lt;A.length;i++) { if(A[i].value&gt;M) { M = A[i].value; Max_index = i; } } return A[Max_index]; }
accepted answer of: http://stackoverflow.com/q/26895208
type: Answer
upvote count: 1
downvote count: 1
score: 0

http://stackoverflow.com/comment/42369470
type: QuestionComment
has text: Are you asking for the `new Date()` class?
score: 0
comment on: http://stackoverflow.com/q/26909924
type: Comment

http://stackoverflow.com/a/27140445
answers question: http://stackoverflow.com/q/26838824
score: 2
downvote count: 0
has body: The part that triggers the re-rendering is actually waitOn. By using waitOn, you're telling Iron Router to redirect you to the loading template while you wait, which is what triggers the re-rendering and sticks you back up at the top of the page. This is waitOn's job, and it works great when going from page to page, but is obviously not ideal when re-rendering the same page. By the way, note that the new subscriptions option can also trigger the same behavior (if you've set a global loading template). So this is why we're using onBeforeAction in this specific case. This pattern is explained in more details in Discover Meteor, by the way.
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26838824
type: Answer

http://stackoverflow.com/a/26981838
has comment: http://stackoverflow.com/comment/42510428
score: 0
has body: You can get it in a reduce e.g. via lodash: return _.reduce(hidden.split(','), function(result, value, key) { if(key % 4 === 0) result.push(""); result[result.length - 1] += value; return result; }, []); I think this is about the simplest solution you'll find, given the necessity of the chunk-every-fourth step.
answers question: http://stackoverflow.com/q/26981501
has comment: http://stackoverflow.com/comment/42498129
type: Answer
has comment: http://stackoverflow.com/comment/42498041
downvote count: 1
has comment: http://stackoverflow.com/comment/42512067
has comment: http://stackoverflow.com/comment/42497979
upvote count: 1

http://stackoverflow.com/comment/42336228
comment on: http://stackoverflow.com/a/26890814
type: Comment
score: 2
has text: @DrewKennedy It's just syntactically incorrect for the same reasons why you'd use `span`s in a text section. That's what they're made for
type: AnswerComment

http://stackoverflow.com/q/26887991
tagged with: iframe
has answer: http://stackoverflow.com/a/26891104
type: Question
has comment: http://stackoverflow.com/comment/42330301
tagged with: javascript
has comment: http://stackoverflow.com/comment/42330513
score: 0
answer count: 2
has title: bugged HTML code editor
accepted answer: http://stackoverflow.com/a/26891104
has comment: http://stackoverflow.com/comment/42330391
has answer: http://stackoverflow.com/a/26888735
tagged with: css
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/26888735
has body: $(document).ready(function() { var btn = $('.gen'); btn.on('click', function() { var areaTxt = $('.textarea').val(); var div = $('.result'); div.html(areaTxt); }); }); .result { border: 1px solid red; width: 300px; height: 150px; } .textarea { width: 300px; height: 150px; } Untitled Document I've created a simple HTML code editor. The problem is that when I add style for all classes or divs affect also to my code editor. I want something like the editor of w3school. Just to show the result in iframe but all code in the textarea to affect only the result area. http://jsfiddle.net/sederther/4x6dxrs5/

http://stackoverflow.com/comment/42324897
type: QuestionComment
has text: @Zeratops soz I mean server's time.
score: 0
comment on: http://stackoverflow.com/q/26884797
type: Comment

http://stackoverflow.com/q/26913011
has answer: http://stackoverflow.com/a/26913193
has comment: http://stackoverflow.com/comment/47177543
has body: i play audio file using audio tag in html 5 duration of my file is 20 second. but when i open my page, the duration of audio tag is 14 second. so i refresh the page. then i can see the duration is change to 14 sec or 20 sec. i don't know why. and when the file is not loaded completely, i can't control the player. i click the play bar, but not control in other case, sometimes the file load completely, so i can control currentTime and play(). but often the file is not loaded completely, i can use just play the file only one time, not control it How to sure the file load completely always?
tagged with: javascript
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: how to check audio tag load file complete
type: Question
score: 0
answer count: 1
tagged with: audio

http://stackoverflow.com/comment/81376096
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26975832
has text: I encountered a similar scenario where a given model contained the attribute `activities`. An array consisting of only strings. Even worse, `activities` of different instances of the model aren't overlapping. It wouldn't make any sense to create an own model for these `activities`, so using associations is not an real option in this case. Is there another way of querying model instances by whether or an array contains a value?
score: 0

http://stackoverflow.com/comment/42339705
comment on: http://stackoverflow.com/a/26892801
type: AnswerComment
score: 0
type: Comment
has text: Alright so that will basically will return the actual user object. How do I update it in place?

http://stackoverflow.com/comment/42356704
comment on: http://stackoverflow.com/a/26902129
type: AnswerComment
has text: @ashfaq.p : check the fiddle!!
type: Comment
score: 0

http://stackoverflow.com/comment/42424647
comment on: http://stackoverflow.com/q/26940074
score: 0
type: QuestionComment
has text: check inside css file for any dependencies of image file or something
type: Comment

http://stackoverflow.com/a/26868270
type: Answer
has body: Based on the solution proposed by Benjamin. I wrote the following functions: function addProposal(){ //console.log("Execute AddProposal"); var name_en = $("#name_en").val(); var use_en = $("#use_en").val(); var desc_en = $("#desc_en").val(); return $.ajax({ type:'POST', url:'http://localhost/index.php?option=com_test&amp;task=addProposal&amp;format=raw', data:{ user_id: user_id, name_en: name_en, use_en: use_en, desc_en: desc_en, }, beforeSend:function(response){ $("#loading_modal").modal("show"); //console.log("AddProposal - BEFORESEND"); }, complete:function(response){ $("#loading_modal").modal("hide"); //console.log("AddProposal - COMPLETE"); }, }); } function cachedProposal(){ //console.log("Execute cachedProposal"); return p || (p = addProposal()); } And in the main function "$(document).ready(function()", I wrote this code $(document).ready(function() { p = null; //.... $('#file-upload').fileupload({ dataType: 'json', autoUpload: false, paramName: 'files[]', maxNumberOfFiles:1, add: function (e, data) { var uploadErrors = []; var acceptImgTypes = /^image\/(gif|jpe?g|png)$/i; var acceptDocTypes = /^application\/(pdf|msword|vnd.openxmlformats-officedocument.wordprocessingml.document)$|^text\/plain$/i; //console.log("ADD FILE: "+ data.files[0].name); if (data.fileInput[0].id=="file-img"){ if (data.originalFiles[0]['type'] &amp;&amp; !acceptImgTypes.test(data.originalFiles[0]['type'])) { uploadErrors.push('Not an accepted file type'); } if (data.originalFiles[0]['size'] &amp;&amp; data.originalFiles[0]['size'] &gt; 4000000) { uploadErrors.push('File size is too big'); } }else{ if (data.originalFiles[0]['type'] &amp;&amp; !acceptDocTypes.test(data.originalFiles[0]['type'])) { uploadErrors.push('Not an accepted file type'); } if (data.originalFiles[0]['size'] &amp;&amp; data.originalFiles[0]['size'] &gt; 10000000) { uploadErrors.push('File size is too big'); } } if (uploadErrors.length &gt; 0) { alert(uploadErrors.join("\n")); } else { if (data.fileInput[0].id=="fil…
score: 0
answers question: http://stackoverflow.com/q/26848611

http://stackoverflow.com/q/26963722
score: 0
has comment: http://stackoverflow.com/comment/42608647
tagged with: adobe-cc
has comment: http://stackoverflow.com/comment/42622641
answer count: 0
has comment: http://stackoverflow.com/comment/42694022
type: UnansweredQuestion
has title: Flash CC 2014 HTML publish JS error
has comment: http://stackoverflow.com/comment/42802174
has body: I'm using Flash CC 2014 to create some js/html based interactives. One thing I've come across, is sometimes the published files fail to run. It seems like the export fails to include random clips in the library, so you get errors when it attempts to instantiate them, eg... this.instance_1 = new lib.c_hand("synched",0); Uncaught TypeError: undefined is not a function Has anyone had any similar problems? Is there any way to debug what's going on inside the export script? After a quick look, I can find JSFL files relating to the export, by it appears that they're all obfuscated :\ At the moment I'm resorting to rebuild the library file by hand from GIT diffs. Pain.
type: Question
tagged with: export
tagged with: flash
has comment: http://stackoverflow.com/comment/42813781
tagged with: javascript
tagged with: createjs

http://stackoverflow.com/a/26971883
answers question: http://stackoverflow.com/q/26971845
downvote count: 0
has body: You need to call the function with return, so that the false value prevents default action (form submission)
has comment: http://stackoverflow.com/comment/42479463
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/26832854
has body: How do I "reset" the .replaceWith function so that the html, css and javascript are returned back to their original state? The idea is to have an icon replace the text when the user clicks on "contact", and when the user clicks on "back" button, the icon returns back to the "contact" text. Right now, the icon switches back to text, but the text isn't responsive when I try to repeat the function a second time. Here is the HTML: Contact Back And the Javascript: var contactswitch = $(' '); var switchback = $('.contact'); $('.contact').click(function() { $(this).replaceWith(contactswitch) }); $('.back').click(function() { $(contactswitch).replaceWith(switchback) }); Thanks!
tagged with: css
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/42232213
upvote count: 1
has comment: http://stackoverflow.com/comment/42232261
tagged with: replacewith
score: -1
has comment: http://stackoverflow.com/comment/42232236
type: Question
has answer: http://stackoverflow.com/a/26833167
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: How to "reset" the .replaceWith function in jQuery?
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/42344813
type: Comment
type: QuestionComment
has text: WebWorker could offer a way. Depends, if you regard them as native calls.
comment on: http://stackoverflow.com/q/26895730
score: 1

universal-analytics
tag name: universal-analytics
type: Tag
tags question: http://stackoverflow.com/q/26849042

http://stackoverflow.com/comment/42351134
comment on: http://stackoverflow.com/a/26897051
score: 0
type: Comment
has text: Ok, well, if I'm going to help you any further, I'll have to look at all of the code..
type: AnswerComment

http://stackoverflow.com/comment/42336375
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/26891234
has text: Soooo.. do you need pixel size or file size? Title says pixels but then you are talking about file size later on

http://stackoverflow.com/comment/42455064
has text: read [Event object docs](http://fullcalendar.io/docs/event_data/Event_Object/). you are supplying non standard date format to `start` and `end`
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/26958022
type: Comment

http://stackoverflow.com/comment/42320645
has text: Is your page accessible from the Internet?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26881551

ios
tags question: http://stackoverflow.com/q/26891530
tags question: http://stackoverflow.com/q/26920561
tags question: http://stackoverflow.com/q/26967477
tags question: http://stackoverflow.com/q/26903822
tags question: http://stackoverflow.com/q/26856497
type: Tag
tags question: http://stackoverflow.com/q/26975017
tags question: http://stackoverflow.com/q/26912442
tags question: http://stackoverflow.com/q/26989798
tags question: http://stackoverflow.com/q/26959373
tags question: http://stackoverflow.com/q/26988562
tags question: http://stackoverflow.com/q/26851012
tags question: http://stackoverflow.com/q/26891751
tags question: http://stackoverflow.com/q/26981201
tags question: http://stackoverflow.com/q/26903758
tag name: ios
tags question: http://stackoverflow.com/q/26898941
tags question: http://stackoverflow.com/q/26905160
tags question: http://stackoverflow.com/q/26842834
tags question: http://stackoverflow.com/q/26906479
tags question: http://stackoverflow.com/q/26834563
tags question: http://stackoverflow.com/q/26880913
tags question: http://stackoverflow.com/q/26990829
tags question: http://stackoverflow.com/q/26838238
tags question: http://stackoverflow.com/q/26834738
tags question: http://stackoverflow.com/q/26928580
tags question: http://stackoverflow.com/q/26917561
tags question: http://stackoverflow.com/q/26883916
tags question: http://stackoverflow.com/q/26876168
tags question: http://stackoverflow.com/q/26920132
tags question: http://stackoverflow.com/q/26907211
tags question: http://stackoverflow.com/q/26859422
tags question: http://stackoverflow.com/q/26943002
tags question: http://stackoverflow.com/q/26957080
tags question: http://stackoverflow.com/q/26973974
tags question: http://stackoverflow.com/q/26962464
tags question: http://stackoverflow.com/q/26966663

http://stackoverflow.com/a/26924069
type: Answer
upvote count: 4
has body: You could also simplify the code down using a hashmap and some ES5 higher-order functions: var text_array = ["a1","a1","a2","a3","a2","a4","a1","a5"]; var counts = {}; text_array.forEach(function(el) { counts[el] = counts.hasOwnProperty(el) ? counts[el]+1 : 1; }); var unique_array = Object.keys(counts); var counter_array=unique_array.map(function(key) { return counts[key]; })
downvote count: 0
score: 4
answers question: http://stackoverflow.com/q/26923655

http://stackoverflow.com/comment/42286666
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26861799
has text: Please see this fiddle: http://jsfiddle.net/9rmLb7x5/. You did not give enough context to answer the question properly. You should have mentioned that this is an event and you can't give up `this`. You could try asking another question and give a *real* example instead of example pseudo code.
score: 0

http://stackoverflow.com/comment/42361859
comment on: http://stackoverflow.com/a/26891104
type: Comment
has text: @DavidPankov I changed the style from 'background' to 'background-color' and 'height' to '450px'. the 'px' in 'height' was missing, also the '-color' in background was missing. with this changes it worked fine. ' '. could you please check this now
score: 0
type: AnswerComment

http://stackoverflow.com/a/26941663
has comment: http://stackoverflow.com/comment/42427157
upvote count: 4
has body: Your initialization statements like this: this.setMedium = setBoxDimensions(16,14,6); are calling the function "setBoxDimensions". If you want "setMedium" to be a call to "setBoxDimensions" with particular arguments, you need to make it be a function to do that: this.setMedium = function() { this.setBoxDimensions(16,14,6); }.bind(this); Whenever you mention a function and follow that by a parenthesized list of arguments, you're making a function call then and there. The .bind() function used above arranges for this to be correctly set in the anonymous wrapper function. An alternative that will work in really old browsers is: var that = this; this.setMedium = function() { that.setBoxDimensions(16, 14, 6); };
has comment: http://stackoverflow.com/comment/42427178
type: Answer
has comment: http://stackoverflow.com/comment/42427250
downvote count: 1
score: 3
answers question: http://stackoverflow.com/q/26941646

http://stackoverflow.com/a/27877509
type: Answer
has body: Here is buzz for meteor. I'm using it.
score: 0
answers question: http://stackoverflow.com/q/26951776

http://stackoverflow.com/q/26883838
tagged with: javascript
answer count: 1
downvote count: 0
tagged with: jquery
has body: My goal is to validated field(s) that has a class name or Id using the bootstrap validator Here is the example code : HTML: &lt;input id="myFirstId" class="myClass" type="text" name="myFirstName" /&gt; &lt;input id="mySecondId" class="myClass" type="text" name="myLastName" /&gt; JS: $('#myForm').bootstrapValidator({ fields : { myFirstName : { validators : { notEmpty : { message : 'required' } } }, myLastName : { validators : { notEmpty : { message : 'required' } } } } }); but i want a single block to validated those two element using bootstrap validator ex. $('#myForm').bootstrapValidator({ fields : { myClass : { // &lt;-- this is not working but i want to validate those // object with has 'myClass' class. validators : { notEmpty : { message : 'required' } } } } });
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: spring
has answer: http://stackoverflow.com/a/26884090
upvote count: 6
type: AnsweredQuestion
tagged with: twitter-bootstrap
score: 6
type: Question
has title: How to use ID or CLASS instead of using name in Bootstrap Validator
accepted answer: http://stackoverflow.com/a/26884090

http://stackoverflow.com/q/26988805
type: Question
has title: Using ajax promise with $.when().done
has comment: http://stackoverflow.com/comment/42509646
score: 1
has body: I need two return values from two different ajax calling. I have two javascript functions : this.getVal1= function(numberDep){ var promise = $.ajax({ url:url, //REST url type:"GET", dataType:"json", contentType: "application/json" }); return promise; }; this.getVal2= function(){ var promise = $.ajax({ url:url, //another REST url type:"GET", dataType:"json", contentType: "application/json" }); return promise; }; How I call these two functions : $.when(getVal1(17),getVal2()) .done(function(_topdep,_alldep){ console.log(_topdep); console.log(_alldep); }); Here are the result of each console.log : https://i.sstatic.net/IHBQx.png. What I supposed to return from first console.log is those 17 records, and the second console.log is 36 records (please have a look in the above image) . Any help would be much appreciated, thank you..
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26988879
has answer: http://stackoverflow.com/a/26988847
accepted answer: http://stackoverflow.com/a/26988847
has comment: http://stackoverflow.com/comment/42509801
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/42509824
has comment: http://stackoverflow.com/comment/42509751
has answer: http://stackoverflow.com/a/26988879
has comment: http://stackoverflow.com/comment/42509901
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42509949
upvote count: 1
has comment: http://stackoverflow.com/comment/42509798

http://stackoverflow.com/comment/42337792
comment on: http://stackoverflow.com/a/26870878
type: AnswerComment
score: 0
type: Comment
has text: Additionally, I should note that var results_xml has already been initialized as an empty array. So each time the function runs/loops its pushing data into that array, and then each index is tabbed through 1 by 1. Would your method of managing those responses by page still be required?

http://stackoverflow.com/comment/42360890
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26904712
type: Comment
has text: Thanks for your effort. I tried your code and it didn't work.

http://stackoverflow.com/q/26966398
answer count: 1
accepted answer: http://stackoverflow.com/a/26966466
has title: Expanding / Collapsing text area problems
has body: I am trying to create an expandable text area that collapses back to its original height only if the box is empty. If it is not empty, then I want the text area to stay expanded and to grow as needed (that is, to grow when the user inputs more text). The text area should never hide the text that is entered--that is, it should never collapse to a height that hides any of its contents. I put what I have so far in a fiddle at http://jsfiddle.net/np5y4esr/8/ It's almost right but not quite. If you enter enough text in the first textarea to make it expand beyond the 300px height, then click into the second textarea and then back into the first, the first will collapse on you. I'm not sure what I'm doing wrong. My rules are only those in the first paragraph above. If anyone can create a new fiddle to achieve this or modify mine to make it work, I would appreciate your help. Edit: Is it posible to set a maximum expansion height for the text area? That is, so that it expands as the user types but stops at a certain point (e.g. 400px) at which it just scrolls like the default text area behavior?
has comment: http://stackoverflow.com/comment/42470013
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/26966466
tagged with: javascript
tagged with: jquery
score: 0
tagged with: textarea

http://stackoverflow.com/q/26841064
answer count: 2
tagged with: validation
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/35817857
has body: The code which I wrote for validation of the credentials on my login page is: describe('Login',function() { var loginURL; var email=element(by.id("email")); var password=element(by.id("password")); var LoginButton=element(by.buttonText("Sign in")); }); it('should redirect to login page',function() { browser.get('https://pacific-meadow-5124-dev-test.herokuapp.com'); loginURL = browser.getCurrentUrl();`` expect(browser.getCurrentUrl()).toEqual(loginURL); }); it('should warn on wrong/missing values',function(){ email.clear(); password.clear(); password.sendkeys('test'); loginButton.click(); expect(error.getText()).toMatch('missing email'); email.sendkeys('test'); loginButton.click(); expect(error.gettext()).toMatch('invalid email'); email.sendkeys('pavanpesse11@gmail.com'); password.clear(); loginButton.click(); expect(error.getText()).toMatch('missing password'); }); it('should accept a valid email address and password', function() { email.clear(); password.clear(); email.sendKeys('pavanpesse11@gmail.com'); password.sendKeys('goalsr123'); loginButton.click(); expect(browser.getCurrentUrl()).not.toEqual(loginURL); }); I am not able to execute above code, getting an error saying that jasmine.suite() required as shown below: Message: Error: jasmine.Suite() required Stacktrace: Error: jasmine.Suite() required at new jasmine.Spec (C:\Users\GOALSR3\AppData\Roaming\npm\node_modules\protr actor\node_modules\minijasminenode\lib\jasmine-1.3.1.js:2326:11) at jasmine.Env.it (C:\Users\GOALSR3\AppData\Roaming\npm\node_modules\protrac tor\node_modules\minijasminenode\lib\jasmine-1.3.`enter code here`1.js:966:14) at jasmine.Env.(anonymous function) [as it] (C:\Users\GOALSR3\AppData\Roamin g\npm\node_modules\protractor\node_modules\minijasminenode\lib\async-callback.js :26:50) at global.it (C:\Users\GOALSR3\AppData\Roaming\npm\node_modules\protractor\n ode_modules\minijasminenode\lib\index.js:15:29) at C:\Users\GOALSR3\AppData\Roaming\npm\node_modules\protractor\node_modules \jasminew…
favorite count: 0
has answer: http://stackoverflow.com/a/30687663
type: UnansweredQuestion
type: Question
has title: How to avoid "jasmine.suite() required" error message in protractor?
tagged with: protractor
score: 10
upvote count: 10

http://stackoverflow.com/q/26909833
has comment: http://stackoverflow.com/comment/42369348
has comment: http://stackoverflow.com/comment/42369322
answer count: 0
has comment: http://stackoverflow.com/comment/42369752
has comment: http://stackoverflow.com/comment/42369391
has comment: http://stackoverflow.com/comment/42369841
type: Question
has comment: http://stackoverflow.com/comment/42369413
has body: I currently try to load HTML code into a div using jQuery and this code: I have got my button here: Play And my div below And last but not least the code in the startjourney2.html Start your Journey Some text goes here Tracing Lines 11 % - Last played: 27/08/2014 @ 11:59 p.m. Continue Journey Quit Journey Reveal 97 % - Last played: 12/11/2014 @ 07:54 a.m. Continue Journey Quit Journey Empty 0 % Start Journey The problem is that only the stuff from "page-side" is visible, everything else is invisible as you can see in the screenshot below: As far as I can see the code also gets loaded correctly, does a Javascript Plugin cause that? How do I correctly load the code? I hope someone can help me. Greetz,
tagged with: javascript
tagged with: jquery
score: 0
has title: jQuery: Loaded HTML is invisible
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42369654
has comment: http://stackoverflow.com/comment/42370139
has comment: http://stackoverflow.com/comment/42369519
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42369580

http://stackoverflow.com/q/26973237
has comment: http://stackoverflow.com/comment/42483403
has comment: http://stackoverflow.com/comment/42483441
possible better answer: http://stackoverflow.com/a/26973249
has answer: http://stackoverflow.com/a/26973419
has comment: http://stackoverflow.com/comment/42481915
has answer: http://stackoverflow.com/a/26973249
has answer: http://stackoverflow.com/a/26973643
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42481720
has comment: http://stackoverflow.com/comment/42483954
has body: I've got div with date 2014-11-17 16:00 that I want to parse. This is how I do: var beginDate = new Date((document.getElementById('beginDate').innerHTML)) .getTime(); Chrome shows millis, but not Safari and Firefox: NaN What's wrong? Second effort: var beginDateStr = document.getElementById('beginDate').innerHTML; beginDateStr = beginDateStr.split(' ').join('T'); var beginDate = new Date(beginDateStr); I've got an Invalid Date Third effort: var beginDateStr = document.getElementById('beginDate').innerHTML; beginDateStr = beginDateStr.split(' ').join('T'); beginDateStr = beginDateStr.replace(/\s/g, ""); console.log(beginDateStr); var beginDate = new Date(beginDateStr); var currentDate = new Date().getTime(); console.log(beginDate); In Chrome it's 2014-11-17T16:00 Mon Nov 17 2014 19:00:00 GMT+0300 (RTZ 2 (зима)) Wrong time. In Firefox it's 2014-11-17T16:00 2014-11-17T13:00:00.000Z Not even equal.
has comment: http://stackoverflow.com/comment/42484724
has comment: http://stackoverflow.com/comment/42484617
has answer: http://stackoverflow.com/a/26987545
type: Question
has title: Date parsing in different browsers
has comment: http://stackoverflow.com/comment/42482888
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26973643
tagged with: date
tagged with: browser
score: 0
has comment: http://stackoverflow.com/comment/42484338
has comment: http://stackoverflow.com/comment/42484343
has comment: http://stackoverflow.com/comment/42483383
has answer: http://stackoverflow.com/a/26973461
answer count: 5

http://stackoverflow.com/comment/42394999
type: AnswerComment
has text: @kanderson if this helped please mark the question as solved.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/26919242

http://stackoverflow.com/q/26950489
has answer: http://stackoverflow.com/a/26950673
has comment: http://stackoverflow.com/comment/42442247
upvote count: 1
has answer: http://stackoverflow.com/a/26952217
type: Question
linked to: http://stackoverflow.com/q/26941899
has comment: http://stackoverflow.com/comment/42442280
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42442365
answer count: 3
has comment: http://stackoverflow.com/comment/42442371
has body: How can I calculate a set of radio buttons using JavaScript? It works as of now with adding up the total. but I would like it to Subtract the $150.00 off. this is what I been working on now I get $Nan Baby Plan [radio BPSUBPT id:BPSUBPT class:radio-vertical "Baby Plan $300.00 3 Sessions" "Baby Plan $500.00 4 Sessions"] Did you have a Newborn session With ADP? [radio BPSUPQ id:BPSUPQ class:radio-vertical "Yes$ -150 off" "No"] Baby Plan Totals: Baby Plan Price: [text BPSUBPP 28/28 id:BPSUBPP] Discount Amount: [text BPSUDA 8/8 id:BPSUDA] Total Price: </span
accepted answer: http://stackoverflow.com/a/26952217
downvote count: 0
tagged with: calculated-field
score: 1
tagged with: subtraction
favorite count: 0
has title: How to subtract values of radio buttons
has answer: http://stackoverflow.com/a/26950661
has comment: http://stackoverflow.com/comment/42442268
has comment: http://stackoverflow.com/comment/42442309
possible better answer: http://stackoverflow.com/a/26950673
type: AnsweredQuestion

http://stackoverflow.com/comment/42398252
score: 2
comment on: http://stackoverflow.com/q/26925812
type: Comment
type: QuestionComment
has text: http://stackoverflow.com/a/3799269/887675

http://stackoverflow.com/a/26926958
type: Answer
has body: You should look at this answer. StackOverflow answer: Getting selected text in a browser, cross-platform From what you wrote, I'm guessing that you want to make a new radio button based on the text that the user selects from the contents of the txtHint div. The problem is that whatever you employ with normal javascript might be difficult to do in a cross browser way. And maybe you're learning javascript, try using jQuery, specially for the AJAX...it's awesome! The following answer also suggests the use of jQuery plugin and the wrapSelection plugin that does it in a cross browser supported way!
has comment: http://stackoverflow.com/comment/42401805
has comment: http://stackoverflow.com/comment/42400755
score: 0
answers question: http://stackoverflow.com/q/26914311

http://stackoverflow.com/q/26920304
has title: Rails 4 - force browser to execute javascript response instead of displaying text
has answer: http://stackoverflow.com/a/26920655
upvote count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/50936048
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/37173653
score: 3
has comment: http://stackoverflow.com/comment/86531358
tagged with: render
has body: I have a Rails 4 application where I need to force the controller to send a js response to all requests, html or js. For some reason, the browser is displaying the response as text instead of executing the code when the controller receives an html request (for example, when the user makes a request by typing in the url). Controller: def action render :template =&gt; 'sessions/home.js.erb', :content_type =&gt; "text/javascript" end sessions/home.js.erb: $("#button").on("click", function(){ alert("got here"); }); Instead of binding #button, the browser simply displays the code from home.js.erb as text. I've tried the following options in the controller but the results are the same - the browser just presents the text vs executing the code: render js: "alert('got here')"; or render :format =&gt; :js, :template =&gt; 'sessions/home.js.erb' or respond_to do |format| format.html {render :template =&gt; 'sessions/home.js.erb', :content_type =&gt; 'text/javascript'} end or respond_to do |format| format.html {render :template =&gt; 'sessions/home.js.erb', :content_type =&gt; 'application/javascript'} end Can somebody help me figure out what I need to do in order to get the browser to execute the javascript?
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: controller

http://stackoverflow.com/comment/42366723
type: Comment
has text: I dont want to invert the whole plugin i need to inherit or add custom script to do this specific action.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26908277

http://stackoverflow.com/comment/42508878
has text: Can you please be clearer about your desired output format? It doesn't make sense to have a string built of DOM elements. Are you trying to log the text content of those elements, or...?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26988121

http://stackoverflow.com/comment/42456053
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26956480
type: Comment
has text: Wonderful, to say the least... I thought I had to something by counting image elements but I didn't think about image preloads. Do .onload and .onerror are consistent across browsers?

http://stackoverflow.com/q/26863327
linked to: http://stackoverflow.com/q/318630
answer count: 0
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: javascript
tagged with: mozilla
tagged with: image
has comment: http://stackoverflow.com/comment/42287488
has title: Finding Image width and height by given maximum width and height with aspectratio
tagged with: aspect-ratio
downvote count: 0
has body: I am trying to find the image aspectratio,so width/height gives the aspect ratio of any image. But i want to set the image width and height like mozilla sets width and height of an image when i set max-width or max-height to somevalue. How to do this calculation to find width and height of an image with correct aspect ratio? new_width = width/height*user_definedwidth; like this, but i want to calculate both width and height for any image? How mozilla sets both width and height with aspect ratio when max-width or max-height have set. I need to show any user uploaded image with correct aspect ratio but large size images need to be resized. &lt;img src="http://hdcomputerwallpaper.com/wp-content/uploads/2013/12/Puppy-images.jpg" style='max-width:200px;'/&gt;
favorite count: 0
tagged with: css

http://stackoverflow.com/q/26970880
tagged with: css
type: AnsweredQuestion
score: 1
type: Question
has comment: http://stackoverflow.com/comment/42478037
has comment: http://stackoverflow.com/comment/42477907
possible better answer: http://stackoverflow.com/a/26971058
accepted answer: http://stackoverflow.com/a/26971059
has comment: http://stackoverflow.com/comment/42477723
has answer: http://stackoverflow.com/a/26971058
downvote count: 0
tagged with: javascript
has body: I have a span on page which is appearing via loop depending on the number of records in database table, so at times there could be a single span or multiple, exact number cannot be known and the span looks like this Then I have a dropdown menu and based on the selection I need the span to show $ sign or % sign This is the dropdpwn menu Set Weekly Savings Amount Allocate % Of Weekly Savings This is the JS function that is being called onchange function selectSavingOption(element) { if (element.options[element.selectedIndex].value == 'weekly_savings_amount') { alert('amount'); $("#goaltypeicon").html('$'); }if (element.options[element.selectedIndex].value == 'weekly_savings_percent') { alert('percent'); $("#goaltypeicon").html('%'); } } The above solution works, but for some reason it only works for 1 span. I guess the first span it finds, but it does not work for rest of the spans. For example if there are 4 spans on screen, the display of $ and % will work for the first span only. I will really appreciate if I can get some assistance in this. I need the solution to change span symbol from $ to % depending on the selection. value weekly_savings_amount should display $ value weekly_savings_percent should display %
tagged with: jquery
answer count: 3
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/42477787
has title: assigning symbol to multiple via JS with same id
has answer: http://stackoverflow.com/a/26971160
upvote count: 1
has answer: http://stackoverflow.com/a/26971059

http://stackoverflow.com/q/26866600
type: Question
has comment: http://stackoverflow.com/comment/42292717
answer count: 2
possible better answer: http://stackoverflow.com/a/72235762
has answer: http://stackoverflow.com/a/72235762
tagged with: javascript
tagged with: ajax
upvote count: 2
has answer: http://stackoverflow.com/a/26866773
accepted answer: http://stackoverflow.com/a/26866773
has comment: http://stackoverflow.com/comment/42292649
has title: PHP script not receiving posted JSON
favorite count: 0
has body: I'm having trouble with the following JavaScript, where data is a JavaScript object: var ajax_send = function(data) { var httpRequest; makeRequest('/prototype/test.php', data); function makeRequest(url, data) { if (window.XMLHttpRequest) { httpRequest = new XMLHttpRequest(); } else if (window.ActiveXObject) { try { httpRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!httpRequest) { alert('Giving up :( Cannot create an XMLHTTP instance'); return false; } httpRequest.onreadystatechange = alertContents; httpRequest.open('POST', url); httpRequest.setRequestHeader('Content-Type', 'application/json'); httpRequest.send(JSON.stringify(data)); } function alertContents() { if (httpRequest.readyState === 4) { if (httpRequest.status === 200) { alert(httpRequest.responseText); } else { alert('There was a problem with the request.'); } } } }; The PHP is: $data = $_POST['data']; $obj = json_decode($data); echo $obj; In dev tools the request payload looks ok but it doesn't seem to be what the PHP is looking for. Nothing gets through to the PHP script and the response is empty. What am I doing wrong?
has comment: http://stackoverflow.com/comment/42293428
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42293309
downvote count: 0
has comment: http://stackoverflow.com/comment/42292456

http://stackoverflow.com/comment/42511174
score: 0
has text: And we have problems to understand what is not working for you, if you even don't care to post any code.
comment on: http://stackoverflow.com/q/26986814
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42521519
comment on: http://stackoverflow.com/q/26975799
has text: @user3557327 No, even though I use this._id the document is not being retrieved I think it's because it's not being `subscribed`.
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/q/26851711
answer count: 3
has answer: http://stackoverflow.com/a/26851774
has answer: http://stackoverflow.com/a/26875330
tagged with: meteor
favorite count: 0
upvote count: 2
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/32264561
type: Question
has title: avoid meteor load scripts on
accepted answer: http://stackoverflow.com/a/26875330
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/32264561
has body: Its there a way to run scripts after some template load? Im totally noob on meteor, so i want to load my scripts.js after my template.html get loads, without meteor i put thats scripts on the body and works, but now im using meteor its seems like meteor load all scripts at same time on the and the problem its like i need to load first the template and later the script so my question its there a way to put a script on somewhere and call him when the template finish load?

http://stackoverflow.com/comment/42435084
has text: is it possible to use this for hiding picturenames which doesnt contain "horse" OR "dog"? like.. `$('.picture:not([picturename*="horse" or "dog"])').hide();`
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26946269
type: Comment

http://stackoverflow.com/comment/42483276
has text: I would add that `height='"+200+"' width='"+200+"'`is unnecessary also. No need to use the + if it's not a variable.
type: Comment
comment on: http://stackoverflow.com/a/26974045
score: 1
type: AnswerComment

http://stackoverflow.com/a/26839420
score: 2
has comment: http://stackoverflow.com/comment/42244456
has body: According to angularjs documentation, beside string expression, we also can pass function for filter argument. You can achieve the requirement using custom filter function. The function have to filter list based on given comma separated string. More or less change the your getData method with following. The updated jsfiddle is here: http://jsfiddle.net/ykktuo33/3/ getData: function ($defer, params) { $scope.peoples = angular.copy($scope.peoplesCopy); var filteredData = $filter('filter')($scope.peoples, // This is the custom filter function function(val,idx){ // entered filter in column var filt = params.filter(); if(filt &amp;&amp; filt.desig) { var searchfilter = filt.desig; // split multiple filter comma separated var filterKeys = searchfilter.split(','); if(filterKeys) { var ret = false; // iterate multiple entered filter and return true for match for(var key in filterKeys) { var listVal = val.desig; // call trim to remove whitespace between search filter keys ret = (listVal.indexOf(filterKeys[key].trim())) &gt; -1 || ret; } return ret; } } return true; }); $scope.peoples = $filter('orderBy')(filteredData, params.orderBy()); $defer.resolve($scope.peoples); }
answers question: http://stackoverflow.com/q/26838131
has comment: http://stackoverflow.com/comment/42244756
has comment: http://stackoverflow.com/comment/42244898
has comment: http://stackoverflow.com/comment/42245034
has comment: http://stackoverflow.com/comment/42244538
has comment: http://stackoverflow.com/comment/42245017
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26838131
upvote count: 2
has comment: http://stackoverflow.com/comment/42244937
type: Answer

http://stackoverflow.com/q/26956140
has comment: http://stackoverflow.com/comment/42452248
has title: How can I add items to existing array?
accepted answer: http://stackoverflow.com/a/26956157
type: Question
downvote count: 4
upvote count: 0
tagged with: arrays
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/42451703
score: -4
favorite count: 0
has answer: http://stackoverflow.com/a/26956157
type: AnsweredQuestion
has body: I have an array like this one: var data1 = [{ value: 'Afghan afghani', lubID: 'AFN' },{ value: 'Albanian lek', lubID: 'ALL' }]; What i want to do is to dynamically add items to data1 after it has been created. How can i do that? Thank you.

http://stackoverflow.com/a/27058590
type: Answer
score: 0
answers question: http://stackoverflow.com/q/26923229
has body: I saw your other question about getting UI elements into table cells before you deleted it. It seemed like an extension of this question, so I figured I'd post it here. I was thinking you may want to consider moving the select boxes and ui elements visually into the table cells. Here's the jsfiddle I made before you removed your question and figured you may want to see it. Seems somewhat relevant to what you're asking here, if only a few steps further along in development... $("select").addClass("hidden"); $("#abc-td").on("click focus", function (){ var $offset = $(this).offset(); var $top = $offset.top - 9, $left = $offset.left - 9, $height = $(this).outerHeight(), $width = $(this).outerWidth(); $("#abc").css({ position: "absolute", top: $top, left: $left, height: $height, width: $width }).removeClass("hidden").focus(); });

http://stackoverflow.com/comment/42407866
type: Comment
comment on: http://stackoverflow.com/q/26930347
has text: The budget resource seems out of place,none of your resources nested in `project` are using a dynamic segment, why are they there in the first place.
score: 0
type: QuestionComment

dynamics-crm-2013
tags question: http://stackoverflow.com/q/26873822
tags question: http://stackoverflow.com/q/26951887
tag name: dynamics-crm-2013
tags question: http://stackoverflow.com/q/26907449
type: Tag

http://stackoverflow.com/q/26870301
accepted answer: http://stackoverflow.com/a/26873834
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26909174
has title: Make marker zoom/rotate with map in Openlayers 3
tagged with: openlayers-3
type: Question
possible better answer: http://stackoverflow.com/a/26909174
answer count: 2
has body: I'm trying to overlay an image over an OpenLayers 3.0 map by adding a point feature to the layer, and setting the icon to the image to load. How can I get it to scale with the map as it is being zoomed? Or is there a better way to overlay an image atop a layer? p=ol.proj.transform( [-78,40],'EPSG:4326','EPSG:3857') var f=new ol.Feature({ geometry: new ol.geom.Point(p) }); var imgStyle=new ol.style.Style({ image: new ol.style.Icon(({ rotateWithView: false, anchor: [.5,.5], anchorXUnits: 'fraction', anchorYUnits: 'fraction', opacity: 0.75, src: 'http://www.viseyes.org/shiva/map.jpg' })) }); f.setStyle(imgStyle); myLayerr.getSource().addFeature(f);
tagged with: javascript
has answer: http://stackoverflow.com/a/26873834
downvote count: 0
favorite count: 0
tagged with: openlayers
upvote count: 2

http://stackoverflow.com/comment/42449593
type: AnswerComment
comment on: http://stackoverflow.com/a/26951046
has text: Of course, your code do the same,... but the problem is, i won't change the code in the plugin `.meRadioCheck();`. This i use in some other projects for styling the Layout of CheckBoxes and RadioButtons. What i want the change event make available from outside.
type: Comment
score: 0

http://stackoverflow.com/q/26856470
has comment: http://stackoverflow.com/comment/42274976
has title: Remove all tags from a string in JS using a regex
type: Question
has comment: http://stackoverflow.com/comment/42274972
has comment: http://stackoverflow.com/comment/42275012
tagged with: javascript
score: 0
has body: I know the subject has been treated many times on SO, but I couldn't fine a proper solution yet. I have this string: Your account has been created on this application. You are now connected as vado. Used language: en. I want to remove all tags but not the content inside. I have tried several regexes but I wasn't able to delete them all so far. I have tried replace(' ', '').replace(' ', ''), replace(/(<([p^>]+)>)/ig) but ... Note that I need to use a regex here, a DOM jQuery manipulation is not possible.
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/1144783
tagged with: regex
answer count: 0
duplicate of: http://stackoverflow.com/q/1144783

http://stackoverflow.com/q/26965359
has body: Here my Angularjs application with coffeescript: app.factory "User", ["$http", ($http ) -&gt; current: -&gt; $http.get("api/users").then (data) -&gt; console.log(data.data) ] app.controller "MainCtrl", MainCtrl = ["$scope", "User", ($scope, User) -&gt; $scope.user = User.current() console.log($scope.user) ] Factory return Promise Promise {$$state: Object, then: function, catch: function, finally: function} I need to return an object from the factory: Object {id: 1, email: "example@example.com", created_at: "2014-05-27T08:21:02.322+10:00", updated_at: "2014-11-17T10:11:31.551+10:00", inn: "25"…} I need help.
type: AnsweredQuestion
has title: Angularjs object from factory
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/26965554
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/26965554
tagged with: angularjs
tagged with: angular-promise

http://stackoverflow.com/a/26906526
has body: Change: echo json_encode($row) "\r\n"; To: echo json_encode(array("cord_latitude" =&gt; $row["cord_latitude"], "cord_longitude" =&gt; $row["cord_longitude"])); And then use JSON.parse();: json = 'YOUR JSON STRING' theater = JSON.parse(json); console.log('Longitude: ' + theater.cord_longitude) console.log('Latitude: ' + theater.cord_latitude) This way only those 2 fields will go over the line, resulting in less trafic and thus faster loading.
score: 0
answers question: http://stackoverflow.com/q/26906351
type: Answer

http://stackoverflow.com/a/26888174
type: Answer
has comment: http://stackoverflow.com/comment/42335997
score: 0
answers question: http://stackoverflow.com/q/26887903
has body: I think you are getting an error because of the following line - HardDrive.prototype = new Pc(); Your Pc constructor (method) is not equipped with handling no parameter cases. Hence you pass nothing to the Pc method, obj is undefined and obj.type cannot be accessed.

http://stackoverflow.com/q/26873263
type: AnsweredQuestion
has title: Layer is not being display even though it was assigned high z-index
type: Question
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
score: 0
has answer: http://stackoverflow.com/a/26873453
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/26873453
downvote count: 1
tagged with: css
has comment: http://stackoverflow.com/comment/42304594
has body: I am facing an issue with a div not being displayed when it is toggled from display: none; to display: block; HTML: &lt;div class="menus-container" style="display: block; top: 50px; height: 277px;"&gt; .. some pretent content, which shows up in another place on the website ... &lt;/div&gt; Which is toggled by js by a plugin JS which is minified so I cannot list the js, but I see in the developer toolbar that the style changes work. I see that it has a height, I see that it has a width and a z-index of about 99999.To be sure I assigned in the developer tool bars all parent elements as well an z-index: 999 !important; Still that div wont show up... any ideas? If you want to look at the example follow this link (redacted) - it only happens at a width of less than 850px.
has comment: http://stackoverflow.com/comment/42304820

http://stackoverflow.com/comment/42494046
type: Comment
has text: sorry, was late and none of that was all that helpful admittedly! Hopefully the codepen demo will clear most of it up
comment on: http://stackoverflow.com/a/26964252
score: 0
type: AnswerComment

http://stackoverflow.com/a/26974991
downvote count: 0
type: Answer
has body: This is a javascript closure. I've found this site to be helpful. var move = function () { alert("move"); }; load(); function load() { move(); } This code will alert Move only once.
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/26974865

http://stackoverflow.com/comment/42503100
has text: exactly - thank you so much. but why wouldn't work? im not even sure how to troubleshoot for that. there has been no purposeful change to the settings of the calendar. what could the issue be? is it possible google changed something and how do i figure that out? thank you - i really appreciate your help.this is the xml feed of the calendar if it helps: https://www.google.com/calendar/feeds/m00bjts7fdqj3d7jqksqamqouc%40group.calendar.google.com/public/basic
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26984579

http://stackoverflow.com/comment/42516836
has text: I think you should create a socalled snapshot to make google "happy". Simply have a static table in your html / template with the first 100 rows (or whatever you need)
comment on: http://stackoverflow.com/q/26978841
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42474691
type: Comment
comment on: http://stackoverflow.com/a/26969191
score: 1
has text: You can also use one of the YAML libraries; YAML, unlike JSON, allows for circular representations.
type: AnswerComment

http://stackoverflow.com/a/26971381
score: 0
type: Answer
upvote count: 1
has body: The problem is you use a real HTML link, so it refreshes the page, it's the normal behaviour. But you would like to change only the current route, not to reload the page. For that, you can handle the links to say to Backbone : "handle my links !". Here is an example of the JS that I use to handle links that have "innerlink" CSS class as a route. 'use strict'; var Backbone = require('backbone'); var $ = require('jquery'); Backbone.$ = $; module.exports = function() { // Use absolute URLs to navigate to anything not in your Router. var openLinkInTab = false; // Only need this for pushState enabled browsers if (Backbone.history._hasPushState) { // console.log('YES you have push state !'); $(document).keydown(function(event) { if (event.ctrlKey || event.keyCode === 91) { openLinkInTab = true; } }); $(document).keyup(function() { openLinkInTab = false; }); // Use delegation to avoid initial DOM selection and allow all matching elements to bubble $(document).on('click', 'a.innerlink', function(evt) { // Get the anchor href and protcol var href = $(this).attr('href'); var protocol = this.protocol + '//'; console.log('backbone_pushstate_router:', href, protocol); evt.preventDefault(); // Ensure the protocol is not part of URL, meaning its relative. // Stop the event bubbling to ensure the link will not cause a page refresh. if (!openLinkInTab &amp;&amp; href.slice(protocol.length) !== protocol) { evt.preventDefault(); // Note by using Backbone.history.navigate, router events will not be // triggered. If this is a problem, change this to navigate on your // router. Backbone.history.navigate(href, true); } }); } else { console.warn('no push state'); } }; Enjoy :)
answers question: http://stackoverflow.com/q/26970737
downvote count: 1

http://stackoverflow.com/q/26851439
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
favorite count: 0
has body: I have a problem regarding my new site design prospect, and it involves using some jQuery and jQueryUI (mainly SliderUi) and some css manipulation. Everytime I slide the #slider, the width of .left will then update depend on (ui.value from 1-100 + '%'), from here slide + background transition is happening already, My question is is there any possible way to manipulate the color of texts depending on slider's treshold or value? if yes, can you suggest how can I come up into something like this? Snippet below. Thanks in advance! $(document).ready(function() { $( "#slider" ).slider({ max: 101, min:1, value: 51, slide: function(event,ui) { var percentage = (ui.value)-1; $('.left').css("width",percentage +'%'); } }); }); #slider {z-index: 5;background: #666; } .left, .right {positioackgrn:absolute; top: 0; left: 0; height: 100vh;} .left {background: #000; width: 50%; z-index: 1;} .right {background: #fff; z-index: -1; width: 100%;} .main-content {z-index: 3; position: absolute; top: 0; left: 0; width: 100%;} h3 {color: blue; text-align: center; margin-top: 30px;} A part of my font must change color depending on slider-ui threshold
type: UnansweredQuestion
tagged with: css
has title: jQuery ui Slider for Background and Font Colors
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/26853006
type: Question
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/42494219
type: Comment
score: 0
has text: When I inspect the element I can see the picker is there but not visible on the page. I thought I loaded the CSS - do you know what i might be missing?
comment on: http://stackoverflow.com/a/26893333
type: AnswerComment

http://stackoverflow.com/q/26861654
has comment: http://stackoverflow.com/comment/42283571
tagged with: asp.net
has answer: http://stackoverflow.com/a/26863836
favorite count: 0
tagged with: pageload
type: AnsweredQuestion
has body: I'm trying to use function pageLoad() (asp.net related JS event) I have one in the masterpage, and one in a different page. For some reason they don't want to be friends... only one is called. When I cancel one, the other one is called so I don't see a problem there... Any idea? Master page: &lt;%@ Master Language="C#" AutoEventWireup="true" CodeBehind="....." Inherits="......." %&gt; &lt;!DOCTYPE html&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;script&gt; function pageLoad() { alert('masterpage load'); CallStyledArrowSelect(); } &lt;/script&gt; //more irrelevant code &lt;asp:ContentPlaceHolder ID="head" runat="server"&gt; &lt;/asp:ContentPlaceHolder&gt; And in the content page: &lt;asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"&gt; &lt;script&gt; function pageLoad(){ alert('hi i'm not working'); } //more code...
score: 1
upvote count: 1
has title: pageLoad function in page and masterpage
type: Question
has comment: http://stackoverflow.com/comment/42284889
has comment: http://stackoverflow.com/comment/42284271
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26863836
downvote count: 0
answer count: 1

http://stackoverflow.com/comment/42451343
score: 0
type: Comment
type: QuestionComment
has text: try removing the slashes from the beginning and end of your indexOf condition
comment on: http://stackoverflow.com/q/26955755

http://stackoverflow.com/comment/42467978
type: QuestionComment
comment on: http://stackoverflow.com/q/26964645
has text: I looked into using but that only prevents the data from being submitted when it doesn't meet parameters, I want to prevent invalid characters from being entered into the box at all
score: 0
type: Comment

http://stackoverflow.com/a/26976605
has comment: http://stackoverflow.com/comment/75100262
type: AcceptedAnswer
upvote count: 6
type: Answer
has body: You can check parent state only instead of checking all child states $scope.isActive = function() { return $state.includes('playLotteries'); }
accepted answer of: http://stackoverflow.com/q/26976350
downvote count: 0
has comment: http://stackoverflow.com/comment/48450038
score: 6
answers question: http://stackoverflow.com/q/26976350

http://stackoverflow.com/comment/42351987
has text: Could you help me and show how? I'm new to JS...
comment on: http://stackoverflow.com/q/26899445
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47086655
has text: actually the problem here is that global variables is not a good idea , I want to assign it as private variable , any idea about that?
comment on: http://stackoverflow.com/a/26919068
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/26867842
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26867321
answers question: http://stackoverflow.com/q/26867321
score: 5
type: AcceptedAnswer
upvote count: 5
has body: The browsers are very strict when it comes to tables. It does not work well when you get out of the scope of how tables are designed to work. However, you can use a trick with fixed positioning to cheat the browser into not taking in account the missplaced table cell, since it is absolutelly off the normal flow: Add a transform property to the table row, so it will act as a fixed position container. Choose one that will not have any visual impact, like transform: scale(1,1); Set the table cell as position: fixed, and then you can move it relatively to the transformed row: tr { position:relative; transform:scale(1,1); } td.last{ position:fixed; left: 10px; top: 40px; } td 1 td 2 td 3 td 1 td 2 td 3 td 1 td 2 td 3
type: Answer
has comment: http://stackoverflow.com/comment/55484074

http://stackoverflow.com/comment/42259293
has text: @SyedMuhammadZeeshan, just a wild guess: ALL ID'S!
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/26848071

http://stackoverflow.com/comment/42324758
type: Comment
comment on: http://stackoverflow.com/q/26884747
score: 0
type: QuestionComment
has text: try utf8_encode() or something like this.. while passing the data from server...

http://stackoverflow.com/comment/42444487
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26951694
has text: I get it, thanks. Yeah that's what I wanted to know, the best way to apply functions. Cheers

http://stackoverflow.com/comment/42301820
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26871708
type: AnswerComment
has text: I don't have IE 7 at hand. What does it show? `element` is `undefined` in the last call?

video
tags question: http://stackoverflow.com/q/26969306
type: Tag
tags question: http://stackoverflow.com/q/26909611
tags question: http://stackoverflow.com/q/26863038
tags question: http://stackoverflow.com/q/26947337
tags question: http://stackoverflow.com/q/26858472
tags question: http://stackoverflow.com/q/26931363
tags question: http://stackoverflow.com/q/26952084
tags question: http://stackoverflow.com/q/26866025
tags question: http://stackoverflow.com/q/26892572
tags question: http://stackoverflow.com/q/26969405
tags question: http://stackoverflow.com/q/26940074
tags question: http://stackoverflow.com/q/26920132
tags question: http://stackoverflow.com/q/26834537
tags question: http://stackoverflow.com/q/26894083
tags question: http://stackoverflow.com/q/26988960
tag name: video
tags question: http://stackoverflow.com/q/26985016

http://stackoverflow.com/comment/80702658
has text: @dandavis cors does only affect browsers so its security concern is for the user, not your server
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26988071
score: 0

http://stackoverflow.com/comment/42325237
type: Comment
score: 0
type: AnswerComment
has text: PhP Doesn't provides any Client data, because PhP is a server-side langage. You can access Client current time using Javascript As mentioned by "Zeratops" above
comment on: http://stackoverflow.com/a/26885031

http://stackoverflow.com/q/26846991
has comment: http://stackoverflow.com/comment/42257026
has answer: http://stackoverflow.com/a/26847063
type: Question
has comment: http://stackoverflow.com/comment/42256953
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/42256989
accepted answer: http://stackoverflow.com/a/26847063
has title: Can I combine the 2 marrow animate sequences into one statement and still get the same results?
has body: Is there anyway I can combine the 2 marrow animate sequences into one statement and still get the same results? btnopen.on('mouseenter', function(e) { var marrow = $(this).find(btnopenarrow); marrow.css({'background-position':'bottom center'}); marrow.stop().animate({marginTop:5}, 100, 'easeOutCubic', function(){ marrow.stop().animate({marginTop:20}, 300, 'easeOutCubic'); }); mlinkopen.css({color:'white'}); });
type: AnsweredQuestion

http://stackoverflow.com/comment/42497885
score: 0
type: Comment
type: AnswerComment
has text: @djechlin minor bug fixed
comment on: http://stackoverflow.com/a/26981672

http://stackoverflow.com/a/26961710
has comment: http://stackoverflow.com/comment/76749383
downvote count: 4
score: 135
has comment: http://stackoverflow.com/comment/74361185
has comment: http://stackoverflow.com/comment/77961407
has body: There is a little known feature in TypeScript that allows you to use Mixins to create re-usable small objects. You can compose these into larger objects using multiple inheritance (multiple inheritance is not allowed for classes, but it is allowed for mixins - which are like interfaces with an associated implenentation). More information on TypeScript Mixins I think you could use this technique to share common components between many classes in your game and to re-use many of these components from a single class in your game: Here is a quick Mixins demo... first, the flavours that you want to mix: class CanEat { public eat() { alert('Munch Munch.'); } } class CanSleep { sleep() { alert('Zzzzzzz.'); } } Then the magic method for Mixin creation (you only need this once somewhere in your program...) function applyMixins(derivedCtor: any, baseCtors: any[]) { baseCtors.forEach(baseCtor => { Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => { if (name !== 'constructor') { derivedCtor.prototype[name] = baseCtor.prototype[name]; } }); }); } And then you can create classes with multiple inheritance from mixin flavours: class Being implements CanEat, CanSleep { eat: () => void; sleep: () => void; } applyMixins (Being, [CanEat, CanSleep]); Note that there is no actual implementation in this class - just enough to make it pass the requirements of the "interfaces". But when we use this class - it all works. var being = new Being(); // Zzzzzzz. being.sleep();
upvote count: 139
type: Answer
answers question: http://stackoverflow.com/q/26948400
has comment: http://stackoverflow.com/comment/76756997
has comment: http://stackoverflow.com/comment/77184307

http://stackoverflow.com/comment/42513388
type: QuestionComment
has text: I don't want to use jQuery
score: 0
comment on: http://stackoverflow.com/q/26991037
type: Comment

http://stackoverflow.com/comment/104372196
comment on: http://stackoverflow.com/a/26864048
score: 2
has text: @Justinas Then, you need to refill the body every time when `calling modal.show()`, I cant accept this method.
type: AnswerComment
type: Comment

http://stackoverflow.com/a/26875392
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/42310285
accepted answer of: http://stackoverflow.com/q/26874929
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26874929
has body: Try using the solution here open-jquery-accordion-panel-with-link-outside-of-acccordion Demo here.
type: Answer

http://stackoverflow.com/a/29376836
upvote count: 2
score: 2
downvote count: 0
has body: I never comment on stackoverflow but this was an issue for me several times and I seem to keep running into this. So, I'll like to HELP everyone. First Set Header to Content-Type : application/json Don't include : into Context-type. Second choose raw for the input type. Though this isn't a JSON tutorial, postman notice the difference between single and double quotes. Use double quotes which is this ", NOT ' and not ''. Second, double quote the key and if the value of the key is a string, double quote the expression. It was always recommended that keys should be single strings (use camel hump notation if necessary). Being a so-called veteran of programming, I though postman would handle if the keys for the JSON object was variables and not string because of the notation but maybe it is an issue with postman. A picture tells a thousand words so I included a picture. Note that if you have issues add particular key, it might be your model. Go young grasshopper. (A)lways (B)e (C)oding Regards! Quentin Mayo. P.S I have no affiliation with Postman but I strongly recommend it to anyone trying to work with an API. I don't post enough to post images so if someone validates me, feel free to post re-post the image on this page(I just want to help others). http://postimg.org/image/6xmto3elj/
type: Answer
answers question: http://stackoverflow.com/q/26853292

http://stackoverflow.com/comment/42391434
comment on: http://stackoverflow.com/q/26921700
score: 2
has text: do you mean making sure there isn't multiple rows with the same "Name"?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26854785
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Foreach loop in Ghost CMS returning null
tagged with: ghost-blog
score: 2
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42556801
tagged with: handlebars.js
has answer: http://stackoverflow.com/a/27372569
has comment: http://stackoverflow.com/comment/42287444
has body: Currently setting up a simple site using Ghost CMS. By default, the homepage comes with a list of posts that it retrieves through a foreach loop. I'm trying to recreate that on the posts page, but nothing is being pulled in. File structure is: /theme /theme/index.hbs /theme/post.hbs The code that works on the index.hbs is: {{#foreach posts}} &lt;article class="{{post_class}}"&gt; &lt;header class="post-header"&gt; &lt;h2 class="post-title"&gt;&lt;a href="{{url}}"&gt;{{{title}}}&lt;/a&gt;&lt;/h2&gt; &lt;/header&gt; &lt;section class="post-excerpt"&gt; &lt;p&gt;{{excerpt words="26"}} &lt;a class="read-more" href="{{url}}"&gt;&amp;raquo;&lt;/a&gt;&lt;/p&gt; &lt;/section&gt; &lt;footer class="post-meta"&gt; {{#if author.image}}&lt;img class="author-thumb" src="{{author.image}}" alt="Author image" nopin="nopin" /&gt;{{/if}} {{author}} {{tags prefix=" on "}} &lt;time class="post-date" datetime="{{date format='YYYY-MM-DD'}}"&gt;{{date format="DD MMMM YYYY"}}&lt;/time&gt; &lt;/footer&gt; &lt;/article&gt; {{/foreach}} My slightly stripped down version that I use on the post.hbs page is: &lt;aside class="timeline"&gt; {{#foreach posts}} &lt;h4 class="post-title"&gt;&lt;a href="{{url}}"&gt;{{{title}}}&lt;/a&gt;&lt;/h4&gt; &lt;section class="post-meta"&gt; {{author}} {{tags prefix=" on "}} &lt;time class="post-date" datetime="{{date format='YYYY-MM-DD'}}"&gt;{{date format="DD MMMM YYYY"}}&lt;/time&gt; &lt;/section&gt; {{/foreach}} &lt;/aside&gt; My guess is that I can't call posts while on the post page, but I'm not sure.

http://stackoverflow.com/a/26897967
downvote count: 2
score: 1
has comment: http://stackoverflow.com/comment/42350189
has comment: http://stackoverflow.com/comment/42348966
answers question: http://stackoverflow.com/q/26897924
type: Answer
has comment: http://stackoverflow.com/comment/42348947
has comment: http://stackoverflow.com/comment/42348994
has body: Sure: document.body.insertAdjacentHTML('beforeend', 'Lorem ipsum');
upvote count: 3

http://stackoverflow.com/a/26859371
answers question: http://stackoverflow.com/q/26859341
score: 0
type: Answer
has body: &lt;input name="q" type="text" id='test' autocomplete="off"/&gt; will turnoff the autocomplete in html . no need of jquery or js Or if you need it to be done with javascript, document.getElementById("test").autocomplete="off"

http://stackoverflow.com/comment/42514004
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26990880
type: Comment
has text: @NirajChoksi you might wanna update the answer with that code.

http://stackoverflow.com/q/26972008
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/42479806
tagged with: .net
answer count: 1
has answer: http://stackoverflow.com/a/26972485
accepted answer: http://stackoverflow.com/a/26972485
tagged with: javascript
has comment: http://stackoverflow.com/comment/42479591
tagged with: jquery
has body: I have 2 functions in javascript, but only returns one one of the error rather then both of them. if i delete one function then other works, but if i have 2 functions it only shows one. this is my javascript: function validateForm(event) { event = event || window.event || event.srcElement; var initialMonoReading = $('#InitialMonoReading').val(); var newMonoReading = $('#newMonoReading').val() if (~~newMonoReading &lt; ~~initialMonoReading) { $('#MonoErrorMessage').text("New Mono Readings must be MORE than existing"); $('#MonoErrorMessage').show(); event.preventDefault(); } else { $('#MonoErrorMessage').hide(); } } function validateForm(event) { event = event || window.event || event.srcElement; var InitialColourReading = $('#InitialColourReading').val(); var newColourReading = $('#newColourReading').val() if (~~newColourReading &lt; ~~InitialColourReading) { $('#ColourErrorMessage').text("New Colour Readings must be MORE than existing"); $('#ColourErrorMessage').show(); event.preventDefault(); } else { $('#ColourErrorMessage').hide(); } } This is my submit: @using (Html.BeginForm("Save", "ReadingsEntry", FormMethod.Post, new { enctype = "multipart/form-data", onsubmit = "validateForm(event)"})) This works only for the ColourErrorMessage . but ignores MonoErrorMessage. when it should show both errors.... so why is it skipping one of the functions
has comment: http://stackoverflow.com/comment/42480012
upvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/42479866
has title: onsubmit button works only for 1 function

http://stackoverflow.com/q/26895325
tagged with: php
has body: To be more clear here is my fiddle for demonstration. I have multiple DIVs with a unique ID like so: desk_85 (the small box you see and the number changes). B20 I want my "aht_value" from show_aht.php to replace the number inside every appropriate "desk_#" DIV. example of my json_encode result : [{"username":"HCZR","aht_value":"578","station":"B12"{"username":"FEHER4","aht_value":"703","station":"B20"}] Problems I want to achieve:: I'll use the DIV and VALUES above for this example... 1.Match the station number from the array with the station number from the desk_# DIV, in other words, compare the "B20" from json result with the "B20" in the DIV. IF they match, replace the inner html from desk_85 with the "aht_value" from the array (so have displaying 278 instead of B20) If I need to clarify things please tell me. thanks in advance! map.php AJAX AHT show_aht.php - json_encode part foreach ($memo as $username => $memodata) { if (in_array($username, array_keys($user))) { // Match username against the keys of $user (the usernames) $userdata = $user[$username]; if (is_null($memodata['aht_value'])) { $result[] = array( 'username' => $userdata['username'], 'aht_value' => 'NA', 'station' => $userdata['station'] ); } else { $result[] = array( 'username' => $userdata['username'], 'aht_value' => substr($memodata['aht_value'],0,-3), 'station' => $userdata['station'] ); } } } echo json_encode($result);
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/26895448
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/26895448
downvote count: 2
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
has title: How to replace inner html using returned results from json_encode with AJAX?

http://stackoverflow.com/comment/42284313
type: AnswerComment
comment on: http://stackoverflow.com/a/26862049
type: Comment
has text: You maybe right. I have tried data[key] but I get the result as value: [object Object] that is why I had changed it to JSON.stringify(data) to get the whole object. Now I need only the value for status.
score: 0

http://stackoverflow.com/q/26884353
answer count: 1
has comment: http://stackoverflow.com/comment/42324007
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has title: Bad encoding when renaming html file to php
has comment: http://stackoverflow.com/comment/42324404
type: Question
has body: I had a file index.html with accents, and everything went fine. Since I changed it for index.php, I see encoding problems. So I replaced accent with HTML entities in index.php and it displays well. My last problem now is I have a form where inputs have custom placeholders fill in javascript, containing accents. Even with html entities these placeholders are displayed with encoding problem. How can I resolve this ? In my index.php I have : &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt; And in firebug I have : Content-Type text/html; charset=iso-8859-1
tagged with: javascript
tagged with: character-encoding
has answer: http://stackoverflow.com/a/26884641
score: 0

http://stackoverflow.com/comment/42377143
type: Comment
comment on: http://stackoverflow.com/a/26913956
has text: Because this doesn't solve the question. He's searching for a *value*, not key.
score: 4
type: AnswerComment

http://stackoverflow.com/comment/42300667
comment on: http://stackoverflow.com/a/26870563
has text: Thanks, Niet the Dark Absol. I will probably write a small program for it then that incorporates a browser and starts and stops the PHP service.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/26902272
has comment: http://stackoverflow.com/comment/42356470
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/26902751
has comment: http://stackoverflow.com/comment/42357217
has comment: http://stackoverflow.com/comment/42357016
has answer: http://stackoverflow.com/a/26902751
tagged with: regex
has comment: http://stackoverflow.com/comment/42357126
has answer: http://stackoverflow.com/a/26902793
has comment: http://stackoverflow.com/comment/42356433
type: Question
score: 0
has comment: http://stackoverflow.com/comment/42356599
answer count: 2
has comment: http://stackoverflow.com/comment/42356458
tagged with: date
has title: Date regex of format mm/yyyy is not working
has comment: http://stackoverflow.com/comment/42356808
accepted answer: http://stackoverflow.com/a/26902793
has body: i am new to regex. i am using a regex '^((0?[1-9]|1[012])[- /.](20)?[0-9]{2})$' to validate credit card expiry date in MM/YYYY format. this is my javascript function which checks the regex and give me response in TRUE or FALSE. function isValidThruDate(valid_till){ var regex = new RegExp('^((0?[1-9]|1[012])[- /.](20)?[0-9]{2})$'); return regex.test(valid_till); } but whenever i pass it the date, it gives me FALSE in return. i am unable to figure out what is the problem.
tagged with: javascript

http://stackoverflow.com/q/26941739
downvote count: 0
tagged with: javascript
has body: I have a form into a bootstrap modal 3. How can I validate the input fields marked with a * ? I have tried to set required in the class for the first input field as a test but it's not working. If i change the url to a non existant file, it gives me the error message otherwise it's always the success message. Is the only reason here the validation? &lt;div class="modal fade" id="cta-aut-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-body"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt; &lt;h4 class="modal-title" id="myModalLabel"&gt;Vraag uw demo aan&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;div class="style-msg successmsg" id="contact-form-result2"&gt;&lt;/div&gt; &lt;div class="style-msg errormsg" id="contact-form-result3"&gt;&lt;/div&gt; &lt;form class="nobottommargin" id="template-contactform" name="template-contactform"&gt; &lt;div class="form-process"&gt;&lt;/div&gt; &lt;div class="col_one_third"&gt; &lt;label for="template-contactform-firstname"&gt;Voornaam &lt;small&gt;*&lt;/small&gt;&lt;/label&gt; &lt;input type="text" id="template-contactform-firstname" name="template-contactform-firstname" value="" class="required sm-form-control " /&gt; &lt;/div&gt; &lt;div class="col_one_third"&gt; &lt;label for="template-contactform-lastname"&gt;Achternaam &lt;small&gt;*&lt;/small&gt;&lt;/label&gt; &lt;input type="text" id="template-contactform-lastname" name="template-contactform-lastname" value="" class=" sm-form-control " /&gt; &lt;/div&gt; &lt;div class="col_one_third col_last"&gt; &lt;label for="template-contactform-email"&gt;Email &lt;small&gt;*&lt;/small&gt;&lt;/label&gt; &lt;input type="text" id="template-contactform-email" name="template-contactform-email" value="" class=" sm-form-control" /&gt; &lt;/div&gt; &lt;div cla…
answer count: 1
tagged with: bootstrap-modal
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/26941810
type: UnansweredQuestion
tagged with: php
score: 1
upvote count: 1
has title: Validate form inputs via ajax (form in bootstrap modal)
type: Question

http://stackoverflow.com/a/26951475
has comment: http://stackoverflow.com/comment/42459391
answers question: http://stackoverflow.com/q/26950645
type: Answer
has comment: http://stackoverflow.com/comment/42453742
accepted answer of: http://stackoverflow.com/q/26950645
score: 3
has comment: http://stackoverflow.com/comment/42472654
upvote count: 3
has comment: http://stackoverflow.com/comment/42453684
has body: You can use timer-tick event here $scope.$on('timer-tick', function (event, data) { if ($scope.timerRunning === true &amp;&amp; data.millis &gt;= $scope.deadlineInMilli) { $scope.$apply($scope.turnRed); } }); And you need to convert your minutes to milliseconds for comparison $scope.startTimer = function (deadline) { .... $scope.deadlineInMilli = +deadline * 1000 * 60; // converting to milliseconds }; See the DEMO
downvote count: 0
has comment: http://stackoverflow.com/comment/42453716
has comment: http://stackoverflow.com/comment/42459181
has comment: http://stackoverflow.com/comment/42445420
type: AcceptedAnswer

http://stackoverflow.com/q/26858914
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/26859217
tagged with: animation
tagged with: vertical-scrolling
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26859210
possible better answer: http://stackoverflow.com/a/26859217
has title: How to animate List from Down to Up
score: 1
has body: I am creating a small animation which work like Up to Down and once it will scroll till end then it will go Down to Up and it will repeat again and again. Scroll Text Scroll Text Scroll Text Scroll Text Scroll Text Scroll Text Scroll Text
tagged with: scroll
upvote count: 1
type: Question
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/26859210

http://stackoverflow.com/comment/42376962
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26913741
type: Comment
has text: okay, I fixed it, but how can i get $web_account_number=$_POST['web_account_number'] I selected from dropdown box Thank you

http://stackoverflow.com/comment/42513767
type: QuestionComment
score: 1
has text: The error should point to a script and a position. Please tell us more.
comment on: http://stackoverflow.com/q/26990980
type: Comment

http://stackoverflow.com/q/26962571
answer count: 1
downvote count: 0
tagged with: mongoose
tagged with: javascript
favorite count: 0
has title: What's the common way to access a MongoDB with JavaScript?
has answer: http://stackoverflow.com/a/26963042
accepted answer: http://stackoverflow.com/a/26963042
upvote count: 1
tagged with: node.js
has body: Let's say I wrote a little HTML site, deployed on my nginx webserver. I created a database with MongoDB and stored several million entries in it. The MongoDB server is only listening on the local interface and accessible via localhost:27017. Now I want to go to my webpage on my publicly accessible nginx webserver and access the entries in the database via JavaScript, by clicking a button "Show Users" or "Get latest entries" and so on. I need to perform only simple read-only-queries on the database like counting, searching, aggregating, and so on, so I don't need write access. How do you generally implement this? Do I really need to set up PHP, Python, and Java to access the DB or is it somehow possible to solve this by only using HTTP/REST Interfaces? Can NodeJS help me to solve this? Do I have to remove nginx when using NodeJS? Sorry, but I'm quite confused with all that JavaScript/ NodeJS/ mongoose/ MongoDB/ JSON stuff.
type: AnsweredQuestion
tagged with: nginx
score: 1
type: Question
tagged with: mongodb

http://stackoverflow.com/comment/42445578
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26952397
has text: that doesn't asnwer the question. What do you think `A = 'A'|'a';` and `A = userinput / A` do?
score: 2

http://stackoverflow.com/q/26905038
has comment: http://stackoverflow.com/comment/42361318
linked to: http://stackoverflow.com/q/210643
type: Question
has comment: http://stackoverflow.com/comment/42361142
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/42361059
has comment: http://stackoverflow.com/comment/42361144
answer count: 2
downvote count: 2
upvote count: 1
has title: Why click event for file browse window is not working?
tagged with: jquery
has body: &lt;input&gt; for select images: &lt;input type="file" class="form-control forminputs files photoimg" multiple name="photoimg[]" placeholder="Choose 3 image files" accept="image/png,image/jpeg" id="photoimg" /&gt; I am trying to select at least 3 images. If it is exceeded 3, then it alerts "please select 3" and again automatically opens file browse window. Up to alert everything works fine but after that file browse window is not opening. JS code: $('#photoimg').change(function() { var files = this.files.length; if (files &gt; 3) { alert("Please select 3 images only(png/jpg)"); document.getElementById("photoimg").click(); } }); tried with this.click() and $('#photoimg').click();. $('#photoimg').click(function() { alert("clicked"); }); to test it click event was taken, click event was working but still file browse was not working. Why it is not working?
has answer: http://stackoverflow.com/a/26905175
has answer: http://stackoverflow.com/a/26905284
favorite count: 0
duplicate of: http://stackoverflow.com/q/210643
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42361109
has comment: http://stackoverflow.com/comment/42361351

google-maps-api-3
tags question: http://stackoverflow.com/q/26904189
tags question: http://stackoverflow.com/q/26872331
tags question: http://stackoverflow.com/q/26913467
tags question: http://stackoverflow.com/q/26904703
tags question: http://stackoverflow.com/q/26876806
tags question: http://stackoverflow.com/q/26854058
tags question: http://stackoverflow.com/q/26893648
tags question: http://stackoverflow.com/q/26844237
tags question: http://stackoverflow.com/q/26968272
tags question: http://stackoverflow.com/q/26899484
tags question: http://stackoverflow.com/q/26965425
tags question: http://stackoverflow.com/q/26903347
tags question: http://stackoverflow.com/q/26891211
tags question: http://stackoverflow.com/q/26949769
tags question: http://stackoverflow.com/q/26865593
tags question: http://stackoverflow.com/q/26932031
tags question: http://stackoverflow.com/q/26866063
tags question: http://stackoverflow.com/q/26887416
tags question: http://stackoverflow.com/q/26849203
tags question: http://stackoverflow.com/q/26987993
tags question: http://stackoverflow.com/q/26910573
tags question: http://stackoverflow.com/q/26885135
tags question: http://stackoverflow.com/q/26970243
tags question: http://stackoverflow.com/q/26957593
tags question: http://stackoverflow.com/q/26971611
tags question: http://stackoverflow.com/q/26881964
tags question: http://stackoverflow.com/q/26983211
tags question: http://stackoverflow.com/q/26980633
tags question: http://stackoverflow.com/q/26951293
tags question: http://stackoverflow.com/q/26982576
tags question: http://stackoverflow.com/q/26976377
tag name: google-maps-api-3
type: Tag
tags question: http://stackoverflow.com/q/26849146
tags question: http://stackoverflow.com/q/26936287
tags question: http://stackoverflow.com/q/26982533
tags question: http://stackoverflow.com/q/26877003
tags question: http://stackoverflow.com/q/26962897
tags question: http://stackoverflow.com/q/26856390
tags question: http://stackoverflow.com/q/26949103
tags question: http://stackoverflow.com/q/26975713
tags question: http://stackoverflow.com/q/26890514
tags question: http://stackoverflow.com/q/26904472

http://stackoverflow.com/comment/42288228
type: Comment
comment on: http://stackoverflow.com/a/26864121
score: 0
type: AnswerComment
has text: Ah, ok. That wasn't initially clear from the question, sorry. Updated my answer to further suit your requirement.

http://stackoverflow.com/q/26928323
score: 0
possible better answer: http://stackoverflow.com/a/26928991
answer count: 3
tagged with: javascript
has answer: http://stackoverflow.com/a/26930242
has body: We are using a RegExp replace to searching a text for terms and wrap the hits with . This works like a charm until we have a term that contains of several words that get wrapped and then a term that only has one of those words. For example: These are an example for one of these cases with the terms: "Human Design System", "Design". So our code first finds "Human Design System", wraps it with a tag and then finds "Design" within that and wraps that with an tag. The result becomes: Human Design System When we desire the result: Human Design System So what we need is a way of checking if the term is wrapped by a and simply skip the replace for these cases. This is the code we are using right now: //Definition of variables, please not that ~open~ is replaced by and ~close~ is replaced by later var TPL_TAG_OPEN = '~open~', TPL_TAG_CLOSE = '~close~', ESCAPERS = '[\\s!:\.\;,%\"\'\\(\\)\\{\\}]'; //This is the RegExp that prepares the content //term is the term that we are looking for and line is the text we are searching in var re = new RegExp("^("+term+")(" + ESCAPERS + ")", modifier); line = line.replace(re, TPL_TAG_OPEN + "$1" + TPL_TAG_CLOSE + "$2"); re = new RegExp("(" + ESCAPERS + ")("+term+")$", modifier); line = line.replace(re, "$1" + TPL_TAG_OPEN + "$2" + TPL_TAG_CLOSE); re = new RegExp("(" + ESCAPERS + ")("+term+")(" + ESCAPERS + ")", modifier); line = line.replace(re, "$1" + TPL_TAG_OPEN +"$2" + TPL_TAG_CLOSE + "$3"); Input: Human Design System Human Design Design Human Testar test Human Design Test Human Test Design Test Test Design Human Design System Test Human Design Result right now: Human Design System Human Design</dfn Design Human Testar test Human Design</dfn Test Human Test Design Test Test Design Human Design System Test Human Design Wanted Result: Human Design System Human Design Design Human Testar test Human Design Test Human Test Design Test Test Design Human Design System Test Human Design Note: We have succeeded to check if the term is wrapped b…
accepted answer: http://stackoverflow.com/a/26933670
tagged with: regex
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26928991
has answer: http://stackoverflow.com/a/26933670
has title: RegExp replace only if not within and
type: Question
tagged with: replace

http://stackoverflow.com/q/26885811
has title: Calling c# from JS via button
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42326349
has comment: http://stackoverflow.com/comment/42327437
score: 0
has comment: http://stackoverflow.com/comment/42326687
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has body: So what I want to do is click on a button which will cause JS code to run which will cause another button to click and button #2 will be runat="server" and cause a C# function to run onClick. But using the below does not cause the C# function to run even though simply clicking the button2 does cause it to run. function button1_click() { document.getElementById('button2').click(); __doPostBack('#button2', 'onclick'); $('#button2').trigger('click'); // neither worked (tried them seperately) } &lt;asp:Button runat="server" Visible="true" text="you should not see this" ClientIDMode="Static" ID="button2" onclick="button2_Click" formnovalidate /&gt; Useful knowledge: - button one is in a client form - button two is in a runat="server" form
tagged with: c#
has comment: http://stackoverflow.com/comment/42326901
has comment: http://stackoverflow.com/comment/42327619
has comment: http://stackoverflow.com/comment/42328120
type: Question
has answer: http://stackoverflow.com/a/26889350

http://stackoverflow.com/comment/42498531
type: QuestionComment
score: 0
has text: @Uby and when it come to retrieving the parameter will it have to be iterated through a loop as individual array values??
comment on: http://stackoverflow.com/q/26982083
type: Comment

http://stackoverflow.com/comment/42391654
has text: @RobG how do I set its `this`?
score: 0
comment on: http://stackoverflow.com/q/26921759
type: Comment
type: QuestionComment

jquery-ui
tags question: http://stackoverflow.com/q/26942416
tags question: http://stackoverflow.com/q/26938818
tags question: http://stackoverflow.com/q/26944421
tags question: http://stackoverflow.com/q/26889186
tags question: http://stackoverflow.com/q/26865576
tags question: http://stackoverflow.com/q/26970730
tags question: http://stackoverflow.com/q/26912607
tags question: http://stackoverflow.com/q/26938282
tags question: http://stackoverflow.com/q/26880189
tags question: http://stackoverflow.com/q/26908864
tags question: http://stackoverflow.com/q/26895469
tags question: http://stackoverflow.com/q/26879012
tags question: http://stackoverflow.com/q/26911215
tags question: http://stackoverflow.com/q/26880624
tags question: http://stackoverflow.com/q/26874929
tags question: http://stackoverflow.com/q/26898051
tags question: http://stackoverflow.com/q/26882039
tags question: http://stackoverflow.com/q/26844081
tags question: http://stackoverflow.com/q/26936300
tags question: http://stackoverflow.com/q/26860449
tags question: http://stackoverflow.com/q/26889988
tags question: http://stackoverflow.com/q/26837399
tags question: http://stackoverflow.com/q/26843740
tags question: http://stackoverflow.com/q/26897596
tags question: http://stackoverflow.com/q/26844367
tags question: http://stackoverflow.com/q/26984071
tags question: http://stackoverflow.com/q/26915915
tags question: http://stackoverflow.com/q/26875020
tags question: http://stackoverflow.com/q/26973188
tags question: http://stackoverflow.com/q/26842620
tags question: http://stackoverflow.com/q/26877020
tags question: http://stackoverflow.com/q/26897004
type: Tag
tags question: http://stackoverflow.com/q/26847906
tags question: http://stackoverflow.com/q/26847558
tags question: http://stackoverflow.com/q/26874210
tag name: jquery-ui
tags question: http://stackoverflow.com/q/26843489
tags question: http://stackoverflow.com/q/26964692
tags question: http://stackoverflow.com/q/26838598
tags question: http://stackoverflow.com/q/26851439

http://stackoverflow.com/q/26932032
has body: I have this peice of javascript: &lt;script&gt; var reg = "website.com"; var mob = "website.com/m"; if(window.innerWidth &gt;= 1024) { if(window.location.href != reg) window.location.replace("http://" + reg + window.location.pathname + window.location.search) } else { if(window.location.href != mob) window.location.replace("http://" + mob + window.location.pathname + window.location.search) } &lt;/script&gt; When I run this, it keeps reloading the page - Any ideas how this can be sorted out?
has title: Javascript Redirect Not Going To Correct URL
type: Question
has answer: http://stackoverflow.com/a/26933064
tagged with: javascript
has comment: http://stackoverflow.com/comment/42409049
score: 0
answer count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26932091
has comment: http://stackoverflow.com/comment/42409037

http://stackoverflow.com/q/26872770
favorite count: 0
type: UnansweredQuestion
upvote count: 4
tagged with: local-storage
tagged with: node.js
tagged with: wkhtmltopdf
answer count: 0
downvote count: 0
has comment: http://stackoverflow.com/comment/77395095
type: Question
has title: Wkhtmltopdf local storage dependency
tagged with: javascript
score: 4
has body: I have dependency of local storage while generating the PDF from our application URL. I am using following code: var wkhtmltopdf = require('wkhtmltopdf'); wkhtmltopdf( 'http://localhost:8081/ui/main/app/home.html#/analytics/student-report', { noStopSlowScripts:true, javascriptDelay:5000, viewportSize: '1280x1024', output: 'out3.pdf', orientation:'Landscape' }, function (code, signal) { return callback(null,{code:code,signal:signal}) } ); Is there any way to simulate local storage.

ruby-on-rails-4
type: Tag
tags question: http://stackoverflow.com/q/26981370
tags question: http://stackoverflow.com/q/26947879
tags question: http://stackoverflow.com/q/26834799
tags question: http://stackoverflow.com/q/26926016
tags question: http://stackoverflow.com/q/26921940
tags question: http://stackoverflow.com/q/26896565
tags question: http://stackoverflow.com/q/26866810
tags question: http://stackoverflow.com/q/26904511
tags question: http://stackoverflow.com/q/26919860
tags question: http://stackoverflow.com/q/26948288
tags question: http://stackoverflow.com/q/26954898
tags question: http://stackoverflow.com/q/26938130
tags question: http://stackoverflow.com/q/26941962
tag name: ruby-on-rails-4
tags question: http://stackoverflow.com/q/26917358
tags question: http://stackoverflow.com/q/26897874

http://stackoverflow.com/comment/42413681
type: Comment
has text: And I can't seem to access the element. I have got the form, look through the fields, but no $XpageAlt. See above for code.
comment on: http://stackoverflow.com/a/26934176
type: AnswerComment
score: 0

http://stackoverflow.com/comment/42238698
comment on: http://stackoverflow.com/q/26833922
type: Comment
score: 0
type: QuestionComment
has text: @torazaburo And it does have to do with the DOM because JavaScript's execution in a web page runs in the same place as the DOM. So if you task the page to parse a giant JavaScript object (a dictionary in this case), the DOM freezes until the array is finished loading (which is a big no-no).

http://stackoverflow.com/comment/42437899
comment on: http://stackoverflow.com/a/26946878
type: Comment
score: 0
type: AnswerComment
has text: Thanks @olly. I read filters are faster than match. Is there any way to use filters?

http://stackoverflow.com/a/26843639
downvote count: 0
upvote count: 3
has body: i get error why this is so Because the object returned by the jQuery constructor doesn't have selectedIndex or options properties. $('selector') creates a jQuery collection out of matches in the DOM whereas document.getElementId('selector') is a reference to a specific DOM element. $('selector') contains a reference to the DOM element, but doesn't have DOM element properties/methods, instead it has jQuery methods. To use DOM element properties/methods, you can 'get' the DOM element from the jQuery collection using square bracket notation, since our jQuery collection is an array-like object: var x = $("#mySelect")[0].selectedIndex; var y = $("#mySelect")[0].options; Or, using .get(): var x = $("#mySelect").get(0).selectedIndex; var y = $("#mySelect").get(0).options; Or, return a property value using .prop(): var x = $("#mySelect").prop('selectedIndex'); var y = $("#mySelect").prop('options');
answers question: http://stackoverflow.com/q/26843566
type: Answer
score: 3

http://stackoverflow.com/a/26956700
answers question: http://stackoverflow.com/q/26956646
has body: use for this a jQuery plugin - Date and Time picker Example html: &lt;input type="text" name="date" class="datepicker"&gt; javascript: $('.datepicker').datetimepicker({ mask:'39-19-9999 29:59:59', format:'d-m-Y H:i:s' });
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42457680
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/26956646

http://stackoverflow.com/q/26868667
has answer: http://stackoverflow.com/a/26868831
has title: Replace special characters different variables
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26868913
type: Question
tagged with: google-apps-script
has comment: http://stackoverflow.com/comment/42298646
tagged with: javascript
score: 0
has body: I'm trying to put together firstname + lastname into an email address, and it works, but I need to replace special characters in firstname and lastname or in the finished variable emailad: function CreateEmailAddress(){ var ss = SpreadsheetApp.getActiveSpreadsheet(), sheet = ss.getActiveSheet(), range = sheet.getDataRange(), values = range.getValues(); for (var r=1; r&lt;values.length; r++) { var row = values[r], firstname = row[0], lastname = row[1], email = row[2]; if(email != "nodata" ){ var emailad = (firstname + "." + lastname + "@superenterprisecompany.com"); Logger.log(emailad); sheet.getRange(1 + r, 3).setValue(emailad); } } } I found this, but do not know how to get it to work with my variables function convert_accented_characters(str){ var conversions = new Object(); conversions['ae'] = 'ä|æ|ǽ'; conversions['oe'] = 'ö|œ'; conversions['ue'] = 'ü'; conversions['Ae'] = 'Ä'; conversions['Ue'] = 'Ü'; conversions['Oe'] = 'Ö'; conversions['A'] = 'À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ'; conversions['a'] = 'à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª'; conversions['C'] = 'Ç|Ć|Ĉ|Ċ|Č'; conversions['c'] = 'ç|ć|ĉ|ċ|č'; conversions['D'] = 'Ð|Ď|Đ'; conversions['d'] = 'ð|ď|đ'; conversions['E'] = 'È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě'; conversions['e'] = 'è|é|ê|ë|ē|ĕ|ė|ę|ě'; conversions['G'] = 'Ĝ|Ğ|Ġ|Ģ'; conversions['g'] = 'ĝ|ğ|ġ|ģ'; conversions['H'] = 'Ĥ|Ħ'; conversions['h'] = 'ĥ|ħ'; conversions['I'] = 'Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ'; conversions['i'] = 'ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı'; conversions['J'] = 'Ĵ'; conversions['j'] = 'ĵ'; conversions['K'] = 'Ķ'; conversions['k'] = 'ķ'; conversions['L'] = 'Ĺ|Ļ|Ľ|Ŀ|Ł'; conversions['l'] = 'ĺ|ļ|ľ|ŀ|ł'; conversions['N'] = 'Ñ|Ń|Ņ|Ň'; conversions['n'] = 'ñ|ń|ņ|ň|ŉ'; conversions['O'] = 'Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ'; conversions['o'] = 'ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º'; conversions['R'] = 'Ŕ|Ŗ|Ř'; conversions['r'] = 'ŕ|ŗ|ř'; conversions['S'] = 'Ś|Ŝ|Ş|Š'; conversions['s'] = 'ś|ŝ|ş|š|ſ'; conversions['T'] = 'Ţ|Ť|Ŧ'; conversions['t'] = 'ţ|ť|ŧ'; conversions['U'] = 'Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ'; conversions['u'] = 'ù|ú|û|ũ|ū|ŭ|ů|…
answer count: 3
has answer: http://stackoverflow.com/a/26868913
possible better answer: http://stackoverflow.com/a/26868975
has answer: http://stackoverflow.com/a/26868975

http://stackoverflow.com/comment/42421586
comment on: http://stackoverflow.com/q/26938290
score: 0
type: Comment
type: QuestionComment
has text: can return the ajax promise from your functions or add a callback argument that passes to their success callbacks

http://stackoverflow.com/comment/42429545
has text: Well, still, when you set the datatype to jsonp it's already parsed, `JSON.parse` probably gets you an error. Learn how to use the console (F12).
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/26943198

http://stackoverflow.com/comment/48224073
type: QuestionComment
comment on: http://stackoverflow.com/q/26871148
score: 0
has text: possible duplicate of [Simplest SOAP example](http://stackoverflow.com/questions/124269/simplest-soap-example)
type: Comment

http://stackoverflow.com/q/26881751
has body: Basically the code will generate a french word, The code will then generate a select menu with 6 english words. The user then guesses what is the correct translation! What I'm trying to do now is gather the users guessed and the correct to go with that guess into parralel arrays so I can then display there guesses (with the correct answer next to it) at the end of the code. I've partly got it too work, It will store the first and only the first select menu option and answer into each of the arrays, It will not store the next 5 questions Please check my latest fiddle, Observe that it will store the first q and a. http://jsfiddle.net/jamesw1/w8p7b6p3/8/ So basically only the first French word, English translation and the first Guess they made will store into the array. HTML: James' Translation Guessing Game Guess what the generated french word translates to in English! Question # Check James Wainwright Javascript: var RanNumbers = new Array(6), foreignWords = ['un', 'deux', 'trois', 'quatre', 'cinq', 'six', 'sept', 'huit', 'neuf', 'dix', 'onze', 'douze', 'treize', 'quatorze', 'quinze', 'seize', 'dix-sept', 'dix-huit', 'dix-neuf', 'vingt', 'vingt et un', 'vingt-deux', 'vingt-trois', 'vingt-quatre', 'vingt-cinq', 'vingt-six', 'vingt-sept', 'vingt-huit', 'vingt-neuf', 'trente'], translate = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen', 'twenty', 'twenty-one', 'twenty-two', 'twenty-three', 'twenty-four', 'twenty-five', 'twenty-six', 'twenty-seven', 'twenty-eight', 'twenty-nine', 'thirty'], number = Math.floor((Math.random() * 30)), output = '', correctAns = translate[number]; //Generate random numbers to pick the available answers function wordGen() { for (var h = 0; h < RanNumbers.length; h++) { var temp = 0; do { temp = Math.floor(Math.random() * 30); } while (RanNumbers.indexOf(temp) > -1); RanNumbers[h] = temp; } } //Call the previou…
type: Question
has answer: http://stackoverflow.com/a/26882624
tagged with: javascript
has comment: http://stackoverflow.com/comment/42319645
score: 0
has comment: http://stackoverflow.com/comment/42319667
has comment: http://stackoverflow.com/comment/42319603
answer count: 1
has title: Gather my users selections from a select menu aswell as the correct answer
has comment: http://stackoverflow.com/comment/42319451
has comment: http://stackoverflow.com/comment/42320368
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42319526

http://stackoverflow.com/a/26920729
type: Answer
accepted answer of: http://stackoverflow.com/q/26920533
score: 2
downvote count: 0
has body: The first column in your data array is a timestamp - the reason nothing is appearing on your updated graph is that you've adjusted the x-axis range but the timestamps are outside of this new range. To make the time values more readable you could change it to something like this: $(function () { $('#container').highcharts({ chart: { zoomType: 'x' }, xAxis: { type: 'datetime', tickInterval: 3600 * 1000, min: Date.UTC(2014,11,14), max: Date.UTC(2014,11,15), }, series: [{ data: [ [Date.UTC(2014,11,14, 0, 0, 0), 1], [Date.UTC(2014,11,14, 8, 0, 0), 3], [Date.UTC(2014,11,14, 16, 0, 0), 2] ], pointStart: Date.UTC(2014,11,14), pointInterval: 24 * 3600 * 1000 // one day }] }); });
upvote count: 2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26920533

http://stackoverflow.com/a/26999072
has comment: http://stackoverflow.com/comment/42572093
type: AcceptedAnswer
downvote count: 0
has body: <?php if($this->config->get('config_store_id') == 1) { if (!$logged) { $this->redirect('https://wholesale.garrysun.com/index.php?route=account/login'); } else if ( $this->customer->getCustomerGroupId() == '1' ) { ?> <?php $this->customer->logout(); echo " ;" } } ?> Hope this works for you, however I have not de bugged it.
type: Answer
has comment: http://stackoverflow.com/comment/42546685
has comment: http://stackoverflow.com/comment/42576814
accepted answer of: http://stackoverflow.com/q/26921040
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/26921040

http://stackoverflow.com/q/26949870
has answer: http://stackoverflow.com/a/26950031
tagged with: php
type: AnsweredQuestion
downvote count: 0
score: 1
has title: javascript not diplaying innerHTML
tagged with: forms
type: Question
tagged with: validation
answer count: 1
tagged with: javascript
favorite count: 0
upvote count: 1
accepted answer: http://stackoverflow.com/a/26950031
has body: ok I have been trying to figure this out now for 2 days and it just doesn't make any sense to me. so I have a registration form username, email, password and re-enter password. each input has JavaScript that on every keyup sends the users input to php where it validates it and will display "Good" in a div below password the div is "password_feedback"(this all works fine ,if I type in a valid password it will display "good" in the "password-feedback" div) then I have JavaScript check to see what's in the "password_feedback". an "if statement" will display "good" in the "check2" div if "password_feedback" == "Good" else it displays "bad". but this doesn't work it will always display "bad". now here is the strange part I do the same for all 4 inputs ( re-enter password doesn't go to php just java) and "username" and "re-enter password" both work, email and password do not. if I change var password_good = document.getElementById('password_feedback').innerHTML; to var password_good = document.getElementById('feedback').innerHTML; (username feedback instead of password feedabck) then it will work for username. again the "password_feedback" will display "Good" like it should so that works. in the javascript if I replace all the passwords information with the username information it will works so I know ity works fine. I cant even speculate why this doesn't work for password but does for username. iv tried everything I can think of, I have reduced the page so it only validates password. maby somebody out there knows something I don't. Username: E-mail: Password: Re-enter Password: $connect = mysqli_connect("localhost", "????", "????","?????"); if (mysqli_connect_errno()){ echo "failed" . mysqli_connect_error(); } $password = mysqli_real_escape_string($connect, $_POST['password']); $check = mysqli_query($connect,"SELECT password FROM users WHERE password='$password'"); $check_num_rows = mysqli_num_rows($check); if ($password==NULL) echo "enter a password"; else if( preg_matc…

http://stackoverflow.com/q/26888831
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/42358110
accepted answer: http://stackoverflow.com/a/26904446
type: AnsweredQuestion
downvote count: 0
has title: Setting data row primary ID in TR ID for JQUERY Datatables
score: 1
has answer: http://stackoverflow.com/a/26904446
type: Question
tagged with: asp.net-mvc
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42349231
upvote count: 1
tagged with: datatables
answer count: 1
has body: I'm using ASP.Net MVC and trying to set the datasource rowID value in each TR #ID attribute. Problem is I'm getting table id=myDataTable - Requested unknown parameter '1' for row 0. the controller returns: var jsonSerialiser = new JavaScriptSerializer(); var json = jsonSerialiser.Serialize(List); return Json(new { sEcho = param.sEcho, iTotalRecords = result.Count, iTotalDisplayRecords = 10, aaData = json }, JsonRequestBehavior.AllowGet); and List is a list of: public class MyObj { public string DT_RowId {get;set;} public string NumeLocatie {get;set;} } DataTables initializer is: oSesizariTable = $('#myDataTable').dataTable({ "scrollY": "600px", "scrollCollapse": true, "scrollX": true, "bServerSide": true, "sAjaxSource": "ControlSLA/AjaxHandler", "bProcessing": true, "aoColumnDefs": [ { "width": "30", "class": "details-control", "orderable": false, "mdata": null, "defaultContent": "", "targets": 0 }, { "targets": 1, "width": "30", "mdata": "NumeLocatie" },], "fnServerData": function (sSource, aoData, fnCallback) { aoData.push({ "name": "DeLa", "value": $('#sesizariDeLa').val() }); aoData.push({ "name": "La", "value": $('#sesizariLa').val() }); $.getJSON(sSource, aoData, function (json) { fnCallback(json) }); } }); $("#Refresh").click(function (e) { oSesizariTable.fnDraw(); }); I've just started with ASP.Net and MVC... I can't get to the bottom of this!!! Data sent from controller is: { draw = 1, recordsTotal = 2, recordsFiltered = 10, data = "[[\"DT_RowId\":\"ses_35335\",\"NumeLocatie\":\"Galati 1_\"],[\"DT_RowId\":\"ses_35342\",\"NumeLocatie\":\"3 Craiovei\"]]" } and now the error is: table id=myDataTable - Requested unknown parameter 'NumeLocatie' for row 0 After I click OK at the error prompt, the table shows every letter in the data in 1 row.

http://stackoverflow.com/comment/42282782
comment on: http://stackoverflow.com/q/26861129
score: 0
type: Comment
type: QuestionComment
has text: The way you've used `ng-repeat` will give you a new `ul` for every item, which will contain a single `li`. I assume you intended for 1 `ul` with multiple `li`s?

http://stackoverflow.com/comment/42377858
comment on: http://stackoverflow.com/q/26911842
score: 0
type: Comment
type: QuestionComment
has text: I'm getting the "web" href value from the follow user agents Mozilla/5.0 (Windows NT 6.1; rv:33.0) Gecko/20100101 Firefox/33.0 Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:32.0) Gecko/20100101 Firefox/32.0 Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko Interestingly both have the same referrer http://www.google.com/url?sa=t

http://stackoverflow.com/comment/42475176
score: 0
type: Comment
type: QuestionComment
has text: I think you should read again what an AngularJs controller is. That function you defined is used as a constructor
comment on: http://stackoverflow.com/q/26969425

http://stackoverflow.com/a/26918784
type: Answer
score: 2
upvote count: 2
has body: http://jsfiddle.net/73geyvwd/1/ - working fiddle Two main issues. 1.) You aren't setting a default "activeImg" element. &lt;div class="thisImg activeImg"&gt; 2.) Your .prev() and .next() methods need to include a .thisImg class selector, since you have other elements at a sibling level. var nextImg = currentImg.next(".thisImg"); var prevImg = currentImg.prev(".thisImg");
answers question: http://stackoverflow.com/q/26918447
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26918447

http://stackoverflow.com/comment/42342821
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26890273
type: Comment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/64811/discussion-between-mrberggg-and-bebraw).

http://stackoverflow.com/a/26899612
answers question: http://stackoverflow.com/q/26899588
type: Answer
has comment: http://stackoverflow.com/comment/42351940
upvote count: 4
accepted answer of: http://stackoverflow.com/q/26899588
downvote count: 0
score: 4
has body: Wrap it in an immediately-invoked function expression: javascript:(function (){ window.onclick = function () { alert( "Hi" ); } }());
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42352675

http://stackoverflow.com/q/26898556
favorite count: 0
has comment: http://stackoverflow.com/comment/53497032
type: Question
tagged with: plugins
has body: I have a custom js file as part of my wordpress installation, which is registered and enqueued using functions.php as normal. I have registered this particular script to load within wp_footer rather than within wp_header. However, I also have a plugin that is putting js into wp_footer, and by default it is loading this below my script. I need to force my script to load last. Is there soemthing simple that can be done to achieve this? It seems like something fairly routine to me? Here is my code: function scripts() { // Register scripts // js wp_register_script('custom', get_bloginfo('template_url'). '/js/custom.js', false, false, true); // Enqueue scripts wp_enqueue_script('custom'); } add_action('wp_enqueue_scripts', 'scripts'); The current order of the scripts goes, but I need to force my script to load after the plugin: Thanks in advance!
upvote count: 3
tagged with: wordpress
answer count: 1
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26898816
score: 3
downvote count: 0
has title: Wordpress force scripts to load after plugins

http://stackoverflow.com/a/26910090
score: 3
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/42400398
has body: Floating point is notoriously tricky. Basically it boils down to that there are an infinite amount of values between two real numbers, so it is impossible to represent them correctly in a computer. If you want to print the number i suggest: total.toFixed(); Which will always give you three decimal places. And when you want to check if two floats are the same you need to do something like this: function nearlyEqual(a, b, epsilon) { var absA = Math.abs(a); var absB = Math.abs(b); var diff = Math.abs(a - b); var minNormal = 1.1754943508222875e-38; if (a == b) { // shortcut, handles infinities return true; } else if (a == 0 || b == 0 || diff &lt; minNormal) { // a or b is zero or both are extremely close to it // relative error is less meaningful here return diff &lt; (epsilon * minNormal); } else { // use relative error return diff / (absA + absB) &lt; epsilon; } } nearlyEqual(0.1+0.2, 0.3, 0.0001); As is suggested here How should I do floating point comparison?
accepted answer of: http://stackoverflow.com/q/26909128
has comment: http://stackoverflow.com/comment/42393937
answers question: http://stackoverflow.com/q/26909128

http://stackoverflow.com/a/37213926
type: Answer
score: 4
answers question: http://stackoverflow.com/q/26918164
upvote count: 4
downvote count: 0
has body: The accepted answer works fine when there is only one select list, but fails when there are more. Here is a way you can accomplish the same thing using any number of select filters. Select a Material Plastic Glass var selectFilterValues = { material: '', otherSelectListName: '' }; $('.select-filter').change(function() { var selection = this.value, name = $(this).attr('name'); selectFilterValues[name] = selection; featureList.filter(function(item) { var values = item.values(), matches = 0, length = 0; $.each(selectFilterValues, function(key, val) { length++; if (values[key].trim() == val || val === '') { matches++; } }); return (matches === length); }); });

http://stackoverflow.com/q/26882317
tagged with: javascript
favorite count: 0
has body: I'm kinda stuck right now in making the website of the company I'm working for. I'm making a timeline for the company activities. Here's my problem: I can't seem to trigger the hover effect on both the image and the text unless I hover only on the image itself. Here's where I am right now with my HTML: 2014 ACTIVITY INFORMATION HERE ACTIVITY INFORMATION HERE ACTIVITY INFORMATION HERE ACTIVITY INFORMATION HERE ACTIVITY INFORMATION HERE ACTIVITY INFORMATION HERE Here's my css: Hope you guys can help me with this. Thanks!
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/26882647
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/42320463
score: 1
has title: No simultaneous hover effect on image and selected item
downvote count: 0
answer count: 1

http://stackoverflow.com/q/26896487
tagged with: loops
downvote count: 1
possible better answer: http://stackoverflow.com/a/38334248
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/38334248
tagged with: javascript
has answer: http://stackoverflow.com/a/70830133
has answer: http://stackoverflow.com/a/73641986
type: Question
has answer: http://stackoverflow.com/a/26896521
has answer: http://stackoverflow.com/a/26896954
has answer: http://stackoverflow.com/a/61856250
has comment: http://stackoverflow.com/comment/42346320
favorite count: 0
accepted answer: http://stackoverflow.com/a/26896521
answer count: 9
has answer: http://stackoverflow.com/a/26896535
has body: I am teaching myself code and am trying to solve this problem: Write a loop that loops through nums, if the item is even, it adds it to the evens array, if the item is odd, it adds it to the odds array. This is what I have so far: var nums = [1,2,34,54,55,34,32,11,19,17,54,66,13]; var evens = []; var odds = []; var evenNumbers = function(nums) { for (var i = 0; i &lt; nums.length; i++) { if ((nums[i] % 2) != 1) { evens.push(nums[i]); console.log(evens); } else { odds.push(nums[i]); console.log(odds); } } }; alert(evens); alert(odds); They don't return anything and I'm not sure where I'm going wrong, any help would be much appreciated.
has answer: http://stackoverflow.com/a/70946163
upvote count: 2
has title: loop through array, returns odd and even numbers
score: 1
has answer: http://stackoverflow.com/a/58291619

http://stackoverflow.com/q/26870735
has body: I'm working on a script which is hiding and showing some divs after some time. Here is my complete jQuery code: &lt;script type="text/javascript"&gt; $.noConflict(); jQuery(document).ready(function($){ $("#SuperWebF1").click(function(){ if ($('[name="shipping_method"]', window.parent.document).is(':checked')){ billing.save(); $("#LoadingDiv", window.parent.document).show().delay(4300).fadeOut(); $("#OutDiv", window.parent.document).hide().delay(5000).fadeIn(); $('#OutDiv', window.parent.document).removeClass('outerdiv'); $('#OutDiv', window.parent.document).removeClass('outerdivNoAdress'); setTimeout(function() { if( $('#DisplayMe').length ){ $('#OutDiv', window.parent.document).addClass('OuterDiv1000'); } else { $('#OutDiv', window.parent.document).addClass('OuterDiv1000No'); } }, 5100); $('#InnerIframe', window.parent.document).removeClass('FrameCSS'); $('#InnerIframe', window.parent.document).removeClass('FrameCSSNoAdress'); $('#InnerIframe', window.parent.document).addClass('FrameCSS1000'); }else { alert('Моля, изберете начин на доставка!'); } }) }); &lt;/script&gt; The problem is in that line: $("#OutDiv", window.parent.document).hide().delay(5000).fadeIn(); After it hides the div with the line of code abouve this one it seems this line of code is not showing back the #OutDiv element. I can confirm that i have this problem only with Firefox Mozilla. Tested on Firefox on Windows and Linux and in the both places i have this problem. Both browsers are up to date. Do you have any suggestions?
has comment: http://stackoverflow.com/comment/42300215
score: 2
downvote count: 0
type: Question
has title: jQuery - fadeIn not working only in Firefox
tagged with: firefox
tagged with: javascript
upvote count: 2
answer count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/26870813
type: UnansweredQuestion

http://stackoverflow.com/a/26924734
has comment: http://stackoverflow.com/comment/42396428
has comment: http://stackoverflow.com/comment/42431709
upvote count: 1
has comment: http://stackoverflow.com/comment/42463059
has comment: http://stackoverflow.com/comment/42431738
answers question: http://stackoverflow.com/q/26924624
has comment: http://stackoverflow.com/comment/42396490
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/42427695
has comment: http://stackoverflow.com/comment/42399249
has body: Try the following: $(function() { $('input[type="checkbox"]') .on('change', checkboxChange) // do it when you change the checkbox .each(checkboxChange); // as well as once when the page loads function checkboxChange() { var $checkbox = $(this); $('input[name="' + $checkbox.attr('value') + '"]').prop('disabled', !$checkbox.prop('checked')); } }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;form name=registration&gt; &lt;table border=1&gt; &lt;tr&gt; &lt;td&gt; &lt;input type='checkbox' id='c1' name=selcourse value='2-PM-030' onChange="enabledSDF(1,this.value);"&gt;Microsoft Project 2013&lt;/td&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;td&gt; &lt;input type=radio id=cd name='2-PM-030' value='Dec 11-12'&gt;Dec 11-12&lt;/td&gt; &lt;td&gt; &lt;input type=radio id=c1d1 name='2-PM-030' value='Jan 26-27'&gt;Jan 26-27&lt;/td&gt; &lt;td&gt;&amp;nbsp;&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;input type='checkbox' id='c2' name=selcourse value='2-PM-050'&gt;Microsoft Project 2010&lt;/td&gt; &lt;td&gt; &lt;input type=radio id=c2d1 name='2-PM-050' value='Nov 24-25'&gt;Nov 24-25&lt;/td&gt; &lt;td&gt; &lt;input type=radio id=c2d2 name='2-PM-050' value='Dec 18-19'&gt;Dec 18-19&lt;/td&gt; &lt;td&gt; &lt;input type=radio id=c2d3 name='2-PM-050' value='Jan 29-30'&gt;Jan 29-30&lt;/td&gt; &lt;td&gt;&amp;nbsp;&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; &lt;/form&gt; EDIT: If not linked by common attribute value If the radio buttons don't have the same name as the value of the checkbox that is meant to disable them, then you would need to traverse from the checkbox that was changed to the &lt;tr&gt; that contains them, then find the radio buttons within that. To do that, just change my checkboxChange() function as follows. function checkboxChange() { var $checkbox = $(this); $checkbox.closest('tr').find(…
score: 1

http://stackoverflow.com/q/26924827
has answer: http://stackoverflow.com/a/26925112
type: Question
score: 0
has body: I found a similar question for this same assignment but that person was using a different type of loops. I have been struggling with this assignment and even with the teacher giving me pseudo code to try to explain it further I am still having difficulties with it writing out what it's supposed to in the end. We are supposed to create an array that holds the price of theater tickets, then make a html table that has the different level of tickets and prices that correspond with the numbers in the array. After this we prompt the user for their name and validate that they did enter something. Then we are supposed to create a function named numSeats that prompts the user for the number of seats that they want to buy and validate that they entered a number and the maximum number of seats they can buy in one transaction is 6. We are supposed to use a loop to prompt the user until they enter a valid number, then create a function named seatingChoice that prompts the user for where they would like the seats to be by indicating the correct number from the table. seartingChoice also needs to validate that they entered a number 1-4 and use a loop to prompt the user until they enter a valid number. If the user at any time hits the cancel button in a prompt we are supposed to give an alert of "Sorry you changed your mind". This is missing from my code because i haven't figured out how to do that. When the program calculates everything and writes to the screen in the end it is supposed to write like "UsersName ordered #tickets for a total of dollaramt" but instead it writes "Null ordered null tickets for a total of $null." The following is what i have the the javascript part of the code: var Prices = [60, 50, 40, 30]; var Usersname = prompt("Please enter your name"); while(Usersname = null) { Usersname = prompt("Please enter your name"); } function numSeats () { var seats = prompt("Please enter the number of seats you want to buy"); parseInt(seats); while((seats = null)||(seats &…
answer count: 3
tagged with: loops
possible better answer: http://stackoverflow.com/a/26925116
linked to: http://stackoverflow.com/q/6962718
has answer: http://stackoverflow.com/a/26925116
has answer: http://stackoverflow.com/a/26925144
accepted answer: http://stackoverflow.com/a/26925144
has comment: http://stackoverflow.com/comment/42396447
has title: Javascript Functions with loops assignment
type: AnsweredQuestion
tagged with: function
tagged with: validation
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/42396812

http://stackoverflow.com/comment/42435634
type: QuestionComment
score: 1
has text: Vohuman, could you link me to some documentation on "live" objects? I can't find anything and really need to access the values that show up in the first log.
comment on: http://stackoverflow.com/q/26946535
type: Comment

http://stackoverflow.com/q/26874662
has body: I know this kind of post is frequently found on internet. But my problem is a little bit more dificult and I did not find an answer. I want to make an associative array in Javascript in a loop with a variable name. ($JJ = table of object) ($JJ->getResto($DB,$acad) allows me to recover my database datas) $JJ = new RestaU(); $JJ = $JJ-&gt;getResto($DB,$acad); for ($i = 0; $i &lt;= sizeof($JJ)-1; $i++) { //Datas recovering $lat = $JJ[$i]-&gt;loc_lat; $long = $JJ[$i]-&gt;loc_long; $name = $JJ[$i]-&gt;nom; $ville = $JJ[$i]-&gt;ville; //String treatment to avoid spaces $ville = str_replace(" ","",$ville); $name = str_replace(" ","",$name); echo &lt;&lt;&lt; SC &lt;script&gt; //here $ville will contain an google map object associated to the ville name. //It means that I need to change it for each "for" loop. var $ville = new Object(); //that is why here I need to have $ville["name"] to generate a table for each city //and have an access to it later. $ville+["name"] = new google.maps.LatLng($lat,$long); console.log(string2); &lt;/script&gt; SC; My problem is, I can not find the solution to right for example ville1["name"]. Each time the code is not "interpreted" it means I can have the string but it does not create my array. Thank you a lot for all your ideas! SOLUTION IN COMMENT. I used that : var string = "$ville"; window[string]["name"] = "blabla"; It works really well.
has answer: http://stackoverflow.com/a/26874783
has title: PHP variable as Javascript variable name
has comment: http://stackoverflow.com/comment/42309179
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/42307578
favorite count: 0
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/42307262
has comment: http://stackoverflow.com/comment/42307257
has comment: http://stackoverflow.com/comment/42307096
score: 1
linked to: http://stackoverflow.com/q/23740548
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/42307505
has comment: http://stackoverflow.com/comment/42307332
has comment: http://stackoverflow.com/comment/42307144
tagged with: javascript
has comment: http://stackoverflow.com/comment/42309613

http://stackoverflow.com/q/26919425
score: 0
tagged with: datetime
tagged with: node.js
tagged with: timezone
accepted answer: http://stackoverflow.com/a/26919917
type: AnsweredQuestion
has title: Comparing client and server times
has answer: http://stackoverflow.com/a/26919917
has body: I have a Node.js server that queries an API to receive a set of times like this: { "end": "2014-05-24T14:00:00.000Z", "start": "2014-05-24T11:00:00.000Z" } The client's browser makes AJAX GET requests to the server, passing in the client's local time in ms: // ajax code data: { localTime: (new Date()).getTime() } // more ajax code I want to compare to the time that the server receives and check whether it lies within the interval defined by the API's events. The data returned by the API define events on the east coast, and when I pass these strings into the Date constructor they are parsed into the Eastern timezone. The issue arises because of Daylight time savings, and the fact that the client could be in a different timezone than the server or EST. I've become pretty confused trying to convert all of the times to the same timezone, so I'm really not sure how I should go about doing this in the most reliable way. Any help is greatly appreciated!
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/26859859
score: 1
has title: Highcharts reflow() after moving Y Axis to the opposite side
type: Question
answer count: 1
tagged with: highcharts
downvote count: 0
tagged with: javascript
has body: I have a Highcharts chart with two YAxes. One of them is opposite. At some point (after button click()) the opposite axis' side is changed to normal with this: $('#btn').click(function(){ chart_1.axes[2].opposite = false; chart_1.axes[2].isDirty = true; chart_1.isDirtyBox = true; chart_1.reflow(); }); JSFiddle with full example is here It doesn't work as expected though... Am I missing something?
has answer: http://stackoverflow.com/a/26861969
favorite count: 0
upvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26861969

http://stackoverflow.com/a/26834354
has body: You should always keep private information out of your repo. Use environment variables for keys and passwords. $ MYKEY=abcdefg node app.js Then in your script var MYKEY = process.env.MYKEY; You can also setup a script to launch your app with your keys in environment variables. #!/bin/bash export MYKEY=abcdef node app.js
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/26834288
answers question: http://stackoverflow.com/q/26834288
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/26898621
upvote count: 2
type: Question
tagged with: javascript
has body: I don't know if it has always been like that in Safari, but I'm having a problem with the mousemove event in Safari that works just well in Chrome (and FF). With the following code : document.addEventListener('mousemove', function(e) { console.log(e); }) Chrome returns something like that: But Safari only gives me that: Do you have any idea why? Thank you!
tagged with: mousemove
downvote count: 0
has title: Safari 8.0 (Yosemite) returns nothing on mousemove
favorite count: 0
type: UnansweredQuestion
tagged with: safari
score: 2
answer count: 0

http://stackoverflow.com/a/26969572
accepted answer of: http://stackoverflow.com/q/26969254
downvote count: 0
score: 1
has body: A good way to handle AJAX responses is to use JSON. It will allow you to send multiples data and do a redirect or show message depending of AJAX result. In PHP you can use json_encode() to convert and array to JSON. $arg = $_POST["arg"]; if (isset($arg)) { if (function($arg)) { exit(json_encode(array('redirect' =&gt; 'page2.php'))); } else { exit(json_encode(array('message' =&gt; 'Response was not successfully'))); } } else { exit(json_encode(array('message' =&gt; $arg.' parameter was not defined'))); } AJAX: You just have to add dataType: 'json'. You can also use $.getJSON() $.ajax({ type: $(this).attr('method'), url: $(this).attr('action'), data: $(this).serialize(), dataType: 'json', success: function(json) { if ( json.redirect ) window.location.href = json.redirect; else $("body").cftoaster({content: json.message}); } })
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26969254
type: Answer

http://stackoverflow.com/q/26922045
tagged with: angularjs
has body: I think this is probably just a misunderstanding of how to do this on my part but its bugging me and I haven't found anything to answer the problem. I have a static site where my file structure is --node_modules --index.html --server.js --app.js my server.js is simple its just var express = require("express"); var cors = require("cors"); var app = express(); app.use(cors()); app.use(express.static(__dirname + '/')); app.get('/question', function(req, res){ res.send(req.body); }); // Start the server on port 3000 app.listen(process.env.PORT || 3000); // Print out a nice message so you know that the server started console.log('Server running on port 3000'); and my bootstrap and angular WORKS...your probably wondering what the problem is.... So I have a 2nd site and I building and thought I would organize my stuff a little better. My file structure is --node_modules --public |---index.html |---app.js --server.js The only difference in my server.js is app.use(express.static(__dirname + '/public')); my bootstrap and angular is referenced in index.html like &lt;script src="../node_modules/angular/angular.js"&gt;&lt;/script&gt; &lt;script src="../node_modules/bootstrap/dist/js/bootstrap.min.js"&gt;&lt;/script&gt; This DOESN'T work!...now I know I could just do it the first way or use a CND but I was wondering if anyone could educate me as to why and what I am doing wrong. All help and education is greatly appreciated.
has answer: http://stackoverflow.com/a/26922111
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26922111
score: 0
has comment: http://stackoverflow.com/comment/42392018
type: Question
tagged with: javascript
tagged with: express
answer count: 1
has title: Static site with express using a public fonder

http://stackoverflow.com/a/26884578
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: Here's my take on it. Note that for the requirement that states that the array values cannot differ from the next one by more than one, I consider the array to be looping, i.e. the value after the last value is the first value again. var amount = 30; var camels = [0,0,0,0,0,0,0,0,0,0,0,0]; while (amount &gt; 0) { var index = Math.floor(Math.random() * camels.length); var previous = (camels.length + index - 1) % camels.length; var next = (index + 1) % camels.length; if (Math.abs(camels[index] + 1 - camels[previous]) &lt;= 1 &amp;&amp; Math.abs(camels[index] + 1 - camels[next]) &lt;= 1) { camels[index]++; amount--; } } Update As requested by the OP, here's an annotated version: // the amount that needs to be distributed among the camels var amount = 30; // the actual values for all 12 camels, initially all zero var camels = [0,0,0,0,0,0,0,0,0,0,0,0]; // as long as we have something to distribute while (amount &gt; 0) { // get a random current index in the array, i.e. a value between 0 and 11 var index = Math.floor(Math.random() * camels.length); // calculate the index previous to the current index; // in case the current index is 0, the previous index will be 11 var previous = (camels.length + index - 1) % camels.length; // calculate the index next to the current index; // in case the current index is 11, the next index will be 0 var next = (index + 1) % camels.length; // if adding 1 to the camel at the current index makes it so that // the difference with the camel at the previous index is 1 or lower // the difference with the camel at the next index is 1 or lower if (Math.abs(camels[index] + 1 - camels[previous]) &lt;= 1 &amp;&amp; Math.abs(camels[index] + 1 - camels[next]) &lt;= 1) { // go ahead and add 1 to that camel camels[index]++; // and decrement the amount accordingly amount--; } }
upvote count: 2
score: 2
has comment: http://stackoverflow.com/comment/42785987
has comment: http://stackoverflow.com/comment/42785963
accepted answer of: http://stackoverflow.com/q/26883815
has comment: http://stackoverflow.com/comment/42785853
answers question: http://stackoverflow.com/q/26883815
has comment: http://stackoverflow.com/comment/42785910
has comment: http://stackoverflow.com/comment/42785975
has comment: http://stackoverflow.com/comment/42324256
has comment: http://stackoverflow.com/comment/42324300

http://stackoverflow.com/q/26918212
type: UnansweredQuestion
type: Question
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26918356
has title: Html5 page sliding issues
answer count: 2
has body: This code below works by sliding the content of DIV but what i want is if user is on the first page and click on the links, it will slide him to second page in full and vice versa. Any help will be appreciated. Thanks Page Slide I am on the First Page Slide Me to Secondpage I am on the second page Slide Me back to First Page
score: 0
has answer: http://stackoverflow.com/a/26918326
tagged with: javascript

http://stackoverflow.com/comment/42236012
type: QuestionComment
comment on: http://stackoverflow.com/q/26834990
score: 0
has text: @NicoSantangelo: the prototyped method is not invoked. Not to say that your proposal is just not correct.
type: Comment

http://stackoverflow.com/comment/42463811
comment on: http://stackoverflow.com/q/26962881
type: Comment
type: QuestionComment
has text: How are you handling requests with query strings right now? (Side question: how are you making a forum if you aren't using a server side language to access a DB?)
score: 1

http://stackoverflow.com/comment/42470234
has text: Try `core-icon[icon="android"]`. I believe the styling neesds higher specificity than the just the tag.
type: Comment
comment on: http://stackoverflow.com/q/26963676
score: 0
type: QuestionComment

http://stackoverflow.com/a/26834863
type: Answer
downvote count: 1
has body: Your code is pretty close I have made a slight adjustment that works The HTML: The Javascript: //get elementsByTagName //you have to add the [0] index in order for //to get the div from the collection of div elements stored //in the div variable var div = document.getElementsByTagName("div")[0]; div.addEventListener('click', function(event) { alert("it works"); }); div.innerHTML = "Hello World";
score: -1
upvote count: 0
answers question: http://stackoverflow.com/q/26834572

http://stackoverflow.com/a/26885000
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26884055
accepted answer of: http://stackoverflow.com/q/26884055
type: Answer
has body: You should be able to retrieve the dbname from the request query string parmaters. This can be done using: request.getParameter("your-param"); In your case, it should be the dbname parameter, which you are injecting in URL within your JS file: try { String dbName = request.getParameter("dbname"); // Retrive the dbname parameter String responseText = ""; String text = ""; Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/" + dbName /*Use the dbName in the schema URL*/, "root", ""); DatabaseMetaData dbmd = conn.getMetaData(); ResultSet ctlgs = dbmd.getCatalogs(); while (ctlgs.next()) { text += ctlgs.getString(1) + ","; } } catch (Exception e) { out.println(e); } Edit: Otherwise you can simply show your database names within your JSP without any external requests calls, since you are already populating your db names to a String delimited by a comma, you can use the &lt;c:forTokens&gt; tag to iterate over a splitted array from you String; text: &lt;c:forTokens items="${text}" delims="," var="dbname"&gt; &lt;c:out value="${dbname}"/&gt;&lt;p&gt; &lt;/c:forTokens&gt;

http://stackoverflow.com/comment/42267478
has text: What do you want to see change on the screen?
comment on: http://stackoverflow.com/a/26850541
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42413307
type: Comment
has text: @brso05 If I do that, the gif image will either not be shown, or if shown, it will appear frozen, i.e. not spinning.
type: QuestionComment
comment on: http://stackoverflow.com/q/26934320
score: 0

http://stackoverflow.com/q/26877484
tagged with: javascript
has title: Weird behavior with margin on mac when opacity of child element changes
score: 0
answer count: 1
tagged with: jquery
tagged with: macos
has comment: http://stackoverflow.com/comment/42542816
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42563630
tagged with: css
has answer: http://stackoverflow.com/a/26877694
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42312460
accepted answer: http://stackoverflow.com/a/26877694
has comment: http://stackoverflow.com/comment/42315231
has body: I am building a memory game. It works fine on chrome on Windows. However with a mac, there is a weird glitch, that causes the cards to jump after the second set of cards gets uncovered. The code for each card is this: &lt;div id="'+counter+'" class="'+num+' card covered"&gt;&lt;div&gt;'+num+'&lt;/div&gt;&lt;/div&gt; whereas counter is the int variable from a for loop, num is the face of the card (a random number, making sure it has only 1 pair per number). The cards get covered or uncovered by a change in the background color of our .card and the opacity of the child element .card div gets set to 1 or 0 respectively. Also the cards were rotated and spaced randomly via jquery. Here are two fiddles: http://jsfiddle.net/awm0ccbp/7/ Click on each card to uncover it. It should work fine. Basically what it does is every time you click on a card change the opacity of the child element from 0 to 1. Here is the second version: http://jsfiddle.net/awm0ccbp/6/ This time the cards get covered again after you uncovered 2 cards.Starting on the third click, things will get messy: The previously uncovered cards get flipped over (opacity back to 0) but the newly uncovered card will somehow get an additional margin, causing all the cards to be pushed around. I believe the margin comes from our child element, which is rotated, and therefore pushes cards over and to the side. So why does it act so weird on a mac, after you cover the cards back up?
type: Question

http://stackoverflow.com/comment/42376338
type: Comment
comment on: http://stackoverflow.com/a/26905495
has text: If I type this following code in the console, with this stackoverflow page displayed, I get elements with chrome and FF, don't you? $('*').hide();$('body *').filter(function() { return $(this).css('margin-left') == 'auto' && $(this).css('margin-right') == 'auto'; })
score: 0
type: AnswerComment

http://stackoverflow.com/q/26945246
score: 0
tagged with: rest
tagged with: adobe-brackets
type: UnansweredQuestion
has body: We have two separate web projects for our application One for Spring REST services Other for AngularJS, the front end of the application. We have been using eclipse for development of both and also for running those locally on tomcat server. It is a great deal of pain to view updates to JavaScript and CSS part of the second project from eclipse, because it requires restart or publish of the tomcat server every time which takes a long time. So I wanted to use eclipse for development of REST and front-end development editor like Brackets for development of AngularJS/JavaScript and CSS. But then they run on different ports causing Cross Site requests errors, and I don't want to write any CORS filter like this for this purpose. Is there any better way to get these tools work together ?
tagged with: java
tagged with: eclipse
has title: How to use Eclipse for Spring REST development with Brackets like editor for JavaScript/front end development?
type: Question
has answer: http://stackoverflow.com/a/26956131
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/26954545
has comment: http://stackoverflow.com/comment/42472298
upvote count: 1
has comment: http://stackoverflow.com/comment/42520380
has comment: http://stackoverflow.com/comment/42544829
type: Answer
answers question: http://stackoverflow.com/q/26954342
has body: Your requirements are tough. For example - what will you do if you have two citations that occur on the same line? There might be a javascript solution to calculate the position of things and move them to an appropriate spot. I know that it's possible but I'm not the right guy to clearly write or explain it. I think you can reduce the cases where you might have to compromise with smaller text and line-height: small { font-size: 12px; line-height:110% } That would make them overlap less often, but to really do this right you need to figure out what you will do when two citations are on the same line. Aside from some kind of css hover/hide effect I think the only way is with some non-trivial javascript figuring out where to put things.
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/42481243
has comment: http://stackoverflow.com/comment/42529995

http://stackoverflow.com/a/26927202
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42400873
answers question: http://stackoverflow.com/q/26926951
type: Answer
accepted answer of: http://stackoverflow.com/q/26926951
has body: You would better use localStorage for this functionality, it's simpler then cookies. For example: function changeClass(value) { var newColor = value == 2 ? 'red' : 'green'; localStorage.color = value; var elems = document.querySelectorAll('.red, .green'); var i = elems.length; while (i--) { var item = elems[i]; removeClass(item, 'red'); removeClass(item, 'green'); // or removeClass(item, 'red|green'); addClass(item, newColor); }; return false; }; then to set correct class on page load you can call changeClass again with the color value saved in localStorage: window.onload = function() { changeClass(localStorage.color || 2); }; Demo: http://jsfiddle.net/xgmx11dt/4/
has comment: http://stackoverflow.com/comment/42506427
score: 0

http://stackoverflow.com/comment/42305784
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26873743
has text: First things first, your syntax is wrong. Use a combination of single/double quotes or escape them. Try: `$.getJSON('./db/q="select * from *"', function(result){ console.log(result); });` and post what you get in your console.

http://stackoverflow.com/a/26964721
upvote count: 1
has comment: http://stackoverflow.com/comment/42467435
type: Answer
answers question: http://stackoverflow.com/q/26964666
downvote count: 0
score: 1
has body: You need to simply move the rectangle's in (add x and y values) and change the width and height accordingly like so (basically subtract it by 5 more to fit it inside the last one): whereX = whereX + 5; whereY = whereY + 5; width = width - 10; height = height - 10; Your browser doesn't support the HTML5 canvas tag

http://stackoverflow.com/comment/42437101
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26947473
has text: Why do you assign `this` to `self` and then never use `self`?
score: 0

http://stackoverflow.com/q/26838138
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42241962
has comment: http://stackoverflow.com/comment/42241850
type: Question
tagged with: javascript
tagged with: response
score: 0
has comment: http://stackoverflow.com/comment/42242061
tagged with: yql
has title: YQL global response object converts binary data to raw binary string incorrectly
has comment: http://stackoverflow.com/comment/42241986
has body: I have asked the same question on YDN forum, too. --> post on YQL forum It is said in https://developer.yahoo.com/yql/guide/yql-javascript-objects.html#yql-execute-responseglobalobject: Get the response from the remote service.** If the response content type is not application/json or text/xml then YQL provides a string.** If JSON or XML is specified, the E4X representation of the data is returned. But if response content is binary data (for example image/jpeg), YQL cannot convert it to raw binary string literal(in JSON format) correctly. I have figured out that YQL failed for 2 characters: \u000D (\n) not \u000A (\n), \u00A0 (non-breaking-space) not \u0020 (space). It is impossible to recover the original binary data from YQL output. Definitely it's a BUG, and a bugfix is welcomed. Is there a way to change some settings to avoid the problem, or YQL team will correct its engine in near future? It will be grateful if YQL can support binary content as response. P.S. you can try query as below on YQL console with Community Tables ON (check JSON output): <a href="https://developer.yahoo.com/yql/console/?q=select%20*%20from%20data.uri%20where%20url%3D%22http%3A%2F%2Fl.yimg.com%2Fa%2Fi%2Fus%2Fpps%2Fyql32.png%22&env=store://datatables.org/alltableswithkeys#h=select%20*%20from%20execute%20where%20code%3D%22var%20url%3D%27http%3A%2F%2Ftechblogcorner.com%2Fwp-content%2Fuploads%2F2014%2F09%2Fjpeg.jpg%27%2C%20req%20%3D%20y.rest%28url%29.accept%28%27image%27%29.header%28%27Accept-Encoding%27%2C%20%27gzip%2Cdeflate%27%29.decompress%28true%29%2C%20resp%20%3D%20req.get%28%29%3B%20response.object%3D%20resp.response%3B%22" rel="nofollow noreferrer">Execute on YQL console select * from execute where code="var url='http://techblogcorner.com/wp-content/uploads/2014/09/jpeg.jpg', req = y.rest(url).accept('image').header('Accept-Encoding', 'gzip,deflate').decompress(true), resp = req.get(); response.object= resp.response;" Here is source code of a live sample client querying yql. (also on…
tagged with: binary

http://stackoverflow.com/q/26863342
answer count: 4
has answer: http://stackoverflow.com/a/26863613
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42286588
score: 13
has comment: http://stackoverflow.com/comment/42286590
upvote count: 13
tagged with: performance
tagged with: http://stackoverflow.com/tag/json
tagged with: dom
type: Question
downvote count: 0
tagged with: javascript
has body: I am working on a Big Data client side application. Server language is Java. Within Frontend I have heavily vanilla JavaScript but AngularJS as MVC framework. Problem Dealing with big data analysis, at a time a single REST api response is around 1.5MB to 3MB. Dealing with this data to construct DOM is a pain. First it takes around 5 to 10 seconds to load the JSON. Then I build the UI (DOM) Once DOM is constructed, based on users interaction with data - I have to send/hit the server back with same JSON with updated values. Suggest, What are the options do I have to optimize the page responsiveness" Couple of things I have in mind: break the JSON into chunks of 1000 at a time, once DOM is loaded then bring data silently and update the UI. GZIP the JSON on the server and decode back on client. Give me your concrete workarounds! Sample JSON could be: var data = [ { prop:val, prop2: {}, prop3:[ id: val, prop4: { {}, {}, {}, {}}, prop5: [ [], [], [] ] ] }, {}, {}, {} ] Some Use cases DATA size could be 10000 of objects, nested at a minimum of six, seven deep levels. Need to construct grid (table), rows goes around same length as objects and columns at minimum of 100 columns. All data cells have custom context menu, have nested headers, all columns to be sortable, rows to be sortalbes and these sorted orders hits the server as soon as users changes that. But I do have a second of threshold. A very basic example is here: http://shekhardesigner.github.io/OuchGrid/
has answer: http://stackoverflow.com/a/26867601
has answer: http://stackoverflow.com/a/26863997
has answer: http://stackoverflow.com/a/26863464
has comment: http://stackoverflow.com/comment/42286639
has comment: http://stackoverflow.com/comment/42286688
has comment: http://stackoverflow.com/comment/42286444
has comment: http://stackoverflow.com/comment/42286659
has title: Optimize Huge JSON response
has comment: http://stackoverflow.com/comment/42286816

w3c
type: Tag
tag name: w3c
tags question: http://stackoverflow.com/q/26863320

http://stackoverflow.com/comment/42317325
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26880198
has text: @Ben I am looking for the shortest and simplest way to add/modify my code without changing it on a whole.
score: 0

http://stackoverflow.com/q/26887683
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42329944
has answer: http://stackoverflow.com/a/26887774
linked to: http://stackoverflow.com/q/426258
type: Question
has answer: http://stackoverflow.com/a/26887812
has title: disable/renable input field base on radio checkbox
tagged with: javascript
has body: I wrote below code but there's no respond I switch my radio box. I want to disable unchecked radio checkbox. http://jsfiddle.net/prxteafy/1/ &lt;input class="radio-checkbox" type="radio" name="choice" value="custom_msg" checked&gt;Custom Message :&lt;br/&gt; &lt;input style="width:200px" placeholder="your msg" type="text" id="custom_text"/&gt; &lt;br/&gt; &lt;input class="radio-checkbox" type="radio" name="choice" value="custom_img"&gt;Image :&lt;br/&gt; &lt;input style="width:200px" placeholder="an image url" type="text" id="custom_img"/&gt; my js $(".radio-checkbox").change(function() { if(this.checked) { $(this).next().$("input").prop('disabled', true); } });
has comment: http://stackoverflow.com/comment/42329732
answer count: 3
downvote count: 0
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/26887812
upvote count: 2
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26887922
accepted answer: http://stackoverflow.com/a/26887774

http://stackoverflow.com/q/26858662
has comment: http://stackoverflow.com/comment/42278536
has body: I have Jquery Code Sample.Here I need to put the content of one page inside a particular div var ajax_load = "&lt;img src='ajax-loader.gif' alt='loading...'&gt;"; $('#id').html(ajax_load).load("https://url/demo/Sample"); Due to CORS my code is not working.In my server CORS is enable but request is not coming to server also,How to handle the issue, If I am trying the same with normal Html (From Same Domain )I am not getting it correctly
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/42278543
linked to: http://stackoverflow.com/q/3076414
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/42278920
has comment: http://stackoverflow.com/comment/42278537
tagged with: javascript
downvote count: 0
has comment: http://stackoverflow.com/comment/42278800
tagged with: jquery
has comment: http://stackoverflow.com/comment/42278724
favorite count: 0
tagged with: ajax
linked to: http://stackoverflow.com/q/20442628
has title: How to disable CORS for jquery load function
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42278898

http://stackoverflow.com/comment/42332342
type: Comment
comment on: http://stackoverflow.com/q/26888780
has text: Is the link in a different domain or sub domain?
type: QuestionComment
score: 1

http://stackoverflow.com/comment/42237458
has text: Whoah, is that shorthand? It actually works, I just ran it, but I've never seen `= ` used like that.
comment on: http://stackoverflow.com/a/26835721
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/26869965
has comment: http://stackoverflow.com/comment/42305821
has comment: http://stackoverflow.com/comment/42299398
type: Answer
has comment: http://stackoverflow.com/comment/42298915
accepted answer of: http://stackoverflow.com/q/26869426
has comment: http://stackoverflow.com/comment/42303931
has comment: http://stackoverflow.com/comment/42307648
answers question: http://stackoverflow.com/q/26869426
upvote count: 1
has comment: http://stackoverflow.com/comment/42305299
has comment: http://stackoverflow.com/comment/42305766
has body: You just need changes to your output to suit your situation. For instance, changing this line - $option = '&lt;option value="' . $rows['movieName'] . '"&gt;' . $rows['movieName'] . '&lt;/option&gt;'; to something like - $option = '&lt;a href=movie.php?title="' . $rows['movieName'] . '"&gt;' . $rows['movieName'] . '&lt;/a&gt;&lt;br /&gt;'; will output a link to a page called movie.php which references the title of the movie in the query string, for example - http://www.example.com/movie.php?title=Big You can add pictures, icons or any markup that you desire for each of the returned items.
has comment: http://stackoverflow.com/comment/42305024
has comment: http://stackoverflow.com/comment/42304852
has comment: http://stackoverflow.com/comment/42304182
has comment: http://stackoverflow.com/comment/42304684
has comment: http://stackoverflow.com/comment/42304263
has comment: http://stackoverflow.com/comment/42304412
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/42306334

http://stackoverflow.com/q/26909964
has comment: http://stackoverflow.com/comment/42369611
has title: jQuery to plain javascript
tagged with: append
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26910068
has body: I need to change this bit of jQuery.. $(function() { $("#breadcrump").append(" Can't find what you're looking for? Try our old website: Old Website (brooksbarn.co.uk) orE-Mail "); }); Into regular javascript, I've looked into many ways, but my lack of js knowledge seems to be my stumbling block. Here is what I've come up with so far: document.body.onload = addElement; function addElement () { // create a new div element // and give it some content var newDiv = document.createElement("oldsite"); var newContent = document.createTextNode("Can't find what you're looking for? Try our old website: Old Website (brooksbarn.co.uk) orE-Mail"); newDiv.appendChild(newContent); //add the text node to the newly created div. // add the newly created element and its content into the DOM var currentDiv = document.getElementById("breadcrump"); document.body.insertBefore(newDiv, currentDiv); }
type: Question
has comment: http://stackoverflow.com/comment/42369650
has answer: http://stackoverflow.com/a/26910068
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26910016
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/26910067
upvote count: 1
downvote count: 1
possible better answer: http://stackoverflow.com/a/26910016
favorite count: 0
linked to: http://stackoverflow.com/q/799981

http://stackoverflow.com/q/26908374
has answer: http://stackoverflow.com/a/26908619
has comment: http://stackoverflow.com/comment/42367496
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/26908619
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26908674
favorite count: 0
has body: I'm working on a web application which has many dynamic modules. Inside those modules I have a text container and I can't control what the future administrator will write inside of this container. So I've set a fixed max-height to the container and I've added a button to "read more" that will change the max-height if any user clicks on it. (and then clicks it again) If the text is too short, obviously there shoudn't be a "read more" option as there's no more text to show. My question is. Would it be possible to hide the button (display:none) if the text container has not reach that fixed max-height? (or make it show if the max-height is reached). Example of the HTML: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum Read more Basic CSS: .text { overflow:hidden; } .height { max-height:38px; } .heightAuto { max-height:5000px; } and my little javascript: function changeheight() { var readmore = $('#readmore'); if (readmore.text() == 'Read more') { readmore.text("Read less"); } else { readmore.text("Read more"); } $('.height').toggleClass("heightAuto"); }; JSFIDDLE I work basically with HTML and CSS and have very little knowledge of javascript/jquery, so if you think there's a turn around with just css it would be a better option for me. However any solution will be greetly apreciated. Btw, would it be possible to make a bit of a transition when changing the height so it would look a bit more fluid? (this is me beign greedy, feel free to ignore this question if You think I went over the top asking for help). thanks a lot in advance and excuse my poor english.
upvote count: 2
possible better answer: http://stackoverflow.com/a/26908674
has title: Hide an element if container height is less than a fixed amount
tagged with: css
has answer: http://stackoverflow.com/a/26909240
type: AnsweredQuestion
score: 2

http://stackoverflow.com/comment/42491051
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26949275
has text: Yes, just console.log the returned json. Parse accordingly. If my answer helped you, then you can accept my answer.

http://stackoverflow.com/a/26986346
accepted answer of: http://stackoverflow.com/q/26986218
answers question: http://stackoverflow.com/q/26986218
has body: Check that you are actually adding the id attribute (you haven't shown the full code so hard to tell if its correct). Should be something like @Ajax.ActionLink("Add Last Name", "AddTimeSeriesData", null, new AjaxOptions { }, new { ID = "link" }) Then you can access the text with var displayText = $('#link').text();
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/42505936
score: 1
upvote count: 1

http://stackoverflow.com/comment/42267194
has text: you also have other options like ng-style, but I don't recommend that. ng-options is the best one to use.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26852317
type: Comment

http://stackoverflow.com/comment/42408956
has text: Yeah, I think that's the way I'll have to go. I don't relish the idea of having to basically write media queries in JS, but it might be the only way.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26913401

http://stackoverflow.com/comment/42379267
type: QuestionComment
type: Comment
has text: Problem that i need repeating values but i want display it in one li tag and change it height accordingly
comment on: http://stackoverflow.com/q/26914964
score: 0

http://stackoverflow.com/q/26946243
score: 4
has comment: http://stackoverflow.com/comment/42452530
downvote count: 0
tagged with: meteor
favorite count: 0
has answer: http://stackoverflow.com/a/42541988
has title: Meteor - preventDefault not preventing default
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/42541988
has answer: http://stackoverflow.com/a/26946959
has comment: http://stackoverflow.com/comment/42452864
type: Question
upvote count: 4
answer count: 2
accepted answer: http://stackoverflow.com/a/26946959
tagged with: javascript
has body: I'm busy with David Turnbull's - Your first Meteor Application. Everything works up to the point where I try and add a new player to the list via a form. My problem is that preventDefault is not preventing the form from trying to submit and reloading the page. return false doesn't work either. Any ideas why this will be happening? Thanks PlayersList = new Mongo.Collection('players'); if (Meteor.isClient) { //Helpers Template.leaderboard.helpers({ 'player': function() { return PlayersList.find({}, {sort: {score: -1, name: 1}}); }, 'playerCount': function() { return PlayersList.find().count(); }, 'selectedClass': function() { var playerId = this._id; var selectedPlayer = Session.get('selectedPlayer'); if(playerId == selectedPlayer) { return 'selected' } }, 'showSelectedPlayer': function() { var selectedPlayer = Session.get('selectedPlayer'); return PlayersList.findOne(selectedPlayer); } }); //Events Template.leaderboard.events({ 'click .player': function() { var playerId = this._id; Session.set('selectedPlayer', playerId); }, 'click .increment': function() { var selectedPlayer = Session.get('selectedPlayer'); var increaseBy = document.getElementById('increase-by').value; var isNumber = /^\d+$/.test(increaseBy); if(increaseBy != '' &amp;&amp; isNumber) { PlayersList.update(selectedPlayer, {$inc: {score: +increaseBy}}); } }, 'click .decrement': function() { var selectedPlayer = Session.get('selectedPlayer'); var decreaseBy = document.getElementById('decrease-by').value; PlayersList.update(selectedPlayer, {$inc: {score: -decreaseBy}}); }, 'submit #new-player': function(event) { event.preventDefault(); var playerNameVar = event.target.playerName.value; if(playerNameVar != '') { PlayersList.insert({ name: playerNameVar, score:0 }); } } }); } Template &lt;template name="addPlayerForm"&gt; &lt;div id="add-player" class="reveal-modal" data-reveal&gt; &lt;a class="close-reveal-modal"&gt;&amp;#215;&lt;/a&gt; &lt;h2&gt;Add a player&lt;/h2&gt; &lt;p class="lead"&gt;Add another pl…
has comment: http://stackoverflow.com/comment/42435869

http://stackoverflow.com/q/26864931
has title: magnificPopup goTo in meteor closes the popup
answer count: 1
tagged with: javascript
has body: My problem is that when I use .goTo(1) the item 0 will just close. I can view the popup if I choose to open item 1 first time. I import the templates for my popus: {{> booking_preview }} {{> user_preview }} Then I create a popup on a click which opens item 0 by default: $.magnificPopup.open({ items: [ { src: $(".booking-preview"), type: 'inline' }, { src: $(".user-preview"), type: 'inline' }], enableEscapeKey: false, showCloseBtn: false, closeOnBgClick: true, removalDelay: 300, mainClass: 'mfp-fade mfp-tooltip' }, 0); now inside this popup there is a button to go to specified item: $.magnificPopup.instance.goTo(1); $.magnificPopup.instance.updateItemHTML(); Now why is this closing down the popup and not taking me to the next popup as it does if I choose to open item 1 by default? The two popup templates looks like this: item 0: {{> preview_booking }} {{> preview_book }} item 1: {{> preview_user_head }} {{> preview_user_body }} My issue seem to be related to opening a popup from inside another popup. Update: The following code will display item 1 for the duration of the removalDelay and then dissapear: $.magnificPopup.open({ items: [ { src: $(".booking-preview"), // calendar/preview/booking/booking_preview.html type: 'inline' }, { src: $(".user-preview"), // user/user.html type: 'inline' } ], removalDelay: 1500 }, 0);
score: 0
tagged with: meteor
has answer: http://stackoverflow.com/a/26957428
tagged with: magnific-popup
type: UnansweredQuestion
type: Question

http://stackoverflow.com/q/26895102
has title: Clone and modify XmlHttpRequest
has answer: http://stackoverflow.com/a/73156123
type: Question
upvote count: 2
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/27030220
has comment: http://stackoverflow.com/comment/42583123
tagged with: ajax
has comment: http://stackoverflow.com/comment/42347432
has comment: http://stackoverflow.com/comment/42343905
has body: This maybe be seems like a total misunderstanding of a javascript way, but nevertheless here is an interest question: how to copy a XmlHttpRequest and make copy's send function include custom headers in a way that it will leave original XmlHttpRequest untouched. Here is my (unsuccessful) attempt: Ajax.prototype._newReq = function() { var request = Object.create(XMLHttpRequest.prototype), token = this.token; request._send = request.send; request.send = function(data) { request.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); if (typeof token !== 'undefined') { request.setRequestHeader("X-AUTH-TOKEN", token); } this._send(data) } return request; } this code throws TypeError: Illegal invocation
favorite count: 0
score: 2
downvote count: 0
tagged with: prototypal-inheritance
type: UnansweredQuestion

http://stackoverflow.com/comment/42315499
has text: a simple googling will give you your answer :)
type: QuestionComment
type: Comment
score: 2
comment on: http://stackoverflow.com/q/26879347

http://stackoverflow.com/q/26894361
possible better answer: http://stackoverflow.com/a/26894657
has answer: http://stackoverflow.com/a/26894688
has answer: http://stackoverflow.com/a/26894657
has comment: http://stackoverflow.com/comment/42342845
has title: Function to write new text size on window resize
has comment: http://stackoverflow.com/comment/42342631
has answer: http://stackoverflow.com/a/26894901
answer count: 4
has comment: http://stackoverflow.com/comment/42343224
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42342375
has comment: http://stackoverflow.com/comment/42342723
has comment: http://stackoverflow.com/comment/42342552
has comment: http://stackoverflow.com/comment/42342682
has body: I am trying to figure out an equation for a small problem I'm having. I'm not great at figuring these types of things out, but I know I've done it before with a different set of numbers. Basically, I'm trying to figure out: if 360px = 100%; and 959px = 160%; then 720px = X; 720px is an arbitrary number. I know that 360px should be 100% font size, while 959px should be 160% font size. I'd like the body font-size to change when the screen is enlarged or shrunken (on load usually) and I'd like to find out any font size percentage in between. I would like to plug this into a javascript math function for something like this: function widthToPerc(){ var width = $(window).width(); var toPerc = // THIS FORMULA RIGHT HERE TO GET A PERCENTAGE $('body').css({"font-size" : toPerc + "%"}); } And then initiate this on window load and window resize.
has comment: http://stackoverflow.com/comment/42342335
type: Question
has comment: http://stackoverflow.com/comment/42342318
has answer: http://stackoverflow.com/a/26894665
has comment: http://stackoverflow.com/comment/42342321
has comment: http://stackoverflow.com/comment/42342302
tagged with: javascript
has comment: http://stackoverflow.com/comment/42342298
has comment: http://stackoverflow.com/comment/42342674
has comment: http://stackoverflow.com/comment/42342588
has comment: http://stackoverflow.com/comment/42342746
score: 0
has comment: http://stackoverflow.com/comment/42342355
has comment: http://stackoverflow.com/comment/42342271
has comment: http://stackoverflow.com/comment/42342729
accepted answer: http://stackoverflow.com/a/26894665
has comment: http://stackoverflow.com/comment/42342648

http://stackoverflow.com/a/26901069
answers question: http://stackoverflow.com/q/26900920
has comment: http://stackoverflow.com/comment/42355153
has comment: http://stackoverflow.com/comment/42355361
accepted answer of: http://stackoverflow.com/q/26900920
upvote count: 2
has comment: http://stackoverflow.com/comment/42355305
has comment: http://stackoverflow.com/comment/42355415
has comment: http://stackoverflow.com/comment/42355266
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42355435
has comment: http://stackoverflow.com/comment/42354660
has body: This will work: timeold = "12.84"; time = timeold.match(/(\d+)(\.\d+)?/); if (time[2] &gt;= .60) { time[2] = time[2] - .60; time[1] = parseInt(time[1]) + 1; } alert(time[1] + time[2]);
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/a/26913418
answers question: http://stackoverflow.com/q/26910703
upvote count: 1
type: Answer
has body: I managed to create a small function using a filter I created which capitalizes and hyphenates, take a look and let me know if it meets your needs. http://plnkr.co/edit/i8MEUQjtUvlthp9WwaBq?p=preview Code: var app = angular.module("myApp", []); app.controller('myCtrl', ['$scope', '$filter', function($scope, $filter){ $scope.myText = ""; $scope.update = function(){ $scope.myText = $filter('myFilter')($scope.myText); }; }]); app.filter('myFilter', function(){ return function(text){ if(!text) return text; else{ var toReturn = text; toReturn = toReturn.toUpperCase().replace('', ''); if(toReturn.length &gt; 4 &amp;&amp; toReturn[4] !== "-") toReturn = toReturn.substring(0, 4) + "-" + toReturn.substring(4); if(toReturn.length &gt; 9 &amp;&amp; toReturn[9] !== "-") toReturn = toReturn.substring(0, 9) + "-" + toReturn.substring(9); if(toReturn.length &gt; 14 &amp;&amp; toReturn[14] !== "-") toReturn = toReturn.substring(0, 14) + "-" + toReturn.substring(14); return toReturn; } }; }); HTML: &lt;input ng-model="myText" ng-change="update()"/&gt;
downvote count: 0
score: 1

http://stackoverflow.com/a/26969886
accepted answer of: http://stackoverflow.com/q/26969764
has comment: http://stackoverflow.com/comment/42476151
answers question: http://stackoverflow.com/q/26969764
has body: Its hard to achieve this, since your two websites don't come from the same origin. "The essence of the Same Origin policy can be formulated as: windows can work in contexts of each other only if they are from same protocol://domain:port, or, shortly, from same origin." http://javascript.info/tutorial/same-origin-security-policy There are workarounds, namely the cross-window messaging, but you need to be in control of both domains. In essence, you would be fighting browsers that actively prohibit this, as it is considered a security flaw.
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/42476861
has comment: http://stackoverflow.com/comment/42476203
type: Answer
has comment: http://stackoverflow.com/comment/42476062

http://stackoverflow.com/q/26971192
score: 0
answer count: 1
tagged with: jquery
has title: How to change "AgendaDay" day title format in fullcalendar.js
has answer: http://stackoverflow.com/a/26971292
tagged with: momentjs
accepted answer: http://stackoverflow.com/a/26971292
has body: My question is as simple as the title. I want to customize the format of the default title of AgendaDay view in the fullcalendar javascript library. I've searched the whole documentation here. I tried titleFormat attribute but no avail. Is there anything that can do the trick ?
type: Question
type: AnsweredQuestion
tagged with: format
tagged with: javascript
tagged with: fullcalendar

http://stackoverflow.com/comment/42399077
type: QuestionComment
has text: Please tell why you downvote, I think this is a legitimate question.
comment on: http://stackoverflow.com/q/26926340
score: 1
type: Comment

http://stackoverflow.com/q/26838139
has title: Failure of click action on input file element in Firefox extension
score: 0
tagged with: firefox-addon
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/26840842
type: UnansweredQuestion
type: Question
has body: I am trying to do click action on an input file element at Firefox extension side, but the upload dialog cannot be triggered. I use element.click() at extension side, it fails. but it succeeds when executed at Firebug console.

http://stackoverflow.com/comment/42512247
comment on: http://stackoverflow.com/q/26989309
score: 1
type: QuestionComment
type: Comment
has text: What you see in the output [is not the state the objects had when they were logged](http://stackoverflow.com/questions/23392111/console-log-async-or-sync).

http://stackoverflow.com/q/26910162
has answer: http://stackoverflow.com/a/26910262
tagged with: native
has comment: http://stackoverflow.com/comment/101629897
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42370224
has comment: http://stackoverflow.com/comment/42370112
downvote count: 2
has comment: http://stackoverflow.com/comment/42369898
has body: I'm looking for a way to represent the "on" and "off" capabilities of jQuery in pure JavaScript code. For example: jQuery("my_selector_here").on("click", function(){ // some code here... }) Should be represented in the most (total) accurate way, something like: myobj.fn.on = function(){ // pure javascript code here... } Thanks in advance!
type: Question
has comment: http://stackoverflow.com/comment/42369964
score: 3
has title: jQuery's "on" and "off" in pure native javascript
upvote count: 5
has comment: http://stackoverflow.com/comment/42369891

http://stackoverflow.com/comment/136577923
type: Comment
comment on: http://stackoverflow.com/a/26946318
has text: @ImShogun If your JavaScript can inflict a change, maybe your JavaScript can also inflict a trigger? `$("#myElementId").val("new val"); $("#myElementId").trigger("change");` Docs: https://api.jquery.com/trigger/.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/42416535
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26935786
has text: FYI it looks like so now: onClick="editGUI('+ i +',\"'+JSON_csw[i].carerName+'\",\"'+JSON_csw[i].carerAddress+'\", \"'+JSON_csw[i].carerMobile+'\", '+JSON_csw[i].carerID+');">\
score: 0

http://stackoverflow.com/q/26964751
has answer: http://stackoverflow.com/a/26964766
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
has body: I'm a Jquery noob, very much in the learning stage. This is my fiddle: http://jsfiddle.net/4tjof34d/ (Double click any of the three dots to get a textbox in the above fiddle, then enter a value in that box and press enter) As you can see it works but how do I get the id and value when the user puts a new value into the textbox? Basically, I need to get the value in to something like this: var theId = $(this)id; var newValue = $(this)value; // console.log(theId+" "+newValue+ " "+savedData); so I can make an AJAX call to update the DB with the new value/s. If you could put a comment in the code as well, for example: // ajax call here that would be appreciated as well!
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26964772
has answer: http://stackoverflow.com/a/26964952
answer count: 4
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/26964776
upvote count: 1
has answer: http://stackoverflow.com/a/26964776
has title: jquery: get value and id of textbox when it changes
type: Question
accepted answer: http://stackoverflow.com/a/26964772
tagged with: javascript

http://stackoverflow.com/comment/42433182
type: Comment
comment on: http://stackoverflow.com/a/26930928
has text: Awesome, yeah its a bit of a pain but kinda interesting
type: AnswerComment
score: 0

http://stackoverflow.com/comment/42237774
comment on: http://stackoverflow.com/q/26835809
score: 0
type: Comment
type: QuestionComment
has text: Well if the typo that lwalden points out is in your actually code it will cause your function to not be defined as you will have a syntax error. So fix the typo and see if that fixes it, if it doesnt than you have to make sure its in global scope ie not defined in an object or in another function.

http://stackoverflow.com/comment/42383661
type: Comment
has text: My apologies, but I am getting nowhere with this. My css file is being attached very nicely and that link is in my view. However, I cannot get jquery to link. I am even using the fully qualified URL to Google's hosted API. I am at a serious loss here
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26891959

http://stackoverflow.com/a/26988879
has comment: http://stackoverflow.com/comment/42509866
upvote count: 0
score: -2
has body: I'm guessing you want to return the results of the two separate ajax calls after both finish? If that's the case, then you could wrap each ajax request in a Promise and use the Promise.all([promise1, promise2]) construct.
has comment: http://stackoverflow.com/comment/42509867
type: Answer
answers question: http://stackoverflow.com/q/26988805
has comment: http://stackoverflow.com/comment/42509782
downvote count: 2

http://stackoverflow.com/a/27888110
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/26964005
answers question: http://stackoverflow.com/q/26964005
upvote count: 2
has comment: http://stackoverflow.com/comment/44193250
has body: You could do this: var Utilities= { showLogs:true, printLog:function(msg){ if(!this.showLogs) return 0; var k=new Error().stack.split("\n").slice(2); k.unshift(msg); console.log(k.join("\n")); } }
score: 2
type: AcceptedAnswer

http://stackoverflow.com/comment/42252786
comment on: http://stackoverflow.com/q/26844260
score: 0
has text: No, I didn't mean to ask **why** you were doing this. Sure, it might be a good idea to extract out an array of IDs and keep it around. I was asking, **where did you get stuck** in figuring out how to do it. I was just curious, since this involves absolutely basic, fundamental, rudimentary, foundational JS constructs, namely looping over the array to get each object, then getting its property value, then comparing it, then sticking it in an array. What other ideas could there be? And why do you care about "least" code at this point when you haven't written any code at all?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26978951
score: 0
has body: You never toggled it back up. http://jsfiddle.net/ndczc728/8/ if(!$target.hasClass('active')){ $target.addClass('active').slideDown(); } else { $target.removeClass('active').slideUp(); }
answers question: http://stackoverflow.com/q/26978862
type: Answer

http://stackoverflow.com/a/26932587
score: 2
answers question: http://stackoverflow.com/q/26931834
type: AcceptedAnswer
downvote count: 0
has body: Instead of document.ready, insert the panel on pageinit: $(document).on("pageinit", "#a", function(){ $("#a").append(...) }); Then the panel will be there when pageshow is handled. Updated FIDDLE
accepted answer of: http://stackoverflow.com/q/26931834
type: Answer
has comment: http://stackoverflow.com/comment/42412267
has comment: http://stackoverflow.com/comment/42410779
upvote count: 2

http://stackoverflow.com/q/26858039
score: 4
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has body: So I'm hoping to do some lazy loading in my angular app -- I want to pull down everything I need to render the landing page, and then subsequently pull down the rest. The problem is, it seems like I have to define all of my angular module dependencies up-front, when I first run the app... var myApp = angular.module('myApp', []); // then, after 1st page render: var myModule = angular.module('myApp.subModule', []); How do I now inject myApp.subModule into the dependencies of myApp? Thanks! -Daniel
type: Question
upvote count: 4
has title: Angular - Creating a new module dynamically, and injecting it into main app's dependencies?
tagged with: javascript
has answer: http://stackoverflow.com/a/26872566

peerjs
tags question: http://stackoverflow.com/q/26958404
tag name: peerjs
type: Tag
tags question: http://stackoverflow.com/q/26876004

http://stackoverflow.com/comment/42362753
has text: What do you mean by post data to my server.. I got all data needed when user logged in
comment on: http://stackoverflow.com/a/26904953
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/26901814
answers question: http://stackoverflow.com/q/26900313
has body: The .serialize() method returns a string that looks like this: selectNameA=valueA1&amp;selectNameA=valueA2&amp;selectNameB=valueB1 It is common to use the following when submitting a form via ajax with jQuery: data: $("#form").serialize(), Assuming you are using PHP on the server (since the question is tagged for PHP), you will want the value of the "name" attribute of the select element to end with "[]". (See this question.) &lt;select name="xxx[]" ... That way, $_GET['xxx'] will be an array holding all the selected values. Note: If you specify type: 'post' in your ajax call, you would use $_POST on the serveer, instead of $_GET.
type: Answer
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26900313

http://stackoverflow.com/comment/42372208
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26899290
has text: Terrific. It worked like a charm. Thank you Lars!
score: 0

http://stackoverflow.com/a/26835898
has comment: http://stackoverflow.com/comment/42238941
has comment: http://stackoverflow.com/comment/42238467
answers question: http://stackoverflow.com/q/26833596
accepted answer of: http://stackoverflow.com/q/26833596
type: AcceptedAnswer
has body: Version 0.8.2 Added a special _uihooks feature Add preliminary API for registering hooks to run when Blaze intends to insert, move, or remove DOM elements. For example, you can use these hooks to animate nodes as they are inserted, moved, or removed. To use them, you can set the _uihooks property on a container DOM element. _uihooks is an object that can have any subset of the following three properties: insertElement: function (node, next): called when Blaze intends to insert the DOM element node before the element next moveElement: function (node, next): called when Blaze intends to move the DOM element node before the element next removeElement: function (node): called when Blaze intends to remove the DOM element node Note that when you set one of these functions on a container element, Blaze will not do the actual operation; it's your responsibility to actually insert, move, or remove the node (by calling $(node).remove(), for example). There's also an example of this in the current todos app For your given example, (it might not work with the sub template, but you can try): Template: &lt;template name="main"&gt; &lt;ul&gt; {{#each people}} &lt;li&gt;{{name}}&lt;/li&gt; {{/each}} &lt;/ul&gt; &lt;/template&gt; Javascript: Template.main.rendered = function(){ this.find('ul')._uihooks = { insertElement: function(node, next) { $(node) .hide() .insertBefore(next) .fadeIn(); }, removeElement: function(node) { $(node).fadeOut(function() { this.remove(); }); } }; }
downvote count: 0
type: Answer
score: 3
upvote count: 3

http://stackoverflow.com/q/26959361
score: 0
has body: I have been fighting a lot with this for many hours and seems strange when I see the same working on Fiddle but the same thing doesn't work in my code. Here, I paste my HTML and JS, CSS can be seen here: http://jsfiddle.net/rd6bX/76/ item to be hovered Some Menu Item Another Item Another Item JQuery code: jQuery('.center-menu ul li').hover(function () { jQuery(this).children('.menu.middle').toggle(); });
has comment: http://stackoverflow.com/comment/42457212
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Toggle not working on hover in a menu
accepted answer: http://stackoverflow.com/a/26959395
has comment: http://stackoverflow.com/comment/42457421
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26959395
tagged with: jquery-hover
type: Question

http://stackoverflow.com/a/26941517
downvote count: 0
answers question: http://stackoverflow.com/q/26940423
type: Answer
score: 1
upvote count: 1
has body: As @sifriday describes, you can define your "variables" as properties of an object, which can be looked up by name. They don't necessarily have to be defined in self. It can be a separate object: var responses = { DE63BEY: { ... }, SL64KWX: { ... }, CU56OHG: { ... }, VN10YMY: { ... }, Y926MNB: { ... } }; Then responseText: responses[self.registrationmark()] If for some reason, you need to define the values as variables, you can use eval to read their values dynamically. This method is potentially unsafe and shouldn't be used. responseText: eval(self.registrationmark())

http://stackoverflow.com/q/26864234
answer count: 1
has comment: http://stackoverflow.com/comment/42292465
has answer: http://stackoverflow.com/a/26864971
type: UnansweredQuestion
has body: I've got this strange behavior and even if I can easily workaround it I'd like to know why this happens. function Game () { this.viewport = { ... }; this.player = Player; this.renderer = { ... }; this.stage = { ... }; this.init = function () { //THIS GETS EXECUTED this.setKeyBindings(); } this.run = function () { //THIS WORKS TOO requestAnimFrame(this.update); } this.update = function () { //BAD! THROWS UNDEFINED IS NOT A FUNCTION //HERE I NEED TO USE A REFERENCE HERE this.processInput(); this.renderer.render(this.stage); this.handleLogic(); //EVEN THIS ONE WON'T WORK, BUT IT WORKED IN init()! requestAnimFrame(this.update); }; //METHODS ARE DEFINED THE SAME WAY this.processInput = function () { ... }; this.handleLogic = function () { ... }; this.setKeyBinding = function () { ... } } So I'm clearly missing something: this.setKeybindings() gets successfully executed from within the init method. this.processInput() throws an error. I don't need a workaround, i solved it by using a local reference, like this: function Game () { var reference = this; ....... this.update = function () { //NOW WORKS reference.processInput(); reference.handleLogic(); reference.renderer.render(reference.stage); requestAnimFrame(reference.update); } this.init = function () { //THIS ONE WORKS EVEN USING 'this' this.setKeyBindings() } } I'd like to know why 'this' works only in some methods (like init) while it doesn't in others (like update).
tagged with: oop
has comment: http://stackoverflow.com/comment/42311571
linked to: http://stackoverflow.com/q/20279484
tagged with: methods
has title: Refer to object method property from another method property in JavaScript
type: Question
tagged with: object
has comment: http://stackoverflow.com/comment/42302102
tagged with: closures
has comment: http://stackoverflow.com/comment/42294721
tagged with: javascript
has comment: http://stackoverflow.com/comment/42295637
duplicate of: http://stackoverflow.com/q/20279484
score: 0

http://stackoverflow.com/comment/42466112
type: Comment
has text: Interesting. How would I include locales if I wanted to the example above?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26964078

http://stackoverflow.com/q/26892333
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42338679
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
favorite count: 0
has body: I have a textbox and on click it will display the datepicker. However now there is a requirement to add the calendar icon. Datepicker icon must be inside a textbox and whether I click a datepicker icon or the textbox, it should display the datepicker. I am using the following code: @Html.TextBoxFor(model =&gt; model.myDatePicker, new { @class = "form-control myDatePicker" }) &lt;span class="glyphicon glyphicon-calendar"&gt;&lt;/span&gt; Since Span is outside @Html.TextBoxFor calendar icon is displayed in the next line. (Needs 10 reputation point to post images- So not able to add that image) Is there a way to include calendar icon inside @Html.TextBoxFor? Or should I add the css to do it? Any input on this will be helpful.
type: Question
has title: Text box with datepicker icon in MVC 5
tagged with: datepicker
tagged with: css
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/26892508

http://stackoverflow.com/a/26863514
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26863459
type: Answer
upvote count: 1
has body: Try this code. $(".show").click(function() { if ($('#mobile-menu').css('height') === '100%') $('#mobile-menu').css({ 'height': '51px' }); else $('#mobile-menu').css({ 'height': '100%' }); });
score: 1
answers question: http://stackoverflow.com/q/26863459

http://stackoverflow.com/comment/42470714
type: Comment
type: QuestionComment
score: 0
has text: would you please check the collection name is spell or spells?
comment on: http://stackoverflow.com/q/26966666

http://stackoverflow.com/a/26982697
has comment: http://stackoverflow.com/comment/42499609
has comment: http://stackoverflow.com/comment/42499929
has comment: http://stackoverflow.com/comment/42499512
has comment: http://stackoverflow.com/comment/42499708
has comment: http://stackoverflow.com/comment/42499877
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/26982532
has body: You should only use var one time per variable. Remove it from your null checks. When you use it in the null checks, the scope of the variable means the outer ones don't change. Move the changeColor function outside of the $(function() {} block. Make sure you have cookies enabled in your browser. $(function(){ /* Using jQuery cookie plugin: https://github.com/carhartl/jquery-cookie */ /* Check value of cookies */ var light = $.cookie("light-color"); var dark = $.cookie("dark-color"); if (light == null) { $.cookie("light-color", "#0095FF"); light = $.cookie("light-color"); } if (dark == null) { $.cookie("dark-color", "#0068B3"); dark = $.cookie("dark-color"); } changeColor(light, dark); }); function changeColor(l, d) { $.cookie('light-color', l); $.cookie('dark-color', d); $('.site_color').css({"color":l}); $('#nav #on').css({"color":l}); $('#menu_dropdown #on').css({"color":d}); }
answers question: http://stackoverflow.com/q/26982532
has comment: http://stackoverflow.com/comment/42500177
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42499914

http://stackoverflow.com/q/26913938
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42377096
has comment: http://stackoverflow.com/comment/42377067
has comment: http://stackoverflow.com/comment/42379854
possible better answer: http://stackoverflow.com/a/26914509
tagged with: forms
type: Question
tagged with: javascript
score: 0
answer count: 3
tagged with: pug
has title: How to get closest form element of parent class. jQuery
accepted answer: http://stackoverflow.com/a/26914264
has answer: http://stackoverflow.com/a/26914509
tagged with: jquery
has body: I am trying to add vote up buttons to my blog comments. I am looping through each comment like this: .row for comment in Comments .row p #{comment} .votecell(style='width:30px;float:left;margin-left: 15px;') .voteUp(id='#{comment.id}', style='margin-bottom: -17px;') &amp;#9650; form.form-horizontal(id='voteUp', enctype="multipart/form-data", method='POST') input(type='hidden', name='_csrf', value=_csrf) input(type='hidden', name='commentID', value='#{comment.id}') &lt;br&gt; Then using jQuery I am trying to submit the form that is a child of the button that was clicked. $(".voteUp").click(function () { var form = $(this).closest(".form-horizontal") $(function(){ $.ajax({ url: '/voteUp', //the URL to your node.js server that has data type: 'POST', data: form.serialize() }).done(function(data){ }); }); }); The problem is it always submits the form from the first comment on the page no matter which voteUp button is clicked. I know this is because in jQuery $(this) == this[0], but I am unsure what other options are available to reference the clicked object. Anyone know how I can grab the child form of the clicked button? Here is what the html output looks like: &lt;div id="5463ce6bd6e5e5d403e80b3f" style="margin-bottom: -17px;" class="voteUp"&gt; ▲ &lt;form enctype="multipart/form-data" method="POST" class="form-horizontal"&gt; &lt;input type="hidden" name="_csrf" value="4JbLbnEcRvq7ZuAhpZCXavMq7JW/vnIZlxW/o="&gt; &lt;input type="hidden" name="commentID" value="5463ce6bd6e5e5d403e80b3f"&gt; &lt;/form&gt; &lt;/div&gt;
has answer: http://stackoverflow.com/a/26916070
has comment: http://stackoverflow.com/comment/42377095
has comment: http://stackoverflow.com/comment/42377734
has answer: http://stackoverflow.com/a/26914264
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42377087

http://stackoverflow.com/comment/42264280
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26850733
has text: I deleted my comments, but tks. that helps
score: 0

http://stackoverflow.com/comment/42494690
type: QuestionComment
has text: How do you know it's not loaded?
score: 0
comment on: http://stackoverflow.com/q/26980056
type: Comment

http://stackoverflow.com/q/26937424
possible better answer: http://stackoverflow.com/a/26937558
has answer: http://stackoverflow.com/a/26937558
linked to: http://stackoverflow.com/q/500431
tagged with: onclick
has answer: http://stackoverflow.com/a/26937474
has body: I want my Button to change color every time I click on it. But it only changes color on the first click. I believe the problem is in the setColor function. Every time I click on the Button, count gets set to 1. So even when I set it to 0, it gets reset to 1 on the next click. How do I fix this? Are there global variables in javascript/html where this would easily be solved? &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script&gt; function setColor(btn, color){ var count=1; var property = document.getElementById(btn); if (count == 0){ property.style.backgroundColor = "#FFFFFF" count=1; } else{ property.style.backgroundColor = "#7FFF00" count=0; } } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="button" id="button" value = "button" style= "color:white" onclick="setColor('button', '#101010')";/&gt; &lt;/body&gt; &lt;/html&gt;
answer count: 5
has title: Change Button color onClick
has answer: http://stackoverflow.com/a/79144201
has answer: http://stackoverflow.com/a/26937544
upvote count: 20
downvote count: 0
tagged with: button
tagged with: javascript
has answer: http://stackoverflow.com/a/62817615
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/26937544
tagged with: global
favorite count: 0
type: Question
score: 20
has comment: http://stackoverflow.com/comment/42419096

http://stackoverflow.com/a/75301399
answers question: http://stackoverflow.com/q/26980713
has body: My fix was @app.after_request def handle_options(response): response.headers["Access-Control-Allow-Origin"] = "*" response.headers["Access-Control-Allow-Methods"] = "GET, POST, PUT, DELETE, OPTIONS" response.headers["Access-Control-Allow-Headers"] = "Content-Type, X-Requested-With" return response
score: 5
upvote count: 5
downvote count: 0
type: Answer

http://stackoverflow.com/comment/42244756
comment on: http://stackoverflow.com/a/26839420
type: AnswerComment
score: 0
type: Comment
has text: one more issue....since i am using jshint .....i am getting [L63:C30] W089: The body of a for in should be wrapped in an if statement to fil ter unwanted properties from the prototype. `for (var key in filterKeys) {`

http://stackoverflow.com/q/26904616
type: Question
accepted answer: http://stackoverflow.com/a/26904825
tagged with: internet-explorer
tagged with: internet-explorer-8
has title: ng-click triggered unexpectedly by pressing Enter key in IE8
tagged with: javascript
score: 4
upvote count: 4
has body: I have a simple ng-click button nested inside ng-repeat and there're no in current page. Price & Order when the catalog array updated and user pressed ENTER without focus on any inputs. the last button element ng-click="callPricing(product)" trigger unintentionally. i tried watch document.activeElement before hitting Enter key it's How to prevent this?
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
tagged with: cross-browser
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26904825

http://stackoverflow.com/comment/42363744
has text: You could use `replaceWith()` to update the result multiple times
type: Comment
comment on: http://stackoverflow.com/a/26906443
score: 0
type: AnswerComment

http://stackoverflow.com/q/26933772
has answer: http://stackoverflow.com/a/27274753
tagged with: asp.net-mvc-4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42655877
has answer: http://stackoverflow.com/a/27086535
has comment: http://stackoverflow.com/comment/42598087
type: Question
tagged with: c#
score: 5
upvote count: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/42413130
has comment: http://stackoverflow.com/comment/42704911
tagged with: javascript
linked to: http://stackoverflow.com/q/13836636
accepted answer: http://stackoverflow.com/a/27274753
has body: I have developed a point of sale system using MVC 4.The responsiveness and loading times on Windows and Mac is instant but on an iPad it takes 8-13 seconds to load a page or perform an action such as adding items to basket. To improve the speed of the web application I enabled compression in IIS and minified all my java script files I also used bundling to bundle the following .js files together which supposedly improves loading of pages as well: jquery-1.8.2.min.js knockout-2.2.0.js jquery.easing.1.3.js b.popup.min.js(used for displaying a modal popup only 6KB) The other javascript files I use on pages are between 5KB and 15KB.After doing all this the application seems to be a few seconds quicker, but still takes unacceptably long(8-10 seconds). Has anyone experienced similar performance issues on an iPad and how did you resolve it?Is there anything else I can do to improve performance? I'm using Windows Server 2003 and IIS 6.0 Here's my bundle registration code: public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-1.8.2.min.js", "~/Scripts/jquery.easing.1.3.js", "~/Scripts/knockout-2.2.0.js", "~/Scripts/common/common.min.js", "~/Scripts/popup.min.js" )); bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css")); BundleTable.EnableOptimizations = true; } And this is where I call it on the master page: @using System.Configuration Prestige SSC @Scripts.Render("~/bundles/jquery") @RenderSection("scripts", required: false) @Styles.Render("~/Content/css") @RenderBody()
possible better answer: http://stackoverflow.com/a/27050735
has answer: http://stackoverflow.com/a/27061359
has comment: http://stackoverflow.com/comment/42473413
has answer: http://stackoverflow.com/a/27050735
has title: MVC 4 website very slow on iPad
has comment: http://stackoverflow.com/comment/42704498
answer count: 4
tagged with: ipad
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/42481747

http://stackoverflow.com/a/26943149
score: 0
type: Answer
has body: There are other options with jQuery which you can use instead of using array you can use a web method. You can go through this link http://blog.nitinsawant.com/2011/09/integrating-jquery-ui-autocomplete-in.html There are many question asked to SO all ready like Jquery autocomplete .NET WebMethod Jquery AutoComplete with database You need to create a web method or generic http handler as use it as source for you auto complete.
answers question: http://stackoverflow.com/q/26943051

http://stackoverflow.com/comment/42312270
type: Comment
type: QuestionComment
has text: Yeah your increment isn't an increment at all.
score: 0
comment on: http://stackoverflow.com/q/26877584

http://stackoverflow.com/comment/42459627
comment on: http://stackoverflow.com/a/26959775
score: 0
type: Comment
has text: *How* exactly is my answer worse? The other answer gives incorrect information *and* advertises.
type: AnswerComment

http://stackoverflow.com/comment/42304797
type: QuestionComment
comment on: http://stackoverflow.com/q/26872935
score: 0
has text: Two things are possible. The element doesn't exist-->double check. Or, the DOM isn't ready. In which case wrap everything in `$(function() {});`
type: Comment

http://stackoverflow.com/comment/42428242
score: 0
type: Comment
type: QuestionComment
has text: You read correct but don't use `click` now, `bind` is enough.
comment on: http://stackoverflow.com/q/26942146

http://stackoverflow.com/a/26957151
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/26949406
type: Answer
has body: Thank you for your reply. I finally did it using sessionStorage. Here is the code $(document).ready(function(){ $(":image").click(function(){ sessionStorage.scrolly=$(window).scrollTop(); }); if (sessionStorage.scrolly) { $(window).scrollTop(sessionStorage.scrolly); sessionStorage.clear(); } });

http://stackoverflow.com/a/26901573
answers question: http://stackoverflow.com/q/26901517
has comment: http://stackoverflow.com/comment/42357369
has comment: http://stackoverflow.com/comment/42356920
has comment: http://stackoverflow.com/comment/42356962
has comment: http://stackoverflow.com/comment/42355736
score: 0
has comment: http://stackoverflow.com/comment/42356203
has comment: http://stackoverflow.com/comment/42357024
has comment: http://stackoverflow.com/comment/42356363
type: Answer
has comment: http://stackoverflow.com/comment/42357079
has comment: http://stackoverflow.com/comment/42355475
has body: confirm('Do you want to delete it ..!!') it returns true or false on the basis of what button you have clicked.. better to write a separate function and include it in your JavaScript file and call like the above way you are doing.. else you have to write the whole code inline, but looks messy.. ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "confirm", "" + "document.body.onload = function(){"+ "if(confirm('Do you want to delete it ..!!')==false)" + "{" + "document.getElementById('myTextBox').value='';" + "}"+ "}", true);
has comment: http://stackoverflow.com/comment/42355346
has comment: http://stackoverflow.com/comment/42355962
has comment: http://stackoverflow.com/comment/42356229
accepted answer of: http://stackoverflow.com/q/26901517
has comment: http://stackoverflow.com/comment/42356338
type: AcceptedAnswer

http://stackoverflow.com/q/26860657
tagged with: events
tagged with: callback
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26860776
has body: I have controller init method which initialize autocomplete input in template: $scope.initAutoCompleteForWorkers = function (id) { // INIT AUTOCOMPLETE FOR WORKERS var promise = GlobalHelperService.workersListForAutocomplete(); promise.then( function(answer) { // do something console.log("Answer"); console.log(answer); console.log("Name" + answer.name); console.log("Surname" + answer.surname); //$scope.projectDetail.newWorker = ""; //$scope.projectDetail.newWorkerName = ""; $scope.projectDetail.newWorker = answer; $scope.projectDetail.newWorkerName = answer.name +" "+answer.surname ; }, function(error) { // report something console.log("Error"); console.log("Processing error with status " +status); growlNotifications.add($translate.instant('PROCESSING_REQUEST_ERROR') + jsonResponse.message , 'error', $rootScope.notificationLifetime); }, function(progress) { // report progress console.log("Progres"); }); }; This is init method which should returned deffered.resolve after the each select event. this.workersListForAutocomplete = function (container, options) { var deferred = $q.defer(); $("#autocompleteWorker").kendoAutoComplete({ dataSource : { type: "json", serverFiltering: true, transport: { read: function (options) { console.log("List"); console.log(options.data); requestParams = { "entityName": "worker", "page": 1, "pageSize": 20, "filter": options.data.filter, "sort": [ { "field": "name", "ord": "asc" } ] }; ApiService.doHttpRequest( "POST", $rootScope.apiBaseUrl + "worker/search", requestParams ) .success(function (data, status, headers, config) { // successful data retrieval console.log("request success, checking state"); console.log(data); // sent status to global HTTP status service var jsonResponse = ApiService.processReturnedHttpState(status); console.log("Status response is " + jsonResponse.result); // do something with data switch (jsonResponse.result) { case true: options.success(data.results); break; case false: growlNotifications.add($translate.instant…
type: Question
tagged with: javascript
has title: How to refactor Angular promise to Callback?
score: 0
answer count: 1

http://stackoverflow.com/q/26833414
accepted answer: http://stackoverflow.com/a/26833667
answer count: 1
favorite count: 0
upvote count: 1
tagged with: faye
has body: I am new to node.js I am trying to use the pub/sub faye nodemodule to create a publish/subscribe web application. I have the following files and folders: My dependencies in the node_modules folder, a sever.js file, and a client.js My server.js contains the following code: var http = require('http'), faye = require('faye'); var server = http.createServer(), bayeux = new faye.NodeAdapter({mount: '/'}); bayeux.attach(server); server.listen(8000); As for my client.js file, it contains the following code: var faye = require('faye') var client = new faye.Client('http://localhost:8000/'); client.subscribe('/messages', function(message) { alert('Got a message: ' + message.text); }); client.publish('/messages', { text: 'HAI!' }) I go to my terminal and run node server.js and node client.js When I go to my browser and run localhost:8000, all I get is a Bad request. Why am I getting this? I am suspecting I don't have any page to display something. Could someone please point out to me what I am missing. Thanks.
tagged with: node.js
has answer: http://stackoverflow.com/a/26833667
type: AnsweredQuestion
score: 1
has title: Why do I get a Bad request when I run server.js and client.js and access localhost?
type: Question
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/42406819
score: 0
type: AnswerComment
type: Comment
has text: what are you starting with?
comment on: http://stackoverflow.com/a/26930793

http://stackoverflow.com/q/26977327
has comment: http://stackoverflow.com/comment/42489352
has comment: http://stackoverflow.com/comment/42492582
has comment: http://stackoverflow.com/comment/42492081
answer count: 0
has comment: http://stackoverflow.com/comment/42492670
type: UnansweredQuestion
tagged with: cognos-10
has comment: http://stackoverflow.com/comment/42506286
has comment: http://stackoverflow.com/comment/42492641
has comment: http://stackoverflow.com/comment/42490505
has comment: http://stackoverflow.com/comment/42492835
type: Question
has body: I have some HTML buttons that I created that bring up different value prompts and to the right of them is a submit button. Everything works great the first few times. But everytime on the third time I push the submit button, everything goes white, the report re-loads, and my value prompts are moved to the bottom of the report. I have other reports that use JavaScript and after a certain amount of times of pushing the submit button the reports goes white reloads and thigns don't work. I was wondering if anyone knew why Cognos does this. I am using 10.2.1 report studio. Any help would be greatly appreciated. var ftw = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() : document.forms["formWarpRequest"]); var button = ftw._textEditBoxbuttonBox.value; skillGroupButtons(button); function skillGroupButtons(Elmt){ var firstPrompt = ftw._oLstChoicesfirsttPrompt; var secondPrompt = ftw._oLstChoicessecondPrompt; var SS = ftw._oLstChoicesSSPrompt; ftw._textEditBoxbuttonBox.value = Elmt; if (ftw._textEditBoxbuttonBox.value == "first"){ document.getElementById('first').style.visibility = "visible"; document.getElementById('second').style.visibility = "hidden"; document.getElementById('SS').style.visibility = "hidden"; document.getElementById('first').checked = true; SS.options[0].selected = true; second.options[0].selected = true; for (var count=1;count &lt;second.length; count++){ second.options[count].selected= false; } } else if ( ftw._textEditBoxbuttonBox.value== "SS"){ document.getElementById('first').style.visibility = "hidden"; document.getElementById('SS').style.visibility = "visible"; document.getElementById('second').style.visibility = "hidden"; document.getElementById('SS').checked=true; first.options[0].selected=true; second.options[0].selected=true; for (count=1;count &lt;second.length; count++){ second.options[count].selected= false; } } else { document.getElementById('first').style.visibility = "hidden"; document.getElementById('SS').style.visibility…
has title: My Javascript function breaks my cognos report after I hit submit 3 times
has comment: http://stackoverflow.com/comment/42492282
tagged with: javascript
tagged with: cognos-bi
has comment: http://stackoverflow.com/comment/42492460
score: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/26961243
has comment: http://stackoverflow.com/comment/42809686
answers question: http://stackoverflow.com/q/26961015
type: Answer
has comment: http://stackoverflow.com/comment/42461321
has comment: http://stackoverflow.com/comment/42736530
has comment: http://stackoverflow.com/comment/42724823
has body: Separate the formatting from the value. Use float to preserve low order positions in case you ever want to use fractional prices. Test with gildan and XXL. (update with correction - price.toFixed(2)) Working example here Shirt Type Basic Shirt (€20.00) Poly-Cotton Blend (€25.00) Gildan Cotton (€28.30) Organic Cotton (€30.00) PRICE: €XX.XX Shirt Size Choose Size Small Medium Large XL XXL XXXL
score: 0
has comment: http://stackoverflow.com/comment/42463432

http://stackoverflow.com/q/26968008
tagged with: colors
has body: Why in this script label color still black? plotOptions: { series: { dataLabels: { enabled: true, color: ['#7cb5ec', '#434348'], } } }
accepted answer: http://stackoverflow.com/a/26968198
type: AnsweredQuestion
score: 0
has title: How to change label colors in Highcharts
type: Question
tagged with: highcharts
tagged with: javascript
tagged with: label
has answer: http://stackoverflow.com/a/26968198
answer count: 1

http://stackoverflow.com/q/26853925
score: 0
has answer: http://stackoverflow.com/a/26853986
answer count: 2
tagged with: jquery
has answer: http://stackoverflow.com/a/26854259
linked to: http://stackoverflow.com/q/7055269
tagged with: css
type: AnsweredQuestion
has title: Have created a click effect for a single image, but would like to have the other images have the same effect
type: Question
accepted answer: http://stackoverflow.com/a/26854259
has body: I'm at a point where I've tried every other option, but I can't seem to solve this problem. Here's an explanation of the experience: When visiting the page, the person is introduced to a number of images (tagged with classes, for example two of the images are tagged img01 and img02). When an image is clicked, the image maintains it's place (img01's z-index is risen) while all the other images fade away (DIV with a white fill fades in and covers img02), and a text that explains the piece fades in as well (DIV tagged object-text with img01's supporting text fades in). While I got the img01 functionality to work, I can't seem to do the same for img02. I'm also planning on adding more tags (such as img03 and img04) and am wondering if there is a smarter, more effective way this can be structured. For functionality reference, here's a http://jsfiddle.net/kenhimself/nvwzgus0/4/ Below, is the html, css, and the java code. Thanks in advance! html img01 Text img01 Text img02 Text img02 Text CSS html, body { width:100%; height:100%; } #object { top: 100px; left:100px; } #object-text { display:none; z-index:100000; bottom: 0; left: 0; } #filler { display:none; width:100%; height:100%; position:fixed; background-color: white; z-index:1000; opacity: 0.8; } h1 { font-size:20px; font-family: sans-serif; font-weight: 100; font-style: normal; color: red; } .img01, .img02 { position:absolute; } .img01 img, .img02 img { width:200px; height:auto; } .img01 { top: 20px; left: 20px; } .img02 { top: 20px; right: 20px; } Javascript $("#object").click(function (e) { e.stopPropagation(); }); $("#object").click(function (e) { e.preventDefault(); e.stopPropagation(); $("#object").css("z-index", "2000"); $("#object-text").fadeIn("slow"); $("#filler").fadeIn("slow"); $("#inner").css("z-index", "2000"); }); $(document).click(function () { $("#filler").fadeOut("slow"); $("#object-text").fadeOut("slow"); });
tagged with: javascript
tagged with: image
possible better answer: http://stackoverflow.com/a/26853986

http://stackoverflow.com/q/26951671
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/42445518
tagged with: javascript
has comment: http://stackoverflow.com/comment/42444492
favorite count: 0
answer count: 0
tagged with: angularjs
has title: AngularJS directive not using own scope
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42462033
has body: I am struggling with a problem with AngularJS directives. I tried to copy all relevant code to a JSFiddle here: http://jsfiddle.net/roger21/07mje0uw/1/ but noticed it only works in Chrome. The directive has an isolated scope defined like this: this.scope = { values: "=", min: "@", max: "@", step: "@" }; The controller scope contains the value it binds to: $scope.response = [ { "Day": "Monday", "Times": [ { "Time": "06:00:00", "Temperature": 16.5 }, { "Time": "08:00:00", "Temperature": 21.0 }, { "Time": "18:00:00", "Temperature": 21.0 }, { "Time": "22:00:00", "Temperature": 16.5 } ] }, { "Day": "Tuesday", "Times": [ { "Time": "06:00:00", "Temperature": 16.5 }, { "Time": "08:00:00", "Temperature": 21.0 }, { "Time": "18:00:00", "Temperature": 21.0 }, { "Time": "22:00:00", "Temperature": 16.5 } ] }]; The directive is then created like this: &lt;div data-slider data-values="response[0].Times" data-min="0" data-max="1440" data-step="5"&gt;&lt;/div&gt; When you move the slider it updates the values property in the directive, and then it updates the object in the controller, as expected. But now I add a second instance of the directive: &lt;div data-slider data-values="response[0].Times" data-min="0" data-max="1440" data-step="5"&gt;&lt;/div&gt; &lt;div data-slider data-values="response[1].Times" data-min="0" data-max="1440" data-step="5"&gt;&lt;/div&gt; Now when I move the first slider is actually is bound to the values of response[1].Times, and it updates the values for that object! I must be something missing with isolating the scopes here?
tagged with: angularjs-directive
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/42445226

http://stackoverflow.com/q/26895466
has comment: http://stackoverflow.com/comment/42344553
has comment: http://stackoverflow.com/comment/42346682
tagged with: css
has comment: http://stackoverflow.com/comment/42344375
has comment: http://stackoverflow.com/comment/42344400
type: AnsweredQuestion
upvote count: 0
score: -5
has comment: http://stackoverflow.com/comment/42344373
has comment: http://stackoverflow.com/comment/42344492
type: Question
has comment: http://stackoverflow.com/comment/42345950
has comment: http://stackoverflow.com/comment/42344690
tagged with: javascript
has comment: http://stackoverflow.com/comment/42345627
has comment: http://stackoverflow.com/comment/42346752
tagged with: forms
has comment: http://stackoverflow.com/comment/42345655
has title: Why won't my button run my javascript
has comment: http://stackoverflow.com/comment/42346155
accepted answer: http://stackoverflow.com/a/26896343
has comment: http://stackoverflow.com/comment/42345695
answer count: 1
tagged with: jquery
has body: Hi im having trouble figuring out why my button will not work below is my code any help is appreciated. basically once i hit button it should either print story with typed in words or if a spot is left blank story doesnt show and box thats missing characters is surrounded with red border thanks. HTML code: assignment2 Fill in the blanks and then press the submit button. Adjective Adjective Plural Noun Verb (ending in "ing") Edible object Monster Adjective Monster (again) Verb (ending in "ing") View Story Rain was still lashing the windows, which were now , but inside all looked bright and cheerful. The firelight glowed over the countless where people sat , talking, doing homework or, in the case of Fred and George Weasley, trying to find out what would happen if you fed a to a . Fred had "rescued" the , fire-dwelling from a Care of Magical Creatures class and it was now gently on a table surrounded by a knot of curious people. Javascript code: $(document).ready( function() { $('#story p').hide(); $('#form1').on('submit', function(event) { for(var i=0 ;i<$('#form1 input').length; i++) //tyler suggested this to make it easier fo my error borders. { $('#form1 input').eq(i).removeclass("errorborder"); } if (!formFilled()){ event.preventDefault(); } else { $('span.adjective').html($('#form1 input#adjective').val()); $('span.adjective2').html($('#form1 input#adjective2').val()); $('span.pluralnoun').html($('#form1 input#pluralnoun').val()); $('span.verb').html($('#form1 input#verb').val()); $('span.edibleobject').html($('#form1 input#edibleobject').val()); $('span.monster').html($('#form1 input#monster').val()); $('span.adjective3').html($('#form1 input#adjective3').val()); $('span.monster2').html($('#form1 input#monster2').val()); $('span.verb2').html($('#form1 input#verb2').val()); $('#story p').show(); event.preventDefault(); //Tyler informed me this would stop the page from refreshing and deleting the inputted words. } }); function formFilled(){ var filled=true; for(v…
favorite count: 0
has answer: http://stackoverflow.com/a/26896343
downvote count: 5
has comment: http://stackoverflow.com/comment/42344363
has comment: http://stackoverflow.com/comment/42344369
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/42488078
comment on: http://stackoverflow.com/q/26976634
score: 1
has text: Loop throguh on all of your divs, and the the id of them into an array. Create another embty array, called, `clickedDivs`. When a div clicked, check is there the id of it in `clickedDivs`. If not, then `push` it. Every time, you can compare the two arrays. If they are the same, then all div has clicked.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42499738
type: AnswerComment
score: 0
type: Comment
has text: Yes. I tried this with no luck: var request = { placeId: place.place_id }; service.getDetails(request, function(details, status) { google.maps.event.addListener(function() { placesList.setContent(details.name + " " + details.formatted_address +" " + details.website + " " + details.rating + " " + details.formatted_phone_number); placesList.innerHTML += ' ' + details.name + ' '; infowindow.open(map, this); }); }); } google.maps.event.addDomListener(window, 'load', initialize);
comment on: http://stackoverflow.com/a/26982693

http://stackoverflow.com/a/26877612
answers question: http://stackoverflow.com/q/26877390
has body: This is a well-known restriction of Chrome Apps, and the solutions are well-documented as well. For example, here's the problem and the solution on Google's doc page: https://developer.chrome.com/apps/app_external#external Basically, you download the image bits with XMLHttpRequest, get the bits as a blob, form that blob into a data URL, and use that URL in the img element.
type: Answer
downvote count: 0
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26877390
type: AcceptedAnswer

http://stackoverflow.com/comment/42297200
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26854218
has text: Thanks for noticing btw, @skobaljic. Just gave you a vote for it.

http://stackoverflow.com/comment/42639952
type: Comment
has text: Yes, exactly. So I just want that when i click myaccount, onblur doesn't be active and run GoAddress JavaScript.
comment on: http://stackoverflow.com/a/26984896
type: AnswerComment
score: 0

http://stackoverflow.com/comment/42314710
has text: I tried both your solutions. Still getting the same error.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26878615
type: Comment

http://stackoverflow.com/comment/42289223
comment on: http://stackoverflow.com/a/26864864
type: Comment
has text: thanks .... noted bout cross domain, but the thing on same domain... aint happening mate..... im testing this out of localhost...i have a big list of images on a page..... trying to load that but no dice.
score: 0
type: AnswerComment

http://stackoverflow.com/a/26940553
has body: It might seem's stupid but maybe you should do two meteor app, one with the browser and server and the mobile version as a standalone connected to the server. You will have to share the global and server folders during the dev part but it might be the most direct working way to do so. On my side I'm doing identical for web and app so I don't get your issue...
has comment: http://stackoverflow.com/comment/42913487
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42914997
has comment: http://stackoverflow.com/comment/42432648
type: Answer
accepted answer of: http://stackoverflow.com/q/26937506
answers question: http://stackoverflow.com/q/26937506
score: 1
upvote count: 1

http://stackoverflow.com/comment/42451162
has text: Note that `load` uses Ajax, and some browsers do not allow using Ajax when there is no web server. This is probably the next problem.
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/26955792

timer
tag name: timer
tags question: http://stackoverflow.com/q/26876092
tags question: http://stackoverflow.com/q/26916368
type: Tag
tags question: http://stackoverflow.com/q/26912599
tags question: http://stackoverflow.com/q/26857412
tags question: http://stackoverflow.com/q/26963728
tags question: http://stackoverflow.com/q/26950645
tags question: http://stackoverflow.com/q/26965439

http://stackoverflow.com/q/26963668
tagged with: arrays
answer count: 1
downvote count: 0
favorite count: 0
has title: Creating a d3 horizontal bar chart with a multidimensional array/nested json file
tagged with: d3.js
type: UnansweredQuestion
has body: I'm trying to create a simple d3 bar chart (http://bost.ocks.org/mike/bar/2/) using the following nested json file. { "clustername": "cluster1", "children": [ { "neighborhoodname": "Shaw", "children": [ { "totpop2000": "1005", "children": [ { "name": "demographic", "children": [ {"name": "Black", "size2000":0.18}, {"name": "White", "size2000":0.6}, {"name": "Hispanic", "size2000":0.40}, {"name": "Asian", "size2000":0.10} ] }, { "name": "wellbeing", "children": [ {"name": "Unemployment", "size2000":0.40}, {"name": "Poverty", "size2000":0.1}, {"name": "Without HS Education", "size2000":0.31} ] }, { "name": "crime", "children": [ {"name": "Violent Crime", "size2000":0.09}, {"name": "Property Crime", "size2000":0.08} ] }, { "name": "housing", "children": [ {"name": "Home Ownership", "size2000":0.34}, {"name": "Houses for Rent", "size2000":0.50} ] } ] } ] } ] } So far, my javascript includes the following for adding the amounts labeled as size2000 to the svg but when I run the code I can't seem to append the appropriate array of data (i.e. I get the first array/"clustername": "cluster1") in my json file. var data = d3.json("data/test.json", function(json) { console.log(json); var bar = chart2000.selectAll("g") .data(data) .enter().append("g") .attr("transform", function(d, i) { return "translate(0," + i * height + ")"; }); bar.append("rect") .attr("width", function(d) { return x((d.size2000)*100); }) .attr("height", height - 1); bar.append("text") .attr("x", function(d) { return x((d.size2000)*100) - 3; }) .attr("y", height / 2) .attr("dy", ".35em") .text(function(d) { return (d.size2000)*100); }); }); Is there a way to keep the json data structure and append the size2000 values to a svg? If so, how?
has answer: http://stackoverflow.com/a/26963973
score: 1
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
type: Question
tagged with: appendchild
tagged with: javascript

http://stackoverflow.com/a/26912673
score: 1
answers question: http://stackoverflow.com/q/26912464
has body: But why then completing the previous function calls - 1 and 2 outputs them in the yellow section, and not in the blue, it's not me that's understandable. Because after executing f(3), function is not terminated and is awaiting for completion of f(2) call. When it is done, then it goes further and writes 3 into yellow div. And so on for each counter. Imagine f calls not itself inside but some other function myFunc. It waits until myFunc is ended. With recursion the same flow.
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/comment/42385606
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26918490
has text: @MiaGilin See the updated answer. It includes `e.preventDefault();` to prevent the default link behavior instead of `return false`.

http://stackoverflow.com/comment/42316381
comment on: http://stackoverflow.com/a/26878995
score: 0
type: AnswerComment
has text: I follow ur code and I got this Uncaught TypeError: Cannot read property 'onClicked' of undefined
type: Comment

http://stackoverflow.com/comment/42436258
type: QuestionComment
comment on: http://stackoverflow.com/q/26946535
score: 1
has text: Show how you use this function. It seems you are having problems related to other asynchronous code
type: Comment

http://stackoverflow.com/comment/42740079
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27117909
has text: Thanks for your research and expertise! I'll sleep better knowing I'm not the only one to think it's a bug.

http://stackoverflow.com/q/26917560
tagged with: jquery
has answer: http://stackoverflow.com/a/26917598
has body: I need to work around a limitation on my company's platform where pages can only be rendered with the filename as the title. I don't want to change my file-names to have values like, "This page title with spaces, and maybe illegal characters", because I don't want my URLs to have a bunch %20's and illegal characters in them, so I've been trying to figure out how to use the contents of another section of the page over which I do have control - the breadcrumb - as the "title". I've been trying to use jQuery's .get and .replaceWith to replace the contents of the title tag with the contents of span.ms-pagetitle, which contains the part I can edit, but I'm a jQuery noob, and just haven't been able to suss it out.
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
score: 1
tagged with: replacewith
accepted answer: http://stackoverflow.com/a/26917598
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/42383686
tagged with: javascript
has title: Using jQuery to get the content of div.class to replace content of title tag
downvote count: 0
answer count: 1

http://stackoverflow.com/q/26859521
type: UnansweredQuestion
tagged with: javascript
tagged with: angularjs
type: Question
has body: I wrote as provider in application as below; module.provider('CalculateTime', function() { this.$get = function() { var seconds = this.seconds; var minutes = this.minutes; var hours = this.hours; var day = this.day; return { toSeconds: function(){ return Math.round(seconds); }, toMinutes: function(){ return Math.round(minutes); }, toHours: function(){ return Math.round(hours); }, toDays: function(){ return Math.round(day); }, exactDate: function(){ return Math.floor(hours%24)+":"+ Math.floor(minutes%60)+":"+ Math.floor(seconds%60); } } }; this.setTime = function(milis) { this.milis = milis; this.seconds = this.milis/1000; this.minutes = this.seconds/60; this.hours = this.minutes/60; this.day = this.hours/24; }; }); and I want to set config inside of controller ( after finished some preparation and set it up). So I tried as follows; module.controller('ResultController',function($scope,$data,CalculateTime){ var date = $data.post.date; given.setDate(date.selectedYear,date.selectedMonth,date.selectedDay); var now = new DateTime(); var diff = now.compare(given); // config here module.config(function(CalculateTimeProvider){ CalculateTimeProvider.setTime(diff); }); setTimeout(function() { $scope.$apply(function() { $scope.result = CalculateTime.toDays() + " Days " + CalculateTime.exactDate(); }); }, 100); $scope.result is become null and nothing come out. I know that I'm wrong in usage and still don't know correct way to use whether service or provider or factory. Please tell me about correct ways of setting and retrieving.
score: 0
has title: how to set config inside of controller
answer count: 1
has answer: http://stackoverflow.com/a/26859667

http://stackoverflow.com/comment/42471301
type: Comment
has text: I guess there must be a usable one out there, somewhere. Since the OP's original problem is so small-scale, writing 3 lines of code that do exactly that seems like an appropriate solution.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26966515

http://stackoverflow.com/q/26971024
has comment: http://stackoverflow.com/comment/42495364
type: UnansweredQuestion
has title: Ajax codeigniter, loading too fast on success. .done
tagged with: php
tagged with: codeigniter
has answer: http://stackoverflow.com/a/26982635
type: Question
has comment: http://stackoverflow.com/comment/42478903
has comment: http://stackoverflow.com/comment/42481199
has body: I have only been working with ajax for under a week now trying to use it with codeigniter to create a pretty complex ajax menu system. The user can add new sections to the menu system as they work on it. I have ajax code posting to the database and on success adding it to the menu system. The problem I am having is that the code is running before the update is made to the database. So instead of getting the new menu section I just get a copy of the latest menu before making the addition. If I wait a moment and make the call manually with a button I attached with the ajax call instead of using .done this works fine. This is my ajax call // this is attached to my form to add a menu section $(function(){ $('#add_category_form').submit(function(evnt){ evnt.preventDefault(); var posting = $.post(base_url+"/menu/add_category", $("#add_category_form").serialize()); posting.done(newCategory()); }); //calls view to generate menu section function newCategory(){ $.ajax({ 'url' : base_url + '/' + controller + '/new_category', 'type' : 'POST', // 'success' : function(data){ var container = $('#testcontainer'); if(data){ container.html(data); } } }); } // view &lt;?php $count = count($menu)+1; $counter=0; foreach ($menu as $category) { $counter++; if ($count == $counter) { echo "menu html goes here of last menu created"; } } ?&gt;
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
answer count: 1

http://stackoverflow.com/a/26931506
has body: I were you, I'd wrap all words with &lt;span&gt; tags beforehand and just change the class on click. This might look like $( 'p' ).html(function( _, html ) { return html.split( /\s+/ ).reduce(function( c, n ) { return c + '&lt;span&gt;' + n + ' &lt;/span&gt;' }); }); and then we could have a global handler, which listens for click events on &lt;span&gt; nodes $( document.body ).on('click', 'span', function( event ) { $( event.target ).addClass( 'touch' ); }); Example: http://jsfiddle.net/z54kehzp/ I modified @Jonast92 solution slightly, I like his approach also. It might even be better for huge data amounts. Only caveat there, you have to live with a doubleclick to select a word. Example: http://jsfiddle.net/5D4d3/106/
downvote count: 0
type: Answer
score: 6
has comment: http://stackoverflow.com/comment/42408157
upvote count: 6
has comment: http://stackoverflow.com/comment/42408240
answers question: http://stackoverflow.com/q/26931274
has comment: http://stackoverflow.com/comment/42408073
has comment: http://stackoverflow.com/comment/42408335

http://stackoverflow.com/q/26991825
has comment: http://stackoverflow.com/comment/42515575
upvote count: 1
tagged with: regex
has body: I'm interested in a Unicode capable alternative for the JavaScript word boundary escape sequence "\b". The problem with \b is it's limited to ASCII characters which fails for words like "Münster". I am not looking for a universal valid-for-all-languages solution. I just target Latin based languages (e.g. English, German, French, ... etc). I wonder if there is something which builds on Unicode character categories (see here)
has title: Is there a unicode capable alternative for word boundary escape sequence "\b"?
tagged with: word-boundary
type: Question
has comment: http://stackoverflow.com/comment/42612384
downvote count: 0
tagged with: javascript
tagged with: unicode
score: 1
has comment: http://stackoverflow.com/comment/42655924
favorite count: 0
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/26978763
answers question: http://stackoverflow.com/q/26967265
score: 0
type: Answer
has body: e.preventDefault(); should be the first line. So: $(".signup-form").submit(function(e){ // This should be line one e.preventDefault(); var createUrl = $('.tutor-checkbox').is(':checked') ? serverUrls.createTutor : serverUrls.createStudent; // etc etc })
has comment: http://stackoverflow.com/comment/42503798

http://stackoverflow.com/a/26974487
has comment: http://stackoverflow.com/comment/131463936
score: 35
upvote count: 39
type: Answer
has comment: http://stackoverflow.com/comment/42484422
has comment: http://stackoverflow.com/comment/99609163
has body: Since JS is dynamical language just rewrite original functions. var originalSetItem = localStorage.setItem; localStorage.setItem = function(){ document.createEvent('Event').initEvent('itemInserted', true, true); originalSetItem.apply(this, arguments); }
accepted answer of: http://stackoverflow.com/q/26974084
has comment: http://stackoverflow.com/comment/42485697
has comment: http://stackoverflow.com/comment/118824549
answers question: http://stackoverflow.com/q/26974084
downvote count: 4
has comment: http://stackoverflow.com/comment/61232594
has comment: http://stackoverflow.com/comment/118824599
type: AcceptedAnswer

http://stackoverflow.com/q/26944467
has body: I have a JavaScript function in page header for changing visibility of stuffs in the page: &lt;script type="text/javascript"&gt; // &lt;![CDATA[ function toggleVis(id1, id2, id3) { var element = document.getElementById(id1).style.visibility; if (element == 'hidden') { document.getElementById(id1).style.visibility = 'visible'; document.getElementById(id2).style.visibility = 'visible'; document.getElementById(id3).style.visibility = 'visible'; } else { document.getElementById(id1).style.visibility = 'hidden'; document.getElementById(id2).style.visibility = 'hidden'; document.getElementById(id3).style.visibility = 'hidden'; } } // ]]&gt; &lt;/script&gt; It works when I use it in updatepanel with radio button: &lt;dx:ASPxRadioButton ID="RB1" CssClass="btnInline" runat="server" Text="Yes"&gt; &lt;ClientSideEvents CheckedChanged="function(s, e) { toggleVis('Label33', 'textbox','Label34');}" /&gt; &lt;/dx:ASPxRadioButton&gt; &lt;dx:ASPxLabel ID="Label33" CssClass="btnInline" runat="server" Text="Label33" Style="visibility: hidden" /&gt; &lt;dx:ASPxTextBox ID="textbox" CssClass="btnInline" runat="server" Style="visibility:hidden" Width="40px" /&gt; &lt;dx:ASPxLabel ID="Label34" CssClass="btnInline" runat="server" Text="Label34" Style="visibility: hidden" /&gt; The problem is when I click a button for clearing the form, after that the javascript doesn't work by checking the radio button. I have tried some stuffs that are in the internet, but I couldn't make it, sorry for my english.
downvote count: 0
type: UnansweredQuestion
score: 1
has answer: http://stackoverflow.com/a/26944563
type: Question
has title: run javascript after updatepanel partial postback
answer count: 2
upvote count: 1
tagged with: javascript
tagged with: asp.net
favorite count: 0
has answer: http://stackoverflow.com/a/26944496
tagged with: devexpress

http://stackoverflow.com/q/26952904
has answer: http://stackoverflow.com/a/26954508
has title: How do I autocomplete on submit with twitter typeahead?
type: Question
tagged with: javascript
tagged with: twitter-typeahead
score: 0
has body: When a hint is shown using twitter typeahead I would like that to replace the query when a user clicks submit. Example the user types in mo, the hint shows montana and the user can click submit and montana is submitted. This is the same functionality if a use presses the right arrow key.
tagged with: typeahead.js
accepted answer: http://stackoverflow.com/a/26954508
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/42446593
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42463269
has comment: http://stackoverflow.com/comment/42446796

http://stackoverflow.com/comment/42504254
type: Comment
has text: the answer you have explained and the question the OP said is entirely dfferent
comment on: http://stackoverflow.com/a/26985385
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42462635
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26962278
has text: @Aravind: `Function` was not either, but is `instanceof Object`

http://stackoverflow.com/comment/42432133
comment on: http://stackoverflow.com/q/26944680
type: Comment
type: QuestionComment
score: 1
has text: Not really, you probably want `map` not `every`.

http://stackoverflow.com/comment/42495585
score: 0
has text: Regarding code size, this would certainly be less redundant: `function and(a, b) { return (a===true) && (b===true); }`
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26980215

http://stackoverflow.com/a/26889114
has comment: http://stackoverflow.com/comment/42332640
type: Answer
has body: Replace with and in your JavaScript code you have a typo. function ypopup() { document.getElementById("y").onclick= function(){ var overlay = document.getElementById("overLay"); var popup = document.getElementById("yPopup"); overlay.style.display = "block"; popup1.style.display = "block"; // Here the popup1 is undefined change it to popup.style..... } } Edit :--> I've changed your code to hide the popup, if you click on the greyed out section. Fiddle HTML: Link 1 Link 2 JavaScript: var overlay = document.getElementById("overLay"); var xpopup = document.getElementById("xPopup"); var ypopup = document.getElementById("yPopup"); document.getElementById("x").onclick = function () { overlay.style.display = "block"; xpopup.style.display = "block"; }; document.getElementById("y").onclick = function () { overlay.style.display = "block"; ypopup.style.display = "block"; }; overlay.onclick = function () { overlay.style.display = "none"; xpopup.style.display = "none"; ypopup.style.display = "none"; };
has comment: http://stackoverflow.com/comment/42339001
has comment: http://stackoverflow.com/comment/42335951
accepted answer of: http://stackoverflow.com/q/26889028
has comment: http://stackoverflow.com/comment/42336670
has comment: http://stackoverflow.com/comment/42336153
answers question: http://stackoverflow.com/q/26889028
score: 0
has comment: http://stackoverflow.com/comment/42333562
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42337106

http://stackoverflow.com/comment/42471028
comment on: http://stackoverflow.com/q/26967048
has text: http://stackoverflow.com/questions/750486/javascript-closure-inside-loops-simple-practical-example
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/42349345
score: 0
type: Comment
has text: well, now this is turning in to a different question. I believe my answer solve your original question? in this; first of, you have not initialized your variable, and yes, because it's set in the callback, and the code just "keep running", it is undefined when you log it
comment on: http://stackoverflow.com/a/26894414
type: AnswerComment

http://stackoverflow.com/comment/42501504
type: QuestionComment
comment on: http://stackoverflow.com/q/26983490
score: 0
has text: *getDate* returns a Number, so `Number(getDate())` returns exactly the same value as `getDate()`. [*Number.prototype.toString*](http://ecma-international.org/ecma-262/5.1/#sec-15.7.4.2) returns a string, not the window (global) object.
type: Comment

http://stackoverflow.com/q/26919942
tagged with: angularjs
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/18487403
type: Question
tagged with: scrollbar
has title: How do I force the horizontal scroll move to the right on UI-GRID
answer count: 1
tagged with: javascript
tagged with: ng-grid
has body: I would like to create a function that would manually position the horizontal scroll bar to the furthest right. I am having a hard time figuring out how to achieve this effect. There was a previous stackoverflow question (How do I scroll an ngGrid to show the current selection?) similar to mine, but the solution was for NgGrid, an older version of ui-grid. A user posted the solution on getting the ngGrid version to work (http://plnkr.co/edit/oyIlX9?p=preview). $scope.scrollTo = function() { var grid = $scope.gridOptions.ngGrid; grid.$viewport.scrollTop(grid.rowMap[$scope.index] * grid.config.rowHeight); }; I tried to use the same code for ui-grid, but this newer version doesn't seem to have $viewport. I created a plunker to see an example of what I am working on. The horizontal scroll bar initially starts at the furthest left. I would like to write some code to move it to the furthest right. http://plnkr.co/edit/SJEoPxelB2HYHLsfZ768?p=preview If anyone can help me, that would be great :)
score: 0
has answer: http://stackoverflow.com/a/29760191
tagged with: angular-ui-grid

http://stackoverflow.com/a/34392470
answers question: http://stackoverflow.com/q/26849677
upvote count: 2
score: 1
downvote count: 1
has body: Yes, you can invoke it from AJAX. Just pass the request with the following header: withCredentials: true
type: Answer

http://stackoverflow.com/comment/42495238
comment on: http://stackoverflow.com/a/26962465
type: Comment
score: 1
has text: Yes, agree it's valid JSON but that doesn't make it right. The previous API ("shopping API") FindItemsAdvanced call didn't return the results in this odd manner. Will resort to converting XML to JSON as described [here](http://stackoverflow.com/questions/8830599/php-convert-xml-to-json#19391553) - this gives the results in the form I want them without having to add [0] to each element.
type: AnswerComment

http://stackoverflow.com/q/26880173
type: Question
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/26880213
score: 0
answer count: 1
has body: I wanted to get fifth level child value from json object with easiest way without using any third party library. this is the json object. var datas = { "one": [ { "name": "name1", "two": [ {"name": "name2"}, {"name": "name3"}, { "name": "name4", "three": [ {"name": "name5"}, {"name": "name6"}, { "name": "name6", "four": [ {"name": "name5"}, {"name": "name6"}, { "name": "name6", "five": [ {"name": "name5"}, {"name": "name6"}, {"name": "name6"} ] } ] } ] }, {"name": "name7"} ] } ] }
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42316770
has title: Get fifth level child value from json object with minimal script in javascript
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/42355533
type: QuestionComment
has text: please mention the error line where crash occurs.
comment on: http://stackoverflow.com/q/26901712
score: 0
type: Comment

http://stackoverflow.com/comment/42538850
type: Comment
has text: That's the first thing I tried did not worked. Update my Plunker :)
type: AnswerComment
comment on: http://stackoverflow.com/a/27003588
score: 0

http://stackoverflow.com/comment/42387040
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26919407
has text: Wrong. The call stack is big enough that stack overflows are usually a result of user error.

http://stackoverflow.com/comment/42479865
comment on: http://stackoverflow.com/a/26971520
has text: Sorry, I forgot to update on fiddle. now you can see.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/26899850
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26993031
has comment: http://stackoverflow.com/comment/42418388
score: 1
tagged with: mobile-safari
upvote count: 1
has comment: http://stackoverflow.com/comment/42416680
has body: When pulling up my Dojo Mobile app on an iPad with iOS 8, the ComboBox dropdown doesn't get placed correctly. My ComboBox is very near the bottom of the screen (in a single-page app with no scrolling), and so the dropdown should almost always appear above the CombBox. It does this fine in all browsers/devices that I've tested except Safari on the iPad. On there, it always appears below the ComboBox and scrolls all the other content off the screen. To confirm this wasn't a problem with my app, I opened the dojox/mobile ComboBox tests on the iPad, and they behave the same way. In particular, dojox/mobile/tests/test_ComboBox-widepage.html shows it best. I have text-entry disabled on my ComboBox (to keep on-screen device keyboards from appearing), and you can replicate this in the test page by adding this: ready(function () { domAttr.set(registry.byId('dropDown').textbox, 'readOnly', true); }); I really don't know where to begin looking for a solution to this. Nothing in ComboBox.js looks wrong, which makes sense since it works almost everywhere. Is there any quick fix that I can put in place, or do I have to report this as a bug and wait for fixes? Edit: Added screenshots. These are all of dojox/mobile/tests/test_ComboBox-widepage.html. Click to see them full-size.
has title: Dojo Mobile ComboBox dropdown misplaced in iOS8/Safari
type: Question
tagged with: ios8
tagged with: javascript
has comment: http://stackoverflow.com/comment/42352515
has answer: http://stackoverflow.com/a/26993031
answer count: 1
downvote count: 0
favorite count: 0
tagged with: dojox.mobile
tagged with: dojo

http://stackoverflow.com/q/26853403
tagged with: javascript
score: 0
answer count: 1
has title: Updating array in mongodb document within Mean.js
has answer: http://stackoverflow.com/a/28387430
tagged with: angularjs
has body: I’m just beginning with mean.js and getting my feet wet building out a custom article module with a few basic extra properties. I’m trying to add a list of tags that are added on the create form via an text input field. As you can see below, this works fine when they're freshly created. I can see the tags array in the newly created document in the terminal. When I load the edit view the tags field is populated with the elements of the tags array separated by commas. That seems ok. Now I want to simply add new tags after the current ones, separating each new tag with a comma, and have the array updated with the new list. However, after performing the update the tags array elements change to one long string containing all tags. I had a look at the server side update function but I’m not quite sure what to do there to make it work. It appears the article is being updated as a complete object so maybe I need to extract the tags array and perform a push new tags separately?Anyone know what I’m doing wrong?I've been troubleshooting it for a day or so now and am out of ideas.Thanks in advance! JSON print of new article: { "user" : ObjectId("545db575197ad8a949894a18"), "desc" : “some description”, "_id" : ObjectId("546115f20a3048862033d393"), "created" : ISODate("2014-11-10T19:45:54.079Z"), "tags" : [ "here”, "be", "tags" ], "name" : "Test”, "__v" : 0 } JSON print after update - Note: tags are now one string { "__v" : 1, "_id" : ObjectId("546115f20a3048862033d393"), "created" : ISODate("2014-11-10T19:45:54.079Z"), "desc" : "some description", "name" : "Test", "tags" : [ "here,be,tags,more" ], "user" : ObjectId("545db575197ad8a949894a18") } // Create new article $scope.create = function() { console.log('Tags before split: ' + this.tags); var tags = this.tags; var tags = tags.split(" "); console.log(“Tags array “ + tags); // Create new article object var article = new Article ({ name: this.name, desc: this.desc, tags: tags }); // Update existing article $scope.update = functi…
type: UnansweredQuestion
type: Question
tagged with: mongodb
tagged with: mean
tagged with: arrays

http://stackoverflow.com/comment/42364240
comment on: http://stackoverflow.com/a/26906771
score: 0
type: AnswerComment
type: Comment
has text: Yeah just wanted to see if maybe there was a solution within the .round, thank you either way :D

http://stackoverflow.com/q/26915574
tagged with: arrays
tagged with: javascript
tagged with: duplicates
accepted answer: http://stackoverflow.com/a/26915706
score: 2
answer count: 1
downvote count: 0
has title: Delete duplicate array element
favorite count: 0
has comment: http://stackoverflow.com/comment/42380361
linked to: http://stackoverflow.com/q/26791539
has comment: http://stackoverflow.com/comment/42380407
has comment: http://stackoverflow.com/comment/42379963
type: AnsweredQuestion
upvote count: 2
has answer: http://stackoverflow.com/a/26915706
has comment: http://stackoverflow.com/comment/52417980
type: Question
has comment: http://stackoverflow.com/comment/42380204
has body: I am working on a program that records customer name and status(child/adult), the program allows add, display and delete customer records from array. However, if user enters the same name and status e.g: Name: james, status: adult Name: james, status: adult I want the function to delete just one record,but now it delete both of them, do i have to add break here? Please help. PS: I can't use any inbuilt JavaScript functions such as slice(),delete(), concat(), join(), pop(), push(), reverse(), shift(), slice(), sort(), splice(), toString(), unshift() or valueOf() const MAX_CUSTOMERS = 5; //create new Array var customerList = new Array(); function addCustomer() //add customer { if (customerList.length >= MAX_CUSTOMERS) //check max customers alert('Sorry, no more than ' + String(MAX_CUSTOMERS) + ' customers are allowed on the trampoline.') else { var newIndex = customerList.length; //add new user customerList[newIndex] = new Object; customerList[newIndex].name = prompt('What is the customer\'s name?'); //ask user enter their name customerList[newIndex].status = prompt('Are you a Child or an Adult?'); //ask user enter their status while (!(customerList[newIndex].status == 'child' || customerList[newIndex].status == 'adult')) //check user is child or adult { customerList[newIndex].status = (prompt('Error! Please Enter \'child\' or \'adult\':')); } } } function displayAllCustomers() //display customers { var message = ''; //create message for (var i = 0; i < customerList.length; i++) //loop customers { message += 'Name:' + customerList[i].name + ', Status: ' + String(customerList[i].status) + '. \n'; //add customer to message } if (message == '') //check message message = 'Sorry, there are no customer to display!'; alert(message); //output message } function identifyThenDeleteCustomer() //identify then delete customer { var customerName = prompt('Enter the name of the customer to delete:'); //get customer name var customerStatus = prompt('Enter \'child\' or \'adult\':'); /…

http://stackoverflow.com/a/26961880
downvote count: 0
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26961804
answers question: http://stackoverflow.com/q/26961804
has comment: http://stackoverflow.com/comment/42499185
has body: By setting newTask as an input argument to both getFormData and createTaskForm.onsubmit, you are redeclaring that variable within the scope of those functions. To access the value from the outer scope, you just need to reference it.
type: AcceptedAnswer

http://stackoverflow.com/comment/42501977
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26983837
has text: You're right, I hadn't seen the fiddle link and went storming in ....Beddy byes for me then, half asleep.

http://stackoverflow.com/a/26868324
answers question: http://stackoverflow.com/q/26847053
score: 0
has body: load functions have a callback. var loader = new THREE.OBJLoader( manager ); loader.load( 'obj/male02/male02.obj', function ( object ) { //this happens after load object being what is loaded. } ); for more info see the example
type: Answer

http://stackoverflow.com/comment/42256469
type: AnswerComment
type: Comment
has text: I wasn't the downvoter, but maybe because the statement - kind of just repeated what I said in the question, lol. i.e. Why is it that the property on the orange object in the external scope is changed? thanks
comment on: http://stackoverflow.com/a/26846102
score: 0

http://stackoverflow.com/comment/42370042
type: QuestionComment
comment on: http://stackoverflow.com/q/26882510
has text: This is the correct syntax: angular.module('app1',['ngRoute']). The second argument is an array of strings
score: 0
type: Comment

http://stackoverflow.com/comment/42387765
score: 0
type: Comment
comment on: http://stackoverflow.com/q/26919305
type: QuestionComment
has text: also, you're using jquery. So why not `$('#linkgreen').val()` instead of `document.getElementById('linkgreen')` and using `.value` on it later? or adding an event listener instead of inline js?

pug
tags question: http://stackoverflow.com/q/26922173
tags question: http://stackoverflow.com/q/26962482
tags question: http://stackoverflow.com/q/26913938
tag name: pug
type: Tag
tags question: http://stackoverflow.com/q/26932402
tags question: http://stackoverflow.com/q/26879487
tags question: http://stackoverflow.com/q/26970861

http://stackoverflow.com/comment/42471865
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/26967508
has text: I think you should take these functions out of angular run blocks. that way you can run tests easily without loading modules.

http://stackoverflow.com/comment/132343509
type: AnswerComment
type: Comment
has text: this solution only works in forms at submit
comment on: http://stackoverflow.com/a/26872092
score: 0

http://stackoverflow.com/a/29543565
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/26982738
downvote count: 0
has body: Just to close the loop on this, solution: The file isn't an actual ePub, it is a "shell" for ingesting an ePub with ePub.js and then displaying it in a custom way...

http://stackoverflow.com/comment/104318849
type: AnswerComment
score: 0
type: Comment
has text: very useful could you please explain this. how do we change uniqueNodes[0]["latitude"] to next closest location so that it will find its next closest location and so on?
comment on: http://stackoverflow.com/a/26837460

http://stackoverflow.com/comment/42390572
has text: if u open html in separate page that page need to include the angular js main files as its kind of fresh page.. and route will not work as its kind of out of route. Best is keep same page and hide other things with ng-show if its only about ui look n feel but you wana keep functionality of route.
type: AnswerComment
comment on: http://stackoverflow.com/a/26912100
score: 0
type: Comment

http://stackoverflow.com/comment/42241849
type: Comment
comment on: http://stackoverflow.com/a/26838098
score: 1
type: AnswerComment
has text: @jamesemanon - you'd have to show a more complete code example (by editing your question and inserting it there where you can format it too) for me to follow that scenario. In general, ANY array on a prototype is going to be shared by all objects that use that prototype.

http://stackoverflow.com/q/26929563
has title: Passing Array to Openlayers 3 with geolocation and style
tagged with: openlayers-3
score: 0
accepted answer: http://stackoverflow.com/a/26945383
answer count: 1
has comment: http://stackoverflow.com/comment/42413386
has answer: http://stackoverflow.com/a/26945383
has body: I am looking to create simple markers in Openlayers 3 based on a two dimensional array which I pass via PHP containing the Geolocation of the marker and an attribute. Currently the attribute is the colour that I would like the layer to be: //run external php script to grab all entries from the database; make an array and add to source vector var latlong_marker = &lt;?php require 'db_multiple_gps.php'; echo $ol_latlong;?&gt;; var latlong_array_length = latlong_marker.length; var vectorSource = new ol.source.Vector({ //create empty vector }); // cycle through all entries in the array for (var i = 0; i &lt; latlong_array_length; i++){ var iconFeature = new ol.Feature({ geometry: new ol.geom.Point(ol.proj.transform(latlong_marker[i][0], 'EPSG:4326', 'EPSG:3857'))}); vectorSource.addFeature(iconFeature); var iconStyle = new ol.style.Style({ image: new ol.style.Circle({ radius: 5, fill: new ol.style.Fill({color: latlong_marker[i][2]}) }) }); //add the feature vector to the layer vector, and apply a style to whole layer var vectorLayer = new ol.layer.Vector({ source: vectorSource, style: iconStyle }); } The vector layers are presented on the map in the correct locations but the issue is that the colour is that of the last entry in the array latlong_marker[i][2]. From my research I think it may be due to closure of functions but I'm not exactly sure how or where the functions are in play here. Debugging show the entire array being passed through the loop and vectorSource looking good; however iconStyle appears to have many null values. Am I going about this in the right fashion? I could pass another parameter other than the actual colour required (such as a integer) to then be used to create the different style. In addition to the code snippet above, I have played around with with closing the loop earlier; this works fro creation of vectorSource but I always fall down with trying to pass an array of iconStyle to the Vector Layer.
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/42475707
has comment: http://stackoverflow.com/comment/42431782
tagged with: arrays
has comment: http://stackoverflow.com/comment/42409482
tagged with: javascript

uisearchbar
tag name: uisearchbar
tags question: http://stackoverflow.com/q/26860830
type: Tag

http://stackoverflow.com/a/29852352
upvote count: 1
answers question: http://stackoverflow.com/q/26931363
has body: It's impossible to do it from flash. But there is a workaround. You can pass the video url from JavaScript if the url is known on JavaScript side. All you need is to register a callback in your flash app and call it from JavaScript. You can find more details here: how to pass arguments from javascript to as3 using external interface
score: 1
downvote count: 0
type: Answer

http://stackoverflow.com/a/27080578
downvote count: 1
has body: Take a look on a browserify. It implements interesting approach. With browserify you can write code that uses require in the same way that you would use it in Node.
type: Answer
answers question: http://stackoverflow.com/q/26969271
has comment: http://stackoverflow.com/comment/42782445
score: 0
upvote count: 1

http://stackoverflow.com/a/26917061
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42469991
has comment: http://stackoverflow.com/comment/42465538
type: Answer
upvote count: 1
has body: I would start with custom formatter. jqGrid support predefined formatters like formatter: "integer", formatter: "date". You can "register" your custom formatter and unformatter as one more value which you can use. For example if you want to register formatter: "myCheckbox" you need define $.fn.fmatter.myCheckbox as formetter function and $.fn.fmatter.myCheckbox.unformat as unformatter function. $.extend($.fn.fmatter, { myCheckbox: function (cellValue, options, rowObject) { // the code of the custom formatter is here ... } }); $.extend($.fn.fmatter.myCheckbox, { unformat: function (cellValue, options, elem) { // the code of the custom unformatter is here ... } }); The code from here uses Font Awesome 4.x and register new formatter: "checkboxFontAwesome4". "Registering" of custom formatters can simplify your code. The next feature. jqGrid supports column templates starting with version 3.8.2 jqGrid (see the old answer). It allows you to define common settings used in colModel as one object and to use template property in colModel. For example if you have many columns which contains numbers you can define for example numberTemplate object as var numberTemplate = { formatter: "number", align: "right", sorttype: "number", width: 60, searchoptions: { sopt: ["eq", "ne", "lt", "le", "gt", "ge"] } }; then you can define tree columns "tax", "amount" and "total" as colModel: [ ... { name: "tax", template: numberTemplate }, { name: "amount", template: numberTemplate }, { name: "total", width: 70, template: numberTemplate }, ... ] In the way you defines columns where all the properties from numberTemplate will be applied in the columns. The default width: 60 defined in numberTemplate will be overwritten to the value width: 70 for the column "total". The usage of column templates allows you to define once in your code templates for dates which uses jQuery UI Datepicker for example and uses in every column of every grid of your project just the corresponding reference on the templ…
score: 1
accepted answer of: http://stackoverflow.com/q/26913645
has comment: http://stackoverflow.com/comment/42485211
answers question: http://stackoverflow.com/q/26913645

http://stackoverflow.com/comment/42330602
score: 0
comment on: http://stackoverflow.com/q/26887542
type: QuestionComment
type: Comment
has text: @RahilWazir using Batarang it shows that the licenceKey is set, but in a sub-scope (not sure why, or how)

http://stackoverflow.com/comment/42333767
type: Comment
type: QuestionComment
has text: a can think of a reason: Where is your code ? What have you tried so far ?
score: 1
comment on: http://stackoverflow.com/q/26889805

http://stackoverflow.com/q/26868645
has body: I would like to prevent triggering the onchange event of selectbooleancheckbox when its value is toggled in toggleBillableChkBox method. &lt;p:selectBooleanCheckbox value="#{myBean.billableBoolean}" widgetVar="billableEditVar" id="billableEdit" onchange="showBillableForEdit(this)"&gt; &lt;/p:selectBooleanCheckbox&gt; function showBillableForEdit(obj){ if(obj.checked){ confirmBillableYesEdit.show(); } else{ confirmBillableNoEdit.show(); } } &lt;p:confirmDialog id="confirmBYesEditId" header="Please Confirm" severity="alert" visible="false" widgetVar="confirmBillableYesEdit" message="edit Are you sure you want to invoice this service ?" &gt; &lt;p:commandButton value="Yes" oncomplete="confirmBillableYesEdit.hide();" global="false" &gt; &lt;/p:commandButton&gt; &lt;p:commandButton value="No" onclick="toggleBillableChkBox();" oncomplete="confirmBillableYesEdit.hide();"&gt; &lt;/p:commandButton&gt; &lt;/p:confirmDialog&gt; function toggleBillableChkBox() { billableEditVar.toggle(); }
linked to: http://stackoverflow.com/q/1357118
possible better answer: http://stackoverflow.com/a/26868746
has answer: http://stackoverflow.com/a/26868746
type: AnsweredQuestion
tagged with: jsf
has answer: http://stackoverflow.com/a/26880085
type: Question
tagged with: primefaces
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/26880085
tagged with: javascript
tagged with: jquery
has title: Prevent calling onchange event when checkbox value changes

acrobat
type: Tag
tags question: http://stackoverflow.com/q/26908906
tags question: http://stackoverflow.com/q/26853549
tags question: http://stackoverflow.com/q/26874918
tag name: acrobat

http://stackoverflow.com/q/26837961
tagged with: xslt
type: Question
has body: I am trying to get a language dropdown in HTML which calls JavaScript which uses XMLT which reads an XML to have a default value of English when the page loads, can someone help?\ Please note this only runs on Internet Explorer 9 and above The required HTML Is: My JavaScript is function Start() { LoadLanguageCombo(); LoadCustomerCombo(); GetLanguage(); } function nvl(value1,value2) { if (value1 == null) return value2; return value1; } function LoadLanguageCombo() { var xmldoc=new ActiveXObject("Microsoft.XMLDOM"); xmldoc.async=false; xmldoc.load("Language.xml"); var xsldoc=new ActiveXObject("Microsoft.XMLDOM"); xsldoc.async=false; xsldoc.load("LanguageCombo.xsl"); alert (xmldoc.transformNod(exsldoc)); LanguageComboHere.innerHTML=xmldoc.transformNode(xsldoc); } function GetLanguage(language) { alert("here"); alert(language); var xmldoc=new ActiveXObject("Msxml2.DOMDocument.3.0"); var xsldoc=new ActiveXObject("MSXML2.FreeThreadedDOMDocument"); var xslt = new ActiveXObject("MSXML2.XSLTemplate"); var xslproc; var defaultlanguage = "English"; language = nvl(language, defaultlanguage); alert(language); xmldoc.load("Language.xml") xsldoc.load("getLanguage.xsl"); xslt.stylesheet = xsldoc; xslproc = xslt.createProcessor(); xslproc.input = xmldoc; xslproc.addParameter("elementname", "selectalanguage"); xslproc.addParameter("languagetype", language); xslproc.transform(); selectalanguage.innerHTML = xslproc.output; } My XSLT is: <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" > <xsl:output method="html" /> <xsl:template match="/"> <xsl:for-each select="//language"> <xsl:sort select="englishtype"/> <xsl:sort select="englishtype" /> <xsl:variable name="language" select="englishtype" /> <xsl:element name="option"> <xsl:attribute name="value"> <xsl:value-of select="$language" /> </xsl:attribute> <xsl:value-of select="englishtype" /> </xsl:element> </xsl:for-each> </xsl:template> </xsl:stylesheet> My XML is: Ukrainian Italian Engl…
tagged with: javascript
has answer: http://stackoverflow.com/a/26838954
answer count: 1
tagged with: default
tagged with: combobox
tagged with: http://stackoverflow.com/tag/xml
accepted answer: http://stackoverflow.com/a/26838954
type: AnsweredQuestion
has title: Setting default value on ComboBox on HTML using JavaScript ,XSLT and XML
score: 0

http://stackoverflow.com/comment/42477779
type: Comment
comment on: http://stackoverflow.com/a/26969191
has text: @dystroy I did so and the result is : This my object before converting : imgur.com/s3HbdtQ and this after converting : imgur.com/ilWUGcU
type: AnswerComment
score: 0

http://stackoverflow.com/comment/42350423
has text: It does work for me in all fiddles, but not on my page. I do not receive any errors in the JavaScript Console. @JasonSperske
score: 0
comment on: http://stackoverflow.com/q/26898051
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26902055
type: Answer
upvote count: 1
score: 1
has body: With your data structure... You cannot access name and description directly from first ng-repeat. Even if you have nested ng-repeat you are not guaranteed with name and description. You need to flatten the object after first ng-repeat and then you can access all the properties. Assuming that _1, _2 object properties are related.
answers question: http://stackoverflow.com/q/26901910
downvote count: 0

http://stackoverflow.com/comment/42330742
type: Comment
comment on: http://stackoverflow.com/q/26887918
type: QuestionComment
has text: @UnskilledFreak and this ? `$("#new_data").data('value',0);` in my last code how it should be ?
score: 0

http://stackoverflow.com/comment/139109874
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26922661
has text: What about if you're authenticating from a DIFFERENT site than the Wordpress site?
type: AnswerComment

http://stackoverflow.com/q/26900218
has comment: http://stackoverflow.com/comment/42353091
upvote count: 1
has comment: http://stackoverflow.com/comment/42353134
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: css
has title: Firefox box-sizing + expanding div = missing padding?
favorite count: 0
has comment: http://stackoverflow.com/comment/42353112
has answer: http://stackoverflow.com/a/26912548
type: UnansweredQuestion
downvote count: 0
has body: I've been trying to solve this issue where I have an expanding div (as the content is added over time) with box-sizing and padding. The mentioned case works fine on ie and Chrome, but behaves weird on Firefox (33.0.2). Here is the link http://codepen.io/anon/pen/mydPdV Keep pressing the button. The button will send you to the end of the page via: $("#button").click(function(){ $("#container").scrollTop(99999999999999999); }); After the page is filled, and scroll appears, you will see that for osme reason padding-bottom will stay out of the page - only on firefox! On Chrome and IE it works as it should. It looks like Firefox is making some wrong calculation somhere? or does int not calculate padding at all, for the expanding/dynamic content? Am I missing a point? I'm looking for a quickfix.
score: 1
type: Question
tagged with: firefox
tagged with: javascript
has comment: http://stackoverflow.com/comment/42353190
tagged with: jquery

http://stackoverflow.com/q/26841796
downvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/42248445
has comment: http://stackoverflow.com/comment/42247514
has answer: http://stackoverflow.com/a/26842641
has comment: http://stackoverflow.com/comment/42248579
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/42247544
accepted answer: http://stackoverflow.com/a/26842641
has comment: http://stackoverflow.com/comment/42248383
score: 0
has body: $(document).on('click', '.addphoto', function(e){ currentImgCnt = $(this).attr("id"); $('#photo-update'+currentImgCnt).click(); }); Here photo-update is a dynamically generated input of type file, and .addphoto is also a dynamically generated button, the code is self explanatory. Once the person clicks the .addphoto button, it in turn clicks the #photo-uplate button The problem is jQuery won't click the inner generated button that is the #photo-update button but the dynamically generated .addphoto button works fine. JSFiddle HERE http://jsfiddle.net/z8yzbb41/3/ PROBLEM SOLVED when I used $(".input-container").on('change','input',function () { alert('helo'); });
has comment: http://stackoverflow.com/comment/42248323
has title: Jquery issue with .click() with dynamic elements
upvote count: 1
has comment: http://stackoverflow.com/comment/42247508

http://stackoverflow.com/comment/42416526
has text: I assure you it doesn't... there, I made a snipper out of it.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/26936053
score: 0

http://stackoverflow.com/q/26921286
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42392468
has answer: http://stackoverflow.com/a/26925154
upvote count: 1
type: Question
tagged with: javascript
has title: Dynamic properties for Angular controllers
has comment: http://stackoverflow.com/comment/42390690
has comment: http://stackoverflow.com/comment/42391171
answer count: 1
downvote count: 0
has body: I'm trying to dynamically load a controller based on different values and want to know what's the practical way in doing so? See below. I'm trying to retrieve the data-post-id attribute's value within the controller that it is within. Suppose I have multiple CommentsController div on the same, page and each of them is associated with a different data-post-id. Any help would be greatly appreciated. Thanks. JS app.controller("CommentsController", function($scope, $http) { $scope.comments = []; $scope.load = function() { $http.get("https://myapi.com/comments.json", [post_id: post_id]) .success(function(data) { $scope.comments = data; }); }; // Load the data $scope.load(); }); HTML &lt;div ng-controller="CommentsController as comments" data-post-id="30"&gt; &lt;div ng-repeat="comment in comments"&gt; {{ comment.body }} - {{ comment.author }} &lt;/div&gt; &lt;/div&gt;
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/42390971
tagged with: angularjs

http://stackoverflow.com/comment/42432262
has text: Why not hire a programmer or outsource it to someone? You surely don't build a vehicle knowing it has 4 wheels and an engine.
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/26944713

http://stackoverflow.com/comment/42362714
score: 0
comment on: http://stackoverflow.com/q/26903227
type: Comment
type: QuestionComment
has text: above function needs to be implemented by browser I think. I have found on web that this function is not supported by chrome. any workaround for this? in case you know

http://stackoverflow.com/a/26918297
type: Answer
answers question: http://stackoverflow.com/q/26917858
has body: Processing by IndexController#load_poc as HTML is the problem. Your action is only responding to requests as JS, but it's sending through as an HTML request. Your request should look like: Processing by IndexController#load_poc as JS
score: 0

http://stackoverflow.com/q/26846078
score: 1
tagged with: java
tagged with: javafx
type: Question
has comment: http://stackoverflow.com/comment/42279889
has answer: http://stackoverflow.com/a/32871527
downvote count: 0
tagged with: javascript
tagged with: javafx-webengine
answer count: 1
has body: I'm going to use WebView/WebEngine to display "logs" (i.e. chat message, game status message, ...) for simple multiplayer game. Here is what I wrote on javascript part. function addLogMessage(o) { var kind = o.getMessageKindCase(); if (kind.equals(kind.CHAT_MESSAGE)) { $("body").append(createChatMessage(o.getChatMessage())); } else (/* other cases following... */) } function addLogMessages(l) { var n = l.size(); for (var i = 0; i &lt; n; i++) { addLogMessage(l.get(i)); } } Here is what I wrote on java part. private GameStatus gameStatus; private WebEngine logWebEngine; private final ObjectProperty&lt;JSObject&gt; window = new SimpleObjectProperty&lt;&gt;(this, "window"); public void initialize(URL url, ResourceBundle rb) { gameStatus = /* ... */; window.addListener((o, oldValue, newValue) -&gt; { if (newValue == null) { return; } // getLogMessages() will return java.util.List&lt;LogMessage&gt; newValue.call("addLogMessages", gameStatus.getLogMessages()); }); logWebEngine = logView.getEngine(); logWebEngine.getLoadWorker().stateProperty().addListener((o, oldValue, newValue) -&gt; { if (newValue == Worker.State.SUCCEEDED) { window.set((JSObject) logWebEngine.executeScript("window")); } }); logWebEngine.load(getClass().getResource("log.html").toString()); } When I called addLogMessage() from java side, it works as intended. However, calling addLogMessages() caused the following exception. Exception in thread "JavaFX Application Thread" java.lang.IllegalAccessException: Class sun.reflect.misc.Trampoline can not access a member of class java.util.Collections$UnmodifiableCollection with modifiers "public" It seems that l.size() in addLogMessages caused this exception. What's the reason of this exception? And, is there any solution for this issue? Thanks in advance.
favorite count: 0
type: UnansweredQuestion
has title: IllegalAccessException while using java object in javascript
upvote count: 1

http://stackoverflow.com/comment/42283575
score: 2
has text: Your code line works perfectly fine here http://jsfiddle.net/betdzroz/ What issue are you having with it?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26860449

http://stackoverflow.com/q/26980633
type: AnsweredQuestion
tagged with: list
has body: The below code works. -It shows "stores" on a map within 500 meters of predetermine location. -It shows markers with store details on a map. - It does show a list of places with the map, but only with the place name not details(I would like details). If I want to output a HTML/Javascript list of the above instead of showing a map, how would find out how to do this? Google Places API, focuses how to output onto a Map, but I don't want to output store information on just a map. If you have ANY clue, please let me know. I just need suggestions. Place searches Results More results
type: Question
has title: Google Places HTML/Javascript List
tagged with: javascript
has answer: http://stackoverflow.com/a/26982693
tagged with: google-maps-api-3
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: google-places-api
accepted answer: http://stackoverflow.com/a/26982693

http://stackoverflow.com/q/26942715
downvote count: 0
tagged with: templates
has answer: http://stackoverflow.com/a/26945094
favorite count: 0
tagged with: ember.js
has body: I have a nested route, that displays an obect of data based on an item that is clicked on. In Ember, is there a way to log the data in the template for this nested route when I selected an item from the list? I've only recently started working with Ember, but I have not found where this is asked. Here is a fiddle where I can display the data using handlebars and calling the objects property nae, but how do I log the whole object to the console in this template? http://jsfiddle.net/jwevfhzL/ Here is my JS and Templates: JS: App = Ember.Application.create(); App.ApplicationAdapter = DS.FixtureAdapter.extend(); App.User = DS.Model.extend({ firstName: DS.attr('string'), lastName: DS.attr('string'), fullName: function() { return this.get('firstName') + ' ' + this.get('lastName'); }.property('firstName', 'lastName') }); App.User.FIXTURES = [ { id: 1, firstName: 'Luke', lastName: 'Skywalker' }, { id: 2, firstName: 'Frodo', lastName: 'Baggins' } ]; App.Router.map(function() { this.resource('users', {path: '/'}, function() { this.route('show', {path: ':user_id'}); }); }); App.UsersRoute = Ember.Route.extend({ model: function() { return this.store.find('user'); } }); App.UsersShowRoute = Ember.Route.extend({ model: function(params){ return this.store.find('user', params.user_id); }, templateName: 'show' }); Templates:
type: AnsweredQuestion
has title: Ember: Log model data in template from a nested route
score: 1
accepted answer: http://stackoverflow.com/a/26945094
upvote count: 1
type: Question
tagged with: javascript
answer count: 1

http://stackoverflow.com/comment/42383525
type: AnswerComment
has text: Thank you for the clarification. So I realized the libraries are indeed getting loaded because when I removed the initial code block as you suggested from the `application.js` and ran it again without it there and without it included, it throws an error that state `couldn't find file '/public/javascript/Chart.min.j'` which seems to mean it could before and so loaded into our app. Is there a way to test for sure if it is or not?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26916812

http://stackoverflow.com/a/26933734
type: Answer
has comment: http://stackoverflow.com/comment/42412595
answers question: http://stackoverflow.com/q/26933324
has comment: http://stackoverflow.com/comment/42412250
has comment: http://stackoverflow.com/comment/42412310
has body: Why not just take the arguments to the callback function as extra parameters on _if? var _if = function (predicate, callback, context) { if (predicate) { var callbackArgs = [].slice.call(arguments, 3); callback.apply(context || null, callbackArgs); } }; // Usage: _if(true, console.log, console, "text");
score: 1
has comment: http://stackoverflow.com/comment/42412221
upvote count: 1
has comment: http://stackoverflow.com/comment/42412348
downvote count: 0

http://stackoverflow.com/comment/42511446
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26973020
has text: @madhavan what's the problem? i see the comments plugin in the bottom.
score: 0

http://stackoverflow.com/a/26905702
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: var __this=this; //declare out side your function. function test(){ __this; //use __this in your function. }
answers question: http://stackoverflow.com/q/26905573

http://stackoverflow.com/comment/42348669
comment on: http://stackoverflow.com/q/26897264
type: Comment
score: 0
has text: Is there a way to track which version of jquery, Util.js is wrapped for? I do not have a read me or doc associated with it.
type: QuestionComment

http://stackoverflow.com/comment/42495856
comment on: http://stackoverflow.com/a/26980723
score: 0
type: AnswerComment
has text: @A.Wolff, you're right... My fingers assumed it wrong, check edit
type: Comment

http://stackoverflow.com/q/26850555
score: 2
answer count: 1
has body: I am trying to restrict the file type (only mp3 files) when I open a dialog with uploadcare. uploadcare.loadFileGroup(soundGroupID) .done(function (fileGroup) { uploadcare.openDialog(fileGroup.files(), { multiple: true, multipleMin: 0, fileTypes="mp3" }).done( function (file) { file.promise().done( function (fileInfo) { //TODO Something }); }); }) .fail(function () { // Something went wrong. }); Is there any way to push a validator? Is there any way to access the widget? As you can see, I am opening a dialog so I can not access the widget anywhere.
favorite count: 0
upvote count: 2
has title: How do I restrict the file type with uploadcare in javascript?
has comment: http://stackoverflow.com/comment/42264025
type: AnsweredQuestion
tagged with: uploadcare
has answer: http://stackoverflow.com/a/26850875
type: Question
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26850875

http://stackoverflow.com/a/26928349
accepted answer of: http://stackoverflow.com/q/26928348
has body: I tested a couple of Ruby (on Rails) methods to find out which works best to instantiate new Date objects in JavaScript. The results are: Ruby Class Time .to_s (Link): The output of this method works in Google Chrome but doesn't work in Firefox. Rails .to_formatted_s(:rfc822) (Link): The output of this method works in Google Chrome and works limited in Firefox. It didn't work for me in Firefox when I was trying to parse dateStrings that were using German day abbreviations (e.g. 'Do, 13 Nov 2014 ...' instead of 'Thu, 13 Nov 2014 ...') Ruby Class Time .to_i.to_s (Link) The output of this method doesn't work in Google Chrome and doesn't work in Firefox either because it returns seconds instead of milliseconds since the Epoch. converted Ruby class Time (... .to_i * 1000).to_s: The output of this method works in Google Chrome and in Firefox - finally ;-). Hope this saves you some pain!
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26928348
type: Answer
score: 0

http://stackoverflow.com/a/67537021
has body: Each time a user inputs some value, do something. var element = document.getElementById('input'); element.addEventListener('input', function() { // Do something });
has comment: http://stackoverflow.com/comment/124401141
upvote count: 5
downvote count: 5
answers question: http://stackoverflow.com/q/26946235
score: 0
type: Answer

http://stackoverflow.com/comment/42335199
comment on: http://stackoverflow.com/a/26868032
has text: Hi, thx it`s work. But I need to set 1st point on Y axist, can I do that? example: prntscr.com/55ms9y
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/42309627
comment on: http://stackoverflow.com/a/26875825
score: 0
type: AnswerComment
type: Comment
has text: @DrewBaker he is not adding it to the document!

http://stackoverflow.com/a/26919644
downvote count: 0
has body: On mongo shell this query seems to work: db.messages.find({ "receiver.id": "YzhZchz4AwCAd3q2R"} )
answers question: http://stackoverflow.com/q/26914766
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/42329887
has text: I have removed onfocusout=$.GetID(this.id) second thing error in id=' + questions[i].Question.DataType + '-' + questions[i].Question.QuestionId + '-' + QuesDesc + '-' + controlTypevalue + '
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26887700
type: Comment

http://stackoverflow.com/comment/42246994
type: AnswerComment
score: 0
type: Comment
has text: Really sorry, i didn't understand. can you tel how, i am beginner in it. Pls help
comment on: http://stackoverflow.com/a/26838557

http://stackoverflow.com/q/26986651
linked to: http://stackoverflow.com/q/1218245
possible better answer: http://stackoverflow.com/a/26986678
has answer: http://stackoverflow.com/a/26986678
has title: How can I open a URL inside a DIV tag using AJAX?
type: Question
has answer: http://stackoverflow.com/a/26986730
has answer: http://stackoverflow.com/a/26987067
tagged with: javascript
has answer: http://stackoverflow.com/a/26986797
score: 0
tagged with: ajax
tagged with: php
has comment: http://stackoverflow.com/comment/42506376
accepted answer: http://stackoverflow.com/a/26986797
answer count: 4
has body: I have the following php files. One that captures a user's text from a simple form, and the other echos this text. The files are shown below.. file1.php: Paste text document: output.php: Output <?php $doc = $_POST['doc']; echo $doc; ?> I want the output to be displayed between the DIV tags, rather than to load and show the output on a new page. I want the text to be output in between the DIV tags on the same page. Maybe the best way is to use AJAX to display output.php within the DIV tags and output the text after the user has clicked on the "submit" button. How can I use AJAX to do this in the most basic way possible?
type: AnsweredQuestion

http://stackoverflow.com/comment/42399408
has text: @funkwurm thank you so much, I've used this but there is still a problem with my code. it change the angle only one time. i need to make it change every time i click on the key. see the code above I've edited it
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26925800

http://stackoverflow.com/a/26950126
upvote count: 4
downvote count: 0
has body: I can't believe no one has suggested this so far. Your problem is a general misunderstanding of HTML. This is not what checkboxes are for. You should be using radio buttons: buy sell This will automate this functionality for you. No script required.
answers question: http://stackoverflow.com/q/26949700
score: 4
type: Answer

http://stackoverflow.com/q/26948646
score: 2
has answer: http://stackoverflow.com/a/26948725
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/26951491
linked to: http://stackoverflow.com/q/3552461
downvote count: 0
tagged with: ide
tagged with: javascript
favorite count: 0
tagged with: random
upvote count: 2
type: UnansweredQuestion
tagged with: selenium
has body: I want to make javascript that random time according the format "HH:MM AM" inside my selenium IDE. I tried the code below: javascript{Math.floor(24*Math.random() + 00) +":" + "00 PM";} But as you guess, it doesn't work. Please your help thanks.
has title: How to random time in javascript

http://stackoverflow.com/comment/45672190
score: 0
type: AnswerComment
has text: I want, get value in pixels, when scroll event fired
comment on: http://stackoverflow.com/a/28690320
type: Comment

http://stackoverflow.com/comment/42281057
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26860198
score: 0
has text: It's hard to visualise your problem without an example. Could you set up a http://jsfiddle.net with a demo? Also, you could try `display: none`.

http://stackoverflow.com/q/26968974
answer count: 1
tagged with: jquery
tagged with: ipad
type: UnansweredQuestion
tagged with: css
tagged with: safari
has title: Positioning absolute on iPad does not set the element on the desired position
type: Question
has body: Hi I seem to have some issue regarding the absolute positioning on iPad. Here is my issue.What I am trying to create is a tooltip when a user taps on an image the tooltip will appear. Here is what I have done so far: var div = createTooltip(toElement); $(toElement).click(function () { showTooltipNow(toElement, div); }); function createTooltip(toElement, div){ var div = document.createElement('DIV'); div.style.zIndex = 100000; div.style.visibility = 'hidden'; div.style.position = 'absolute'; div.style.left = 0; div.style.top = 0; document.body.appendChild(div); } function showTooltipNow(toElement, div) { $(div).addClass('tbxtooltip-close'); var positionedElement = $(div); var toElem = $(toElement); positionedElement.css({ top: toElem.position().top, left: toElem.position().left, position: "absolute" }) alert("Top Position " +positionedElement.position().top + " Left Position " +positionedElement.position().left); alert("Top ToElement Position " + toElem.position().top + " Left ToElement Position " +toElem.position().left) div.style.visibility = 'visible'; } When I initialize this I get the following readings from the alerts: Top Position: 363.375 Left Position 300 Top ToElement Position 485 Left ToElement Position 400 What I expected to happen is the positioned element to get the same position as the clicked element but as you can see this does not hapen. I first assumed that the position is set from another place in the aplication but if I do not called this line : positionedElement.css({ top: toElem.position().top, left: toElem.position().left, position: "absolute" }) in the showTooltipNow function the element is position at top:0 left:0 as it is set in the createTooltip function. I should also mention that on all desktop browsers this works correctly IE, Firefox, Safari and Chrome do not have this behavios and the element is se tat the desired position. Does anyone know why my element is not set to the correct position?
tagged with: javascript
has answer: http://stackoverflow.com/a/30997767
score: 0

http://stackoverflow.com/q/26860594
downvote count: 2
has comment: http://stackoverflow.com/comment/42324938
has comment: http://stackoverflow.com/comment/42324850
tagged with: php
has comment: http://stackoverflow.com/comment/42324923
has comment: http://stackoverflow.com/comment/42281702
type: Question
linked to: http://stackoverflow.com/q/1917576
upvote count: 0
score: -2
has answer: http://stackoverflow.com/a/26861101
has body: hi i am new to php and javascript. i have a problem. i wanted to obtain a value from javascript function and pass it on to php and use that value for a query. here's the code: <?php $link=mysqli_connect("localhost","root","", "personinfo") or die("Error " .mysqli_error($link)); ?> Name: Person1 Person2 Person3 Submit <?php $did=x; $sql="SELECT * FROM personinfo where id=$did limit 1" or die("Error in the consult.." . mysqli_error($link)); $aResult=mysqli_query($link, $sql); while($rows = mysqli_fetch_array($aResult)) { $id = $rows['ID']; $pid = $rows['personID']; $fname = $rows['firstName']; $lname = $rows['lastName']; $department = $rows['department']; $type = $rows['fType']; ?> ID FIRST NAME LAST NAME DEPARTMENT TYPE <?php echo $pid;?><?php echo $id;?> <?php echo $fname;?> <?php echo $lname;?> <?php echo $department;?> <?php echo $type;?> <?php } ?> if there's a way to do that it will be much appreciated, if not, what do i need to do to make this work? i hope you could help. thanks.
tagged with: javascript
has comment: http://stackoverflow.com/comment/42282080
has comment: http://stackoverflow.com/comment/42324753
answer count: 1
has comment: http://stackoverflow.com/comment/42282208
has comment: http://stackoverflow.com/comment/42324808
has comment: http://stackoverflow.com/comment/42282943
favorite count: 0
has comment: http://stackoverflow.com/comment/42324893
has title: pass a value from a javascript function to php and use the value for query?
type: UnansweredQuestion

http://stackoverflow.com/comment/42402423
type: AnswerComment
score: 0
has text: Ok thanks. I assumed something like this. Is there any way to stop it doing this? (assuming the collection on the server isn't changing, which is the case here). It seems strange to have a sync between fixed server and client collection running sort of asynchronously.
type: Comment
comment on: http://stackoverflow.com/a/26917411

http://stackoverflow.com/a/26918815
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/42385970
answers question: http://stackoverflow.com/q/26918763
score: 2
downvote count: 0
has body: HTML does not normally use \r nor \n to represent line breaks. Try wrapping each section in a block-level element such as a &lt;div&gt; or &lt;p&gt;, or using the &lt;br/&gt; tag, which is the closest thing you'll get to a line break in HTML, though it's not terribly semantic. Alternately, use CSS: some-selector { white-space: pre; }

http://stackoverflow.com/comment/42313825
type: Comment
has text: so what I want it to do is like this if($(this).attr('id') == 'Sell'){$('#transType').val('something');}
comment on: http://stackoverflow.com/a/26877834
type: AnswerComment
score: 0

http://stackoverflow.com/q/26872225
score: 1
type: Question
answer count: 1
downvote count: 0
has title: cookiechoices on appspot not working
tagged with: javascript
upvote count: 1
has body: I'm trying to run cookieChoices.js from cookieChoices.org on appspot but I'm getting the following error when I inspect the elements Failed to load resource: the server responded with a status of 404 (Not Found) http://whatsonpontyclun.appspot.com/cookiechoices.js Uncaught ReferenceError: cookieChoices is not defined whatsonpontyclun.appspot.com/:36 I've loaded cookieChoices into the root directory as I understand the instructions but I've also tried loading the file into /static/js which is where I keep my other javascript files. I get the same errors. What gives?
favorite count: 0
has answer: http://stackoverflow.com/a/29263459
accepted answer: http://stackoverflow.com/a/29263459
type: AnsweredQuestion

http://stackoverflow.com/comment/42331525
comment on: http://stackoverflow.com/q/26888654
type: Comment
type: QuestionComment
has text: Your actual string is `"value[1][some_string]"`? And you want to make change it to `"value[2][some_string]"`? What are you actually trying to achieve?
score: 2

http://stackoverflow.com/comment/42485607
comment on: http://stackoverflow.com/q/26969969
score: 0
type: Comment
type: QuestionComment
has text: "all users can access all data." Oh, being able to query data you shouldn't be able to see is only the start. I'd be more worried about `Npm.require("child-process").exec("rm -rf /")`...

http://stackoverflow.com/a/26897181
has comment: http://stackoverflow.com/comment/42348297
type: AcceptedAnswer
upvote count: 3
type: Answer
answers question: http://stackoverflow.com/q/26896852
accepted answer of: http://stackoverflow.com/q/26896852
has body: The details variable in the parseItemNode() function is null because the itemNode variable is the &lt;item/&gt; node itself. Therefore, applying Xpath item/details on this &lt;item/&gt; will return the &lt;details/&gt; that are child of &lt;item/&gt; that are child of &lt;item/&gt;, hence, no node. Switch the XPath expression to 'details' only since you're applying it on &lt;item/&gt; node. Btw, XSLT is designed to build (X)HTML upon any XML source.
score: 3
downvote count: 0

http://stackoverflow.com/comment/42276610
comment on: http://stackoverflow.com/a/26857158
type: Comment
type: AnswerComment
score: 0
has text: Actually, once I added ".length" into the for loop, this got the tiles spinning perfectly. Thanks again.

http://stackoverflow.com/comment/42269571
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26852419
has text: try using `document.body.innerHTML = data;` instead.
score: 0

http://stackoverflow.com/comment/42379927
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26915531
score: 1
has text: @RocketHazmat I put the link up

http://stackoverflow.com/q/26940074
has body: I tried to create video (and apply video-js skin) using javascript, but it doesn't seems to work :( Here is my code: Create Video After click on the button "Create Video", the video is created, but the video-js skin isn't apply. Does anyone know how to fix this problem? Thanks!
has answer: http://stackoverflow.com/a/26941019
tagged with: javascript
tagged with: html5-video
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/26941019
tagged with: css
has comment: http://stackoverflow.com/comment/42424647
tagged with: video
type: AnsweredQuestion
has title: Unable to apply video-js skin when creating video from Javascript
type: Question

http://stackoverflow.com/q/26892433
accepted answer: http://stackoverflow.com/a/26894058
tagged with: javascript
score: 0
answer count: 1
tagged with: gulp
has title: Run gulp on changed files in jade
has body: I have gulp watching jade prototypes in a /source folder, structure as follows: /source/prototypes/my-prototype-1/index.jade /source/prototypes/my-prototype-2/index.jade Here's the gulp task: gulp.task('jade', function() { return gulp.src(['source/**/*.jade']) .pipe(changed('build/prototypes/', {extension: '.html'})) .pipe(jade({ pretty: true })) .pipe(gulp.dest('build')) .on('error', gutil.log) .pipe(notify({ message: 'Jade task is complete' })); }); The prototypes are compiled into: /build/prototypes/my-prototype-1/index.jade /build/prototypes/my-prototype-2/index.jade The problem is that all prototypes are still getting re-compiled when any of them is changed. Is this perhaps because of the way I'm nesting the prototypes in folders?
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/26894058

http://stackoverflow.com/q/26834279
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42234861
type: Question
has body: I have two scripts on my site makes a jscript error with the Onclick and Style null. How can i solve this? 1. &lt;script&gt; document.getElementById("chooser-image").onclick = function () { Dropbox.choose({ linkType: "direct", extensions: ['.pdf', '.jpg', '.zip'], success: function(files) { var linkTag = document.getElementById('link'); linkTag.href = files[0].link; linkTag.textContent = files[0].link; } }); }; Error : TypeError: Cannot set property 'onclick' of null http://www.domain.dk/kontakt-os:1019 2. &lt;!-- LiveZilla Tracking Code (ALWAYS PLACE IN BODY ELEMENT) --&gt; &lt;div id="livezilla_tracking" style="display:none"&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt; var script = document.createElement("script"); script.async=true; script.type="text/javascript"; var src = "http://www.domain.dk/chat/server.php?a=fd125&amp;request=track&amp;output=jcrpt&amp;intgroup=U3VwcG9ydA__&amp;intid=cm9ubmk_&amp;pref=dXNlcg__&amp;hg=Pw__&amp;hcgs=MQ__&amp;htgs=MQ__&amp;ovlp=MjI_&amp;ovlc=IzczYmUyOA__&amp;ovlct=I2ZmZmZmZg__&amp;ovlml=Ng__&amp;ovlt=Q2hhdCBvbmxpbmU_&amp;ovloo=MQ__&amp;eca=MQ__&amp;ecw=MjUw&amp;ech=OTU_&amp;ecmb=Mjk_&amp;echt=U3DDuHJnc23DpWw,&amp;echst=Q2hhdCBtZWQgb3MgbnU_&amp;ecoht=UXVlc3Rpb25zPw__&amp;ecohst=UGxlYXNlIGxlYXZlIGEgbWVzc2FnZQ__&amp;ecfs=I0YwRkZENQ__&amp;ecfe=I0QzRjI5OQ__&amp;echc=IzZFQTMwQw__&amp;ecslw=Mg__&amp;ecsgs=IzY1OUYyQQ__&amp;ecsge=IzY1OUYyQQ__&amp;nse="+Math.random(); setTimeout("script.src=src;document.getElementById('livezilla_tracking').appendChild(script)",1); &lt;/script&gt; &lt;noscript&gt; &lt;h1&gt;&lt;img src="http://www.print.dk/chat/server.php?a=fd125&amp;amp;request=track&amp;amp;output=nojcrpt&amp;amp;intgroup=U3VwcG9ydA__&amp;amp;intid=cm9ubmk_&amp;amp;pref=dXNlcg__&amp;amp;hg=Pw__&amp;amp;hcgs=MQ__&amp;amp;htgs=MQ__" width="0" height="0" style="visibility:hidden;" alt=""&gt;&lt;/h1&gt; &lt;/noscript&gt;&lt;!-- http://www.LiveZilla.net Tracking Code --&gt; Error : TypeError: Cannot read property 'style' of null http…
score: 1
has answer: http://stackoverflow.com/a/26834453
favorite count: 0
upvote count: 2
tagged with: php
has title: Script Onclick makes jscript error
answer count: 1
downvote count: 1

http://stackoverflow.com/comment/42449911
score: 0
type: Comment
type: QuestionComment
has text: Are both files located on the local machine or as I understood it the log file is on a web site while the html file is on the local machine?
comment on: http://stackoverflow.com/q/26953816

http://stackoverflow.com/q/26877251
tagged with: node.js
linked to: http://stackoverflow.com/q/21577230
type: Question
tagged with: javascript
tagged with: jquery
tagged with: express
has body: I'm trying grab the following PDF file from a node.js server running on Heroku. https://limitless-depths-2785.herokuapp.com/file/geo3a.pdf If I go to that url within my browser, the PDF loads. What I would like to do is make an AJAX or GET call to that URL using jQuery or JavaScript and save it to the phone. I'm not sure exactly what I need to do on the server to configure it to send the pdf in a way that it can be saved to the phone or what call to make on the client side to receive that PDF file properly. Here is my client side code. $('#myButtonPdf').on('click', function () { alert("Loading Pdf"); $.get( "https://limitless-depths-2785.herokuapp.com/file/geo3a.pdf", function( data ) { $( ".result" ).html( data ); alert( "Loaded PDF" ); }); }); Here is my Node.js server side code to serve up static files. app.get('/file/:name', function (req, res, next) { var options = { root: __dirname + '/public/', dotfiles: 'deny', headers: { 'x-timestamp': Date.now(), 'x-sent': true } }; var fileName = req.params.name; res.sendFile(fileName, options, function (err) { if (err) { console.log(err); res.status(err.status).end(); } else { console.log('Sent:', fileName); } }); });
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/26877614
tagged with: cordova
has title: Saving a PDF file from a Node.js server to a PhoneGap application
type: UnansweredQuestion

http://stackoverflow.com/q/26891606
tagged with: javascript
has body: I am working with a kendo chart which has a date x-axis. I have several points for different dates, but the x-axis shows only the per month view. I have set a custom aggregate function to display the LAST data point that corresponds to each month, i.e. Data points are: Jan 01 2014 - $1500 Jan 03 2014 - $2000 Jan 10 2014 - $75 Shown in the graph is Jan 2014 - $75 When I hover over these points I want to show a custom tooltip with some custom value related to each of these points. The value shown in the tooltip is being generated by my business logic and I do not consider important to discuss it here. Lets say that for the above mentioned values the tooltip I want to show is: Jan 01 2014 - $100 Jan 03 2014 - $200 Jan 10 2014 - $300 However, when I hover over the aggregated point for the current month I expect the tooltip to show the value 'C' (because of my previous aggregate function). However the value shown is: Jan 2014 - '$100' My question is. Is there a way to specify a custom aggregate function to my kendo tooltip? The code for the chart is: public class MyModel{ public DateTime Date {get; set;} public double ShownValue {get; set;} public double ToolTipValue {get; set;} } @(Html.Kendo().Chart(List&lt;MyModel&gt;) .Name("myChart") .DataSource(dataSource =&gt; dataSource .Sort(s =&gt; s.Add(fc =&gt; fc.Date)) ) .SeriesDefaults(seriesDefaults =&gt; seriesDefaults.Line().Style(ChartLineStyle.Smooth) ) .Series(series =&gt; { series.Line(value =&gt; value.ShownValue, category =&gt; category.Date) .Aggregate("selectLastPoint"); }) .CategoryAxis(axis =&gt; axis .Labels(labels =&gt; labels.Rotation(0).Format("MMM 'yy")) .Date() .BaseUnit(ChartAxisBaseUnit.Months) .Justify(false) ) .ValueAxis(axis =&gt; axis.Numeric() .Labels(labels =&gt; labels.Format("{0:c}")) ) .Tooltip(t =&gt; t .Visible(true) .Format("{0:c}") .Template("#= kendo.format('{0:C}',dataItem.TooltipValue) #") )) The code to my aggregate function is: function selectLastPoint(values) { return values[values.l…
has title: Add aggregate function on tooltip in kendo chart
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/26891801
type: UnansweredQuestion
tagged with: kendo-chart
tagged with: kendo-tooltip
type: Question
tagged with: asp.net-mvc

http://stackoverflow.com/comment/42320734
type: Comment
comment on: http://stackoverflow.com/q/26881551
type: QuestionComment
has text: Can you make a jsfiddle that demonstrates the problem?
score: 0

http://stackoverflow.com/comment/42495017
has text: I have a tag for CrazyEgg and have included as a firing rule 'GTM Event' which has as its rule {{event}} contains 'event_name' - is that what you mean?
comment on: http://stackoverflow.com/q/26972185
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/42507223
has text: It's to remind you that npm isntall that.
type: Comment
type: QuestionComment
score: 11
comment on: http://stackoverflow.com/q/26987238

http://stackoverflow.com/q/26977783
has answer: http://stackoverflow.com/a/52109184
upvote count: 4
answer count: 3
tagged with: datetimepicker
downvote count: 0
favorite count: 0
has body: I want to ask users for a date range using bootstrap datetimepicker. There is a field for the start date and another one for the end date, and they're initialized to the day before current day. On change to the start date, I want to set the minDate of end date to the value of start date; and on change to end date I want to set the max date of start date to the value of end date. But I cannot get this working. Here is the JS code: var start = $('.start'); var end = $('.end'); var d = new Date(); var month = d.getMonth() + 1; var day = d.getDate() - 1; var year = d.getFullYear(); start.datetimepicker( { useCurrent: false, defaultDate: month + '-' + day + '-' + year + ' ' + '12:00AM', autoClose: true }) .on('change', function (selected) { end.minDate(selected.?????????); // What should replace the question marks? }); end.datetimepicker( { useCurrent: false, defaultDate: month + '-' + day + '-' + year + ' ' + '11:59PM', autoClose: true }) .on('change', function (selected) { start.maxDate(selected.???????); // What should replace the question marks? }); and the HTML: Start Date End Date I've found tickets about similar operation on datepicker, but that is done differently from datetimepicker so please don't mark duplicate unless you find similar question for datetimepicker.
possible better answer: http://stackoverflow.com/a/33992544
has answer: http://stackoverflow.com/a/33992544
has answer: http://stackoverflow.com/a/26978481
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
has title: How to set minDate and maxDate for bootstrap datetimepicker on change
type: Question
tagged with: javascript
score: 4
accepted answer: http://stackoverflow.com/a/26978481

http://stackoverflow.com/comment/42468225
comment on: http://stackoverflow.com/q/26965154
type: QuestionComment
score: 0
has text: FYI, you can only fadeOut one image and fadeIn another image at the same time (e.g. a cross fade) with Javascript when you actually have two separate images that you are fading between. You can't do that with just one image which is likely the issue with your code. If you have a newly loaded image that you want to fadeIn, the image has to initially be not visible (e.g. opacity `0`) so it can fadeIn FROM that state. If it's already visible, then jQuery's `fadeIn()` has nothing to do.
type: Comment

http://stackoverflow.com/comment/42447827
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26953731
has text: how to open above code in same window.
score: 0

http://stackoverflow.com/a/26846963
score: 0
has body: I actually decided to go with the top answer in MVC4 input field placeholder since I was using MVC4:
answers question: http://stackoverflow.com/q/26845505
type: Answer

http://stackoverflow.com/comment/42431407
has text: i tested it but still reachable to the main one easily
comment on: http://stackoverflow.com/q/26943475
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/26936144
has answer: http://stackoverflow.com/a/26937196
accepted answer: http://stackoverflow.com/a/26937196
has comment: http://stackoverflow.com/comment/42418409
type: AnsweredQuestion
has body: I have a jQuery toggle function which works fine: If I click on the dt-tag the dd section slides up or down. Just like it supposed to. But now I want to extend the toggle function: A background image of a span element within the dt-tag supposed to change position everytime you click on the dt-tag (display arrow up or down). I tried to accomplish that with following code, but I can't get it to work &lt;dt&gt;&lt;?php echo $this-&gt;__($_filter-&gt;getName()) ?&gt;&lt;span id="cpl"&gt;&lt;/span&gt;&lt;/dt&gt; &lt;dd&gt;&lt;?php echo $_filter-&gt;getHtml() ?&gt;&lt;/dd&gt; jQuery('dd').hide(); jQuery('dt').click(function() { var toggle = jQuery(this).nextUntil('dt'); toggle.slideToggle(); jQuery('dd').not(toggle).slideUp(); jQuery('#cpl').toggleClass('clicked'); }); #cpl { width: 90px; height: 11px; display: inline-block; margin: 0 0 0 10px; background:transparent url('../images/arrow.gif') no-repeat; background-position: 0 0; } #cpl.clicked { background-position: 0 -15px; } Any help is much appreciated. Thank you.
tagged with: toggle
type: Question
has comment: http://stackoverflow.com/comment/42417621
has comment: http://stackoverflow.com/comment/42417397
has title: jQuery toggle - change background position of image
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42417226
has comment: http://stackoverflow.com/comment/42417365
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/42416738

http://stackoverflow.com/a/26948513
type: Answer
has comment: http://stackoverflow.com/comment/42439988
has body: The answer is found, finally :) $('#player').detach().appendTo($('#'+tileID))
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/26947473
downvote count: 0

list
type: Tag
tags question: http://stackoverflow.com/q/26980633
tags question: http://stackoverflow.com/q/26977801
tag name: list
tags question: http://stackoverflow.com/q/26853850
tags question: http://stackoverflow.com/q/26968002
tags question: http://stackoverflow.com/q/26963836

dreamweaver
type: Tag
tag name: dreamweaver
tags question: http://stackoverflow.com/q/26921647

http://stackoverflow.com/a/26974447
has body: This is more of an understanding-of-the-language question, than an Angular question. Short answer: The internals of AngularJS call the method that is at the controller key in the returned object. It just happens to call it with a parameter of $scope Any arguments passed or not passed to a function do not necessarily have anything to do with arguments passed to functions that are created inside of the "parent" function's scope - even though a parent-child relationship is not the correct way of thinking about how these functions are related). Maybe an example will help better: var t = function() { return { controller: function(someArgument) { console.log(someArgument); }, foo: function(bar) { console.log(bar); } } } var obj = t(); obj.controller('hello'); obj.foo('world!');
answers question: http://stackoverflow.com/q/26974392
upvote count: 1
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/42369611
comment on: http://stackoverflow.com/q/26909964
score: 0
type: Comment
type: QuestionComment
has text: textNode is text, not html, hence why the link is not a link.

http://stackoverflow.com/a/26964766
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/42467260
has body: use .attr() and .val() to get attribute and value: $(this).attr('id'); and $(this).val();
answers question: http://stackoverflow.com/q/26964751
upvote count: 1
has comment: http://stackoverflow.com/comment/42467649

http://stackoverflow.com/comment/42370614
score: 0
type: AnswerComment
has text: ah, i see now. At here: data {p:selected}. This is the point, where you somehow neet to get the `$('#q').val();`. So the selected value shold be that.
type: Comment
comment on: http://stackoverflow.com/a/26908561

http://stackoverflow.com/q/26949943
accepted answer: http://stackoverflow.com/a/26951117
score: 0
tagged with: irc
tagged with: google-chrome-extension
answer count: 1
tagged with: tabs
has body: For reference, here's my project. Here's my manifest: { "name": "Chatty", "description": "Yet another IRC client written as a Chrome application", "version": "0.0.1", "manifest_version": 2, "app": { "background": { "scripts": ["background.js"] } } } Here's my SUPER basic web page that I would like to open in a new tab: &lt;!doctype HTML&gt; &lt;html&gt; &lt;body&gt; Hello, Chatty IRC client! &lt;/body&gt; &lt;/html&gt; And, here's how I've been trying to open the new tab: chrome.app.runtime.onLaunched.addListener(function(){ chrome.tabs.create({ url: chrome.extensions.getUrl("irc.html") }); }); Finally, here's my issue: it doesn't want to open in a new tab. Can someone help me get this working?
has title: Why isn't chrome tabs working?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26951117
type: Question
tagged with: javascript

http://stackoverflow.com/a/29400635
type: Answer
answers question: http://stackoverflow.com/q/26981158
has body: This is not possible. PHP runs on the server, while JS runs on the client. Your best chance is to remove the ns.path.VARIABLE part from your file, and read it as an actual JSON file by using file_get_contents() on it Example resource.json { Part1: { 'Key1': 'Value1', 'Key2': 'Value2' } Part2: { 'Key1': 'Value1', 'Key2': 'Value2' } } PHP code &lt;?php $json = json_parse(file_get_contents('resource.json')); Simple as that! EDIT On the specific code you published, you can do the following, but it doesn't seem safe or flexible: // Load the file as a string $js_string = file_get_contents('resource.js'); // Remove the namespace part so that you can parse it as a JSON string $js_string = str_replace('ns.path.VARIABLE =', '', $js_string); // Convert it to an associative array you can use in PHP $array = json_decode($js_string);
upvote count: 1
downvote count: 0
score: 1

http://stackoverflow.com/comment/42463269
has text: "Example the user types in mo, the hint shows montana" - It doesn't suggest Montana in your fiddle. Also right arrow key does not select the suggestion.
comment on: http://stackoverflow.com/q/26952904
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/26922173
tagged with: node.js
has answer: http://stackoverflow.com/a/26922257
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/26934455
tagged with: express
score: 0
has title: Using the Jade engine on all .jade files regardless of location
answer count: 2
tagged with: pug
has body: I'm using Node and the Express framework for my website, but instead of a separate Views folder, I have a site structure where the .jade files could be anywhere within a static folder. What's the simplest way of getting jade to compile the templates if they end in .jade? Do I have to write a middleware function for the regex \.jade$? How would I do this?
type: UnansweredQuestion

http://stackoverflow.com/comment/42311180
type: Comment
comment on: http://stackoverflow.com/q/26876994
type: QuestionComment
has text: Is ajax request sent? Is it successful?
score: 0

http://stackoverflow.com/comment/42487712
comment on: http://stackoverflow.com/a/26976422
has text: All u've done there is copied the example on the ANgular js documentation. I'd like to keep using the Restangular plugin if i can which is abstracted into the UsernameService. Why does my code not work, whislt the above does? Thanks for any help you can provide
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42305024
score: 1
has text: Rouler avec les bons tons!
type: AnswerComment
comment on: http://stackoverflow.com/a/26869965
type: Comment

http://stackoverflow.com/q/26958379
accepted answer: http://stackoverflow.com/a/26974013
downvote count: 0
type: Question
has body: On a form there are 4 text inputs. If at least 1 of them has a value then all remaining fields must have a value. Is it possible to configure Parsley.js for this validation?
tagged with: parsley.js
has answer: http://stackoverflow.com/a/26974013
has title: Parsley.js Validation if 1 of 4 Fields Has a Value
tagged with: javascript
upvote count: 2
tagged with: validation
answer count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
score: 2

http://stackoverflow.com/a/26928170
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/26927740
type: Answer
has body: try something like this and console.log and check the result $.ajax({ url : 'checkSite.php', dataType : 'json', cache : false, contentType : false, processData : false, data : { siteid : siteid }, type : 'post', success : function(data){ console.log (data); } });

http://stackoverflow.com/q/26839472
has comment: http://stackoverflow.com/comment/47395152
type: Question
has body: Since updating Visual Studio 2013, (Update 2) I keep receiving this error message: The JavaScript language has encountered an error and has been shut down. Please save your changes, exit, and restart Visual Studio. This error occurs on old and new projects, and researching into it i dont seem to be getting anywhere. I have tried the obvious (stated in the error message) but this occurs each time i load up a javascript window. I insalled app builder shortly after (Telerik) which also may have caused an issue, im still looking at it myself but would appreciate any suggestions cheers for any help
has answer: http://stackoverflow.com/a/42634514
has answer: http://stackoverflow.com/a/26905743
tagged with: javascript
answer count: 3
downvote count: 0
possible better answer: http://stackoverflow.com/a/33376536
favorite count: 0
tagged with: visual-studio-2013
has answer: http://stackoverflow.com/a/33376536
accepted answer: http://stackoverflow.com/a/26905743
has comment: http://stackoverflow.com/comment/47394012
upvote count: 2
has title: The JavaScript language has encountered an error and has been shut down. (Tried Suggested links)
tagged with: visual-studio
score: 2
type: AnsweredQuestion

http://stackoverflow.com/comment/42358774
type: Comment
type: QuestionComment
has text: You want loader to be placed in whole page or in a single view?
score: 0
comment on: http://stackoverflow.com/q/26903562

http://stackoverflow.com/comment/42258926
score: 0
has text: I am using infinite scroll, adding $i++ to each div id breaks the scroll
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26848102

http://stackoverflow.com/a/27568027
has body: I have encountered this solution developed in Python: Celery "Celery is an asynchronous task queue/job queue based on distributed message passing. It is focused on real-time operation, but supports scheduling as well." Can be integrated with several Python frameworks (Django, Pylons, ...): http://docs.celeryproject.org/en/latest/getting-started/introduction.html#framework-integration But you prefer Node.js, so you can use it with other languages as well, it can integrate through HTTP Callback (Webhooks): http://docs.celeryproject.org/en/latest/userguide/remote-tasks.html
has comment: http://stackoverflow.com/comment/43619779
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26843483

http://stackoverflow.com/a/26923858
score: 1
has comment: http://stackoverflow.com/comment/42399803
has comment: http://stackoverflow.com/comment/42400321
has comment: http://stackoverflow.com/comment/42400510
has comment: http://stackoverflow.com/comment/42400610
downvote count: 0
has comment: http://stackoverflow.com/comment/42399318
has comment: http://stackoverflow.com/comment/42400261
has comment: http://stackoverflow.com/comment/42398967
has body: You need to set the date in setValue like this: cartHeaderRDD.setValue(new Date());
type: Answer
has comment: http://stackoverflow.com/comment/42399129
has comment: http://stackoverflow.com/comment/42400764
upvote count: 1
answers question: http://stackoverflow.com/q/26917478
has comment: http://stackoverflow.com/comment/42397577

http://stackoverflow.com/q/26912115
has answer: http://stackoverflow.com/a/26912831
tagged with: jquery
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/42374406
has comment: http://stackoverflow.com/comment/42373788
tagged with: backbone-events
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42374991
has title: Document listener jQuery.each
has body: We have a web app that spits out elements server-side and some through Backbone -- and have a simple jQuery.each() statement that flips through elements on the page and adds/removes certain classes based on size of the component. I'm calling this within an "init" function, but it's obviously not working for any elements that are not on the page when loaded; within the Backbone scope. I'd rather not re-call this function in each Backbone instance (in-case we end up adding more views that render other items needed by this function) and wanted something like a $(document).on() function to work like I do for normal clicks, hovers, etc. I haven't found any examples on how I could make this work with jQuery.each(), so would appreciate any insight on how I'd go about this.
type: Question
has comment: http://stackoverflow.com/comment/42373850
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/a/26869972
has comment: http://stackoverflow.com/comment/42300813
has comment: http://stackoverflow.com/comment/42299278
has comment: http://stackoverflow.com/comment/42310731
downvote count: 0
upvote count: 1
has body: In my project, I have an index.js (browserify entry point) and load plugins like: var Ractive = require('ractive'); // file reference: /*var keys = */ require('./js/ractive-transitions-fade'); // npm reference: /*var touch = */ require('ractive-touch'); var ractive = new Ractive({...}) The plugin "registers" itself, but you still have to "install" either as a file in your assets or via npm
has comment: http://stackoverflow.com/comment/42303056
type: Answer
answers question: http://stackoverflow.com/q/26868815
score: 1

http://stackoverflow.com/comment/42507923
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/26987661
has text: You have a spelling mistake in your JS. In the HTML you have the id as 'midtext' and in your jS youhave it as 'midtekst'. thats all
type: Comment

http://stackoverflow.com/q/26861110
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/26870701
has body: I want fixed an div or image in left of html page, and when scroll y, image scroll, but when scroll x image not scroll or fixed in left, I use jquery.sticky-kit.js and jquery-scrolltofixed.js plugin but when page resize to small width (mobile size) scroll x that, note that my page not responsive. Another note that a mootools plugin is that work well, but I want do this in jquery. Mootools plugin is in this link: http://demo.rickyh.co.uk/css-position-x-and-position-y/
has answer: http://stackoverflow.com/a/26861577
score: 0
answer count: 2
has title: fixed div only vertically with jquery
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/42346068
has text: mustache.js is your friend, and all you really need if your jedi force is strong
comment on: http://stackoverflow.com/q/26896349
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42358400
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26903427
has text: @SZenC — You can say the same thing about parsing JSON. Heck, parsing JSON is just a single function call so it requires less googling and even less thought than munging does.
score: 0

http://stackoverflow.com/comment/42505071
comment on: http://stackoverflow.com/a/26985709
has text: So you've told me where the first part (trimming) is documented, but not the second (encoding). Is this documented or is it Postel's Law in action?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42329519
type: QuestionComment
has text: the location is hard set in the code, I need to use geolocation so it gets the current location
comment on: http://stackoverflow.com/q/26887416
score: 0
type: Comment

http://stackoverflow.com/q/26966544
type: Question
tagged with: async.js
has title: Returing result of asynchronous function within Async.map
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/26966698
score: 0
has body: I'm very new to JS and functional programming in general and am struggling to find a graceful solution to this problem. Essentially, I want to make async requests to a MongoDB server, and return the results to an async to map function. The problem I am having in that the actual function within async.map is asynchronous itself. I would like to know a graceful solution here, or at least get a pointer in the right direction! Thanks! async.map(subQuery, function(item){ collection.distinct("author", item, function(err, authors){ counter++; console.log("Finished query: " + counter); var key = item['subreddit']; return { key: authors }; }) }, function(err, result){ if (err) console.log(err); else{ console.log("Preparing to write to file..."); fs.writeFile("michaAggregate.json", result, function() { console.log("The file was saved!"); }); } db.close(); } );
type: UnansweredQuestion

http://stackoverflow.com/a/26888836
type: Answer
score: 2
has body: Yes, and you almost have it. Just lose the extra + in your load() function, and add a space before #title (to match the your correct earlier example): function load(url) { $("#main2").load( url + " #title" ); }
answers question: http://stackoverflow.com/q/26888747
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/42331992

http://stackoverflow.com/comment/42254197
has text: Hmm, I'm going to need `RANDOM-UNIQUE-STRING-1` too. But thanks for the idea. Will this be time consuming if I have 1000+ pieces of data?
type: AnswerComment
comment on: http://stackoverflow.com/a/26839848
score: 0
type: Comment

http://stackoverflow.com/comment/42363575
has text: I have updated my question. Can you please check my updated quesetion.\
comment on: http://stackoverflow.com/q/26906164
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42444753
type: QuestionComment
comment on: http://stackoverflow.com/q/26952040
type: Comment
has text: Can we see the service? is it returning a promise?
score: 0

http://stackoverflow.com/comment/42337209
has text: Thanks for your help on this @michael, got it working. Had to change the construct of my modal funciton, but you helped lay the groundwork! I really appreciate it, now its exactly like I wanted.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26877834
type: Comment

http://stackoverflow.com/q/26893779
has body: I need to prevent the user from selecting white spaces with get Selection: if (window.getSelection) { text = window.getSelection(); if (text.rangeCount) { if(text==""){return false;} var range = text.getRangeAt(0).cloneRange(); range.surroundContents(span); text.removeAllRanges(); text.addRange(range); } } My check only returns false if there is no selection at all.
possible better answer: http://stackoverflow.com/a/26893823
has answer: http://stackoverflow.com/a/26893823
has answer: http://stackoverflow.com/a/26893820
type: Question
tagged with: javascript
score: 0
answer count: 3
has title: how to check if get Selection contains only whitespace
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/26893860
favorite count: 0
has comment: http://stackoverflow.com/comment/42341196
accepted answer: http://stackoverflow.com/a/26893820
type: AnsweredQuestion

http://stackoverflow.com/a/33291714
accepted answer of: http://stackoverflow.com/q/26952903
has body: Here is how I have done it... this fiddle uses a custom DataTablesForEach binding and also includes a fork of knockout... I have created a pull request with the knockout repository on github. If this solution helps you, please leave a comment on my pull request to get this merged into knockout 3.4.. thanks! jsfiddle pull request #1856 knockout/knockout repository on github ko.bindingHandlers.DataTablesForEach = { init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) { var nodes = Array.prototype.slice.call(element.childNodes, 0); ko.utils.arrayForEach(nodes, function (node) { if (node &amp;&amp; node.nodeType !== 1) { node.parentNode.removeChild(node); } }); return ko.bindingHandlers.foreach.init(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext); }, update: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) { var value = ko.unwrap(valueAccessor()), key = "DataTablesForEach_Initialized"; var newValue = function () { return { data: value.data || value, beforeRenderAll: function (el, index, data) { if (ko.utils.domData.get(element, key)) { $(element).closest('table').DataTable().clear(); $(element).closest('table').DataTable().destroy(); } }, afterRenderAll: function (el, index, data) { $(element).closest('table').DataTable(value.options); } }; }; ko.bindingHandlers.foreach.update(element, newValue, allBindingsAccessor, viewModel, bindingContext); //if we have not previously marked this as initialized and there is currently items in the array, then cache on the element that it has been initialized if (!ko.utils.domData.get(element, key) &amp;&amp; (value.data || value.length)) { ko.utils.domData.set(element, key, true); } return { controlsDescendantBindings: true }; } };
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26952903
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/26917287
has comment: http://stackoverflow.com/comment/42394654
has comment: http://stackoverflow.com/comment/42384661
tagged with: javascript
has comment: http://stackoverflow.com/comment/42384545
score: 0
has comment: http://stackoverflow.com/comment/42383591
has title: Dynamically updating array ng-repeat
has comment: http://stackoverflow.com/comment/42383462
has comment: http://stackoverflow.com/comment/42383574
has comment: http://stackoverflow.com/comment/42384155
answer count: 1
has answer: http://stackoverflow.com/a/26920753
has comment: http://stackoverflow.com/comment/42383283
linked to: http://stackoverflow.com/q/15475601
has comment: http://stackoverflow.com/comment/42383502
has comment: http://stackoverflow.com/comment/42383720
has comment: http://stackoverflow.com/comment/42383247
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42396121
has comment: http://stackoverflow.com/comment/42384075
has comment: http://stackoverflow.com/comment/42383137
has comment: http://stackoverflow.com/comment/42392631
has comment: http://stackoverflow.com/comment/42383429
has comment: http://stackoverflow.com/comment/42394967
has comment: http://stackoverflow.com/comment/42383669
has comment: http://stackoverflow.com/comment/42384210
has comment: http://stackoverflow.com/comment/42393965
has body: I am new to angular and I have built some controller with angular which is shown in below. var app = angular.module('jobs', []); app.controller('DaCtrl',function(){ this.itemlist = [{id:"001"},{id:"002"},{id:"003"}]; }); What I need is to update "itemlist" property dynamically by calling a function and display the items using ng-repeat I tried like this and it didnt work :( What I have tried so far JSFiDDLE Updated FIDDLE
type: Question
has comment: http://stackoverflow.com/comment/42383537
linked to: http://stackoverflow.com/q/11902379
has comment: http://stackoverflow.com/comment/42384135
has comment: http://stackoverflow.com/comment/42384004

http://stackoverflow.com/a/26887728
answers question: http://stackoverflow.com/q/26887613
has body: 1 way of doing it would be to save the location of the page and restore to that location when back button is clicked on click : var position = $(window).scrollTop(); On back button : $(window).scrollTop(position);
score: 0
type: Answer

http://stackoverflow.com/comment/42364796
score: 0
type: QuestionComment
type: Comment
has text: @Athi..i have included the html code.please check it
comment on: http://stackoverflow.com/q/26906879

http://stackoverflow.com/q/26988945
type: Question
has body: So, I'm using this program called MMLogic and I have a question about a school project. We had to create a traffic light using a button, and everytime we pressed the button It'd switch colour and at the 4th press reset. So a truth table would be: +----------+------+ | Red | 001 | +----------+------+ | Yellow | 010 | +----------+------+ | Green | 011 | +----------+------+ | Reset | 100 | +----------+------+ Now, I have done that but the next assignment is to create 4 traffic lights as in a junction, so: Traffic light A would be green at the same time as light B, and C &amp; D will be red. All cycling through at the press of one button. Truth table -> +--------+----------+---------------+-------+---------+ | Press | binary | state AB/CD | AB | CD | +--------+----------+---------------+-------+---------+ | 0. | 000 | red/green | 100 | 001 | | 1. | 001 | red/orange | 100 | 010 | | 2. | 010 | green/red | 001 | 100 | | 3. | 011 | orange/red | 010 | 100 | | 4. | 100 | reset | | | +--------+----------+---------------+-------+---------+ So, I can use any gates, from AND to XOR and more. Can somebody help me with this assignment... I've worked on it for 3 periods now and still can't figure it out... Thanks in advance :)
has answer: http://stackoverflow.com/a/26992203
tagged with: javascript
has title: Mmlogic Traffic light
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: css
score: 2
upvote count: 2

http://stackoverflow.com/comment/42422786
has text: How are you loading the JavaScript via jQuery? Does it work as expected if you include them as script files normally?
comment on: http://stackoverflow.com/q/26939271
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/42448352
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26953879
has text: do you have that project on jsfiddle?
score: 0

http://stackoverflow.com/comment/42499966
has text: Here's an older Screenshot example I used photoshop to come up with. However I'm sticking with the marker and not icons.http://s30.postimg.org/8v01cnu41/Screenshot_Figure1_2.jpg
type: AnswerComment
comment on: http://stackoverflow.com/a/26982693
score: 0
type: Comment

http://stackoverflow.com/a/26860826
downvote count: 0
answers question: http://stackoverflow.com/q/26860394
type: Answer
has comment: http://stackoverflow.com/comment/42284182
accepted answer of: http://stackoverflow.com/q/26860394
has body: You can put them in an external file(s) and load them when you need but this means plugin users will have to download all your files, instead of a single js file. Another option I used before (not for a plugin though) is to have an object inside your plugin which holds all the html you want. This makes it easier to write the plugin as the html doesn't clutter the plugin code. Also when you need to edit the html, it's in a single place. You can also put your templating code inside this object. var pi = function() { var self = this; self.getNewDiv = function(){ return repo.getDiv(); } //..... all your plug in code goes here and at the bottom var htmlRepository = function() { var divCode = "&lt;div&gt;&lt;/div&gt;"; this.getDiv = function(){ return divCode; }; this.getSpan = function(){ return "Span Content"; } this.getDivWithSpan = function(){ return getSpan().wrap(divCode); //etc } }; var repo = new htmlRepository(); }
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/42284741
type: AcceptedAnswer

http://stackoverflow.com/q/26872387
favorite count: 0
has answer: http://stackoverflow.com/a/26873708
tagged with: http://stackoverflow.com/tag/html
answer count: 4
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/42303037
has title: Inserting username and password at website using javascript in Chrome
has answer: http://stackoverflow.com/a/26872468
has answer: http://stackoverflow.com/a/26872533
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/42302979
type: Question
has body: I was trying to make script which will auto-login me to website (http://gamers.ba/), but I can't get it to insert my username and password inside form. I tried this code: javascript:document.forms['cssforms'].elements[username].value = MyUsername; but nothing happens actually... Also I tried this code: javascript:document.getElementById('username').value = 'MyUsername'; but then I just get new blank page with "MyUsername" text at left upper corner... This is part of code when I inspect that element in my Chrome: Username Any ideas? Thanks in advance!
score: 3
linked to: http://stackoverflow.com/q/4968406
tagged with: javascript
upvote count: 3
has answer: http://stackoverflow.com/a/26872524
possible better answer: http://stackoverflow.com/a/26872468
accepted answer: http://stackoverflow.com/a/26873708

if-statement
tags question: http://stackoverflow.com/q/26964171
tags question: http://stackoverflow.com/q/26856737
tags question: http://stackoverflow.com/q/26887582
tag name: if-statement
tags question: http://stackoverflow.com/q/26846095
type: Tag
tags question: http://stackoverflow.com/q/26980796
tags question: http://stackoverflow.com/q/26941966
tags question: http://stackoverflow.com/q/26844316
tags question: http://stackoverflow.com/q/26976694
tags question: http://stackoverflow.com/q/26941899
tags question: http://stackoverflow.com/q/26983941
tags question: http://stackoverflow.com/q/26920682

http://stackoverflow.com/comment/42346533
type: Comment
type: QuestionComment
has text: Ok. But if I write a wrong index (like 333 or -10), why don't I see in the page the word "undefined" or "null"? Why the script is ignoring me?
comment on: http://stackoverflow.com/q/26895366
score: 0

http://stackoverflow.com/a/26946614
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26945711
type: AcceptedAnswer
type: Answer
score: 3
upvote count: 3
has body: Finally I have the solution (hopefully). A good help was these stack overflow post. Now I can drag the nodes correctly as I want. The point was the d.fixed = true for the force layout. Maybe that helps others.
answers question: http://stackoverflow.com/q/26945711

http://stackoverflow.com/q/26918595
score: 0
has comment: http://stackoverflow.com/comment/42491268
tagged with: laravel-4
tagged with: ajax
has comment: http://stackoverflow.com/comment/42726806
tagged with: laravel
has comment: http://stackoverflow.com/comment/42726359
answer count: 0
has body: In my application, I call a function named checkProject, in my controller. I do this via getJSON. I understand the use of append to display content from my response data, however I need to use the values to populate a javascript function within my blade view. Is it possible to do this through sessions? Is there another way I can pass this data through? PROJECT CONTROLLER public function getProject() { $input = Input::get('option'); $projects = Project::where('id', $input)-&gt;get(); return Response::json($projects); // can session be set here? } PROJECT.BLADE.PHP This has getJSON which calls api/getproject which routes to the project controller function above. Below is the Json call and the secondary JS function which needs to populate the values minTime and maxTime $.getJSON("{{ url('api/getproject')}}", { option: $(this).val() }, function(data) { if (data.success != false ) { $.each(data, function(key, value) { $('#open').append('&lt;div&gt;' + value.weekday_start_time +', ' + value.title +'&lt;/div&gt;'); }); } }); var logic = function( currentDateTime ){ if( currentDateTime.getDay()==6 ){ this.setOptions({ minTime:'10:00', maxTime:'21:00' }); } else this.setOptions({ minTime:'08:00', maxTime:'22:00' }); }; });
type: UnansweredQuestion
type: Question
has title: Laravel 4 - pass parameter in controller, through ajax to view
tagged with: javascript

http://stackoverflow.com/comment/42395085
comment on: http://stackoverflow.com/q/26923743
score: 0
type: Comment
type: QuestionComment
has text: You can simulate this dynamically by adding `<a` with attributes `href` and `download` and trigger the click at the end remove the element

http://stackoverflow.com/q/26845208
answer count: 1
linked to: http://stackoverflow.com/q/11275481
has answer: http://stackoverflow.com/a/26846559
tagged with: javascript
tagged with: qtip2
tagged with: jquery
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26846559
tagged with: css
has body: I am trying to include a chart inside a qtip tooltip, but the chart does not show up in the tooltip. I have given the tooltip charting area an id of its own, but the plot does not appear in that area. There is an earlier posting on Stack Overflow which addresses the same issue, but the solution does not provide enough detail for me to apply it correctly. Likewise on the qtip help forum. I made a fiddle demonstrating my problem. There is a normal tooltip and then a tooltip which is supposed to contain the chart (but doesn't). Fiddle here I'll also post the relevant code: HTML: Hello Hello again! CSS: #hello1, #hello2{ height: 100px; width: 200px; } #tooltipchart{ height: 100px; width: 200px; } Javascript: $('#hello1').qtip({ // Grab some elements to apply the tooltip to content: { text: 'Here is a chart!'}, position: { target: 'mouse' } }) $('#hello2').qtip({ content: { text: "No chart inside the tooltip :(" }, position: { target: 'mouse' }, api:{onShow: function(){return tooltipcontent();}} }) function tooltipcontent(){ var div = document.createElement("div"); div.setAttribute("id", "tooltipchart"); div.setAttribute("height", "100px"); div.setAttribute("width", "100px"); return div; } $(document).ready(function(){ var plot1 = $.jqplot('hello1', [ [[4,1], [7,2], [1,3], [2,4]]], { seriesDefaults: { pointLabels: { show: true} } }); var plot2 = $.jqplot('tooltipchart', [ [[4,1], [7,2], [1,3], [2,4]]], { seriesDefaults: { pointLabels: { show: true} } }); }); Please advise on how to solve this issue.
has title: Chart inside qtip tooltip?
score: 0

http://stackoverflow.com/a/26974020
has body: There are numerous ways to clear a canvas pre drawing to create animation: How to clear the canvas for redrawing simplest in my mind: canvas.width=canvas.width; though can equally use clearRect (which is actually quicker and won't reset the entire canvas if that is an issue regarding transforms etc!) over the region or whole canvas. Get the likes of: http://jsfiddle.net/dw17jxee/
answers question: http://stackoverflow.com/q/26973798
score: 0
type: Answer

http://stackoverflow.com/comment/42429519
comment on: http://stackoverflow.com/q/26943198
score: 0
type: Comment
type: QuestionComment
has text: And you're sure the issue isn't just asynchronicity, the `reRank` variable looks hinky !

http://stackoverflow.com/comment/42431552
comment on: http://stackoverflow.com/q/26944319
score: 0
type: Comment
type: QuestionComment
has text: I suggest u to use plug-in:http://www.thepetedesign.com/demos/zepto_onepage_scroll_demo.html

http://stackoverflow.com/comment/42343087
score: 0
type: Comment
type: QuestionComment
has text: print_r($_POST['selectto']) prints out Array ( [0] => [1] => [2] => [3] => [4] => [5] => [6] => [7] => ) when I select eight options.
comment on: http://stackoverflow.com/q/26894490

http://stackoverflow.com/comment/42513292
has text: In general, it's probably not necessary. In circumstances where content comes from a user, it may be sensible. So in this case it depends where `this.au` came from.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26990899
score: 3

http://stackoverflow.com/q/26946099
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/26946117
accepted answer: http://stackoverflow.com/a/26946117
has comment: http://stackoverflow.com/comment/42434524
upvote count: 3
has body: I have problems with my application that is when it will display the data from the database in the form of a data table that happen to two sideways instead of down main.js $(document).ready(function(){ var sql = ign.sql(); var driver = sql.driver("sqlite","peserta.sqlite"); var qry = sql.query("select * from data"); if(driver){ //$(".json").html(JSON.stringify(qry)); var query = qry; var html = ""; $("p").html("Status Database Connection : "+query.status); if(query.status){ $.each(query.content,function(data){ html += " "+this.no+" "; html += " "+this.nama+" "; html += " "+this.alamat+" "; }); } $(".data").html(html); } }); this HTML No Nama Alamat
tagged with: http://stackoverflow.com/tag/html
tagged with: sqlite
has answer: http://stackoverflow.com/a/31613864
has title: how to display database with javascript in the form of a table?
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/31613864
type: Question
answer count: 2

http://stackoverflow.com/q/26955920
has comment: http://stackoverflow.com/comment/42451301
has body: I have written a program in C#, i use webbrowser dialog box control in my program. There is some problem with one of the java script. Internet Explorer gives me warning message. "one of the Script is slowing down". I am not getting any way, i can debug the java script in IE(because webbrowser dialog box control use it indirectly). Is there any tool i can install which can give me some information on the javascript which is causing the problem. *There are lot many javascripts , so tracing won't be possible. ( i have tried tracing few).
tagged with: c#
tagged with: internet-explorer
tagged with: javascript
has comment: http://stackoverflow.com/comment/42451393
type: Question
has title: JavaScript issue in Internet explorer while using webbrowserdialog box control C#
score: 0
tagged with: webbrowser-control
has comment: http://stackoverflow.com/comment/42452080
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/26919239
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/26919093
has body: I think you want /\w+(?:\[(\w+)_attributes\])+\[\d+\]\[own_property\]/ Note that if you use global g flag and you attempt to match multiple strings, you will need to reset the index of the regex.
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26919093

http://stackoverflow.com/q/26835791
has answer: http://stackoverflow.com/a/26835839
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/26835839
has answer: http://stackoverflow.com/a/26835828
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26835828
has body: I'm newbie in html 5, and i'm trying some code for drop image from desktop, but my code doesn't work. This is my code: script&gt; function OnDropTextarea(event) { if (event.dataTransfer) { if (event.dataTransfer.files) { var leftbox = document.getElementById("leftbox"); for (var i = 0; i &lt; event.dataTransfer.files.length; i++) { var file = event.dataTransfer.files[i]; leftbox.innerHTML += file; } } else { alert("Your browser does not support the files property."); } } else { alert("Your browser does not support the dataTransfer property."); } if (event.stopPropagation) { event.stopPropagation(); } else { event.cancelBubble = true; } return false; } &lt;/script&gt; &lt;section id="leftbox" ondrop="return OnDropTextarea (event);"&gt;&lt;/section&gt; So, please! help me I try new code, but i can only drag and drop box in other box, not from desktop. Another code: &lt;script&gt; function doFirst() { mypic = document.getElementById('pic'); mypic.addEventListener("dragstart", startDrag, false); leftbox = document.getElementById('leftbox'); leftbox.addEventListener("dragenter", function(e) { e.preventDefault() }, false); leftbox.addEventListener("dragover", function(e) { e.preventDefault() }, false); leftbox.addEventListener("drop", dropped, false); } function startDrag(e) { var code = '&lt;img src="/assets/Koala.jpg"&gt;'; e.dataTransfer.setData('Text', code); } function dropped(e) { e.preventDefault(); leftbox.innerHTML = e.dataTransfer.getData('Text'); } window.addEventListener("load", doFirst, false); &lt;/script&gt; &lt;section id="leftbox"&gt; &lt;/section&gt; &lt;section id="rightbox"&gt; &lt;img src="/assets/Koala.jpg" id="pic"/&gt; &lt;/section&gt;
has title: Can't drop image from desktop with html5
type: Question
has answer: http://stackoverflow.com/a/26835858
tagged with: javascript

http://stackoverflow.com/comment/42555016
comment on: http://stackoverflow.com/a/26992361
has text: It still gets an `ng-invalid-parse` and a `ng-invalid` class added, so it fails validation!
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/26844704
possible better answer: http://stackoverflow.com/a/26844751
score: -2
accepted answer: http://stackoverflow.com/a/26844741
has answer: http://stackoverflow.com/a/26844751
tagged with: javascript
answer count: 6
has title: :gt() selector, index defined for a variable
has answer: http://stackoverflow.com/a/26844763
has answer: http://stackoverflow.com/a/26844768
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/26844741
has body: I'm trying using the selector :gt() of jquery.It works when I put a number, for example :gt(3). I have a numeric variable and want pass it for the selector,like: var x = 9; $("tr:gt(x)").hide(); How can I do it?
has answer: http://stackoverflow.com/a/26844994
type: AnsweredQuestion
downvote count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/26844749
has comment: http://stackoverflow.com/comment/42252602
type: Question
has comment: http://stackoverflow.com/comment/42252930

http://stackoverflow.com/q/26845150
has comment: http://stackoverflow.com/comment/42253470
type: Question
has title: Backbonejs routing casesensitivity issue
answer count: 1
tagged with: javascript
score: 0
tagged with: backbone.js
has body: I am using backbonejs router and it seems that routing is not working for opposite case of route which has been configured. var AppRouter = Backbone.Router.extend({ routes: { 'project(/)(/index)': 'showProjects', 'project/:id': 'showProjectEdit' } }); Works for http://www.test.com:53895/project But not working when P is in uppercase http://www.test.com:53895/Project The version which i am using is 1.1.2. Please help!
has answer: http://stackoverflow.com/a/26857640
accepted answer: http://stackoverflow.com/a/26857640
tagged with: url-routing
type: AnsweredQuestion

http://stackoverflow.com/q/26922517
has comment: http://stackoverflow.com/comment/42392568
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42392615
upvote count: 2
tagged with: md5
has answer: http://stackoverflow.com/a/26923960
has answer: http://stackoverflow.com/a/26924572
type: Question
tagged with: javascript
tagged with: image
possible better answer: http://stackoverflow.com/a/26922534
has answer: http://stackoverflow.com/a/26922534
tagged with: canvas
answer count: 3
accepted answer: http://stackoverflow.com/a/26923960
has title: Why does canvas.toDataURL() not produce the same base64 as in Ruby for an image?
has body: I'm trying to produce the same base64 data for an image file in both JavaScript and in Ruby. Unfortunately both are outputting two very different values. In Ruby I do this: Base64.encode64(File.binread('test.png')); And then in JavaScript: var image = new Image(); image.src = 'http://localhost:8000/test.png'; $(image).load(function() { var canvas, context, base64ImageData; canvas = document.createElement('canvas'); context = canvas.getContext('2d'); canvas.width = this.width; canvas.height = this.height; context.drawImage(this, 0, 0); imageData = canvas.toDataURL('image/png').replace(/data:image\/[a-z]+;base64,/, ''); console.log(imageData); }); Any idea why these outputs are different?
downvote count: 0
favorite count: 0
linked to: http://stackoverflow.com/q/15208640

http://stackoverflow.com/comment/74800951
type: Comment
has text: This not work for wkwebview's evaluateJavaScript(), refer to this post http://stackoverflow.com/q/43600624/6521116
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27067168

http://stackoverflow.com/q/26931631
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/42409134
has answer: http://stackoverflow.com/a/26943326
downvote count: 1
type: Question
tagged with: javascript
score: -1
has title: How to add stacklabels for stacked bar chart where data is loaded dynamically
upvote count: 0
tagged with: highcharts
answer count: 1
favorite count: 0
has body: How to add stacklabels for stacked bar chart where data is loaded dynamically.For example, On click of a button every new 5 data will be displayed in the chart , in such a case the stacklabels dont display , what to do?

http://stackoverflow.com/a/26865134
type: Answer
has comment: http://stackoverflow.com/comment/42291579
has body: do you want to do this initially? hjow about you do this? $(document).ready(function(){ if($(#element)) { do something }; }); EDIT: after 10 seconds of search: $("#someDiv").bind("DOMSubtreeModified", function() { alert("tree changed"); });
has comment: http://stackoverflow.com/comment/42291566
has comment: http://stackoverflow.com/comment/42289819
has comment: http://stackoverflow.com/comment/42289697
score: 0
answers question: http://stackoverflow.com/q/26865072
has comment: http://stackoverflow.com/comment/42289644

http://stackoverflow.com/q/26922871
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26923171
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/42393274
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42393683
type: Question
has title: Disable changing of border-color with given class
has comment: http://stackoverflow.com/comment/42393489
score: 1
has body: If add "Orange" before "Orange" that is readonly. The input that will have red borderline is the input that is read-only w/c is wrong. I dont want the read-only input(supposedly from database to be mark as duplicate or to have red borderline) Current output: Apple [read-only] Orange // *added by user* Orange[read-only] //borderline changed to red when button save is clicked Wanted output: Apple [read-only] Orange // *added by user* and borderline changed to red when button save is clicked Orange[read-only] See this FIDDLE for demo and try to click add row button before the row with "Orange" value input field with another "Orange" value of input. $("#save").off("click").on("click",function(){ var existing = []; var duplicates = $('#myTable td:nth-child(3) input').filter(function() { var value = $(this).val(); if (existing.indexOf(value) &gt;= 0) { return $(this); } existing.push(value); }); duplicates.closest('tr').css('background-color', 'red'); }); I tried this : duplicates.closest('#myTable td:nth-child(3) input:not(readOnlyText)').css('background-color', 'red'); but nothing change.
upvote count: 1
answer count: 1

http://stackoverflow.com/q/26991305
score: 3
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
linked to: http://stackoverflow.com/q/2170923
favorite count: 0
duplicate of: http://stackoverflow.com/q/2170923
type: Question
linked to: http://stackoverflow.com/q/16933989
has comment: http://stackoverflow.com/comment/42513979
has answer: http://stackoverflow.com/a/26991463
upvote count: 3
has title: Auto refresh div content, loaded by jquery include ajax call
has answer: http://stackoverflow.com/a/26991460
answer count: 4
has answer: http://stackoverflow.com/a/26991453
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
tagged with: ajax
has answer: http://stackoverflow.com/a/26996519
has body: I am loading output from now_playing.php (shoutcast now playing content) using a jQuery include ajax call, as sugested here, and it works well. My code: &lt;script&gt; $(function(){ $("#now_playing").load("now_playing.php"); }); &lt;/script&gt; &lt;div id="now_playing"&gt;&lt;/div&gt; I just need that div output content updated every 5 seconds or so. Which code can i add to script or div part for that? Thank you!

http://stackoverflow.com/q/26881428
answer count: 1
tagged with: animation
accepted answer: http://stackoverflow.com/a/26881552
type: AnsweredQuestion
has title: Making concurrent canvas animations in JavaScript?
has answer: http://stackoverflow.com/a/26881552
type: Question
has body: I'm learning JavaScript canvas recently, and I came up two ways of making animations. I searched google for a while but cannot determine which way is correct. Say I have want to render different objects doing different things on the canvas with 30 fps. There're 2 ways to achieve this. For both 2 ways, there should be a main setInterval function that draw all objects in 30fps. Every object has a nextframe(user_response) method, which changes the 'status' of this object according to user response, and is called by a main setInterval 30 times ps. The main setInterval need to pass user responses into each nextframe(...) in some way, and it calls draw for each object. --The problem with this approach is that all nextframe for all objects are called per frame, taking system resources. Objects implement their own animation methods withsetInterval. These methos get called according to user response, changing the object 'status' 30 times per second. And the main setInterval function only calls draw for each object in 30fps, behaving like 'taking pictures' of each object's status. The object statuses change independently in other threads. So there's always one main thread of 30fps running, and if there're m objects animated and n object not animated at the moment, there're (m+1) threads in total --The problem with this that when many objects are animated I have many threads running, which also takes system resources. So, which one is a more appropriate method? or are they both wrong? :> thank you in advance!
tagged with: canvas
tagged with: javascript
score: 0

http://stackoverflow.com/comment/42308227
score: 0
has text: @steve_gallagher that's the answer, post it
comment on: http://stackoverflow.com/q/26874905
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26968976
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/26969128
has title: HighChart generating table without chart
tagged with: highcharts
answer count: 1
downvote count: 0
tagged with: javascript
has body: Here is code jsfiddle.net/highcharts/z9zXM/ which generate both chart and table, but I need only highchart table. How I can implement it? Thanks
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/26969128

http://stackoverflow.com/a/26916486
type: Answer
has body: is it better performance-wise Not keeping timers around when they are not needed is definitely better. Regardless whether they're implented with setTimeout or setInterval. and clean code-wise That depends on how (often) "the player decides to change location", and how this is signaled to your code. It might make an actual difference in behaviour, and you should aim to keep your code correct - independent from the sequence and timing of inputs. Keep it simple, and choose what you need.
score: 2
has comment: http://stackoverflow.com/comment/42381584
accepted answer of: http://stackoverflow.com/q/26916368
answers question: http://stackoverflow.com/q/26916368
upvote count: 2
has comment: http://stackoverflow.com/comment/42381619
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/42511477
type: Comment
has text: You mean something like `Q(100).then(function(v){ console.log(v); return Q(200); }).then(function(x){ console.log(x); return Q(300); })`
comment on: http://stackoverflow.com/a/26976735
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42271141
comment on: http://stackoverflow.com/a/26854289
has text: Kinda working, but I get another weird duplicate of my scroll bar inside the webpage. Like it was an iframe or something.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/26836946
possible better answer: http://stackoverflow.com/a/26837519
type: Question
tagged with: javascript
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/26837073
has comment: http://stackoverflow.com/comment/42239552
has answer: http://stackoverflow.com/a/26837519
tagged with: http://stackoverflow.com/tag/xml
has title: Get data from XML file with javascript
has answer: http://stackoverflow.com/a/26837073
has body: I'm learning how to do this with the help of some tutorials but this code is not working. The browser is not displaying anything from the XML file. Is there anything wrong with my code? Here are the codes: <?xml version="1.0"?> Tanmay Patil 1234567890 Taniya Mishra 1234667898 FirstName: LastName: ContactNo: Email:
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42241476
has answer: http://stackoverflow.com/a/26837633

phonegap-plugins
tags question: http://stackoverflow.com/q/26971021
tags question: http://stackoverflow.com/q/26960901
tags question: http://stackoverflow.com/q/26951793
type: Tag
tag name: phonegap-plugins

http://stackoverflow.com/q/26990986
upvote count: 18
has answer: http://stackoverflow.com/a/28690320
type: Question
has body: I have this event: $(window).scroll(function(e){ console.log(e); }) I want to know, how much I have scroll value in pixels, because I think, scroll value depends from window size and screen resolution. Function parameter e does not contains this information. I can store $(window).scrollTop() after every scroll and calculate difference, but can I do it differently?
has answer: http://stackoverflow.com/a/30869566
has comment: http://stackoverflow.com/comment/42513664
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28795755
has comment: http://stackoverflow.com/comment/45869222
has comment: http://stackoverflow.com/comment/42513403
answer count: 4
favorite count: 0
possible better answer: http://stackoverflow.com/a/26992079
accepted answer: http://stackoverflow.com/a/28795755
has answer: http://stackoverflow.com/a/26992079
has comment: http://stackoverflow.com/comment/45843192
has comment: http://stackoverflow.com/comment/45673242
has comment: http://stackoverflow.com/comment/45859188
linked to: http://stackoverflow.com/q/26928352
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42514310
has comment: http://stackoverflow.com/comment/42513640
has title: jQuery scroll event: how to determine amount scrolled (scroll delta) in pixels?
score: 17

http://stackoverflow.com/comment/42427912
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26942146
has text: [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers.setInterval) takes 2 parameters.

http://stackoverflow.com/comment/42308095
has text: I do not know why my php code is not interpreted. I have exactly the same code written in the console... Normaly I am supposed to have the RESTULT of this code, no @M.Eskandari?
score: 0
comment on: http://stackoverflow.com/a/26874783
type: AnswerComment
type: Comment

http://stackoverflow.com/q/26919639
upvote count: 2
has comment: http://stackoverflow.com/comment/42388159
has comment: http://stackoverflow.com/comment/42389322
downvote count: 1
has comment: http://stackoverflow.com/comment/42387835
favorite count: 0
has title: Javascript tic tac toe, trying to declare a winner
has comment: http://stackoverflow.com/comment/42388018
answer count: 0
type: UnansweredQuestion
score: 1
has body: &lt;script type="text/javascript"&gt; var winArray = new Array; var turn = 0; var data1 = document.getElementById('data1'); var data2 = document.getElementById('data2'); var data3 = document.getElementById('data3'); var data4 = document.getElementById('data4'); var data5 = document.getElementById('data5'); var data6 = document.getElementById('data6'); var data7 = document.getElementById('data7'); var data8 = document.getElementById('data8'); var data9 = document.getElementById('data9'); var tiger = document.getElementById('tiger'); var dragon = document.getElementById('dragon'); function allowDrop(ev) { ev.preventDefault();} function drag(ev) { ev.dataTransfer.setData("Text",ev.target.id);} function drop(ev) { ev.preventDefault(); var data=ev.dataTransfer.getData("Text"); ev.target.appendChild(document.getElementById(data).cloneNode(true)); document.getElementById(data).setAttribute("draggable", "false"); if (data == "dragon"){ document.getElementById("dragon").setAttribute("style", "background: yellow;");} else{ document.getElementById("tiger").setAttribute("style", "background: blue;");} ev.target.removeAttribute('ondrop'); document.getElementById(data).removeAttribute('id'); turn++; whosTurn(); checkWinner();} function whosTurn(){ if(turn % 2 == 0){ document.getElementById("tiger").setAttribute("draggable", "false"); document.getElementById("dragon").setAttribute("draggable", "true");} else{ document.getElementById("tiger").setAttribute("draggable", "true"); document.getElementById("dragon").setAttribute("draggable", "false"); }} function checkWinner(){ if ((data1 == data2 &amp;&amp; data1 == data3 &amp;&amp; data1 == tiger) || (data4 == data5 &amp;&amp; data4 == data6 &amp;&amp; data4 == tiger) || (data7 == data8 &amp;&amp; data7 == data9 &amp;&amp; data7 == tiger) || (data1 == data4 &amp;&amp; data1 == data7 &amp;&amp; data1 == tiger) || (data2 == data5 &amp;&amp; data2 == data8 &amp;&amp; data2 == tiger) || (data3 == data6 &amp;&amp; data3 == data9 &amp;&amp; …
type: Question
has comment: http://stackoverflow.com/comment/42387954
tagged with: javascript

http://stackoverflow.com/q/26874586
has answer: http://stackoverflow.com/a/26875028
linked to: http://stackoverflow.com/q/3876299
possible better answer: http://stackoverflow.com/a/42647496
has answer: http://stackoverflow.com/a/42647496
has comment: http://stackoverflow.com/comment/128359600
score: 9
type: Question
has answer: http://stackoverflow.com/a/42677253
accepted answer: http://stackoverflow.com/a/42677253
tagged with: javascript
has title: Photoeffects site based on php
downvote count: 3
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: web
favorite count: 0
upvote count: 12
has body: I want to know how websites like http://photofunia.com/ and other online photo effects sites are built. For example, using php, i want merge two images frame.png with profile.jpg. I want my frame.png transparent in the center where I would place my profile.jpg. I have tried this, but it doesn't work: &lt;?php $dest = imagecreatefromjpeg('dest.jpg'); $src = imagecreatefrompng('logo.png'); $src = imagerotate($src, 90, imageColorAllocateAlpha($src, 0, 0, 0, 127)); $almostblack = imagecolorallocate($src,254,254,254); $src = imagecolortransparent($src,$almostblack); imagealphablending($dest, true); imagesavealpha($dest, 0); imagecopymerge($dest, $src, 900,600, 1, 1, 90,90, 90); Thanks in advance. Please help me.
tagged with: php
linked to: http://stackoverflow.com/q/5282072
type: AnsweredQuestion

http://stackoverflow.com/comment/68637671
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26911751
type: Comment
has text: Then please award the answer. Doing so will help others in future

http://stackoverflow.com/q/26890285
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Get the parent form element from the first input with a specific class
has comment: http://stackoverflow.com/comment/42335116
has answer: http://stackoverflow.com/a/26890331
upvote count: 2
has body: I'm trying to talk to the parent form element of the first input element with a specific class. On any given page, I could have at least 2 forms. A login form in my header, and in this case a form in the body of my page. I am able to find the first element with a class name like this: $('.my-select:first'); I thought, getting the parent form would be easy: $('.my-select:first').closest('form'); But, it doesn't apear to be the case. When I try this to make sure I'm talking to the correct form: $('.my-select:first').closest('form').attr('id'); I am getting back undefined. 'closest()' travels up the DOM, so I thought I would be safe. I don't think I'm finding the right selector(s) though. Here is what my markup looks like: HTML &lt;form id="myform"&gt; &lt;fieldset&gt; &lt;div&gt; &lt;div&gt; &lt;label&gt; &lt;select class="my-select"&gt; .... I will ultimately have more than one select element with the class name of "my-select". I am going to have a button that will dynamically add another select input. That's why I need to find the closest form element. Thank you for your time!
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42335223
has comment: http://stackoverflow.com/comment/42334560
has comment: http://stackoverflow.com/comment/42334615
tagged with: forms
accepted answer: http://stackoverflow.com/a/26890331
score: 2

http://stackoverflow.com/q/26956595
has answer: http://stackoverflow.com/a/26956821
has title: Javascript from onmouseover to onclick
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/42452876
tagged with: javascript
has comment: http://stackoverflow.com/comment/42453551
score: 0
has body: I'm using this piece of code for my website to implement a dropdown menu: and Dropdown One Navigation Item 1 Navigation Item 2 Navigation Item 1 Navigation Item 2 Navigation Item 3 Navigation Item 4 Navigation Item 5 Navigation Item 3 Navigation Item 1 Navigation Item 2 Navigation Item 3 Navigation Item 1 Navigation Item 2 Navigation Item 3 Navigation Item 4 Navigation Item 5 Navigation Item 6 Navigation Item 4 Navigation Item 4 Navigation Item 5 I tried to convert h.onmouseover and h.onmouseout in h.onclick because i want the menu to expand when the user clicks on it. How can i do that? I'm newbie in Javascript.
answer count: 1

http://stackoverflow.com/q/26909098
tagged with: spacebars
type: Question
tagged with: javascript
score: 0
has body: I am creating an application where there are two user types. This is determined upon user creation. This field is located in Meteor.users.userType: publisher or it can be userType: reader. Apart from both userTypes sharing the same home page (which will also be public), everything else between the 'publisher' and 'reader' will be totally different. E.g template layout, navigation, data passed in. Should I use spacebars {{#if}} block and only show relevant paths available for the userType as I've done similarly in the signup/login paths in my example below using iron:router? This way, I would be using many if statements to declare templates and functionality depending on userType many times over. So far, as the userTypes have different user profile data structures, I am simply calling the desired fields that each userType needs to see. On the face of it, this is seems fine as I've created separate templates and paths for both userType. But there must be a better convection that includes declaring the userType when the application starts up. Eg. Is it possible to determine the userType with iron router as soon as the user logs in? So if userType is 'reader', the code could branch to a particular routing configuration, and if userType is 'publisher', the code could branch to a another routing configuration? I would like to exhaust a few ideas before committing to the application structure. All Posts // public home page ProfilePage Publisher //for userType: publisher Create Posts //for userType: publisher ProfilePage Reader //for userType: reader Reading List //for userType: reader {{#if currentUser}} Logout {{else}} Sign In Join {{/if}} {{> yield}} Thank you in advance for considering to help.
answer count: 1
tagged with: meteor
tagged with: iron-router
has title: Meteor: Convention to configure routes specific to user-type
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26911250

http://stackoverflow.com/comment/42303205
score: 2
comment on: http://stackoverflow.com/q/26872432
has text: Also, every time you do `func()` you are creating a new function with a completely separate `x`. Presumably you intended to use an IIFE?
type: Comment
type: QuestionComment

each
tags question: http://stackoverflow.com/q/26922689
type: Tag
tag name: each

http://stackoverflow.com/q/26912642
tagged with: http://stackoverflow.com/tag/html
has title: Applying CSS to single characters dynamically?
has answer: http://stackoverflow.com/a/26912830
favorite count: 0
upvote count: 8
tagged with: css
accepted answer: http://stackoverflow.com/a/26912987
answer count: 3
has body: I am using JavaScript/jQuery to populate a date field on my page. I want to add CSS styling to each individual character of the generated date and wondering if it is possible and how I could go about doing it. Basically, I want the end result to look like this: Here is my code which is generating the date: HTML: &lt;div class="date"&gt;&lt;/div&gt; JavaScript: var monthNames = [ "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" ]; var dNow = new Date(); var date = (monthNames[dNow.getMonth()]) + ' ' + ('0' + dNow.getDate()).slice(-2) + ' ' + dNow.getFullYear(); $('.date').text(date); Here's a JSFiddle.
score: 8
downvote count: 0
has answer: http://stackoverflow.com/a/26912977
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26912987
type: Question
has comment: http://stackoverflow.com/comment/42374874
possible better answer: http://stackoverflow.com/a/26912830
type: AnsweredQuestion

http://stackoverflow.com/comment/42452848
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26956723
has text: @nnnn http://www.convertunits.com/dates/from/Jan+1,+1900/to/Nov+16,+20 i check in more than 5 websites it is just 41957 day, i think urs also 1 day more.

http://stackoverflow.com/comment/42485020
comment on: http://stackoverflow.com/q/26974884
score: 0
type: QuestionComment
has text: tried that already but it doesn't work :(
type: Comment

http://stackoverflow.com/a/26869105
score: 0
has body: Of course there is proportionality between the number of requests and the memory usage: every request needs some objects (ex.: req, res, ...) to be handled and every object takes memory. In my nodejs applications I noted that with the increasing of requests the memory increases as well but sometimes it falls down under the action of the Google V8 Engine Garbage Collector which is very efficient. Anyway, the memory leaks are behind the corner but for sure it's not possible to speak about memory leak for memory usage around 50 MB as the one you are speaking about.
type: Answer
answers question: http://stackoverflow.com/q/26866143

http://stackoverflow.com/comment/42442309
type: QuestionComment
has text: I am using contact form 7 here is my [page](http://www.annadecarlophotography.com/baby-plan-sign-up/) to see what I am talking about
score: 0
comment on: http://stackoverflow.com/q/26950489
type: Comment

http://stackoverflow.com/q/26941291
downvote count: 0
has answer: http://stackoverflow.com/a/26941365
favorite count: 0
accepted answer: http://stackoverflow.com/a/26941365
linked to: http://stackoverflow.com/q/779379
has body: This question is regarding setTimeout method in JavaScript. Is there some kind of benefit to calling another function inside a setTimeout after zero seconds? Like so, setTimeout(func, 0); The reason why i'm asking is because I have noticed similar lines of code in certain plugin/libraries(for example, checkout offloadFn function in swipejs). Is it to support some kind of browser incompatibility or is it just bad way to write code and I should totally ignore it? I would love to know if there is some kind of benefit. Thank you for your time in advance.
type: AnsweredQuestion
tagged with: settimeout
has title: seTtimeout with zero seconds
type: Question
duplicate of: http://stackoverflow.com/q/779379
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/42426493
upvote count: 4
answer count: 1

http://stackoverflow.com/comment/42335997
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26888174
has text: thanks but it ain't work with that , i tried it before and now
type: AnswerComment

http://stackoverflow.com/comment/42446474
has text: Yes. This is correct. d3 is powerful; I just haven't quite grasped it all yet. Thanks though.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26951310
type: Comment

http://stackoverflow.com/comment/42517180
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/26962210
has text: Similar question resolved in this post http://stackoverflow.com/a/16120827/504377

http://stackoverflow.com/comment/42426193
has text: @learner I just noticed that you are the OP _and_ you posted a link to IMO an exact duplicate of this question.
type: Comment
comment on: http://stackoverflow.com/q/26941009
type: QuestionComment
score: 1

http://stackoverflow.com/q/26867747
tagged with: unit-testing
has title: To what extent can we refactor unit tests
type: Question
tagged with: javascript
tagged with: nunit
tagged with: jasmine
has body: When working with Jasmine testing framework, I have come across a code snippet where expect is written in a sub-function which is called in it(), but not in it() itself. The reason behind writing this is, they were trying to compare similar objects and they refactored test code and moved this expect to the sub-function. Now, we don't have expect in it() rather we have a method call which has expect. describe("bla bla", function() { //for nunit, junit guys, this is testSuite() function somefunc() { //this is [test] //do some stuff and generate object expect(someObject).toEqual(otherObject); //expect is assert } it("some case", function() { //do some stuff somefunc(); }); it("some other case", function() { //do some other stuff somefunc(); }); }); Now, is this kind of test code encouragable? can we have it() without expect ?
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/42295103
has comment: http://stackoverflow.com/comment/42295771
has answer: http://stackoverflow.com/a/26868720
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/a/26904948
score: 0
has body: Get offsetWidth directly from the element: alert (document.getElementsByTagName("button")[0].offsetWidth); Edit: For other inherited attributes, jQuery's css(). Fiddle example. Or you can use window.getComputedStyle.
answers question: http://stackoverflow.com/q/26904879
has comment: http://stackoverflow.com/comment/42360913
type: Answer

http://stackoverflow.com/a/78344381
has body: My previous answer was deleted as it was too similar to what I had suggested elsewhere, however, I took a different approach to this problem - in that I used a custom input control coupled with a custom model binder. It's a solution that is working well for me, so I see value in suggesting it in this thread. More details can be found in my post here: How to handle decimal input values in a globalized MVC app
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/26890209
upvote count: 1
score: 1

http://stackoverflow.com/comment/42282773
comment on: http://stackoverflow.com/a/26845922
type: Comment
score: 0
type: AnswerComment
has text: It seems you have not read the entire question thoroughly before giving this answer. The question is about opening the dropdown explicitly with javascript code.

http://stackoverflow.com/q/26920364
tagged with: date
downvote count: 4
answer count: 1
has comment: http://stackoverflow.com/comment/42389258
has title: Regex not validating November in a YYYY-MM-DD string
favorite count: 0
accepted answer: http://stackoverflow.com/a/26960056
score: -3
has comment: http://stackoverflow.com/comment/42417087
tagged with: regex
has answer: http://stackoverflow.com/a/26960056
has comment: http://stackoverflow.com/comment/42413594
upvote count: 1
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42389074
has body: I'm using this regex: /^(((\d{4})(-)(0[13578]|10|12)(-)(0[1-9]|[12][0-9]|3[01]))|((\d{4})(-)(0[469]|1‌​1)(-)([0][1-9]|[12][0-9]|30))|((\d{4})(-)(02)(-)(0[1-9]|1[0-9]|2[0-8]))|(([02468]‌​[048]00)(-)(02)(-)(29))|(([13579][26]00)(-)(02)(-)(29))|(([0-9][0-9][0][48])(-)(0‌​2)(-)(29))|(([0-9][0-9][2468][048])(-)(02)(-)(29))|(([0-9][0-9][13579][26])(-)(02‌​)(-)(29)))$/ to validate dates, with their respective last day of the month, from an html input type date (format: YYYY-MM-DD), the point here is that it doesnt match for november (11th month). Why this is happening?
tagged with: javascript

http://stackoverflow.com/comment/42260097
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26848611
has text: You are right the id is not returned by the function but by the Ajax request idNewProposal=id; (when the request is done)
score: 0

http://stackoverflow.com/comment/42274089
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26848590
has text: Thank you! Is the Adapter `host` or `namespace` the correct place to put the URL for the ajax request? It looks like Ember will piece that together so I was mistaken in placing the whole url in the `host` property of the adapter.
score: 0

http://stackoverflow.com/comment/42397269
comment on: http://stackoverflow.com/a/26924958
score: 0
has text: @Philcyb i created i fiddle with a working example [fiddle](http://jsfiddle.net/wmwy04fr/4/). Just play around with the commented lines to see the difference
type: AnswerComment
type: Comment

http://stackoverflow.com/q/26963451
type: Question
possible better answer: http://stackoverflow.com/a/26963487
tagged with: javascript
tagged with: jquery
answer count: 2
has answer: http://stackoverflow.com/a/26963487
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/26963467
accepted answer: http://stackoverflow.com/a/26963467
has body: Hello I make a call of an json array with jquery and each time I press the button it should load the list again instead of multiplying. [{"denumire":"Q Club"},{"denumire":"Carul cu Flori"},{"denumire":"La Rocca"}] and my jquery script &lt;script&gt; $(".filtru").click(function(e){ e.preventDefault(); var href = $(this).attr(\'href\'); $.getJSON(href, function(data) { /* data will hold the php array as a javascript object */ $.each(data, function(key, val) { $("#restaurant").append(\'&lt;li id="\' + key + \'"&gt;\' + val.denumire + \'&lt;/li&gt;\'); }); }); }); &lt;/script&gt;
upvote count: 1
tagged with: php
type: AnsweredQuestion
has title: Jquery prevent append to multiply each time I press the button
score: 1
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/a/34904641
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/26981774
downvote count: 0
type: Answer
has body: The class of your form is "dropzone" and that is why the form becomes a dropzone. Only use the "dropzone" class on the actual element that you want to become a dropzone. For example try to change "dropzone-previews" into "dropzone". Or if you want to create the dropbox programmatically, use: Dropzone.autoDiscover = false; This will turn off the automatic conversion of elements with the class "dropzone".

http://stackoverflow.com/a/26878792
has body: demo - http://jsfiddle.net/victor_007/e2yjerm3/3/ 2 } } were missing at the end var $ = function(id) { return document.getElementById(id); }; var red = $("red"); var yellow = $("yellow"); var blue = $("blue"); var green = $("green"); var white = $("white"); var purple = $("purple"); var mixColours = function mixColours() { if (red.checked && green.checked) { $("colourResult").innerHTML = "You made Yellow!"; } else if (red.checked && white.checked) { $("colourResult").innerHTML = "You made Pink!"; } else if (red.checked && purple.checked) { $("colourResult").innerHTML = "You made Mauve!"; } if (yellow.checked && green.checked) { $("colourResult").innerHTML = "You made Yellow!"; } else if (yellow.checked && white.checked) { $("colourResult").innerHTML = "You made Light Yellow!"; } }; /* this */ window.onload = function() { $("mixColours").onclick = mixColours; }; /* this */ Select your first colour: Red Yellow Blue Select your second colour: Green White Purple
accepted answer of: http://stackoverflow.com/q/26878655
answers question: http://stackoverflow.com/q/26878655
type: Answer
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/26937105
has comment: http://stackoverflow.com/comment/42421089
has body: In the app.js file I have .config which has states for all the navigation urls. I want to pass a variable to container.html file which is the config file, The state for base url is as follows: // setup an abstract state for the tabs directive .state('tab', { url: "/tab", abstract: true, templateUrl: "templates/container.html" }) I want to pass a variable called division which will have value either "agriculture" or "construction" and based on that variable I want to do further operations. Can anybody help me I am pretty new to angularJS. Additional info: I am working on cordova, angularJS, taffy for a mobile app. Thanks in advance. I want the url to be something like /tab/:division or templates/container.html/division which i will later be able to use in the container.html file.
tagged with: cordova
tagged with: angularjs
type: UnansweredQuestion
has title: How to pass a variable to config file in AngularJS
type: Question
has answer: http://stackoverflow.com/a/26946936
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/42420799
has comment: http://stackoverflow.com/comment/42421635
answer count: 1
has comment: http://stackoverflow.com/comment/42422696

http://stackoverflow.com/comment/42415678
type: Comment
has text: @apsillers, and why I see a bash console "printed" in my browser, if it does not return anything? (`self.init` called outside `app.get(...)`. What I want is the same output calling `self.init` or calling `app.get('/', function() {self.init()});`
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26935390

http://stackoverflow.com/comment/42233442
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26833075
has text: Is there anyway to do this with php?

http://stackoverflow.com/comment/42382679
has text: @DonRhummy I did it and Iam cent percent sure that this is not problem and same for addChild I tried adding separately and combined but did not work.
comment on: http://stackoverflow.com/q/26916532
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26924624
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
upvote count: 2
has body: I want the radio buttons to be enabled only when the associated checkbox is checked. So I need help in writing a generic javascript code, which will work for all the checkboxes. I have about 100 checkboxes, so I don't want to write each ID or name manually in the javascript code. Can a code sample be presented on how to do this in a generic way. &lt;form name=registration&gt; &lt;table border=1&gt; &lt;tr&gt; &lt;td&gt;&lt;input type='checkbox' id='c1' name=selcourse value='2-PM-030' onChange="enabledSDF(1,this.value);"&gt; Microsoft Project 2013 &lt;/td&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;input type=radio id=cd name='2-PM-030' value='Dec 11-12'&gt;Dec 11-12&lt;/td&gt; &lt;td&gt;&lt;input type=radio id=c1d1 name='2-PM-030' value='Jan 26-27'&gt;Jan 26-27&lt;/td&gt;&lt;td&gt;&amp;nbsp;&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;input type='checkbox' id='c2' name=selcourse value='2-PM-050'&gt; Microsoft Project 2010 &lt;/td&gt; &lt;td&gt;&lt;input type=radio id=c2d1 name='2-PM-050' value='Nov 24-25'&gt;Nov 24-25&lt;/td&gt; &lt;td&gt;&lt;input type=radio id=c2d2 name='2-PM-050' value='Dec 18-19'&gt;Dec 18-19&lt;/td&gt; &lt;td&gt;&lt;input type=radio id=c2d3 name='2-PM-050' value='Jan 29-30'&gt;Jan 29-30&lt;/td&gt; &lt;td&gt;&amp;nbsp;&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; &lt;/form&gt; I found the following pieces of code, but I am not sure how to make it generic. &lt;script type="text/javascript"&gt; $(window).load(function(){ $(document).ready(function() function enabledSDF(i,value){ var form = document.registration; if(document.getElementById('course_type').value=='C') { if (value=="Singaporean"){ document.getElementById("sdf"+i+"0").disabled=''; document.getElementById("sdf"+i+"1").disabled=''; } else{ document.getElementById("sdf"+i+"0").disabled='disabled'; document.getElementById("sdf"+i+"1").disabled='disabled'; } } } $(d…
score: 1
has answer: http://stackoverflow.com/a/26924734
has title: generic javascript to handle radio button enable/disable
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26924882
answer count: 2

http://stackoverflow.com/q/26873176
downvote count: 0
tagged with: javascript
answer count: 1
tagged with: meteor
favorite count: 0
type: UnansweredQuestion
tagged with: node.js
score: 1
upvote count: 1
has body: I'm working through the book Your First Meteor Application and I'm stuck on Section 8.3: Advanced Operators, Part 2 Basically, the click.increment and click.decrement functions are supposed to do the following: On click, the name of the player (li element) the background transitions to yellow When clicking the "Give 5 Points" or "Take Away 5 Points" the user's points are incremented / decremented by 5. However, here's what's happening: when I click on a player (li element) it is highlighted yellow when I click on the increment or decrement buttons, the li element is de-selected, the background is no longer yellow, and there is no change in the number of points. Any help would be appreciated. This must be a very simple matter that I've overlooked but I can't figure it out. Here's the relevant code: leaderboard.html: Leaderboard The Leaderboard {{> leaderboard }} {{#each player}} {{name}}: {{score}} {{/each}} leaderboard.js: PlayersList = new Mongo.Collection('players'); console.log("Hello World from Meteor!"); if(Meteor.isClient){ Template.leaderboard.helpers({ 'player': function(){ return PlayersList.find(); }, 'selectedClass': function() { var playerId = this._id; var selectedPlayer = Session.get('selectedPlayer'); if (playerId == selectedPlayer) { return "selected"; } } }); Template.leaderboard.events({ 'click.player': function() { var playerId = this._id; Session.set('selectedPlayer', playerId); }, 'click.increment': function() { var selectedPlayer = Session.get('selectedPlayer'); PlayersList.update(selectedPlayer, {$inc: {score: 5} }); }, 'click.decrement': function() { var selectedPlayer = Session.get('selectedPlayer'); PlayersList.update(selectedPlayer, {$inc: {score: -5} }); } }); } leaderboard.css: .selected { background-color: yellow; }
has title: MeteorJS - click.increment function not working (Your First Meteor Application)
type: Question
has answer: http://stackoverflow.com/a/26874051

http://stackoverflow.com/a/26933166
has comment: http://stackoverflow.com/comment/42411190
type: Answer
accepted answer of: http://stackoverflow.com/q/26933092
has comment: http://stackoverflow.com/comment/42411413
score: 2
answers question: http://stackoverflow.com/q/26933092
upvote count: 2
has body: You code is executed before browser loads the CSV script. Wrap you JavaScript code with $( document ).ready(function() { // PUT YOUR JavaScript CODE HERE }); This will make browser to wait, until all your scripts are loaded, and only after to execute the code. You can check the documentation of the jquery csv here. It says that you should invoke methods like this: $.csv.toArrays(csv);
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/26979829
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26979533
has body: The error is happening on this line: var pos = box.getPos(); Based on your myNS.box definition, getPos is not returning a function but the pos object, e.g {x:0, y:0}. Change the return of getPos: getPos() to getPos: getPos. // public memebers return { getPos: getPos }; After that, you can call pos.x and pos.y. Update fiddle with working demo: http://jsfiddle.net/ybwyLdmj/1/
answers question: http://stackoverflow.com/q/26979533

http://stackoverflow.com/q/26862253
has body: I was wondering if there is a way to expand my angular controller on the fly according to the user's permissions. For example lets say that we have three different permission levels respectively (Admin,Supervisor,User) and an angular controller app.controller("myController", ["$scope", function($scope){ $scope.userFunc = function(){....}; $scope.supervisorFunc = function(){....}; $scope.adminFunc = function(){....}; }]); I would like to add the supervisorFunc and the adminFunc only if the user possest the right permission. User controller will contain only userFunc Supervisor will contain userFunc and supervisorFunc Admin will contain all the methods (userFunc,supervisorFun and adminFunc) Now I would like to add a separate js file that will inject the additional methods into the controller, so if you are a Supervisor your client will receive two js files, one is the main myController and an additional Supervisor Injector that will expand myController. One important thing is that I don't want to dynamically generate myController js file at server side because it's bad practices. any ideas ?
downvote count: 0
has comment: http://stackoverflow.com/comment/42288157
tagged with: javascript
has answer: http://stackoverflow.com/a/26862712
has title: Add method to angularJs controller according the user permissions
answer count: 1
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
upvote count: 1
score: 1
type: Question
has comment: http://stackoverflow.com/comment/42284724

typoscript
type: Tag
tag name: typoscript
tags question: http://stackoverflow.com/q/26862154

http://stackoverflow.com/comment/42435233
comment on: http://stackoverflow.com/a/26946293
score: 0
type: Comment
has text: Yes, it is still disable even when the checkbox has been checked.
type: AnswerComment

http://stackoverflow.com/comment/42544347
type: AnswerComment
comment on: http://stackoverflow.com/a/26988909
score: 0
type: Comment
has text: Changing the URL format to include the API key and the Cal-I was sufficient for me. I didn't have to modify gcal.js at all. It works now. Thanks!

http://stackoverflow.com/a/26869304
type: Answer
has body: foo is an object, which is passed by reference. bar is passed by value. When bar is overwritten, it loses the relation to foo.bar. Hence, foo.bar is "a"`, which is what it was set to in the function. var foo = { bar: {} }; (function(foo, bar) { // foo is {bar:{}} // bar is {} foo.bar = 'a'; // now foo is {bar:'a'} bar = 'b'; // now bar is 'b' // bar has no relation to foo.bar anymore }(foo, foo.bar)) console.log(foo.bar) // prints 'a', not 'b', how come?
has comment: http://stackoverflow.com/comment/42297763
has comment: http://stackoverflow.com/comment/42378773
score: 4
answers question: http://stackoverflow.com/q/26869243
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/42297711

http://stackoverflow.com/a/26905108
has body: The problem is that your array contains the text value of the table element, not a numeric value. You can convert like this: parseInt(checkedRows[0][1]) http://jsfiddle.net/st99zoxm/
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/26903420
accepted answer of: http://stackoverflow.com/q/26903420
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/26876092
has title: pause countdown javascript jquery
has comment: http://stackoverflow.com/comment/42309815
accepted answer: http://stackoverflow.com/a/26876162
type: Question
possible better answer: http://stackoverflow.com/a/26876263
has answer: http://stackoverflow.com/a/26876263
tagged with: javascript
tagged with: seconds
score: 0
answer count: 2
tagged with: timer
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26876162
has body: http://jsfiddle.net/vvccvvcc/mu45bptk/ how do I pause the timer? I want it to stop when it gets to 5 seconds I tried this as seen in the fiddle else { isWaiting = true; seconds--; if (seconds == 5) { seconds=seconds;} } does not work

http://stackoverflow.com/comment/42352804
type: Comment
comment on: http://stackoverflow.com/q/26900080
score: 0
type: QuestionComment
has text: There is no `int` keyword in JavaScript! Use `var` keyword.

http://stackoverflow.com/comment/42362657
has text: console.log($('#' + clicked_id).val());
score: 0
comment on: http://stackoverflow.com/q/26905973
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42389105
type: QuestionComment
comment on: http://stackoverflow.com/q/26919414
score: 0
has text: Also what IF your children have images (images load time in not accounted in calculating the children height on DOM.ready)...
type: Comment

http://stackoverflow.com/q/26884931
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
answer count: 3
has answer: http://stackoverflow.com/a/27051171
has title: Lose the focus of the textboxes in gridview
tagged with: asp.net
has body: I have a grid view in an updatepanel like this : <asp:UpdatePanel ID="UpdatePanel3" runat="server"> <asp:Panel ID="pnl_lect" runat="server"> <asp:GridView ID="gv_ques" runat="server" CssClass="formTable cr_center" AutoGenerateColumns="False" ShowFooter="True" OnRowDataBound="gv_ques_RowDataBound"> <asp:TemplateField HeaderText="عناصر التقييم"> <asp:Label ID="lbl_ques" runat="server" Text='<%# Bind("que_desc") %>'></asp:Label> <asp:Label ID="Label1" runat="server" Text="الاجمالي"></asp:Label> <ItemStyle Width="45%" /> </asp:TemplateField> <asp:TemplateField HeaderText="ممتاز (4)"> <telerik:RadNumericTextBox ID="txt_1" runat="server" DbValue='<%# Bind("grade_id1") %>' AutoPostBack="true" Width="60px" MinValue="0" MaxValue="999999999" OnTextChanged="txt_1_TextChanged"> <NumberFormat GroupSeparator="" DecimalDigits="0" /> </telerik:RadNumericTextBox> <asp:HiddenField ID="hf_1" runat="server" Value="1" /> <asp:Label ID="lbl_1" runat="server"></asp:Label> </asp:TemplateField> <asp:TemplateField HeaderText="جيد جدًا (3)"> <telerik:RadNumericTextBox ID="txt_2" runat="server" DbValue='<%# Bind("grade_id2") %>' AutoPostBack="true" Width="60px" MinValue="0" MaxValue="999999999" OnTextChanged="txt_1_TextChanged"> <NumberFormat GroupSeparator="" DecimalDigits="0" /> </telerik:RadNumericTextBox> <asp:HiddenField ID="hf_2" runat="server" Value="2" /> <asp:Label ID="lbl_2" runat="server"></asp:Label> </asp:TemplateField> <asp:TemplateField HeaderText="جيد (2)"> <telerik:RadNumericTextBox ID="txt_3" runat="server" DbValue='<%# Bind("grade_id3") %>' AutoPostBack="true" Width="60px" MinValue="0" MaxValue="999999999" OnTextChanged="txt_1_TextChanged"> <NumberFormat GroupSeparator="" DecimalDigits="0" /> </telerik:RadNumericTextBox> <asp:HiddenField ID="hf_3" runat="server" Value="3" /> <asp:Label ID="lbl_3" runat="server"></asp:Label> </asp:TemplateField> <asp:TemplateField HeaderText="مقبول (1)"> <telerik:RadNumericTextBox ID="txt_4" runat="server" DbValue='<%# Bind("grade_id4") %>' A…
has answer: http://stackoverflow.com/a/27050817
upvote count: 2
type: UnansweredQuestion
score: 2
type: Question
tagged with: c#
has answer: http://stackoverflow.com/a/27051135

http://stackoverflow.com/comment/42409463
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26932222
has text: Looks like you have an XXS vulnerability. escape user input.
score: 1

http://stackoverflow.com/q/26846306
has answer: http://stackoverflow.com/a/26847339
answer count: 1
tagged with: javascript
score: 0
has body: I found this example from Ryan Niemeyer and started to manipulate it into the way I write my own code, but then it stopped working. Can anybody tell me why? Alternative 1 is my variant Alternative 2 is based upon Ryans solution and does work (just comment/uncomment the Applybindings). Why doesn´t Alternative 1 work? My issue is with the filteredRows: self.filteredRows = ko.dependentObservable(function() { //build a quick index from the flags array to avoid looping for each item var statusIndex = {}; ko.utils.arrayForEach(this.flags(), function(flag) { statusIndex[flag] = true; }); //return a filtered list var result = ko.utils.arrayFilter(this.Textbatches(), function(text) { //check for a matching genré return ko.utils.arrayFirst(text.genre(), function(genre) { return statusIndex[genre]; }); return false; }); console.log("result", result); return result; }); I want to filter my Textbatches on the genre-attribute (string in db and the data collected from the db is a string and not an array/object) Fiddle here: http://jsfiddle.net/gsey786h/6/
has title: How to make checkboxes work with knockout
accepted answer: http://stackoverflow.com/a/26847339
tagged with: checkbox
type: AnsweredQuestion
tagged with: knockout.js
type: Question

http://stackoverflow.com/comment/42315795
type: Comment
has text: To be constructively honest, this is some really sloppy code. This is the kind of code you're looking for when you google `bad code`.. Inline css styles, &nbsp instead of margin/padding, poorly written javascript etc. Your problem isn't how to add numbers, it's how to f&*$# code. Have some respect for what you do for a living.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/26879364

http://stackoverflow.com/comment/42576814
has text: I just figured that out too. Works great! Thanks!
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26999072

http://stackoverflow.com/q/26970369
downvote count: 0
has answer: http://stackoverflow.com/a/26970552
accepted answer: http://stackoverflow.com/a/26970552
tagged with: methods
type: Question
upvote count: 2
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has title: Shorter string causes the webpage to freeze
has body: When the HTML Chart button is pressed it activates the createChart() method. However, if the value in the textarea is 25 characters or less, the webpages freezes. Also, only the letter "a" is being referenced with the method. &lt;script type = "text/javascript"&gt; orangeBar = "./orange.gif"; function createChart() { alphabet = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]; textValue = document.getElementById("text").value; max = 0; for (i=0;i&lt;alphabet.length;i++) { value = numberOf(alphabet[i], textValue); if (value &gt; max) { max = value; } } document.write(max); } function numberOf(letter, string) { count = 0; for (i=0; i&lt;string.length; i++) { if (string[i].toLowerCase() == letter) { count++; } } return count; } &lt;/script&gt; Thank you. I'm brand new to coding. I can answer any questions.
score: 2
type: AnsweredQuestion

http://stackoverflow.com/q/26854433
score: 2
has title: QML wrong integration in javascript hashmaps?
type: Question
tagged with: qml
has body: I've found an issue tonight and I wonder if this is a mistake between the keyboard and the screen or a QML/javascript integration problem. Here is my example: var myHash = {} for (var i=0; i&lt;3; ++i) { var newObject = Qt.createQmlObject('import QtQuick 2.3; Rectangle {color: "red"; width: 20; height: 40}', main, "test") console.log(newObject.color) myHash[newObject] = i } for (var key in myHash) { console.log("Object type:" + key) console.log("Color: " + key.color) } The output is: qml: Initial color: #ff0000 qml: Initial color: #ff0000 qml: Initial color: #ff0000 qml: Object type:QQuickRectangle(0x98e9ac8) qml: Color: undefined qml: Object type:QQuickRectangle(0x98da7a0) qml: Color: undefined qml: Object type:QQuickRectangle(0x970b328) qml: Color: undefined Thus, when I've stored my QML object in the hash-map myHash as a key, QML has kept the object type, but forgot the properties?
tagged with: javascript
downvote count: 0
answer count: 1
favorite count: 0
upvote count: 2
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/368280
has answer: http://stackoverflow.com/a/26854514

http://stackoverflow.com/q/26887664
downvote count: 0
has comment: http://stackoverflow.com/comment/42334791
tagged with: javascript
favorite count: 0
answer count: 0
type: UnansweredQuestion
tagged with: raycasting
tagged with: three.js
has body: I'm trying to use a Raycaster to intercept particles in a PointCloud object. The point cloud is being created as such: ... other initializations, like the scene object... var geometry = new THREE.Geometry(); var sprite = THREE.ImageUtils.loadTexture("myAwesomeIcon"); for (i = 0; i &lt; 100000; i++) { var vertex = new THREE.Vector3(); vertex.x = 15000 * Math.random() - 1000; vertex.y = 15000 * Math.random() - 1000; vertex.z = 15000 * Math.random() - 1000; geometry.vertices.push(vertex); } var material = new THREE.PointCloudMaterial({ size : 30, sizeAttenuation : true, map : sprite, transparent : true }); var particles = new THREE.PointCloud(geometry, material); particles.sortParticles = true; scene.add(particles); The raycaster, in its turn, is created as such: var raycaster = new THREE.Raycaster(); raycaster.params.PointCloud.threshold = 15; However, given that I want the sizes of the particles to change based on the camera's proximity (sizeAttenuation : true), I need the threshold param to "adapt" to each particle. Right now, it may detect the particle too soon (when it's closer to the camera), or too late (when it's further from the camera. By too soon/late I mean in respect to the mouse position over the particle. I found this solution online, but it assumes that I know the sizes of each particle, which I don't. I only know the initial (non-attenuated) size. Thank you very much.
tagged with: particle-system
score: 3
has title: Three js Raycasting intercepting particles with attenuated sizes
upvote count: 3
has comment: http://stackoverflow.com/comment/42336746
type: Question

http://stackoverflow.com/q/26941476
linked to: http://stackoverflow.com/q/49747213
has title: Failed to load resource: net::ERR_CONNECTION_REFUSED for only selective images from instagram API
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42426919
has comment: http://stackoverflow.com/comment/42426856
score: 6
favorite count: 0
has answer: http://stackoverflow.com/a/49786812
tagged with: instagram-api
has comment: http://stackoverflow.com/comment/42427113
upvote count: 6
has body: I am currently making a GET request to the instagram API to get a bunch of photos with a particular tag, and returning the JSON object I get in Rails back to the caller in JS, and setting the HTML with the img links and thumbnails etc. in the DOM. What is weird is that, after restarting my server, I get this error: Failed to load resource: net::ERR_CONNECTION_REFUSED for only some but not all of the photos which are returned by the instagram API. var formdata = {tag: "myflsadventure"}; $.ajax({ url: "application/get_instagram_photos", type: "POST", datatype: 'json', data: formdata, success: function(response){ htmlz = " "; count = 0; rounded_style = " style='border:1px solid #; -webkit-border-radius: 20px; -moz-border-radius: 20px; border-radius: 20px;'" $.each(response.data, function(i, item) { if (count == 0 ){ htmlz += " "; count = count + 1; } else if (count == 9){ htmlz += " "; count = count + 1; } else if (count == 13){ htmlz += " "; count = count + 1; } else if (count ==5){ htmlz += " "; count = count + 1; } else if ((count == 4) || (count == 12)){ htmlz += " "; count = count + 1; } else if ((count == 6) || (count == 7) || (count == 8) ){ htmlz += " "; count = count + 1; } else if ((count == 3) || (count == 11)){ htmlz += " "; count = count + 1; } else if ( count == 1){ htmlz += " "; count = count + 1; } else{ htmlz += " "; count = count + 1; } }); $("#myflsadventure").append(htmlz); reapportion_les_fotos(); } }); Here is my Routes and finally my controller which makes the API call post '/application/get_instagram_photos', to: 'school_applications#get_instagram_photos' Controller method def get_instagram_photos respond_to do |format| uri = URI("https://api.instagram.com/v1/tags/#{params[:tag]}/media/recent?client_id=myIDc&count=14") response = Net::HTTP.get(uri) format.json {render :json => response} end end UPDATE: This is only happening on my development machine. After pushing to Heroku and viewing from other computers, the photos load fine except for still…
type: UnansweredQuestion
type: Question

http://stackoverflow.com/comment/42343244
type: Comment
score: 0
type: AnswerComment
has text: ok so just to clarify, since funct is defined as a function that returns a function, this now makes funct a callable function?
comment on: http://stackoverflow.com/a/26894796

http://stackoverflow.com/comment/42301317
comment on: http://stackoverflow.com/a/26870448
type: Comment
has text: Some relevant code and examples would definitely help to improve your answer.
type: AnswerComment
score: 4

http://stackoverflow.com/comment/42303473
type: Comment
comment on: http://stackoverflow.com/q/26872609
score: 1
has text: The hash should be at the back, so the proper url would be `myApp/?fid=Milk+Cheese+Butter#page3`
type: QuestionComment

http://stackoverflow.com/q/26915116
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/63328999
answer count: 4
possible better answer: http://stackoverflow.com/a/45807695
tagged with: node.js
has answer: http://stackoverflow.com/a/26915475
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/45807695
has body: I use the following mongoose query in a MEAN-environment to find and output a particular author and his corresponding books. Author .findOne({personcode: code}) .select('-_id') .select('-__v') .populate('bookids') //referencing to book documents in another collection (-&gt;array of bookids) .select('-_id') //this doens't affect the data coming from the bookids-documents .select('-__v') //this doens't affect the data coming from the bookids-documents .exec(function (err, data) { //foo }); I would also like to exclude the "_id" and "__v" fields from the populated data coming from the external documents. How can that be achieved?
score: 33
type: Question
tagged with: mongodb
has title: Mongoose/Mongodb: Exclude fields from populated query data
upvote count: 33
tagged with: mongoose
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26915475
has answer: http://stackoverflow.com/a/57632143

http://stackoverflow.com/comment/42296005
comment on: http://stackoverflow.com/q/26868366
has text: Hah! I think that's the only think that I _hadn't_ tried, but it works! I'll accept this if you write it as an answer.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42320706
comment on: http://stackoverflow.com/q/26881551
type: QuestionComment
has text: @ No it is not accessible from internet
type: Comment
score: 0

http://stackoverflow.com/comment/42383344
has text: Since you do not have common prefix in selectors anymore, you need to put a common class on the date fields and modify so that you are selecting them... `var prefix = 'myClass'; var $inputs = $(prefix);`
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26898244

http://stackoverflow.com/comment/42467719
type: Comment
has text: If you're using `$(document).ready(function() {...}` they should be in the DOM.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/26965069

http://stackoverflow.com/comment/42436924
comment on: http://stackoverflow.com/a/26947125
score: 0
type: AnswerComment
type: Comment
has text: Thanks for the reply. Yes, I'm planning on using fileReader. I'll have a form with some input fields, including a file input. Then I want to send the form data including the image with POST. Is readAsDataURL still the way to go?

http://stackoverflow.com/comment/42501356
score: 0
type: Comment
type: QuestionComment
has text: Are you sure execution is reaching the line that calls `$.get` in the first place?
comment on: http://stackoverflow.com/q/26983661

http://stackoverflow.com/a/26917953
has comment: http://stackoverflow.com/comment/42390487
answers question: http://stackoverflow.com/q/26913202
score: 3
upvote count: 3
has body: Something like this should do the trick: ".read": "auth.uid == $userid || root.child('users/'+auth.uid+'/children/'+$userid).exists()" So this grants access to a node when: it is the currently logged on user's own node the currently logged on user has a child node with the node's id I would recommend cleaning up your data structure a bit to remove the duplicate data in the children: { "firebase-account-123": { "users": { "simplelogin:1": { "properties"{ "name": "john doe", "email": "user@email.com" } "children": { "simplelogin:2": true } }, "simplelogin:2": { "properties"{ "name": "user 2", "email": "user2@email.com", "disabled": false } } } }
type: Answer
has comment: http://stackoverflow.com/comment/42390574
downvote count: 0

http://stackoverflow.com/comment/42483215
score: 0
type: QuestionComment
type: Comment
has text: Thank you very much, the code is working now, but the images are still not inline :(
comment on: http://stackoverflow.com/q/26973957

http://stackoverflow.com/comment/42299246
score: 0
type: AnswerComment
has text: @Suffii: that is because `closest('.form-group')` is sibling div of div having required input element in it.
type: Comment
comment on: http://stackoverflow.com/a/26870218

http://stackoverflow.com/q/26931740
score: 2
has title: Hammer.js events on dynamically added HTML
accepted answer: http://stackoverflow.com/a/26952561
has body: I have this HTML structure: @JohnDoe Image caption #LA_city_trip 56 minutes ago 5477 The div '#snaps' is a static div, which holds all the '.snap_item' elements which are added with the JQuery .html() function. So the '.snap_item' elements are dynamically added to the div '#snaps', like so: When the user double taps on '.snap_img', some stuff has to happen. The element '.snap_img' is inside the '.snap_item' element. What I have so far is: $('#snaps').find('.snap_item').hammer().on({ doubletap : function(event){ alert("doubletap!"); } }); This doesn't work at all. The on() function should allow me to fire events on dynamically added HTML, but this code doesn't work. I have this code from this SO question I have included hammer.js, jquery_hammer_plugin.js and query.specialevent.hammer.js. So all the necessary JS files have been included, but still no luck. How do I make this work?
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
type: AnsweredQuestion
upvote count: 2
has answer: http://stackoverflow.com/a/26952561
type: Question
tagged with: javascript
tagged with: touch
linked to: http://stackoverflow.com/q/13810137

http://stackoverflow.com/a/26914221
answers question: http://stackoverflow.com/q/26906456
has comment: http://stackoverflow.com/comment/42453170
type: Answer
has comment: http://stackoverflow.com/comment/42451813
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/42450854
has comment: http://stackoverflow.com/comment/42450724
has body: HTMLElements don't have a keyup method. To trigger events programmatically, you'll have to use EventTarget.dispatchEvent. Since all HTMLElements are instances of EventTarget (HTMLElement.prototype instanceof EventTarget), you can do: var keydown = new Event('keydown'); document.querySelector('[name=xhpc_message_text]').dispatchEvent(keydown); Also note that Facebook previews a link only if it has more characters after the link. var messageBox = document.querySelector('[name=xhpc_message_text]'); messageBox.dispatchEvent(new Event('focus')); messageBox.value = 'www.stackoverflow.com '; messageBox.dispatchEvent(new Event('keydown'));
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26906456
downvote count: 0

http://stackoverflow.com/comment/42378566
comment on: http://stackoverflow.com/a/26914478
type: AnswerComment
score: 0
type: Comment
has text: @Fred-ii- haha yeah, thanks for your help man. I pointed that in the original question ;)

http://stackoverflow.com/comment/42462793
type: AnswerComment
comment on: http://stackoverflow.com/a/26952987
type: Comment
has text: I'm not sure if this is possible... Keep in mind that "Bootstrap Multiselect" is based on a "select" widget, always drawn by the navigator as a drop-down widget, and I need an always-shown widget (like an "iframe" with some checkboxes inside)...
score: 0

http://stackoverflow.com/a/26967684
type: Answer
answers question: http://stackoverflow.com/q/26967614
has body: Ajax request via $.post do not prevent sending page to server by native browser behavior. You must use event preventDefault function to cancel it: $(document).ready(function() { $("#locationForm").submit(function(e) { e.preventDefault();//stop form submiting var unameVal = $("#locationForm input[name='uname']").val(); var locationVal = $("#locationForm select[name='location']").val(); $.post("locationHandler.php", {uname: unameVal, location: locationVal}, function() { $("#display").load("defaultPhp.php"); }); }); }); More info about preventDefault here.
score: 0

http://stackoverflow.com/q/26926849
tagged with: jquery
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/26927072
type: UnansweredQuestion
has body: Consider this code: function drawCharts2() { var jsonData2 = $.ajax({ url: "http://**.**.**.**:9001/jolokia/read/*", dataType:"json", async: false }).responseText; var parsed2 = JSON.parse(jsonData2); The above URL contains no value at the startup of the web app. The data in that url will come after 2-3 minutes. When I start my web app. It gives error, but as a workaround I have set my page refresh time to 30 seconds. So after 30 seconds the table generates successfully. I need a way so that, even if the url will not contain any data, the code should not give any error. It should just skip the whole code. How can I achieve this?
type: Question
has title: Failed to load resource in ajax call
answer count: 1
has comment: http://stackoverflow.com/comment/42400029
tagged with: javascript

http://stackoverflow.com/a/39101870
has comment: http://stackoverflow.com/comment/65551021
has body: let R = require('ramda'); let arr =[ { 'key1': 'a', 'key2': 'b', 'key3': 'c', },{ 'key1': 'a1', 'key2': 'b1', 'key3': 'c1', },{ 'key1': 'a2', 'key2': 'b2', 'key3': 'c2', } ]; let key1 = R.pluck('key1', arr); let key2 = R.pluck('key2', arr); let key3 = R.pluck('key3', arr); let obj = { key1, key2, key3 }; Obj = { key1: [ 'a', 'a1', 'a2' ], key2: [ 'b', 'b1', 'b2' ], key3: [ 'c', 'c1', 'c2' ] }
score: 0
answers question: http://stackoverflow.com/q/26898363
type: Answer

http://stackoverflow.com/q/26976639
type: Question
tagged with: servlets
has answer: http://stackoverflow.com/a/26976724
score: 0
tagged with: arrays
answer count: 1
tagged with: javascript
tagged with: jquery
has title: sending a 2d array jquery post to java servlet
accepted answer: http://stackoverflow.com/a/26976724
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/13241668
has body: I have some data that I need to send that is in a 2D array. I found that you send an array through post here here but i need to send a 2D array from my javascript using post to a java servlet. Is there a way to do this?

http://stackoverflow.com/comment/42262323
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26848861
type: Comment
has text: Okay so the "blah blah blah" and "bloo bloo bloo" parts are not exactly what i have that i want the page to print out, i have other things written i just thought it would be easier on the question to replace those parts with something mindless. Anyways, I have two 's in my first div and one in my second div, and the very first is larger than the rest of the text on the page, but that happens before i hit any buttons.

http://stackoverflow.com/a/26952484
upvote count: 3
type: Answer
has body: Instead of all these, convert the checkboxes to radio buttons and group them using a name! And for deselecting, you can just give a reset. Product 1 Buy Sell Product 2 Buy Sell Product 3 Buy Sell No JavaScript or nothing.
downvote count: 0
answers question: http://stackoverflow.com/q/26952443
score: 3

http://stackoverflow.com/comment/42258995
type: Comment
comment on: http://stackoverflow.com/a/26847642
has text: Here is my [lab](http://www.lab.workforceint.com/contract.php), dynamically provided by my db
type: AnswerComment
score: 0

http://stackoverflow.com/q/26833896
has title: jQuery Animation Effect
type: UnansweredQuestion
tagged with: css
answer count: 0
score: 0
type: Question
has body: Have a look on this two pictures and tell me if is any chance to create this transition in jQuery. So I have 3 pictures which should be buttons. The thing is it should looks in those shapes like in first picture. On picture touching should to have an transit effect as in the second picture. So the first one should to transit in right side and see the whole picture for 2 seconds and after to open a page. Second picture should to transit in both sides and the third one in the left side.
has comment: http://stackoverflow.com/comment/42234038
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42234345

http://stackoverflow.com/comment/42251216
score: 0
type: AnswerComment
has text: I'm not sure. Why are you being stuck at *jsfiddle*?
type: Comment
comment on: http://stackoverflow.com/a/26843879

http://stackoverflow.com/a/26859777
answers question: http://stackoverflow.com/q/26850265
score: 4
has comment: http://stackoverflow.com/comment/42321881
upvote count: 4
has comment: http://stackoverflow.com/comment/42321665
accepted answer of: http://stackoverflow.com/q/26850265
has comment: http://stackoverflow.com/comment/42294782
type: AcceptedAnswer
has body: You will need to use some Javascript. Luckily the SVG DOM provides a function that allows you to get the position of a point n along a path: var point = mypath.getPointAtLength(n); So once you have a reference to a path, you can position elements along it using absolute positioning. pathOnDiv("1", 0.1); function pathOnDiv(text, pos) { // Get the coordinates of the point that is the fraction 'pos' along the path var path = document.getElementById("mypath"); var pathLength = path.getTotalLength(); var loc = path.getPointAtLength(pos * pathLength); // Make a div var div = document.createElement("div"); div.textContent = text; div.setAttribute("class", "pathDiv"); div.style.left = loc.x + "px"; div.style.top = loc.y + "px"; document.body.appendChild(div); } Demo fiddle here Note that this is a fairly simplistic demo. For instance, it assumes that: your SVG is at the very top left of the window. your SVG is not scaled (ie. it is at 1:1). If those assumptions are not correct, you will need to modify the code a bit. To correct for assumption #1, you would need to adjust the position of the div by adding in the left and top offset of the SVG on the page. There are also ways to correct for assumption #2. Update A simple way to correct for assumption #1 is to wrap your &lt;svg&gt; and path divs in a container div. If you give that div position: relative, then any pathDivs you put in there will be positioned correctly, and you don't need to worry about adjusting div positions for offset. Example here
downvote count: 0
type: Answer

http://stackoverflow.com/comment/42339925
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26893025
score: 0
has text: http://stackoverflow.com/questions/10867503/change-background-image-in-body

http://stackoverflow.com/a/26904225
score: -2
downvote count: 2
has comment: http://stackoverflow.com/comment/42359846
has body: Change mousemovepos : { x:0, y:0 }, to this.mousemovepos : { x:0, y:0 },
upvote count: 0
answers question: http://stackoverflow.com/q/26904130
type: Answer

http://stackoverflow.com/comment/42379067
comment on: http://stackoverflow.com/q/26914964
score: 0
has text: You can remove duplicats with javascript like so - var names = ["potato","volvo","volvo","potato","apple",]; var uniqueNames = []; $.each(names, function(i, el){ if($.inArray(el, uniqueNames) === -1) uniqueNames.push(el); }) , however I would recommend if you are getting it from a server (which you or someone has control), have the servers return method not send you duplicates.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42443682
score: 0
type: QuestionComment
type: Comment
has text: I think it occurs when the point it's attached to goes off screen, something you'd want to have happen with a marker. The extent is probably ok. Thanks
comment on: http://stackoverflow.com/q/26928785

http://stackoverflow.com/a/26985347
type: Answer
accepted answer of: http://stackoverflow.com/q/26985265
has comment: http://stackoverflow.com/comment/42543702
score: 2
has comment: http://stackoverflow.com/comment/42533444
upvote count: 2
has body: One way to do this is to have GSP write those child values (lists) into JS variables. On parent dropdown's change (onchange), load the appropriate list of values into the children dropdown, based on the parent selection. Modify from this answer Another way is to have GSP render all the lists data as DOM object (children dropdowns). On parent dropdown's change (onchange), show or hide these DOM objects, based on the parent selection.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42575115
answers question: http://stackoverflow.com/q/26985265
downvote count: 0

http://stackoverflow.com/q/26991862
has comment: http://stackoverflow.com/comment/42515029
has comment: http://stackoverflow.com/comment/42514949
type: Question
has title: How can I insert css in javascript?
has body: This is my script This is my html <img src = "../images/thumbs/3.png" And I want to add css for each element as "Images" to be showed in one position and thumb in other. It should to be something like this. Car or pic2() should to be in middle of page and car-colour in bottom side of page. .car { position: absolute; cursor: pointer; display: block; overflow:hidden; margin:0; padding: 0; width: 638px; height: 274px; top: 200px; left: 150px; } .car-colour { position: absolute; cursor: pointer; display: block; overflow:hidden; margin:0; padding: 0; width: 70px; height: 70px; top: 500px; left: 80px; } SOLVED .car { position: absolute; cursor: pointer; display: block; overflow:hidden; margin:0; padding: 0; }
score: 0
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26992501
has answer: http://stackoverflow.com/a/26992810
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42514930
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/q/26904006
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/26904163
score: 0
has title: How to move a DIV based on a mouse click in Javascript?
type: UnansweredQuestion
type: Question
has body: I have a testbed with four simple content DIVS which I would like to change the position of when each of them is clicked. Link below. http://christopherwynne.com/tattoo/ I have performed similar functions with other sites in the past, and I feel like I am missing something fundamental. I am still new to Java, and have always had issues getting anything to work initially. Any help with this issue would be greatly appreciated.

http://stackoverflow.com/a/26873364
answers question: http://stackoverflow.com/q/26873162
downvote count: 1
has body: It looks like you are missing Authentication header. See documentation: Authorization - Required. Specifies the authentication scheme, account name, and signature. For more information, see Authentication for the Azure Storage Services. Details how to set this header can be found here EDIT: Wrong, as pointed out in comment - "An authenticated request must include the Authorization header. If this header is not included, the request is anonymous and may only succeed against a container or blob that is marked for public access , or against a container, blob, queue, or table for which a shared access signature has been provided for delegated access"
has comment: http://stackoverflow.com/comment/42305178
has comment: http://stackoverflow.com/comment/42305025
type: Answer
upvote count: 0
has comment: http://stackoverflow.com/comment/42305274
score: -1

http://stackoverflow.com/a/46834001
has comment: http://stackoverflow.com/comment/92144624
has body: As of 2018, the accepted answer is out-of-date: Sweetalert is maintained, and you can solve the original question's issue with use of the content option.
has comment: http://stackoverflow.com/comment/84800632
has comment: http://stackoverflow.com/comment/92144377
downvote count: 2
upvote count: 13
answers question: http://stackoverflow.com/q/26838965
type: Answer
score: 11

http://stackoverflow.com/q/26878491
has title: Web Audio Api writing oscilator with createBuffer()
accepted answer: http://stackoverflow.com/a/26878646
type: AnsweredQuestion
tagged with: html5-audio
score: 0
type: Question
has body: I am trying to make a sine wave with createBuffer(). Like following code. var TWOPI = Math.PI * 2; var Sinewave = function(freq, amp, phase){ var self = this; this.src; this.init = function(){ var osc = new self.Osc(phase); var buffer = ac.createBuffer(1, osc.samplerate, osc.samplerate); var buffering = buffer.getChannelData(0); for(i = 0; i &lt; buffering.length; i++){ buffering[i] = amp * this.sinetick(osc, freq); } this.src = ac.createBufferSource(); this.src.buffer = buffer; this.src.loop = true; this.src.connect(contect.destination); } this.Osc = function(_phase){ this.samplerate = context.sampleRate; this.twopiovsr = TWOPI/this.samplerate; this.curfreq = 0; this.curphase = _phase; this.incr = 0.0; } this.sinetick = function(osc, freq){ var val = Math.sin(osc.curphase); if(osc.curfreq != freq){ osc.curfreq = freq; osc.incr = osc.twopiovsr * freq; } osc.curphase += osc.incr; if(osc.curphase &gt;= TWOPI){ osc.curphase -= TWOPI; } if(osc.curphase &lt; 0.0){ osc.curphase += TWOPI; } return val; } this.play = function(duration){ this.src.start(0); this.src.stop(duration); } } This only contains function for sine wave but I've succeeded to implement other shapes as well. Reason for this in the first place was to set phase offset, if there's a better option please give me a notice. So, When I look at the output signal through oscilloscope they look like how they should be. However when I try to modulate frequency of a regular createOscillator node with the signal created by code above, output is not pretty. When regular createOscillators nodes fm themselves, waves on the oscilloscope changes horizontally, only frequencies, but with the signal generated with the code above gives changes in both horizontal and vertical giving clips what could be the problem? Thanks
has answer: http://stackoverflow.com/a/26878646
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/26976515
has comment: http://stackoverflow.com/comment/42487673
tagged with: setinterval
accepted answer: http://stackoverflow.com/a/26977060
score: 1
has body: I've written a small function that moves/bouces a button every 5 seconds like so: HTML: Text JS: var interval; function buttonShake(){ var times = 5; var speed = 300; var distance = '15px'; for(var i = 0; i < times; i++) { twitterButton.animate({ left: '-='+distance }, speed).animate({ left: '+='+distance }, speed); } } interval = setInterval(buttonShake, 4000); What the button does it when clicked, it slides out a hidden box from the right hand side of the page. What I'm trying to do is prevent the button from bouncing once it has been clicked. So I tried using the following button.on('click', function(e){ // do the slideout animation // add "open" class to the box if(box.hasClass('open')){ clearInterval(interval); } }); The button and box elements have been defined correctly and the open class is appended to the box once it slides out, however clearing the interval doesn't appear to be working. It still continuously calls the buttonShake() function every 5 seconds. Here is a JSFiddle with the full code for a live preview: http://jsfiddle.net/30tsype8/3/ Am I doing something wrong here?
has comment: http://stackoverflow.com/comment/42487788
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/42487983
has comment: http://stackoverflow.com/comment/42488276
has title: Javascript clearInterval on click
has answer: http://stackoverflow.com/a/26977060
has comment: http://stackoverflow.com/comment/42487850
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42487717
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/42487970
tagged with: clearinterval
has comment: http://stackoverflow.com/comment/42488064
type: Question
has comment: http://stackoverflow.com/comment/42487791

http://stackoverflow.com/comment/42308918
type: Comment
type: QuestionComment
has text: It might help if we can see your html. Also if you want this to work across multiple users you'll need to save it to the back end somehow and I don't think you have any ajax. For sharing your full work I would recommend jsfiddle or one of many similar sites. Also I suspect that your actually making your life way more complicated then needed. If I understand your problem correctly what you want is for the odometer to reflect the current level of donation? If so I might have something a bit simpler for you. Also an image of what the final product should look like would probably help.
comment on: http://stackoverflow.com/q/26875501
score: 0

http://stackoverflow.com/q/26860198
has comment: http://stackoverflow.com/comment/42281784
downvote count: 1
has comment: http://stackoverflow.com/comment/42281234
type: Question
has comment: http://stackoverflow.com/comment/42281057
has comment: http://stackoverflow.com/comment/42281722
has comment: http://stackoverflow.com/comment/42281671
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26879018
has comment: http://stackoverflow.com/comment/42281054
has comment: http://stackoverflow.com/comment/42281719
upvote count: 0
has body: I'm trying to have a long vertical page with images that "animate" in from the left and right using JQUERY. Using jquery, i artificially move them "out of the website frame of 960 pixels (that way, if the user doesnt have javascript, the images stay put) using this: $(".boxtxtleft img").animate({ left:'+=150', opacity: 0 }, 0); $(".boxtxtright img").animate({ left:'-=150', opacity: 0 }, 0); My problem is that when i change the "position:absolute" of the images to go outside the frame of the website, it add an horizontal scroll bar at the bottom of the window. It also make Safari "zoom out" to include all content in IOS, both of which are not acceptable. NOTE: when i use overflow: hidden; on my 960 pixel container, then the images clip, which is not good either. Also putting the overflow on the body tag doesnt solve the problem either. HINT: i'm trying to do a similar animation as the molecule on http://onnit.com/alphabrain about 50% down the page. My site: if this can help answer the question, my site is: http://satinata.com/index.php?l=1#ingredients How do I move something outside a frame without creating this problem? EDIT Here is a part of my code: TEXT and the css: .ingredients{} .max960{ width: 960px; position: relative; margin: 0 auto; overflow: hidden; } .boxtxtright{ float: right; width: 500px; margin-top: 125px; position: relative; } .boxtxtright img{ position: absolute; left: -530px; z-index: 0; } Thanks
answer count: 1
has comment: http://stackoverflow.com/comment/42281101
has comment: http://stackoverflow.com/comment/42281175
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: -1
has title: A div with "position:absolute" that doesn't add horizontal scrollbar
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26879018

http://stackoverflow.com/comment/42432203
comment on: http://stackoverflow.com/q/26944713
score: 1
type: Comment
has text: It is like eating a real size chocolate elephant. Take it one bite at a time. See if you can `ftp` the image files to the server and create a page to show one of those images. Then dive into PHP and databases. Store the images paths and description and see if you can retrieve it, for just one image. And so on.
type: QuestionComment

http://stackoverflow.com/a/26913088
type: Answer
score: 1
has body: you can see this link http://jsfiddle.net/Vandeplas/5aKdc/3/ grid.store.sorters.clear(); grid.view.refresh(); it says that you have to refresh your grid after disabling sorting
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26912762
answers question: http://stackoverflow.com/q/26912762
has comment: http://stackoverflow.com/comment/42376145
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/42454300
type: AnswerComment
has text: @Stoto Here is a demo: http://jsfiddle.net/aeuLx9nt/ . I manually added the minimum and maximum values that you add from php.
type: Comment
comment on: http://stackoverflow.com/a/26956958
score: 0

http://stackoverflow.com/q/26963398
has body: I have simple HTML: Then I dynamically add options (with help of Backbone.js). As result, I have the following HTML: Task type 47 Task type 76 Task type 25 Task type 44 I want to listen event on change option. I have the following jQuery: $( document ).ready(function() { $(document).on('change', "#task-categories-select", function () { alert(this.value); }); }); It correctly works in Chrome. But, when I change option first time, it does not work in Firefox. Then, when I change option second time, it correctly works.
answer count: 0
tagged with: javascript
tagged with: jquery
tagged with: html-select
has comment: http://stackoverflow.com/comment/42672778
tagged with: jquery-events
type: Question
tagged with: http://stackoverflow.com/tag/html
has title: Event on change option does not work in Firefox
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42509797

http://stackoverflow.com/q/26859059
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26859343
score: 0
accepted answer: http://stackoverflow.com/a/26859343
tagged with: http://stackoverflow.com/tag/html
has title: Django data updation in the table
linked to: http://stackoverflow.com/q/7335780
tagged with: django
type: AnsweredQuestion
has body: I am using Django to enter some data into my database. After entering the data I want to edit it. Now, what I am trying is, the user should not go to any other page to change the data. So I have implemented a javascript method which edits the text on the front end. How do I reflect the changes made by the user in the database? The related code is given below: {% csrf_token %} Name Phone Number {% for record in queryset %} {{record.first}} {{record.second}} {%endfor%} function clickable(ele) { var value = prompt("Enter the details"); if(value) { ele.id='edited' ele.innerHTML = value; //I want to send the request to my django view to edit the database here //The data has been updated. }

http://stackoverflow.com/comment/42317511
score: 0
type: AnswerComment
has text: That does seem to produce the intended result. Interesting that the html that angular injects doesn't adhere to the containing object. Is this a common occurrence with html that is injected to the DOM? The html that angular outputs is essentially the same as the html that I hardcoded in the fiddle.
type: Comment
comment on: http://stackoverflow.com/a/26880535

http://stackoverflow.com/q/26841136
has answer: http://stackoverflow.com/a/26882565
answer count: 1
downvote count: 0
tagged with: partial
favorite count: 0
tagged with: angularjs
has title: Directive templateUrl redirects to /
accepted answer: http://stackoverflow.com/a/26882565
type: AnsweredQuestion
score: 1
upvote count: 1
tagged with: directive
has comment: http://stackoverflow.com/comment/42247505
type: Question
has body: I am trying to use templateUrl in a directive to load a partial, but when visiting the URL for the template, I am getting redirected back to /. So the partial loads the entire page instead of the requests partial. add-to-cart.js .directive('addToCart', function() { return { restrict: 'E', scope: { }, replace: false, templateUrl: 'src/common/add-to-cart/add-to-cart.tpl.html', link: function(scope, element, attrs) { } }; }); app.js $urlRouterProvider.otherwise( '/' ); Why is this happening and how can I solve it?
tagged with: angular-ui-router
tagged with: javascript
has comment: http://stackoverflow.com/comment/42246505

http://stackoverflow.com/comment/42471203
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26966915
has text: The idea is fine, but the execution - not so much :) See @Johannes Reuter answer - you can use `data-attributes`. This way your markup is still valid.
score: 0

http://stackoverflow.com/a/26988043
upvote count: 5
downvote count: 0
type: AcceptedAnswer
has body: You can use geoPlugin First Add to your webpage then try this document.write("Welcome to our visitors from "+geoplugin_countryName());
accepted answer of: http://stackoverflow.com/q/26987953
answers question: http://stackoverflow.com/q/26987953
type: Answer
score: 5

http://stackoverflow.com/a/26958413
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: They can still follow the link to get the file directly. Just display the source of this (this question) page, you can see &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;&lt;/script&gt; but you can still simply open https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js to see the source. Even obfuscation doesn't provide protection as the source is still accessible to the client and he can de-obfuscate it (although that can be hard, it is not impossible). And minification is used to reduce file size, so the file loads faster (and thus the page load time is lower).
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/26958322
accepted answer of: http://stackoverflow.com/q/26958322

http://stackoverflow.com/a/26869348
type: Answer
score: 6
has comment: http://stackoverflow.com/comment/42298107
upvote count: 6
has body: You define two variables: function(foo, bar) You pass two values into them: }(foo, foo.bar)) The value of foo is a reference to an object (that object has a property bar whose value is a reference to a different object) The value of the variable bar is a reference to that second object. foo.bar = 'a'; You overwrite the bar property of the first object with the string 'a'. foo.bar is no longer a reference to the second object. The value of bar is still a reference to the second object. bar = 'b'; You overwrite the local bar variable with the string 'b'. There are now no references to the second object left. The second object will be garbage collected. console.log(foo.bar) You output the value of the bar property of the object that the value of foo is a reference to. This is 'a' since you modified the value of that property in the function.
has comment: http://stackoverflow.com/comment/42297865
answers question: http://stackoverflow.com/q/26869243
has comment: http://stackoverflow.com/comment/42298415
has comment: http://stackoverflow.com/comment/42298437
has comment: http://stackoverflow.com/comment/42298094
has comment: http://stackoverflow.com/comment/42298162
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26869243
has comment: http://stackoverflow.com/comment/42297986
has comment: http://stackoverflow.com/comment/42298249
has comment: http://stackoverflow.com/comment/42298353
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42298169

http://stackoverflow.com/comment/42445535
score: 0
comment on: http://stackoverflow.com/q/26952040
has text: Take a look at this: http://plnkr.co/edit/RXDHmY?p=preview Just updated
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26963129
type: Question
tagged with: jquery-animate
answer count: 1
tagged with: javascript
tagged with: jquery
has body: Can anyone recommend any good product auto slider with buttons. I am new to jquery so any good easy jquery slider would be fine. I am looking to build this kind of slider .And when click on the image then it should open the clicked image with description like this . Any help of how can i make this slider would be appreciated thanks in the advance.
tagged with: css-animations
score: 0
has answer: http://stackoverflow.com/a/26964861
tagged with: css
has title: Jquery Auto Slider with buttons
accepted answer: http://stackoverflow.com/a/26964861
type: AnsweredQuestion

http://stackoverflow.com/a/26990658
upvote count: 1
has comment: http://stackoverflow.com/comment/42514157
score: 1
downvote count: 0
has body: You can try var parWorking = ["a val", "b cal", { id: "c.id val" } ]; foo.apply(this, parWorking);
type: Answer
answers question: http://stackoverflow.com/q/26990586

http://stackoverflow.com/comment/42310504
type: QuestionComment
has text: If this is DOM (using jQuery or equivalent) then this isn't specific to Node.JS.
comment on: http://stackoverflow.com/q/26876493
score: 0
type: Comment

http://stackoverflow.com/comment/42476178
score: 0
type: AnswerComment
type: Comment
has text: Well, now I'm getting `Error: $scope.categories is undefined` - though I of course instanciated `$scope.categories` and used the not-working-code from above for my controller. O.ó Why that? I don't know...
comment on: http://stackoverflow.com/a/26969037

http://stackoverflow.com/q/26910846
tagged with: google-chrome
has body: Any ideas how get Win OS user session id from Google Chrome using JavaScript or any plugins for it ? Task manager screenshot with session id: http://tinypic.com/view.php?pic=15rfklu&amp;s=8#.VGS7h_mSzQk
type: AnsweredQuestion
score: 1
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/26912575
favorite count: 0
tagged with: google-chrome-extension
has title: How to get windows Session id using javascript
accepted answer: http://stackoverflow.com/a/26912575
upvote count: 1

http://stackoverflow.com/q/26967621
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26968559
score: 0
answer count: 1
tagged with: backbone.js
has answer: http://stackoverflow.com/a/26968559
tagged with: cordova
has body: I am adapting an existing Backbone.js project to Cordova. Everything works fine except that, on iOS, I can't use console.log on the main.js. I am using the Cordova console plugin (org.apache.cordova.console) in order to be able to print messages to the console on iOS, and this is working fine in other scripts but not in main.js. I am sure this is due to deviceready not being fired yet when main.js is executing. How can I do to load main.js after deviceready is fired?
has title: Cordova + Backbone.js - Delay main.js load until deviceready is fired
type: AnsweredQuestion

http://stackoverflow.com/a/26940577
answers question: http://stackoverflow.com/q/26940538
score: 1
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26940538
has body: I don't know exactly for Facebook, but if there is no sign of detection with JavaScript or CSS media queries, then they are probably doing it the old school way, i.e with user agent strings. Whenever you make a request to a website, your browser sends a string in the request header, in my case it's: User-Agent: Mozilla/5.0 (X11; Linux i686; rv:32.0) Gecko/20100101 Firefox/32.0 Iceweasel/32.0a2 The server which received the request can use that string to get an idea of what operating system and browser you are using, you can see that in my case it's Debian for the OS and Iceweasel (=firefox) for the browser, you can be 99% sure that I'm browsing on a Desktop computer.

http://stackoverflow.com/comment/42234345
type: QuestionComment
comment on: http://stackoverflow.com/q/26833896
has text: Check this out: http://css-tricks.com/almanac/properties/t/transform/
score: 0
type: Comment

http://stackoverflow.com/comment/42390004
type: AnswerComment
comment on: http://stackoverflow.com/a/26898499
type: Comment
has text: If I'm reading that correctly, a leading 0 followed by a digit is also invalid: i.e. 000.1234 and 0123.45 are invalid. Correct? Not that I would deliberately code input that way, but their spec is bad.
score: 0

http://stackoverflow.com/q/26922508
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/42392548
answer count: 2
has title: JavaScript Object Transformation
has body: I have an array of objects and 2 arrays to make comparison from. Based on the comparison of the elements in the array and keys in object the object needs to be transformed into a new object. For example The original object is as follows [{ 'Period 1': 1000.00 'Period 2': 2500.00 'Period 3': 1500.00 'Product': 'ABC' }, { 'Period 1': 3000.00 'Period 2': 1500.00 'Period 3': 2500.00 'Product': 'XYZ' }] The arrays are as follows var arr1 = ['Product'] var arr2 = ['Period 1','Period 2','Period 3'] The expected result based on the comparision from the above array in the object must be as follows [ { 'name': 'ABC' 'data': [1000.00,2500.00,1500.00] }, { 'name': 'XYZ' 'data': [3000.00,1500.00,2500.00] } ]
has comment: http://stackoverflow.com/comment/42392806
has comment: http://stackoverflow.com/comment/42392672
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/42392776
has comment: http://stackoverflow.com/comment/42392799
possible better answer: http://stackoverflow.com/a/26924510
favorite count: 0
has answer: http://stackoverflow.com/a/26922877
has comment: http://stackoverflow.com/comment/42392812
accepted answer: http://stackoverflow.com/a/26922877
score: -3
has answer: http://stackoverflow.com/a/26924510
upvote count: 0
downvote count: 3
tagged with: javascript-objects

http://stackoverflow.com/comment/42370986
has text: Maybe that's after clicking a second time?
comment on: http://stackoverflow.com/q/26910680
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26904754
upvote count: 1
downvote count: 1
type: Question
answer count: 2
tagged with: javascript
has title: javascript string split for string containing backslashes
has comment: http://stackoverflow.com/comment/42360576
score: 0
linked to: http://stackoverflow.com/q/3820381
has answer: http://stackoverflow.com/a/26904838
favorite count: 0
has body: I have a string like C:\Users\shail.jet\Desktop\cca-lan_test_cases_path.txt. I want to get only file name that is in this case is cca-lan_test_cases_path.txt.I have tried it with javascript split function but it did'nt work. Any help will be appreciated.
duplicate of: http://stackoverflow.com/q/3820381
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26904840

http://stackoverflow.com/a/26862719
answers question: http://stackoverflow.com/q/26862687
score: 0
type: Answer
has body: Use console.log(product.text()); (it is plain vanilla jQuery)

http://stackoverflow.com/a/26866041
accepted answer of: http://stackoverflow.com/q/26865848
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42291950
answers question: http://stackoverflow.com/q/26865848
has comment: http://stackoverflow.com/comment/42292500
has body: You have to call color function inside javascript code as shown below. d3.selectAll("path.link.onezero") .style("stroke",color(-0.5));
has comment: http://stackoverflow.com/comment/42291873
type: Answer
has comment: http://stackoverflow.com/comment/42292349
has comment: http://stackoverflow.com/comment/42291713
has comment: http://stackoverflow.com/comment/42292643
score: 0

http://stackoverflow.com/comment/42421992
type: Comment
type: QuestionComment
has text: http://pastebin.com/JPJWah3H Also I suppose I missed the explanation for that. I'll check it out now.
comment on: http://stackoverflow.com/q/26938622
score: 0

http://stackoverflow.com/comment/42509188
comment on: http://stackoverflow.com/q/26988505
type: Comment
type: QuestionComment
score: 1
has text: A jsfiddle for this, would be much appreciated !

http://stackoverflow.com/q/26842600
downvote count: 0
tagged with: javascript
has body: I'm writing a WP8.1-App in JavaScript/HTML that needs a working camera. My mediaCapture is set up and working. So I tried to do the focus: var focusControl = mediaCapture.videoDeviceController.focusControl; focusControl.focusAsync().then(function () { ..... }); But here it fails with a catastrophic failure in this line. Same, if I remove the .then-part. I read a bit on the internet and wanted to check my focusSettings to make sure everything is set up fine. But this: var focusSettings = new Windows.Media.Devices.FocusSettings(); var modeContinuous = Windows.Media.Devices.FocusMode.continuous; var distanceHyperfocal = Windows.Media.Devices.ManualFocusDistance.hyperfocal; var rangeFull = Windows.Media.Devices.AutoFocusRange.fullRange; focusSettings.distance = distanceHyperfocal; focusSettings.mode = modeContinuous; focusSettings.autoFocusRange = rangeFull; and this: var focusSettings = new Windows.Media.Devices.FocusSettings(); focusSettings.distance = focusControl.supportedFocusDistances[0]; focusSettings.mode = focusControl.supportedFocusModes[0]; focusSettings.autoFocusRange = focusControl.supportedFocusRanges[0]; both crash in this line: var focusControl = mediaCaptureMgr.videoDeviceController.focusControl; focusControl.configure(focusSettings); It says: JavaScript runtime error: The application called an interface that was marshalled for a different thread. But afaik there is no dispatcher in JavaScript so I can't push it to the UI thread (if it is not there already..). What am I doing wrong? The default focusSettings sets it to focus once. I wanted to set continuous or at least autofocus everytime before I capture a photo.
favorite count: 0
score: 2
answer count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: windows-phone-8.1
has title: focusControl.focusAsync() - Catastrophic failure
tagged with: photo
type: Question
has comment: http://stackoverflow.com/comment/51840600

http://stackoverflow.com/a/26912789
has body: Did you try adding "float: left" to the css?
has comment: http://stackoverflow.com/comment/42375140
answers question: http://stackoverflow.com/q/26912454
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/42375019
upvote count: 1

http://stackoverflow.com/q/26945825
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/42442030
has title: Page Transition not working (jQuery mobile)
tagged with: jquery-mobile
has comment: http://stackoverflow.com/comment/42437104
tagged with: javascript
score: 0
tagged with: jquery
tagged with: ajax
type: UnansweredQuestion
has body: I'm trying to learn jQuery mobile. I tried to use data-transition used for page transition, but it's showing the default fade transition only for other transistion, even if i using other transitions like pop, flip etc I'm able to view all transitions displayed on jQuery docs Here's my html body : Heading 1 Hi! I'm the content in the page Page 2 Pop Up Footer 1 Heading 2 Hi! I'm the content in the page 2 Page 1 Back Footer 2 Pop Up Hi! I'm the content in the Pop Up Page 1 Pop Up What am i doing wrong?
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/42450912
type: Comment
comment on: http://stackoverflow.com/a/26955594
type: AnswerComment
has text: in the model field I can see only "undefined". Can plz check the documentation provided here: http://dataweave.in/apis/usage/15/Car-Prices-India
score: 0

http://stackoverflow.com/comment/42284743
type: AnswerComment
has text: @RCola: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_string_as_a_parameter It is syntax of the replacement string. Don't worry since it is not as crazy as regex's syntax.
comment on: http://stackoverflow.com/a/26862065
type: Comment
score: 1

http://stackoverflow.com/comment/42446210
score: 1
type: AnswerComment
has text: Ok here is an updated version of the example. Pressing any key will cause the camera to rotate to the object but if you do that the next time you go to move the camera by dragging the mouse the camera will automatically jump to the last position before the keystroke. This is because in order for the mouse to move the camera it has to keep track of the lat and lon. So what I'm having issues with is calculating the new lat lon position after the keystroke. http://codepen.io/anon/pen/GgRXJz
type: Comment
comment on: http://stackoverflow.com/a/26952349

dc.js
tag name: dc.js
tags question: http://stackoverflow.com/q/26991857
tags question: http://stackoverflow.com/q/26897821
type: Tag

http://stackoverflow.com/comment/42463688
comment on: http://stackoverflow.com/q/26962855
type: Comment
type: QuestionComment
score: 2
has text: We need to see the entire code.

http://stackoverflow.com/comment/42360563
type: Comment
has text: @SZenC I am sorry, I do not follow, he wanted to extract the Hits against Computer name, please tell me what is inconsistent with what he asked?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26903903

http://stackoverflow.com/comment/42304161
type: QuestionComment
type: Comment
has text: Yes the css is loading just fine and there is only one div id with name container
score: 0
comment on: http://stackoverflow.com/q/26865365

http://stackoverflow.com/q/26917905
tagged with: scope
score: 0
has body: I have a function which is going to make a REST call, but it cannot do this until an auth token has been fetched. So I wrapped the REST call in the 'then()' of the auth token call's promise, like so: var RESTCall = function() { return authTokenPromise.then(function() { return $http.get('userService' { userId: 1234, someFlag: true }); }); }; This has the result of waiting to fire off the call to the userService until the authToken promise (from the service that gets the auth token) has resolved. The problem comes when I try to remove the hard-coded params that set userId and someFlag. What I want to do is this: var RESTCall = function(params) { return authTokenPromise.then(function() { return $http.get('userService' { userId: params.userId, // params is undefined someFlag: params.flag // params is undefined }); }); }; How do I pass params into the anonymous function scope created by then(function() {...})?
has comment: http://stackoverflow.com/comment/42384361
answer count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/42385295
type: UnansweredQuestion
has title: How to pass a javascript object into a child function scope
tagged with: angular-promise
has comment: http://stackoverflow.com/comment/42384366
has comment: http://stackoverflow.com/comment/42385290
type: Question
has comment: http://stackoverflow.com/comment/42384773
linked to: http://stackoverflow.com/q/3349380
tagged with: javascript

http://stackoverflow.com/a/40617542
downvote count: 2
has body: I was having this issue. After some research, I opted to convert objectTwo to a JSON string, and then replace objectOne with the parsed version. In other words: var mObjectOne = { ExampleProperty: 10 }; var mObjectTwo = { ExampleProperty: 15 }; // I wanted mObjectOne to hold the same data as mObjectTwo, but keep a separate reference var mObjectTwoAsJSON = JSON.stringify(mObjectTwo); mObjectOne = JSON.parse(mObjectTwoAsJSON); // Now the references are still different, as desired, but the object data has been updated. Thanks,
upvote count: 0
score: -2
answers question: http://stackoverflow.com/q/26957719
has comment: http://stackoverflow.com/comment/117560534
type: Answer

http://stackoverflow.com/comment/42486253
type: QuestionComment
comment on: http://stackoverflow.com/q/26973962
score: 0
has text: So you want to allow the zoom function in the charts, instead of moving the panel, right? do you still want to be able to move the chart panel? possibly by clicking and dragging on the heading area containing 'utlisation from October 1st'? or do you not want the chart panel to be draggable at all?
type: Comment

http://stackoverflow.com/comment/42291244
comment on: http://stackoverflow.com/a/26865844
has text: I'm editing my original post as well, but I'll try to be more descriptive the first time through in the future.
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/q/26948389
answer count: 1
tagged with: javascript
score: 0
has title: Add click event to the Image on canvas
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26948441
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42438718
linked to: http://stackoverflow.com/q/55677
has body: I have created a canvas and added an image on it. I want to add a click event to that image. Below is my code for the same. &lt;canvas id="myCanvas" width="578" height="1000"&gt;&lt;/canvas&gt; &lt;script&gt; var canvas = document.getElementById('myCanvas'); var context = canvas.getContext('2d'); //This code is for adding leftArrow icon var leftArrow = new Image(); leftArrow.src = "leftArrow.jpg"; leftArrow.addEventListener("click",function(){alert("hello");},false); //this is not working leftArrow.onclick=function(){alert("image click");} drawScreen(); function drawScreen() { //context.drawImage(leftArrow, 218, 482);//leftArrow leftArrow.onload = function(){ context.drawImage(leftArrow, 218, 482); } } &lt;/script&gt; I want to add event to its click.
linked to: http://stackoverflow.com/q/4334896
type: Question
duplicate of: http://stackoverflow.com/q/4334896
tagged with: canvas

http://stackoverflow.com/q/26852391
favorite count: 0
has body: I am facing a problem in which same piece of code works fine in browser but doesn't work on device. Below Code works fine in browser HTML Your Name Phone Number JavaScript function GetImageBLOBObjectFromFile() { var dataURL; var file = document.querySelector('input[type=file]').files[0]; var reader = new FileReader(); reader.onloadend = function () { dataURL = reader.result; console.log("dataURL: "+ dataURL); var sPicData = dataURItoImageJPGBlob(dataURL); var sLanguage = "EN"; var sLongitude = "56.324319"; var sLatitude = "25.133403"; var sLocation = "Some location"; var sName = $("#yourname").val(); var sPhoneNumber = $("#phonenumber").val(); var sNotify = "Y"; var objForm = document.getElementById('snapitform'); SnapITServiceAPI.InitializeValues(); SnapITServiceAPI.getSnapITUploadService(objForm, sLanguage, sLongitude, sLatitude, sLocation, sName, sPhoneNumber, sNotify, sPicData); } if (file) { reader.readAsDataURL(file); } else { dataURL = ""; } } function dataURItoImageJPGBlob(dataURI) { console.log("dataURItoImageJPGBlob().. " ); var byteString = atob(dataURI.split(',')[1]); var ab = new ArrayBuffer(byteString.length); var ia = new Uint8Array(ab); for (var i = 0; i < byteString.length; i++) { ia[i] = byteString.charCodeAt(i); } return new Blob([ab], { type: 'image/jpeg' }); } /* -------------------SnapITServiceAPI ------------------------------- */ getSnapITUploadService: function(objForm, sLanguage, sLongitude, sLatitude, sLocation, sName, sPhoneNumber, sNotify, sPicData) { var requestMode = 'UPLOADSERVICE'; var objFormData = new FormData(objForm); objFormData.append('requestmode',requestMode); objFormData.append('user',ApplicationConfig.getUserName()); objFormData.append('pass',ApplicationConfig.getUserPassword()); objFormData.append('lang',sLanguage); objFormData.append('curlongitude',sLongitude); objFormData.append('curlatitude',sLatitude); objFormData.append('curlocation',sLocation); objFormData.append('yourname',sName); objFormData.append('phonenumber',sP…
tagged with: ajax
type: Question
tagged with: android
tagged with: cordova
upvote count: 2
type: UnansweredQuestion
has title: PhoneGap - FormData Ajax submit does not work on device but works fine in browser
score: 2
answer count: 0
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/51210048
score: 1
comment on: http://stackoverflow.com/a/26925191
type: AnswerComment
has text: I figured it out. Just needed to set a `var template = Template.instance()` at the correct scope **before** my Meteor method call. Then in the callback code call `template.autorun(function ...` referring to the above variable works perfect.
type: Comment

http://stackoverflow.com/q/26849804
type: Question
tagged with: javascript
has title: loop through 'distinct' values and ignore duplicates - javascript
answer count: 2
tagged with: for-loop
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26849880
score: 2
upvote count: 2
has answer: http://stackoverflow.com/a/26850130
has body: I'm completely rewriting this question to explain it better, i have a list of objects as shown in the image. These all have the property statusCode: 62467 but the journey property goes like: 0,1,2,3,3,4,4,4,4 i want to loop through these objects and return the FIRST of the duplicated objects with the same journey number. So i want to return the bold objects: 0,1,2,3,3,4,4,4,4 $.each(points, function (index, point) { for (i = 0; i &lt; journeyNumber.length; i++) { if (point.k.journey === journeyNumber[i] &amp;&amp; point.k.statusCode === '62467') { console.log(point); latlngs.push(point.j.aa.k); latlngs.push(point.j.aa.B); } } }); the screenshot is the log of console.log(point), so ideally i would like another loop inside which returns only the first object of the same journey number. hope this makes sense and thank you for your time.
tagged with: loops

http://stackoverflow.com/comment/42290589
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/26865476
has text: Why shouldn't be null? You are sending only value of your input. To what it should be mapped?
type: Comment

http://stackoverflow.com/comment/42408051
comment on: http://stackoverflow.com/a/26929856
has text: @Sumit: It would work either way, it just changes where you put the code, but I probably don't have a good understanding of your overall design.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/26867609
upvote count: 1
score: 1
has body: You could add a specific stylesheet which will be only loaded in IE9 using IE conditional comments. In this stylesheet you should add whatever you need to fix the rendering issues. &lt;!--[if IE 9]&gt; &lt;link href="stylesheets/ie9.css" rel="stylesheet" /&gt; &lt;![endif]--&gt; Here is more info about conditional comments and how it works.
has comment: http://stackoverflow.com/comment/42294630
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/42294507
answers question: http://stackoverflow.com/q/26867140

http://stackoverflow.com/comment/42471152
has text: Can you give an example? The terminology is a bit unclear otherwise.
score: 0
comment on: http://stackoverflow.com/q/26967156
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26982576
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42513661
has answer: http://stackoverflow.com/a/27080239
upvote count: 2
has body: I have a problem to get a google map (v2) with v3 script to work The basic code is from geozip. Do you find the problem ? So far i think i have done all the changes that are needed for google Maps API v3 but it dont work. And i have also to say that i am new in JavaScript Working example (v2) Google Maps JavaScript API Example Restaurants Bars Not working exmaple (v3) Google Maps JavaScript API Example Restaurants Bars
type: Question
accepted answer: http://stackoverflow.com/a/27080239
has comment: http://stackoverflow.com/comment/42525769
has comment: http://stackoverflow.com/comment/42509691
has title: Issue to get map to work on google maps API v3
tagged with: javascript
tagged with: google-maps-api-3
tagged with: google-maps
tagged with: google-maps-api-2
downvote count: 0
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/42501475
has comment: http://stackoverflow.com/comment/42516939
tagged with: http://stackoverflow.com/tag/xml

http://stackoverflow.com/a/26868648
has body: jQuery is what you probably want to use for this case, please post your code so people can better help you but for a wild guess it would look something like this: $('#txtblk1').fadeIn('slow', function() { //A function called after fadein is complete }); Prime explanation can be found on the jQuery API website as said above.
answers question: http://stackoverflow.com/q/26868499
type: Answer
score: 0

http://stackoverflow.com/comment/42389312
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26920408
has text: You should create instead a jQuery plugin. Once you get all the *exceeding* children elements, you should clone the parent, empty-it, append the elements and re-do again the same method on that newly created *parent* element... and so on and so on...
type: AnswerComment

http://stackoverflow.com/a/61158941
score: 0
has body: Please consider making following changes. author: { type: String, ref: 'User' }; authot: { type: Schema.Types.ObjectId, ref:'User'};
type: Answer
answers question: http://stackoverflow.com/q/26880887
has comment: http://stackoverflow.com/comment/108195739

http://stackoverflow.com/q/26922148
has body: I was wondering if someone could help me with the coding I need to use on JavaScript(Google Script) for authentication over HTTPS. All requests must be made over HTTPS. All data is sent and received as JSON. When making requests, you receive data as JSON by properly setting the Accept header to application/json, as shown in the example below: $ curl https://yoursite.desk.com/api/v2/cases/:id -u email:password -H 'Accept: application/json' This was the HTTPS authentication provided by the website API. And I was wondering if someone could help with calling this using JavaScript.
answer count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42392203
tagged with: curl
has title: How to call HTTPS authentication using JavaScript
type: Question
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
tagged with: http-headers
has answer: http://stackoverflow.com/a/26922947
score: 0

http://stackoverflow.com/comment/42462832
score: 3
has text: What is the difference between the `isNan` here and doing `o !== o`
type: AnswerComment
comment on: http://stackoverflow.com/a/26962405
type: Comment

http://stackoverflow.com/q/26885945
tagged with: zurb-foundation
has answer: http://stackoverflow.com/a/26886809
has title: Revert to initial active tab when mouse leaves area, or using JS in Zurb Foundation
has body: I want to revert back to the initially active tab when the user moves the mouse away from the menu. I have a left top-level menu that changes the active tab on hover, using data-options="is_hover:true" When hovering over any of the tabs, it displays the second-level menu in place of the main content (which is displayed in a tab, which is displayed by default on page load). I want the default content tab to display whenever the mouse leaves the 1st or 2nd level menu area. Alternatively, I can make other elements detect the mouse hover and use JS to command the initial tag to be active. However I cannot find any documentation on what the JS should say, eg: $( ".detect" ).hover(function() { $( SET TAB1 TO ACTIVE PLEASE });
type: UnansweredQuestion
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0

content-management-system
tags question: http://stackoverflow.com/q/26931116
type: Tag
tag name: content-management-system

http://stackoverflow.com/comment/42257246
type: AnswerComment
comment on: http://stackoverflow.com/a/26846298
type: Comment
score: 0
has text: Never mind I found all the answers I need. I checked my other question and I found the answer there and now I don't need to toggle popups anymore

http://stackoverflow.com/comment/42340622
score: 0
type: AnswerComment
has text: Ok I'm going to look at it. Thank you very much!
comment on: http://stackoverflow.com/a/26869353
type: Comment

http://stackoverflow.com/q/26962503
score: 0
has body: I want it to look like this https://i.sstatic.net/QMXLF.jpg but it looks like this https://i.sstatic.net/mOmMP.jpg Here's what I have as code for it, I've tried creating a label and adding it to the row as you can see below, and also tried creating a view (createView) and adding row and label to that but that just creates a white screen. var Helpers = {}; // row maker Helpers.createNavItem = function(options) { var footHeight=120; if (options.title == ''){ footHeight = 40; } var row = Ti.UI.createTableViewRow({ height:footHeight, title: options.title, backgroundImage: options.backgroundImage, font:{ fontFamily: "Helvetica", fontWeight: "bold", fontSize: 18}, color: '#1d1d1d', backgroundColor:'#b6e2e2', zIndex: 1 }); var label = Ti.UI.createLabel({ bottom: 0, height: 20, width: 'fill', backgroundColor: '#b6e2e2', opacity: 50, zIndex: 2 }); row.addEventListener('click', function (e) { tab1.open(options.page); }); return row; return row.add(label); }; Please help!!
tagged with: view
has title: Titanium JavaScript - Place colored object over existing label
type: AnsweredQuestion
tagged with: row
type: Question
has answer: http://stackoverflow.com/a/26970050
tagged with: tableview
answer count: 1
tagged with: javascript
tagged with: label
accepted answer: http://stackoverflow.com/a/26970050

http://stackoverflow.com/q/26908217
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26908277
type: Question
score: 0
has title: JQuery Datepicker inverse next and prev buttons events
answer count: 1
tagged with: javascript
has body: I want to inverse Jquery datepicker next and prev buttons events, so that when press at next decrements the date and vise versa to fitting arabic right to left direction. this is my sample code. $("#searchFromDate").datepicker({ showOtherMonths: true, defaultDate: "+1w", changeMonth: false, numberOfMonths: 1, dateFormat: 'mm/dd/yy', monthNames: ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], dayNames: ['احد', 'اثنين', 'ثلاثاء', 'اربعاء', 'خميس', 'جمعة', 'سبت'], dayNamesShort: ['احد', 'اثنين', 'ثلاثاء', 'اربعاء', 'خميس', 'جمعة', 'سبت'], dayNamesMin: ['احد', 'اثنين', 'ثلاثاء', 'اربعاء', 'خميس', 'جمعة', 'سبت'], onClose: function (selectedDate) { $("#searchToDate").datepicker("option", "minDate", selectedDate); } }); //searchToDate $("#searchToDate").datepicker({ showOtherMonths: true, defaultDate: "+1w", changeMonth: false, numberOfMonths: 1, dateFormat: 'mm/dd/yy', monthNames: ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], dayNames: ['احد', 'اثنين', 'ثلاثاء', 'اربعاء', 'خميس', 'جمعة', 'سبت'], dayNamesShort: ['احد', 'اثنين', 'ثلاثاء', 'اربعاء', 'خميس', 'جمعة', 'سبت'], dayNamesMin: ['احد', 'اثنين', 'ثلاثاء', 'اربعاء', 'خميس', 'جمعة', 'سبت'], onClose: function (selectedDate) { $("#searchFromDate").datepicker("option", "maxDate", selectedDate); } });
tagged with: jquery
tagged with: datepicker
accepted answer: http://stackoverflow.com/a/26908277
has comment: http://stackoverflow.com/comment/42367533

http://stackoverflow.com/comment/42468094
has text: @adeneo compareFn just returns 1 or 0 depending on if the number is greater than or less than the middle value. I just compare the number to the middle value direclty
score: 0
comment on: http://stackoverflow.com/q/26965254
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42537554
has text: Yes, it does. For the zoom level, it is okay. The 1:1 layer is a solution, but I would like to generate all layers. With the computing algo of sizes (*2 at each zoom level) I think I can make a func that can take everything and draw the final tile for the Seadragon. Thanks.
comment on: http://stackoverflow.com/a/27000318
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/26965141
accepted answer of: http://stackoverflow.com/q/26963565
has body: Well, everything in JavaScript is JSON so it just kind of makes sense to use it. And you don't need PHP. You seem to already have a Node server up, just use that :). However, your valuesArray is instantiated to an empty list and then reassigned a bunch of times to other objects. You may want to change that to increase code clarity. A possible error source is that D3 expects an array of numbers, but your function is getting strings or JSON. That is, either ["1", "2"] or [{number : 1}, {number : 2}] as opposed to [1,2]. Place console.log(obj.numbers) in fkt_values_array and see what it looks like
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42501064
type: Answer
has comment: http://stackoverflow.com/comment/42476026
has comment: http://stackoverflow.com/comment/42478138
answers question: http://stackoverflow.com/q/26963565
has comment: http://stackoverflow.com/comment/42477684

http://stackoverflow.com/q/26841637
downvote count: 0
tagged with: javascript
tagged with: dom-events
has comment: http://stackoverflow.com/comment/42254316
favorite count: 0
answer count: 0
tagged with: angularjs
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/42248634
has comment: http://stackoverflow.com/comment/42250309
tagged with: leaflet
has body: I am using leaflet under Angularjs. At the leaflet map I have two markers m1 and m2. The map and the distance between the two markers are displayed using the following directives. &lt;leaflet ng-mouseup="change()" center="cen" paths="paths" markers="markers"&gt;&lt;/leaflet&gt; {{dist}} I want to calculate/recalculate the distance any time a marker is moved. For doing this I wrote a function change() which is called when the event ng-mouseup is triggered. The corresponding js is as follows: $scope.dist = distance($scope.markers.m1.lat, $scope.markers.m2.lat, $scope.markers.m1.lng, $scope.markers.m2.lng); $scope.change = function() { $scope.dist = distance($scope.markers.m1.lat, $scope.markers.m2.lat, $scope.markers.m1.lng, $scope.markers.m2.lng); }; The function change is called when a marker is moved and this function is calling the function distance but not with the new values of the markers. The original (old) values of the marker are passed. The question is how I can get the distance between the two markers using the new position of the marker instead. EDIT: Here is the jsfiddle code. JSFIDDLE: http://jsfiddle.net/vg01q7xw/
score: 1
has title: How to calculate the distance between two markers in leaflet
type: Question

http://stackoverflow.com/a/26898197
answers question: http://stackoverflow.com/q/26897997
has comment: http://stackoverflow.com/comment/42441598
has body: It looks like in dragged = function (d), d is sometimes null. This is probably also the case for "property '0'" errors as there's a lot of that in D3.v3.js. Do you have line number / file names for these errors? Are your SVG images ever being hidden? This could cause the events passing a null value. Running your code, both errors have to do with origin, which happens when you click somewhere other than the top of the SVG. It can't calculate the offset between the mouse and the SVG's location.
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/42384719
has comment: http://stackoverflow.com/comment/42407451

http://stackoverflow.com/comment/42334878
score: 0
type: Comment
type: QuestionComment
has text: the desired effect is for innerHTML just the way it is coded atm
comment on: http://stackoverflow.com/q/26890144

http://stackoverflow.com/q/26971026
has answer: http://stackoverflow.com/a/76614543
score: 77
has answer: http://stackoverflow.com/a/41498839
type: Question
linked to: http://stackoverflow.com/q/23238319
has answer: http://stackoverflow.com/a/27039293
accepted answer: http://stackoverflow.com/a/27039293
has body: I've recently set-up a local WebSocket server which works fine, however I'm having a few troubles understanding how I should handle a sudden loss of connection which neither the client or server intentionally initiated, i.e: Server loses power, ethernet cables pulled out etc... I need the client's to know whether connection has been lost within ~10seconds. Client side, connection is simply: var websocket_conn = new WebSocket('ws://192.168.0.5:3000'); websocket_conn.onopen = function(e) { console.log('Connected!'); }; websocket_conn.onclose = function(e) { console.log('Disconnected!'); }; I can manually trigger the connection disconnect which works fine, websocket_conn.close(); But if I simply pulled the ethernet cable out the back of the computer, or disabled the connection, onclose doesn't get called. I've read in another post that it would eventually get called when TCP detects loss of connectivity, but it's not in the timely manner that I need as the default for Firefox I believe is 10 minutes, and I don't really want to go around hundreds of computers about:config changing this value. The only other suggestion I've read is to use a 'ping/pong' keep-alive polling style method which seems counterintuitive to the idea of websockets. Is there an easier way to detect this kind of disconnect behaviour? Are the old posts i'm reading still up to date from a technical point, and the best method is still 'ping/pong' style?
tagged with: javascript
answer count: 6
has answer: http://stackoverflow.com/a/39765960
upvote count: 77
tagged with: firefox-addon
has title: Handling connection loss with websockets
tagged with: firefox
has answer: http://stackoverflow.com/a/70259132
tagged with: websocket
downvote count: 0
has answer: http://stackoverflow.com/a/26971108
favorite count: 0
linked to: http://stackoverflow.com/q/11809267
has comment: http://stackoverflow.com/comment/42477962
possible better answer: http://stackoverflow.com/a/39765960
type: AnsweredQuestion

http://stackoverflow.com/a/45357220
answers question: http://stackoverflow.com/q/26920174
type: Answer
score: 0
has body: var listOfItems = [1, 2, 3, 4, 5]; // Creating an empty initial promise that always resolves itself. var promise = $q.all([]); // Iterating list of items. angular.forEach(listOfItems, function (item) { promise = promise.then(function () { return $timeout(function () { console.log('Item executed: ' + item); }, 2000); }); }); promise.finally(function () { console.log('Chain finished!'); }); Source, In this solution, "angular.forEach" make possible that each promise be executed in chain, in other words, be a promises´s sequence
has comment: http://stackoverflow.com/comment/77677116

http://stackoverflow.com/q/26974903
has title: https domain, try download JS from no-secure http
has body: I'm have domain on HTTPS, with JS &lt;script src="http://example.com/some.js?key=cf04b31a52ed4c"&gt; and this script doesn't load. On other domain without SSL, all OK. This problem can resolve if I'm change protocol example.com to HTTPS too or no?
tagged with: ssl
has answer: http://stackoverflow.com/a/26975513
has comment: http://stackoverflow.com/comment/42485095
tagged with: https
has comment: http://stackoverflow.com/comment/42485900
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/26975896
tagged with: javascript
score: 0
type: UnansweredQuestion
tagged with: http

http://stackoverflow.com/q/26884841
upvote count: 1
score: 1
type: Question
has answer: http://stackoverflow.com/a/26885217
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I have a page with modal window, I want to in order to user could scroll divs in modal (when modal is open), but not all page, and if user close modal window he can scroll all page. $(window).scroll(function (e) { if (! modal ) { e.preventDefault(); } }) Is it possible ?
has title: Disable/enable scroll only on Modal
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/26880805
type: Answer
has body: I suppose that you are placing your script in the wrong place in code. Put it after the table tag, it worked for me in this way.
has comment: http://stackoverflow.com/comment/42317942
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/26879863
answers question: http://stackoverflow.com/q/26879863

http://stackoverflow.com/q/26853272
accepted answer: http://stackoverflow.com/a/26854432
type: AnsweredQuestion
score: 0
has body: I have added a textillate effect to text on a second jquery mobile page. When I click on the page 2 button in the navbar, the animation works correctly when page 2 is displayed. When I click on the page 1 button in the navbar followed by clicking on page 2 button, the text is displayed without animation. I presume there is javascript code to re-initialize the effect but I am at a loss what it is. put title here Page 1 Page 2 Page 1 Page 2 hello
type: Question
has answer: http://stackoverflow.com/a/26854432
tagged with: jquery-mobile
tagged with: javascript
has title: Textillate CSS animation not fully working with jQuery Mobile
answer count: 1

http://stackoverflow.com/comment/42510630
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26949941
has text: What is your Spree version?
score: 0

callback
tags question: http://stackoverflow.com/q/26856002
tag name: callback
tags question: http://stackoverflow.com/q/26873581
tags question: http://stackoverflow.com/q/26850950
tags question: http://stackoverflow.com/q/26860657
tags question: http://stackoverflow.com/q/26833596
tags question: http://stackoverflow.com/q/26869390
tags question: http://stackoverflow.com/q/26887259
tags question: http://stackoverflow.com/q/26911111
tags question: http://stackoverflow.com/q/26850437
tags question: http://stackoverflow.com/q/26969579
type: Tag

http://stackoverflow.com/comment/42267229
comment on: http://stackoverflow.com/q/26852333
score: 0
type: Comment
type: QuestionComment
has text: Having tried in Chrome's console, `'true' == true` returns `false`, so no: there's no type coercion (which makes sense, really). If, however, it reports `true` in the console then it's almost certainly a Boolean `true`.

http://stackoverflow.com/comment/42361606
comment on: http://stackoverflow.com/q/26904315
type: Comment
type: QuestionComment
has text: I'm not interested in a video player. By default HTML5 Videos don't auto play. So that is not a problem. The only problem is I don't want them to load.
score: 0

http://stackoverflow.com/q/26946143
answer count: 2
favorite count: 0
has answer: http://stackoverflow.com/a/26965140
has comment: http://stackoverflow.com/comment/42434659
upvote count: 1
possible better answer: http://stackoverflow.com/a/26965140
has answer: http://stackoverflow.com/a/26947009
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
downvote count: 3
has comment: http://stackoverflow.com/comment/42435398
has title: convert or parse string to JSON object
type: Question
score: -2
tagged with: arrays
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26947009
tagged with: jquery
has body: There was an interview question(Javascript) which my friend and me unable to solve it for a long time, so thought of asking here, Question: String: 2014&lt;18.3,11.4,12.1,19.5,1000&amp;&amp;11.2,34.5,67.1,18,20000&gt;name=sample,position=engineer,company=abc and the end reult should be a JSON Objwct with following format. Can anyone please help to solve this issue. Output: {[ {"Proposal":"2014"}, {"values":"[18.3,11.4,12.1,19.5],[11.2,34.5,67.1,18]"}, {"Items":"[1000,20000]"}, {"name":"sample"}, {"position":"engineer"}, {"company":"abc"}, ]} Expecting a solution and explanation please. Thanks, Basky

http://stackoverflow.com/q/26986762
score: 0
has title: Create color overlay when checkbox selected using z-index
possible better answer: http://stackoverflow.com/a/26986840
has answer: http://stackoverflow.com/a/26986840
tagged with: javascript
has answer: http://stackoverflow.com/a/27000467
type: AnsweredQuestion
tagged with: jquery
type: Question
has body: I have a check box that will be used to select a table with product info. Once selected a css style is to overlay a color at 30% so that it’s obvious that item is selected. Using just css and jquery I can invoke the style that has a greater z-index than the image that is being used to visually see the overlay. The overlay style works and shows the correct z-index but it is not over the image. Using Jquery I have forced the z-index of the image back to a -10 value. Still shows on top of the colored div… I can even force the div in the same Jquery to move to z-index 105 but still it is not shown over the top of the image that is on a lesser z-index. I’m thinking the problem is that the the div receiving the greater z-index is taking everything within it UP as the starting point so the nested image is also moved up in z-index level. If that’s the case, how best to do an overlay on a series of dynamically generated tables that need to be covered with the 30% opacity style? UPDATED WORKING CODE: $(function () { $("input[type='checkbox']").change(function () { if ($(this).is(":checked")) { $(this).parent().addClass("jobSelected"); } else { $(this).parent().removeClass("jobSelected"); } }); }); UPDATED WORKING CODE: Item 1 Select Item 2 Select The code above does a great job of setting the expected values that can be seen by doing a browser Inspect Element but it's the results that are not acheiving the goal.
answer count: 2
tagged with: css
accepted answer: http://stackoverflow.com/a/27000467

http://stackoverflow.com/comment/42337599
type: AnswerComment
has text: This is exactly what I was doing, but it breaks the MVC paradigm.
type: Comment
comment on: http://stackoverflow.com/a/26891906
score: 0

http://stackoverflow.com/comment/42285775
type: Comment
has text: I cannot add any console statements as "executeSql" is provided by the browser running the JavaScript (in this case, I am testing it in Safari (UIWebView) on iOS as it is part of a Cordova based mobile application).
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/26847587

http://stackoverflow.com/a/26895777
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/26894858
has comment: http://stackoverflow.com/comment/42345110
answers question: http://stackoverflow.com/q/26894858
score: 3
upvote count: 3
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42345353
has comment: http://stackoverflow.com/comment/124711027
has body: It's hard to do this real-time using high quality HSL conversion. Been there done that, so I came up with a quantized approach which allow you to do this in real-time. You can find the solution here (GPL3.0 licensed): https://github.com/epistemex/FastHSL2RGB Example of usage can be found here (MIT license) incl. demo: https://github.com/epistemex/HueWheel Apologies for referencing my own solutions here, but the inner workings (the how to's) is too extensive to present in a simple form here and both of these are free to use for anything.. The key points are in any case: Quantize the range you want to use (don't use full 360 degrees and not floating points for lightness etc.) Cache the values in a 3D array (initial setup using web workers or use rough values) Quantize the input values so they fit in the range of the inner 3D array Process the bitmap using these values It is not accurate but good enough for animations (or previews which is what I wrote it for). There are other techniques such as pre-caching the complete processed bitmap for key positions, then interpolate the colors between those instead. This, of course, requires much more memory but is a fast way. Hope this helps!

http://stackoverflow.com/q/26908705
tagged with: javacc
accepted answer: http://stackoverflow.com/a/26923510
upvote count: 1
type: AnsweredQuestion
score: 1
type: Question
has title: LOOKAHEADs for the JavaScript/ECMAScript array literal production
has answer: http://stackoverflow.com/a/26917617
tagged with: grammar
has answer: http://stackoverflow.com/a/26923510
downvote count: 0
tagged with: ecmascript-5
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/26912745
has body: I currently implementing a JavaScript/ECMAScript 5.1 parser with JavaCC and have problems with the ArrayLiteral production. ArrayLiteral : [ Elision_opt ] [ ElementList ] [ ElementList , Elision_opt ] ElementList : Elision_opt AssignmentExpression ElementList , Elision_opt AssignmentExpression Elision : , Elision , I have three questions, I'll ask them one by one. This is the second one. I have simplified this production to the following form: ArrayLiteral: "[" ("," | AssignmentExpression ",") * AssignmentExpression ? "]" Please see the first question on whether it is correct or not: How to simplify JavaScript/ECMAScript array literal production? Now I have tried to implement it in JavaCC as follows: void ArrayLiteral() : { } { "[" ( "," | AssignmentExpression() "," ) * ( AssignmentExpression() ) ? "]" } JavaCC complains about ambiguous , or AssignmentExpression (its contents). Obviously, a LOOKAHEAD specification is required. I have spent a lot of time trying to figure the LOOKAHEADs out, tried different things like LOOKAHEAD (AssignmentExpression() ",") in (...)* LOOKAHEAD (AssignmentExpression() "]") in (...)? and a few other variations, but I could not get rid of the JavaCC warning. I fail to understand why this does not work: void ArrayLiteral() : { } { "[" ( LOOKAHEAD ("," | AssignmentExpression() ",") "," | AssignmentExpression() "," ) * ( LOOKAHEAD (AssignmentExpression() "]") AssignmentExpression() ) ? "]" } Ok, AssignmentExpression() per se is ambiguous, but the trailing "," or "]" in LOOKAHEADs should make it clear which of the choices should be taken - or am I mistaken here? What would a correct LOOKAHEAD specification for this production look like? Update This did not work, unfortunately: void ArrayLiteral() : { } { "[" ( "," | LOOKAHEAD (AssignmentExpression() ",") AssignmentExpression() "," ) * ( AssignmentExpression() ) ? "]" } Warning: Warning: Choice conflict in (...)* construct at line 6, column 5. Expansion nested within construct and expansion f…
has answer: http://stackoverflow.com/a/26912745
answer count: 3
linked to: http://stackoverflow.com/q/26908490
tagged with: parsing

http://stackoverflow.com/comment/42404991
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26925838
has text: You got me and solved me. If you have any easy coding of these features then I will welcome that...

http://stackoverflow.com/comment/42375796
has text: no doesn't work, I get this error in the console: Uncaught ReferenceError: scrollUp is not defined
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26899659
type: AnswerComment

http://stackoverflow.com/comment/42448774
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26954325
score: 0
has text: but, what if there are arguments for the function? do i still do the same?

http://stackoverflow.com/q/26894291
has body: Hi guys I've looked around and I haven't really gotten a really good answer on this. So I have a drop down list that allows my users to pick which city they live in and stuff. However I want it so that that drop down has the ability to allow users to first type in their value first or select a value from the drop down. Here is what I have so far: * Service City/County: Select City/County Alpharetta Atlanta Brookhaven Chamblee Chattahoochee Hills College Park Decatur Douglasville Duluth Dunwoody East Point Fairburn Fulton County Hapeville Johns Creek Marietta Milton Mountain Park Newnan Palmetto Riverdale Roswell Sandy Springs Smyrna Union City ';
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26894415
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/42342231
tagged with: drop-down-menu
tagged with: jquery
has comment: http://stackoverflow.com/comment/42342461
tagged with: http://stackoverflow.com/tag/html
has title: drop down + user input (text)
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42342194
has answer: http://stackoverflow.com/a/26894415
has comment: http://stackoverflow.com/comment/42342229
type: Question

http://stackoverflow.com/comment/42369223
comment on: http://stackoverflow.com/q/26909189
has text: JavaScript cannot access pixel color on purpose. Its considered to be a security issue
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42383049
type: QuestionComment
has text: So you want to communicate this fact to your GCM server? Using GCM?
type: Comment
comment on: http://stackoverflow.com/q/26917064
score: 0

http://stackoverflow.com/comment/42482188
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26973419
type: Comment
has text: Thu Nov 30 1899 00:00:00 GMT+0300

http://stackoverflow.com/comment/42299330
has text: We only need to see one DIV, since they're all the same.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26870173

http://stackoverflow.com/a/26847557
upvote count: 3
has comment: http://stackoverflow.com/comment/42257970
answers question: http://stackoverflow.com/q/26847506
type: Answer
accepted answer of: http://stackoverflow.com/q/26847506
score: 3
downvote count: 0
has body: If you want a client-side/front-end solution then you could use https://github.com/coolbloke1324/jquery-lang-js
has comment: http://stackoverflow.com/comment/42258146
type: AcceptedAnswer

http://stackoverflow.com/q/26885598
has answer: http://stackoverflow.com/a/26885804
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/22116470
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42328642
type: Question
linked to: http://stackoverflow.com/q/12131659
has comment: http://stackoverflow.com/comment/42326067
has answer: http://stackoverflow.com/a/26885849
has comment: http://stackoverflow.com/comment/42325988
has comment: http://stackoverflow.com/comment/42326033
has title: How can i load pages dynamically with angularJS?
answer count: 3
has comment: http://stackoverflow.com/comment/42326226
tagged with: javascript
has comment: http://stackoverflow.com/comment/42326105
has comment: http://stackoverflow.com/comment/42326693
has body: I'm a complete newbie with angularjs. I'm searching for an clear example to call pages with ajax. First question is: How can i make an ajax request? Second question is: I don't want to use ng-click with all links. I can't add ng-click attr to all elements because they are dynamic links. How can i call the function with clicking links between #menu? For example: // Controller var ceoApp = angular.module('ceoApp', []).config(function($interpolateProvider){ $interpolateProvider.startSymbol('{[{').endSymbol('}]}'); }); ceoApp.controller('AjaxLoadCtrl', function(){}); CALL P1 CALL P2 CALL P3 I really don't know what's next now... Any help would be great! To understanding what must be: $('#menu a').click(function(){ $.ajax({ type: 'post', dataType: 'html', url: $(this).attr('href'), success: function(data){ $('#view').html(data); } }); }); Above example loads clicked link's url, and gets response as html and show it in view. I'm exactly asking for this. Sorry for lame question but i need this...
has answer: http://stackoverflow.com/a/26885822
score: 0
tagged with: angularjs

http://stackoverflow.com/comment/42378346
comment on: http://stackoverflow.com/q/26913406
has text: added fade effect option, so it doesn't disappear so abruptly.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/26964666
type: Question
answer count: 2
tagged with: canvas
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/26964748
has title: using canvas to draw rectangle within rectangle?
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has body: I have to use canvas and output rectangles within rectangles (number of rectangles depends on how many I have put in the code) and the rectangles should fit nicely inside the previous one. I'm really lost as to how to center the rectangles and have them fit inside the previous rectangle. I know why my output is the way it is, but I'm not sure where to go from here. This is what I have, any help will be greatly appreciated! Your browser doesn't support the HTML5 canvas tag
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26964721
score: 1
upvote count: 1

http://stackoverflow.com/comment/42362909
has text: And what if the object comes back in an other order?
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/26905858
type: Comment

http://stackoverflow.com/comment/42432395
has text: @Nordenheim We were considering that but it doesn't seem too complicated, the idea of this website is fairly simple actually. just a bit of effort and we could tag team it ourselves.. I hope.
comment on: http://stackoverflow.com/q/26944713
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42503037
score: 0
type: Comment
type: QuestionComment
has text: I don't think there's any difference in code, only thing that I notice is that in official solution you can know right away that trampoline is called with a function, where in your solution, one has to check what are you returning. And on a side note, be careful with this official solutions, avoiding semicolons in javascript might turn out ugly if you don't know this works "under the hood".
comment on: http://stackoverflow.com/q/26983589

http://stackoverflow.com/q/26964171
has body: The idea here is to create a sort of "EULA wall". For some reason, whenever I test this code if I don't have the cookie, it works wonderfully, the EULA pops up, the accept button pops up and the accept button gives me the cookie. However, when I have the cookie, nothing in the actual if part happens. I currently have three "commands" one that would bring up the button again (a visual debug of sorts) one that would pass text to a , and one that would call a function that runs the open.window(); function: Seems bizarre that this sort of thing would happen but maybe I'm just missing something obvious.
tagged with: if-statement
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/42466549
has comment: http://stackoverflow.com/comment/42466470
has title: If statement only working when else is the case
has comment: http://stackoverflow.com/comment/42466338
has comment: http://stackoverflow.com/comment/42466445
has comment: http://stackoverflow.com/comment/42466203
has comment: http://stackoverflow.com/comment/42466312
has comment: http://stackoverflow.com/comment/42466389
has comment: http://stackoverflow.com/comment/42466297
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42466392
has comment: http://stackoverflow.com/comment/42466219
has comment: http://stackoverflow.com/comment/42466588
has comment: http://stackoverflow.com/comment/42466294
type: Question

sidebar
type: Tag
tag name: sidebar
tags question: http://stackoverflow.com/q/26941458

http://stackoverflow.com/q/26971276
tagged with: javascript
tagged with: extjs
has title: Ext.application: Uncaught TypeError: undefined is not a function
upvote count: 1
answer count: 1
downvote count: 0
has body: I am having some issues with my extjs 5 application. I am using Sencha Architect and im running the application on FreeBSD. The error I am getting is Uncaught TypeError: undefined is not a function for 'Ext.application' Here is my code // @require @packageOverrides Ext.Loader.setConfig({ }); Ext.application({ models: [ 'BassSearch', 'BassSearchResult', 'Menu', 'Customer', 'Subscription', 'NetInfo', 'Products', 'AddressSearch', 'AddressAll', 'Interface', 'Phone' ], stores: [ 'SearchStore', 'CustomerStore', 'NetinfoStore', 'InterfaceStore', 'PhoneStore', 'BassMenuStore', 'JsonSubscriptions' ], views: [ 'fSearch', 'searchResult', 'SearchPanel', 'ApplicationPanel', 'MenuPanel', 'MainBass', 'CustomerInfoView' ], controllers: [ 'searchController', 'MenuSubController', 'CustomerInfoController' ], name: 'MyApp', launch: function() { Ext.create('MyApp.view.MainBass'); //load var myCookieVal = document.cookie.indexOf('basssessionid'); if (myCookieVal) { window.location.href="index.html"; } else { var xhReq = new XMLHttpRequest(); var request = 'api/checkSession'; xhReq.open("GET", request, false); xhReq.send(null); var json = JSON.parse(xhReq.responseText); if (!json.success) { window.location.href="index.html"; } } Ext.define('BASSSharedData', {cid: 0}); MyApp.globals = { currentcid: 0, userid: 0, callback: "", subscriptionid: 0, currentView: null }; } }); Any help appriciated. Thanks
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26971949
score: 1
type: Question

http://stackoverflow.com/a/56238418
has body: The solution didn't work for me with TinyMCE 5 and Bootstrap 4. In the end I followed Abdur's link and had to use the remove method. $('#modalOne').on('hide.bs.modal', function () { // scope the selector to the modal so you remove any editor on the page underneath. tinymce.remove('#modalOne textarea'); });
downvote count: 0
upvote count: 8
type: Answer
score: 8
answers question: http://stackoverflow.com/q/26961325

http://stackoverflow.com/comment/42308482
score: 0
type: AnswerComment
has text: You're contradicting yourself. You're saying you're getting data back, but when you log it, nothing shows. Either the function is not being executed at all, or you're not getting data back. Try `console.log('test'`) before the append and see if THAT shows.
type: Comment
comment on: http://stackoverflow.com/a/26874874

http://stackoverflow.com/comment/42274913
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26855002
score: 0
has text: I see now you already tried something. Notice that in mine I use an extra variable `status` and only set the `var data` after the if-clause? That's a little more optimized and less code. **Another thing, very important**: you declare the `var data` inside the if-clause. That's bad practice, always declare your vars before so they always exist, and then inside the if-clause set them to a desired value.

http://stackoverflow.com/a/27579359
score: 7
has comment: http://stackoverflow.com/comment/112050288
upvote count: 7
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/54513456
type: Answer
accepted answer of: http://stackoverflow.com/q/26845101
downvote count: 0
answers question: http://stackoverflow.com/q/26845101
has body: webpack-dev-middleware doesn't output any file. If you want to output real files, you need to use the webpack command outside of express. You can put your webpack config into a seperate file, and refer to that with both your webpack command and require it in your express script to access it.

http://stackoverflow.com/comment/42513422
type: QuestionComment
comment on: http://stackoverflow.com/q/26990942
has text: with blinking border
score: 0
type: Comment

http://stackoverflow.com/q/26938800
has answer: http://stackoverflow.com/a/42254188
has body: I want to track clicks on outbound links and implemented the following code: GA code var trackOutboundLink = function(url) { ga('send', 'event', 'outbound', 'click', url, {'hitCallback': function () { document.location = url; } }); } Links &lt;a class="postLinks" href="&lt;?php if (get_field('source_link')) echo get_field('source_link'); ?&gt;" onclick="trackOutboundLink('&lt;?php if (get_field("source_link")) echo get_field("source_link"); ?&gt;'); return false;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt; target=_blank I add the target=_blank attribute via jQuery based on whether the visitor to the website ticks a checkbox or not (the selection is then stored in a cookie). However, if I choose to open the outbound link in a new window it doesn't work. When ticking the checkbox it does correctly add the target attribute to the link but when I click on the link it opens it in the same window. Links with target attribute &lt;a class="postLinks" href="&lt;?php if (get_field('source_link')) echo get_field('source_link'); ?&gt;" onclick="trackOutboundLink('&lt;?php if (get_field("source_link")) echo get_field("source_link"); ?&gt;'); return false;" target="_blank"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt; Any idea?
tagged with: outbound
upvote count: 7
has title: target=_blank doesn't work with GA outbound link tracking
tagged with: google-analytics
possible better answer: http://stackoverflow.com/a/42254188
has answer: http://stackoverflow.com/a/35201868
has answer: http://stackoverflow.com/a/26939582
has answer: http://stackoverflow.com/a/36528414
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/45279639
tagged with: javascript
tagged with: jquery
favorite count: 0
type: Question
accepted answer: http://stackoverflow.com/a/26939582
tagged with: event-tracking
score: 7
answer count: 6
has answer: http://stackoverflow.com/a/35247001

http://stackoverflow.com/a/65495609
has comment: http://stackoverflow.com/comment/116929688
has comment: http://stackoverflow.com/comment/116931225
has comment: http://stackoverflow.com/comment/116908771
downvote count: 3
answers question: http://stackoverflow.com/q/26946235
has body: If you would like to monitor the changes each time there is a keystroke on the keyboard. const textarea = document.querySelector(`#string`) textarea.addEventListener("keydown", (e) =>{ console.log('test') })
upvote count: 0
has comment: http://stackoverflow.com/comment/116929669
has comment: http://stackoverflow.com/comment/116929823
score: -3
type: Answer

http://stackoverflow.com/a/26938636
score: 4
accepted answer of: http://stackoverflow.com/q/26938557
upvote count: 4
has body: Object.keys(dict).map(function(k){ return dict[k]; }).join(',');
answers question: http://stackoverflow.com/q/26938557
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/130714343

http://stackoverflow.com/comment/42241596
comment on: http://stackoverflow.com/a/26836872
type: Comment
has text: Your function is still failing on the empty array.
score: 1
type: AnswerComment

http://stackoverflow.com/q/26866708
tagged with: masonry
has answer: http://stackoverflow.com/a/26928039
has answer: http://stackoverflow.com/a/26916186
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26922811
has comment: http://stackoverflow.com/comment/42387960
type: Question
has answer: http://stackoverflow.com/a/26867414
has comment: http://stackoverflow.com/comment/42379348
linked to: http://stackoverflow.com/q/7971258
score: 7
has answer: http://stackoverflow.com/a/26990630
favorite count: 0
has comment: http://stackoverflow.com/comment/42384452
has answer: http://stackoverflow.com/a/27011351
has comment: http://stackoverflow.com/comment/42379366
has answer: http://stackoverflow.com/a/27020391
has answer: http://stackoverflow.com/a/27014110
has comment: http://stackoverflow.com/comment/42383194
tagged with: css
has answer: http://stackoverflow.com/a/27033894
answer count: 9
downvote count: 3
has comment: http://stackoverflow.com/comment/42383569
has body: I'm creating a 2 column masonry layout using images of different sizes. The images can be any size as long as they have the greatest common divisor (as required by the Masonry plugin). In order to make the layout responsive I'm converting the width of the masonry items into percent (or I can use min-width and width 100%). Update: I noticed that many who answer make both columns 50% as a solution. That works but is not the goal. Images have to retain their original image size. They can shrink but keep the same ratio. $(function () { var container = $('#container'); // Convert .box width from pixels to percent $('.box').find('img').each(function () { var percent = ($(this).width()) / container.width() * 100 //convert to percent; $(this).closest('.box').css('max-width', percent + '%'); }); // Trigger masonry container.masonry({ itemSelector: '.box', columnWidth: 1 //widths dividable by 1 }); }); jsfiffle: http://jsfiddle.net/AMLqg/278/ This seems to work. The items are fluid when you resize the window. However if you load the script in a small window size (smaller than the 2 column width) the items collapse. How can I keep the masonry items responsive on window load even when the window is smaller? Update: Here is more info for a better understanding. I'm trying to keep 2 responsive columns regardless of the window size. The columns can't have equal widths because the images have different widths. For this reason I'm using columnWidth: 1 because all widths are dividable by 1. Please see images below for examples. Problem: When you open the page in a small window the elements are collapsed. When you resize the window to be larger the elements remain collapsed until the window width is larger than the width of both elements. Goal: I'm trying to keep the elements in 2 responsive columns on load like in the image below. Currently they remain responsive if on load the window is large and you resize it to be smaller but not vice verse when window is small on load and you mak…
has title: Responsive Masonry layout without predefined widths
upvote count: 10
has comment: http://stackoverflow.com/comment/42383235
has comment: http://stackoverflow.com/comment/42383692
tagged with: jquery-masonry

http://stackoverflow.com/q/26953251
answer count: 2
accepted answer: http://stackoverflow.com/a/26953431
score: 1
favorite count: 0
upvote count: 1
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42446983
tagged with: mysql
has comment: http://stackoverflow.com/comment/42447302
type: Question
downvote count: 0
has body: I have these scripts: &lt;? /*//Disable error reporting error_reporting(0); */ //Report runtime errors //error_reporting(E_ERROR | E_WARNING | E_PARSE); //Report all errors error_reporting(E_ALL); //end of error reporting ?&gt; &lt;html&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt; &lt;head&gt; &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ $('select').on('change', function(e){ var selected_value = $(this).val(); var option_data = $(this).children('option[value="'+selected_value+'"]'); // get data values var visanumber = option_data.data('visanumber'); var idnumber = option_data.data('idnumber'); var statusapp = option_data.data('statusapp'); var subdate = option_data.data('subdate'); // the photo var accntvisaphotopath = option_data.data('accntvisaphotopath'); if(accntvisaphotopath == 'data-passport=') { $(this).closest('td').siblings().find('img.accntVisaPhotoPath').attr('src', 'accntvisaphotopath'); $(this).closest('td').siblings().find('img.passportPath').attr('src', 'passportpath'); } else { $(this).closest('td').siblings().find('img.passportPath').attr('src', 'passportpath'); $(this).closest('td').siblings().find('img.accntVisaPhotoPath').attr('src', 'accntvisaphotopath'); } // set the values $(this).closest('td').siblings().find('span.visanumber').text(visanumber); $(this).closest('td').siblings().find('span.idnumber').text(idnumber); $(this).closest('td').siblings().find('span.statusapp').text(statusapp); $(this).closest('td').siblings().find('span.subdate').text(subdate); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;? $con=mysqli_connect("localhost","xxx","xxxx","xxxx"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL:" . mysqli_connect_error(); } $result = mysqli_query($con, "SELECT * FROM visa ORDER BY idvisa"); ?&gt; &lt;div align="center"&gt; &lt;form name="contractIn…
tagged with: javascript
has answer: http://stackoverflow.com/a/26953431
has comment: http://stackoverflow.com/comment/42446957
possible better answer: http://stackoverflow.com/a/26953389
has answer: http://stackoverflow.com/a/26953389
has title: img by changing it's src and is drawn by a dynamically provided source (mysql and php) with a Javascript

http://stackoverflow.com/q/26990493
tagged with: jquery
answer count: 2
has title: How to move/position DIV container by changing CSS values using Javascript?
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26990673
has comment: http://stackoverflow.com/comment/42512719
has answer: http://stackoverflow.com/a/26990835
has body: I got two div containers as blocks with some fixed width and maybe height and display: block; &lt;div class="one"&gt;&lt;/div&gt; &lt;div class="two"&gt;&lt;/div&gt; When you hover your mouse over container .one I need somehow to apply margin-top (or padding-top) to container .two so it moves couple pixels below while mouse is over .one and when you move mouse pointer aside, .two comes back to it's original position.
accepted answer: http://stackoverflow.com/a/26990673
possible better answer: http://stackoverflow.com/a/26990835
tagged with: css
type: AnsweredQuestion
score: 0
type: Question
has comment: http://stackoverflow.com/comment/42512559
tagged with: javascript

http://stackoverflow.com/a/26975963
downvote count: 0
type: AcceptedAnswer
type: Answer
has body: Previously you were sending the user's browser to someone else's website. They were leaving your site and all was fine. Now you are trying to write JavaScript to instruct your visitor's browser to fetch data from someone else's website (which would use any auth/authz credentials they had) and give that data to your code. Since the other website could be, for example, an online bank, this is forbidden unless the site you are requesting the data from gives explicit permission for you to access it. For further reading, see the Same Origin Policy and HTTP access control (CORS).
accepted answer of: http://stackoverflow.com/q/26975871
score: 7
answers question: http://stackoverflow.com/q/26975871
upvote count: 7

http://stackoverflow.com/comment/42453449
has text: @Carpetsmoker This is fraction; infinite number is hyperreal number. (Which can't really represent like this.)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26951407

http://stackoverflow.com/a/26852705
answers question: http://stackoverflow.com/q/26852651
upvote count: 5
score: 5
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: Viewport = { rotate: function () { var that = this; setTimeout(function () { that.startRotate(); }, 1000); } startRotate: function () { console.log('in') } }
accepted answer of: http://stackoverflow.com/q/26852651

http://stackoverflow.com/comment/42321764
has text: It sounds like you are calling the action with an html request.
type: AnswerComment
comment on: http://stackoverflow.com/a/26866338
score: 0
type: Comment

country
tag name: country
type: Tag
tags question: http://stackoverflow.com/q/26978790

http://stackoverflow.com/comment/139735257
type: AnswerComment
score: 0
type: Comment
has text: solve this flaw by using this answer: https://stackoverflow.com/a/64665817/4526479
comment on: http://stackoverflow.com/a/26951160

http://stackoverflow.com/a/26865554
answers question: http://stackoverflow.com/q/26865391
type: Answer
accepted answer of: http://stackoverflow.com/q/26865391
has body: You can use location.href to redirect the page. getElementById() gets the element with id inside the paranthesis from the page for getting or setting the current value. function myFunction() { var uri = "https://webpage.com/submit.do?firstName=Ždžrgr&amp;lastName=Žrđredj&amp;phone=(24324) 09942&amp;email=email@email.net"; var res = encodeURI(uri); location.href = res; }
score: 0
type: AcceptedAnswer

http://stackoverflow.com/a/26941019
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26940074
type: Answer
accepted answer of: http://stackoverflow.com/q/26940074
score: 0
has body: Js: $(function () { var obj = $(' ').attr({ 'class': 'video-js vjs-default-skin', 'width': '640px', 'height': '464', 'controls': ' ', 'poster': 'http://video-js.zencoder.com/oceans-clip.jpg', 'preload': 'auto', 'data-setup': '{}' }), source = $(' ').attr({ 'type': 'video/mp4' }); $('#btnCreateVideo').on('click', function () { var videoCloned = obj.clone().append(source.clone().attr('src', 'http://video-js.zencoder.com/oceans-clip.mp4')); console.dir(videoCloned); $('#content').append(videoCloned); videojs(videoCloned[0], {}, function() { console.log('done'); }); }); }); html: Create Video That happened because in the documentation of the page they recommend to use :videojs(). And the object that you want to apply dynamically.

http://stackoverflow.com/comment/42310536
has text: As for attempting to assign a default value like that, you'll need to do all that inside the function declaration itself, cant do `function select($this = $that) {}`.
type: AnswerComment
comment on: http://stackoverflow.com/a/26876510
score: 0
type: Comment

http://stackoverflow.com/q/26883966
tagged with: javascript
type: Question
has title: How to make automatic load popover after pages loaded without using click, hover, focus?
has body: I'm using Bootstrap3 and I want to create popover to show in on pages or document has loaded then show popover on the each html element without using hover,click, focus But it worn't work as what I want. And How can I create disable button on popover when popover pop up after pages loaded which easy for me click hide pop up back? here is html element <a data-toggle="popover" href="<?php echo base_url('invoice/edit');?>"> Received Date what should I correct with those above code? Please help
tagged with: twitter-bootstrap-3
tagged with: twitter-bootstrap
answer count: 1
score: 0
has answer: http://stackoverflow.com/a/26884064
accepted answer: http://stackoverflow.com/a/26884064
type: AnsweredQuestion

http://stackoverflow.com/q/26882141
answer count: 0
type: UnansweredQuestion
has title: how to trigger the image in ember with handlebars
tagged with: handlebars.js
has comment: http://stackoverflow.com/comment/42363607
has comment: http://stackoverflow.com/comment/42320766
has body: Hello I want to appear the image from code i wrote below but i cant. Any ideas? I googled and i found that i must use a helper function. (template) showallapps.hbs {{#if getappsexist}} {{#each app in getapp}} {{#each app.app_files}} {{#link-to "dashboard" app}} &lt;img {{bind-attr src=get_url}} class="img-responsive"&gt; {{/link-to}} {{/each}} {{#link-to "dashboard" app}} {{app.app_name}} {{/link-to}} (controller) showallapps.js import Ember from 'ember'; export default Ember.ObjectController.extend({ apps:[], getappsexist: function () { var appsexist = false; if (this.store.all('userapp').content.length &gt; 0) { appsexist = true; } return appsexist; }.property(), getapp: function () { this.apps = this.store.all('userapp'); return this.apps; }.property(), get_url: function (){ var url = 'http://' + JSON.parse(this.apps.content[2]._data.app_files).url; return url; }.property() }); I have this json. { "userapp": [ { }, { "app_files": "{"url":"static.xxx.xxx/data/application/3911efd9-413a-11e1-b5e9-fbed80c8f6ba/eleutheris_epilogis.jpg","mime":"image/jpeg","name":"eleutheris epilogis.jpg"}" } ] } I get these errors: Uncaught Error: Assertion Failed: The value that #each loops over must be an Array. You passed {"url":"static.xxx.xxx/data/application/3911efd9-413a-11e1-b5e9-fbed80c8f6ba/eleutheris_epilogis.jpg","mime":"image/jpeg","name":"eleutheris epilogis.jpg"}
has comment: http://stackoverflow.com/comment/42325885
has comment: http://stackoverflow.com/comment/42326031
has comment: http://stackoverflow.com/comment/42326991
tagged with: image
type: Question
has comment: http://stackoverflow.com/comment/42336512
has comment: http://stackoverflow.com/comment/42326390
tagged with: javascript
has comment: http://stackoverflow.com/comment/42336453
score: 0
has comment: http://stackoverflow.com/comment/42328859
has comment: http://stackoverflow.com/comment/42326326
has comment: http://stackoverflow.com/comment/42336614
tagged with: ember.js
has comment: http://stackoverflow.com/comment/42321676
has comment: http://stackoverflow.com/comment/42327733
tagged with: ember-cli

http://stackoverflow.com/a/26873179
type: Answer
score: 0
has body: I'm assuming you've got a function like the following: function showTab(tabNumber) { ... } In order to get the value after the hash mark, you just use this code: var current = window.location.hash.substr(1); Then you can simply pass current to your function: showTab(current);
answers question: http://stackoverflow.com/q/26873134

http://stackoverflow.com/comment/42356645
comment on: http://stackoverflow.com/a/26902058
type: AnswerComment
has text: I m really Newbie. i found .apk file and i extract it. using apktool. but this source code many error. and R.java not found in source code. so only ids in Mainactivity.java How solve this problem.
score: 0
type: Comment

http://stackoverflow.com/comment/42451417
has text: Tip: Use a ISO string when validating the date when it reaches the server.
score: 2
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26955864

http://stackoverflow.com/comment/42266600
has text: @user2485710 Node's streams center around Buffers, which are its way of representing byte strings/arrays/etc. It allows Strings as well because they can easily be converted to Buffers -- `if (typeof chunk === 'string') chunk = new Buffer(chunk);`.
score: 2
comment on: http://stackoverflow.com/a/26851940
type: AnswerComment
type: Comment

http://stackoverflow.com/q/26914745
accepted answer: http://stackoverflow.com/a/26916031
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/26916031
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has title: Swing animation to different parts of page
has body: I am trying to use a swing animation to href to certain parts of my page. However I am not sure what to put to refer to the correct sections of my HTML. I think the best thing to do would be to select the href id that my a tag is referring to. I am open to new approaches jQuery: $("li a").each(function() { $(this).on("click", function() { var mode = "swing"; $('html, body').animate({ scrollTop: $(/*HERE*/).offset().top }, 750, mode); }); }) HTML: About Services Portfolio Contact ABOUT SERVICES PORTFOLIO CONTACT
type: Question

http://stackoverflow.com/comment/42455778
score: 0
comment on: http://stackoverflow.com/q/26958164
type: Comment
type: QuestionComment
has text: @Aravind how would I return the functions along with this as an object??

http://stackoverflow.com/a/26940576
type: Answer
answers question: http://stackoverflow.com/q/26940118
score: 2
accepted answer of: http://stackoverflow.com/q/26940118
downvote count: 0
has body: You've got two myControllers there. Each will have their own scope and not a common one. The usual solution is to use a service for the common data which can be injected into the controller.
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/comment/42377232
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/26911093
type: Comment
has text: @MatthewJamesDavis, a possible case would be the one in the reset function, where I set a completely new object: `itemContainer({items: ko.observableArray(["item x", "item y"])})`; The JsFiddles I used are a "simplified" scenario of what I am working on, so the examples may not directly make sense, but the above snippet is the problematic one I want to make working. In addition, it is possible to only alter the observable array - I mean I should support both

http://stackoverflow.com/a/26953907
accepted answer of: http://stackoverflow.com/q/26953862
type: Answer
answers question: http://stackoverflow.com/q/26953862
has comment: http://stackoverflow.com/comment/42465385
has body: replace .clearBtn show { left: -15px; } to .show { left: -15px; } in the css JSFiddle
upvote count: 1
downvote count: 0
type: AcceptedAnswer
score: 1

http://stackoverflow.com/comment/42415871
has text: You have both class="img-rounded" and class="img-responsive center-block" in your img tag. needs to be just one, class="img-rounded img-responsive center-block"
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26935221
type: Comment

http://stackoverflow.com/q/26883915
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/38992063
tagged with: google-chrome-extension
has title: Google Chrome extension alarm at specific time
favorite count: 0
has comment: http://stackoverflow.com/comment/42338612
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42338596
score: 3
has body: Good morning dear developers, I am developing a small Google Chrome Extention but I am not sure if this is the right way. Maybe I am a bit confused with all the background pages, event paes, content scripts and so on. What is this extension going to do? Alarm: Manipulate the current opened tabs CSS and play a sound. The time is always the same (wether you in America or Europe or wherever). This is not the main thing. I used this kind of "architecture" with a similar extention but there I had to do something active (clicks etc.). This extention here is totally in the background. { "manifest_version": 2, "version": "0.1", "name": "Alarm whatever", "permissions": ["alarms"], "icons": { "16": "icon.png", "48": "icon.png", "128": "icon.png" }, "content_scripts": [{ "js": ["jquery.js", "script.js"], "matches": ["http://*/*", "https://*/*"] }], "background": { "scripts": [ "background.js" ], "persistent": false } } background.js // When to ring var now = new Date(), minutes = 50, seconds = 0; var timestamp = new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), minutes, seconds); var whenToRing = (timestamp.getTime() - now.getTime()); chrome.runtime.onMessage.addListener(function(request, sender, sendResponse){ if(request.action == 'createAlarm') { // Create chrome.alarms.create('theAlarm', { // Wann soll der Alarm gefeuert werden? // Angabe in Millisekunden when: whenToRing, }); } }); chrome.alarms.onAlarm.addListener(function(alarm) { if (alarm.name === 'theAlarm') { // send a message to the script.js to manipulate the CSS and play sound chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { chrome.tabs.sendMessage(tabs[0].id, {action: 'doAlarm'}) }); } }); script.js $(document).ready(function() { chrome.runtime.sendMessage({action: 'createAlarm'}); chrome.runtime.onMessage.addListener( function(resp, sender, sendResponse) { if(resp.action == 'doAlarm') { // CSS and SOUND here } }); }); I've shortened the CSS and Sound. The time is s…
upvote count: 3
has comment: http://stackoverflow.com/comment/42386225
tagged with: google-chrome

http://stackoverflow.com/comment/42399728
type: QuestionComment
has text: And asked the same question here as well! http://stackoverflow.com/questions/26908285/how-to-get-a-value-from-specificed-key/26908915#26908915
type: Comment
comment on: http://stackoverflow.com/q/26922957
score: 0

specifications
type: Tag
tags question: http://stackoverflow.com/q/26845108
tag name: specifications

http://stackoverflow.com/comment/42460268
score: 0
type: AnswerComment
type: Comment
has text: Thank you so much for pointing it out. I did exactly what you said and its working now. 1+ and I accept the answer.
comment on: http://stackoverflow.com/a/26960943

http://stackoverflow.com/q/26966833
has answer: http://stackoverflow.com/a/26966975
has answer: http://stackoverflow.com/a/26966915
answer count: 3
has title: How do you create variables to open up the same type of div?
tagged with: variables
accepted answer: http://stackoverflow.com/a/26966975
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/26966881
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26966881
type: Question
tagged with: javascript
has body: I am making a website that displays profiles of people. Each person is designated a svg button and when that button is clicked, a pop up displays that persons information. I have this jquery function: $('.button1').click(function() { $('.person1-profile').fadeIn(); }); $('.button1-exit').click(function() { $('.person1-profile').fadeOut(); }); $('.button2').click(function() { $('.person2-profile').fadeIn(); }); $('.button2-exit').click(function() { $('.person2-profile').fadeOut(); }); $('.button3').click(function() { $('.person3-profile').fadeIn(); }); $('.button3-exit').click(function() { $('.person3-profile').fadeOut(); }); I'm wondering if it is possible to do this with Javascript so that it significantly shortens the coding, and rather than copy &amp; pasting that code every time for each person, if variables can be made for people/profile and so it would be something like: $('var person + button').click(function() { $('var person + profile').fadeIn(); }); $('var button + exit').click(function() { $('var person + profile').fadeOut(); }); Thank you I really appreciate it! Sorry if it is unclear.
score: 0

http://stackoverflow.com/comment/42474019
score: 0
comment on: http://stackoverflow.com/q/26968545
type: Comment
type: QuestionComment
has text: Please include all the relevant code in your question when asking.

http://stackoverflow.com/q/26923627
score: 0
has body: I want a concise expression to tell me if a given value is an integer or float. When provided the input value NaN or Infinity, I want the output value to be false, so this rules out simply checking whether typeof(val) == 'number' Desired input / output: 1 => true -42 => true 3.14 => true NaN => false Infinity => false null => false undefined => false isFinite() is almost perfect, but there's one gotcha: isFinite(null) returns true, when I actually want it to return false. Short of always checking if ((val != nul) &amp;&amp; isFinite(val)), is there another more concise technique?
type: Question
linked to: http://stackoverflow.com/q/18082
has comment: http://stackoverflow.com/comment/42394487
answer count: 1
has comment: http://stackoverflow.com/comment/42394418
tagged with: javascript
has title: What's the most concise way to check for an integer or float in JavaScript?
duplicate of: http://stackoverflow.com/q/18082
has answer: http://stackoverflow.com/a/26923761
tagged with: types
accepted answer: http://stackoverflow.com/a/26923761
has comment: http://stackoverflow.com/comment/42394400
has comment: http://stackoverflow.com/comment/42394417
type: AnsweredQuestion

http://stackoverflow.com/q/26953495
favorite count: 0
has title: Angular: object structure best practice
tagged with: angularjs
tagged with: javascript-objects
type: AnsweredQuestion
score: 3
downvote count: 0
type: Question
has body: I'm working in Angular, currently focusing on filtering a nested object. Here is the structure of my object: $scope.subjectBin = { "Faculty of Engineering": { "ECE": [{&lt;course-object&gt;},{&lt;course-object&gt;}], "CHEM: [{&lt;course-object&gt;}] }, "Faculty of Science": { "BIOL: [{&lt;course-object&gt;},...], ... }, ... } As I work with filtering this object, build new features, and render this in a layered accordion, I'm thinking I should change the design of this object. Someone suggested to change the object to the following: $scope.subjectBin = [{ faculty: "Faculty of Engineering", subjects: [{ subjectName: "ECE", courses: [{&lt;course-object&gt;},{&lt;course-object&gt;}] }, ... ] }, { faculty: "Faculty of Science", subjects: [{ subjectBin: "CMPUT", courses: [{&lt;course-object&gt;},...] }, ... ] }] I was told this layout is better because: "it doesn't use objects as keymaps and it follows a pattern". I agree that it's better but would like some clarification on object layout, in general. What are best practices for laying out nested objects? Are array-based objects with fixed key-names preferable?
tagged with: javascript
upvote count: 3
has answer: http://stackoverflow.com/a/28680112
answer count: 1
accepted answer: http://stackoverflow.com/a/28680112

http://stackoverflow.com/comment/42341362
type: QuestionComment
has text: Seems to work fine: http://jsfiddle.net/fiddleyetu/og8x2tcd/
comment on: http://stackoverflow.com/q/26893517
score: 0
type: Comment

http://stackoverflow.com/a/26983474
has comment: http://stackoverflow.com/comment/42501421
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/26982809
has comment: http://stackoverflow.com/comment/42501170
has body: How about refactoring your javascript function as follows? Open Tutorial Code Behind: protected void Page_Load(object sender, EventArgs e) { //code to check if this is the first time ..... // it this is the first time, call this function Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "OpenTutorial()", true); } EDIT: Updating the OpenTutorial function to start a lightbox as opposed to opening the link
has comment: http://stackoverflow.com/comment/42501341
score: 1
has comment: http://stackoverflow.com/comment/42501909
upvote count: 1

http://stackoverflow.com/q/26989798
type: UnansweredQuestion
tagged with: encryption
has answer: http://stackoverflow.com/a/27758480
type: Question
tagged with: ios
tagged with: javascript
score: 0
tagged with: javascriptcore
answer count: 1
tagged with: objective-c
has title: ARC4 Encryption through javascript in iOS
has body: I am not getting any result after writing this code.It returns only blank. [self.webview loadHTMLString:@"&lt;script src=\"http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/rc4.js\"&gt;&lt;/script&gt;" baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] resourcePath]]]; NSString *function = [[NSString alloc] initWithFormat: @"CryptoJS.RC4.encrypt(%@, %@)",@"abhijit",@"TestKey"]; NSString *result = [self.webview stringByEvaluatingJavaScriptFromString:function]; NSLog(@"----%@",result); Is there are some mistake in implementation on this or anything else?Please suggest.. Trying to implement this http://uttool.com/encryption/RC4/default.aspx in ios app

http://stackoverflow.com/comment/42372158
has text: 1, 2, 3 - No. 4, 5, 6 - Ask this on [codereview.se]. 7 - Yes. 8 - I think they can be set externally; but I'm not sure. 9 - Yes.
comment on: http://stackoverflow.com/q/26911210
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/52671518
score: 0
type: AnswerComment
has text: and how can I pass this into my angular controller after rendering the new page?
comment on: http://stackoverflow.com/a/26856677
type: Comment

http://stackoverflow.com/a/26915112
has body: I made it this way(jsfiddle) now. Maby could someone have a look at it. I have took all forms in one file. So I do not need three diffrent files and have to load them into it. $(document).ready(function(){ $("#form_1").hide(); $("#form_2").hide(); $("#choice_btn").click(function(){ if ( $("#choice").val() == "joboffers" ){ $("#form_2").hide(); $("#form_1").show(); }else{ $("#form_1").hide(); $("#form_2").show(); } }) $("#j_date").datepicker(); $("#w_date").datepicker(); });
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26892584

http://stackoverflow.com/a/26898082
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42349734
downvote count: 0
has comment: http://stackoverflow.com/comment/42351420
has comment: http://stackoverflow.com/comment/42352214
type: Answer
has comment: http://stackoverflow.com/comment/42350263
upvote count: 3
has body: This is probably a cross-domain issue. Note that http://www.w3schools.com/website/Customers_JSON.php has the Access-Control-Allow-Origin: * response header and http://fingerzeig.ch/api/agenda/list does not. $ curl -I "http://www.w3schools.com/website/Customers_JSON.php" If you're making a cross-domain request you have to deal with CORS.
score: 3
answers question: http://stackoverflow.com/q/26897975
accepted answer of: http://stackoverflow.com/q/26897975

http://stackoverflow.com/q/26836519
tagged with: http://stackoverflow.com/tag/html
score: -2
has comment: http://stackoverflow.com/comment/42238741
has answer: http://stackoverflow.com/a/26836766
has comment: http://stackoverflow.com/comment/42238823
has comment: http://stackoverflow.com/comment/42238742
answer count: 2
downvote count: 2
has comment: http://stackoverflow.com/comment/42238878
has comment: http://stackoverflow.com/comment/42238804
has comment: http://stackoverflow.com/comment/42238916
has title: How do I change an if statement to accept string instead of integer
has comment: http://stackoverflow.com/comment/42238753
possible better answer: http://stackoverflow.com/a/26836771
accepted answer: http://stackoverflow.com/a/26836766
has comment: http://stackoverflow.com/comment/42238777
has answer: http://stackoverflow.com/a/26836771
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/42238855
has comment: http://stackoverflow.com/comment/42239107
tagged with: javascript
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/42238980
has body: I cant find a way to change this statement to accept a string value instead of a integer. I am building a shopping cart and I need to use the carts total value and multiply it using a decimal (based on the sum of the total value) the pricerange and decimals are below. If you know how to edit below to accept a string. Or take a look at codepen if you can find a way to have rateValue use this string >>> grandTotal = (((salesTotal-discount12) * (0.13)) + (salesTotal-discount12)) var chartValue; var rateValue = rateValue = grandTotal; var priceRange = [ 1000, 2500, 5000, 10000, 15000, 50000 ]; var priceValue = [ 0.02301, 0.01224, 0.02040, 0.01992, 0.01980,0.01980]; for(range in priceRange) if (rateValue &gt;= priceRange[range]) chartValue = priceValue[range];

http://stackoverflow.com/a/26951310
has body: you're trying to find the maximum of the array data.Jim which only has one element = {"Value" : [10,11,12]} which d3 promptly returns as the maximum using your given accessor function. Try changing your code to the following: var myMax = d3.max(data.Jim, function(d){ var maxVal = d3.max(d["Value"]); return maxVal; })
score: 1
accepted answer of: http://stackoverflow.com/q/26951208
has comment: http://stackoverflow.com/comment/42446474
upvote count: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26951208
type: Answer

http://stackoverflow.com/comment/42443873
has text: Then how does the form know where to submit the data too?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/26951503
type: Comment

http://stackoverflow.com/q/26849146
favorite count: 0
tagged with: google-maps-api-3
has body: We're seeing an issue where the PlacesService's textSearch is not returning any results for the "Strood Station Car Park, Rochester", whereas the Autocomplete is. I've created this JS Fiddle that shows the demonstrates this behavior: http://jsfiddle.net/anero/b5jh56gy/6/ Is there a way to have a consistent result set for both API calls? var client = new google.maps.places.PlacesService($("#google-attributions")[0]); var query = "Strood Station Car Park, Rochester"; var textSearchRequest = { query: query }; client.textSearch(textSearchRequest, function (response, status) { if (status === google.maps.GeocoderStatus.OK &amp;&amp; response.length &gt; 0) { alert('Found place!'); } else { alert('Did not find place!'); } });
tagged with: google-places
tagged with: google-places-api
downvote count: 0
answer count: 0
type: UnansweredQuestion
type: Question
score: 1
has title: PlacesService's text search not consistent with Autocomplete
upvote count: 1
tagged with: javascript

http://stackoverflow.com/q/26973439
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/26973965
upvote count: 0
has body: $.get('http://www.roblox.com/', function(data) { $(data).find('.member-name-container').children('[title]').each(function() { console.log( $(this ).text() ); }); }); I'm trying to get it to find the on this piece of code in HTML. Here is what I'm trying to find the title of; DeltaAddict How would I make it print out the title="DeltaAddict"?
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/26973534
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
downvote count: 1
has title: jQuery/JavaScript inquiry about title attribute?
score: -1

http://stackoverflow.com/q/26861732
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/26861771
has body: I am a newbie in regular expressions. I have a problem with this one. I need to add chars from addons variable as allowed characters to the next regex re. var addons = '_-'; re = new RegExp(/^[a-zA-Z]+$/i); console.log('match a', re.test('a')); console.log('match a_', re.test('a_')); console.log('no match 9', re.test('9')); console.log('no match 9_', re.test('9_')); Any suggestions? Thanks.
tagged with: regex
score: 0
accepted answer: http://stackoverflow.com/a/26861771
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42283790
has title: Part of RegExp pattern from variable

http://stackoverflow.com/a/26968681
answers question: http://stackoverflow.com/q/26842804
type: Answer
has body: Turns out I used the link posted by @Vivasaayi, however I did it with a slight twist. Instead of using an Iframe I used a regular a href. PHP-file is unchanged. Javascript var downloadLinkID = 'hiddenDownloadLink', downloadHref = document.getElementById(downloadLinkID); if (downloadHref === null) { downloadHref = document.createElement('a'); downloadHref.id = downloadLinkID; downloadHref.setAttribute('href', postUrl + params); downloadHref.setAttribute('onclick', firefoxDownload(postUrl + params)); // FF/IE must have onclick event to make link clickable downloadHref.click(); } function firefoxDownload(url) { window.location.href = url; //Needed for FF/IE to force download of file }
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26842804

http://stackoverflow.com/a/26940590
upvote count: 2
type: Answer
score: 2
has body: Your code seems to work fine in IE10+ The problem with IE9 (or compatibility mode maybe?) is that it parses SVG using "old" document mode when it receives it using ajax. You could try to workaround it like that. Maybe there is a better way, not sure. var svg = new XMLHttpRequest(); svg.open("GET", "image.svg", false); svg.send(); // svgResult = svg.responseXML; &lt;&lt;&lt;&lt; this seems to be the problem // begin of workaround var svgText = svg.responseText; parser = new DOMParser(); var svgResult = parser.parseFromString(svgText, "text/xml"); // end of workaround var theSVG = svgResult.getElementsByTagName('svg')[0]; titleElement = document.createElementNS('http://www.w3.org/2000/svg', 'title'), titleContent = document.createTextNode("The &lt;title&gt; text"); titleElement.appendChild(titleContent); theSVG.insertBefore(titleElement, theSVG.firstChild);
answers question: http://stackoverflow.com/q/26939183
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26939183

http://stackoverflow.com/q/26947703
has body: Hi I'm trying to work on a problem solving webpage that I need for school but so far I'm stuck with the if statement which it will use to calculate. What I have so far. &lt;script&gt; var randomNumberA = Math.round((Math.random() * 50) +1) var randomNumberB = Math.round((Math.random() * 50) +1) document.write('He runs at ' + randomNumberA + 'm/s which took him ' + randomNumberB + 's. How far did he run?'); var distance = randomNumberA * randomNumberB function Submit() { var answer = document.getElementById('answer') if(distance == true){ alert("Congrats! You got it right!"); } else{ alert("Try again!"); location.reload(); } } &lt;/script&gt; &lt;body&gt; &lt;input type='text' id='inputAnswer'/&gt; &lt;input type='button' onClick='Submit()' value='Submit'/&gt; &lt;/body&gt; It's not really working and if I put only one "=" then it'll alert as true as long as there's a value in the text box. I plan to make a variable for the textbox value and a variable for the formula and just put If(var1=var2)... so on, but it doesn't work. I'd like to know if it's possible, and if it is how? If it's not possible can I try to place var1 = formula = textbox id. I'm trying to make it so one variable contains the values that need to be equal so when I declare it in the if statement, I'll just test if it's true or false. All help is appreciated thanks!
accepted answer: http://stackoverflow.com/a/26947742
favorite count: 0
has title: Can I put a variable = another variable in if statements. Or put var = value = another value which it should be equal to?
has comment: http://stackoverflow.com/comment/42437244
has comment: http://stackoverflow.com/comment/42437280
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26947785
score: -1
has comment: http://stackoverflow.com/comment/42437395
type: Question
has answer: http://stackoverflow.com/a/26947742
answer count: 2
upvote count: 0
possible better answer: http://stackoverflow.com/a/26947785
tagged with: javascript

http://stackoverflow.com/a/26882344
downvote count: 0
has comment: http://stackoverflow.com/comment/42336566
accepted answer of: http://stackoverflow.com/q/26882252
answers question: http://stackoverflow.com/q/26882252
upvote count: 2
has comment: http://stackoverflow.com/comment/42343733
has comment: http://stackoverflow.com/comment/42335547
type: AcceptedAnswer
type: Answer
score: 2
has body: You can't tell if the wine doesn't exist until you get through the whole loop. Use a variable to tell if you found the wine. var dataHent = { wines: [{ catalog: "aaa" }, { catalog: "bbb" }, { catalog: "ccc" }] }; function slettVin() { var slettInput = document.getElementById('slettInput'); var slettInput_v = slettInput.value; var wine_found = false; for (wine = 0; wine < dataHent.wines.length; wine++) { if (dataHent.wines[wine].catalog == slettInput_v) { dataHent.wines.splice(wine, 1); alert("Wine found, sending AJAX"); slettInput.value = ''; wine_found = true; break; } } if (!wine_found) { alert('This wine doesnt exist'); } } Click
has comment: http://stackoverflow.com/comment/42336336

http://stackoverflow.com/q/26917753
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/26917881
has body: I am using jQuery Mobile's collapsible box, and I would like to use the alternate, black icon color for the collapse's header. This is easy to achieve by applying the ui-alt-icon class. My problem is, I then want to use the regular, white icons within the collapsible box, on some buttons. Because the ui-alt-icon is applied to the collapsible wrapper, everything inside the collapsible is also getting the alternate, black icons. I can't seem to figure out how to tell the buttons inside the collapsible to go back to using the regular icons. Collapse Header Press Me I thought maybe adding the class ui-icon to the buttons would override the ui-alt-icon, but that didn't seem to work. Can I turn the children of the ui-alt-icon wrapper back into a regular icon? I'd like to do it within the framework, and without having to resort to CSS overrides.
has title: jQM - Possible to revert back to a regular icon within a ui-alt-icon wrapper?
type: AnsweredQuestion
type: Question
tagged with: jquery-mobile
tagged with: javascript
tagged with: icons
tagged with: jquery
accepted answer: http://stackoverflow.com/a/26917881

web-services
tags question: http://stackoverflow.com/q/26980621
type: Tag
tags question: http://stackoverflow.com/q/26892050
tags question: http://stackoverflow.com/q/26960187
tags question: http://stackoverflow.com/q/26833191
tags question: http://stackoverflow.com/q/26871185
tags question: http://stackoverflow.com/q/26930841
tag name: web-services

http://stackoverflow.com/q/26892050
has title: Necessity of java web-frameworks when using AngularJS
accepted answer: http://stackoverflow.com/a/26892251
type: AnsweredQuestion
score: 1
tagged with: java
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/26892251
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
has body: We are currently developing an enterprise web application (Java backend + HTML/JS frontend). This application shall provide cloud-based data analysis functionality to a variety of users. Now, we have decided to use AngularJS for creating the web-frontend. The communication to the backend is realized with REST webservices (implemented in java using jersey, and jetty as webserver). Some time ago, I have already developed simple java web apps using apache wicket just for examplary reasons. Since I am new to AngularJS, I am wondering if there is any reason why it could still be necessary for us to use a java web-framework (such as wicket, gwt, etc.) additionally to Angular JS? The other way around: since we use Angular for developing the web-frontend, we do not need any web-framework on the java side any more, right? I am quite new to java web applications, so any help would really be appreciated :-) Regards
tagged with: web-services

http://stackoverflow.com/q/26966922
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26967142
type: AnsweredQuestion
has body: I have loaded an iframe in my page. The purpose of doing this is to use Javascript methods from that link which is being loaded in iframe. Is this possible? If so, how? I ahve tried to directly call the methods in my Javascript, but I think it will work only if the iframe is loaded before my javascript is being executed. Waiting for your suggestions. myobj._myFirstJs.prototype.init = function () { $("#load").click( function (){ myobj. = new myobj._myclass(myobj,homeComingUrl); myobj.myclass.getEmployee(); console.log("called"); }); }); } I have tryied this code. I am calling these lines when a button (id=load)is been clicked. I don't understand why its norking, afterall its being called after the whole page is being loaded.
score: 0
tagged with: iframe
upvote count: 1
downvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/26967017
has answer: http://stackoverflow.com/a/26967017
accepted answer: http://stackoverflow.com/a/26967142
has comment: http://stackoverflow.com/comment/42474127
has comment: http://stackoverflow.com/comment/42470979
answer count: 2
has comment: http://stackoverflow.com/comment/42474420
has title: use javascript methos from iframe into my page(javascript)
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/26892106
answers question: http://stackoverflow.com/q/26873215
score: 0
has body: Yes, You should be able to do this using the adobeDPS.configurationService.gotoState() method (see docs) adobeDPS.configurationService.gotoState("Library") The string you pass to gotoState must match the label of the tab. If the tab says "Library" (it's case sensitive), then the above code should work.
type: Answer

http://stackoverflow.com/q/26874918
tagged with: javascript
upvote count: 1
has title: Need to use name of current button in the associated Acrobat javascript code
answer count: 1
tagged with: button
has body: I need to insert several (50+) buttons on an Acrobat document, each of which simply does a "Save As" on a specific non-PDF attachment. For a single button, the following script works perfectly: this.exportDataObject({cName:"Attachment01", nLaunch:0}) It would be much simpler if I could use the name of the current/calling button in the javascript like this: var currButtonName = ??? this.exportDataObject({cName:currButtonName, nLaunch:0}) With this second approach, I could use the name of the button to determine which attachment is saved, so that I don't have to change the javascript code at all. Is it possible to get the name of the current button and if so how? Thanks.
favorite count: 0
has answer: http://stackoverflow.com/a/26882476
type: UnansweredQuestion
tagged with: acrobat
downvote count: 0
score: 1
type: Question

http://stackoverflow.com/comment/42391872
type: Comment
has text: Well, i wouldn't mind if people would fake the regexp, disable JS or something. It is really nothing too important and IF the clientside is hacked, well, still okay. It is only a missing watermark. You are right though, was thinking about PHP as well for adding a watermark. That would still be the same problem anyway. How to trigger only, if the target is a image-format.
type: QuestionComment
comment on: http://stackoverflow.com/q/26921961
score: 0

http://stackoverflow.com/comment/42432063
type: AnswerComment
comment on: http://stackoverflow.com/a/26941810
type: Comment
has text: I have the same result here. If i change the url to a non existant file i have the error message. Otherwise i'm not. I have updated my question.
score: 0

http://stackoverflow.com/comment/42404165
type: QuestionComment
has text: @user1775718 so add and find out.. I don't understand what your question for us is.
comment on: http://stackoverflow.com/q/26927324
score: 0
type: Comment

http://stackoverflow.com/q/26840885
score: 0
has comment: http://stackoverflow.com/comment/42246177
has title: D3: Animate pie chart update
has comment: http://stackoverflow.com/comment/42246601
has body: I'm trying to animate an update in my pie chart using d3.js. I've tried using the attrTween function, but cannot seem to get it working properly. function updatePieChart() { $.when(someOtherAjaxFunction()).done(function (json) { for (x in json) { var npath = d3.select('svg' + x).selectAll("path").data(pie(json)) npath.transition().duration(1000).attrTween("d", arcTween); // redraw the arcs } function arcTween(a) { var i = d3.interpolate(this._current, a); this._current = i(0); return function (t) { return arc(i(t)); }; } }) } //updatePieChart Any help is much appreciated. JSFiddle
type: UnansweredQuestion
tagged with: animation
answer count: 0
tagged with: d3.js
type: Question
tagged with: javascript

parsing
tags question: http://stackoverflow.com/q/26990886
tags question: http://stackoverflow.com/q/26935471
tags question: http://stackoverflow.com/q/26947286
tags question: http://stackoverflow.com/q/26981034
tag name: parsing
tags question: http://stackoverflow.com/q/26928279
tags question: http://stackoverflow.com/q/26922716
type: Tag
tags question: http://stackoverflow.com/q/26891097
tags question: http://stackoverflow.com/q/26908490
tags question: http://stackoverflow.com/q/26909200
tags question: http://stackoverflow.com/q/26883760
tags question: http://stackoverflow.com/q/26933468
tags question: http://stackoverflow.com/q/26964498
tags question: http://stackoverflow.com/q/26922657
tags question: http://stackoverflow.com/q/26877859
tags question: http://stackoverflow.com/q/26908705
tags question: http://stackoverflow.com/q/26899381

http://stackoverflow.com/comment/43169555
type: Comment
score: 0
has text: I tried this patch about one week ago in v1.1.2 and v1.2-beta, but it don't solves the problem. In the meanwhile I use another methode and don't need it anymore. But for the future it can be useful, I think.
type: AnswerComment
comment on: http://stackoverflow.com/a/27355209

http://stackoverflow.com/a/26877071
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/26874562
upvote count: 2
has body: I think you mean that you want your input to be a label or obj.label of the selected obj, but want to maintain the selected information of the obj. You can capture the $on selected event an add .label $scope.$on('$typeahead.select', function(v,i){ console.log(v,i); $scope.selected.label = $scope.selected.formatted_address; }); Here's a plunker
type: Answer
has comment: http://stackoverflow.com/comment/42311599

http://stackoverflow.com/comment/42261146
score: 0
has text: @VanCoding Edited for easier understanding
comment on: http://stackoverflow.com/q/26849164
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28261821
answers question: http://stackoverflow.com/q/26865294
upvote count: 1
has body: I'm not sure what you mean by "with hangout app", but to my understanding your problems could be: You are leaving out the recepient number(s), which is not supported by the standard (see RFC 5724) The message should be url-encoded (there are tons of free services for online url-encoding some text) Quoting the examples from RFC 5724, valid sms URIs are: sms:+15105550101 sms:+15105550101,+15105550102 sms:+15105550101?body=hello%20there In your case it should suffice to add the destination, url-encode the body and wrap it into an HTML tag as you did: Send SMS Where, of course, you should replace +15105550101 with the number of your intended recipient.
downvote count: 0
score: 1
type: Answer

http://stackoverflow.com/q/26915917
favorite count: 0
tagged with: coldfusion
downvote count: 0
type: UnansweredQuestion
has body: Question: How would I set up a page so that all links when clicked go to a page called query_data.cfm where a database query is triggered and once complete send the user to the url of the original link? As of right now I am adding a class to all links on my page using javascript. But what I also want to do is make it so all links with that class for example Page 2 go to a page named www.mywebsite.com/query_data.cfm where a query is ran passing the value of href to a database and once complete redirect the user to www.mywebsite.com/page2.cfm I hope this is enough information but if I missed anything please let me know.
tagged with: href
has title: How to send all clicked links to a page before going to the URL in the link
score: 1
has answer: http://stackoverflow.com/a/26916272
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
upvote count: 1
has answer: http://stackoverflow.com/a/26916022

http://stackoverflow.com/q/26956965
has title: Phalcon and Angular JS routing - use Angular templates and Phalcon controllers
score: 0
has answer: http://stackoverflow.com/a/26987808
tagged with: angular-routing
tagged with: javascript
tagged with: phalcon
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26987808
has body: I am using Phalcon with Angular JS and have the problem, that Phalcon is catching all my Angular routes. The target is that the route /dashboard is called first which loads the Angular, jQuery, etc. If the user clicks on the link /people only the ng-view should change and the Angular template should be loaded. Volt template: &lt;div ng-app="sampleApp"&gt; // Loads menu with two links to /dashboard and /people &lt;?php $this-&gt;partial("partials/navigation") ?&gt; &lt;?php echo $this-&gt;flashSession-&gt;output(); ?&gt; &lt;div ng-view ng-controller="DashboardController"&gt; {{ content() }} &lt;/div&gt; &lt;/div&gt; My target is that when the user clicks a link only the ng-view is changed with the routes defined in Angular: $routeProvider .when('/dashboard', { templateUrl: '/partials/dashboard.html', controller: 'DashboardController' }).when('/people', { templateUrl: '/partials/people.html', controller: 'PeopleController' }); Instead of that the Phalcon routing tries to load the "PeopleController" with the method "indexAction". I have tried to disable the Phalcon routing and only load the dashboard route (where the Angular library is loaded): $di-&gt;set('router', function () { $router = new \Phalcon\Mvc\Router(false); $router-&gt;add("/dashboard", array( 'controller' =&gt; 'dashboard', 'action' =&gt; 'index' )); return $router; }); How can I load some pages/routes with Phalcon like the /dashboard and some pages/routes to change the ng-view in Angular? Best regards, Patrick Edit: It works fine with the normal Angular, but with activated HTML mode it makes problems
tagged with: angularjs
answer count: 1

http://stackoverflow.com/a/26841960
answers question: http://stackoverflow.com/q/26840454
type: Answer
has body: Today it seems it's not possible to be notified when a PDF file is loaded in your pages. Events DOMContentLoad and load are not triggered in iframes, embed, object or popup windows when handling PDF files. However, there's hope for the future, the HTML5 specs says about the embed tag: Fetching the resource must delay the load event of the element's document. But so far, in Chrome 38 and IE11 it's not true yet, the document load event is fired as soon as the HTML is loaded.
score: 0

http://stackoverflow.com/comment/42489178
score: 0
has text: Ok, got the logic, and moved up the console.log() statement and it all works, voted and selected your answer, thanks!
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/26976757

http://stackoverflow.com/comment/42356433
comment on: http://stackoverflow.com/q/26902272
has text: What date is not working for you? I just tried this and it works as expected. Note: this regex does not test that the date is in the future..
type: Comment
type: QuestionComment
score: 3

http://stackoverflow.com/a/26931143
has body: Here the solution : those two lines should be modified : var myPlaylist = new jPlayerPlaylist({ to var myPlaylist = new parent.top.jPlayerPlaylist({ and $(".song").click(function(event) { event.preventDefault(); $("#jplayer_N").jPlayer("setMedia", { title:$(this).attr("data-title"), artist:$(this).attr("data-art"), mp3: $(this).attr("data-mp3"), }) .jPlayer("play"); }); to $(".song").click(function(event) { event.preventDefault(); parent.top.$("#jplayer_N").jPlayer("setMedia", { title:$(this).attr("data-title"), artist:$(this).attr("data-art"), mp3: $(this).attr("data-mp3"), }) .jPlayer("play"); })
type: Answer
answers question: http://stackoverflow.com/q/26872504
accepted answer of: http://stackoverflow.com/q/26872504
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/26944298
answer count: 1
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/16935095
tagged with: backbone.js
score: 0
tagged with: angularjs
has title: How can i use jquery plugins for my AngularJS Single Page Application
tagged with: single-page-application
has comment: http://stackoverflow.com/comment/42434870
type: UnansweredQuestion
type: Question
has body: The CSS works fine always. but the jquery code (jquery plugins or custom jquery code) does not work in the ng-view (partials) its not about few jquery functions for which i can always rewrite jquery code using angular directives. here the major problem is, i am using a lot of jquery plugins, so the whole code contains hundreds of jquery functions, effects, transitions. so i want a practical way to make all this work inside angular ng-view using partials with minimum labor. what changes are necessary to make such jquery code/plugins work with angular? what is the best solution? ps: is backbone.js better in this respect? is it easier to use jquery plugins with backbone or same problem there also?
has comment: http://stackoverflow.com/comment/42431603
has answer: http://stackoverflow.com/a/26950148

http://stackoverflow.com/q/26901910
answer count: 3
tagged with: angularjs-ng-repeat
has answer: http://stackoverflow.com/a/26902129
tagged with: angularjs
type: UnansweredQuestion
has body: I have a JSON data in the format [ { "_1": { "id": 4, "cost": 45.0, "measure": 4, "NoOfUnits": 677, "hours": null }, "_2": { "id": 1, "name": "Truck", "description": "Test" } }, { "_1": { "id": 1, "cost": 1120.0, "measure": 1, "NoOfUnits": 500, "hours": null }, "_2": { "id": 7, "name": "PC300", "description": null } }, ] I'm not able to display the data that I have store in a $scope variable say $scope.result This is my ng repeat functionality &lt;div ng-repeat="data in result"&gt;{{data.name}}{{data.description}}&lt;/div&gt;
has answer: http://stackoverflow.com/a/26902055
type: Question
tagged with: javascript
has title: Displaying JSON with ng repeat
has comment: http://stackoverflow.com/comment/42355890
score: 0
has answer: http://stackoverflow.com/a/26901970

http://stackoverflow.com/q/26855837
tagged with: javascript
has comment: http://stackoverflow.com/comment/42274185
has comment: http://stackoverflow.com/comment/42274410
score: 0
has comment: http://stackoverflow.com/comment/42274409
tagged with: asynchronous
tagged with: node.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42274105
type: Question
has body: Why is it that when I execute this code list is empty am i doing my asynchronous calls incorrectly? I have been moving things around and separating them into functions but still have a race going on between my execution. The order I would like the to execute is in their nesting but I guess something is wrong because it is not working. server.route({ method: 'POST', path: '/convert', config: { validate: { payload: { fileUpload: Joi.object({ headers: Joi.object({ 'content-type': Joi.string().valid(['application/pdf']).required(), }).unknown().required() }).unknown() } }, payload: { output: 'file', maxBytes: 209715200, uploads:'./thumbs' }, handler: function(request, reply) { var newPath, filename, filenamePng; fs.readFile(request.payload.fileUpload.path, function(err, data) { filename = request.payload.fileUpload.filename; filenamePng = filename.substr(0, filename.indexOf('.')); newPath = __dirname + "/thumbs/"; fs.writeFile(newPath + filename, data, function(err) { ChildProcess.exec('cd ' + newPath + ' &amp;&amp; convert ' + filename + ' -thumbnail 50% ' + filenamePng + '_thumb_page_' + '%d' + '.png', function(error) { fs.readdir(__dirname + "/thumbs", function(error, list) { list.forEach(function(element) { element = element.toString(); Thumbs.addThumbnail(Thumbs.thumbnailArray, {name: element, url: './thumbs/' + element }); }); var tmpFN = request.payload.fileUpload.path; fs.unlink(tmpFN, function(err){ if(err){ console.log(err); } else { console.log('/tmp/file deleted') // reply(Thumbs.showThumbnails(Thumbs.thumbs)); }; }); reply(Thumbs.showThumbnails(Thumbs.thumbs)); }); }); }); process.on('exit', function(code) { console.log('PROCESS FINISHED'); }); }); } } });
has answer: http://stackoverflow.com/a/26857015
has title: Hapijs , fs.readfile, fs.writefile, and childprocess.exec how do i control my async?
has comment: http://stackoverflow.com/comment/42274090
answer count: 1
tagged with: hapi.js

http://stackoverflow.com/comment/42371100
has text: Whats the question ?
score: 0
comment on: http://stackoverflow.com/q/26910396
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26845850
type: Answer
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/42255245
score: 0
answers question: http://stackoverflow.com/q/26845763
has body: Why should you? deleteAdress is a function. You can call it from any place if you want. Try this: $(document).ready(function () { var customerID = $("#hidcustomerid").val(); if (customerID != "0") { // dont know what you want to do here. (function is called at button onclick) } } function deleteAdress(adressId, customerId, appid, retVal) { window.location.href = '/Customer/DeleteAdress/?adressId=' + adressId + "&amp;customerId=" + customerId + "&amp;appid=" + appid + "&amp;retVal=" + retVal; }
has comment: http://stackoverflow.com/comment/42255048

http://stackoverflow.com/comment/42767305
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26912927
score: 0
has text: Akamaozu, I click it by mistake. now removed. Sorry for the confusion.

http://stackoverflow.com/a/26982742
accepted answer of: http://stackoverflow.com/q/26982671
score: 5
upvote count: 5
has comment: http://stackoverflow.com/comment/42499544
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42499985
type: Answer
answers question: http://stackoverflow.com/q/26982671
has body: This is because you are adding an un-needed "#" symbol. document.getElementById() requires only the name of the element's id (history_comment). The error is basically telling you that it can't get the property "value" of something that doesn't exist, i.e an element with the id of "#history_comment". You don't need a jQuery solution, what you have here is fine except for the typos.

http://stackoverflow.com/q/26839356
has comment: http://stackoverflow.com/comment/66108525
tagged with: reactjs
answer count: 2
upvote count: 9
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26842138
tagged with: css
favorite count: 0
possible better answer: http://stackoverflow.com/a/39360711
has title: How can I apply fallback style properties to a React JS component?
has answer: http://stackoverflow.com/a/39360711
has body: I would like to apply fallback style properties to a component. For instance: var inlineStyle = { display: '-webkit-box', display: '-webkit-flex', display: '-moz-box', display: '-moz-flex', display: '-ms-flexbox', display: 'flex' } return &lt;div style={inlineStyle}&gt;{divContent}&lt;/div&gt;; Is there any way to do this? At the moment they are being ignored.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26842138
type: Question
score: 9

http://stackoverflow.com/q/26871351
tagged with: css
has body: I'm new to JavaScript. I managed to add dynamic inputs after clicking on a button but I want to know how to apply the CSS to those added inputs, if anyone can give me a simple example i'd be glad! Thank you!
has comment: http://stackoverflow.com/comment/42301377
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42301330
has comment: http://stackoverflow.com/comment/42301345
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/26871599
tagged with: javascript
has answer: http://stackoverflow.com/a/26871599
has title: Adding CSS to and added input elements using Javascript
score: 0
has answer: http://stackoverflow.com/a/26871493
accepted answer: http://stackoverflow.com/a/26871493
has comment: http://stackoverflow.com/comment/42301225

http://stackoverflow.com/q/26902958
tagged with: firefox
has comment: http://stackoverflow.com/comment/42357533
answer count: 1
tagged with: webrtc
favorite count: 0
has body: Can any body help me find out, why this link(webRTC example) http://goo.gl/PNMSII not working on firefox? It's working fine on Chrome &amp; Opera but not on firefox. I've planned to build one photo capturing tool from webcam, but got stuck now.
has comment: http://stackoverflow.com/comment/42357793
has comment: http://stackoverflow.com/comment/42357571
has comment: http://stackoverflow.com/comment/42357535
has comment: http://stackoverflow.com/comment/42371334
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42396351
has answer: http://stackoverflow.com/a/39285980
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/42357595
has comment: http://stackoverflow.com/comment/42371677
has title: Not working on firefox
tagged with: javascript
type: Question
score: 0

http://stackoverflow.com/q/26841143
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: web
type: UnansweredQuestion
has title: Full screen does not work on a Youtube/Viemo embedded video on my site when using chrome
has answer: http://stackoverflow.com/a/26845992
tagged with: google-chrome
type: Question
tagged with: javascript
tagged with: html5-video
has body: On my website, I embedded a Youtube video with this simple code: Site Demo can be seen here at: https://testvillage.letsventure.com/dreamon When in Chrome and I press the full screen button on that video, the video goes full screen and again restores automatically. However, when I use Explorer or Firefox, full screen works just fine. So obviously I'm doing something wrong. Any help would be appreciated.
score: 0

http://stackoverflow.com/a/26837676
score: 0
type: Answer
has body: If you want both the min-height and max-height to be the size of the window why dont you just forgo the mins and maxs and just set the height itself?? You are pretty much bang on with your code however I would structure it a little differently. Are you loading the jQuery library? $(document).ready(function() { setHeight(); }); $(window).resize(function() { setHeight(); }); function setHeight() { windowHeight = $(window).innerHeight(); $('.sidebar').css('height', windowHeight); console.log(windowHeight); } This will make the sidebar 100% of the screen height on load and on screen resize. Alternatively if you are trying to make a page a tablet style web application you can achieve this 100% sidebar with css alone html,body { width: 100%; height: 100%; overflow:hidden; } .sidebar { height: 100%; /*set overflow-x + y to scrolls if you have a lot of content*/ } this will give you the same effect without any javascript/jquery http://jsfiddle.net/kdwnk2ax/1/
has comment: http://stackoverflow.com/comment/42241219
answers question: http://stackoverflow.com/q/26837493

http://stackoverflow.com/a/26866100
has comment: http://stackoverflow.com/comment/42292134
accepted answer of: http://stackoverflow.com/q/26865938
type: AcceptedAnswer
has body: I believe you want something like this: interFace.createNode = function(name) { debug('createNode'); var node = {}; node.name = name; node.childNodes = []; ... return node; }; or, something like this: interFace.createNode = function(name) { debug('createNode'); return new interFace.Node(name); }; interFace.Node = function(name){ this.name = name; this.childNodes = []; ... }
has comment: http://stackoverflow.com/comment/42292436
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/42291838
has comment: http://stackoverflow.com/comment/42292021
answers question: http://stackoverflow.com/q/26865938

http://stackoverflow.com/q/26917730
has comment: http://stackoverflow.com/comment/45526702
has comment: http://stackoverflow.com/comment/42423217
has comment: http://stackoverflow.com/comment/42420204
downvote count: 0
tagged with: jquery
score: 1
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28026972
has comment: http://stackoverflow.com/comment/42418001
tagged with: safari
has comment: http://stackoverflow.com/comment/45568150
has comment: http://stackoverflow.com/comment/42409286
has title: Ajax GET request using jQuery returning null in Safari only
upvote count: 1
has body: I'm going nuts trying to debug a problem I'm having with Safari only (running 5.1). I'm doing a simple ajax GET request using jQuery as follows: $.ajax({ type: "GET", url: "get_values.cgi", data: {}, contentType: "application/json; charset=utf-8", headers: { "cache-control": "no-cache","pragma":"no-cache" }, dataType: "JSON", cache: false, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("Fatal Error"); }, success: function (data) { (do stuff here) } This call works fine in all browsers except Safari. The CGI code is returning nicely formatted JSON data and it is parsed quite happily by all other browsers (has been tested with the latest versions of IE, Chrome, and Firefox). The error Safari is throwing is from the jQuery code - it is "JSON: Unexpected EOF". It's clear from stepping through the jQuery code using the Safari debugger that Safari is throwing away the returned JSON data completely - it is attempting to parse a null string and thus throws an error. We have watched the HTTP requests going back and forth with message monitoring software and seen that the CGI is clearly creating the message correctly and sending it up to Safari correctly. It's Safari that is throwing away the JSON data. I have seen other questions on here that talk about empty responses in Safari due to problems with their authentication stack, but adding the no-cache rules to the header as shown above made no difference; changing to a POST type made no difference, either. Help, I'm pulling my hair out!
type: Question
has answer: http://stackoverflow.com/a/61111615
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has comment: http://stackoverflow.com/comment/42441509
answer count: 2
has comment: http://stackoverflow.com/comment/42384932

http://stackoverflow.com/q/26962671
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42467211
tagged with: css
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/42463393
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42467688
has body: I'm recreating physical map aisles based on their coordinates on a page. I'm creating DIV elements and using css to draw on the page using coordinates x and y. for example position: absolute; width:20px; height:10px; left:208; top:820; All is good except the divs start almost half the the screen. So I want to either move the container div close to the top of the page. I tried dividing the coordinates by 4 to get closer to the top of the page but by doing that the map does not look as good. So what I'm looking for is either way to move the main up or resize the main dive so the aisles start almost the edge of the main Div. my structure looks like this and so on....
score: 0
has title: Center page where coordinates begins jquery
type: UnansweredQuestion

http://stackoverflow.com/comment/42512949
type: QuestionComment
comment on: http://stackoverflow.com/q/26979942
score: 1
has text: I think there is some kind of timing issue because I can see the output sometimes but not always.
type: Comment

http://stackoverflow.com/comment/42461443
type: Comment
score: 2
has text: Same as mentioned in answer: http://www.devthought.com/2012/01/18/an-object-is-not-a-hash/ For making sure no clashes with inherited properties.
comment on: http://stackoverflow.com/q/26961544
type: QuestionComment

http://stackoverflow.com/q/26833945
answer count: 1
has body: I'm trying to get my JS to recognize the type of form input that is visible on the page. I'm doing a quiz, and when you hit the "next" button, it will show the next question, as long as the previous question was answered. If it was not, it should show an alert. I'm trying to get JS to recognize the type of input the question has so that it can get see if no radio button was checked, if the question was a radio button question. But so far, it's recognizing all questions as text AND radio questions. I don't know what I'm doing wrong. I've been working on this for hours. Here is the JS Fiddle: http://bitly.com/1qy5TiX Here is the code: $("button").click(function() { if ($("input:visible [type=text]") || $("select") ) { console.log("this is text or select"); } if ($("input:visible :radio")) { console.log("this is radio"); } showNext(); }); // end button click function
tagged with: javascript
tagged with: jquery
score: 0
has title: JavaScript / jQuery - Recognize Type of Form Input (i.e. radio button, text input, dropdown)
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42234244
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/26834312
accepted answer: http://stackoverflow.com/a/26834312

http://stackoverflow.com/comment/42360723
score: 0
type: AnswerComment
type: Comment
has text: Thank You Paul for assisting me. But sorry to say, I think I have to move some customize solution rather than Zumero.
comment on: http://stackoverflow.com/a/26846136

http://stackoverflow.com/a/26860709
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42282414
type: Answer
answers question: http://stackoverflow.com/q/26860464
accepted answer of: http://stackoverflow.com/q/26860464
has body: Basically the file is read in uploadFileInBlocks() function which you're not calling. To initiate the upload you have to call this method somehow. If you look at the code in the blog post, this method is called on the click on Upload File button (from the blog post): &lt;p&gt; &lt;input type="button" value="Upload File" onclick="uploadFileInBlocks()"/&gt; &lt;/p&gt;

http://stackoverflow.com/q/26836295
tagged with: css
score: 1
has comment: http://stackoverflow.com/comment/42251547
type: Question
has body: i'm new to making web stuff so sorry in advance for my newbyness... anyways Ive created a SVG animation with css, <path class="st0" d="M14.872,26.016c0.347,1.109,0.539,1.82,0.79,2.511c12.477,34.228,24.958,68.452,37.44,102.679 c10.294,28.223,20.59,56.445,30.883,84.67c0.501,1.373,0.697,2.684,2.854,2.678c30.238-0.082,60.478-0.068,90.716-0.02 c1.515,0.002,2.172-0.516,2.715-1.867c3.9-9.707,7.819-19.406,11.884-29.045c0.846-2.006,0.83-3.67,0.09-5.686 c-18.811-51.182-37.568-102.383-56.285-153.598c-0.636-1.74-1.439-2.373-3.355- 2.369C94.2,26.031,55.798,26.016,17.396,26.016 C16.652,26.016,15.908,26.016,14.872,26.016z M202.77,162.303c18.564-45.643,36.941-90.824,55.349- 136.08 c-35.402,0-70.482,0-105.825,0C169.125,71.6,185.857,116.709,202.77,162.303z"/> Id like to be able to run this animation while my website loads/refreshes but instead the animation plays through and stays onto the page not redirecting to some basic three.js code i was testing... the index file looks like this... TEST All help is needed - thanks in advance!
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42239118
has title: css animation loader to homepage
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
answer count: 0
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/a/26948077
has body: The trace function will replace a method in an object with a wrapper, which will output some log meddages and call the original method. The anonymous function is the wrapper that will be called instead of the original method. When it is called, it's called as a method of the object, so this will refer to the object. Note that the anonymous function isn't executed in the trace function. It replaces the original method, so it will be called later on when the original method would have been called. The arguments array is the arguments of the wrapper function, so that will be the arguments that was intended for the original method. That's why they are passed along when the original method is called. If you have an object like this: var html = { bold: function(x) { return "&lt;strong&gt;" + x + "&lt;/strong&gt;"; } }; If you now use the trace function: trace(html, 'bold'); Now the html object will contain the equivalent of: { bold: function() { var m = 'bold'; var original = function(x) { return "&lt;strong&gt;" + x + "&lt;/strong&gt;"; }; console.log(new Date(), "Entering:", m); var result = original.apply(this, arguments); console.log(new Date(), "Exiting:", m); return result; } }
score: -1
upvote count: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26947973
type: Answer
answers question: http://stackoverflow.com/q/26947973
has comment: http://stackoverflow.com/comment/42550722
downvote count: 1

http://stackoverflow.com/comment/42342631
comment on: http://stackoverflow.com/q/26894361
score: 0
has text: @ntgCleaner then you need to find out the max width that you are resizing to and then you can figure out the max %, the stuff in the middle is just a simple calculation. This is assuming your page has a max width
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42501341
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26983474
has text: Ok.. I see! How about calling the light box function within OpenTutorial to start the tutorial instead of any attributes that you may have.
score: 0

http://stackoverflow.com/comment/43160222
type: Comment
type: QuestionComment
has text: I have found another solution. I have added new class on text box and on click event of text box I performed my business logic
comment on: http://stackoverflow.com/q/26880624
score: 0

http://stackoverflow.com/comment/42294740
has text: lol, the php script was calling login_check() but I just required the db_connect instead of the functions.php which also includes the db_connect.php... the variables are sent correctly, but there's an error (undefined method mysqli::bind_param())
comment on: http://stackoverflow.com/q/26855002
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/26946147
has body: First thing, I'd clean up the HTML code a bit... I assume the four radio buttons are all possible answers to one question, in which case they should all have the same name (not value) so that you can only choose one answer; then in the script I'd would need to use more information than just the value of the checked answer, so instead of sending this.value to the function, I'd just send this: &lt;input type="radio" name="question_1" value="option_1" onclick="checkValue(this);" /&gt; Hyper Text Markup Languages &lt;br /&gt; &lt;br /&gt; &lt;input type="radio" name="question_1" value="option_2" onclick="checkValue(this);" /&gt; Highest Text Markup Language &lt;br /&gt; &lt;br /&gt; &lt;input type="radio" name="question_1" value="option_3" onclick="checkValue(this);" /&gt; Hyper Total Markup Language &lt;br /&gt; &lt;br /&gt; &lt;input type="radio" name="question_1" value="option_4" onclick="checkValue(this);" /&gt; Hyper Text Markup Language &lt;br /&gt; &lt;br /&gt; In the script, to disable the radio buttons after they've been clicked, I would add a function that goes through each radio button that has the same name (as mentioned above) as the one that's been clicked, and disable it: var radiobuttons = document.getElementsByName(option.name); for(i = 0; i &lt; radiobuttons.length; i++) { radiobuttons[i].disabled = true; } Then, of course, the alert to let the visitor know whether they've got the right answer: if (option.value == "option_4") { alert("Correct"); } else { alert("False, Option (4) is the Correct Answer."); } Here's a fiddle: http://jsfiddle.net/Niffler/nyqk6gga/ (I'm assuming you don't want to use jQuery; otherwise there would be much nicer-looking ways to do this...)
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/26945870
accepted answer of: http://stackoverflow.com/q/26945870
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/26980948
type: Question
upvote count: 0
accepted answer: http://stackoverflow.com/a/26981230
tagged with: jquery-mobile
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/42496046
has comment: http://stackoverflow.com/comment/42496369
has comment: http://stackoverflow.com/comment/42496502
has title: Jquery mobile tabs - selected tab
answer count: 1
has comment: http://stackoverflow.com/comment/42496179
favorite count: 0
has answer: http://stackoverflow.com/a/26981230
has body: I have a page with JQM tabs on it and below it, a "save" button. The "save" button needs to know which one of the three tabs is active. Is there a way for me to know it? In this example the answer should be "Two". Example Thanks.
has comment: http://stackoverflow.com/comment/42496066
type: AnsweredQuestion
downvote count: 1

http://stackoverflow.com/q/26947673
possible better answer: http://stackoverflow.com/a/27004193
favorite count: 0
has answer: http://stackoverflow.com/a/27004193
score: 2
type: AnsweredQuestion
tagged with: casperjs
upvote count: 2
has answer: http://stackoverflow.com/a/26948029
type: Question
accepted answer: http://stackoverflow.com/a/26948029
has body: To be clear, I want to use sugar.js extensions in my casperJS script (as distinct from it being part of the web site being tested). I am using casperJS in test mode (i.e. casperjs test myscript.js) if that makes any difference.
tagged with: javascript
has title: How to use sugar.js with CasperJS?
answer count: 2
tagged with: sugar.js
downvote count: 0

epub
type: Tag
tags question: http://stackoverflow.com/q/26982738
tag name: epub

http://stackoverflow.com/a/27002224
score: 1
has comment: http://stackoverflow.com/comment/42548041
has body: You can set "icon": false in the node data to remove the icon.
answers question: http://stackoverflow.com/q/26965457
accepted answer of: http://stackoverflow.com/q/26965457
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42545677
type: Answer
has comment: http://stackoverflow.com/comment/134637150
downvote count: 0

http://stackoverflow.com/q/26962080
tagged with: javascript
has body: Rails newbie here. I'm working on a project and I need to integrate google maps into a current rails application. I have the google maps javascript file working properly. My issue comes in when trying to integrate it with the current rails application. I have the html.erb file setup to reference the respective google maps js file, yet every time the page loads, I get an error in the console saying "Failed to load resource: the server responded with a status of 404 (Not Found)" in regards to the corresponding js file. Yet when I copy the javascript code into the html.erb file, google maps just loads fine. Any ideas on what I'm missing to have this setup working properly, I have been losing my mind over this for the past 24 hours and would greatly appreciate any help I can get. Thanks in advance! EDIT: Adding the code and errors below. Here is the core of the google maps js with angular, I have commented out everything except loading the core google maps below var My_Map = angular.module('My_Map' , []); My_Map.directive("myMaps", function() { return { restrict: 'E', template: ' ', replace: true, link: function (scope, element, attrs) { var mapOptions = { center: new google.maps.LatLng(34.0, -118.4), zoom: 12, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById(attrs.id), mapOptions); } }; }); Here is the html erb code chunk <%= javascript_include_tag "dispatcher_script", "data-turbolinks-track" => true %> Google Maps And the console errors, stackoverflow wont let me post images, but its basically the following Uncaught ReferenceError: google is not defined dispatcher_script.js:1646 Failed to load resource: the server responded with a status of 404 (Not Found) https://NAME.herokuapp.com/app/assets/javascripts/app/map_app.js Failed to load resource: the server responded with a status of 404 (Not Found) https://NAME.herokuapp.com/app/assets/javascripts/angular-animate.min.js.map Also, the file structure is rails compliant, ha…
score: 0
has comment: http://stackoverflow.com/comment/42463043
tagged with: google-maps
tagged with: ruby
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42463076
has title: Integrate Google Maps Into a current Rails Application
answer count: 0
type: UnansweredQuestion
tagged with: ruby-on-rails
type: Question
has comment: http://stackoverflow.com/comment/42462425

http://stackoverflow.com/comment/42288404
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26864339
has text: What error did you get in the browser? 404?
score: 0

http://stackoverflow.com/comment/70765576
type: AnswerComment
has text: This is good... but lacking when there are multiple editors on a page that need to be individually targeted :-(
type: Comment
comment on: http://stackoverflow.com/a/26839911
score: 2

http://stackoverflow.com/comment/42489893
type: Comment
type: QuestionComment
has text: BTW, there's a closing `}` missing in CSS, line above `header, footer, ...`.
comment on: http://stackoverflow.com/q/26975831
score: 0

http://stackoverflow.com/q/26923023
tagged with: url
type: Question
has answer: http://stackoverflow.com/a/26923104
score: 0
tagged with: youtube-api
answer count: 1
tagged with: src
accepted answer: http://stackoverflow.com/a/26923104
has title: Using Javascript for iFrame src URL
tagged with: javascript
has body: I'm playing around with the YouTube API and JavaScript and I can't get this to work. I'm trying to use JavaScript to give the video URL to the iFrame. This is what I have in the body of my HTML page: &lt;iframe id="ytplayer" type="text/html" width="720" height="405" src="" frameborder="0" allowfullscreen&gt; &lt;script type="text/javascript"&gt; document.getElementById("ytplayer").src = "https://www.youtube.com/embed/0rhwc5_iWkA?autoplay=1"; &lt;/script&gt; It's just a trivial example but I can't get the video player to appear. I've looked at various ways to achieve the same result but nothing works. What's going wrong?
type: AnsweredQuestion
tagged with: getelementbyid

http://stackoverflow.com/comment/42329727
comment on: http://stackoverflow.com/q/26887542
type: Comment
type: QuestionComment
has text: @RahilWazir Hey, unfortunateley removing `ng-model-options` doesnt change the functionality. I added my directive code as you asked.
score: 0

http://stackoverflow.com/a/26979768
downvote count: 0
has comment: http://stackoverflow.com/comment/42611020
type: Answer
has body: Not entirely sure why this fixes it, but changing the autoprefixer pipe to: .pipe(autoprefixer({ browsers: ['last 2 versions'], cascade: false })) and putting it before the sass pipe (top) allows it to build succesfully.
upvote count: 5
has comment: http://stackoverflow.com/comment/42557814
score: 5
answers question: http://stackoverflow.com/q/26979433
has comment: http://stackoverflow.com/comment/42596136

http://stackoverflow.com/comment/42307112
comment on: http://stackoverflow.com/q/26874420
score: 0
has text: O(n) (aka [Big O](http://en.wikipedia.org/wiki/Big_O_notation)) isn't an algorithm, it's not something that you code: it's a measure of the "cost" of an algorithm
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42308088
type: AnswerComment
type: Comment
has text: @ericbelldesigns OK great. Note the change I made to the answer - your code that converts a `new Date()` to a string and then back is probably a good idea so that if a user picks today's date it doesn't look like it's *before* today, because Date instances made from just the year, month, and day will have the clock set to midnight (00:00:00) on that date.
comment on: http://stackoverflow.com/a/26875110
score: 0

http://stackoverflow.com/a/26912635
accepted answer of: http://stackoverflow.com/q/26912464
upvote count: 1
type: AcceptedAnswer
downvote count: 0
score: 1
has body: It's because counter is a local variable scoped to function f. // value of counter = 2 document.write("&lt;p style='background: blue'&gt;" + counter); if(counter != 0) { f(counter) // calling f(2), must wait for function to return before continuing. } // after return, the value of counter is still 2 because it's a local variable document.write("&lt;p style='background: yellow'&gt;" + counter);
type: Answer
answers question: http://stackoverflow.com/q/26912464

http://stackoverflow.com/comment/42346151
comment on: http://stackoverflow.com/q/26895208
type: Comment
type: QuestionComment
has text: you can also pluck a property from each object element to create an index, which you can use [].indexOf() on to very quickly get the array position of an object with the specified property. that's nice because it's often faster and always more flexible to not hard-code the property name into the iteration workload.
score: 0

http://stackoverflow.com/q/26961996
type: Question
linked to: http://stackoverflow.com/q/20967006
tagged with: javascript
has body: I'm writing a node.js program that makes use of the fibrous library to maintain synchronous control in part of my code. In a helper function, I need to complete a timeout, but cannot use setTimeout() because it will not work in the context with fibrous. This is what I came up with instead: startTimer = new Date() startSecondTimer = new Date() while startSecondTimer - startTimer &lt; 10000 startSecondTimer = new Date() I'm not very comfortable with creating several thousand Date objects to support this workflow, but I'm not certain what a better approach here might be. Is there a more optimal way to write a synchronous timeout-style function?
upvote count: 1
has comment: http://stackoverflow.com/comment/42464803
has title: synchronous timing in node.js
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: node.js
downvote count: 0
has answer: http://stackoverflow.com/a/26962166
score: 1

http://stackoverflow.com/a/26874217
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26873654
has body: So i updated my own code. I subscirbed to the drag:end event-- dd1.on('drag:end', getOffsetTop); Then I make a pure JS function that just checks for the offsetTop and offsetLeft. I think I should be able to create my own condition based on these values to change the class names.

http://stackoverflow.com/a/26987014
type: Answer
has body: I have gone through your code its almost correct you simply need to change something in your click function because preventDefault(); creating problem with the default functionality of &lt;a&gt;&lt;/a&gt; tag... Also click on Allow block content when it ask you in IE. Instead try this :- &lt;script&gt; $(document).ready(function(){ $("body").css("display","none"); $("body").fadeIn(2000); $("a").click(function() { linkLocation=this.href; if(!linkLocation.contains("#")) { $("body").fadeOut(1000,redirectPage); } }); function redirectPage() { window.location=linkLocation; } }); &lt;/script&gt; I hope this will work for you..
upvote count: 2
answers question: http://stackoverflow.com/q/26986711
has comment: http://stackoverflow.com/comment/42507638
score: 2
downvote count: 0

http://stackoverflow.com/q/26856929
has body: I am a newbie learning angularjs. I am trying to access external api to get data from them. The below image link is the json data that I get after http request from that api: In js file I have saved data as $scope.jsondata = data; I want to create an table which will look like this: Date age avg num_payments ? ? ? // dont know what to give because when I tried to access the variable like jsondata.stats.histogram nothing comes up. If I give jsondata.stats and print them I get following output 1.[{"date":"201311","histogram":[{"ages":"<=18","num_payments":825,"avg":525.24},{"ages":"19-25","num_payments":49628,"avg":243.86},{"ages":"26-35","num_payments":181206,"avg":335.73},{"ages":"36-45","num_payments":208087,"avg":409.1},{"ages":"46-55","num_payments":209074,"avg":387.01},{"ages":"56-65","num_payments":156109,"avg":347.39},{"ages":">=66","num_payments":70881,"avg":400.2},{"ages":"Unknown","num_payments":4133,"avg":658.82}]},{"date":"201312","histogram":[{"ages":"<=18","num_payments":875,"avg":678.74},{"ages":"19-25","num_payments":56716,"avg":243.19},{"ages":"26-35","num_payments":200432,"avg":330.1},{"ages":"36-45","num_payments":227268,"avg":399.74},{"ages":"46-55","num_payments":227818,"avg":385.11},{"ages":"56-65","num_payments":166577,"avg":337.03},{"ages":">=66","num_payments":75534,"avg":373.36},{"ages":"Unknown","num_payments":4075,"avg":609.47}]},{"date":"201401","histogram":[{"ages":"<=18","num_payments":863,"avg":829.89},{"ages":"19-25","num_payments":64139,"avg":215.28},{"ages":"26-35","num_payments":211934,"avg":309.96},{"ages":"36-45","num_payments":236751,"avg":377.17},{"ages":"46-55","num_payments":232784,"avg":409.92},{"ages":"56-65","num_payments":170349,"avg":331.59},{"ages":">=66","num_payments":77767,"avg":386.73},{"ages":"Unknown","num_payments":4084,"avg":674.42}]},{"date":"201402","histogram":[{"ages":"<=18","num_payments":947,"avg":929.1},{"ages":"19-25","num_payments":50168,"avg":227.48},{"ages":"26-35","num_payments":170661,"avg":326.44},…
type: AnsweredQuestion
tagged with: nested
tagged with: angularjs-ng-repeat
tagged with: angularjs
type: Question
has answer: http://stackoverflow.com/a/26857334
answer count: 1
has title: How to get data of json nested objects?
score: 0
tagged with: http://stackoverflow.com/tag/json
linked to: http://stackoverflow.com/q/1051061
has comment: http://stackoverflow.com/comment/42275842
accepted answer: http://stackoverflow.com/a/26857334
tagged with: javascript

http://stackoverflow.com/a/26877386
downvote count: 0
has comment: http://stackoverflow.com/comment/42311931
has comment: http://stackoverflow.com/comment/42311911
has comment: http://stackoverflow.com/comment/42311923
has body: This should do the trick. Using JavaScript's print method: Print
has comment: http://stackoverflow.com/comment/42311939
has comment: http://stackoverflow.com/comment/42311874
upvote count: 3
has comment: http://stackoverflow.com/comment/42311980
has comment: http://stackoverflow.com/comment/42311973
answers question: http://stackoverflow.com/q/26877360
type: Answer
has comment: http://stackoverflow.com/comment/42311892
score: 3

http://stackoverflow.com/q/26961189
has title: Snap Svg gives an error when removing an element
type: Question
score: 0
has comment: http://stackoverflow.com/comment/42480614
has comment: http://stackoverflow.com/comment/42475123
tagged with: javascript
has body: Error: NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMSVGPathElement.ownerSVGElement] [line 1956] Code: var g = getG(), node = g.node.firstChild, next; while (node) { next = node.nextSibling; selectorLayer.select('#' + node.id).remove(); node = next; } Using the above code I am trying to empty the complete g tag created using SNAP.SVG Fiddle link. The elements gets deleted but then the error starts appearing at a specific interval from garbage collector function in snap.svg.js
has comment: http://stackoverflow.com/comment/42481201
has comment: http://stackoverflow.com/comment/42471561
has comment: http://stackoverflow.com/comment/42482376
tagged with: http://stackoverflow.com/tag/svg
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42463473

http://stackoverflow.com/comment/42322490
has text: @JLSARP: You can't trap the user on your page. This is a Good Thing(tm). As I said above, all you can do is *"[understand] that the user is ultimately in control and can bypass your alert"*. The alert is there to warn the user that they're doing something that can lose work they've done. It's up to them whether to do that.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26883367
type: AnswerComment

spdy
tag name: spdy
tags question: http://stackoverflow.com/q/26961772
type: Tag

http://stackoverflow.com/comment/42392287
comment on: http://stackoverflow.com/a/26922237
has text: nice thats great. but how can i make the selects have the counter that ads a number for each new item so i can save the output in a database in different fields? and how to limit the amount of rows? like in the example i posted. sorry im really no good at all with jquery
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/64048974
score: 4
answers question: http://stackoverflow.com/q/26975068
downvote count: 0
type: Answer
upvote count: 4
has body: SOLVED: This is because of the fast csv throwing an error as it thought a new column was added. so use discardUnmappedColumns option that throws away extra columns csv.fromStream(stream, { headers: true, discardUnmappedColumns: true }).validate(function(data) { if (data.age &gt; 18) return false; else return true; } }

http://stackoverflow.com/q/26895253
type: Question
tagged with: c#
score: -2
accepted answer: http://stackoverflow.com/a/26895373
tagged with: javascript
has title: Constant in a key value pair
has body: I am doing a post to a Action in MVC 5 from Javascript in order to set a variable in the session: $.post('@Url.Action("MyAction", "MyController"), { key: "myKey", value: returnValue }); Where return value comes back from a service and the string "myKey" is what the value in session is stored as: So MyAction looks like: [HttpPost] public void MyAction(string key, string value) { Session[key] = value; }
downvote count: 2
has answer: http://stackoverflow.com/a/26895373
answer count: 1
favorite count: 0
tagged with: session-variables
type: AnsweredQuestion
upvote count: 0

http://stackoverflow.com/comment/42576755
type: Comment
has text: only qtags is even easier call `langTools.setCompleters([qtags])`, note that you need v1.1.8 for this to work.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/27010052

http://stackoverflow.com/q/26913754
type: Question
has answer: http://stackoverflow.com/a/26913965
score: -2
answer count: 1
tagged with: javascript
tagged with: express
favorite count: 0
has body: Edit: SELECT * query is returning my dates in an incorrect format. Using the mysql2 module to execute a connection.query(), pass all data to a server-side variable, and calling it client-side using AJAX. router.post('/applicants', function(req, res){ connectionpool.getConnection(function(err, connection){ if(err){ console.error('CONNECTION error: ', err); res.statusCode = 503; res.send({ result: 'error', err: err.code }); } else { console.log connection.query('SELECT * FROM applicant', function(err, rows){ if (err) console.error(err); res.send(rows); } ); connection.release(); } }); }); var applicants = ''; $.post('/applicants').done(function(data){ applicants = data; }); $('.name').click(function(){ var selected = $(this).attr('id'); applicants.forEach(function(applicant){ if(selected == applicant.applicant_id){ ... $('input[name="applicant_dob"]').val(applicant.applicant_dob); I can't parse it out by '-' because it returns the day as 02T05:00:00.000Z instead of 02. It looks correct in phpmyadmin. Any ideas?
has title: 'Datetime' value showing up as 2014-11-02T05:00:00.000Z instead of 2014-11-02 00:00:00
tagged with: phpmyadmin
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42376834
downvote count: 3
upvote count: 1
tagged with: node.js
has comment: http://stackoverflow.com/comment/42377104
tagged with: mysql

http://stackoverflow.com/a/27337349
type: AcceptedAnswer
has body: thanks for the help. I found a solution for my problem probably no the nicest but works for me. a $('#li_a') [0].speak = function () { alert('Hello I\'m a!'); }; var button = $(' ').html('speak2'); button.click(function () { var el = $('#li_a') [0]; if (typeof el.speak == 'function') el.speak(); }); button.appendTo('body'); With [0] I get the DOM element I guess.
type: Answer
accepted answer of: http://stackoverflow.com/q/26985006
answers question: http://stackoverflow.com/q/26985006
score: 0

http://stackoverflow.com/comment/42394051
comment on: http://stackoverflow.com/a/26909782
has text: Thank you for editing the answer to explain toObject() and toJSON().
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/26962786
type: Question
tagged with: canvas
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/42474986
has title: OpenLayers 3 set custom extent for ImageCanvas layer
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42504171
answer count: 0
has body: Is it possible in OpenLayers 3 to set a custom extent for an Image layer that uses ImageCanvas as its source? It seems that by default, when using ImageCanvas, OL creates a layer with extent equal to the current view extent plus half, and updates the extent on every render. Setting an extent for the Image layer somehow breaks the ImageCanvas source, which is never created (canvasFunction is never called). I'm drawing images with a fixed location to the canvas that I would like to appear when the map pans over their extent (i.e. during a pan animation). As it stands, the Image layer's extent won't be updated until a moveend event, so the canvas sits in its old position during the entirety of the pan. It seems it's impossible to force a render/update of the canvas layer during a pan operation, but I figured if it's possible to set a larger extent for the Image layer that covers all the images I want to draw, that won't be a problem. Any help would be appreciated.
tagged with: openlayers-3

http://stackoverflow.com/comment/42654645
score: 0
type: Comment
comment on: http://stackoverflow.com/q/26848115
type: QuestionComment
has text: Also maybe first approach would be to do it without a force ? A static network chart wits 'L' and 'R's , any ideas how to push them to opposite sides of the central node

http://stackoverflow.com/a/26924599
has body: Use .clone() $(".addRecord").on("click", function(){ $(".form-group:first").clone(true).appendTo(".schedulingRecord"); }); Fiddle You could also use .html() but, here are a few differences: .clone can be used on multiple element at the same time while .html() return only the html of the first element. .clone return a jQuery object while .html return a string. .clone can (if specified) keep any event and data of the DOM element. .html cannot. .clone keep the root element while .html only get the innerHTML. See more details here
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/26924412
upvote count: 2

http://stackoverflow.com/comment/61425854
has text: @zneak it's the best companion tag for HTML, JavaScript and JS frameworks.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26907669

http://stackoverflow.com/comment/42371006
type: Comment
comment on: http://stackoverflow.com/a/26910711
has text: Question says `console.log the value of each of them one by one`, then why are you showing text?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/42427890
type: QuestionComment
has text: It means what thread safety means anywhere else -- that you don't have to be paranoid about multiple threads using the library at the same time. The library will handle synchronization between calling threads.
score: 0
comment on: http://stackoverflow.com/q/26941923
type: Comment

http://stackoverflow.com/comment/42328082
type: Comment
type: QuestionComment
has text: Can you show enough of your code that we can reproduce (a simplistic/minimal version of) what's going on? See: '[MCVE](http://stackoverflow.com/help/mcve/)' for guidance. Incidentally, is there a problem with your current approach that you're trying to address? If so, what is that problem? Where are you stuck with the re-implementation/rewrite?
score: 0
comment on: http://stackoverflow.com/q/26886834

http://stackoverflow.com/a/26877767
has comment: http://stackoverflow.com/comment/42314957
accepted answer of: http://stackoverflow.com/q/26877604
has body: Instead of this var re = /(var\s*paradas\s*=\s*)(\[(.*?)\];)/g; Try this var re = /(var\s*paradas\s*=\s*)(\[([^;]+)\];)/g; Now result[0] == 'var paradas = [["name1", 12,....], ["namen", 24,..]];' result[1] == 'var paradas =' result[2] == '[["name1", 12,....], ["namen", 24,..]];'
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26877604
type: Answer
has comment: http://stackoverflow.com/comment/42312589

http://stackoverflow.com/a/26852657
score: 0
has body: Absolutely-positioned elements to not affect the size of their containing element. Consider a case where we use a red-colored instead of as the clickable element: function move() { dom = document.getElementById('image'); dom.style.top=event.clientY+"px"; dom.style.left=event.clientX+"px"; } div { background-color: red; } This snippet should contain a red-colored , but it doesn't, because the is empty or anything that would cause it to have a size greater than 0. The image it contains is absolutely-positioned, which does not affect the size. Now consider a similar with a CSS-specified size: function move() { dom = document.getElementById('image'); dom.style.top=event.clientY+"px"; dom.style.left=event.clientX+"px"; } div { background-color: red; width: 400px; height: 400px; } Now the div is larger than zero, and clicking inside produces the expected result. this is why your clicks don't work: the has a width and height of 0. If you instead place the onclick listener on the element (which is full-width and full-height by default) or on an element with non-zero dimensions, you'll see your code works. I'm not sure I'd advise putting binding click listeners on the element; I would advise using a CSS-sized .
answers question: http://stackoverflow.com/q/26852035
type: Answer

http://stackoverflow.com/comment/42281682
score: 0
type: QuestionComment
has text: @mawg Yes :) . so I'll google that 'RegExp' and 'Slice' functions to do same at PHP. thanks
type: Comment
comment on: http://stackoverflow.com/q/26860178

http://stackoverflow.com/comment/42262368
score: 0
type: QuestionComment
has text: @Brett, you probably mean 'do not include user data in your web ui output without encoding it first.' It's awful hard to get between the keyboard and the browser :-) And, while that's good advice, it's a little out of scope here.
type: Comment
comment on: http://stackoverflow.com/q/26849437

http://stackoverflow.com/a/26979651
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/26976625
has body: The template (map) won't be rendered until the model resolves. The model won't be resolved if either hook beforeModel or afterModel return promises. You placed the map in the application template and fetch articles from the index route, good. The problem is that nested routes, that return promises, block their parents too. The application transition is blocked until the index transition resolves. So while you wait, you can use Loading / Error Substates . In this case, the loading state. Example: http://emberjs.jsbin.com/sihedi/1/edit?html,js,output With the loading state you allow a partial rendering and when the nested route completes its transition, the loading template is replaced with whatever your app does.
accepted answer of: http://stackoverflow.com/q/26976625
has comment: http://stackoverflow.com/comment/42516136
upvote count: 1
has comment: http://stackoverflow.com/comment/42531257
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/26949321
has comment: http://stackoverflow.com/comment/42458985
has comment: http://stackoverflow.com/comment/42440166
has comment: http://stackoverflow.com/comment/42458699
score: -1
has body: EDITED: I'm (still) having a little trouble getting values from a nested array in JSON and appending them to generated html. I'm currently using the following JSON (updated): { "OuterArray": [ { "memberId": "01", "key01": "", "included": "true", "nestedArray": [ { "keyA": "", "keyB": "" }, { "keyA": "", "keyB": "" } ] }, { "memberId": "02", "key01": "", "included": "true", "nestedArray": [ { "keyA": "", "keyB": "" }, { "keyA": "", "keyB": "" } ] }, { "memberId": "03", "key01": "", "included": "false", "nestedArray": [ { "keyA": "", "keyB": "" }, { "keyA": "", "keyB": "" } ] }, { "memberId": "04", "key01": "", "included": "true", "nestedArray": [ { "keyA": "", "keyB": "" }, { "keyA": "", "keyB": "" } ] } ] } And this js: for (var i = 0; i < outerArray.length; i++) { if (outerArray[i].included !== "false") { var key01 = outerArray[i].key01; var key02 = outerArray[i].key02; // etc. var nestedArray = outerArray[i]["nestedArray"]; myDiv.innerHTML += " " + " " + key01 + " " + " " + key02 + " " + " " // help? + " " + " " var nestedArrayStuff = document.getElementsByClassName("nested-array-stuff")[i]; for (var j=0; j<outerArray.length; j++) { nestedArrayStuff.innerHTML += " " + nestedArray[j].keyA + " "; } } Note that one of the keys in the outer array has a boolean value which determines whether or not it (the outer array member) is - and its nested array stuff are - included in the page. So just to reiterate, the goal is: <!-- <snip: some outer array key/values here /> --> [e.g., nested array key 1 value] [e.g., nested array key 2 value] [etc.] If all the outer array members 'included' are 'true', everything outer & nested loads, but this is not exactly what I want; I need to filter so that only those 'included' !== "false". So now my problem is that despite being inside the if 'included'/else loop, the outer array members stop loading at the first excluded outer array member (actually, the next 'true' outer array member does load, but its nested array stuff doesn't, and …
possible better answer: http://stackoverflow.com/a/26949447
has title: Looping through nested array vaues in JSON, appending those values to generated html
answer count: 3
has answer: http://stackoverflow.com/a/26949447
downvote count: 1
accepted answer: http://stackoverflow.com/a/26949686
has comment: http://stackoverflow.com/comment/42458249
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/26961202
type: AnsweredQuestion
upvote count: 0
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/42458542
has comment: http://stackoverflow.com/comment/42458580
favorite count: 0
has answer: http://stackoverflow.com/a/26949686
type: Question

http://stackoverflow.com/a/26987123
downvote count: 0
score: 4
accepted answer of: http://stackoverflow.com/q/26987096
answers question: http://stackoverflow.com/q/26987096
type: AcceptedAnswer
has body: You are missing ); at the end. The function is never closed.
type: Answer
upvote count: 4

replace
tags question: http://stackoverflow.com/q/26900156
tags question: http://stackoverflow.com/q/26975991
type: Tag
tags question: http://stackoverflow.com/q/26987661
tags question: http://stackoverflow.com/q/26928323
tag name: replace

titanium
type: Tag
tags question: http://stackoverflow.com/q/26858670
tag name: titanium
tags question: http://stackoverflow.com/q/26952234
tags question: http://stackoverflow.com/q/26863260
tags question: http://stackoverflow.com/q/26919737
tags question: http://stackoverflow.com/q/26921249
tags question: http://stackoverflow.com/q/26907932
tags question: http://stackoverflow.com/q/26986928
tags question: http://stackoverflow.com/q/26919194
tags question: http://stackoverflow.com/q/26905333
tags question: http://stackoverflow.com/q/26885922

http://stackoverflow.com/a/26846814
has body: Well you can use localstorage if you are using html5 to store information.
score: 0
answers question: http://stackoverflow.com/q/26846670
type: Answer

http://stackoverflow.com/a/26933770
downvote count: 0
type: Answer
has body: Without any fulltext utility, you can use regex on a Collection.find like so: Tasks.find({text: new RegExp(searchTerm,"ig")});
answers question: http://stackoverflow.com/q/26929909
score: 1
upvote count: 1

http://stackoverflow.com/a/26938218
has comment: http://stackoverflow.com/comment/42421488
upvote count: 2
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26937850
accepted answer of: http://stackoverflow.com/q/26937850
type: Answer
has body: All numbers in JavaScript are floats (actually doubles). The corresponding specification is IEEE 754. To represent an integer without loss of precision it must fit into the mantissa which is 53 bit big for 64 bit floats. You can check the maximum integer with Number.MAX_SAFE_INTEGER which is 9007199254740991. Everything beyond that loses precision. Why is this a problem? (Most of) cryptography must be exact otherwise the secret cannot be learned. What you try to do is exponentiate and then apply the modulus, but since you do this separately, you get a very big number after exponentiation before it can be reduced through the modulus operation. The solution is to use some kind of BigNumber library (like BigInteger) which handles all those big numbers for you. Note that there is specifically a modPow(exp, mod) function which combines those two steps and calculates the result efficiently. Note that user secrets should be smaller than the modulus.
score: 2

http://stackoverflow.com/a/68690791
type: Answer
answers question: http://stackoverflow.com/q/26937966
has body: You will need to add some Ambient Light or Point Light since, MeshPhongMaterial reacts to Light &amp; hence is only visible in presence of Light, for best results/visibility use below code: const ambientLight = new THREE.AmbientLight(0xffffff, 0.5); const pointLight = new THREE.PointLight(0xffffff, 0.5); pointLight.position.x = 2; pointLight.position.y = 3; pointLight.position.z = 4; scene.add(ambientLight, pointLight);
score: 0

http://stackoverflow.com/comment/42985151
score: 0
comment on: http://stackoverflow.com/q/26991406
has text: You're right. Done!!
type: QuestionComment
type: Comment

http://stackoverflow.com/a/26872130
has comment: http://stackoverflow.com/comment/42303072
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/26871967
answers question: http://stackoverflow.com/q/26871967
upvote count: 1
has body: Do not use inline handlers. Use addEventListener instead function initialize(){ // initialization parameters function drop(){ //code to drop a marker } //ta-da! document.getElementById('drop').addEventListener('click', drop); } google.maps.event.addDomListener(window, 'load', initialize); HTML Drop Markers

http://stackoverflow.com/comment/67683968
has text: @Auiles, my actual issue was different,but this post helped me to figure that out. My id/values are purely dynamic and was an issue while saving it after editing.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28933091

http://stackoverflow.com/q/26916759
has body: WORKING $(document).ready(function() { $("#submit").click(function() { $.ajax({ url : "/vmstatus/", type : "POST", dataType: "json", data : { selected_customer : $("#selected_customer").val(), csrfmiddlewaretoken: '{{ csrf_token }}' }, success : function(json) { $('#table-repeat-data').remove(); setInterval(update_powerstatus, 2000); var on = ' ' var off = ' ' var sortarrows = ' ' $('#table_name').append(" VM Name" +sortarrows+ " Command Status PowerState " +sortarrows+ " Commands "); for (var index = 0; index < json.vmlist.length; index++) { var powerOn = ' Power On '; var powerOff = ' Power Off '; var resetVM = ' ResetVM '; if(json.vmlist[index][1] == 'poweredOn'){ $('#table-repeat-data').append (' ' + json.vmlist[index][0] + ' ' + json.vmlist[index][3] + ' ' + on + ' ' + powerOn + ' ' + powerOff + ' ' + resetVM + ' '); }else{ $('#table-repeat-data').append (' ' + json.vmlist[index][0] + ' ' + json.vmlist[index][3] + ' ' + off + ' ' + powerOn + ' ' + powerOff + ' ' + resetVM + ' '); } } }, error : function(xhr,errmsg,err) { console.log(xhr.status + ": " + xhr.responseText); } }); return false; }); $("#table-repeat-data").tablesorter(); }); function update_powerstatus(){ $.ajax({ url : "/vmstatus/", type : "POST", dataType: "json", data : { selected_customer : $("#selected_customer").val(), csrfmiddlewaretoken: '{{ csrf_token }}' }, success : function(json) { var on = ' ' var off = ' ' for (var index = 0; index < json.vmlist.length; index++) { var powerOn = ' Power On '; var powerOff = ' Power Off '; var resetVM = ' ResetVM '; if(json.vmlist[index][1] == 'poweredOn'){ var get_element_id = json.vmlist[index][2] + '1'; var stat_message_id = 'status' + json.vmlist[index][2]; document.getElementById(json.vmlist[index][0]).innerHTML = json.vmlist[index][0]; document.getElementById(stat_message_id).innerHTML = json.vmlist[index][3]; document.getElementById(get_element_id).innerHTML = on + "1"; document.getElementById(json.vmlist[index][2]).innerHTML = powerOn + ' ' + pow…
tagged with: jquery
accepted answer: http://stackoverflow.com/a/26918295
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
tagged with: javascript
type: Question
score: 0
has answer: http://stackoverflow.com/a/26918295
answer count: 1
has title: Dynamically Filter a Dynamically generated list based on id and textbox text

http://stackoverflow.com/a/26963780
answers question: http://stackoverflow.com/q/26963758
upvote count: 8
type: Answer
score: 8
accepted answer of: http://stackoverflow.com/q/26963758
has body: This is an array where the first element is an array containing 4 elements. Try this in your browser JavaScript console (press F12, then go to console) or in <a href="http://jsconsole.com/?var%20arr%20%3D%20%204%2C%20%22notes%22%2C%20%22PLEASE%20SET%22%2C%20%22%22%3B%20%2F%2F%20Initialize%20the%20array%0A%0Aconsole.log%20%28arr[0]%29%3B%20%20%20%20%2F%2F%20[4%2C%20%22notes%22%2C%20%22PLEASE%20SET%22%2C%20%22%22]%0Aconsole.log%20%28arr[0][0]%29%3B%20%2F%2F%204%0Aconsole.log%20%28arr[0][1]%29%3B%20%2F%2F%20%22notes%22%0Aconsole.log%20%28arr[0][2]%29%3B%20%2F%2F%20%22PLEASE%20SET%22%0Aconsole.log%20%28arr[0][3]%29%3B%20%2F%2F%20%22%22%0Aconsole.log%20%28arr[1]%29%3B%20%20%20%20%2F%2F%20undefined%0Aconsole.log%20%28arr[2]%29%3B%20%20%20%20%2F%2F%20undefined" rel="nofollow">jsconsole.com: var arr = 4, "notes", "PLEASE SET", ""; // Initialize the array console.log (arr[0]); // [4, "notes", "PLEASE SET", ""] console.log (arr[0][0]); // 4 console.log (arr[0][1]); // "notes" console.log (arr[0][2]); // "PLEASE SET" console.log (arr[0][3]); // "" console.log (arr[0][4]); // undefined console.log (arr[1]); // undefined console.log (arr[1][0]); // undefined
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/42355138
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/26888815
has text: see this post it may help http://stackoverflow.com/questions/5263640/html5-canvas-and-firefox
type: Comment

http://stackoverflow.com/q/26931082
accepted answer: http://stackoverflow.com/a/26931657
tagged with: d3.js
linked to: http://stackoverflow.com/q/13530584
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/20691805
has title: Trying to transfer Tributary D3.js example into JSFiddle
type: Question
tagged with: javascript
score: 0
answer count: 1
has body: I'm rather a beginner at both JS and D3.js; my JSFiddle is here. JSHint shows no errors, so I think I'm doing the D3 wrong. I'm trying to do the same thing as in these questions, adapting a Tributary example to run outside of that platform: "Exporting" a Tributary example that makes use of the tributary object - d3.js and Getting horizontal stack bar example to display using d3.js (I'm even adapting the same code as the latter) Unfortunately, there is no corrected JSFiddle or other example in either answer Here's my code: var VanillaRunOnDomReady = function() { var margins = { top: 12, left: 48, right: 24, bottom: 24 }; var data = [ {"key":"Nonviolent", "cat1":0.69, "cat2":0.21, "cat3":0.10}, {"key":"Violent", "cat1":0.53, "cat2":0.29, "cat3":0.18} ]; var catnames = {cat1: "No mental illness", cat2: "Mild mental illness", cat3: "Moderate or severe mental illness"}; var svg = d3.select('body') .append('svg') .attr('width', width + margins.left + margins.right) .attr('height', height + margins.top + margins.bottom) .append('g') .attr('transform', 'translate(' + margins.left + ',' + margins.top + ')'); var n = 3, // number of layers m = data.length, // number of samples per layer stack = d3.layout.stack(), labels = data.map(function(d) {return d.key;}), //go through each layer (cat1, cat2 etc, that's the range(n) part) //then go through each object in data and pull out that objects's catulation data //and put it into an array where x is the index and y is the number layers = stack(d3.range(n).map(function(d) { var a = []; for (var i = 0; i < m; ++i) { a[i] = {x: i, y: data[i]['cat' + (d+1)]}; } return a; })), //the largest single layer yGroupMax = d3.max(layers, function(layer) { return d3.max(layer, function(d) { return d.y; }); }), //the largest stack yStackMax = d3.max(layers, function(layer) { return d3.max(layer, function(d) { return d.y0 + d.y; }); }); var margin = {top: 40, right: 10, bottom: 20, left: 50}, width = 677 - margin.left - margin.right, height = 533 …
has answer: http://stackoverflow.com/a/26931657

keyboard
tags question: http://stackoverflow.com/q/26912442
tag name: keyboard
type: Tag

http://stackoverflow.com/q/26852389
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26852462
has comment: http://stackoverflow.com/comment/42267333
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/42267350
favorite count: 0
tagged with: angularjs
score: 2
has title: Angular JS Service Promise for Massaged Data
has body: Hi I am new to Angular and javascript and need a bit of help. I have a service that will need to aggregate data from various locations. I am building a sub-service to pull data from one of these locations. This subservice needs to 1) retrieve data from a REST web service, 2) massage it a bit and 3) return the final data to the invoking service. I have steps 1 and 2 working, however I am running into a problem on the third. In general, I am having a hard time understanding promises. Yes, I've read the documentation, googled around, even saw a cartoon on it, still can't figure it out.... Anyway, here is the relevant code: app.service('advsolr',['$http',function($http) { var DEBUG = false; var conf = get_conf(); var solr = 'serverurl'; var res = {}; var data = {}; this.query = function(searchp) { //Run Search query_solr(searchp); return data; }; var query_solr = function(search) { var g = 'serverurl' //works fine if (DEBUG) { console.log(g);} $http.get(g).then(function(response){ res = response.data; // this works parse_search_res(); //this massages the data and sticks it in the data object return data; //this does absolutely nothing here }); }; }]); The main query method is ran by the other service. This queries a Solr instance, gets the results and massages them into the format I want. I know I can do this elsewhere, but I want to have this as a standalone service for portability and plus I just want this to work dammit. So the query method runs, I had some other stuff in there, but I took it out for this example since it would not add value. It hits query_solr which gets the data and massages it with parse_search_res, which sticks it into the data global variable. Now the issue is that query method returns the empty data before parse_search_res had a chance to load the data in it. How can I prevent the query method from returning without the data? Thanks
has answer: http://stackoverflow.com/a/26852462
upvote count: 2
type: Question

http://stackoverflow.com/q/26935167
tagged with: loops
type: Question
has answer: http://stackoverflow.com/a/26935285
has comment: http://stackoverflow.com/comment/42414898
downvote count: 0
possible better answer: http://stackoverflow.com/a/26935271
has comment: http://stackoverflow.com/comment/42414825
tagged with: javascript
has answer: http://stackoverflow.com/a/26935271
has body: I'm making a form where the user can RSVP for themselves and up to 5 others. Each guest has a text field for their names and then radio buttons (yes or no) as to whether they are attending or not. By default Guest 1 &amp; 2 are displayed and then there is a button the user can click to add another guest up until guest #6. Guest's 3 - 6 are contained in their own objects like this: var guestThree = { name : document.querySelector('label[for="nameOfThirdGuest"]'), attendingYes : document.querySelector('label[for="guestThreeAttendingYes"]'), attendingNo : document.querySelector('label[for="guestThreeAttendingNo"]') }; var guestFour = { name : document.querySelector('label[for="nameOfFourthGuest"]'), attendingYes : document.querySelector('label[for="guestFourAttendingYes"]'), attendingNo : document.querySelector('label[for="guestFourAttendingNo"]') }; var guestFive = { name : document.querySelector('label[for="nameOfFifthGuest"]'), attendingYes : document.querySelector('label[for="guestFiveAttendingYes"]'), attendingNo : document.querySelector('label[for="guestFiveAttendingNo"]') }; var guestSix = { name : document.querySelector('label[for="nameOfSixthGuest"]'), attendingYes : document.querySelector('label[for="guestSixAttendingYes"]'), attendingNo : document.querySelector('label[for="guestSixAttendingNo"]') }; I am hiding guest's 3 - 6 using the following function which are then converted to methods for the above objects: function hideFields() { this.name.style.display = "none"; this.attendingYes.style.display = "none"; this.attendingNo.style.display = "none"; } I also have the opposite of the above function in showFields: function showFields() { this.name.style.display = "block"; this.attendingYes.style.display = "block"; this.attendingNo.style.display = "block"; } So the idea here is that when the add guest button (which is assigned to the variable addGuest) is clicked guest #3 will be added. Then when it's clicked again guest #4 will be added and so on until #6. I'v…
accepted answer: http://stackoverflow.com/a/26935285
favorite count: 0
answer count: 3
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/42414769
linked to: http://stackoverflow.com/q/750486
has answer: http://stackoverflow.com/a/26935774
type: AnsweredQuestion
has title: For loop not working as expected, what am I doing wrong?
duplicate of: http://stackoverflow.com/q/750486

http://stackoverflow.com/comment/42507429
has text: plunker or fiddle please ? :)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26987398
score: 1

http://stackoverflow.com/q/26847942
tagged with: jquery
has comment: http://stackoverflow.com/comment/42260001
favorite count: 0
type: UnansweredQuestion
downvote count: 2
has title: Converting Prototype to jQuery
linked to: http://stackoverflow.com/q/23074447
has comment: http://stackoverflow.com/comment/42258842
answer count: 0
upvote count: 2
has body: Converting "new Form.getElements(window.document.forms[0]) " Prototype to jQuery I am trying to convert a javascript code to jQuery which has some prototype.js codes Please help me to find a best solution in converting this. function init() { var arr = new Form.getElements(window.document.forms[0]); var list = document.getElementsByTagName("ul"); for (var i=0; i&lt;list.length; i++) { // Append ULs with a questionId attrib to the list var obj = list[i].getAttribute("questionid"); if (list[i].getAttribute("questionid")) { arr[arr.length] = list[i]; } } arr.each(function(element) { var dependsOn = element.getAttribute('dependson'); if (dependsOn &amp;&amp; $(dependsOn)) { new Form.Element.EventObserver($(dependsOn), function() { populateQuestionOptions(element); }); } }); } The doubt in finding an equivalent of new Form.getElements(window.document.forms[0]) in jQuery or javascript and new Form.getElements(window.document.forms[0]). The code I tried function init() { var arr = jQuery('form'); var list = document.getElementsByTagName("ul"); for (var i=0; i&lt;list.length; i++) { var obj = list[i].getAttribute("questionid"); if (list[i].getAttribute("questionid")) { arr[arr.length] = list[i]; } } arr.each(function(element) { var dependsOn = element.getAttribute('dependson'); if (dependsOn &amp;&amp; jQuery('#dependsOn')) { jQuery('#theForm').bind(jQuery('#dependsOn'),function() { populateQuestionOptions(element); }; } }); }
has comment: http://stackoverflow.com/comment/42259325
type: Question
tagged with: prototypejs
has comment: http://stackoverflow.com/comment/42260940
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/42259720

http://stackoverflow.com/q/26973282
has comment: http://stackoverflow.com/comment/42482233
has comment: http://stackoverflow.com/comment/42481900
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/26973662
has comment: http://stackoverflow.com/comment/42482183
upvote count: 2
accepted answer: http://stackoverflow.com/a/26973662
answer count: 1
has title: Canvas 'drawImage' returns ' No function was found that matched the signature provided.'
has body: I have two HTML5 canvases. I draw first on a temp one and then I want to copy the temp to the final one. Everything seems to work except the drawImage function which is weird because it accepts Images as well Canvases. I tried already the convert to DatatoUrl() method with no success. These are the objects I am using. Sizes etc are all set later. var paint = $('&lt;canvas/&gt;'); var temp_paint = $('&lt;canvas/&gt;'); temp_ctx = temp_paint[0].getContext('2d'); ctx = paint[0].getContext('2d'); Any ideas? This is the code function paintMouseUp(e) { e.preventDefault(); draw=false; ctx.drawImage(temp_paint, 0, 0); temp_ctx.clearRect(0, 0, settings.width, settings.height); mousePoints = []; } This is the error I am getting: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': No function was found that matched the signature provided.
has comment: http://stackoverflow.com/comment/42482286
has comment: http://stackoverflow.com/comment/42482122
tagged with: canvas
tagged with: javascript
tagged with: jquery
type: AnsweredQuestion
score: 2
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
downvote count: 0

http://stackoverflow.com/comment/42402590
has text: Those values I' need to mock in the controller or DOM.But How? Say the value for InPrgoress is 30 if {{item.status}} is "InProgress" and if {{item.status}} is "InHold" then value is 10.
comment on: http://stackoverflow.com/q/26928133
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42336977
has text: var listMemo = document.createElement('li');
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26891059

http://stackoverflow.com/comment/42439648
has text: not really but is a good practice use on because at the end it's gonna be used.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26948929

http://stackoverflow.com/comment/42474411
score: 0
comment on: http://stackoverflow.com/a/26968836
type: AnswerComment
has text: I did put jquery in the title but not explicitly the description. jquery or some other way was just fine.
type: Comment

http://stackoverflow.com/q/26942490
tagged with: javascript
linked to: http://stackoverflow.com/q/15951255
score: 0
answer count: 1
tagged with: jquery
has title: Using callback function with loop in underscore.js of backbone.js project not working
tagged with: backbone.js
tagged with: ajax
has body: I am developing backbone.js project with underscore.js and require.js. I created a javascript callback function in order to get data from web service using ajax : this.getProCallBack = function(type,callback){ var result = ""; $.ajax({ url: url, //rest url type:"GET", dataType:"json", contentType: "application/json", success: function(response){ result = callback(response); } }); } Here is View of backbone.js define(["jquery" , "underscore" , "backbone", "text!templates/Layout/ba.html", "promo" ],function($, _, Backbone, BannerTem, Promo){ var BaView = Backbone.View.extend({ initialize : function(){ }, render: function(options){ var _banner = _.template(BannerTem); $(this.el).html(_banner({type : this.options.type})); return this; } }); return BannerView; }); I'm using text.js of to call underscore template with html file. Here is a template : ba.html <% var home = new Promo(); home.getProCallBack(type,function(result){ _.each(result, function(slideimg){ switch(slideimg.ItemCount){ case 0 : alert(slideimg.PromotionImage); %> <a href="#detail/<%=slideimg.ItemList[0].UID%>"> " /> <% break; default: %> " /> <% } %> Problem : alert() is working in case block, yet did not show in DOM. I'm not sure is it because of _.each() does not work in callback function or what could be caused this problem. Any idea what could be causing this. Thanks.
accepted answer: http://stackoverflow.com/a/26943348
type: AnsweredQuestion
tagged with: underscore.js
type: Question
has answer: http://stackoverflow.com/a/26943348

http://stackoverflow.com/q/26832525
has title: Reload/redirect page from included php file
tagged with: http-redirect
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28843681
has answer: http://stackoverflow.com/a/26832774
has body: My application has the following structure: main.php it includes the config.php that has the credentials to the database. page1.php wich also includes the config.php and calls get_page1_content.php through AJAX. get_page1_content.php wich also includes the config.php and is called through ajax every time page1.php needs. My url is allways www.mysite.com/main.php and I load all the pagesX.php files through JavaScript. example of page1.php, get_page1_content.php and main.php first lines: include("config.php"); $conf=new config(); I want to check if the php session is UP and if it's not I want to refresh the page. Problem is that all my files include the config.php for now in config.php I have the following __construct()function: if (isset($_SESSION['@ADMIN'])){ $result=true; } else { echo "&lt;meta http-equiv=\"refresh\" content=\"0\"&gt;"; } But this doesn't seem to work. I can see i get the tag to refresh in response to get_page1_content.php but the browser doesn't refresh. Is my architecture wrong? How can I fix it? Thank you in advance.
type: Question
has answer: http://stackoverflow.com/a/28843681
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/26871293
answer count: 3
tagged with: jquery
possible better answer: http://stackoverflow.com/a/26832774
tagged with: ajax

http://stackoverflow.com/q/26845803
has comment: http://stackoverflow.com/comment/42254944
answer count: 1
tagged with: javascript
has title: How to add rows and table on a button click in angularjs?
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has body: I need a table whose rows can be added dynamically on a button click and the table itself can be re-created and shown on the page with another button click I have created the following HTML: Add Rows Add Row Add Table Name Age Here's my Controller: angular.module('MyApp', []) .controller('MainController', [ '$scope', function($scope) { $scope.table=['Table 1']; $scope.rows = ['Row 1']; $scope.counter = 3; $scope.addRow = function() { $scope.rows.push('Row ' + $scope.counter); $scope.counter++; } $scope.addTable = function() { $scope.table.push('Table ' + $scope.counter); $scope.counter++; } }]); Everything works fine except that when I click on Add Table , The previous table along with the added rows gets copied. I want to just have the initial instance of the table with just one row to add age and name. Please help: Code pen Link :http://codepen.io/anon/pen/wBwXJP
has answer: http://stackoverflow.com/a/26846040
favorite count: 0
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/42254967
type: Question

http://stackoverflow.com/a/26982468
accepted answer of: http://stackoverflow.com/q/26961369
score: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/26961369
has body: AngularJS does nothing special here. Refer to the regular rules for referencing properties in a javascript object. In a controller: console.log($scope.data['Handedness;']) In a view: {{ data['Handedness;'] }}

http://stackoverflow.com/comment/42486113
has text: In the WP repo its called just *TinyMCE Table Button* unless I'm horribly wrong.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26933296
type: AnswerComment

http://stackoverflow.com/a/26931190
answers question: http://stackoverflow.com/q/26930464
score: 0
has body: Depending on how strict you want to be, the following would be a starting point: str .replace(/^\(|\)$/) // remove parens .split(',') // split on commas .map(function(entry) { // then for each entry return entry.split(':')[1]; // split on colon and return 2nd half }) ; Perhaps some trimming should be added.
type: Answer

http://stackoverflow.com/q/26850586
has answer: http://stackoverflow.com/a/26851265
score: 0
answer count: 1
tagged with: jquery
tagged with: blogs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: How to make content from an input box transfer to an paragraph element, like a blog
tagged with: css
has body: I am trying to make a website thats like a blog but i cant figure out how to align text in an input element and make the entry from that element be posted and saved as a paragraph element below it.... like facebook. I know this isn't a very detailed question but im new to HTML, Javascript and CSS. Fiddle with it here. Social Rejects Log-In <div class="nav" Home My Page My Followers Following About S.R. Feature not yet added! This feature has not yet been constructed. Please check back for more info. These things will be broken for awhile. Okay Congratulations! Enter Secret password: Okay Rodney Mahan This page is in beta <div class="header" About Rodney: Enjoys Making Websites CEO of Mahan's Web Design Born on February 4th, 1999 Rodney's Blog http://jsfiddle.net/MahanWebDesign/bm8fz2u5/1/
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/42263621

http://stackoverflow.com/comment/42451599
type: Comment
has text: Sure. Before that can you accept the answer and upvote if you like.
comment on: http://stackoverflow.com/a/26955720
type: AnswerComment
score: 0

http://stackoverflow.com/q/26979455
accepted answer: http://stackoverflow.com/a/26979708
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42493483
upvote count: 1
type: Question
score: 1
has body: JS newb here and was handed a project to take over. I have a situation that I was able to get working (and took me forever to do so), but I don't understand the JS internals behind it. Can someone shed light on this? I have a JS file with two different type of function blocks inside of a js file that I'll call last.js b/c it is the last file listed: Immediate function that is passed the jQuery object (function ($) { ... }(jQuery)); And right after that you have the standard jQuery doc load code: $(function () { ... }); This JS file is the last one referenced on my page and I assume it will be the last one called/loaded when the page executes. But that isn't quite the case. The immediate function (1) is called first. Next, there jqueryvalidation.js file is loaded and executed. Finally, the jQuery ready() function in last.js is called. So this effectively runs the immediate function before my other js libraries, then it loads/runs the other js files in order and lastly it comes back to my last.js file and finishes it. How can the last file in the list be called before my jqueryvalidation.js file? And the immediate function is passed jQuery, so jQuery would have had to already be loaded and the page should be ready at that time. For me to use jqueryvalidation.js I have to put my custom validation code in the immediate window. If I put it in the jQuery ready function it gets called after the validation code has parsed the page and doesn't do anything. Why would these two functions that are in the same js file have a completely different order of execution?
has title: javascript loading before jQuery Ready?
has comment: http://stackoverflow.com/comment/42493354
has comment: http://stackoverflow.com/comment/42499474
answer count: 1
tagged with: document-ready
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/42494344
has answer: http://stackoverflow.com/a/26979708

http://stackoverflow.com/q/26879924
has answer: http://stackoverflow.com/a/26940925
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: asp.net
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
tagged with: html5-draggable
type: UnansweredQuestion
upvote count: 1
has title: JavaScript triggered by html5sortable's sortupdate is being run twice
has body: On an aspx page I have a sortable list like this that is made using this plugin. Shot Name - 1 Shot Name - 2 Shot Name - 3 Then at the bottom of the page I have code that loads the js for the sortable list and sets up a function called "sortupdate" which is run each time the order of the list changes. Here's where things get bizarre. Upon moving an item from one place to another, such as item 1 to item 2's spot, the alert works as expected, returning "0 -> 1" BUT then another alert box shows up with the exact same "0 -> 1". It seems to me that the Javascript is running twice for some reason, but I've never seen anything like this before, and have no idea what could be causing it. I need it to run only once, otherwise extremely strange things will happen when I try to store the new order. Anyone seen a similar issue before, and have some advice? I can't tell if it's a JavaScript problem, an ASP.NET problem, or a html5sortable problem, so I don't even know where to begin.
score: 1

google-chrome-app
tags question: http://stackoverflow.com/q/26851116
tags question: http://stackoverflow.com/q/26886249
type: Tag
tags question: http://stackoverflow.com/q/26964846
tags question: http://stackoverflow.com/q/26844031
tags question: http://stackoverflow.com/q/26918255
tags question: http://stackoverflow.com/q/26877390
tags question: http://stackoverflow.com/q/26963435
tags question: http://stackoverflow.com/q/26864571
tags question: http://stackoverflow.com/q/26838004
tag name: google-chrome-app

http://stackoverflow.com/comment/42318159
type: Comment
has text: I see. thanks so much although I did not know how to use e.target.nodeName lol
comment on: http://stackoverflow.com/a/26880976
type: AnswerComment
score: 0

http://stackoverflow.com/comment/42248655
has text: Unfortunately... I just learned today that jsonp transactions are apparently async by nature. You can't set jsonp to transact synchronously :(
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26836492

http://stackoverflow.com/comment/82823190
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/46000404
has text: @VladislavDimitrov see this demo. http://jsfiddle.net/NF2jz/5721/ change value of a to 1 and it will update text according to second request.

http://stackoverflow.com/comment/42393232
has text: Sorry, I am expecting the result to be the table within "spn1" to add the new item but not if it is an error item or already in the table. I don't think you can have a database in a GAS web app aside from a spreadsheet and that would cause problems if two people are using it at the same time so I was hoping I could get it by just scraping the innerHTML of this table and appending it. The result I am getting is no response but just let me check with a failure handler... and nothing. It isn't even giving me an error. Also I made a mistake in the original code, didn't press undo enough. fixed.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26900373

http://stackoverflow.com/a/26868491
accepted answer of: http://stackoverflow.com/q/26867456
type: Answer
score: 1
upvote count: 1
has body: The only way to get default anchor handling in the browser - is to use anchors! But since you can't wrap the TR in an anchor, you must wrap the contents of each TD in an anchor. This will work best if your TD's are rendered without gaps between them. HTML: &lt;tr class="oneResultat" data-href="annonce.php"&gt; ... &lt;/tr&gt; Javascript: jQuery(document).ready(function($) { var $oneTR = $(".oneResultat"); var href = $oneTR.attr("href"); var wrap = "&lt;a href='"+href+"'&gt;&lt;/a&gt;"; $("tr.oneResultat &gt; td").wrapInner(wrap); }); Possible CSS to make the anchors display full-width in the TD's: tr.oneResultat &gt; td &gt; a { display:block; width:100%; height:100%; } Note this creates regular anchors which are triggered by left-click, not right-click. If you must use right-click, then make the anchors href='#' and attach an event handler for click on those anchors, then invoke one of the many jQuery contextmenu plugins to render a context-sensitive menu. Let me know if you want an example of that, but for now I'll assume you want regular left-click browser anchor behaviour.
answers question: http://stackoverflow.com/q/26867456
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/26980699
has body: You can specify a 3rd argument to .post() that is the "success" callback. It is a function to call when the .post execution is successful. $.post("testpage.php", $("#payment-form").serialize(), function() { alert('post was successful!')}) Source: http://api.jquery.com/jquery.post/
upvote count: 2
accepted answer of: http://stackoverflow.com/q/26980656
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42495673
answers question: http://stackoverflow.com/q/26980656
type: Answer
score: 2
downvote count: 0

infinite-scroll
tag name: infinite-scroll
type: Tag
tags question: http://stackoverflow.com/q/26984477
tags question: http://stackoverflow.com/q/26932950
tags question: http://stackoverflow.com/q/26927476

http://stackoverflow.com/q/26865007
has answer: http://stackoverflow.com/a/37412091
tagged with: macos
tagged with: node.js
upvote count: 3
has body: I am using Node-Webkit for making an image enhancement app. I have a download button clicking on which executes the following. document.getElementById("download").onclick = function(){ var c = Caman("canvas"); if(file.type.replace("image/","")=="jpeg"){ //save as jpeg c.save('jpeg'); } else { //saves as png by default c.save(); } } } This function is supposed to download the image if run in browser, but the download doesn't work in the Node-Webkit app. So, I want to make it function to open the data:image in default browser so that I can save image from the browser, but I have no idea how to do that. Can anyone help me with this? Thanks.
type: UnansweredQuestion
tagged with: node-webkit
has answer: http://stackoverflow.com/a/26865277
score: 3
type: Question
has comment: http://stackoverflow.com/comment/42358727
tagged with: webkit
answer count: 2
downvote count: 0
has title: How can I open data:image in browser from node-webkit app?
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/26899236
tagged with: setter
type: Question
tagged with: object
tagged with: javascript
score: -1
has body: Which one is the preferred way to increase a value in a API. .setX(val,increase){ if(increase) this.x += val; else this.x = val; } .increaseX(val){ this.x += val; } .incrementX(val){ this.x += val; } .addX(val){ this.x += val; }
has answer: http://stackoverflow.com/a/26899293
answer count: 1
has comment: http://stackoverflow.com/comment/42351341
favorite count: 0
has title: JavaScript API Function Name Best Practices
has comment: http://stackoverflow.com/comment/42351682
upvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26899293
tagged with: oop
downvote count: 2

http://stackoverflow.com/q/26960489
score: 2
type: AnsweredQuestion
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
has title: How to set selectize.js value programatically using Angular?
tagged with: angularjs
type: Question
tagged with: selectize.js
has answer: http://stackoverflow.com/a/26983912
upvote count: 2
tagged with: angularjs-directive
has body: I'm using this AngularJS directive for selectize.js: https://github.com/kbanman/selectize-ng I have two dropdowns and I want to populate one of them selectizeVat depending on what value is selected in the other selectizeProducts. I have read up on the selectize.js API and found the setValue method but how do I utilize it? Below is my template and controller code: Template &lt;div ng-controller="dropdownController"&gt; &lt;select selectize="selectizeProducts" options="products" ng-model="product"&gt;&lt;/select&gt; &lt;select selectize="selectizeVAT" options="vats" ng-model="chosenProduct.vat"&gt;&lt;/select&gt; &lt;/div&gt; Controller app.controller('dropdownController', function($scope, $filter) { $scope.chosenProduct = ''; $scope.vats = [ {'id': 0, 'vat': '25%'}, {'id': 1, 'vat': '16%'}, {'id': 2, 'vat': '6%'}, ]; $scope.selectizeProducts = { valueField: 'id', labelField: 'name', searchField: 'name', onChange: function(id) { // Get an object from $scope.products by id $scope.chosenProduct = $filter('getById')($scope.products, id); } }; $scope.selectizeVat = { valueField: 'id', labelField: 'vat', searchField: 'vat', }; }); Also $scope.products looks like this: {'id': 1, 'name': 'My option', 'nr': 1, 'vat': 0} and the basic idea is to choose a product and the VAT would be populated automatically in the selectizeVat dropdown. Thanks!
accepted answer: http://stackoverflow.com/a/26983912
tagged with: javascript

http://stackoverflow.com/a/26891959
has comment: http://stackoverflow.com/comment/42347060
has comment: http://stackoverflow.com/comment/42369624
answers question: http://stackoverflow.com/q/26846519
has body: If you are returning raw HTML in the AJAX request you will probably need to add the CSS and JS references there. You are not really returning a view that would normally have a layout that includes the references.
has comment: http://stackoverflow.com/comment/42383661
type: Answer
accepted answer of: http://stackoverflow.com/q/26846519
has comment: http://stackoverflow.com/comment/42373801
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/42347526

http://stackoverflow.com/comment/42282909
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26861142
has text: Probably you find this type of solution.. [See This](http://stackoverflow.com/questions/13695537/opening-and-closing-a-new-tab-when-downloading)

http://stackoverflow.com/q/26954682
type: Question
has answer: http://stackoverflow.com/a/26954742
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/42584752
score: 0
tagged with: serialization
type: UnansweredQuestion
tagged with: spring-mvc
tagged with: java
has title: Serializing as javascript object
has body: I am working on a Spring MVC and I want to insert javascript into the html output for analytics purpose. I am only partially familiar with serialization but I figured it does the job nicely rather than manually constructing a string containing javascript. Would it be possible to generate something the following snippet? Any pointers would be great! "emd" : new Date('6/6/2014') Update: I need to output a javascript object which has many fields which may be complex. Hence, on the backend I am gathering all the data into java beans with all the information and I plan to use Jackson mapper to convert to string that I can just output through JSP. Generating the above snippet does not seem straightforward though, not sure if it is even possible. For context, the rest of that javascript looks something like this. Analytics.items["item_123"] = { //ratings and reviews "rat" : a.b, //the decimal value for the rating "rev" : xxxx, //integer //list of flags that indicate how the product was displayed to the customer //add as needed...tracking code will pick up flags as needed when they are available "dec" : ["mbe", "green", "recycled"], //delivery messaging "delivery" : { "cd" : new Date() //current date "offers" : [{ "type" : "abcd" "emd" : new Date('6/6/2014'), "weekend" : true } ] }, };
has comment: http://stackoverflow.com/comment/42589002

http://stackoverflow.com/comment/42391562
type: Comment
comment on: http://stackoverflow.com/a/26918685
score: 1
type: AnswerComment
has text: Nice find! Are you planning to make a PR to [aliasify](https://github.com/benbria/aliasify)?

http://stackoverflow.com/comment/69277539
comment on: http://stackoverflow.com/a/26948614
type: Comment
has text: Also: https://indisnip.wordpress.com/2010/09/07/storing-custom-data-into-indesign-file-xmp/
type: AnswerComment
score: 0

http://stackoverflow.com/comment/42360466
score: 0
type: Comment
has text: Updated the code to check whether transition has already started applying its changes. Hope this helps.
comment on: http://stackoverflow.com/a/26904293
type: AnswerComment

http://stackoverflow.com/comment/42383385
type: QuestionComment
has text: getPosts() must be dumping out json text already, so unless it's double-encoding your data, the whole json.parse business is pointless. why not just `$.each(newPosts, ...)`?
comment on: http://stackoverflow.com/q/26917407
score: 4
type: Comment

http://stackoverflow.com/comment/42501421
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26983474
type: AnswerComment
has text: About the anchor tag. Are you sure you are not making a recursive call to the OpenTutorial function. I hope you don't have $('#OpenTutorial').click() within the OpenTutorial function :)

http://stackoverflow.com/a/26912218
answers question: http://stackoverflow.com/q/26909215
type: Answer
has body: Resolved! window.onload = function() { $("#trigger").mousedown(function(e){ if(e.button == 2){ $("#file").trigger("click"); } }); }
accepted answer of: http://stackoverflow.com/q/26909215
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/26864629
score: 0
has title: How to compile many JS and CSS files into one big JS and CSS file?
possible better answer: http://stackoverflow.com/a/26864823
has answer: http://stackoverflow.com/a/26864726
accepted answer: http://stackoverflow.com/a/26864726
has body: I have many js and css files. Is there any simple utility to compile them into two files? util --input_dir=js/ --output=build.js util --input_dir=css/ --output=build.css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26864823
type: Question
answer count: 2
tagged with: compilation
tagged with: javascript

http://stackoverflow.com/q/26907430
favorite count: 0
accepted answer: http://stackoverflow.com/a/26907944
has title: Search with smooth scroll
downvote count: 0
tagged with: scroll
has answer: http://stackoverflow.com/a/26907944
has body: Can anyone show me how to add a smooth scroll to this script. search and scroll js function searchText() { console.log($(window).scrollTop($("p:contains('" + $("#search-input").val() + "'):eq(0):last").offset().top)); } many thanks!!
type: AnsweredQuestion
score: 1
tagged with: search
type: Question
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/26930535
type: AnsweredQuestion
has title: How break eachLayer leaflet?
tagged with: foreach
has comment: http://stackoverflow.com/comment/70939795
tagged with: leaflet
score: 1
upvote count: 1
has body: How can I exit a loop (eachLayer) in leaflet? I tried break and return but it did not work. Below is my code: var bounds = map.getBounds(); var notInBounds = true; markers.eachLayer(function(marker) { if (bounds.contains(marker.getLatLng())) { notInBounds = false; break; } });
type: Question
accepted answer: http://stackoverflow.com/a/26930968
possible better answer: http://stackoverflow.com/a/26933940
has answer: http://stackoverflow.com/a/26933940
tagged with: javascript
answer count: 2
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/26930968

http://stackoverflow.com/comment/45859188
type: QuestionComment
has text: You generally don't want to know how much the user scrolled but how far the page has been scrolled in total, which is scrollTop / scrollLeft. Sometimes you want that in percentages, for instance when building responsive sites with parallax etc, but that's still the same thing you just divide scrollTop by the total height. The scroll event fires continously when scrolling, so you'll need to debounce it when getting the amount scrolled each time the user scrolls, and the result will not be very accurate and it's generally something you'd avoid doing.
comment on: http://stackoverflow.com/q/26990986
score: 0
type: Comment

http://stackoverflow.com/a/26898297
answers question: http://stackoverflow.com/q/26898209
score: 0
has body: Using jQuery: $("button").click(function() { var myrow = $(this).parent().index(); var mycol = $(this).index(); var deadly = $("#deadly"); var deadly_row = deadly.parent().index(); var deadly_col = deadly.index(); var x_dist = Math.abs(mycol - deadly_col); var y_dist = Math.abs(myrow - deadly_row); // Do what you want with x_dist and y_dist });
type: Answer

http://stackoverflow.com/a/47948306
answers question: http://stackoverflow.com/q/26841084
has body: Kudos to @ymakux comment "It's better to use built-in classes " I have been trawling SO for ages looking to get a Google Map to neatly fit into a bootstrap div and your answer is perfect! So for a newbie like me using maps with Bopotstrap utilizing the sample code supplied by google at https://developers.google.com/maps/documentation/javascript/geolocation Add divs as suggested by @ymakux just prior to map div similar to this: `
type: Answer
score: 6
upvote count: 6
has comment: http://stackoverflow.com/comment/82867141
downvote count: 0

http://stackoverflow.com/comment/42275133
type: AnswerComment
has text: What does this have to do with the original question?
type: Comment
comment on: http://stackoverflow.com/a/26856552
score: 0

http://stackoverflow.com/q/26970713
favorite count: 0
has answer: http://stackoverflow.com/a/26971130
type: UnansweredQuestion
tagged with: razor
has body: I'd appreciate any help. I'm trying to change the link href each time with Kendo Grid change() event: function ContractsGrid_onChange(e) { var selected = this.select()[0], item = this.dataItem(selected); $('#createOnBase').attr('href', function () { var createLink = document.getElementById("createOnBase"); var route = 'http://' + createLink.hostname + createLink.pathname + "?contractID =" + item.ID; return route; }); } @Ajax.ActionLink("Create", "CreateOnBase", new { contractID = "_contractID_" }, new AjaxOptions() {... }, new { id="createOnBase" }) I'm not sure with current approach, because i have different hostnames (localhost with port or server domain) The best way would be: var route = "@Url.Action('CreateOnBase', new { contractID = ??})"; But I cannot use JS variable (item.ID) in razor. Also, this.href.replace("_contractID_", item.ID) won't work for several changes. Can you help me with another solution? Thanks a lot!
has comment: http://stackoverflow.com/comment/42477816
has answer: http://stackoverflow.com/a/26971190
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/42477609
type: Question
answer count: 2
tagged with: asp.net-mvc
tagged with: javascript
tagged with: jquery
has title: Change route values of a link with jQuery
upvote count: 1

http://stackoverflow.com/comment/138093927
type: AnswerComment
comment on: http://stackoverflow.com/a/45493827
type: Comment
has text: You are correct that my wording and understanding was wrong but yes I expected a mixin keyword. Just by comparing typescript mixin docs vs dart mixin docs one can see how dart is much more expressive in this regard and typescript seems like a low level implementation of the pattern. So probably this was not an afterthought but it was intentionally kept low level. Actually typescript just shows you how to built the pattern yourself with existing language features, there is no "mixin" declaration as in Dart.
score: 0

http://stackoverflow.com/q/26976925
has comment: http://stackoverflow.com/comment/42488492
linked to: http://stackoverflow.com/q/750486
type: Question
has comment: http://stackoverflow.com/comment/42488519
score: 2
type: AnsweredQuestion
has body: I want to simulate a progress bar using JS/JQuery, this is my HTML code : 0% I want to go from 0 to 100 and see -Visually- the progress in slow motion, So What I need exactly is a For Loop and a pause function, but unfortunately there is no sleep-like function in Javascript 1st try : After doing some research, I found the setTimeOut function in Jquery, you can find herein the Javascript code : for (i = 0; i < 100; i++) { setTimeout(function() { $("#percentage").text(i+"%"); }, 1000); } But unlikely, this won't work, because according to the documentation the setTimeout function is asynchronous, and the execution of the Javascript will continue. That means that there is no pause-like behavior, and the progress bar will go from 0 to 100 after 1000ms instead of going from 0 to 1. 2nd try : While setTimeout can't solve my problem, I tried to implement my own sleep() function, and here it is : function sleep(ms){ var waitTimeInMilliseconds = new Date().getTime() + ms; while(new Date().getTime() < waitTimeInMilliseconds ) true; } While I was thinking that this is the silver bullet to this scenario -It was a bad Idea, I know-, I was surprised since also this approach didn't solve my problem, and the interface remains Idle during the sleep time, (I cannot click, select or do anything in my HTML page). How can I solve this problem ?
has comment: http://stackoverflow.com/comment/43996535
accepted answer: http://stackoverflow.com/a/26976970
tagged with: sleep
has comment: http://stackoverflow.com/comment/42488533
answer count: 2
downvote count: 0
tagged with: pausing-execution
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Synchronous Sleep function in Javascript
has answer: http://stackoverflow.com/a/26976970
upvote count: 2
possible better answer: http://stackoverflow.com/a/26977058
has answer: http://stackoverflow.com/a/26977058

protractor
tags question: http://stackoverflow.com/q/26926330
tags question: http://stackoverflow.com/q/26848268
tag name: protractor
tags question: http://stackoverflow.com/q/26883663
tags question: http://stackoverflow.com/q/26970684
type: Tag
tags question: http://stackoverflow.com/q/26972725
tags question: http://stackoverflow.com/q/26922498
tags question: http://stackoverflow.com/q/26965850
tags question: http://stackoverflow.com/q/26841064
tags question: http://stackoverflow.com/q/26894468
tags question: http://stackoverflow.com/q/26865411
tags question: http://stackoverflow.com/q/26943115

http://stackoverflow.com/a/26870571
type: Answer
upvote count: 3
accepted answer of: http://stackoverflow.com/q/26869913
score: 3
has comment: http://stackoverflow.com/comment/42304037
answers question: http://stackoverflow.com/q/26869913
has comment: http://stackoverflow.com/comment/42303640
type: AcceptedAnswer
downvote count: 0
has body: How about something like this (I commented out your old code): function addtoScreen(vTag){ var screen = document.getElementById("screen"); if(currentFunction.length == 1){ var newCalc = document.createElement("p"); //newCalc.setAttribute("class", "calc"); newCalc.className = "calc"; //var opInt = "&lt;span&gt;"+vTag+"&lt;/span&gt;"; var opInt = document.createElement("span"); opInt.innerHTML = vTag; //newCalc.innerHTML = opInt; newCalc.appendChild(opInt); //screen.innerHTML = newCalc; screen.appendChild(newCalc); }else{ //var opInt = "&lt;span&gt;"+vTag+"&lt;/span&gt;"; var opInt = document.createElement("span"); opInt.innerHTML = vTag; newCalc = screen.lastChild; //newCalc.innerHTML = opInt; if(newCalc) { newCalc.appendChild(opInt); } else { screen.appendChild(opInt); } } }

http://stackoverflow.com/a/26909166
upvote count: 1
has body: jsFiddle demo var day = new Date().getDay(); var video = document.getElementById('videorotator'); var videos =[ "http//www.youtube.com/embed/UZopKnDHti8", "http://www.youtube.com/embed/z8GHNhteHJQ" ]; video.setAttribute('src', videos[day%videos.length]); You said you want one video/day, so get the day number and get the video src.
type: Answer
answers question: http://stackoverflow.com/q/26908991
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/42368382

http://stackoverflow.com/a/26950841
type: Answer
score: 2
upvote count: 2
has body: Absolutely. In Express interact with databases, build business logic, expose API routes. Your client side files could be served by Express or anything else (nginx, apache, whatever). jQuery can be used to call your Express API, though I would recommend Angular or Backbone for larger projects. Grunt can be used for host of automated tasks such as concat files for production, run tests, reload server. (I prefer Gulp.js) For testing see mocha, karma, or do google search and find plenty of others. I enjoy sails.js and think it is a great framework to learn on. Here are some example apps for it link If you have your client side served from a different domain you will need to read about CORS. Do some more research there are tons of other answered questions and resources on this already. Check out Yeoman.io for generators that will setup the structure for a variety of apps.
has comment: http://stackoverflow.com/comment/42442925
answers question: http://stackoverflow.com/q/26950677
downvote count: 0
has comment: http://stackoverflow.com/comment/42442976
has comment: http://stackoverflow.com/comment/42572982

http://stackoverflow.com/a/26886177
has comment: http://stackoverflow.com/comment/42327006
answers question: http://stackoverflow.com/q/26885908
has body: Just add : function randomImage() { var newImage = getRandomImage(); console.log(newImage); document.body.appendChild(newImage); }; and to the button onclick add: &lt;input type="button" value="More Winry" onclick="randomImage()"&gt; EDIT To replace existing image: function randomImage() { var newImage = getRandomImage(); console.log(newImage); var img = document.getElementsByTagName('img').remove(); document.body.appendChild(newImage); }; Element.prototype.remove = function() { this.parentElement.removeChild(this); } NodeList.prototype.remove = HTMLCollection.prototype.remove = function() { for(var i = 0, len = this.length; i &lt; len; i++) { if(this[i] &amp;&amp; this[i].parentElement) { this[i].parentElement.removeChild(this[i]); } } } add those function instead. Credits to JavaScript: remove element by id also, no need of JQuery in functions so JQuery tag is useless.
accepted answer of: http://stackoverflow.com/q/26885908
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/42477854
type: AnswerComment
has text: you can use [bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) as an alternative
type: Comment
score: 1
comment on: http://stackoverflow.com/a/26970978

http://stackoverflow.com/q/26841439
possible better answer: http://stackoverflow.com/a/26841525
score: 0
has body: I've done some changes to Jssor's JavaScript library 'jssor.slider.js'. After testing has been completed, I'd now like to create a new compressed 'jssor.slider.min.js'. Checking the available command line options of the compression tool 'Jssor.Compress.exe' I cannot see how to do this. An explicit command line call to do this would be great! Any ideas? Thanks in advance, Mario
tagged with: jssor
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26841525
has title: How to create a compressed JavaScript library for Jssor
has answer: http://stackoverflow.com/a/26841701
accepted answer: http://stackoverflow.com/a/26841701
answer count: 2
tagged with: javascript

http://stackoverflow.com/q/26981034
answer count: 3
tagged with: parsing
tagged with: http://stackoverflow.com/tag/xml
favorite count: 0
has answer: http://stackoverflow.com/a/26996439
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/26981126
has answer: http://stackoverflow.com/a/74868616
has answer: http://stackoverflow.com/a/26981126
score: 7
upvote count: 7
type: Question
has title: Create XML DOM Element while keeping case sensitivity
accepted answer: http://stackoverflow.com/a/26996439
has body: I'm trying to create the following element nodetree: &lt;v:custProps&gt; &lt;v:cp v:nameU="Cost"&gt; &lt;/v:custProps&gt; with: newCustprop = document.createElement("v:custProps"); newcp = document.createElement("v:cp"); newcp.setAttribute("v:nameU", "Cost"); newCustprop.appendChild(newcp); However, document.createElement("v:custProps") generates &lt;v:custprops&gt; as opposed to &lt;v:custProps&gt;. Is there anyway to escape this parsing? Edit 1: I'm currently reading this article on nodename case sensitivity. It's slightly irrelevant to my problem though because my code is unparsed with &lt;![CDATA]]&gt; and I'd rather not use .innerHTML.
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/26990899
possible better answer: http://stackoverflow.com/a/26995043
upvote count: 48
has comment: http://stackoverflow.com/comment/42519441
favorite count: 0
tagged with: xss
has title: Is it really insecure to build HTML strings in Javascript?
tagged with: security
has comment: http://stackoverflow.com/comment/42572630
score: 48
has comment: http://stackoverflow.com/comment/42516197
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42553285
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42513445
has comment: http://stackoverflow.com/comment/42514032
has comment: http://stackoverflow.com/comment/42513209
type: Question
has answer: http://stackoverflow.com/a/26991020
has body: The company who hosts our site reviews our code before deploying - they've recently told us this: HTML strings should never be directly manipulated, as that opens us up to potential XSS holes. Instead, always use a DOM api to create elements...that can be jQuery or the direct DOM apis. For example, instead of this.html.push( 'Click to play' ); They tell us to do var quizAuLink = $( 'a' ); quizAuLink.addClass( 'quiz-au' ); quizAuLink.data( 'src', this.au ); quizAu.text( 'Click to play' ); quizAu.prepend( '' ); Is this really true? Can anyone give us an example of an XSS attack that could exploit an HTML string like the first one?
linked to: http://stackoverflow.com/q/24816
has comment: http://stackoverflow.com/comment/42521808
has comment: http://stackoverflow.com/comment/42513292
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26991020
has comment: http://stackoverflow.com/comment/42553379
has answer: http://stackoverflow.com/a/26995043
has answer: http://stackoverflow.com/a/26991123
has comment: http://stackoverflow.com/comment/42513220
has comment: http://stackoverflow.com/comment/42514203
has answer: http://stackoverflow.com/a/27010084
has comment: http://stackoverflow.com/comment/42516030
has comment: http://stackoverflow.com/comment/42539226
downvote count: 0

http://stackoverflow.com/comment/42282235
comment on: http://stackoverflow.com/q/26859006
has text: That is what i said above. You want click function on individual words. That way, each word require to be wrapped in a tag to invoke onclick function. That way you need to hardcode for creating/wrapping in tags
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/26857640
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26845150
answers question: http://stackoverflow.com/q/26845150
type: Answer
score: 1
upvote count: 1
has body: We can make the route to be case insensitive by adding the 'i' attribute to the return value of _routeToRegExp function in backbonejs library. _routeToRegExp: function (route) { var namedParam = /:\w+/g; var splatParam = /\*\w+/g; var escapeRegExp = /[-[\]{}()+?.,\\^$|#\s]/g; route = route.replace(escapeRegExp, '\\$&amp;') .replace(namedParam, '([^\/]+\/?)') .replace(splatParam, '(.*?)'); return new RegExp('^' + route + '$'); /* * Note: If you would like case insensitivity, * add the "i" attribute to the return * return new RegExp('^' + route + '$', 'i'); */ } https://github.com/jashkenas/backbone/issues/848 Thanks Dave!
type: AcceptedAnswer

http://stackoverflow.com/comment/42266004
comment on: http://stackoverflow.com/a/26848556
score: 0
type: Comment
has text: Hey thanks for the response. I've tried testing out your example. Correct me if I'm wrong as I'm new to Javascript but is your `function(prop, el)` correct? Cheers
type: AnswerComment

http://stackoverflow.com/q/26977737
score: 0
has comment: http://stackoverflow.com/comment/42531593
tagged with: canvas
has body: I develop a mobile game which needs user input that means in this case touchinput. I try to make a touchevent that you can see on the bottom. A piece of the code works on jsfiddle well on touch devices, but if I implement the code into my overrided code it wont work. I try many various ways to solve it but I am at the end of my knowledge. Have anyone tips to eleminate the mistake?
tagged with: mobile
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42498240
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42522486
type: Question
has comment: http://stackoverflow.com/comment/42530518
has title: touchevents on mobile devices with javascript
tagged with: touch

http://stackoverflow.com/comment/42259720
has text: See this example http://stackoverflow.com/questions/23074447/how-can-convert-jquery-code-to-prototype-code
score: 0
comment on: http://stackoverflow.com/q/26847942
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26919547
type: Answer
score: 0
has body: It's a JavaScript object, not a JSON string. You're missing commas after Bob and Rob's age. Maria's all good, though.
answers question: http://stackoverflow.com/q/26919445

http://stackoverflow.com/comment/42360713
score: 0
has text: Ok, I provided it in the opening post.
comment on: http://stackoverflow.com/a/26903723
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/42481940
has text: @frikinside, that's not true. According to http://api.jquery.com/on/, "Event handlers are bound only to the currently selected elements; they must exist on the page at the time your code makes the call to .on()."
comment on: http://stackoverflow.com/a/26973211
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/42482140
score: 0
has text: I was starting to wonder haha. I dont think I will be able to provide an example :(. This is part of the backend of a cloud SCORM course. The course itself is uploaded to an LMS which login is required. The course needs to be loaded from a domain that is in my domain database for the cloud SCORM courses to make sure the course is being fired from a valid domain. I could create a test login but dont think my manager would let me do it unfortunately. From your response I'm guessing that the onload frameset issue its not a common issue in IE7 & IE8?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26969835

http://stackoverflow.com/q/26971900
tagged with: javascript
has body: I am using nvd3 to draw a line chart and when i pass the div to nvd3 to draw a chart its give me this error Uncaught TypeError: Cannot read property 'createElementNS' of undefined Here is code: var chartDiv = 'line-chart'+ counter++; tmpl = $($('#charts-panel-template').clone().html()); tmpl.find('.feature-line-chart').attr('id', chartDiv); var div=tmpl.find('.feature-line-chart#'+chartDiv); chartsPanel.append(tmpl); nv.addGraph(function() { var chart; var width = 1024, height = 500; chart = nv.models.lineChart() // .color(sparkChart.colors) .width(width).height(height); //modify the x.axes chart.x(function(d,i) { return d.x; }); //giving chart margin chart.margin({right: 40}); $(div).empty(); //create chart var svg = d3.select(div).append('svg') .datum(data) .transition() .duration(500) .call(chart) .attr('width', width) .attr('height', height); my questions, where i am doing wrong is anything i am missing
has title: Uncaught TypeError: Cannot read property 'createElementNS' of undefined
answer count: 2
downvote count: 0
tagged with: jquery
score: 8
favorite count: 0
has comment: http://stackoverflow.com/comment/42480249
upvote count: 8
tagged with: nvd3.js
has answer: http://stackoverflow.com/a/26972493
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28129648
type: Question
has answer: http://stackoverflow.com/a/28129648
accepted answer: http://stackoverflow.com/a/26972493

http://stackoverflow.com/q/26922716
has title: Parse a text file utilizing match in javascript
answer count: 1
downvote count: 1
tagged with: javascript
favorite count: 0
has body: I'm trying to parse a text file and store to an array, but I can't seem to get rid of the unneeded characters. For example, some of the text will be "fi nd" or "job;" or "writ,er" Right now I'm using lettersTemp = InputDataLine.match(/[a-zA-Z]['*]/); to parse the text file, but that obviously isn't working because I'm pulling the entire string and not getting rid of the extra characters. Anyone got some advice or an easier way to do this?
tagged with: parsing
upvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26924473
tagged with: match
type: Question
score: -1

http://stackoverflow.com/comment/42413544
comment on: http://stackoverflow.com/a/26934509
has text: This will match 5 digits - 3 in the first match, 2 in the second.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/26987205
tagged with: canjs
has comment: http://stackoverflow.com/comment/42921717
tagged with: javascript
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has title: JS Total Count not updating on IE
has comment: http://stackoverflow.com/comment/43251881
answer count: 0
upvote count: 2
downvote count: 1
type: Question
has body: I'm having a problem with IE where if I check the items on a list it doesn't update the total value on the cart. It works fine on all other browsers but not on IE. By default the button is PAY ALL, but if you select an item it will update the total value and change the button, here's the function that does it: update: function() { if (this.paying &gt; 0) { this.element.find('.on_selected').show() .find('h2 span').text('$' + this.paying.toFixed(2)); this.element.find('.on_selected_none, .pay_all').hide(); this.element.find('.continue').css('display', 'block'); } else { this.element.find('.on_selected_none, .pay_all').show(); this.element.find('.on_selected, .continue').hide(); } } And here is my whole JS class for this var Ticket = can.Control.extend({ /** * @var int total */ total: 0.00, /** * @var int paying */ paying: 0.00, /** * * @param {type} element * @param {type} options */ init: function(element, options) { var self = this; element.find(':checkbox').each(function() { self.total += parseFloat($(this).val()); if ($(this).is(":checked")) { self.add($(this)); } }); this.update(); }, /** * * @param dom el */ add: function(el) { var v = parseFloat(el.val()); this.paying += v; }, /** * * @param dom el */ substract: function(el) { var v = parseFloat(el.val()); this.paying -= v; }, /** * Event Listener * @param dom el */ ':checkbox change': function(el) { if (el.is(":checked")) { this.add(el); } else { this.substract(el); } this.update(); }, 'table tr div.row click': function(tr,e){ // console.log(); // if($(e.target).is('label')){ return; } tr.parent().prev().find('input[type=checkbox]').trigger('click'); }, 'table .checkbox-big label click': function(tr){ // console.log(tr.prev()); // tr.prev().trigger('click'); // tr.find('label').trigger('mouseover'); }, /** * Form button event lister * * Submits form */ 'a.button click': function(btn, ev) { ev.preventDefault(); if (btn.hasClass('pay_all')) { this.element.find(':checkbox').each(function() { $(this).trigger('clic…
tagged with: internet-explorer
score: 1

http://stackoverflow.com/q/26857606
tagged with: plugins
score: -1
downvote count: 2
has answer: http://stackoverflow.com/a/26857623
upvote count: 1
has title: want multi select 2 sided with items displayed alphabetical oreder
type: Question
tagged with: javascript
tagged with: jquery-plugins
has body: I need a multiselect 2 sided pannel for Java Script. Is there any plug-in for multiselect 2 side with displaying the items alphabetically, that means if there are 1000 items in the list there should be an option for viewing the items alphabetical order. I used multiselect2side js plug-in but it does not provide alphabetical display of items. If any body have any idea how to do that, plz share.
answer count: 2
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/26857622
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/26987398
tagged with: jquery
has body: I have this html code for my setting box. On click of setting icon I am displaying this. I am using angular framework. Everything is working fine. HTML {{'csr:CSR.SERVICE_DETAIL.SETTING_POPUP.VOLUME_UNIT' | i18next}} {{'csr:CSR.SERVICE_DETAIL.SETTING_POPUP.FLOW_UNIT' | i18next}} {{'csr:CSR.SERVICE_DETAIL.SETTING_POPUP.TEMP_UNIT' | i18next}} {{'csr:CSR.SERVICE_DETAIL.SETTING_POPUP.SUBMIT' | i18next}} JS code // setting unit values using local storage on click of submit for the account number $scope.settingUnit = function () { $log.log("Setting the unit values"); var mockAccountInfo = [{ volumeUnitsSelected: $scope.selectedvolumeUnit, flowUnitsSelected: $scope.selectedflowUnit, tempUnitsSelected: $scope.selectedtempUnit }]; // Here we are going to set the all set values for the setting popup for the account number localStorage.setItem($scope.csrServiceModel.accountDetails.accountNumber, JSON.stringify(mockAccountInfo)); //angular.element('[class="dropdown-menu"]').hide(); }; The problem I am facing is: on click of submit button, I want to close the element which opens on setting icon click.
has comment: http://stackoverflow.com/comment/42507429
tagged with: angularjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42507550
type: Question
has title: How to close dropdown on submit button click?
has answer: http://stackoverflow.com/a/26987579
has comment: http://stackoverflow.com/comment/42507519
score: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/31312877
upvote count: 2
downvote count: 0
has body: I followed this guide, I think is very useful: http://www.podpea.co.uk/blog/starting-off-with-ngdocs/
type: Answer
has comment: http://stackoverflow.com/comment/109532334
score: 2
answers question: http://stackoverflow.com/q/26910188

http://stackoverflow.com/q/26979942
answer count: 2
downvote count: 0
tagged with: child-process
favorite count: 0
has comment: http://stackoverflow.com/comment/42512949
possible better answer: http://stackoverflow.com/a/27006867
has title: Result of ps au | grep ssh different in Node.js (using spawn/pipe) vs shell
has comment: http://stackoverflow.com/comment/42551830
has answer: http://stackoverflow.com/a/27006867
has comment: http://stackoverflow.com/comment/42520576
has answer: http://stackoverflow.com/a/27020321
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42500820
tagged with: pipe
has comment: http://stackoverflow.com/comment/42520768
has comment: http://stackoverflow.com/comment/42512480
type: Question
score: 5
has comment: http://stackoverflow.com/comment/42558418
upvote count: 5
has comment: http://stackoverflow.com/comment/42510346
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27020321
has comment: http://stackoverflow.com/comment/42558375
has comment: http://stackoverflow.com/comment/42520423
has body: I'm playing around with node streams and child processes. So I want to emulate next shell command with pipes: ps au | grep ssh So I wrote next code: var spawn = require('child_process').spawn; var ps = spawn('ps', ['au']); var grep = spawn('grep', ['ssh']); ps.stdout.pipe(grep.stdin); grep.stdout.on('data', function(data) { console.log(data) }); Then I run it, but nothing happens. What did I do wrong? P.S. - I know about: require('child_process') .exec('ps au | grep ssh', function(err, stdout, stderr) { ... }). I'm just playing around with Node.js, and I want to understand what's wrong with this example. Update 1: It appeared that with grep bash program works as expected, but with grep ssh there is no result. Although ps au | grep ssh gives me this result: vagrant 11681 0.0 0.1 10464 916 pts/0 S+ 07:54 0:00 grep --color=auto ssh.

http://stackoverflow.com/q/26978472
score: -2
tagged with: javascript
tagged with: forms
type: Question
has comment: http://stackoverflow.com/comment/42652445
has comment: http://stackoverflow.com/comment/42652470
has body: I'm building a page that I want a form to be able to target the iframe and have the selected webpage be what displays in the iframe. I'm only needing the iframe to display an external webpage, and a button to make it happen. Not actually passing any information form or to the form. Thanks EDIT: After the Information I learned here, and a few Google searches to expound on that knowledge I came up with this, it works nicely. Check Port 1935 The page will display information about Wowza if the port is open The page will time out after ~20 seconds or so if the port is closed USA Europe Australia Japan South America Test Server Refresh Results Then i have the page at http://helpdesk.mydomain.com/test/prompt.html display this Please select a server from the drop down menu Then click "Test Server" I learned a lot here, about how scripts and buttons work. Thanks
upvote count: 0
has answer: http://stackoverflow.com/a/26979189
answer count: 1
tagged with: button
has comment: http://stackoverflow.com/comment/42646951
favorite count: 0
has comment: http://stackoverflow.com/comment/42492078
has comment: http://stackoverflow.com/comment/42497360
has comment: http://stackoverflow.com/comment/42498523
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/26979189
has comment: http://stackoverflow.com/comment/42652939
tagged with: iframe
downvote count: 2
has comment: http://stackoverflow.com/comment/42498975
has title: button and form to change src of Iframe
has comment: http://stackoverflow.com/comment/42491904
type: AnsweredQuestion

http://stackoverflow.com/a/26941693
accepted answer of: http://stackoverflow.com/q/26941670
type: Answer
score: 3
upvote count: 3
has body: var cat = "Starters"; switch (cat) { case "Starters": console.log("Test a= " + cat); break; case "Mains": console.log("Test b= " + cat); break; case "Deserts": console.log("Test c= " + cat); break; default: console.log("Shit.." + cat); break; }
answers question: http://stackoverflow.com/q/26941670
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/26846519
possible better answer: http://stackoverflow.com/a/26931161
score: 0
accepted answer: http://stackoverflow.com/a/26891959
has title: Display View in New Window
tagged with: http://stackoverflow.com/tag/html
tagged with: asp.net
has comment: http://stackoverflow.com/comment/42267202
has comment: http://stackoverflow.com/comment/42334029
type: AnsweredQuestion
has body: I have developed an ASP.NET MVC application that will run several prescreen functions based on user input. The plan is to call this new mvc app from an existing HTML/JavaScript application. I would like to display the controllers's view in a new browser window outside of the calling application. My AJAX call will look something like this $.support.cors = true; $.ajax( { url: "http://mvc_url/prescreen", data: jsonObject, type: "POST", processData: false, dataType: 'html', contentType: "application/json; charset=utf-8", timeout: 60000, //dataType: "json", success: function ( msg ) { ...on success msg = html rendered from view... }, error: function ( XMLHttpRequest, textStatus, errorThrown ) { ...error handling... } } ); I've tested this and on success msg does contain the fully rendered HTML from the view. My question is how do I open a new window using the rendered HTML?. I've tried the following: var newWindow = window.open( "", "", "" ); newWindow.document.write( msg ); and that seems to work. sort of. The new window opens and the html is displayed, but then my style sheets and included javascript files, for the view, are missing. So if using the above window.open code is correct, then how do I bring down the necessary stylesheets and javascript files? EDIT Utilizing the suggestion provided by AndyJ, I've modified my view to include relative paths based on my base application. Here is the returned mark up from my MVC Offer ... Page Content ... the InitializeForm method is defined within the someInclude.js. Based on the above and assuming the files are locates in the paths, everything should link up, correct? So what else might I be doing wrong?
has answer: http://stackoverflow.com/a/26891959
has answer: http://stackoverflow.com/a/26931161
type: Question
answer count: 2
tagged with: asp.net-mvc
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/42432833
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26936879
has text: Thank you for your proposal. Let's say I want to have the slice always oriented towards the "south" position (180°), like I said. How should I modify your code in order to do that? I can see from your example that the slices always start from 0 when I click them, but they are not centered in position 0.

http://stackoverflow.com/q/26977000
has answer: http://stackoverflow.com/a/26977392
type: UnansweredQuestion
has title: aligning n-circels on a circle > no overlapping
score: -1
type: Question
tagged with: layout
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: createjs
has body: for a data visualization im aligning n-circels on a circle. That just works fine - but i dont't know how to stop the circles overlapping each other. Anybody here knows howto? The result should work like this sketch: Link: http://www.xup.to/dl,79345003/sketch.jpg So i dont know how to calculate the angle for the second node - based on the radius an position of the first node - and the radius of the second ... JSFIDDLE to show what i mean: http://jsfiddle.net/0z9hyvxk/ var canvas = document.getElementById("canvas"); var stage = new createjs.Stage(canvas); canvas.width = 500; canvas.height = 500; var midx = 250; var midy = 250; var radius = 200; var angle = 0; var count = 30; var step = 2 * Math.PI / count; var xpos; var ypos; var nodeSize; var node = function(size){ var dot = new createjs.Shape(); dot.graphics.beginFill("#000").drawCircle(0, 0, size); dot.x = dot.y = -5; dot.alpha = .25; return dot }; for(var i = 0; i&lt;count; i++) { xpos = radius * Math.cos(angle) + midx; ypos = radius * Math.sin(angle) + midx; nodeSize = i; var n = new node(nodeSize); n.x = xpos; n.y = ypos; stage.addChild(n) angle += step; } stage.update(); thanks in advance simon
downvote count: 1
tagged with: geometry
upvote count: 0

http://stackoverflow.com/q/26892584
tagged with: datepicker
has answer: http://stackoverflow.com/a/26915112
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42345498
has title: Two Dynamic Forms via Select Option (datepicker)
tagged with: forms
type: Question
has body: I would like to choose between form_two and for_three in the main_form(fiddle at the bottom of the post). Under the main form should be one of the two forms(form_two/form_three). I can choose between the two forms, but they are not editable, because they are not in the source code, if I inspect the code with the browser. I would like to have a datepicker from jquery in it, to submit the date. But I have got the problem, that I can see the two(form_two/form_three) different forms in the browser, but if I look in the source code, there is no form in the dom. Here is my code: Form to select one of these forms (main_form) Inseratauswahl Auswahl: Jobangebot aufgeben Job finden Los form_two Suche Inserate Jobinformationen Jobart: Gelegenheitsjob Ausbildungsplatz Praktika Fachkräfte Berufsfeld: Bau, Architektur, Vermessung Dienstleistung Elektro Gesellschaft-, Geisteswissenschaften Gesundheit IT, Computer Kunst, Kultur, Gestaltung Landwirtschaft, Natur, Umwelt Medien Metall, Maschinenbau Naturwissenschaften Produktion, Fertigung Soziales, Pädagogik Technik, Technologiefelder Verkehr, Logistik Wirtschaft, Verwaltung Stadtteil: Charlottenburg Friedrichshain Hellersdorf Köpenick Kreuzberg Lichtenberg Marzahn Mitte Neuköln Pankow Reinickendorf Schöneberg Spandau Steglitz Tempelhof Treptow Zehlendorf Gesucht ab Datum: Vergütung: Titel: Beschreibung: Auftraggeberinformationen Unternehmen/Firma: Straße/Nr.: PLZ: Ort: Foto/Logo: Kontaktinformationen E-Mail-Adresse: Telefonnummer: Fax: Inserieren form_three Finde Inserat Jobinformationen Jobart: Gelegenheitsjob Ausbildungsplatz Praktika Fachkräfte Berufsfeld: Bau, Architektur, Vermessung Dienstleistung Elektro Gesellschaft-, Geisteswissenschaften Gesundheit IT, Computer Kunst, Kultur, Gestaltung Landwirtschaft, Natur, Umwelt Medien Metall, Maschinenbau Naturwissenschaften Produktion, Fertigung Soziales, Pädagogik Technik, Technologiefelder Verkehr, Logistik Wirtschaft, Verwaltung Stadtteil: Charlottenburg Friedrichshain Hellersdorf…
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/42341694
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/42346092
has comment: http://stackoverflow.com/comment/42345332

http://stackoverflow.com/a/26906673
answers question: http://stackoverflow.com/q/26905866
score: 0
type: Answer
has body: You can create in memory collection by passing null as name. http://docs.meteor.com/#/full/collections new Mongo.Collection(name, [options]) name String The name of the collection. If null, creates an unmanaged (unsynchronized) local collection. Than create method that can be called by clients. http://docs.meteor.com/#/full/meteor_methods The method will load the data via REST from other server and puts it into the local collection.

http://stackoverflow.com/comment/42290349
type: AnswerComment
has text: you welcome, but i suggest you do not use separate `div`. thanks
type: Comment
comment on: http://stackoverflow.com/a/26864887
score: 0

http://stackoverflow.com/comment/42384155
comment on: http://stackoverflow.com/q/26917287
score: 0
type: QuestionComment
type: Comment
has text: it doesn't seem as though your fiddle example matches the problem which is why everyone keeps telling you the same thing... can you update your example please?

http://stackoverflow.com/comment/42307332
has text: @devJunk : I can not find how I can create the tables with a name which can change. Because I need to use table["attribute"], when I concatenate I do not have tables made. (It is difficult to be clear, sorry).
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26874662

http://stackoverflow.com/comment/42376237
score: 0
type: Comment
comment on: http://stackoverflow.com/q/26913250
type: QuestionComment
has text: Here's what it looks like [before](http://i.imgur.com/ik15W0w.png) editing it. and here's [after](http://i.imgur.com/7FkUo8l.png)

http://stackoverflow.com/q/26887264
tagged with: javascript
tagged with: jquery
score: 6
accepted answer: http://stackoverflow.com/a/26889329
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has comment: http://stackoverflow.com/comment/42329886
has comment: http://stackoverflow.com/comment/42329602
favorite count: 0
type: Question
has title: The offsetWidth, scrollWidth,ClientWidth Property is not working for Html Element
has body: I am having this control and trying to get the offsetWidth,clientWidth and scrollWidth.. Annual Self Insurance Renewal Certificate Required My code.. var a=$("#tid").offsetWidth; var b=$("#tid").clientWidth; var c=$("#tid").scrollWidth; alert("offset Width =" +a); alert("client Width =" +b); alert("scroll Width =" +c); The alert message displays as "Undefined" I have tried in Chrome and IE11 both results the same.
answer count: 1
upvote count: 6
has answer: http://stackoverflow.com/a/26889329
has comment: http://stackoverflow.com/comment/42332932
tagged with: dom

http://stackoverflow.com/comment/42356688
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26842210
has text: localStorage.length=>0
score: 0

http://stackoverflow.com/comment/42281672
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/26860218
has text: If this whole thing wasn't wrapped in an immediately invoked function expression, `queue` would be a global variable. Put `queue` inside the IIFE, not within `$.fn.messager`. Also, to avoid `Uncaught RangeError: Maximum call stack size exceeded`, see my latest update which includes limiting and throttling.
score: 0

d3.js
tags question: http://stackoverflow.com/q/26980397
tags question: http://stackoverflow.com/q/26947957
tags question: http://stackoverflow.com/q/26951208
tags question: http://stackoverflow.com/q/26898814
tags question: http://stackoverflow.com/q/26834114
tags question: http://stackoverflow.com/q/26881240
tags question: http://stackoverflow.com/q/26990192
tags question: http://stackoverflow.com/q/26923452
tags question: http://stackoverflow.com/q/26951726
tags question: http://stackoverflow.com/q/26955267
tags question: http://stackoverflow.com/q/26961258
tags question: http://stackoverflow.com/q/26903355
tags question: http://stackoverflow.com/q/26853816
tags question: http://stackoverflow.com/q/26887143
tags question: http://stackoverflow.com/q/26907752
tags question: http://stackoverflow.com/q/26895976
tags question: http://stackoverflow.com/q/26874408
tags question: http://stackoverflow.com/q/26987005
tags question: http://stackoverflow.com/q/26930531
tags question: http://stackoverflow.com/q/26836513
tags question: http://stackoverflow.com/q/26911970
tags question: http://stackoverflow.com/q/26963565
tags question: http://stackoverflow.com/q/26926876
tags question: http://stackoverflow.com/q/26915654
tags question: http://stackoverflow.com/q/26856206
tags question: http://stackoverflow.com/q/26877497
tags question: http://stackoverflow.com/q/26956778
tags question: http://stackoverflow.com/q/26928277
tags question: http://stackoverflow.com/q/26932833
tags question: http://stackoverflow.com/q/26873295
tags question: http://stackoverflow.com/q/26950879
tags question: http://stackoverflow.com/q/26991857
tags question: http://stackoverflow.com/q/26964006
tags question: http://stackoverflow.com/q/26853528
tags question: http://stackoverflow.com/q/26866368
tags question: http://stackoverflow.com/q/26897821
tags question: http://stackoverflow.com/q/26935468
tags question: http://stackoverflow.com/q/26951631
type: Tag
tags question: http://stackoverflow.com/q/26990351
tags question: http://stackoverflow.com/q/26934979
tags question: http://stackoverflow.com/q/26885471
tags question: http://stackoverflow.com/q/26835214
tags question: http://stackoverflow.com/q/26948631
tags question: http://stackoverflow.com/q/26878054
tags question: http://stackoverflow.com/q/26931082
tags question: http://stackoverflow.com/q/26945711
tags question: http://stackoverflow.com/q/26840885
tags question: http://stackoverflow.com/q/26937171
tags question: http://stackoverflow.com/q/26941364
tags question: http://stackoverflow.com/q/26920199
tags question: http://stackoverflow.com/q/26879115
tags question: http://stackoverflow.com/q/26979668
tags question: http://stackoverflow.com/q/26878145
tags question: http://stackoverflow.com/q/26928444
tags question: http://stackoverflow.com/q/26911012
tags question: http://stackoverflow.com/q/26899290
tags question: http://stackoverflow.com/q/26981817
tags question: http://stackoverflow.com/q/26848115
tags question: http://stackoverflow.com/q/26926561
tags question: http://stackoverflow.com/q/26880316
tags question: http://stackoverflow.com/q/26940818
tags question: http://stackoverflow.com/q/26963668
tags question: http://stackoverflow.com/q/26917982
tags question: http://stackoverflow.com/q/26981020
tags question: http://stackoverflow.com/q/26892819
tags question: http://stackoverflow.com/q/26938614
tag name: d3.js
tags question: http://stackoverflow.com/q/26957578
tags question: http://stackoverflow.com/q/26983128
tags question: http://stackoverflow.com/q/26870638
tags question: http://stackoverflow.com/q/26845070
tags question: http://stackoverflow.com/q/26875428
tags question: http://stackoverflow.com/q/26976396
tags question: http://stackoverflow.com/q/26963556
tags question: http://stackoverflow.com/q/26963530
tags question: http://stackoverflow.com/q/26886117
tags question: http://stackoverflow.com/q/26960041
tags question: http://stackoverflow.com/q/26921414
tags question: http://stackoverflow.com/q/26954751

http://stackoverflow.com/q/26851780
has title: Angular UI-router not displayig the view
has comment: http://stackoverflow.com/comment/42266802
has answer: http://stackoverflow.com/a/26851887
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/26851887
has comment: http://stackoverflow.com/comment/42265947
linked to: http://stackoverflow.com/q/25647454
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42266043
type: Question
tagged with: angular-ui-router
has comment: http://stackoverflow.com/comment/42266399
has comment: http://stackoverflow.com/comment/42266247
tagged with: javascript
has body: I try to make a nested views with UI-Router, but got stuck with fact that my view not displaying, though XHR in console indicates correct path and success in loading.The URL also updated as expected. Here's the related code: .state('teams.tasks', { url: '/:teamID', templateUrl: 'views/items.html', controller: "itemsCtrl" }) .state('items', { url: '/items', templateUrl: 'views/items.html', controller: "itemsCtrl" }) and in the view: &lt;a ui-sref=".teams({ id: team.id })" class="h4 media-heading"&gt;{{ team.name }}&lt;/a&gt; The idea is — when i click this link i go to /teams/teamname, where teamname is created dynamically in the controller. The link url generates properly, but i don't see the related partial.
score: 0
answer count: 1

http://stackoverflow.com/comment/42463421
type: Comment
comment on: http://stackoverflow.com/a/26955482
has text: Javascript cannot simply get rid of it's prototypical structure, so I presume the explicit 'class' construct will take some action behind the scenes to make super() refer to the correct method?
score: 0
type: AnswerComment

http://stackoverflow.com/q/26880378
has comment: http://stackoverflow.com/comment/42318489
upvote count: 1
type: Question
linked to: http://stackoverflow.com/q/333664
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/39074199
has comment: http://stackoverflow.com/comment/42318716
answer count: 1
favorite count: 0
linked to: http://stackoverflow.com/q/14512182
has comment: http://stackoverflow.com/comment/42318858
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42317792
tagged with: php
has comment: http://stackoverflow.com/comment/42317392
has body: I have looked around the web including Stack Overflow's 'question and answer' history, but I can't find the related answer to mine; maybe because I don't really understand all posts published in English but as a beginner in programming, I really need this explanation and I think it should be clear and easy to understand. My question is, is there some easy way to make PHP and JavaScript to answer this question: I have two computers online, one computer opens 'my website' where there is scrolling news at the top of the website. The other computer is in my hand, here inside admin area. Now, I add a new data in 'news table db' in my admin area, type it, and push click. Then I look at the other computer, I want the new data to BE THERE without touching any part of the keyboard. That's all, a simple question maybe. It's easy for Facebook's developers, but not for me. I need a detailed explanation from someone who know this. I know a little of PDO, but less JS.
has comment: http://stackoverflow.com/comment/42317165
has title: Show live data in browser without refresh
score: 1
has comment: http://stackoverflow.com/comment/42317128

http://stackoverflow.com/comment/42387333
comment on: http://stackoverflow.com/q/26919305
type: QuestionComment
type: Comment
has text: @squint is right. Here is a [relevant question](http://stackoverflow.com/questions/4585970/jquery-event-preventdefault-not-working-in-firefox-jsfiddle-included) regarding why that is.
score: 1

http://stackoverflow.com/comment/42506113
score: 0
type: QuestionComment
has text: You'll need to do some debugging on this. Look in your browser developer tools so you know what question to ask.
type: Comment
comment on: http://stackoverflow.com/q/26986369

http://stackoverflow.com/comment/42269388
has text: What environment are you running it from?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26853354
score: 0

http://stackoverflow.com/q/26945786
tagged with: sharepoint-2013
type: Question
has title: SharePoint Hosted-App Using DateTimeControl Get null Reference
tagged with: javascript
score: -1
tagged with: sharepoint
has body: Hi i have created a &lt;SharePoint:DateTimeControl ID="ToDateTime" ClientIDMode="Static" LocaleId="2057" AutoPostBack="false" DatePickerFrameUrl="../_layouts/15/iframe.aspx" runat="server" /&gt; in my App.Js file i have written this var listItemCustom = document.getElementById("FromDateTimeDate"); I get error on this line because it cant find by ID why?
has answer: http://stackoverflow.com/a/27090030
answer count: 2
upvote count: 0
has answer: http://stackoverflow.com/a/28018527
favorite count: 0
type: UnansweredQuestion
downvote count: 1

http://stackoverflow.com/a/26853962
has comment: http://stackoverflow.com/comment/42282078
type: Answer
has comment: http://stackoverflow.com/comment/42290967
score: 1
answers question: http://stackoverflow.com/q/26853383
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26853383
type: AcceptedAnswer
has body: Your main issue here is you are only setting the size of the canvas using css which causes stretching issues. This is alright to do so long as you factor in the stretch factor (scaling). You also need to consider that the offset of the canvas changes if you resize the window after it has been loaded so you need to start your events off with the following code. var scale = canvas.attr("width") / canvas.width(), offsetX = $("#myCanvas").offset().left; Also you need to set the canvas width and height attribute for this to function properly. You can set the width to anything but the higher the number the better the detail. Your browser does not support the HTML5 canvas tag. Another tip is to use jQuery functions more for event handling, element selection, and attribute setting. var canvas = $("#myCanvas"); ... canvas.mouseup(function () { ... canvas.attr("cursor", "ew-resize"); ... }); ... canvas.mousedown(function () { ... }); Here's a functioning code snippet: var canvas = $("#myCanvas"), context = canvas[0].getContext("2d"), startX; context.rect(0, 20, canvas[0].width, 50); context.fillStyle = "blue"; context.fill(); canvas.mousedown(function() { var scale = canvas.attr("width") / canvas.width(), offsetX = $("#myCanvas").offset().left; canvas.attr("cursor", "ew-resize"); startX = parseInt((event.clientX - offsetX) * scale); document.getElementById("info").innerHTML = "X position: " + startX; }); canvas.mouseup(function() { var scale = canvas.attr("width") / canvas.width(), offsetX = $("#myCanvas").offset().left; canvas.attr("cursor", "default"); var mouseX = parseInt((event.clientX - offsetX) * scale); context.beginPath(); context.rect(startX, 20, mouseX - startX, 50); context.fillStyle = "red"; context.fill(); document.getElementById("info").innerHTML = "X old: " + startX + " - X new :" + (mouseX) + " - Length: " + (mouseX - startX); }); body { background-color: ivory; } header { background-color: black; color: white; text-align: center; padding: 5px; } section { te…
downvote count: 0

http://stackoverflow.com/q/26921961
has title: adding a watermark only to target images (jquery)
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/42391802
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/42391872
has body: I have a question regarding watermarks for images. For instance: I want to display an image (pure HTML). If a user clicks on the image however, there should be a watermark, showing where that photo comes from. I was thinking about a layer-solution. Putting an invisible layer over the main image and link to another image instead. That would force me to have every photo two times on my server. Not the best idea. I found a lib called watermark.js (link here: watermark.js). However, this would only allow me to put watermarks right in the beginning. To explain the situation: User on my site sees everything without watermark, opening it directly in the browser should add the watermark. Another solution I had was to always apply a watermark via script, and remove it if the user is currently on my site. Maybe you have a solution to apply watermarks only on the linked images. I'd like to realize it via jquery. Thank you in advance.
tagged with: jquery
has comment: http://stackoverflow.com/comment/42391718
has comment: http://stackoverflow.com/comment/42391985
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42391817

http://stackoverflow.com/q/26953781
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has body: Using this fiddle as an example, how would I select a column from this table? The code below doesn't trigger and I'm not getting anything from the column() function page or the column-selector page. alert(typeof table.column());
has answer: http://stackoverflow.com/a/26953926
accepted answer: http://stackoverflow.com/a/26953926
type: AnsweredQuestion
type: Question
has title: How do I select a column from a JavaScript sourced DataTable

http://stackoverflow.com/comment/42311548
score: 0
has text: Or just that database-wise, I'm always using total_price and only very rarely price_1 and price_2.
comment on: http://stackoverflow.com/q/26876864
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42401122
score: 0
type: Comment
type: QuestionComment
has text: Your forgot to add 'ui.bootstrap' module as a dependancy. Try to change your "angular.module('App')" into "angular.module('App', ['ui.bootstrap'])".
comment on: http://stackoverflow.com/q/26876441

http://stackoverflow.com/q/26856930
has answer: http://stackoverflow.com/a/26857560
type: AnsweredQuestion
tagged with: jquery
type: Question
tagged with: django
tagged with: python
accepted answer: http://stackoverflow.com/a/26857560
has body: I have defined class Media as: class LtAdmin(admin.ModelAdmin): form = LtForm class Media: js = ('javascript/lt/showhid_follow_up.js',) This javascript code lies in django project folder: /home/myself/mysite/static/javascript/lt/showhid_follow_up.js settings.py contains: STATIC_URL = '/static/' Javascript is as follows: jQuery(document).ready(function($){ alert('Hi'); }); Do I have to define MEDIA_URL to use this? Do I have to have a src in the javascript? If I add and , it displays error: Uncaught SyntaxError: Unexpected token &lt; On removing this, error I get: Uncaught TypeError: Property 'jQuery' of object [object Object] is not a function How do I resolve this problem? I have tried using FireFox as well as Chrome browsers Am I missing some other settings?
score: 0
answer count: 1
tagged with: javascript
has title: How to execute javascript in django 1.6.5

http://stackoverflow.com/comment/42381554
type: QuestionComment
comment on: http://stackoverflow.com/q/26916069
has text: As of right now I want to just make sure there accessing the correct pipes maybe seeing that in the console log? Like if 2D is chosen from the dropdown and the weight entered is in between 2500 to 3499 that it grabs the correct pipe
score: 0
type: Comment

http://stackoverflow.com/a/26941584
upvote count: 3
has comment: http://stackoverflow.com/comment/42444299
type: Answer
has body: A few things other than the classic just-use-jquery answer: element.remove() is not supported yet by Internet Explorer, according to the API: http://msdn.microsoft.com/en-us/library/ie/hh772117(v=vs.85).aspx. It's an experimental technology: https://developer.mozilla.org/en-US/docs/Web/API/ChildNode.remove Are you sure parentNode.removeChild isn't working because it is for me: http://jsfiddle.net/limdauto/wztm1dgk/ Before After
downvote count: 0
score: 3
accepted answer of: http://stackoverflow.com/q/26941385
answers question: http://stackoverflow.com/q/26941385
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42427014

http://stackoverflow.com/comment/42330104
comment on: http://stackoverflow.com/q/26887259
has text: None - process exists
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/q/26919384
tagged with: javascript
has answer: http://stackoverflow.com/a/26919424
has comment: http://stackoverflow.com/comment/42387110
accepted answer: http://stackoverflow.com/a/26919410
has comment: http://stackoverflow.com/comment/42387361
possible better answer: http://stackoverflow.com/a/26919424
tagged with: http://stackoverflow.com/tag/html
has body: This is problem I was asked and am wondering how to do or whether it's a trick question. I've only been working with JavaScript for a short while, so I'm not too sure. Assume you have a web page with lots of content. Without using any library or getElementsByClassName, traverse the DOM and find all elements which have a particular class name. Sample HTML Target exists here Target exists here Stuff My first thought is that this should be a recursive function and should start at the root document.documentElement JS: var root = document.documentElement; var targetClass = 'myTarget'; var elementsWithTargetClass = []; // store in array function traverse(element, targetClassName){ // get class of current element var currentClass = element.className; // add to array if class matches if(currentClass.trim() === targetClassName) elementsWithTargetClass.push(element); // recursive call if(element.children){ traverse(element, targetClassName); } } Any suggestions on what I'm missing? // recursive call - updated if(element.children){ for(var child in element.children) traverse(element.children[child], targetClassName); }
has comment: http://stackoverflow.com/comment/42387547
has comment: http://stackoverflow.com/comment/42387143
has answer: http://stackoverflow.com/a/26919533
favorite count: 0
upvote count: 2
answer count: 5
has title: Find an element with a class without library or getElementsByClassName
has comment: http://stackoverflow.com/comment/42387238
has comment: http://stackoverflow.com/comment/42387594
has comment: http://stackoverflow.com/comment/42387032
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42387048
has answer: http://stackoverflow.com/a/26919410
has answer: http://stackoverflow.com/a/26919507
has comment: http://stackoverflow.com/comment/42387437
type: Question
has comment: http://stackoverflow.com/comment/42387346
has answer: http://stackoverflow.com/a/26919407
downvote count: 0

http://stackoverflow.com/a/26914907
downvote count: 0
has comment: http://stackoverflow.com/comment/42384105
has comment: http://stackoverflow.com/comment/42380776
score: 1
has body: I'm not sure if the position: absolute is what you're going for. More or less, it seems that you are wanting to select a rotating subset of list items to show at any point in time. I came up with the following changes: ul#list { width: 200px; border: solid; height: 200px } ul#list li { font-size: 1.4em; display: none; margin: 0; padding: 0; } And the corresponding JavaScript: var j = 1; var inbetween = 2000; //milliseconds function page() { var jmax = $("ul#list li").length; var count = 10; var start = j; var end = j + count - 1; var complete = 0; console.log(j, start, end); var range = $('ul#list li:nth-child(n+'+ start + '):nth-child(-n+'+ end +')'); range .show(400) .delay(inbetween) .hide(400, 'swing', function() { if (j++ &gt;= jmax) { j = 1; } if (++complete &gt;= count) { page(); } }); }; page(); You can see an example here: http://codepen.io/anon/pen/XJWpzK The only real change is that you can see we are selecting a range of elements (based on j) using the nth-child selector. Hope this helps.
answers question: http://stackoverflow.com/q/26914235
upvote count: 1
type: Answer

http://stackoverflow.com/comment/42510151
type: Comment
has text: The error message is suggesting that the element is not clickable from a user point of view. Is there any other element upon it, with a higher `z-index` maybe?
type: QuestionComment
comment on: http://stackoverflow.com/q/26943115
score: 0

http://stackoverflow.com/comment/42346823
comment on: http://stackoverflow.com/q/26896718
type: Comment
type: QuestionComment
score: 2
has text: (your syntax is fine)

http://stackoverflow.com/q/26961804
tagged with: object
accepted answer: http://stackoverflow.com/a/26961880
has answer: http://stackoverflow.com/a/26961906
has body: I want to return some data from a form as an object when I submit the form but I am having trouble getting the data to be in the object in the correct scope. I am not sure why console logging the newEvent variable within the onsubmit event handler returns an event either. How can I access the returned form data in the outer scope? JSFiddle: http://jsfiddle.net/antfish/crp98hhw/40/ var createTaskForm = document.getElementById('create-task'), newTask = new Object(); //Returns empty object (I would like my returned object accessible in this scope) console.log(newTask); function getFormData(id, newTask) { var createTaskForm = document.getElementById(id), formElements = createTaskForm.elements; createTaskForm.onsubmit = function(newTask) { var title = formElements['todo-title'].value, content = formElements['todo-content'].value; newTask.title = title; newTask.content = content; //Returns Event console.log(newTask); return newTask; } } getFormData('create-task');
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26961906
type: AnsweredQuestion
tagged with: scope
type: Question
has answer: http://stackoverflow.com/a/26961880
has title: How to return an object into a different scope in JavaScript?
score: 0
answer count: 2

http://stackoverflow.com/comment/42289874
score: 0
has text: But i assume, the total size of the page is unknown and so the total progress cannot be loaded rite ?
comment on: http://stackoverflow.com/a/26864864
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42413727
score: 0
type: Comment
type: QuestionComment
has text: Try changing "location=" with "location.href=".
comment on: http://stackoverflow.com/q/26934620

submenu
tags question: http://stackoverflow.com/q/26938237
tag name: submenu
type: Tag
tags question: http://stackoverflow.com/q/26902258

http://stackoverflow.com/comment/42494791
comment on: http://stackoverflow.com/q/26980203
has text: http://stackoverflow.com/questions/7837456/comparing-two-arrays-in-javascript
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/26843685
has body: I am using mocha to test if some routes I have added to my server are returning 200 ok and if the response contains a string. I am doing this it the following manner: var testDBRoute = function(link, routeName) { it('should return 200 OK for ' + routeName, function (done) { http.get(link, function (res) { assert.equal(200, res.statusCode); done(); }) }); it('should return the correct info', function(done) { http.get(link, function (res) { var body = ''; res.on('data', function(chunk) { body += chunk; }); res.on('end', function() { var response = JSON.parse(body); assert.equal('abc', response.id); done(); }); }); } ) }; I am calling this function 6 times in the same way: describe('/link1', function () { var link = HOST + '/api/link1/'; testDBRoute(link, 'link1'); }); No matter the order of the requests it always fails at the 8'th test meaning that it's making 8 http get requests and then fails with this error: Error: timeout of 2000ms exceeded at null. (\node_modules\mocha\lib\runnable.js:158:19) at Timer.listOnTimeout [as ontimeout] (timers.js:112:15) I must specify that I am running the test on windows.
tagged with: node.js
type: UnansweredQuestion
score: 1
upvote count: 1
tagged with: http
type: Question
has answer: http://stackoverflow.com/a/26844185
tagged with: javascript
tagged with: mocha.js
has title: Mocha unit testing routes return 200 ok
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/q/26928999
has title: Namespace confusion with multiple modules defined in different js files
tagged with: namespaces
has comment: http://stackoverflow.com/comment/42403851
answer count: 0
score: 1
upvote count: 1
type: Question
downvote count: 0
has body: I am struggling to understand an easy way of adding all of my modules to a single namespace. For example I want a single namespace at the global level, but then my modules to be children of that one namespace So this is what I have done so far in the first of my JS files I have done this var MyRootNamespace = window.MyRootNamespace || (window.MyRootNamespace = {}); (function() { MyRootNamespace.EventBus = (function () { ... })(); })(); In another module defined in a different JS file I have (function() { jQuery(document).ready(function() { MyRootNamespace.EventBus.publish(...); }); })(); Trouble is, EventBus is resolving as undefined. MyRootNamespace exists in the global namespace, but on examination there is no EventBus present in the MyRootNamespace namespace Whilst I understand the concept of namespaces, I struggle to understand how you create a clean namespace for your application. Thanks I just discovered though that if do the following in the module with the reference passed in it all works. (function(BUS) { jQuery(document).ready(function() { BUS.EventBus.publish(...); }); })(MyRootNamespace.EventBus); Anyone able to explain why?
tagged with: javascript
has comment: http://stackoverflow.com/comment/42404045
has comment: http://stackoverflow.com/comment/42404025
favorite count: 0
has comment: http://stackoverflow.com/comment/42403730
type: UnansweredQuestion

http://stackoverflow.com/q/26940320
has comment: http://stackoverflow.com/comment/42424977
downvote count: 1
has comment: http://stackoverflow.com/comment/42424794
type: Question
has comment: http://stackoverflow.com/comment/42425015
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
has title: How to append add php conditions while replacing html text in jquery
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42424706
has body: basically , when document is ready , I would like to replace the td content with this html content that has some php conditions in it as shown below , but it's not working &lt;?php echo "&lt;script type='text/javascript'&gt;"; echo "$(document).ready(function(){"; ?&gt; $('#redeem_freebie).html('&lt;a class="btn" &lt;? if (!$freebies-&gt;expired) {?&gt;onclick="applyFreebieNow('&lt;?=addslashes($dialog_copy)?&gt;','&lt;?=addslashes($freebies-&gt;get_started_link)?&gt;','&lt;?=$freebies-&gt;promo_code_id?&gt;');"&lt;? } ?&gt; style="&lt;?=$freebies-&gt;expired ? 'cursor: default;':''?&gt;"&gt;Redeem Freebie &amp;gt;&amp;gt;&lt;/a&gt;'); &lt;?php echo "});"; echo "&lt;/script&gt;"; echo "}"; ?&gt;
has comment: http://stackoverflow.com/comment/42425109
favorite count: 0
has comment: http://stackoverflow.com/comment/42424914
has answer: http://stackoverflow.com/a/26940480
has comment: http://stackoverflow.com/comment/42424988
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/42424741
tagged with: jquery-append
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42424838
accepted answer: http://stackoverflow.com/a/26940480
possible better answer: http://stackoverflow.com/a/26940487
has answer: http://stackoverflow.com/a/26940487

http://stackoverflow.com/q/26941009
downvote count: 2
has answer: http://stackoverflow.com/a/26941185
has comment: http://stackoverflow.com/comment/42425932
upvote count: 6
tagged with: javascript
has answer: http://stackoverflow.com/a/26941138
has comment: http://stackoverflow.com/comment/42425995
score: 4
has comment: http://stackoverflow.com/comment/42426120
has title: Need to understand Javascript object references
linked to: http://stackoverflow.com/q/13104494
has comment: http://stackoverflow.com/comment/42426275
has comment: http://stackoverflow.com/comment/42426021
has comment: http://stackoverflow.com/comment/42425954
has comment: http://stackoverflow.com/comment/42425938
answer count: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/42426132
has comment: http://stackoverflow.com/comment/42425941
possible better answer: http://stackoverflow.com/a/26941185
has comment: http://stackoverflow.com/comment/42426395
has comment: http://stackoverflow.com/comment/42425914
has comment: http://stackoverflow.com/comment/42426193
has comment: http://stackoverflow.com/comment/42426019
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26941151
has comment: http://stackoverflow.com/comment/42425944
duplicate of: http://stackoverflow.com/q/13104494
has answer: http://stackoverflow.com/a/26941140
accepted answer: http://stackoverflow.com/a/26941138
has comment: http://stackoverflow.com/comment/42426609
has body: I am looking at this piece of code from John Resig's website. What I don't understand is when the ninja object is set to an empty object, the yell method is still available to samurai. Is it because since there is still a reference lying around to ninja, it wasn't garbage collected? var ninja = { yell: function(n){ return n &gt; 0 ? yell(n-1) + "a" : "hiy"; } }; var samurai = { yell: ninja.yell }; ninja = {}; console.log(samurai.yell(2)); //hiy http://ejohn.org/apps/learn/#14 (Original source, I modified it a little to remove the named function expression).
type: Question

http://stackoverflow.com/a/26881922
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26841754
has body: so, since i thought it would be nice for my project, to have a usable browser history and bookmarkable subpages, i yesterday tried the approach from my comments of the OP. step 1: change the anchors in your navigation bar to something like that: home about needles to say, that they don't need to be inside the same parent element. those links could be anywhere. step 2: remove the on click handler from your script, that reacts on the navigation bar clicks! step 3: create a function, to listen to the onhashchange event. (this has to be done once, on the main html page) //create a function for the onhashchange event window.onhashchange = function() { //check if a location hash is used if(window.location.hash != null) { //store current location hash in a variable requestedPage = location.hash; //remove the '#' from the location hash value requestedPage = requestedPage.replace('#',''); //load content from subpage into your content frame $('#contentFrame').load('./' + requestedPage + '.html', function( response, status, xhr ) { //catch 'file not found' errors and load start page if ( status == "error" ) { $('#mainPanel').load('./start.html'); } }); }; for your page, you have of course to adapt, use the correct selectors and the correct file names. you then would call your page via www.mydomain.com, and every subdomain via www.mydomain.com/#subPage

http://stackoverflow.com/q/26873308
has comment: http://stackoverflow.com/comment/42333856
has comment: http://stackoverflow.com/comment/42304848
type: Question
has comment: http://stackoverflow.com/comment/44033231
has comment: http://stackoverflow.com/comment/42304749
tagged with: javascript
has answer: http://stackoverflow.com/a/28293666
answer count: 3
has body: Here is the link from where I downloaded the source code of clockpicker jquery plugin http://weareoutman.github.io/clockpicker/jquery.html I have used clockpicker in one of my dialog box but I need to resize it. There is no such attribute of clockpicker where I can mention the dimensions. What changes do I need to do in the css to change the clockpicker's height and width? I am able to change width and height of the box by changing some attributes in clockpicker-popover class, but changing clockpicker-dial and clockpicker-tick classes are not helping. The actual clock (hours and minutes) is not changing. I saw this is prepared in javascript code and some variables are declared as follows based on which the actual clock is prepared. // Clock size var dialRadius = 100, outerRadius = 80, // innerRadius = 80 on 12 hour clock innerRadius = 54, tickRadius = 13, diameter = dialRadius * 2, duration = transitionSupported ? 350 : 1; Based on these values some trigonometric operations are done. How should I change these values to resize the clock?
downvote count: 0
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/26890422
has answer: http://stackoverflow.com/a/26874883
has answer: http://stackoverflow.com/a/26890422
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28293666
tagged with: css
type: AnsweredQuestion
score: 3
upvote count: 3
has title: How to resize the clockpicker?

http://stackoverflow.com/comment/42411571
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26886117
has text: If you can't use the pie chart in another page what about just saving the svg - just google d3js export svg and you should get some hints
score: 0

http://stackoverflow.com/q/26832550
has answer: http://stackoverflow.com/a/26832588
tagged with: angularjs
score: -3
has body: I'm writing a back end application that shows listings similar to a phone book. I have some filters that it sorts by and pagination as well. The app loads all the data first and then the filtering and pagination is essentially done instantly. I can't figure out what the problem is here. From online and my book everything appears to be OK. This is the error I get: TypeError: undefined is not a function at new &lt;anonymous&gt; (http://local.poha.com/js/ang.js:21:10) var listingsApp = angular.module('listingsApp', []); listingsApp.controller('pageController', function ($scope, $http) { $scope.GetListings(); &lt;--- line 21 $scope.GetListings = function () { //function code here } }) &lt;html ng-app="listingsApp"&gt; ... &lt;body ng-controller="pageController"&gt; &lt;div class="pagination"&gt;Page: &lt;span ng-repeat="page in pages"&gt; &lt;a href="" ng-click="GoToPage($index)"&gt;{{$index + 1}}&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt; &lt;/div&gt; &lt;table id="updateTable" width="2000" cellpadding="4" cellspacing="4" border="0"&gt; ... &lt;tr ng-repeat="listing in allListings"&gt; &lt;td&gt;{{listing.id}}&lt;/td&gt; &lt;td&gt;{{listing.name}}&lt;/td&gt; &lt;td&gt;{{listing.address}}&lt;/td&gt; &lt;td&gt;{{listing.city}}&lt;/td&gt; &lt;td&gt;{{listing.state}}&lt;/td&gt; ...
type: AnsweredQuestion
downvote count: 3
accepted answer: http://stackoverflow.com/a/26832588
type: Question
upvote count: 0
has title: Angular JS is Giving an Undefined Function Error
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/42281601
type: Comment
type: QuestionComment
has text: any link to your plugin? what kind of work you need to do. put some example.
comment on: http://stackoverflow.com/q/26860394
score: 0

http://stackoverflow.com/q/26873332
has comment: http://stackoverflow.com/comment/42305079
possible better answer: http://stackoverflow.com/a/26874402
accepted answer: http://stackoverflow.com/a/26874582
has answer: http://stackoverflow.com/a/26874402
favorite count: 0
has title: DOM - Find text between arbitrarily nested elements
upvote count: 2
has comment: http://stackoverflow.com/comment/42306449
has comment: http://stackoverflow.com/comment/42304905
has comment: http://stackoverflow.com/comment/42305083
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26874582
has comment: http://stackoverflow.com/comment/42306867
tagged with: dom
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/42307350
downvote count: 0
tagged with: javascript
has body: Suppose my DOM looks something like this (purely fictional example): Text 1 Text 2 What I'm attempting to do is to find all text (if any) between consecutive elements independent of nesting level (so in this case, I'd find Text1 between #img1 and #img2, Text 2 between #img2 and #img3, and nothing/an empty string between #img3 and #img4) I don't know ahead of time how the dom is going to be structured. I've tried using JQuery's nextUntil(), but that only seems to work for sibling nodes.
tagged with: jquery

http://stackoverflow.com/q/26888620
upvote count: 1
score: 1
type: Question
has body: I'm using AngularJS and the ng-grid module (v3.0, ui.grid) and as the title says, I'm trying to activate the enableFiltering dynamically in a grid, but i can't and i don't know why. I can change the enableCellEdit behavior on the fly, but the same process doesn't seem to work for enableFiltering (although they both are options equally). Currently, i'm trying to change the enableFiltering's value this way: var options = angular.copy($scope.gridOptions[$index]); options.enableFiltering = true; $scope.gridOptions[$index] = options; for ( var i = 0, j = $scope.gridOptions[$index].columnDefs.length; i &lt; j; i += 1 ) { $scope.gridOptions[$index].columnDefs[i].enableFiltering = true; } $scope.gridApi[$index].core.refresh(); I'm creating a lot of grids, because of that i'm using arrays. The main problem is that the grid doesn't change. It happens nothing. Theoretically, enabling this option each column in the grid should show the input for filtering. Any suggestion? Thanks a lot!
tagged with: mean-stack
downvote count: 0
tagged with: javascript
tagged with: ng-grid
favorite count: 0
has title: ng-grid: Trying to enable enableFiltering option dynamically
tagged with: angularjs
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/42358579
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26896811
has text: I've updated my question with some more data. I just can't figure out where this error might be...
score: 0

http://stackoverflow.com/q/26843043
linked to: http://stackoverflow.com/q/9959690
tagged with: javascript
score: 0
has title: finding focus of cursor in radeditor
answer count: 1
has body: I am using radeditor in my project. I want the text which is immediate after the cursor position or immediate before the cursor position. I can set html using editor.pasteHtml("html") but how can I get the text before or after that position?
type: UnansweredQuestion
tagged with: telerik
tagged with: radeditor
has answer: http://stackoverflow.com/a/26862821
type: Question
tagged with: c#

http://stackoverflow.com/q/26977121
has body: My JSON looks like this: json = [ { type: "big" date: "2012-12-08" qty: 6 } { type: "small" date: "2012-12-08" qty: 9 } { type: "big" date: "2012-12-15" qty: 4 } { type: "small" date: "2012-12-07" qty: 7 } { type: "small" date: "2012-11-07" qty: 3 } ] What I'm trying to do is group/merge each type that has a date with the same year &amp; month (the first 7 characters in the date string) and get the sum of those qty's. The output should look like this: json = [ { type: "big" date: "2012-12" qty: 10 } { type: "small" date: "2012-12" qty: 16 } { type: "small" date: "2012-11" qty: 3 } ] There are several similar questions I've found here but haven't come across one that does exactly what I'm looking for. I have played around with lots of code borrowed from different examples but can't quite seem to get the results I need. I'm not home now, therefore I can't paste any code I've tried at the moment but I'm asking for help in hopes to have an answer/solution to test out later
type: Question
has answer: http://stackoverflow.com/a/26978519
has answer: http://stackoverflow.com/a/26977366
score: 1
tagged with: coffeescript
has answer: http://stackoverflow.com/a/26977726
answer count: 3
upvote count: 1
tagged with: arrays
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Sort and merge JSON keys with matching values
accepted answer: http://stackoverflow.com/a/26977366
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/26977726
downvote count: 0
has comment: http://stackoverflow.com/comment/42492213

http://stackoverflow.com/comment/42449073
score: 0
has text: Arbitrarily. Potentially through knockout, or appending document fragments through the DOM API.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26954569

http://stackoverflow.com/q/26923271
linked to: http://stackoverflow.com/q/1357118
has answer: http://stackoverflow.com/a/26923603
has answer: http://stackoverflow.com/a/26923285
has body: On this simple example, 'return' is used on three places. So, i just confuse about using 'return' inside the function. What is use of this 'return' when to use inside the function? Mainly, I need to want to know, on the submit button, 'return' is used on the 'onclick' attribute, see here . So, also explain, What 'return' does exactly here. please. <TITLE>ComboBox Validation Select Java Server Pages Servlet PHP ASP //here
has answer: http://stackoverflow.com/a/26923319
tagged with: javascript
has title: What is the use of 'return' in javascript code
possible better answer: http://stackoverflow.com/a/26923358
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26923358
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/26923400
has comment: http://stackoverflow.com/comment/42393827
has answer: http://stackoverflow.com/a/26923384
favorite count: 0
answer count: 6
has comment: http://stackoverflow.com/comment/42393858
type: Question
accepted answer: http://stackoverflow.com/a/26923319
upvote count: 1

http://stackoverflow.com/a/26923912
answers question: http://stackoverflow.com/q/26923847
accepted answer of: http://stackoverflow.com/q/26923847
has body: The issue is with how you post via CURL, you need to quote the URL, otherwise the ampersand sign will set CURL as a background process curl -i -X GET "http://localhost:8080/albums/italy2012.json?page=0&amp;page_size=20"
type: AcceptedAnswer
score: 4
type: Answer
upvote count: 4
downvote count: 0

http://stackoverflow.com/q/26978637
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/26979892
has comment: http://stackoverflow.com/comment/42493035
has comment: http://stackoverflow.com/comment/42492994
score: 0
has body: I would like to place the views of my application in a separate js file. My code now looks like this: var SearchApp = Backbone.View.extend({ initialize: function() { // Bind all functions that uses 'this' as the current object _.bindAll(this, 'render', 'addDocument', 'initVisualSearch'); this.initVisualSearch(); this.model.bind("change:results", this.render, this); this.collection = this.model.get("hits"); this.collection.bind("add", this.addDocument, this); this.collection.bind("reset", function() { this.collection.each(this.addDocument); }, this); var detailshtml = ' '; detailshtml += ' '; this.$el.html(detailshtml); this.model.bind("change:query", function() { }, this); }, initVisualSearch: function() { this.visualSearch = VS.init({ }); }, template: _.template($("#template-N").html()), render : function() { this.$el.children("#results-N").html(this.template(this.model.toJSON())); return this; } }); However, simply creating a new js file and calling var search = new SearchApp(); will not work. I was wondering, is there any easy solution for placing this view outside my html file? Thank you! Later edit: here is how I am including the relevant javascript: The errors that I receive in the console are: undefined is not a function cannot read property 'model' of undefined cannot read property 'visualSearch' of undefined
has comment: http://stackoverflow.com/comment/42492481
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42493083
has comment: http://stackoverflow.com/comment/42493624
has answer: http://stackoverflow.com/a/26978838
has title: Backbone.js - place views in separate js file
tagged with: backbone.js

http://stackoverflow.com/q/26974728
upvote count: 1
has comment: http://stackoverflow.com/comment/42484531
has comment: http://stackoverflow.com/comment/42485107
has title: dynamically generated buttons with javascript
type: Question
has comment: http://stackoverflow.com/comment/42485035
tagged with: javascript
has answer: http://stackoverflow.com/a/26975187
has comment: http://stackoverflow.com/comment/42485075
answer count: 3
has answer: http://stackoverflow.com/a/26975986
has body: I am working on a TV application with JavaScript, Html and CSS. I want to generate buttons where the label(title) is not always the same: sometimes so long or quiet short. The labels should be dynamically generated from xml files. So the problem is to display all the generated buttons with the same width. Here is how I am creating the buttons with javascript: var a = document.createElement("a"); var span2 = document.createElement("span"); span2.setAttribute("class", "span1"); span2.appendChild(document.createTextNode(text)); a.appendChild(span2); How we can do it?
downvote count: 0
has answer: http://stackoverflow.com/a/26975573
has comment: http://stackoverflow.com/comment/42485275
favorite count: 0
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/42484529
score: 1

http://stackoverflow.com/q/26961045
has answer: http://stackoverflow.com/a/27000318
has title: OpenSeadragon Dynamic Image
type: AnsweredQuestion
has body: I would like to create a tilesource for OpenSeadragon, to render a player's view for a game. The world has coordinates (x,y), player is on a particular coord, with a view range. What I would like is to create a tilesource for OpenSeadragon, that can display the whole view. At maximum zoom, 1 tile = 1 coord. So I have a few questions : How can I compute the maximum zoomlevel for player's view range ? How can I know the world positions I have to render in the tile that is requested by OpenSeadragon (x, y, level) ? Thanks :)
tagged with: deepzoom
has comment: http://stackoverflow.com/comment/42516549
accepted answer: http://stackoverflow.com/a/27000318
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/42516573
has comment: http://stackoverflow.com/comment/42491238
tagged with: openseadragon
score: 0
answer count: 1

http://stackoverflow.com/a/27585364
accepted answer of: http://stackoverflow.com/q/26980621
upvote count: 2
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/26980621
type: AcceptedAnswer
has body: I'm getting ready to start a small project that will potentially do this. You should NOT embed your keys in the browser and you do not have to. Please review the following AWS JavaScript SDK documentation and pay attention to the Loading Credentials in the Client's Browser section. Personally I plan on utilizing an S3 Upload and perhaps a DynamoDB connection. There is a new service called AWS Cognito which is referenced in the above documentation which allows for simplifying a token vending machine to grant temp access to users to access your AWS service. One of the recent updates of Cognito is the ability to use your own custom authentication service.

http://stackoverflow.com/a/26843746
answers question: http://stackoverflow.com/q/26843566
downvote count: 0
has body: $("...") returns a jQuery collection that contains the matched elements. You cannot access the elements and their properties directly, instead: Use the jQuery.get accessor method: var x = $("#mySelect").get(0).selectedIndex; var y = $("#mySelect").get(0).options; Dereference the element: var x = $("#mySelect")[0].selectedIndex; var y = $("#mySelect")[0].options; Use jQuery.prop: var x = $("#mySelect").prop("selectedIndex"); var y = $("#mySelect").prop("options"); Having said all that, you can change your code to this: var $selectedOption = $("#mySelect option:selected"); console.log( $selectedOption.index(), $selectedOption.text(), $selectedOption.val() );
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/26907090
type: Question
tagged with: angularjs-directive
has body: Is there a way to pass a custom filter as an attribute into a custom directive? So if I have a directive &lt;my-element value="1234" filter="my-filter:attr1:attr2"&gt;&lt;my-element&gt; as angular.module("directives", ["filter"]).directive("myElement", function() { return { restrict: "E", replace : true, scope : { value : "@", filter : "@" }, template: function (el, attr) { return "&lt;p&gt;&lt;/p&gt;"; }, link: function($scope){ /* linking stuff */ } }; }); with a filter: angular.module("filter", []).filter("myFilter", function() { return function(value, attr1, attr2) { return "filtered value"; }; }; }); Atm just nothing happens and I don't know what's going wrong here...
tagged with: javascript
has answer: http://stackoverflow.com/a/26907431
has comment: http://stackoverflow.com/comment/42364478
score: 0
has comment: http://stackoverflow.com/comment/42364708
tagged with: angularjs-filter
answer count: 1
has comment: http://stackoverflow.com/comment/42364540
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42366610
has title: Passing a custom filter with attributes to a custom directive in angular

http://stackoverflow.com/q/26966293
type: UnansweredQuestion
has body: I want to bind properties from my controller to the view. in angularjs it's as simple as manipulating the $scope: $scope.buttonProps = { value: 'cheese', disabled: 'disabled', onClick: function() {} }; &lt;custom-button disabled="buttonProps.disabled" onclick="buttonProps.onClick" value="{{buttonProps.value}}" /&gt; however when I try to do the same in SAPUI5 sap.ui.core.mvc.Controller.extend('...', { buttonProps: { value: 'cheese', disabled: 'disabled', onClick: function() {} } }); &lt;custom-button value="{buttonProps.value}" disabled="{buttonProps.disabled}" click="buttonProps.onClick" /&gt; it does not work - the framework doesn't seem to be able to access the properties of the "buttonProps" object. if I, however, move the properties directly onto the controller, it works sap.ui.core.mvc.Controller.extend('...', { value: 'cheese', disabled: 'disabled', onClick: function() {} }); &lt;custom-button value="{value}" disabled="{disabled}" click="onClick" /&gt; but of course, this is a very disorganised way of working when you get more complex views. I tried creating a JSONModel and binding the values via the model: sap.ui.core.mvc.Controller.extend('...', { buttonProps: new sap.ui.model.json.JSONModel({ value: 'cheese', disabled: 'disabled', onClick: function() {} }) onAfterRendering: function() { this.byId('btn').setModel(this.buttonProps); } }); &lt;custom-button id="btn" value="{/value}" disabled="{/disabled}" click="/onClick" /&gt; and it works for everything... except for functions. is there a way for me to bind properties from my controller to the view?
has answer: http://stackoverflow.com/a/26967183
has title: SAPUI5: Binding controller properties to the view
tagged with: sapui5
type: Question
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/q/26913202
tagged with: javascript
has body: I'm using firebase and my users are set up like this: { "firebase-account-123": { "users": { "simplelogin:1": { "properties"{ "name": "john doe", "email": "user@email.com" } "children": { "simplelogin:2":{ "name": "user 2", "email": "user2@email.com" }, } }, "simplelogin:2": { "properties"{ "name": "user 2", "email": "user2@email.com", "disabled": false } } } } I have "children" which account managers should have access to. I'm new to this and I'm trying to solve some permissions problems I'm having. My rules currently only allowing the users to read/write their own data. ".read": "auth.uid == $userid", ".write": "auth.uid == $userid" Does anyone know how I could make it so they also have the ability to write/read data (maybe just in the properties object) for users that are listed in their "children" object?
answer count: 2
score: 3
has comment: http://stackoverflow.com/comment/42607335
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/26917953
accepted answer: http://stackoverflow.com/a/26918005
possible better answer: http://stackoverflow.com/a/26917953
tagged with: firebase-security
type: AnsweredQuestion
tagged with: firebasesimplelogin
upvote count: 3
type: Question
tagged with: firebase
has title: Firebase user write/read rules based on data objects
has answer: http://stackoverflow.com/a/26918005

http://stackoverflow.com/a/44719469
score: 1
has body: Your question is answered here To summarize: as a background script, document refers to the background page.
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/26978241
upvote count: 1

binary-tree
tag name: binary-tree
type: Tag
tags question: http://stackoverflow.com/q/26911415

http://stackoverflow.com/a/26846254
score: 0
type: Answer
has body: Because #seeTemplates is a link (per OP comment), both the default link action and your custom event handler are running. To avoid that, you'll need to prevent the default behavior of the link: $('#resultsDiv').on('click', '#seeTemplates', function (e) { e.preventDefault(); var ebayTemplate = $('#templates').val(); var url = '@Url.Action("SeeTemplateDetailsByName", "EbayTemplate")'; window.location.href = url + "?templateName=" + ebayTemplate; }); You could also just change the element to be some other type (perhaps a &lt;span&gt;), and avoid the problem altogether.
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/26846157

http://stackoverflow.com/comment/42493482
has text: You already have "overflow: scroll" set on your container2 and thats what should allow your fixed sidebar to scroll. So since it's not scrolling, maybe you can try adding "overflow: scroll" to the #sidebar (the parent element of container2). Maybe the parent element is also fixed?? I created a simple codepen of this working: http://codepen.io/richfinelli/pen/RNwzwV
score: 0
comment on: http://stackoverflow.com/q/26978739
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42498240
comment on: http://stackoverflow.com/q/26977737
has text: remove `ballx = canvasWidth / 100;` within the `draw` function.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/26843968
has body: I have a list of group and in each group I have a list of members. In jsp each group is shown in a row of table and each row contains a dropdown of members. Please see the image below - What I am trying to do is - if I select a member from the dropdown then it's onchange trigger a javascript function and the user Id is shown in an alert.(for test purpose I'm now using alert, later I use the userId/member ID for other task). In the first dropdown there are some members - razib, syeful, proshanto. If I select a member from the first dropdwon then the member id is shown properly in the alert. But if I select any member from the other dropdwon (displaying the member name bulbul and rony) then the javascript function is not triggered. Can any one help me what are the problems with the code - The jsp snippet - <c:forEach items="${group.users}" var="user" varStatus="status"> <c:out value="${user.name}"/> </c:forEach> And the javascript snippet is - $(document).ready(function() { $('#userSelect').change(function(event) { var userId = $("select#userSelect").val(); alert("User ID :"+userId); });//change() }); //document.ready() Thanks in advance UPDATE: The answer given by San Krish and Carsten Løvbo Andersen works for a single single id of . But I have multiple with the id "userSeelct" because this is in a forEach loop. If I use class instead of ID then it is also not working.Please see How the actually in my code- <c:forEach id="groupId" var="group" items="${groupListForm.groups}" varStatus="status"> <c:forEach items="${group.users}" var="user" varStatus="status"> <c:out value="${user.name}"/ </c:forEach> </c:forEach> The earlier given answer is OK for a single . But I think the problem is the is also in a for each loop and there are multiple with the same id/class. In this case how can I solve the problem? Thanks again.
tagged with: foreach
score: 2
type: AnsweredQuestion
downvote count: 0
type: Question
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/26844070
tagged with: jstl
tagged with: jsp
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/26844028
possible better answer: http://stackoverflow.com/a/26844070
has title: Calling Javascript from jsp onchange of a dropdown value
has answer: http://stackoverflow.com/a/26844028
favorite count: 0

http://stackoverflow.com/q/26891396
tagged with: javascript
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/26891461
tagged with: regex
has body: I thought it was very simple to find out. But how many ways I tried still not work properly. Below is the test snippet. "100$ and 1.000,000EUR 1,00.0.000USD .90000000000000000000$ (09898)".replace(/[\.,\d]*/g, '{n}') And I want the result like below. {n}$ and {n}EUR {n}USD {n}$ ({n})
has comment: http://stackoverflow.com/comment/42336624
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26891478
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/26891444
type: Question
has title: I want to find numbers-include dot and comma- but Regex not working in javascript

http://stackoverflow.com/comment/42339491
type: QuestionComment
has text: As others have said - that's not valid, but why do you think you need an object that looks like that? Are you trying to use it with another method you read about?
score: 0
comment on: http://stackoverflow.com/q/26892858
type: Comment

http://stackoverflow.com/comment/42372433
score: 0
type: Comment
comment on: http://stackoverflow.com/q/26911368
type: QuestionComment
has text: instead of 'transactionID'.match(/[a-z]+|[A-Z]+/g), use 'DOB'.match(/[a-z]+|[A-Z]+/g)

http://stackoverflow.com/comment/42414729
type: Comment
comment on: http://stackoverflow.com/q/26934029
has text: `` hurt my eyes. Please don't do that. First of all it's a button, not link. Second of all: Use event listeners so you don't have to expose global functions.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/42474586
has text: i get color. now i want to focus textbox.
comment on: http://stackoverflow.com/a/26966817
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/68116978
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26847168
score: 0
has text: @TheMuffinMan the short answer is I figured out and it isn't possible.

http://stackoverflow.com/q/26884732
type: Question
has title: How to keep the height of parent div same after the child div slides up?
has answer: http://stackoverflow.com/a/26884863
has body: When I click on "option-heading" div, "option-content" div slides up but also the height of "main_box" div changes. I want to keep the height of "main_box" div same after the "option-content" div slides up. Does anyone know how to do it??
tagged with: javascript
has answer: http://stackoverflow.com/a/26884878
answer count: 3
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/26885300
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 2
has comment: http://stackoverflow.com/comment/42324689
upvote count: 2
type: UnansweredQuestion

http://stackoverflow.com/comment/42424677
comment on: http://stackoverflow.com/q/26939310
type: QuestionComment
type: Comment
has text: `null == undefined`, but `null !== undefined`.
score: 0

http://stackoverflow.com/comment/42260929
type: AnswerComment
score: 0
has text: I did not do that and also dont know what you mean haha im sorry. this is also my first time using stack exchange. anyways, did you mean $(document).ready($("#button1").click(function(){code}) $("#button1").click(function(){code}) ?
type: Comment
comment on: http://stackoverflow.com/a/26848861

http://stackoverflow.com/a/26894778
has comment: http://stackoverflow.com/comment/42343924
has comment: http://stackoverflow.com/comment/42418189
type: AcceptedAnswer
downvote count: 0
has body: Have you tried this? var x = document.querySelectorAll(":not(" + myParameter + ")");
accepted answer of: http://stackoverflow.com/q/26894747
type: Answer
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/26894747

http://stackoverflow.com/q/26859296
score: 0
has comment: http://stackoverflow.com/comment/42281286
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has title: transition when using $("class").load ajax jquery
has body: I have main html showing 8 thumbnails from section A, when clicking on section B i will use $("content").load to load section B thumbnails. Working fine but i wonder how i can make transition happen instead of the dull changing way.. Thanks sectionA Featured Portfolio1 sectionA Featured Portfolio2 sectionA Featured Portfolio3 sectionA Featured Portfolio4
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/42280949
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/42280459

http://stackoverflow.com/comment/42266681
type: QuestionComment
comment on: http://stackoverflow.com/q/26852035
has text: I tried it in chrome 38.0.2125.111 m and it works. Windows 7 OS. What OS do you have?
score: 0
type: Comment

http://stackoverflow.com/comment/42316143
type: Comment
comment on: http://stackoverflow.com/q/26879386
has text: you can use the "rooms" of Socket.io one example here http://stackoverflow.com/questions/6846174/dynamic-rooms-with-socket-io-and-node
score: 0
type: QuestionComment

http://stackoverflow.com/comment/42493354
comment on: http://stackoverflow.com/q/26979455
score: 0
type: QuestionComment
type: Comment
has text: `$(function(){})` is shorthand for `$(document).ready(function(){})`, which it means it's not executed *until* the `document` is loaded. So, `$(function(){})` adds a function to the event queue, then the rest of the page runs. Once the DOM is ready, then your function runs.

http://stackoverflow.com/a/26918994
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26918892
answers question: http://stackoverflow.com/q/26918892
has body: Could also do this add .anim {display:none} to the css then show it in $( document ).ready(function() { $( ".anim" ).fadeIn( "slow" ); }); http://jsfiddle.net/1egdn3wx/1/
upvote count: 3
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/42386301

http://stackoverflow.com/a/26953321
has body: sure you can $(document).ready(function() { function change() { $('#shoppingBag, .overlay').css('visibility', 'visible'); $('#shoppingBag, .overlay').css('opacity', '1'); $('.icon-cart').css('color', '#cc181e'); $('.toggle__shoppingbag').css('background-color', '#131418'); $('.toolbar').css('background-color', '#0a0a0c'); } function reset() { $('#shoppingBag, .overlay').css('visibility', 'hidden'); $('#shoppingBag, .overlay').css('opacity', '0'); $('.icon-cart').css('color', '#fff'); $('.toggle__shoppingbag').css('background-color', 'transparent'); $('.toolbar').css('background-color', '#131418'); } $('#cart-target, #shoppingBag').hover(change, reset); $('#cart-target').toggle(change, reset); });
downvote count: 0
score: 3
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26953267
answers question: http://stackoverflow.com/q/26953267
upvote count: 3
type: Answer

http://stackoverflow.com/comment/42342773
type: Comment
has text: Yes, that was it! Thank you very much see updated plunker in EDIT2
comment on: http://stackoverflow.com/a/26894034
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42499208
has text: if it isn't javascript, you can't load it with a script element.
comment on: http://stackoverflow.com/q/26982611
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/42390044
score: 0
comment on: http://stackoverflow.com/q/26920395
type: Comment
type: QuestionComment
has text: When meteor stores a document, it's seralized as [EJSON](https://www.meteor.com/ejson) which can't include things like functions and circular references. To instantiate a new instance after a [find](https://docs.meteor.com/#/full/find) you should use a transform. See [this video](https://www.eventedmind.com/feed/meteor-transforming-collection-documents) for more details.

http://stackoverflow.com/q/26961778
answer count: 2
has body: Fiddle Example I'm making a function to return the next nearest number and the associated color from a value,like if the value is 500, the function will return 600 and its associated color beige. I'm using two arrays, one for the numbers, and the other for the colors to accomplish that. I 'd like to know if that's the right way of doing things like that. Instead of two separate arrays, can I just use one associative array to get the result? Instead of: var array = [50,100,200,400,600,1000,1500] var color = {50:"red",100:"yellow",200:"Golden",400:"Black",600:"beige",1000:"pink",1500:"green"}; Is it possible to use something like that: var array ={50:"red",100:"yellow",200:"Golden",400:"Black",600:"beige",1000:"pink",1500:"green"}; Here's the example: var array = [50,100,200,400,600,1000,1500] var color = {50:"red",100:"yellow",200:"Golden",400:"Black",600:"beige",1000:"pink",1500:"green"}; var getClosestValues = function(a, x) { var lo, hi; for (var i = a.length; i--;) { if (a[i] &lt;= x &amp;&amp; (lo === undefined || lo &lt; a[i])) lo = a[i]; if (a[i] &gt;= x &amp;&amp; (hi === undefined || hi &gt; a[i])) hi = a[i]; }; var text = []; var text = [x+'/'+hi,color[hi]]; return text; } var print = getClosestValues(array,1411); $('.area').html('&lt;div style="background:'+print[1]+'"&gt;'+print[0]+'&lt;/div&gt;');
has answer: http://stackoverflow.com/a/26961827
tagged with: associative-array
upvote count: 1
has comment: http://stackoverflow.com/comment/42461673
tagged with: arrays
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26961794
downvote count: 0
score: 1
favorite count: 0
has title: Use one Associative Array instead of two index arrays in jQuery
type: Question

http://stackoverflow.com/q/26848439
tagged with: class
has comment: http://stackoverflow.com/comment/42291102
has body: I am always struggling with the JavaScript object/class inheritance thing. I also don't like the duplicate code in all the examples I can find (the name of the object needs to be written a few times). As far as I understand, proper inheritance in JavaScript looks like this: function Parent(v) { console.log('Parent', v); } Parent.prototype.helloParent = function() { console.log('hello parent'); } function Child(v) { Parent.call( this, 'from child'); console.log('Child'); } Child.prototype = Object.create(Parent.prototype); Child.prototype.constructor = Child; Child.prototype.helloChild = function() { console.log('hello child'); } c = new Child(); console.log(c instanceof Child); c.helloParent(); c.helloChild(); In this example, to extend the "Parent" object, I have to write "Child" four times, "Parent" two times. I want to type them both just once once – because of DRY. I also don't want to define a custom function for this inheritance stuff. That just feels odd for me, to need a user function for such a fundamental functionality (and it is getting hard to read unknown code, because you never know what this specific inheritance function is doing exactly). So I tried to find a simpler version. However I am not sure if I missed something? function Parent(v) { console.log('Parent', v); this.helloParent = function() { console.log('hello parent'); } } (Child = function(v) { this.constructor('from child'); console.log('Child'); this.helloChild = function() { console.log('hello child'); } }).prototype = Parent.prototype; c = new Child(); console.log(c instanceof Child); c.helloParent(); c.helloChild(); Is this okay or does it have serious drawbacks? Edit: Regarding the comments, sadly it seems that it has some serious drawback. Are there any other solutions to reduce at least to write the name of the parent object multiple times?
has answer: http://stackoverflow.com/a/26924010
score: 1
has title: Simpler JavaScript inheritance without duplicate code
has answer: http://stackoverflow.com/a/26866185
linked to: http://stackoverflow.com/q/26595866
favorite count: 0
has comment: http://stackoverflow.com/comment/42260378
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/16063394
upvote count: 1
has comment: http://stackoverflow.com/comment/42259686
has comment: http://stackoverflow.com/comment/42259717
tagged with: oop
has comment: http://stackoverflow.com/comment/42260360
tagged with: prototype
has comment: http://stackoverflow.com/comment/42297801
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: inheritance
has comment: http://stackoverflow.com/comment/42272390

http://stackoverflow.com/comment/42257531
type: QuestionComment
comment on: http://stackoverflow.com/q/26846789
has text: Clarify something for me please: When your browser window is 2000px, you want your slider to be 1200px wide and align it in the middle. When your browser window is 1000px, how do you want to display your slider? Resize it to 1000px or keep displaying it at 1200px but *cut* 100px on each side? Or am I misunderstanding you completely?
score: 0
type: Comment

http://stackoverflow.com/a/26915176
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/26914254
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/26914254
has body: You can use the same code with the new value. Some more info here: Call the _setCustomVar() function when it can be set prior to a pageview or event GIF request. In certain cases this might not be possible, and you will need to set another _trackPageview() request after setting a custom variable. This is typically only necessary in those situations where the user triggers a session- or visit-level custom var, where it is not possible to bundle that method with a pageview, event, or ecommerce tracking call. Source: https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingCustomVariables
type: AcceptedAnswer

http://stackoverflow.com/a/26868142
has body: If you place your url between quotes the problem is fixed: url: 'childfilm.php'. Without the quotes javascript thinks it's an object (which will return undefined).
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/26868057
downvote count: 0

http://stackoverflow.com/comment/42512219
type: QuestionComment
comment on: http://stackoverflow.com/q/26971950
has text: Look at [the old answer](http://stackoverflow.com/a/8138980/315935) which contains [the demo](http://www.ok-soft-gmbh.com/jqGrid/SimpleLocalGridWithSortableMultiselect1.htm). It changes the header of multiselect column so that one can sort the grid by multiselect column by clicking on the column header. It seems me almost the same what you ask.
score: 0
type: Comment

http://stackoverflow.com/q/26911801
type: Question
has body: It is working when I do this with getElementByID. But when I change it to className, it doesn't work. The reason why I am going to do this with class name is because there would be many looping (php) ticket in the page which is ordered by ticket number. And when "view" is clicked for a specif ticket, it will show the full message on it. Of course, I can't get it by multiple duplicate "id" here. And I need to change it to class name only. Help, please. Tiket Baru X CSS:
tagged with: javascript
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/26911877
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has title: Need to change from get ByID to ClassName (Javascript)
tagged with: css
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/26911877
has comment: http://stackoverflow.com/comment/42373155
upvote count: 1

http://stackoverflow.com/comment/42756232
comment on: http://stackoverflow.com/a/26930198
score: 0
type: AnswerComment
type: Comment
has text: right, if you just want to attach information then fields like label could be a good starting point to hack something together!

http://stackoverflow.com/q/26943166
has comment: http://stackoverflow.com/comment/42429730
has title: Not able to fire a action on selecting a option through jquery
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42429501
has comment: http://stackoverflow.com/comment/42429724
accepted answer: http://stackoverflow.com/a/26943703
upvote count: 1
answer count: 1
downvote count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42429680
has comment: http://stackoverflow.com/comment/42429505
favorite count: 0
score: 0
has answer: http://stackoverflow.com/a/26943703
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to generate a div on selecting a specific option in select tag.For this i am using jquery.But i am not able to do so My code is as below: And my select code is as below: Electronices Fashion I have included jquery file also which works well for ready function Can you tell me where is i am wrong?i am newbie in jquery

http://stackoverflow.com/q/26853787
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/26853826
accepted answer: http://stackoverflow.com/a/26853826
score: 0
has body: I have a jQuery function called ShowPopup that opens a modal popup box when clicked. This works fine, however when I click the 'Cancel' button on the modal, it doesn't close. It should be calling the jQuery function btnClose, but nothing ever happens. It's being called twice in the asp code. Any help would be appreciated, thanks. The jQuery code: The ASP code where btnClose is clicked and called: <asp:GridView ID="Grd" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" style="table-layout:fixed;" Width="1000px" OnRowDataBound="Grd_RowDataBound" OnRowCommand="Grd_RowCommand"> <asp:ButtonField CommandName="ColumnClick" Visible="false" /> <asp:BoundField DataField="Month" HeaderText="Month" SortExpression="Month" HeaderStyle-Width="60px" /> <asp:BoundField DataField="1" HeaderText="1" SortExpression="1" /> <asp:BoundField DataField="2" HeaderText="2" SortExpression="2" /> <asp:BoundField DataField="3" HeaderText="3" SortExpression="3" /> <asp:BoundField DataField="4" HeaderText="4" SortExpression="4" /> <asp:BoundField DataField="5" HeaderText="5" SortExpression="5" /> <asp:BoundField DataField="6" HeaderText="6" SortExpression="6" /> <asp:BoundField DataField="7" HeaderText="7" SortExpression="7" /> <asp:BoundField DataField="8" HeaderText="8" SortExpression="8" /> <asp:BoundField DataField="9" HeaderText="9" SortExpression="9" /> <asp:BoundField DataField="10" HeaderText="10" SortExpression="10" /> <asp:BoundField DataField="11" HeaderText="11" SortExpression="11" /> <asp:BoundField DataField="12" HeaderText="12" SortExpression="12" /> <asp:BoundField DataField="13" HeaderText="13" SortExpression="13" /> <asp:BoundField DataField="14" HeaderText="14" SortExpression="14" /> <asp:BoundField DataField="15" HeaderText="15" SortExpression="15" /> <asp:BoundField DataField="16" HeaderText="16" SortExpression="16" /> <asp:BoundField DataField="17" HeaderText="17" SortExpression="17" /> <asp:BoundField DataField="18" HeaderText="18" SortExpression="18" …
answer count: 1
tagged with: jquery
tagged with: asp.net
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has title: jQuery function in ASPX page issue

http://stackoverflow.com/a/36460227
answers question: http://stackoverflow.com/q/26891234
score: 0
type: Answer
has body: You can use blueimp Javascript-Load-Image library. You can use exif data parsing methods to parse image dpi, width, height and other informations from the image. You can load the image locally from file tags or from the image urls as per requirement. Mostly jpeg images and raw image formats store information in exif data. Other formats like png don't have provisions for exif data and hence dpi of such images are difficult to extract without actually loading them in image editing tools like photoshop.

http://stackoverflow.com/comment/42368956
score: 0
has text: Say I'll use draggable/droppable. How would I store these positions generated by the drag and drop functionality for later use ? So when I edit something, I want someone else to see the same thing when he enters my page.
type: Comment
comment on: http://stackoverflow.com/a/26909576
type: AnswerComment

http://stackoverflow.com/comment/42274998
type: QuestionComment
has text: Also, I see you check on the `.html()`. Notice that I check on the class.. always try to avoid checking on `.html()`. Well, you got mine, use it and learn from it
score: 0
comment on: http://stackoverflow.com/q/26855002
type: Comment

http://stackoverflow.com/comment/42416330
comment on: http://stackoverflow.com/a/26935566
score: 0
type: Comment
has text: Please add some explanation to your answer. Code-only answers are sometimes good enough, but code+explanation answers are always better
type: AnswerComment

http://stackoverflow.com/q/26982996
upvote count: 15
tagged with: node.js
favorite count: 0
downvote count: 0
tagged with: php
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/35444935
has answer: http://stackoverflow.com/a/72919987
score: 15
has answer: http://stackoverflow.com/a/26983436
has title: Trying to proxy an image in node-js/express
accepted answer: http://stackoverflow.com/a/26983436
linked to: http://stackoverflow.com/q/55349722
tagged with: javascript
tagged with: express
has body: I get a broken image link when I try to access this via Express: app.get('/fileThumbnail', function(req, res) { var url = proxiedURL +"?" + querystring.stringify(req.query); logger.info('/fileThumbnail going to url', url); request.get(url, function(err, response, img) { logger.info("response:", response.statusCode, response.headers['content-type']); if (!err &amp;&amp; response.statusCode === 200) { res.writeHead(200, { 'Content-Type': response.headers['content-type'] }); // response.pipe(res); // not working res.writeHead(200, response.headers); res.end(img, 'binary'); } else res.send("Error occurred:", err, "; status code: ", response.statusCode); }) }); The thumbnail is coming from a PHP server: if (!$thumbnail) { $thumbnail = $_SERVER['DOCUMENT_ROOT'].'/images/spacer.gif'; } // Write the thumbnail header('Content-Type: '.image_type_to_mime_type(exif_imagetype($thumbnail))); header('Content-length: '.filesize($thumbnail)); print file_get_contents($thumbnail,FILE_BINARY); Have tried several things; response headers are as follows: Access-Control-Allow-Methods:GET,POST,PUT,DELETE,OPTIONS access-control-allow-origin:* cache-control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0 connection:Keep-Alive content-length:894 content-type:image/jpeg date:Mon, 17 Nov 2014 22:13:24 GMT expires:Thu, 19 Nov 1981 08:52:00 GMT keep-alive:timeout=5, max=100 pragma:no-cache server:Apache/2.2.15 X-Powered-By:Express
possible better answer: http://stackoverflow.com/a/35444935
answer count: 3

http://stackoverflow.com/a/26835737
accepted answer of: http://stackoverflow.com/q/26835684
type: Answer
has body: Try this $('a').click(function(e) { e.preventDefault(); $("#help").load($(this).attr('href')); })
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/42267550
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26835684

http://stackoverflow.com/comment/42494648
type: AnswerComment
has text: The ! needs to be within the if's brackets, like if (!..., but basically, it should work. Try it and let us know what results you get.
type: Comment
comment on: http://stackoverflow.com/a/26919628
score: 0

http://stackoverflow.com/a/26871188
has body: Something like this? var data = ["asd", 123]; function isAllString(data) { var stringCount; for (var i = 0; i &lt;= data.length; i++) { if (typeof data[i] === 'string') stringCount++; } return (stringCount == data.length); } if (isAllString(data)) { alert('all string'); } else { alert('check failed'); }
answers question: http://stackoverflow.com/q/26871106
has comment: http://stackoverflow.com/comment/42300985
score: 0
type: Answer

http://stackoverflow.com/comment/42360212
comment on: http://stackoverflow.com/a/26904195
has text: When I assign the event listener I get a new this? where can I check the information to understand the knowledge points？
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/42492757
type: Comment
type: QuestionComment
has text: I mean since that is available in server side code supporting property, you can not use that in `javascript`, rather look out the answer posted., if that does not work, let me know, i will try to post answer.
comment on: http://stackoverflow.com/q/26978112
score: 0

http://stackoverflow.com/a/26852559
upvote count: 3
score: 3
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26852333
answers question: http://stackoverflow.com/q/26852333
type: Answer
has body: Your code is going to make a POST request with the Content-Type application/x-www-form-urlencoded and a POST body that looks like this: isProfilePhoto=true&amp;photoId=123 Your server receives that as a string (well, a byte stream...) and unless you have code or some module that tells it otherwise, it has no way to know that the four bytes true should be converted to a boolean, or that the three bytes 123 should be converted to a number (it's probable that your ORM takes care of the latter at some point, though). One way to get around this would be to send a JSON request instead. (In jQuery you do this by passing "json" as the 4th argument to $.post). In such a request the Content-Type would be application/json and the POST body would look like this (except without the whitespace): { "isProfilePhoto": true, "photoId": 123 } In JSON, true is always a boolean and "true" is always a string, so when your server parses it it'll automatically have the right type. Of course, you'd have to change your server-side code to parse the JSON body, but that's pretty easy these days.

http://stackoverflow.com/comment/42408779
has text: http://stackoverflow.com/questions/2600709/changing-document-domain-to-completely-other-domain
type: QuestionComment
comment on: http://stackoverflow.com/q/26931925
type: Comment
score: 0

http://stackoverflow.com/q/26964263
has comment: http://stackoverflow.com/comment/45978407
answer count: 0
upvote count: 3
type: Question
has body: There is a great tut which illustrates how to accomplish this, however I can't seem to get it right. Here is the example and here is my take on it. And even stranger I am not getting any errors in the console. Here is the HTML from my project locally. Filter: All {{category}} Sort: Asc Desc Value : {{drawing.name}} JS: rustyApp.controller('DrawingsController', function DrawingsController($scope) { $scope.categories = ['Soft', 'Elements']; $scope.drawings = [{ category: 'Elements', value: '1', source: 'http://placehold.it/350x150' }, { category: 'Elements', value: '1', source: 'http://placehold.it/350x150' }, { category: 'Elements', value: '2', source: 'http://placehold.it/350x150' }, { category: 'Soft', value: '2', source: 'http://placehold.it/350x150' }, { category: 'Soft', value: '3', source: 'http://placehold.it/350x150' }]; });
downvote count: 0
has title: How do I get Angular.js and Mixitup.js to work together
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45973901
favorite count: 0
tagged with: mixitup
tagged with: angularjs
type: UnansweredQuestion
score: 3
linked to: http://stackoverflow.com/q/26985399

http://stackoverflow.com/comment/101478718
score: 0
type: Comment
has text: Pro tip: Find the element in "Elements" tab of Developer Console, select that, and then type `c = $0.__vue__` in console. Now `c` is your Vue component and you can inspect all its properties. :)
comment on: http://stackoverflow.com/a/28833179
type: AnswerComment

http://stackoverflow.com/q/26918001
has comment: http://stackoverflow.com/comment/42384625
tagged with: http://stackoverflow.com/tag/html
has title: jQuery .each loop not working in Chrome
tagged with: google-chrome
has answer: http://stackoverflow.com/a/26918151
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/42384442
has body: I have a web app that use jquery to submit all forms in the page. The code is like this : $('form').each(function() { $(this).submit(); }); This is working great in IE and FireFox but on Chrome and Safari it is only submitting the first form of the page, ignoring totally the rest. The app is a asp.net mvc and the forms are posted to a HttpPost action in my controller. If anyone has any idea or see something I did totally wrong please advise, it will be appreciated. Thx and have a nice day.
answer count: 1
tagged with: submit
tagged with: jquery
type: UnansweredQuestion

http://stackoverflow.com/q/26930692
has answer: http://stackoverflow.com/a/58974998
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: sorting
has title: Lo-Dash sortBy array of dates in string format
has body: I'd like to know why lodash doesn't sort array of dates in string format as compared with plain javascript sort(). Is it expected behavior or a bug? var array = ["2014-11-11", "2014-11-12", null, "2014-11-01", null, null, "2014-11-05"]; _.sortBy(array); // ["2014-11-11", "2014-11-12", null, "2014-11-01", null, null, "2014-11-05"] _.sortBy(array, function(value) {return new Date(value);}); // [null, null, null, "2014-11-01", "2014-11-05", "2014-11-11", "2014-11-12"] array.sort(); // ["2014-11-01", "2014-11-05", "2014-11-11", "2014-11-12", null, null, null] Version used: Lo-Dash v2.4.1 – Modern build.
favorite count: 0
possible better answer: http://stackoverflow.com/a/58974998
tagged with: lodash
upvote count: 13
type: AnsweredQuestion
score: 13
has answer: http://stackoverflow.com/a/26935540
accepted answer: http://stackoverflow.com/a/26935540
type: Question

http://stackoverflow.com/a/26959027
answers question: http://stackoverflow.com/q/26958935
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: Do it simply: $('input[type="checkbox"].country').on('click', function (){ var name = $.trim(this.name); $('#destination div.' + name).toggleClass('hide'); });

http://stackoverflow.com/comment/42368367
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26909335
has text: This won't work for text nodes... ` text `
type: AnswerComment

http://stackoverflow.com/a/37749702
has body: By using ES3 Number method, it performs a rounding if no decimal place defined. (value / 1000).toFixed() * 1000 The original answer was: (value / 1000).toFixed(3) * 1000; Yet this is incorrect, due to the value will return the exact original number, instead of affecting the ceil/floor on the value.
downvote count: 0
answers question: http://stackoverflow.com/q/26906657
upvote count: 3
type: Answer
score: 3

http://stackoverflow.com/comment/42255588
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26845967
type: Comment
has text: You need to show the rest of your HTML. You can get it from a) the button pressed (if multiple deletes) or b) store the attributes in the row. Please provide your HTML and I will update to match :)

http://stackoverflow.com/comment/42488381
has text: So if I need to send a very long string, with a bunch of non url encoded characters, I should set this to false? Right? What else needs to be set?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26976530

http://stackoverflow.com/comment/44517135
type: QuestionComment
has text: Specifically I'm wondering why the "a" tag never seems to trigger the event listener I have attached. I'm not stopping propagation.
comment on: http://stackoverflow.com/q/26975915
score: 0
type: Comment

http://stackoverflow.com/comment/42247321
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/26840464
has text: @A.Wolff On 2nd thought, $(selector) returns an array, doesn't matter if it's an array of strings or elements, it's an array. $(selector).each() shouldn't be any different than $([]).each(), both are working on an array. So does $.each([]). Am I wrong?

http://stackoverflow.com/q/26900753
type: AnsweredQuestion
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/26903305
has comment: http://stackoverflow.com/comment/42356415
score: 0
has body: I'm using the Facebook's Graph API (https://developers.facebook.com/tools/explorer), and query the "friends" field on my friends. But it always give me: { "error": { "message": "Unsupported operation", "type": "OAuthException", "code": 100 } } Is this error supposed to happen? If it is, then is there any way to crawl Facebook friends' friends using other methods? Any suggestions would be much appreciated, thanks!
tagged with: facebook-graph-api
has title: Facebook Graph API get friends of friends
tagged with: node.js
favorite count: 0
accepted answer: http://stackoverflow.com/a/26903305
tagged with: facebook
upvote count: 1
tagged with: request
downvote count: 1

http://stackoverflow.com/a/26884642
has body: this is the answer $( ".extra-info-vak, .extra-info-text" ).hover( function() { var _this = this; $(this).find('.triangle-up').stop(true).fadeOut({ duration:200, complete:function(){ $(_this).addClass("open"); $(_this).find('.triangle-up').stop(true); $(_this).find('.extra-info-text').stop(true).animate({height:'150px'},{duration:800,queue:false,easing:'easeOutQuart'}); } }); }, function() { var _this = this; $(_this).find('.extra-info-text').stop(true).animate({height:'60px'},{ duration:800, queue:false, easing:'easeOutBounce', complete:function(){ $(_this).find('.extra-info-text').stop(true); $(_this).find('.triangle-up').stop(true).fadeIn({duration:200, queue:false}); $(_this).removeClass("open"); } }); } ); $(".driekolom").on('mouseleave',function(){ var openclasses = document.getElementsByClassName("open"); $(openclasses).find('.extra-info-text').stop(true).animate({height:'60px'},{ duration:800, queue:false, easing:'easeOutBounce', complete:function(){ $(openclasses).find('.extra-info-text').stop(true); $(openclasses).find('.triangle-up').stop(true).fadeIn({duration:200, queue:false}); $(openclasses).removeClass("open"); } }); });
answers question: http://stackoverflow.com/q/26861368
score: 0
type: Answer

http://stackoverflow.com/a/26860384
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26860081
has body: Hope the following article will help you: http://mikeheavers.com/main/code-item/dynamic_dependent_dropdown_filtering_with_codeigniter_and_jquery

http://stackoverflow.com/a/26867066
score: 1
has comment: http://stackoverflow.com/comment/42294389
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42310690
downvote count: 0
has body: Firstly you are adding the validation on each click, you should first check if it was added. Also the date validation looks like its failing. Where is dateFormat from? If you use date it will work.
type: Answer
accepted answer of: http://stackoverflow.com/q/26866741
answers question: http://stackoverflow.com/q/26866741
upvote count: 1

http://stackoverflow.com/q/26956587
tagged with: http://stackoverflow.com/tag/xml
favorite count: 0
type: UnansweredQuestion
tagged with: css
has title: Create div overlay for image based on xml attributes
has body: I want to create a div overlay, set at 5% opacity, which creates a diagonal bounding box around each of the lines of text in this image. I have the coordinates of each of the four points I need to draw the bounding box, which are encoded as attributes in an XML element which contains the text of individual line as its data. It seems to me that since I have the x,y coordinates for the four corners, I should be able to create the overlay -- but I cannot figure out what the proper syntax would be to mark out the div. Someone suggested to me using the transform functions for CSS (which was the right call as I originally framed this question) but that sounds like I'd be basically writing eight separate pieces of css, one for each line -- which could get messy since there are potentially 118 pictures like this that I would be writing custom pieces of CSS for. Am I wrong in thinking this can be done programmatically, and if not can someone point me at some methods for doing so?
downvote count: 1
has answer: http://stackoverflow.com/a/26957529
type: Question
upvote count: 0
has comment: http://stackoverflow.com/comment/42453944
tagged with: javascript
tagged with: jquery
score: -1
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/comment/64387192
score: 0
type: AnswerComment
has text: ...sorry, didn't mean to tag your answer with a new problem! Trying to add to the thread.
comment on: http://stackoverflow.com/a/27084683
type: Comment

http://stackoverflow.com/comment/42270318
has text: Using `.click()` is problematic since it doesn't persist if the target is modified in DOM manipulation - you should get in the habit of using `.on('click', ...)` instead.
type: Comment
comment on: http://stackoverflow.com/a/26853761
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42365197
score: 0
has text: my real code Editor is not only for HTML, and there are lots of elements, like input, span, div, textarea, img, a and so on. So i dont want when someone change the style for all link to change the styls of my code editor. That's why i need exactly result in iframe.
type: AnswerComment
comment on: http://stackoverflow.com/a/26891104
type: Comment

http://stackoverflow.com/comment/74975338
score: 0
type: AnswerComment
has text: Wow, you are quick, still the same mixed content warning
type: Comment
comment on: http://stackoverflow.com/a/26921644

http://stackoverflow.com/comment/42346855
type: AnswerComment
type: Comment
has text: I'm looking at the site and the image you provided and the navigation systems are different. I'm seeing an expansion navigation, rather than a floating ul submenu.
comment on: http://stackoverflow.com/a/26894711
score: 0

http://stackoverflow.com/q/26861863
has title: Why is "{} == false" incorrect javascript syntax , while "false == {}" is not ?
linked to: http://stackoverflow.com/q/23796596
possible better answer: http://stackoverflow.com/a/26861967
has answer: http://stackoverflow.com/a/26861967
duplicate of: http://stackoverflow.com/q/23796596
accepted answer: http://stackoverflow.com/a/26861909
type: AnsweredQuestion
upvote count: 14
downvote count: 3
has body: Here is the result from browser console (both firefox and chrome ) , false == {} works,but {} == false gives syntax error. &gt;&gt; false == [] true &gt;&gt; false == {} false &gt;&gt; 0 == false true &gt;&gt; false == [] true &gt;&gt; false == {} false &gt;&gt; [] == false true &gt;&gt; {} == false Uncaught SyntaxError: Unexpected token ==
type: Question
tagged with: javascript
score: 11
has answer: http://stackoverflow.com/a/26861909
answer count: 3
has answer: http://stackoverflow.com/a/26862003
favorite count: 0

http://stackoverflow.com/a/37419207
has body: add return false; after window.location.assign(field1); QR Printing
answers question: http://stackoverflow.com/q/26936947
score: 0
type: Answer

http://stackoverflow.com/comment/42300065
comment on: http://stackoverflow.com/a/26869930
type: AnswerComment
score: 0
type: Comment
has text: Yes, theoretically you have a limit of `+- 2^11 - 1` for the exponent, but that's not the concern here. Precision is independent from the number "size", and the reason we use floating point arithmetic is just that. Please check the Wikipedia page I linked before.

http://stackoverflow.com/q/26954569
accepted answer: http://stackoverflow.com/a/27000218
has comment: http://stackoverflow.com/comment/42449043
downvote count: 1
score: 8
favorite count: 0
upvote count: 9
has comment: http://stackoverflow.com/comment/42526391
has comment: http://stackoverflow.com/comment/42449309
linked to: http://stackoverflow.com/q/14815481
has answer: http://stackoverflow.com/a/27000218
linked to: http://stackoverflow.com/q/807878
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42449064
has body: I have an html page with some pre-rendered content and some yet un-rendered content. I want to display the pre-rendered content immediately, and then begin rendering the rest of the content. I am not using jQuery. See the following snippet. I have tried this various ways, including injecting my script before the closing body tag and providing my script to populate the DOM as a callback to window.onload, document.body.onload, and document.addEventListener('DOMContentLoaded'). In every case, the page does not display the pre-rendered content until the rest of the content is rendered. What it is, my doge? What it is, my doge? What it is, my doge? What it is, my doge? One case that has worked is window.setTimeout with 0 timeout. However, this simply defers the function until there is nothing left to do. Is this the best practice, here? What it is, my doge?
has title: Execute javascript after page load is complete
answer count: 4
has comment: http://stackoverflow.com/comment/42449013
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/807878
has answer: http://stackoverflow.com/a/27082393
has answer: http://stackoverflow.com/a/26998544
tagged with: dom
linked to: http://stackoverflow.com/q/9647215
has comment: http://stackoverflow.com/comment/42526764
type: Question
linked to: http://stackoverflow.com/q/1795089
has comment: http://stackoverflow.com/comment/42675739
possible better answer: http://stackoverflow.com/a/26998544
tagged with: javascript
has answer: http://stackoverflow.com/a/26954661
has comment: http://stackoverflow.com/comment/42449073

http://stackoverflow.com/q/26932517
has body: I have 2 multi-select lists in angular that are dependent on on another. One is the parent list and one is the child list. When landing, there is nothing in the child list and once you select (one or many) items from the parent multi-select, it will then populate the child list with the children of the selected item(s) from the parent list. This works great - just for reference I have a $watch on the parent model, so when it changes (the user selects something in the parent list - it will then call an $http and fetch the results for the children list like so - $scope.$watch('selectedResources', function (newValue) { angular.forEach($scope.selectedResources, function(data){ $scope.generalIDArray.push(data.id); }); //id's = $scope.imageIDArray //place new data in $scope.imageOptionsSub $http({ method: 'POST', url: '/listSubCategories', data: { page: 0, ids: $scope.generalIDArray } }) .success(function(data){ //empty options $scope.resourceOptionsSub = []; //push new data in angular.forEach(data.subCategories, function(index) { $scope.resourceOptionsSub.push(index); }); }); So - I push all the id's in and send them to get the results back. However - here is my problem. I realized after trying this out that I don't want to completely replace resourceOptionsSub with all the new results, because the user has interacted with the child results - they have a .checked value on them that means the user has selected them, this will be wiped out and refreshed each time I make a new call because it empties out the scope and replaces it, even if it is the same items. What I would like to happen is to kind of compare if there are items that already exist in resourceOptionsSub that are coming in with the call, and sort of keep the original resourceOptionsSub and compare it to the new one coming in, and maybe pull off the items that don't exist any more? I'm thinking I should somehow compare the 2 objects 1 being the original, 2 being the new - and if 2 has anything 1 does not have, …
type: Question
accepted answer: http://stackoverflow.com/a/26932901
answer count: 1
has title: Angular, comparing 2 objects and replacing (possibly concatinating?)
tagged with: javascript
tagged with: jquery
score: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/26932901
type: AnsweredQuestion

http://stackoverflow.com/q/26966215
has body: I've been trying to use a factory in my Angular app to be able to share and update variables between controllers, however I haven't had much luck. The app I'm working on basically receives messages into an inbox and then I can decide whether to show them on a visualizer for people to see. It's a real-time interactive app that would be used during a conference or something when the speaker wants to interact with the audience and see their responses to a question/statement. I'm using a factory to keep track of the messages in the queue that will be displayed on the visualizer page. When I add a message into the queue from the inbox, it appears that the factory is being updated. However, on the visualizer page, the scope variables that are referencing the factory aren't being updated. Here is my factory code: angular.module('tellApp') .factory('VisualizerFactory', function () { return { queue: [], active: {}, addToQueue: function(msg){ this.queue.push(msg); } } }); Basically, from my inbox, I call the addToQueue function and pass in an object containing the message and some details. On the visualizer page all I'm doing is just looking at the VisualizerFactory object to see if it's updating and it's not. It just returns the empty VisualizerFactory object. Thanks for any help!
downvote count: 0
type: UnansweredQuestion
type: Question
score: 1
upvote count: 1
tagged with: angularjs-service
answer count: 1
has answer: http://stackoverflow.com/a/26966329
tagged with: javascript
favorite count: 0
tagged with: angularjs
has title: Angular factory variable changes not reflected in controller

http://stackoverflow.com/comment/42442333
type: AnswerComment
has text: Thanks again for the thoughts. In this use case, the user is making a payment and creating a new user account at the same time. I've implemented a two-step process where the user fills out the sign up form, the page refreshes and sets the email data attribute (as you suggested), then the user clicks "pay with card." I was hoping to make it one step with JavaScript changing the variable but it seems that doesn't work since the script runs on page load.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/26923088

hql
tag name: hql
type: Tag
tags question: http://stackoverflow.com/q/26923441

http://stackoverflow.com/q/26942633
possible better answer: http://stackoverflow.com/a/26942776
has title: Creating String Names for Functions in Prototype
has answer: http://stackoverflow.com/a/26942776
has comment: http://stackoverflow.com/comment/42436190
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42436547
has comment: http://stackoverflow.com/comment/42436435
type: Question
has comment: http://stackoverflow.com/comment/42436697
has comment: http://stackoverflow.com/comment/42436395
has answer: http://stackoverflow.com/a/26946787
has answer: http://stackoverflow.com/a/29241670
accepted answer: http://stackoverflow.com/a/29241670
tagged with: javascript
has body: Consider a mathematics system where different types of mathematical objects have similar operators; arrays could be added together, complex numbers could be multiplied, etc. But these operators do not exist natively, they must be written. Is it possible to create and use a string name in a prototype function definition? Consider the following (intended) code: var Interval = function(s,e) { this.a = Math.min(s,e); this.b = Math.max(s,e); }; Interval.prototype["*"] = function(x,y) { var t = x.a*y.a; var u = x.a*y.b; var v = x.b*y.a; var w = x.b*y.b; return new Interval(Math.min(t,u,v,w), Math.max(t,u,v,w)); }; Interval.prototype["*="] = function(y) { var ret = this["*"](this, y); this.a = ret.a; this.b = ret.b; }; Note that the particular failure I see occurs when I do something like the following: var i=new Interval(1,2); i["*="](i); Then firefox complains that the second line isn't referring to a function. There are many such functions ("*=","-","^",...). It would be nice to store them by these names directly, but when I try the above it always fails, telling me things like "... is not a function" and such. I can put in a buffer object like Interval.prototype.ops = { "*": function(x,y) {...}};, but that seems inelegant at best. Is there a better way to do this? EDIT: This mechanism works as expected. What does not work is attempting to call a prototyped-in function from within the constructor; for example, if the line this["*="](this); were to appear within the var Interval = function(s,e) { ... }; function definition.
score: 0
answer count: 3

http://stackoverflow.com/comment/44791511
has text: if it helped you, will you accept my answer please :)
type: Comment
comment on: http://stackoverflow.com/q/26835566
score: 0
type: QuestionComment

http://stackoverflow.com/a/26897510
has body: Assuming your controller looks something like this: def show # set an instance variable in the controller @areas1 = [ 'CA', 'US' ] # render code.... end in the view your selectedRegions (assuming it's in an erb page) could simply be &lt;script type="text/javascript"&gt; jQuery(document).ready(function() { var areas1=['CA','US']; jQuery('#vmap').vectorMap({ map: 'world_en', selectedColor: '#FFC864', selectedRegions: [&lt;%= @areas1.map {|str| "'#{ str }'" }.join(',') %&gt;] }); }); &lt;/script&gt;
answers question: http://stackoverflow.com/q/26897393
score: 0
has comment: http://stackoverflow.com/comment/42348718
type: Answer
has comment: http://stackoverflow.com/comment/42386052

http://stackoverflow.com/comment/42439100
type: Comment
score: 2
has text: @FelixKling Actually if it's any number that is not `1` it's false. For example: `if( 15 == true )` is `false`.
comment on: http://stackoverflow.com/a/26947785
type: AnswerComment

http://stackoverflow.com/q/26846652
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26847252
tagged with: jquery
has answer: http://stackoverflow.com/a/26847252
has body: I'm trying to create a slider within one of my Google Sites which has a set background, in this case, a circle surrounding the border of the images. I've managed to get the background to appear behind the slider, but now can't get the two properly aligned. It seems as though whatever I do, doesn't align them, and I think it's down to both class' being within the same tag. However, when I try and have both sets in separate divs I'm then struggling to get the background to appear behind the slider. I've managed to get it above, to the right and below, but not behind. This is what I've currently got it to look like: Do any of you know how I'd align the images? The code I've used can be found below.
score: 0
has title: Javascript slider with set background
tagged with: http://stackoverflow.com/tag/html
tagged with: google-sites
tagged with: css
has comment: http://stackoverflow.com/comment/42256546
accepted answer: http://stackoverflow.com/a/26846907
has comment: http://stackoverflow.com/comment/42256697
type: AnsweredQuestion
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/26846907

http://stackoverflow.com/q/26934508
has comment: http://stackoverflow.com/comment/42413778
accepted answer: http://stackoverflow.com/a/26934591
tagged with: javascript
has title: Checkbox variable outside of function
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/26934591
has comment: http://stackoverflow.com/comment/42413794
has comment: http://stackoverflow.com/comment/42413592
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/42413585
upvote count: 1
has body: I am new to coding (trying to learn) and I cant figure out how to get the var of the check box value outside of the function. Javascript: $(document).ready(function() { var quantity= parseInt($('#phones').val()); $("#check1 input:checkbox").change(function() { var feature = 0; $("#check1 input:checkbox").each(function() { if ($(this).is(':checked')) { feature += parseInt($(this).prop('value')); } }); }); var grand = feature * (quantity * Number ('0.1')) var total = quantity + grand }); HTML: &lt;input id="phones" type="numerical" value="0" style="text-align: right"/&gt; &lt;div id="check1"&gt; &lt;input type="checkbox" value="1" /&gt;
has comment: http://stackoverflow.com/comment/42413931
type: Question

http://stackoverflow.com/a/26871107
upvote count: 1
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/42301050
answers question: http://stackoverflow.com/q/26870939
score: 1
has body: jQuery this is the goto framework for me, you can find examples of integrating jQuery and Spring via a quick search. Also jQuery has support for iOS and Android according to the website, although I have not implemented it on iOS or Android

http://stackoverflow.com/a/26838688
upvote count: 5
type: Answer
answers question: http://stackoverflow.com/q/26838639
downvote count: 0
score: 5
has body: Think about what happens when you call this line: x = "\n" + x.charAt(i-1); You make x into a newline with addition of a SINGLE character. Do you see why your string isn't long now?

http://stackoverflow.com/comment/42254240
has text: @A.Wolff It looks like javascript mixed with coffescript.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26845483
score: 0

http://stackoverflow.com/q/26832708
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has body: I'm trying to automate a javascript heavy page in Perl using Mechanize::PhantomJS. There is some javascript that is executed on the page after the user clicks either okay or cancel in a confirm alert. Since I don't know how to press okay, I'm executing the javascript directly. The problem is that the following script works fine when using firefox (here I use Mechanize::Firefox) but doesn't produce any result when using Mechanize::PhantomJS $mech-&gt;eval_in_page(&lt;&lt;'JS'); closeChildWindows(); commandInProgress = true; document.dataForm.target="_self"; document.dataForm.method='post'; document.dataForm.action="ReviewApptAction"; document.dataForm.submit(); JS In PhantomJS, the script goes through these lines without producing any error but doesn't execute anything on the page, meaning I don't get any result such as submitting the form at the end. Does anyone know what's going on here? I want to use Mechanize::PhantomJS because it allows me to run multiple instances of the script concurrently, unlike firefox. Let me be more clear on this: I have to press a button which has an onclick javascript attached to it: &lt;a href="javascript:bookAppointment()" onmouseover="window.status='Next Screen';return true" onmouseout="window.status='';return true"&gt; &lt;img src="../images/include/buttonnext.gif" width="61" height="16" border="0" alt="Next Screen"&gt;&lt;/a&gt; The function that this button calls is this: function bookAppointment() { if ( confirm("Book this appointment?") ) { if ( !commandInProgress) { closeChildWindows(); commandInProgress = true; document.dataForm.target="_self"; document.dataForm.method='post'; document.dataForm.action="ReviewApptAction"; document.dataForm.submit(); } else { alert("Request has been submitted but not yet processed by the server. Please press OK and wait for response..."); } } return; } First, I used $mech-&gt;confirm( 'Really do this?' [ =&gt; 1 ]) to click okay in confirm dialog but that didn't work. So, I simply issued the com…
has answer: http://stackoverflow.com/a/26848841
tagged with: mechanize
tagged with: http://stackoverflow.com/tag/html
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/26848841
tagged with: phantomjs
type: AnsweredQuestion
score: 1
has title: eval_in_page javascript execution works in firefox but not in phantomjs
tagged with: perl

http://stackoverflow.com/comment/42262311
comment on: http://stackoverflow.com/q/26848611
score: 0
type: QuestionComment
type: Comment
has text: No, The user fill some input[type=text], select files in 2 input[type=files] (one for image and the other one for document). Each time that a file is selected I control the type and the size (I did not write this part in order to simplify). When the user click on the validation the data are sent and the files are uploaded, a message is displayed and the user come back on the home page. Important: the user can't select more than one file per input

http://stackoverflow.com/q/26875260
type: Question
has answer: http://stackoverflow.com/a/26875438
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26875325
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has title: empty() and append() jquery, how does it work?
type: UnansweredQuestion
has body: I have a question, I have this script on my page: $('div').html('Some text inside span'); $('button').click(function() { $('div').html('Now its personal'); }); $('.test_class').click(function() { console.log('test_class CLICKED'); }); When the page loads and I click on my span - everything's perfect, I get a console.log() in web console, but after I click the button and click on my new span - I don't get a console.log(). Can you please tell me why? And how can i get it work? Thank you.
has comment: http://stackoverflow.com/comment/42308320
score: 0
upvote count: 1
tagged with: dom
downvote count: 1

http://stackoverflow.com/q/26988443
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26988539
has title: Using map function to get lists' data attributes into an array in jQuery
type: Question
has body: Working example Fail example I'm using this pie chart plugin. I want to create an array like this [["Male",12,"some text","#222"], ["Female",14,"some text","#333"]] from li data attributes data-value, each of which stores a comma-separated string: 12 or below 13 or above I'm not getting any error but the map function isn't returning an array as the pie chart isn't showing anything. Would anyone show me how to return an array from the lists? Failed Code function chart(stats){ new Chart.Pie('age', { showTooltips : true, chartMinSize : [200, 200], chartMaxSize : [250, 250], chartData : stats }); } var arr = [], stats = $('.piearea').find('li').map(function() { var value = $(this).each(function(){ arr = [$(this).data('value').split(',')]; }) return value; }); console.log(stats); chart(stats); HTML: 12 or below 13 or above
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26988629
has answer: http://stackoverflow.com/a/26988629
accepted answer: http://stackoverflow.com/a/26988539
score: 0
answer count: 2
tagged with: arrays
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/26934579
has body: I have a dynamic navigation which follows the user down the page. On mobile, I do not want the navigation to zoom in, as you will not be able to access the navigation on the right. The method I tried broke the entire navigation. Any other ideas? Live navigation at http://beeskneesfx.com/ The Two Containers in Question Are #top-bar &amp; #top-bar-fixed Controller JS The commented out code is what I tried /* FLOAT NAV CONTROLLER */ $(function(){ var bar = $('#top-bar'), showBar = true, stalkbutton = $('#stalkbutton'), state = false; if ( notMobile == false ) { showBar = false; } floatNav(); $(window).scroll(function () { floatNav(); }); function floatNav() { $('.close-float').click(function () { if (state == true) { state = false; showBar = false; bar.slideUp(200, function () { $(this).attr('id', 'top-bar').css('display', 'block'); }); } }); if (showBar &amp;&amp; state == false &amp;&amp; $(window).scrollTop() &gt; 300) { bar.attr('id', 'top-bar-fixed').slideDown('slow', function () { state = true; /*$(this).css({transform: 'scale(' + window.innerWidth/document.documentElement.clientWidth + ')', left: window.pageXOffset + 'px', bottom: document.documentElement.clientHeight - (window.pageYOffset + window.innerHeight) + 'px'});*/ }); } else if (state == true &amp;&amp; $(window).scrollTop() &lt; 300) { state = false; bar.slideUp(200, function () { $(this).attr('id', 'top-bar').css('display', 'block'); }); } } }); The CSS .logo { float: left; color: #30546b; line-height: 49px; } .logo img { position: relative; float: left; margin-right: 10px; } .logo .bloom { position: absolute; top: 0; left: 0; } .main-width-nav { width: 75%; min-width: 1005px; max-width: 1428px; height: 45px; margin: 0 auto; position: relative; } #homebutton { position: absolute; display: inline-block; opacity:0.75; top: 50%; left: 295px; transform: translate(0,-50%); } #stalkbutton { position: absolute; display: none; opacity:0.75; top: 50%; left: 310px; transform: translate(0,-50%); cursor: pointer;…
type: Question
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: css
has title: No Zoom on Dynamic Fixed Element
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42428894
has comment: http://stackoverflow.com/comment/42428950
has answer: http://stackoverflow.com/a/26934683

http://stackoverflow.com/q/26899157
upvote count: 1
has answer: http://stackoverflow.com/a/26903235
type: Question
tagged with: javascript
score: -1
answer count: 2
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Validating form after error has been shown
has answer: http://stackoverflow.com/a/26899970
has body: I have a form where username and password are entered. If they are left blank an error is shown, however when one of the input box is filled in and the submit button is clicked the error that's there doesn't go away. Only if I fill in both boxes, then the error goes away. I want to hide the error as soon as one of the boxes is filled in with text. Thanks for any help you can give me.
downvote count: 2

http://stackoverflow.com/comment/42743409
score: 0
type: Comment
comment on: http://stackoverflow.com/q/26975017
type: QuestionComment
has text: @blex I tried your code and it's working fine for me (iPhone5 iOS 8.1), are you doing any other process or this is the only HTML that you are loading in your WebView?

http://stackoverflow.com/a/26874249
has comment: http://stackoverflow.com/comment/42317851
has comment: http://stackoverflow.com/comment/42312676
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26874007
accepted answer of: http://stackoverflow.com/q/26874007
type: Answer
upvote count: 1
has body: All casper.then* and casper.wait* functions are asynchronous. If you call them, their actions are scheduled at the end of the current step. This means that calling synchronous functions like console.log, casper.echo and casper.evaluate after casper.wait will result in their immediate execution and the wait will be scheduled for later. You need to add the synchronous functions into the then callback of wait: casper.wait(5000, function(){ console.log("wait done"); casper.echo(checkNext); content = casper.getHTML(); fs.write("caspertest1.html", content, 'a'); // and so on }); But since the execution is asynchronous now, you cannot use a loop which depends on the state of a variable which is set asynchronously. You need to do this recursively: var checkNext = true; function getPageContent() { if (!checkNext) { return; } casper.wait(5000, function(){ console.log("wait done"); casper.echo(checkNext); content = casper.getHTML(); fs.write("caspertest1.html", content, 'a'); var nextLink = system.stdin.readLine(); checkNext = casper.evaluate(function(nextLink) { arb = ($(nextLink).is(":not([disabled])")); console.log(arb); console.log(nextLink); return arb; },nextLink); pagenum = pagenum+1; casper.echo("scraped page "+pagenum); casper.echo("clicking next link"); casper.click(nextLink); }); casper.then(getPageContent); }
score: 1

http://stackoverflow.com/comment/42291127
score: 0
has text: @cvrebert: Upgrade to bootstrap 3.3.0 didn't fix the problem. Can you provide a link to a solution with this upgrade?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26840578

http://stackoverflow.com/comment/42442370
score: 0
type: AnswerComment
has text: @AbdelPosada your welcome, all the others also didn't see it :)
type: Comment
comment on: http://stackoverflow.com/a/26950561

http://stackoverflow.com/q/26877627
type: Question
score: 0
has body: okay so basically I installed red5 in wamp and am using videowhisper to try to live stream online but i cannot seem to connect to the red5 server that is suppose to do the rtmp streaming. I have managed to deploy and start red5 server but it just keeps on saying connecting to server when i try to run videowhisper. The red5 is installed on the www folders in wamp. $rtmp_server = "rtmp://your-server-ip/folder-name"; // rtmp://your-server-ip-or-domain/application I have tried $rtmp_server = "rtmp://localhost/videowhisper"; // rtmp://your-server-ip-or-domain/application $rtmp_server = "rtmp://localhost:5080/videowhisper"; // rtmp://your-server-ip-or-domain/application $rtmp_server = "rtmp://localhost:1935/videowhisper"; // rtmp://your-server-ip-or-domain/application yes i also took out /videowhisper at the end but no luck. In red configuration this is the info i have # Socket policy policy.host=0.0.0.0 policy.port=843 # HTTP http.host=127.0.0.1 http.port=5080 https.port=8443 # RTMP rtmp.host=127.0.0.1 rtmp.port=1935 # RTMPS rtmps.host=0.0.0.0 rtmps.port=8443 # RTMPT rtmpt.host=0.0.0.0 rtmpt.port=8088
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/42312697
has title: Trying to find server ip address for red5 on wamp server
has comment: http://stackoverflow.com/comment/42313648
has answer: http://stackoverflow.com/a/49761342
tagged with: wamp
tagged with: red5
has comment: http://stackoverflow.com/comment/42312501
type: UnansweredQuestion
tagged with: live-streaming
tagged with: php

http://stackoverflow.com/comment/42452640
has text: I found the problem. VS is taking data with point, but in inspector i can see that in js there is stil comma.
score: 0
comment on: http://stackoverflow.com/q/26956372
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42420705
type: Comment
has text: Sure, just calculate the difference between widths and set the left offset to half of that http://codepen.io/anon/pen/PwoQmW
comment on: http://stackoverflow.com/a/26847463
score: 0
type: AnswerComment

http://stackoverflow.com/a/26835712
has comment: http://stackoverflow.com/comment/42239173
has comment: http://stackoverflow.com/comment/42237988
has body: If there are a lot of words in your list, one thing you can do to shrink the size of your dictionary is use a patricia trie. A patricia trie is a special kind of tree optimized for searching for strings. Basically, each node in the trie is a single letter. So for instance: var dictionary = { 'a': { '': 1, // a 'a': { '': 1, // aa 'l': { '': 1, // aal 'ii': 1 // aalii }, 'm': 1, // aam 'ni': 1, // aani 'r': { 'd': { 'vark': 1, // aardvark 'wolf': 1 // aardwolf }, 'on': { '': 1, // aaron 'ic': 1 // aaronic } } }, }, } In the above, I'm using the empty string '' (actually a valid property identifier!) to denote the end of a word. Here's how you could implement the searching: function isWord_internal(str, dic) { var strlen, i, substr, substrlen; strlen = str.length; for(i = strlen; i &gt; 0; i--) { substr = str.slice(0, i); substrlen = substr.length; if(dic[substr]) { if(dic[substr] === 1) { if(substrlen === strlen) { return true; } return false; // end of the line, folks } if(dic[substr][''] &amp;&amp; substrlen === strlen) { return true; } return isWord_internal(str.slice(i), dic[substr]); } // else keep going } // not found return false; } function isWord(str) { return isWord_internal(str, dictionary); // assumes that the dictionary variable exists already } Since objects are hash tables O(log n) and the algorithm is linear with the size of a word, your performance should be O(n log n). This should also keep the size of your list down, since English words are not random and often have substrings in common (you'll probably want to minify it though). To convert your current dictionary, you can use this function to generate it in memory: function patriciafy_internal(str, pat) { var i, substr, patkeys, patkeyslen, j, patkey, pos, portion; for(i = str.length; i &gt; 0; i--) { substr = str.slice(0, i); patkeys = Object.keys(pat); patkeyslen = patkeys.length; for(j = 0; j &lt; patkeyslen; j++) { patkey = patkeys[j]; pos = patkey.indexOf(substr); if(pos !== -1) { if(pat[patk…
has comment: http://stackoverflow.com/comment/42241080
has comment: http://stackoverflow.com/comment/42238301
downvote count: 0
score: 3
has comment: http://stackoverflow.com/comment/42237629
has comment: http://stackoverflow.com/comment/42244893
has comment: http://stackoverflow.com/comment/42237469
has comment: http://stackoverflow.com/comment/42240458
type: Answer
has comment: http://stackoverflow.com/comment/42242692
answers question: http://stackoverflow.com/q/26833922
has comment: http://stackoverflow.com/comment/42237584
has comment: http://stackoverflow.com/comment/42245100
has comment: http://stackoverflow.com/comment/42237389
has comment: http://stackoverflow.com/comment/42239724
upvote count: 3

http://stackoverflow.com/comment/42303232
comment on: http://stackoverflow.com/a/26872092
type: AnswerComment
has text: Your solution works but the solution I posted above in my questions also works just as well but I think it is easier to read. Thanks though man. I know how it is trying to answer questions on here. I still am going to keep the answer previously accepted as it defines what the 'moving parts' are doing and I don't want to keep checking back to continually update acceptance. Cheers and thanks again.
type: Comment
score: 1

http://stackoverflow.com/q/26955867
tagged with: javascript
has comment: http://stackoverflow.com/comment/42451243
tagged with: jquery
score: 0
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: How to show a slow transition of a canvas?
type: UnansweredQuestion
has body: I have written a canvas within and when I click a link, I am expecting the canvas to reduce to a smaller size. I am able to achieve this using onClick event but I want to show the slow transition from larger to smaller size. Could anyone throw some pointers please?
type: Question
has answer: http://stackoverflow.com/a/26956111
tagged with: canvas
has comment: http://stackoverflow.com/comment/42455651

http://stackoverflow.com/q/26964115
has comment: http://stackoverflow.com/comment/42466590
has answer: http://stackoverflow.com/a/26964178
downvote count: 1
has title: For some reason the return when I subtract is not correct
upvote count: 0
possible better answer: http://stackoverflow.com/a/26964178
tagged with: javascript
type: Question
accepted answer: http://stackoverflow.com/a/26964342
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42466575
has body: This is my code. The problem is that the subtraction renders the same return as the variable noDiscount. I have tried to play with multiple methods of subtraction but so far nothing has worked. Also I wanted to know if there was a way of editting font size and font type in java // Variables var BREAK = "&lt;br /&gt;" var pricePound = 1.13; // This is the price per pound var amountPurchased = 0; // Number of pounds purchased var reduceRate = 0; // This is the percent it is reduced var noDiscount = pricePound * amountPurchased; //Cost without discount var amountSaved = reduceRate * noDiscount; var reducCost = noDiscount - amountSaved; noDiscount = pricePound * amountPurchased amountSaved = reduceRate * noDiscount reducCost = noDiscount - amountSaved document.write ("Hello and thank you for shopping at the ACME cement company. This program is here to handle transaction information and apply discounts. For all other concerns please go to our main site." + BREAK) window.alert("Please be aware that all cement purchases are on sell and, the more you buy the more it will be discounted!!! All numbers inputted will be converted to pounds. Some restrictions and limitations do apply see a instore clerk for details.") amountPurchased = parseFloat(prompt("Valued customer, please enter the amount of cement you would like to purchase." )); parseFloat(amountPurchased) if (amountPurchased &lt;= 0) { window.alert("ERROR. Your purchase is below our minimum purchase amount. Please refresh the page and increase the amount you are trying to purchase." ); } else if (amountPurchased &lt;= 500) { reduceRate = 0.02; } else if (amountPurchased &lt;= 9000) { reduceRate = 0.04; } else if (amountPurchased &lt;= 15000) { reduceRate = 0.05; } else { //only occurs when none of the others are true: so this is when it's &gt;15000 reduceRate = 0.09; }; amountSaved = reduceRate * noDiscount noDiscount = pricePound * amountPurchased reducCost = noDiscount - amountSaved document.write ("Your purchase of "…
score: -1
favorite count: 0
has comment: http://stackoverflow.com/comment/42466620
has comment: http://stackoverflow.com/comment/42466343
answer count: 2
has answer: http://stackoverflow.com/a/26964342

http://stackoverflow.com/q/26924346
has title: Set java script value to php session and get session value onto another php file
has comment: http://stackoverflow.com/comment/42395613
tagged with: javascript
has comment: http://stackoverflow.com/comment/42395678
has answer: http://stackoverflow.com/a/26924469
answer count: 2
has comment: http://stackoverflow.com/comment/42395612
favorite count: 0
type: UnansweredQuestion
has body: I'm trying to set the JavaScript value to a PHP Session variable and get this session value to another php page. here my code. on the same it will show the value using alert. here's my first page index_1.php &lt;Script&gt; function(no_user){ `var num_user = no_user; '&lt;?php $_SESSION["num_user"] = "' + no_user+ '"; ?&gt;'; //alert('&lt;?php echo $_SESSION["num_user"] ?&gt;');*/ window.open("demo.php"); } &lt;/script&gt; another page index_2.php &lt;?php if(isset($_SESSION['num_user'])){ $a = $_SESSION['num_user']; echo "Number of user: ". $a; ?&gt;
tagged with: php
has answer: http://stackoverflow.com/a/26924559
has comment: http://stackoverflow.com/comment/42395661
upvote count: 2
score: 1
tagged with: session-cookies
downvote count: 1
type: Question

http://stackoverflow.com/q/26960627
answer count: 1
has body: I've created a canvas of size 1240x3500. I need to convert it to a pair of images., i.e., from (0,0) to (1240,1750) and from (0,1751) to (1240,3500). Is is possible to achieve this using toDataURL() or is there any other function to establish this?
has answer: http://stackoverflow.com/a/26960842
tagged with: http://stackoverflow.com/tag/html
has title: Canvas to Multiple Images
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26960842
type: Question
tagged with: javascript
score: 0
tagged with: canvas
tagged with: html5-canvas

http://stackoverflow.com/comment/42310836
comment on: http://stackoverflow.com/q/26875809
has text: i will have no problem generating markers on the map in the partial view. where i'm having a hard time is making a popup box that passes a list of items (asset names) into the partial view.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26924733
has body: Most likely because x == null is true for (only) x = null and x = undefined. I.e. you capture both cases with a single comparison. That's one of the few exceptions where loose comparison is useful.
type: Answer
answers question: http://stackoverflow.com/q/26924708
score: 0

http://stackoverflow.com/comment/42320924
comment on: http://stackoverflow.com/a/26854738
type: AnswerComment
score: 0
type: Comment
has text: This is a good idea actually. I'll give it a more thorough look - did I miss it when I was trying my own project or was there another reason for this?

http://stackoverflow.com/q/26915193
type: Question
score: 93
upvote count: 93
has answer: http://stackoverflow.com/a/28833107
tagged with: javascript
has answer: http://stackoverflow.com/a/26915378
has answer: http://stackoverflow.com/a/67662417
has answer: http://stackoverflow.com/a/40308163
has answer: http://stackoverflow.com/a/56354444
has answer: http://stackoverflow.com/a/47185136
tagged with: vue.js
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has answer: http://stackoverflow.com/a/36557588
has answer: http://stackoverflow.com/a/49288370
favorite count: 0
has answer: http://stackoverflow.com/a/46915441
answer count: 12
has answer: http://stackoverflow.com/a/37108131
accepted answer: http://stackoverflow.com/a/28833107
has comment: http://stackoverflow.com/comment/42416411
possible better answer: http://stackoverflow.com/a/36557588
has title: DOM element to corresponding vue.js component
has answer: http://stackoverflow.com/a/28833179
tagged with: node.js
has answer: http://stackoverflow.com/a/57680320
type: AnsweredQuestion
has body: How can I find the vue.js component corresponding to a DOM element? If I have element = document.getElementById(id); Is there a vue method equivalent to the jQuery $(element)
has comment: http://stackoverflow.com/comment/80523175
tagged with: dom

http://stackoverflow.com/q/26970405
type: UnansweredQuestion
has body: I am provided a legacy code, where in my JSP files I can see tens of JavaScript files import. I want to understand if all these files are being used (and preferably what all methods), to reduce unwanted load time. I have done similar exercise with Java, using code coverage tool. On local server I would deploy the application along with coverage tool and go through common flows from UI. This would give a good idea of what all Java code is being used. Fortunately there are only 8-10 flows for the app which can be executed manually. I was wondering if similar method can be used to understand JS usage. or is there some other way to figure out what all files are being in use?
has comment: http://stackoverflow.com/comment/42476836
type: Question
has title: JavaScript Code Coverage
has comment: http://stackoverflow.com/comment/42476910
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/26971121
score: 2
tagged with: code-coverage
upvote count: 2

http://stackoverflow.com/comment/42317648
comment on: http://stackoverflow.com/q/26842114
score: 0
has text: hi i have placed the directive code. can u check
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26897783
type: Answer
answers question: http://stackoverflow.com/q/26897141
score: 3
upvote count: 3
type: AcceptedAnswer
has body: I figured it out: With this HTML: &lt;button type="button" class="btn btn-inverse dropdown-toggle" data-toggle="dropdown"&gt; &lt;span class="caret"&gt;&lt;/span&gt; &lt;/button&gt; You get: But with the following HTML examples: &lt;button type="button" class="btn btn-inverse dropdown-toggle" data-toggle="dropdown"&gt; &amp;nbsp;&lt;span class="caret"&gt;&lt;/span&gt; &lt;/button&gt; OR &lt;button type="button" class="btn btn-inverse dropdown-toggle" data-toggle="dropdown"&gt; Action&lt;span class="caret"&gt;&lt;/span&gt; &lt;/button&gt; You get (respectively): So it looks like you need to add a word (e.g., Action) OR just put an HTML space (e.g., &amp;nbsp;)before &lt;span class="caret"&gt;&lt;/span&gt;. I hope this helps someone.
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26897141

http://stackoverflow.com/q/26868366
has answer: http://stackoverflow.com/a/26868513
has title: Binding this to original object in higher-order function
has comment: http://stackoverflow.com/comment/42295907
has comment: http://stackoverflow.com/comment/42296005
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
accepted answer: http://stackoverflow.com/a/26868513
has body: In JavaScript, is it possible to bind the this object to a function returned by a higher-order function? The code sample below is essentially what I am using: var restrict = function(restrictOn, fn) { var that = this; return function() { if (arguments[0] === restrictOn) { throw new Error("Condition not met"); } return fn.apply(/*original object*/that, arguments); }; }; var MyConstr = function(name) { this.name = name; }; MyConstr.prototype.sayNameWhenNotThree = restrict(3, function() { return this.name; }); var myObj = new MyConstr("Fido"); myObj.sayNameWhenNotThree(3); // Throws error - OK myObj.sayNameWhenNotThree(5); // SHOULD return "Fido" - does not In this example, the restrict() function correctly passes through to the function that it is wrapping, but it is not executing in the context of the myObj function. I have tried various this bindings in the apply call, but I cannot figure out how to retain the binding to the original object. Can this be done cleanly?
upvote count: 1
tagged with: this
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/42357079
type: Comment
comment on: http://stackoverflow.com/a/26901573
type: AnswerComment
has text: yes i think its enough.. if you say i can give u one aspx file, with on dropdown and one textbox in working condition.
score: 0

http://stackoverflow.com/comment/42255136
score: 0
type: Comment
has text: @JamieDixon sounds good, but cannot find appropriate example for my case :(
type: QuestionComment
comment on: http://stackoverflow.com/q/26846035

http://stackoverflow.com/comment/42538916
has text: I mean you could trap the error before it happens, and only use marker methods if it's a valid one
type: Comment
comment on: http://stackoverflow.com/a/26992518
type: AnswerComment
score: 0

http://stackoverflow.com/a/26856656
accepted answer of: http://stackoverflow.com/q/26849076
type: Answer
score: 1
has body: EDIT: Working plunker solution: http://plnkr.co/edit/rQJt3h Yes you're having a load order issue. The solution involves using a directive. In my opinion, people are being opinionated when telling not to use jQuery with AngularJS. Yes - you should do all DOM manipulation in directives. In order to use the Bootstrap JavaScript Plugin, you can wrap the affix initialization in a directive: app.directive('bootstrapAffix', function() { return { link: function(scope, element, attrs) { $(element).affix({ offset: $(element).parent().offset().top }); } } }); And then attach it to your element: &lt;aside bootstrap-affix&gt; ... &lt;/aside&gt; Remember to include CSS!
answers question: http://stackoverflow.com/q/26849076
upvote count: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/42432637
has text: I just found the same question Jonathan. I guess that makes this one a duplicate.
type: Comment
comment on: http://stackoverflow.com/q/26944955
score: 0
type: QuestionComment

http://stackoverflow.com/comment/42323991
comment on: http://stackoverflow.com/a/26884336
has text: +1. This is right. A `div` should be used for `EmptyDataTemplate`.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42388623
has text: @Paul yeah just looks like a warning that FF throws that others don't. He's still saying that the scripts and transitions don't work. OP, for now assume the issues are unrelated - post some though, please!
score: 0
comment on: http://stackoverflow.com/q/26920006
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42236927
has text: Considered/tried using Ajax (asynchronous [XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest))?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26834845

http://stackoverflow.com/q/26986986
tagged with: jquery
tagged with: ajax
has title: highcharts render black on ajax refresh
tagged with: php
accepted answer: http://stackoverflow.com/a/26987265
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42518512
tagged with: javascript
has answer: http://stackoverflow.com/a/26987265
score: 0
has body: i'm trying to make real time data with highchart, but i'm tired following documentation and doesn't understand, i'm use ajax refresh for solution. when page reload first time, my chart rendered, and when ajax do refresh/2000 millisecond, my chart rendered always black index.php &lt;script type="text/javascript"&gt; var auto_refresh = setInterval( function () { $('#src2').load('monitor.php').fadeIn("slow"); }, 2000); // refresh setiap 00000 milliseconds &lt;/script&gt; &lt;div id="container" style="min-width: 120px; height: 220px; margin: 0 auto"&gt;&lt;/div&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="src2"&gt;&lt;/div&gt; Monitor.php &lt;script &gt; $(function () { $('#container').highcharts({ title: { text: 'Interval Chart', x: -20 //center }, subtitle: { text: 'Cisco Wallboard', x: -20 }, xAxis: { categories: ['1', '2', '3', '4', '5', '6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24'] }, yAxis: { title: { text: 'Percentage (%)' }, plotLines: [{ value: 0, width: 1, color: '#808080' }] }, tooltip: { valueSuffix: '%' }, legend: { layout: 'vertical', align: 'right', verticalAlign: 'middle', borderWidth: 0 }, series: [{ name: 'SCR', data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6,7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 100] }, { name: 'SL', data: [-0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5] }] }); }); &lt;/script&gt; check with firebug, i didn't know this error : TypeError: ha is not a function
answer count: 1
tagged with: highcharts

http://stackoverflow.com/comment/42439751
comment on: http://stackoverflow.com/a/26927158
type: AnswerComment
has text: The link I had above had download information. Here's the github repo: https://github.com/googlewebcomponents/google-analytics/
score: 0
type: Comment

http://stackoverflow.com/comment/42392421
type: QuestionComment
comment on: http://stackoverflow.com/q/26861340
score: 3
has text: The main idea would be to bundle together the dependancies that are shared across all pages into one file, and then have a separate file that is specific for each page. The goal with that idea is to maximize the amount of code that comes from the browser cache on each page view while minimizing file size. The accepted solution below will result in a lot of redundant code if, say, each page used jQuery.
type: Comment

http://stackoverflow.com/a/26991453
type: Answer
upvote count: 4
answers question: http://stackoverflow.com/q/26991305
downvote count: 0
score: 4
has body: You can do this: Put your load() in a function, then use a setInterval to call it every 5 seconds. function loadNowPlaying(){ $("#now_playing").load("now_playing.php"); } setInterval(function(){loadNowPlaying()}, 5000);

http://stackoverflow.com/comment/42460528
type: Comment
score: 0
type: AnswerComment
has text: @Tom: You'd modify the prototype in the same way that you currently are... by doing `Derived.prototype.foo = "bar";`. Just keep in mind that unless each object has its own `foo` property, they'll all see the same `"bar"` value. The only time you want to update a `.prototype` is to share data between all instances. The most common example is providing methods to all the objects.
comment on: http://stackoverflow.com/a/26960573

http://stackoverflow.com/comment/42365125
type: QuestionComment
has text: thank you all for shedding light. I resolved the problem ;-)
score: 0
comment on: http://stackoverflow.com/q/26907124
type: Comment

http://stackoverflow.com/q/26890453
has body: just like in topic I try to load JS file to head. In my admin.phtml layout file I have somthing like that: &lt;?php $this-&gt;headScript()-&gt;prependScript('var baseUrl = \'' . $this-&gt;baseUrl() . '\';'); echo $this-&gt;headScript(); ?&gt; and when I try to add script in view file by: &lt;?php $this-&gt;headScript() -&gt;appendFile($this-&gt;baseUrl() . '/pub/js/multiSelect.js', 'text/javascript', array()); ?&gt; but this file isn't added. Only works when I add script below in controler or in admin.phtml layout file before echo $this->headScript(). There is the way to add scripts in view files? Regards
upvote count: 1
type: Question
score: 1
has comment: http://stackoverflow.com/comment/42350143
has comment: http://stackoverflow.com/comment/42359643
tagged with: zend-framework
downvote count: 0
tagged with: javascript
favorite count: 0
type: UnansweredQuestion
tagged with: php
has title: Zend Framework 1x append js script to head
answer count: 0

http://stackoverflow.com/q/26913571
has comment: http://stackoverflow.com/comment/42408500
has comment: http://stackoverflow.com/comment/42415529
has comment: http://stackoverflow.com/comment/42397224
has comment: http://stackoverflow.com/comment/42415676
has comment: http://stackoverflow.com/comment/42418784
tagged with: kineticjs
score: 0
has body: var stages = new Array() ; var limites = new Array() ; numStage=0; r = { 'x':65, 'y':120, 'xwidth':335, 'yheight':210 }; limites.push(r); stages[numStage] = new Kinetic.Stage({ container: 'cmg_canvas_'+numStage, width: 450, height: 450 }); //creation image obj = new Image(); obj.src = 'http://i.imgur.com/zFZgKuS.jpg'; image = new Kinetic.Image({ image: obj, width: 450, height: 450 }); // add image to calque layer = new Kinetic.Layer(); layer.add(image); stages[numStage].add(layer); //add image to canvas layer = new Kinetic.Layer(); //set limit x y h l /*var rect = new Kinetic.Rect({ name: 'limite', x: limites[numStage].x, y: limites[numStage].y, width: limites[numStage].xwidth, height: limites[numStage].yheight, stroke: 'black', strokeWidth: 0.5 });*/ //layer.add(rect);// add to canvas stages[numStage].add(layer); $('.cmg_text').live('blur', function(){ idText = 'cmg_line0'; numStage = 0; drawTextPath(numStage, idText,$(this).val(),50,22,numStage); //text = getText(this).text; }); function getSVG(x,y,w,verif) { halfw = parseFloat((w/2).toFixed(2)); x1 = parseFloat((halfw/2).toFixed(2)); x2 = parseFloat(halfw + x1); if(parseInt(verif)) { y1 = parseFloat(y) * 2 +18; y2 = parseFloat(y) * 2 +18; } else { y1 = -18; y2 = -18; } str = 'M '+x+','+y+' C '+x1+','+y1+' '+x2+','+y2+' '+w+','+y; return str; } function drawTextPath(numStage, textId,text,valueSlider, newFontSize,numStage){ //'M 0,115 C42,-18 126,-18 165,115'; //'M 0,115 C45,230 180,230 180,115'; var arcOnly = 0; if(textId == 'cmg_line0') { console.log('limites[numStage].yheight/2'+limites[numStage].yheight/2); console.log('limites[numStage].xwidth'+limites[numStage].xwidth); svg = getSVG(0,valueSlider,valueSlider*6.3,0); arcOnly = 0; } //alert(svg); console.log(parseFloat(limites[numStage].y)); console.log(parseFloat(arcOnly)); console.log(parseFloat(limites[numStage].y - arcOnly)); var layer = new Kinetic.Layer({name:'textPathLayer',draggable:true}); var textpath = new Kinetic.TextPath({ name:'TextPath', id: text…
has comment: http://stackoverflow.com/comment/42414978
has title: kinetic js textPath: draggable didn't work
answer count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42386678
type: Question

http://stackoverflow.com/comment/42294082
type: AnswerComment
type: Comment
has text: @KidBilly yes, you most certainly can do that.
comment on: http://stackoverflow.com/a/26867404
score: 0

http://stackoverflow.com/comment/42310554
score: 0
type: Comment
has text: He said he is using cheerio, which is a node module.
type: QuestionComment
comment on: http://stackoverflow.com/q/26876493

http://stackoverflow.com/comment/42420873
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26938302
has text: try use $watchCollection instead
score: 0

http://stackoverflow.com/a/26942235
has body: test naturally: var json = {apple:0,name:'myname'}; var obj = {x: 5, y: 6}; var objToText = JSON.stringify(json); var text = '{"x": 5, "y": 6}'; var text2 = '{"apple":0,"name":"myname"}'; var textToObj = JSON.parse(text2); now application: var data = document.getElementsByTagName('div')[0].getAttribute('data-options'); //this var createJSON = "'{"+'"'+data.replace(/[:]/g,'":').replace(/,/g,',"').replace(/'/g,'"')+"}'"; var cJSONstring = createJSON.toString().slice(1,-1); //or this var createJSON2 = "{"+'"'+data.replace(/[:]/g,'":').replace(/,/g,',"').replace(/'/g,'"')+"}"; var dataToObj = JSON.parse(cJSONstring); var dataToText = JSON.stringify(dataToObj); console.log(dataToText);
type: Answer
answers question: http://stackoverflow.com/q/26940781
score: 0

http://stackoverflow.com/comment/42493952
comment on: http://stackoverflow.com/a/26978506
score: 0
type: AnswerComment
has text: I'm really new at all of this. Defining IsPostBack in the page worked for me
type: Comment

http://stackoverflow.com/q/26863010
answer count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json
has title: Live JSON stream in a table
has comment: http://stackoverflow.com/comment/42822368
has body: I want to live stream data from JSON to a table which shows data in FILO format (First In Last Out) on a responsive web app. The sample is at Latest Ride posted on http://www.zimride.com/ Searching web for this solution and tried various JS frameworks,but with no joy . This comes close to what I want to achieve --> http://www.bootply.com/63147 Can someone help me provide pointers?
type: Question
has comment: http://stackoverflow.com/comment/42306161
has comment: http://stackoverflow.com/comment/42296074
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/42295438
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42295933

http://stackoverflow.com/a/27035994
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26958410
upvote count: 3
has comment: http://stackoverflow.com/comment/79341750
downvote count: 0
has body: There is some strange bug in your code or in library, here is another working example, that should help: var c = document.getElementById('c'), o = c.getContext('2d'); function reset_canvas() { o.fillStyle = 'white' o.fillRect(0, 0, c.width, c.height) o.fillStyle = 'black' } var drag = false, lastX, lastY; c.onmousedown = function(e) { drag = true; lastX = 0; lastY = 0; e.preventDefault(); c.onmousemove(e) } c.onmouseup = function(e) { drag = false; e.preventDefault(); runOCR() } c.onmousemove = function(e) { e.preventDefault() var rect = c.getBoundingClientRect(); var r = 5; function dot(x, y) { o.beginPath() o.moveTo(x + r, y) o.arc(x, y, r, 0, Math.PI * 2) o.fill() } if (drag) { var x = e.clientX - rect.left, y = e.clientY - rect.top; if (lastX && lastY) { var dx = x - lastX, dy = y - lastY; var d = Math.sqrt(dx * dx + dy * dy); for (var i = 1; i < d; i += 2) { dot(lastX + dx / d * i, lastY + dy / d * i) } } dot(x, y) lastX = x; lastY = y; } } document.body.ondragover = function() { document.body.className = 'dragging'; return false } document.body.ondragend = function() { document.body.className = ''; return false } document.body.onclick = function() { document.body.className = ''; } document.body.ondrop = function(e) { e.preventDefault(); document.body.className = ''; picked_file(e.dataTransfer.files[0]); return false; } function open_picker() { var e = document.createEvent("MouseEvents"); e.initEvent('click', true, true); document.getElementById('picker').dispatchEvent(e); } function runOCR(image_data, raw_feed) { var response = OCRAD(c); if ('innerText' in document.getElementById("text")) { document.getElementById("text").innerText = response; } else { document.getElementById("text").textContent = response; } } reset_canvas()
type: Answer
score: 3
accepted answer of: http://stackoverflow.com/q/26958410

http://stackoverflow.com/a/26837361
accepted answer of: http://stackoverflow.com/q/26837251
has body: First of all, you cannot create "server" controls from client side (i.e. JavaScript / Jquery). As the Browser does not understand the server tag. The Asp View engine render that server control to the HTML control accordingly. So all you can do is you create basic HTML elements from the client side scripting. Create &lt;input type='radio'&gt;&lt;/input&gt; instead of &lt;asp:RadioButton /&gt; As you need the value at the server you can create an Hidden Field and put the selected value of the input radio in that hidden field from JavaScript / Jquery. as follows $('#yourRadiobuttonlist').change(function(){ yourHiddenField.value = $('#yourRadiobuttonlist :selected').val(); }); And at server side you can access the Hidden Field value for the desired selected value of the radio button. Hope it helps....
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26837251
score: 4
type: Answer
upvote count: 4

http://stackoverflow.com/q/26982715
score: 0
has body: Using this example along with several others it's pretty easy to figure out how to put markers on maps in different situations whether from a search or from my own data. However, when I use the google examples I sometimes see places on the map that I didn't add. For example, a search for an exact address will put a marker there, but often also shows small icons for various local businesses. Clicking on these opens that business's details in a popup and gives the user a chance to see more about the place. My question has several parts. Is it possible to get capture the click event for those icons so I can show my own popup instead? If not, is it possible to tell the map to not show any markers or icons that I didn't place? **Edit: ** This is not a duplicate of the listed question. That deals with markers, but these are not markers. See the comments for a link to the question that this is really a duplicate of.
linked to: http://stackoverflow.com/q/7538444
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42499551
answer count: 0
linked to: http://stackoverflow.com/q/24234106
type: Question
has comment: http://stackoverflow.com/comment/42500103
tagged with: google-maps
duplicate of: http://stackoverflow.com/q/24234106
tagged with: javascript
has title: Google Maps API: Capturing clicks on markers I didn't create

http://stackoverflow.com/q/26871615
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/42307428
has comment: http://stackoverflow.com/comment/42341197
has comment: http://stackoverflow.com/comment/42301908
has comment: http://stackoverflow.com/comment/42307110
has comment: http://stackoverflow.com/comment/42307448
tagged with: cordova
answer count: 0
has comment: http://stackoverflow.com/comment/42301862
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42307345
has comment: http://stackoverflow.com/comment/42309340
has title: Refresh/reset dynamically updated page in jquery mobile 1.4+
has body: I have cordova/phonegap app on iOS8 jqm 1.4+ When a user logs in I download a database and change a bunch of visual elements based on the data. Now, if this user logs out and another user logs in on the same device during the same session I need the view to "reset" as if this were a brand-new session. Realistically this only applies to 2 pages in the DOM. .trigger("create") would be the normal method to refresh/reset a page but this is deprecated and was replaced with .enhanceWithin() which I can't get to work. How I can achieve this?
type: Question
has comment: http://stackoverflow.com/comment/42306342
tagged with: jquery-mobile

http://stackoverflow.com/q/26963948
upvote count: 2
has answer: http://stackoverflow.com/a/26964257
possible better answer: http://stackoverflow.com/a/26964018
has comment: http://stackoverflow.com/comment/42465755
downvote count: 0
has body: I have the following code on a page: 2014-11-16 This 2014-11-16 is the date and is generated automatically by my CMS. I need to change this date. Basically I need to change the month to read differently because this site has an international audience. In the case above I want it to read like this: 2014-Nov-16. I know this can be done using a RegEx, however, I have no idea how to write this RegEx as I am not good at them. Of course in my example above 11 = Nov, 12 would equal Dec and so on for each month.
favorite count: 0
has comment: http://stackoverflow.com/comment/42465836
has answer: http://stackoverflow.com/a/26964104
has comment: http://stackoverflow.com/comment/42465734
answer count: 5
tagged with: regex
accepted answer: http://stackoverflow.com/a/26964078
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26964018
has answer: http://stackoverflow.com/a/26964078
has comment: http://stackoverflow.com/comment/42465840
linked to: http://stackoverflow.com/q/17493309
type: Question
has title: Change date format inside HTML with JavaScript
has answer: http://stackoverflow.com/a/26964094
tagged with: javascript

http://stackoverflow.com/q/26963017
tagged with: http://stackoverflow.com/tag/html
answer count: 1
score: 1
favorite count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: css
downvote count: 1
has title: div display none breaks style
has comment: http://stackoverflow.com/comment/42464052
type: Question
has body: I have a textarea for comments and a button to show or hide it (toggle). If I want to hide it by default (display: none) when I click the button to show it, the style is broken but if it's not hidden (display: block) I can click without problems, the style will be fine. html: Comentar css: .rows { height: auto; width: 494px; background: rgb(246, 247, 248) none repeat scroll 0% 0% / auto padding-box border-box; border-radius: 0 0 3px 3px; margin: 8px -12px -12px; } #UL_101 { width: 494px; list-style: none outside none; margin: 0px; padding: 0px; border-top: 1px solid rgb(225, 226, 227); } /* li */ .newComment_row { height: auto; position: relative; width: 470px; background: rgb(246, 247, 248) none repeat scroll 0% 0% / auto padding-box border-box; border-radius: 0 0 2px 2px; list-style: none outside none; margin: 0px 12px; padding: 4px 0px 8px 0px; } .textarea { resize: none; width: 416px; font: normal normal normal 12px/15.3599996566772px Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif; position: initial; padding: 8px 3px 0 3px; margin: 0 7px; overflow: hidden; } and jquery: // show rows $('.comment_button').on('click', function () { $('#hide_' + this.id).slideToggle('fast'); }); function h(e) { $(e).css({ 'height': 'auto', 'overflow-y': 'hidden' }).height(e.scrollHeight); } $('textarea').each(function () { h(this); }).on('input', function () { h(this); }); display: none breaks the style: http://jsfiddle.net/cb41hmpo/ display: block does not break it: http://jsfiddle.net/cb41hmpo/1/ It seems the problem is the auto-height function... Is there a way to fix this? I'd like to keep that textarea size if possible, whatever the changes are. It's not a big deal but if display is set to block and I click the button, the textarea placeholder text appears some fuzzy or blurred for a second, is that a normal thing or can it be fixed?
tagged with: javascript
has answer: http://stackoverflow.com/a/26963440

http://stackoverflow.com/a/26984736
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/26984335
upvote count: 1
has body: None of the paths you draw on Html Canvas are "remembered" so there's no way to rotate a path once it's drawn on the canvas. Instead, traditionally coded canvas animation works like this: Define a shape by putting its properties in an object Draw the shape on the canvas using that object as a template And then to change the path's position / rotation: Clear the canvas Change the definitions of the path's position & rotation. Redraw the shape on the canvas using the changed object as a template. Here's example code and a Demo: var canvas=document.getElementById("canvas"); var ctx=canvas.getContext("2d"); var cw=canvas.width; var ch=canvas.height; var angle1Degree=Math.PI/180; // define a shape by putting its properties in an object var shape1={ points:[{x:0,y:0},{x:50,y:0},{x:100,y:50},{x:0,y:50}], fillcolor:'skyblue', strokecolor:'lightgray', strokewidth:3, x:100, y:100, rotation:0, } animate(); function drawAll(){ ctx.clearRect(0,0,cw,ch); draw(shape1); } function draw(t){ ctx.save(); ctx.translate(t.x,t.y); ctx.rotate(t.rotation); ctx.beginPath(); ctx.moveTo(t.points[0].x, t.points[0].y); for(var i=1;i<t.points.length;i++){ ctx.lineTo(t.points[i].x,t.points[i].y); } ctx.closePath(); ctx.fillStyle=t.fillcolor; ctx.strokeStyle=t.strokecolor; ctx.lineWidth=t.strokewidth; ctx.fill(); ctx.stroke(); ctx.restore(); } function animate(){ requestAnimationFrame(animate); drawAll(); shape1.rotation+=angle1Degree; } body{ background-color: ivory; padding:10px; } #canvas{border:1px solid red;} Rotating a path (shape1) by changing shape1.rotation

http://stackoverflow.com/comment/42356318
has text: @diegodacal does the order of the words in the final result actually matter?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26876946

http://stackoverflow.com/comment/42487761
type: QuestionComment
comment on: http://stackoverflow.com/q/26976402
score: 1
has text: Shouldn't `dataType` be `"text"` instead of `String`?
type: Comment

http://stackoverflow.com/comment/42334710
comment on: http://stackoverflow.com/q/26890358
score: 0
has text: So what output do you want, exactly? `"11"`, `[1,1]`, `["1","1"]`, something else entirely? And what do you mean by '*a specific index*'?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26857594
tagged with: css
has title: Fixed header on-scroll with jQuery animate with stop
tagged with: wordpress
has body: After long search on google and everywhere I couldnt find a solution to my problem. I am developing a wordpress theme and having issue with my header on scrolling... On fast scrollbar scrolling the menu, logo, and header height does not return back to its state. How i can fix that??? i am using this code: jQuery(function(){ jQuery('.header-v4').data('size','big'); }); if(jQuery(".header-v4.header-1").length &gt; 0){ var ot = jQuery(".header-v4.header-1").offset().top; var head_height = jQuery(".header-v4").height(); } jQuery(window).scroll(function(){ var sticky = jQuery('.header-v4.header-1,.header-v4.header-2'); if(sticky.length &gt; 0){ if(jQuery(document).scrollTop() &gt; ot){ sticky.addClass('fixed'); jQuery('.band.blog,#slider_holder').css('marginTop',head_height); }else{ sticky.removeClass('fixed'); jQuery('.band.blog,#slider_holder').css('marginTop',0); } } if(jQuery(document).scrollTop() &gt; 200){ if(jQuery('.header-v4').data('size') == 'big') { jQuery('.header-v4').data('size','small'); //Header-1 jQuery('.header-1 img.logo').stop().animate({width:'80%'},'fast'); jQuery('.header-1 .logo_vertical_align').stop().animate({marginTop:'15px'},'fast'); jQuery('.header-1 .navigation').stop().animate({marginBottom:'15px'},'fast'); jQuery('.header-1 .nav-header-v4').stop().animate({height:'0px'},'fast'); jQuery('.header-v4.header-1').stop().animate({height:'60px'},'fast'); } }else{ if(jQuery('.header-v4.fixed').data('size') == 'small') { jQuery('.header-v4.fixed').data('size','big'); //Header-1 jQuery('.header-1 img.logo').stop().animate({width:'100%'},'fast'); jQuery('.header-1 .logo_vertical_align').stop().animate({marginTop:'30px'},'fast'); jQuery('.header-1 .navigation').stop().animate({marginBottom:'0px'},'fast'); jQuery('.header-1 .nav-header-v4').stop().animate({height:'96px'},'fast'); jQuery('.header-v4.header-1.fixed').stop().animate({height:head_height},'fast') } } }); Really appreciate your support the initial code was taken from this post : https://stac…
possible better answer: http://stackoverflow.com/a/26865774
has answer: http://stackoverflow.com/a/26865774
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/26881659
linked to: http://stackoverflow.com/q/16442016
tagged with: jquery
has comment: http://stackoverflow.com/comment/42319119
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42280774
score: 1
favorite count: 0
type: Question
accepted answer: http://stackoverflow.com/a/26881659
answer count: 2
upvote count: 1

http://stackoverflow.com/q/26860126
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26860182
favorite count: 0
has answer: http://stackoverflow.com/a/26860182
accepted answer: http://stackoverflow.com/a/26955096
tagged with: regex
upvote count: 1
type: AnsweredQuestion
score: 1
has body: I have searched SO and Google for assistance with writing this inline regular expresson but could not find any help. I have tried many times now, but cannot get it working. I have a date value that is displayed as mm/yyyy. How do I write the regular expression to display the date as yyyy/mm? This is just to change the display, not to validate the date. Thanks. EDIT Here is the element that I want to apply the inline regex to: $('#id_voluntary_finish_date').val().replace("/", '.')
tagged with: date
has answer: http://stackoverflow.com/a/26955096
type: Question
answer count: 2
has title: date display inline regular expression

http://stackoverflow.com/q/26958705
score: 2
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26961745
favorite count: 0
has title: Chrome not calculating column height correctly after JS resizing elements in multicolumn
upvote count: 2
tagged with: google-chrome
tagged with: css
tagged with: column-count
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/31847849
has body: I'm creating a dashboard which should fit content on a screen in two columns. The elements on the screen will be dynamic and of different sizes, the sizes of each will vary over time. Therefore I chose a multicolumn div layout, this will vertically fill up the columns nicely and distribute the content evenly over the two columns. For tables with a lot of rows, the idea is to put these tables within a fixed height scrollable container. This way all elements will still fit on the screen, leaving only the top X rows of each table visible. I placed these containerized tables within li elements, within a multicolumn div. Then I use javascript to calculate the height of the first X amount of rows which should be visible without scrolling. So far, so good. What this all comes down to: CSS: div.multiColumn { -moz-column-count: 2; -webkit-column-count: 2; column-count: 2; } ul.noBullets { list-style: none; padding: 0; margin: 0 0.5rem 0 0.5rem; display: -webkit-box; display: box; } ul.noBullets &gt; li { display: inline-block; width: 100%; } .scrollingTableDiv { overflow-y: auto; } HTML: &lt;div class="multiColumn"&gt; &lt;ul class="noBullets" id="ulMultiColumn"&gt; &lt;li&gt; &lt;div class="scrollingTableDiv"&gt; &lt;!-- this is the container --&gt; &lt;table class="scrollingTable" id="list1"&gt; .... &lt;/table&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; JavaScript: $(".scrollingTable").each(function() { var table = this; maxRows = 10; var wrapper = table.parentNode; var rowsInTable = table.rows.length; var height = 0; if (rowsInTable &gt; maxRows) { for (var i = 0; i &lt; maxRows; i++) { height += table.rows[i].clientHeight; } wrapper.style.height = height + "px"; } }); A working example in JS Fiddle: http://jsfiddle.net/m63LL112/4/ This jsfiddle will just work fine in IE and Firefox (showing two columns as it should). But in chrome it just shows 1 big column with a lot of whitespace below it. . What I think is the problem: Chrome seems not to respect the new container heigh…
has answer: http://stackoverflow.com/a/26961745
possible better answer: http://stackoverflow.com/a/31847849
type: Question
answer count: 2

http://stackoverflow.com/q/26887413
tagged with: css
has body: I'm working on a one-page-layout and used skrollr for it, which works quite nicely. However, now I've encountered a slight problem. With the desktop version of the site everything fits neatly on the screen, but on a mobile device the content of some slides does not fit at all, so I'd like to use a variable height for those slides, but I can't get it working, the content is always cut off at the window height / overlaid by the next slide. Is there a way to remedy that? Or am I trying something impossible here? Thanks + greetz, Tox
has title: Skrollr.js: Using fixed and dynamic height slides possible?
answer count: 0
score: 1
tagged with: skrollr
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/42340665
score: 0
comment on: http://stackoverflow.com/q/26893517
type: Comment
type: QuestionComment
has text: Is the page refreshing?

http://stackoverflow.com/a/26884316
has comment: http://stackoverflow.com/comment/42323884
type: Answer
answers question: http://stackoverflow.com/q/26884176
has comment: http://stackoverflow.com/comment/42323945
has body: That is because you are adding that into a thead. Hence regular tbody is also being generated albeit empty. Just specify the row: No records found You could also use EmptyDataText <GridView ... EmptyDataText="[ No details available... ]" >
score: 0

http://stackoverflow.com/q/26981501
has comment: http://stackoverflow.com/comment/42497370
has answer: http://stackoverflow.com/a/26981601
has comment: http://stackoverflow.com/comment/42497451
possible better answer: http://stackoverflow.com/a/26981672
has comment: http://stackoverflow.com/comment/42497839
has body: I started with a string: hidden = "a,b,c,d,e,f,g,h"; I then split(",") the string into something I can try to work with: array = hidden.split(","); If I console.log out, the result is: ["a", "b", "c", "d", "e", "f", "g", "h"] What I would eventually like to end up with (using JS only) is: ["a,b,c,d","e,f,g,h"]; or [["a,b,c,d"],["e,f,g,h"]]; Thanks! EDIT to show that I am actually trying to figure this out (don't mind the formatting): if (currentPage === "view-bills.php") { var str = ""; hidden = document.getElementById("billItems"); array = hidden.value.split(","); for (var i=0;i&lt;array.length;i++) { str += "&lt;option&gt;"+ array[i] +"&lt;/option&gt;"; } var itemsAmt = document.getElementById("items").value; document.getElementById("displayItems").innerHTML = "&lt;optgroup label='"+ itemsAmt +" items'&gt;" + str + "&lt;/optgroup&gt;"; } UPDATE: The problem has been solved, however, I would like to show you the outcome of my project (accessing classes instead of id's this time): http://i.imgur.com/umjhGPP.png Once again, don't mind my formatting, I have trouble pasting things in here: if (currentPage === "view-bills.php") { // Add items to select box hidden = document.getElementsByClassName("billItems"); for (var n=0;n&lt;hidden.length;n++) { array = hidden[n].value.split(","); groups = []; for(var i=0;i&lt;array.length;i+=5) { groups.push(array.slice(i,i+5).join(',')) } var str = ""; for (var j=0;j&lt;groups.length;j++) { str += "&lt;option&gt;"+ groups[j] +"&lt;/option&gt;"; } var itemsAmt = document.getElementsByClassName("items")[n].value; document.getElementsByClassName("displayItems")[n].innerHTML = "&lt;optgroup label='"+ itemsAmt +" items'&gt;" + str + "&lt;/optgroup&gt;"; } }
type: AnsweredQuestion
score: 2
accepted answer: http://stackoverflow.com/a/26981828
downvote count: 3
has comment: http://stackoverflow.com/comment/42497280
linked to: http://stackoverflow.com/q/11345296
type: Question
upvote count: 5
tagged with: javascript
has comment: http://stackoverflow.com/comment/42497393
has title: .split(",") every 4th item only?
has answer: http://stackoverflow.com/a/26981838
has answer: http://stackoverflow.com/a/26981828
has comment: http://stackoverflow.com/comment/42497338
has comment: http://stackoverflow.com/comment/42497782
favorite count: 0
has answer: http://stackoverflow.com/a/26981672
has answer: http://stackoverflow.com/a/26981790
answer count: 5

http://stackoverflow.com/a/26928013
has comment: http://stackoverflow.com/comment/42402315
has body: You wont be able to access any files outside the root directory from the browser (ie. like you're trying to do using Javascript). The entire point of storing files outside the root directory is so that they are not accessible by the client. It is necessary and safe enough to place registration code inside the document root.
accepted answer of: http://stackoverflow.com/q/26927947
score: 4
has comment: http://stackoverflow.com/comment/42402187
answers question: http://stackoverflow.com/q/26927947
has comment: http://stackoverflow.com/comment/42402191
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42401972
type: Answer
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/42402054

http://stackoverflow.com/q/26922657
has answer: http://stackoverflow.com/a/26922720
type: UnansweredQuestion
tagged with: simple-html-dom
tagged with: php
upvote count: 1
downvote count: 1
type: Question
has title: PHP parse javascript
tagged with: javascript
has comment: http://stackoverflow.com/comment/42393169
linked to: http://stackoverflow.com/q/19471285
has comment: http://stackoverflow.com/comment/42392794
has answer: http://stackoverflow.com/a/26922703
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42392804
has comment: http://stackoverflow.com/comment/42392802
favorite count: 0
tagged with: parsing
has body: I am utilizing the HTML DOM Parser for PHP and am having difficult trying to extract the coordinates out of this javascript. Any clue how to? Thanks. &lt;script type="text/javascript"&gt; //&lt;![CDATA[ LoadMarker(parseFloat(45.5364416896354),parseFloat(-122.959525248125), 'seizures', '141101942', 'wccca'); LoadMarker(parseFloat(45.3885251463509),parseFloat(-122.813856693134), 'cardiac arrest', '141101935', 'wccca'); resizeIncidentScrollBar('#wccca-incidents'); LoadMarker(parseFloat(45.3926967266394),parseFloat(-122.622226603465), 'chest pain', '141101208', 'ccom'); LoadMarker(parseFloat(45.266375649134),parseFloat(-122.676613858032), 'hemorrhage', '141101206', 'ccom'); LoadMarker(parseFloat(45.0866856873256),parseFloat(-122.667733219612), '*m82', '141101198', 'ccom'); resizeIncidentScrollBar('#ccom-incidents'); updateMarkers(); Sys.Application.initialize(); Sys.Application.add_init(function() { $create(Sys.UI._Timer, {"enabled":true,"interval":2000,"uniqueID":"tmrIncidents"}, null, null, $get("tmrIncidents")); }); //]]&gt; &lt;/script&gt; PHP: &lt;?php include 'simple_html_dom.php'; // Get WCCCA's html file $html = file_get_html('http://www.wccca.com/PITSv2/'); $node = $html-&gt;find('script[type=text/javascript]', 4); $DOMelement = array("LoadMarker(parseFloat(45.5364416896354),parseFloat(-122.959525248125)"); preg_match_all('/\d+(\.\d+)?/', $DOMelement[0], $matches); print_r($matches[0]); ?&gt;

http://stackoverflow.com/q/26838894
has answer: http://stackoverflow.com/a/26838969
has answer: http://stackoverflow.com/a/26839734
has body: When i close this page from browser a alert box is open to ask "Leave this page" or "stay on this" that is ok. But when submit form from Submit button given below it again ask and show this alert box . how i disable this when submit form it should not be ask and show alert box ?? &lt;script&gt; window.onbeforeunload = function(e) { return 'You application form is not submitted yet.'; }; WinPrint.document.write('&lt;span style="font-size:22px"&gt;' + prtContent.innerHTML + '&lt;span&gt;'); &lt;/script&gt; &lt;div&gt; &lt;input type="submit" name="" class="button" value="Save Your Application Form" onclick="if(document.getElementById('thumb').value=='') { alert('Please select your photograph.'); return false; } return confirm('Read your application form thoroughly before submitting, Once submitted data, it will not changed in any case, press OK to submit or press CANCEL to make corrections.'); return false;" style="text-align:center !important; float:none !important;"/&gt; &lt;/div&gt;
downvote count: 1
type: Question
upvote count: 5
tagged with: javascript
score: 4
tagged with: forms
answer count: 2
has title: How to disable "window.onbeforeunload" when submit form?
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php

http://stackoverflow.com/q/26915493
score: 0
has title: Grunt-contrib-copy temporary disable path filters
has answer: http://stackoverflow.com/a/26915765
type: UnansweredQuestion
type: Question
tagged with: gruntjs
tagged with: grunt-contrib-copy
answer count: 1
has body: Hi I'm using this filter var fs = require('fs'); function onlyNew(target) { return function(filepath) { var src = fs.statSync(filepath).mtime.getTime(); var dest = grunt.config(target.concat('dest')) + filepath.slice(grunt.config(target.concat('cwd')).length); dest = fs.statSync(dest).mtime.getTime(); return src &gt; dest; } }; in the following call to grunt-contrib-copy copy: { all: { src: 'mysource/reset.html', dest: 'mydest/reset.html', filter: onlyNew(['copy', 'all']) }, }, This works great and only copies when the source file is newer than the destination. However how do I temporarily disable those filters to force a copy. I attempted making the `onlyNew`` filter as such: function onlyNew(target) { if (grunt.option('forceCopy')) return true; else { return function(filepath) { var src = fs.statSync(filepath).mtime.getTime(); var dest = grunt.config(target.concat('dest')) + filepath.slice(grunt.config(target.concat('cwd')).length); dest = fs.statSync(dest).mtime.getTime(); return src &gt; dest; } } }; However running grunt --forceCopy is having no effect
tagged with: javascript

http://stackoverflow.com/q/26918827
answer count: 3
tagged with: jquery
has answer: http://stackoverflow.com/a/26918898
has title: JavaScript work only one time
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42386036
tagged with: http://stackoverflow.com/tag/html
score: 0
has answer: http://stackoverflow.com/a/26918961
type: Question
has comment: http://stackoverflow.com/comment/42385981
tagged with: javascript
has body: I face with some problem. I have page and make auto refresh div(table) content everything works fine and i have table with filters from javascript, but after refresh filters gone. I try call again filters function but nothing happen. Why dont work filterJS() again with setInterval script? Main Page World Regions Population ( 2007 Est.) Population % of World Internet Usage, Latest Data % Population ( Penetration ) Usage % of World Usage Growth 2000-2007 Africa 933,448,292 14.2 % 32,765,700 3.5 % 3.0 % 625.8% Asia 3,712,527,624 56.5 % 389,392,288 10.5 % 35.6 % 240.7 % Europe 809,624,686 12.3 % 312,722,892 38.6 % 28.6 % 197.6 % Middle East 193,452,727 2.9 % 19,382,400 10.0 % 1.8 % 490.1 %
has answer: http://stackoverflow.com/a/26918935

http://stackoverflow.com/comment/42393871
has text: if not in array indexOf returns -1
score: 1
comment on: http://stackoverflow.com/q/26923268
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42488690
has text: So your issue is you want a popover to be editable using an HTML template? Rather than just using popover="" ?
type: Comment
comment on: http://stackoverflow.com/q/26976812
score: 0
type: QuestionComment

http://stackoverflow.com/comment/51689173
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26954042
type: AnswerComment
has text: Thank you so much! I've spent three hours trying to figure out how to call a function in the directive scope from the controller. Thank you thank you!

http://stackoverflow.com/a/26909364
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26909077
has body: Here is the working demo http://jsfiddle.net/silpa/qzvfswz8/66/ $('.myClass').each(function(){ $height_div = $(this).height(); $height_p = $(this).find('p').height(); $(this).css('height',$height_div-$height_p); });

http://stackoverflow.com/comment/42492517
score: 0
type: Comment
has text: Thank you so much that works! Can you update your code for others to reflect var request = { placeId: place.place_id }; ?
comment on: http://stackoverflow.com/a/26965656
type: AnswerComment

http://stackoverflow.com/comment/42376935
score: 0
has text: is area of a map.. if you look at **coords** I set specific coordinates that when you move your mouse over those coordinates image will change
type: Comment
comment on: http://stackoverflow.com/a/26913790
type: AnswerComment

http://stackoverflow.com/comment/42432224
comment on: http://stackoverflow.com/q/26944713
has text: JSON, or JavaScript Object Notation is just a syntax for storing & exchanging data, it serves a similar purpose to XML if you are familiar with that.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26951403
answers question: http://stackoverflow.com/q/26950839
has body: Okay, here was my solution, I started from scratch completely, instead created the ionic app with a side menu: ionic start myApp sidemenu then used bower and bower install firebase install angularfire and then added the following html links to the index.html:
type: AcceptedAnswer
downvote count: 0
score: 4
type: Answer
upvote count: 4
accepted answer of: http://stackoverflow.com/q/26950839

http://stackoverflow.com/q/26897166
score: 0
has answer: http://stackoverflow.com/a/26897383
tagged with: radio-button
tagged with: http://stackoverflow.com/tag/html
has title: Window.Location.Href = Variable set by Selected Radio Button Value
answer count: 4
possible better answer: http://stackoverflow.com/a/26897263
has answer: http://stackoverflow.com/a/26897320
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26897424
tagged with: forms
has answer: http://stackoverflow.com/a/26897263
type: Question
accepted answer: http://stackoverflow.com/a/26897383
tagged with: function
tagged with: javascript
has body: I have a set of radio buttons: And two BUTTONS below that will take the user to to different locations CLICK TO GO HERE CLICK TO GO THERE I want to put a onclick function on ButtonTHERE so that when it's clicked, it triggers a window.location.href function and goes to "shoppingcart.html?value" where value is the value of the selected radio button. Can I do this ALL inside the onclick of the button, or should I create an outside function when the radio button is clicked, it sets a variable, and then load that variable into the "shoppingcart.html?value"?

http://stackoverflow.com/q/26942603
has answer: http://stackoverflow.com/a/26942669
has title: How to get setInterval countdown working?
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/26942661
score: 0
has answer: http://stackoverflow.com/a/26942661
has body: I am having trouble getting this countdown working. How do I get it to count down? also if I wanted to get it to count up, how would I go about doing that? jsfiddle: http://jsfiddle.net/vx16tnet/2/ jquery: $('.count').on('click', function(){ var countDown = $('.count').text(); console.log(countDown); setInterval(function() { countDown--; $('.count').html(countDown); }, 1000); });
has comment: http://stackoverflow.com/comment/42428622
has answer: http://stackoverflow.com/a/26942668
accepted answer: http://stackoverflow.com/a/26942668
answer count: 4
has comment: http://stackoverflow.com/comment/42428691
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/26942852

http://stackoverflow.com/q/26850727
downvote count: 1
tagged with: dojo
type: Question
has body: I have a TimeTextBox in Dojo - it currently looks like this: However, I want it to look like this (with the hours emphasized - but with 10 minute increments instead of 15): What's the simplest way to do this? Currently, I have these props set: &lt;input id="${ns}atdExamStartTime" type="text" name="examStartTime" data-dojo-type="dijit/form/TimeTextBox" style="width:8em;" required="true" data-dojo-props="promptMessage:'Enter the start time for the exam', invalidMessage:'This is not a valid time', rangeMessage:'Exams must be scheduled between 8am and 10pm', constraints:{min:'T08:00',max:'T21:59',clickableIncrement:'T00:10:00',visibleIncrement:'T00:10:00'}" /&gt; Thanks in advance!
tagged with: format
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29928854
favorite count: 0
has title: Formatting of the Dojo dijit/form/TimeTextBox dropdown
score: 0
tagged with: datetime
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/a/26910592
has comment: http://stackoverflow.com/comment/42372831
answers question: http://stackoverflow.com/q/26907932
type: Answer
score: 0
has body: if ($.bookables_scroll &amp;&amp; $.bookables_scroll.children != undefined) { // Save childrens var removeData = []; for (i = $.bookables_scroll.children.length; i &gt; 0; i--) { removeData.push($.bookables_scroll.children[i - 1]); }; // Remove childrens for (i = 0; i &lt; removeData.length; i++) { $.bookables_scroll.remove(removeData[i]); } removeData = null; } Try to save children view into an array then use another loop to remove all pages in scrollable view. Hope it helps. Thank you

http://stackoverflow.com/q/26834845
has comment: http://stackoverflow.com/comment/42236927
tagged with: internet-explorer-11
score: 1
upvote count: 1
type: Question
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/42236817
tagged with: javascript
has comment: http://stackoverflow.com/comment/47268604
has answer: http://stackoverflow.com/a/26835889
has comment: http://stackoverflow.com/comment/42236203
linked to: http://stackoverflow.com/q/1451208
has comment: http://stackoverflow.com/comment/42236164
answer count: 2
has comment: http://stackoverflow.com/comment/42236425
downvote count: 0
has comment: http://stackoverflow.com/comment/42237084
favorite count: 0
has title: In IE11, event is not firing in javascript
has body: Tried not working this is an compatability issue Ie9 vs IE11: Actual JSP: Please find the details :WHERE IFRAME AND SCRIPTS used this is an compatibility issue in IE11. I placed a breakpoint in the readyStateChange() but its not triggering.
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/51078738
has comment: http://stackoverflow.com/comment/42236825
has comment: http://stackoverflow.com/comment/42236523

http://stackoverflow.com/a/26961502
answers question: http://stackoverflow.com/q/26961226
has body: Well, there are a couple of solutions to your problem, like this: *instead of slidetoggle, use a toggleClass, that only works on 768px or bellow like this; *or use a css only approach with a checkbox and a label on top of your code, replacing the button tag with a label tag; when the checkbox will be checked the menu will be shown, like this;
score: 1
upvote count: 1
downvote count: 0
type: Answer

http://stackoverflow.com/a/26838557
has comment: http://stackoverflow.com/comment/42242222
answers question: http://stackoverflow.com/q/26838195
has body: Changes in code: if (targetSelector) $(targetSelector).next("span.error").html(obj[entry][0]); else { $(targetSelector).next("span.error").text(' '); } if you want to show error on hover: $("input").hover(function(){ var id = $(this).attr("id"); $("input").next("span.error").hide(); $("#"+id).next("span.error").show(); })
has comment: http://stackoverflow.com/comment/42248043
has comment: http://stackoverflow.com/comment/42245686
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/42245884
has comment: http://stackoverflow.com/comment/42252021
has comment: http://stackoverflow.com/comment/42246994
has comment: http://stackoverflow.com/comment/42249698
score: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/42242331
has comment: http://stackoverflow.com/comment/42242624
has comment: http://stackoverflow.com/comment/42241934

http://stackoverflow.com/a/26882477
type: AcceptedAnswer
downvote count: 0
has body: You can use angular provider, you can find documentation here https://docs.angularjs.org/guide/providers. So you can make provider which has your function scroll and that pass provider to your controller. Example: http://jsfiddle.net/7xvzm7b7/ var myApp = angular.module('myApp', []); myApp.service('$scrollService', function() { this.scroll = function(delta){ //check scroll timer if (scrollTimer) return; //new scroll pane if (delta &lt; 0 &amp;&amp; $rootScope.pane.count &lt; $rootScope.pane.max) $rootScope.pane.count += 1; else if (delta &gt; 0 &amp;&amp; $rootScope.pane.count &gt; 0) $rootScope.pane.count -= 1; else return; //apply current pane $rootScope.$apply(); //animate scroll var scroll = $rootScope.pane.count * $window.height + "px"; $("html, body").animate({scrollTop: scroll}, 600, "swing"); //reset scroll timer scrollTimer = true; setTimeout(function(){ scrollTimer = false; }, 1500); } return this; }); //scroll myApp.controller('ctrl', ['$scope', '$scrollService', function($scope, $scrollService) { $scrollService.scroll(); }]);
upvote count: 2
has comment: http://stackoverflow.com/comment/42321589
type: Answer
has comment: http://stackoverflow.com/comment/42320691
score: 2
answers question: http://stackoverflow.com/q/26882350
accepted answer of: http://stackoverflow.com/q/26882350

http://stackoverflow.com/a/26955634
score: 2
answers question: http://stackoverflow.com/q/26955618
upvote count: 2
accepted answer of: http://stackoverflow.com/q/26955618
type: AcceptedAnswer
downvote count: 0
has body: You have to target $(this).siblings('.sliding_box') instead of $(".sliding_box"). $(document).ready(function() { $(".main_box").click(function() { $(this).siblings('.sliding_box').slideToggle(); }); }); div.wrapper { width: 300px; float: left; margin-right: 10px; } div.main_box { width: 300px; height: 30px; background-color: #FF0000; } div.sliding_box { width: 300px; height: 300px; background-color: #0000FF; } Reference: .siblings()
type: Answer

http://stackoverflow.com/q/26899515
has title: echoing javascript with php including mysql row variables
tagged with: php
type: AnsweredQuestion
tagged with: mysql
accepted answer: http://stackoverflow.com/a/26899562
type: Question
answer count: 2
has body: I'm trying to echo javascript code using php and trying to retrieve data from my database within this very echo-code... Does anybody know what I'm doing wrong? Is it because javascript is only client-side? (Technically, I'm trying to reach the database with php...) I would appreciate some help! &lt;?php if($condition == true){ //connect to the database //-select the database to use //-query the database table //-run the query against the mysql query function //-create while loop and loop through result set echo "&lt;script&gt; items_set = [ { src : '&lt;?php echo ".$row['imageURL']." ?&gt;', url : '&lt;?php echo ".$row['URL']." ?&gt;', category: '&lt;?php echo ".$row['DetailCategory']." ?&gt;', title : '&lt;?php echo ".$row['Name']." ?&gt;', description : '&lt;?php echo ".$row['Description']." ?&gt;', price : '&lt;?php echo ".$row['Price']." ?&gt;', location : '&lt;?php echo ".$row['Postcode']." ?&gt;', thirdparty : '&lt;?php echo ".$row['ThirdParty']." ?&gt;', thirdparty_mobile : '&lt;?php echo ".$row['Thirdparty']." ?&gt;' } ]; jQuery('#list').portfolio_addon({ load_count : 1, items : items_set }); &lt;/script&gt;"; }} ?&gt; Thanks in advance! (In Dreamweaver the colors of the code look right, unlike here)
tagged with: javascript
score: 0
possible better answer: http://stackoverflow.com/a/26899679
has answer: http://stackoverflow.com/a/26899679
has answer: http://stackoverflow.com/a/26899562

http://stackoverflow.com/comment/42370507
type: QuestionComment
has text: The problem is that it does not scroll :)
comment on: http://stackoverflow.com/q/26910030
score: 0
type: Comment

http://stackoverflow.com/a/26895952
type: Answer
answers question: http://stackoverflow.com/q/26875049
score: 3
upvote count: 3
has body: So for those who need a solution to something like this, the answer is a bit complicated. The above PHP code does properly convert the image from a dataURL to a png, and then resizes it as a jpg. The proper way to make a multipart/form-data Post from ajax goes like this: var url = "example.php" var image_as_blob = previousAjaxRequest(); //use xhr.responseType = "blob" and a GET request to grab server image var form = new FormData(); form.append('image_variable_name', image_as_blob, 'file_name.extension'); //the third argument seemed to make all the difference in server code seeing the file correctly. $.ajax({ url: url, type: 'post', data: form, cache: false, contentType: false, //required for multipart processData: false //required for multipart }).done(function( data ) { //do what you want with returned data });
downvote count: 0
has comment: http://stackoverflow.com/comment/78581641

http://stackoverflow.com/q/26926858
tagged with: supertest
has answer: http://stackoverflow.com/a/27102039
has body: This is a question regarding asynchronoust testing in Sails JS using Mocha. I am writing controller test in Sails JS using supertest library. I want to check if a method is being called on HTTP POST to our controller. For that, I am stubbing the method and expecting it to be invoked in the end() as follows: request(sails.hooks.http.app) .post('heartbeat/create') .send('device: 1') .end(function(err, res) { expect(publishCreateStub.called).to.be.true; done(); }); When I run this, the expectation fails because the method is not called when asserting. But when I put the expectation in a setTimeout as follows, it works: request(sails.hooks.http.app) .post('heartbeat/create') .send('device: 1') .end(function(err, res) { setTimeOut(function() { expect(publishCreateStub.called).to.be.true; done(); }, 1000); }); Is there any way to make the test pass without a setTimeout? Here is the code part I am testing: HeartbeatController#create You can also help us to resolve the issue by sending pull requests: https://github.com/multunus/one-mdm/issues/1
accepted answer: http://stackoverflow.com/a/27102039
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/27101677
has comment: http://stackoverflow.com/comment/42706350
downvote count: 0
tagged with: javascript
tagged with: mocha.js
upvote count: 3
has title: How to test if a method is being called in the controller?
tagged with: node.js
favorite count: 0
has answer: http://stackoverflow.com/a/27101677
has comment: http://stackoverflow.com/comment/42706161
type: AnsweredQuestion
score: 3
tagged with: sails.js

http://stackoverflow.com/q/26906271
score: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/26906384
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/42363196
has body: I am struggling with the idea of, adding a fresh new elements to DOM for each time I triggered an AJAX call by jQuery. The code below refresh the text everytime I triggered the AJAX call, I want it to add whole new element instead of refreshing. BTW here is the code I have written. function successAJAX(response){ response = $.parseJSON(response); var priceHTML = document.createElement('p'); priceHTML.innerText= "foo"; $("#priceContainer").append(priceHTML); } function makeAjaxRequest() { $.ajax({ url: "ajax/ajax.php", data: obj, type: "post", success: successAJAX });//end ajax };//end makeRequest $button.on("submit",makeAjaxRequest()); The current situation is I can successfully add a new html element after I press submit button. But I am not satisfied with this, I want to add one more new html element for each time I press the submit button. For example, I can only append 1 element of html on the DOM now when I press the submit button(trigger ajax function) 100 times. My question is how can I append 100 elements of html on the DOM if I press the submit button(triggering ajax function) 100 times.
possible better answer: http://stackoverflow.com/a/26906407
has answer: http://stackoverflow.com/a/26906407
upvote count: 1
type: Question
type: AnsweredQuestion
tagged with: javascript
has title: Create new element by jQuery each time ajax is trigger
has answer: http://stackoverflow.com/a/26906384
answer count: 2
downvote count: 0

http://stackoverflow.com/a/54084281
has body: TypeScript supports decorators, and using that feature plus a little library called typescript-mix you can use mixins to have multiple inheritance with just a couple of lines // The following line is only for intellisense to work interface Shopperholic extends Buyer, Transportable {} class Shopperholic { // The following line is where we "extend" from other 2 classes @use( Buyer, Transportable ) this price = 2000; }
has comment: http://stackoverflow.com/comment/137432710
type: Answer
downvote count: 3
score: 23
answers question: http://stackoverflow.com/q/26948400
upvote count: 26

http://stackoverflow.com/comment/42252578
score: 0
type: Comment
has text: Well, I was just looking for an idea that has the least code. I want to keep my "big/original" array throughout the code and was looking for a way to access the id property easily.
type: QuestionComment
comment on: http://stackoverflow.com/q/26844260

http://stackoverflow.com/comment/42483897
type: QuestionComment
has text: You shouldn't use a loop calling an AJAX function, but send the array (or object) as an AJAX parameter and let the server side code do the loop.
comment on: http://stackoverflow.com/q/26974329
score: 1
type: Comment

http://stackoverflow.com/a/26864864
answers question: http://stackoverflow.com/q/26864654
has comment: http://stackoverflow.com/comment/42289315
accepted answer of: http://stackoverflow.com/q/26864654
has comment: http://stackoverflow.com/comment/42289472
has comment: http://stackoverflow.com/comment/42290153
type: AcceptedAnswer
downvote count: 0
has body: there's couple problems in your code. you need to remove keyword upload before addEventLIstener you need to call send() method on oReq object cross-origin policy won't allow you to load https://www.google.com, but you still can load documents on the same domain check this code: var oReq = new XMLHttpRequest(); function transferComplete(evt) { alert("The transfer is complete."); } oReq.addEventListener("load", transferComplete, false); oReq.open('GET',"/index.html", true); oReq.send(); try it on JSFiddle
type: Answer
has comment: http://stackoverflow.com/comment/42289874
has comment: http://stackoverflow.com/comment/42289445
has comment: http://stackoverflow.com/comment/42289223
score: 1
has comment: http://stackoverflow.com/comment/42289243
upvote count: 1

http://stackoverflow.com/comment/42320482
comment on: http://stackoverflow.com/a/26882281
score: 0
type: AnswerComment
type: Comment
has text: Maybe it's the best if you can provide me a cssdeck, codepen, jsfiddle or something along the lines to examplify

http://stackoverflow.com/comment/42499902
type: Comment
has text: Yeah thats what I did, I wasnt sure if there was another thing I had to do. Somehow you changed the group ID, I changed it to the right group ID lol and it worked. Thanks about to green check once I confirm its working :)
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26982721

http://stackoverflow.com/comment/42416844
comment on: http://stackoverflow.com/q/26936275
has text: Better in terms of what? Performance, simplicity, readability, debuggable?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26892040
type: Question
tagged with: angularjs-directive
linked to: http://stackoverflow.com/q/19227036
has comment: http://stackoverflow.com/comment/42338165
tagged with: javascript
score: 0
has title: How do I properly initialize/mock and unit test input data in a directive's externally-defined controller?
tagged with: angularjs
type: UnansweredQuestion
has body: I have a custom directive that uses an external controller and template. The user passes in some initial data to the directive, which is used inside the controller. When I'm unit testing myController, this.inputData is initially undefined. How do I initialize or mock this.inputData in my unit test so that I can properly test that myCustomFilter was called with a defined value in its first parameter? CustomDirective: 'use strict'; angular.module('myModule') .directive('myDirectve', function () { return { restrict: 'EA', scope: { inputData: '=' }, templateUrl: 'templates/my-directive-template.html', bindToController: true, controllerAs: 'main', controller: 'myMainCtrl', link: function () { } }; }); DirectiveController: 'use strict'; angular.module('myModule') .controller('myMainCtrl', function (myCustomFilter) { this.filteredData = myCustomFilter(this.inputData, true); }); my-directive-template: &lt;span&gt;{{ main.filteredData.length }}&lt;/span&gt; Using MyDirective: &lt;my-directive inputData="myInputData"&gt;&lt;/my-directive&gt;
tagged with: unit-testing
answer count: 0
tagged with: angularjs-controller
has comment: http://stackoverflow.com/comment/42352721

http://stackoverflow.com/comment/42406943
comment on: http://stackoverflow.com/q/26917982
type: Comment
type: QuestionComment
has text: Thanks. Seems it only happens on Firefox. Description updated
score: 0

http://stackoverflow.com/comment/42583312
type: Comment
comment on: http://stackoverflow.com/a/26939368
type: AnswerComment
has text: I did eventually get this to work, but only in a fiddle. I think something is wrong with the rest of the document, but I'm unsure of what. I'm working on transferring it to my ESPs proprietary script now so it will work server side. At that point I'll be able to troubleshoot more. Thanks for everyone's help!
score: 0

http://stackoverflow.com/q/26923268
has answer: http://stackoverflow.com/a/26923367
accepted answer: http://stackoverflow.com/a/26923367
has answer: http://stackoverflow.com/a/26923393
answer count: 2
has comment: http://stackoverflow.com/comment/42393871
upvote count: 1
tagged with: jquery
possible better answer: http://stackoverflow.com/a/26923393
favorite count: 0
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/42393831
type: Question
type: AnsweredQuestion
tagged with: algorithm
has comment: http://stackoverflow.com/comment/42393861
has title: Why this code still adding rows to the table if indexOf return 0?
tagged with: javascript
has body: I've this jQuery that allow to add new rows to a table on click event of a button but only if the id value isn't already added. var factAgregada = []; $('#btnAgregarFactura').on("click", function (e) { e.preventDefault(); // no_factura and fecha_factura comes from a modal window // it's not relevant to show that part here var no_factura = $("#no_factura").val(), fecha_factura = $("#fecha_factura").val(), html; console.log(no_factura); console.log(factAgregada.indexOf(no_factura)); if (factAgregada.indexOf(no_factura) &gt;= -1) { html = '&lt;tr&gt;'; html += '&lt;td&gt;&lt;input type="checkbox" id="' + no_factura + '"&gt;&lt;/td&gt;'; html += '&lt;td&gt;' + no_factura + '&lt;/td&gt;'; html += '&lt;td&gt;' + fecha_factura + '&lt;/td&gt;'; html += '&lt;/tr&gt;'; $(html).appendTo("#facturaBody"); } factAgregada.push(no_factura); }); On first execution the code works fine and console.log() outputs this: 12 -1 So it's right add the row, but on second execution and keeping the same value console.log() changes from the previos values to this ones: 12 0 So, row shouldn't be added but still adding to the table and continue doing the appendTo(), what's wrong there? What I'm not seeing?

http://stackoverflow.com/a/26846298
has body: There are two solutions to this issue: "I understand that I can create a new marker based on the old one, but this is really overhead and I'd like to avoid it": you would do this. This is the better solution, and you shouldn't prematurely optimize this. Non-settable options are that way for a reason. Set clickable to true all the time and add and remove the event listener.
has comment: http://stackoverflow.com/comment/42257375
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26845826
answers question: http://stackoverflow.com/q/26845826
downvote count: 0
type: AcceptedAnswer
score: 1
has comment: http://stackoverflow.com/comment/42256333
has comment: http://stackoverflow.com/comment/42259304
type: Answer
has comment: http://stackoverflow.com/comment/42257246

http://stackoverflow.com/q/26867192
downvote count: 0
has title: White space and background moves
tagged with: background-image
has answer: http://stackoverflow.com/a/26867703
accepted answer: http://stackoverflow.com/a/26867703
type: Question
score: 1
has body: There is a faq on my website for a school project created with Javascript animations. The problem is: 1; The background moves when 2 or more faqs are opened. 2; There is a white space beneath the background. The faq on my website (click for the image) The javascript var main = function() { $('.article').click(function() { $('.article').removeClass('current'); $('.description').hide(); $(this).addClass('current'); $(this).children('.description').show(); }); $(document).keypress(function(event) { if(event.which === 111) { $('.current').children('.description').toggle(); } else if(event.which === 110) { var currentArticle = $('.current'); var nextArticle = currentArticle.next(); currentArticle.removeClass('current'); nextArticle.addClass('current'); } }); }; $(document).ready(main); The Css Body { background: url('http://s3.amazonaws.com/codecademy-content/courses/ltp2/img/uber/black-thread.png'); } .articles_title { color:white; font-size: 250%; position: fixed; top: 30px; right: 50%; } p { margin: 0; } .row { margin: 0; } .articles { margin-top: 16px; margin-bottom: 16px; } .article { color: #222; background: rgba(255,255,255,.9); border-spacing: 2px; border-color: gray; font-family: arial,sans-serif; border-bottom: 1px #e5e5e5 solid; } .current .item { background: rgba(206,220,206,.9); } .item { cursor: pointer; padding-top: 7px; padding-bottom: 7px; } .item .source { margin-left: 16px; } .item .title { font-weight: bold; } .item .pubdate { margin-right: 16px; } .item .pubdate { text-align: right; } .description { display: none; padding-top: 10px; padding-bottom: 10px; } .description h1 { margin-top: 0px; font-size: 16px; } /* the index.php css */ body { left: 0; margin: 0; overflow: hidden; position: relative; } /* Initial menu */ .menu { background: url('http://s3.amazonaws.com/codecademy-content/courses/ltp2/img/uber/black-thread.png') repeat left top; left: -285px; /* start off behind the scenes */ height: 100%; position: fixed; width: 285px; } /* Basic styling…
tagged with: background
possible better answer: http://stackoverflow.com/a/26867900
answer count: 2
upvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: css
has answer: http://stackoverflow.com/a/26867900
type: AnsweredQuestion

http://stackoverflow.com/a/35116814
has comment: http://stackoverflow.com/comment/80320489
score: -2
upvote count: 0
answers question: http://stackoverflow.com/q/26975068
type: Answer
has body: You can do this too: csv .fromStream(stream, { headers: true, strictColumnHandling: true }) .validate(function(data) { if (data.age &gt; 18) return false; else return true; } .on("data-invalid", function(data){ // do something like log for example });
downvote count: 2

http://stackoverflow.com/comment/42486894
has text: @JamesThorpe Thank you for your prompt reply. I tried it already but no luck
score: 0
comment on: http://stackoverflow.com/q/26976000
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42363070
comment on: http://stackoverflow.com/q/26906164
score: 0
type: Comment
type: QuestionComment
has text: why can't you construct the second `select` under this part -> `function(data,status){}`

http://stackoverflow.com/comment/42337694
type: AnswerComment
score: 0
has text: Of course, if the OP has more then 1 file then he should use a `WHERE` clause on which he should match them by file_id, but he stated: *"I'm trying to do this to keep track of how many times **a file** has been downloaded."*
type: Comment
comment on: http://stackoverflow.com/a/26891666

http://stackoverflow.com/q/26899057
has answer: http://stackoverflow.com/a/26899098
answer count: 2
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/26899128
has comment: http://stackoverflow.com/comment/42351330
has comment: http://stackoverflow.com/comment/42351040
favorite count: 0
possible better answer: http://stackoverflow.com/a/26899098
has title: Can document.createElement be combined
has comment: http://stackoverflow.com/comment/42351038
type: AnsweredQuestion
score: 3
has body: Can multiple elements be created without rewriting document.createElement() each time.. document.createElement("article"); document.createElement("footer"); document.createElement("header"); document.createElement("hgroup"); document.createElement("nav"); These would be great.. document.createElements("article,footer,header,hgroup,nav"); or var elems = ["article","footer","header","hgroup","nav"]; document.createElement(elems);
upvote count: 3
accepted answer: http://stackoverflow.com/a/26899128
type: Question

innerhtml
tags question: http://stackoverflow.com/q/26883243
tags question: http://stackoverflow.com/q/26885790
tags question: http://stackoverflow.com/q/26910584
tags question: http://stackoverflow.com/q/26890144
tags question: http://stackoverflow.com/q/26890675
type: Tag
tags question: http://stackoverflow.com/q/26883674
tags question: http://stackoverflow.com/q/26931590
tags question: http://stackoverflow.com/q/26886832
tags question: http://stackoverflow.com/q/26912829
tag name: innerhtml

http://stackoverflow.com/comment/42369976
type: Comment
has text: my above problems solved when i follow your (@Michael) instructions but here is another problem arise "Uncaught Error: [$injector:modulerr]" when i use angular.module('app1','[ngRoute]') .provider('Post',function(){....} and angular.module('app1') .controller('MainCtrl', ['.....
type: QuestionComment
comment on: http://stackoverflow.com/q/26882510
score: 0

http://stackoverflow.com/q/26955805
type: Question
has title: Cannot read property 'className' of null
answer count: 2
has answer: http://stackoverflow.com/a/26955838
has answer: http://stackoverflow.com/a/26968755
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/42451134
has body: This isn't working. I have an element in my html with the id "color". What is the deal? I just want it to add to the class of that element. var el = document.getElementById("color"); var number = Math.floor((Math.random() * 5) + 1); switch (number) { case 1: el.className += " blue"; break; case 2: el.className += " yellow"; break; case 3: el.className += " red"; break; case 4: el.className += " green"; break; case 5: el.className += " purple"; break; }
upvote count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42451137
score: 3

http://stackoverflow.com/q/26962881
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42463811
has answer: http://stackoverflow.com/a/26963254
has answer: http://stackoverflow.com/a/26963088
type: Question
answer count: 2
has title: How to rewrite/change url using javascript
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42463788
tagged with: .htaccess
has body: I know this has already been answered, but mine is somehow special. Firstly, my site is not a PHP site (it's an XHTML site). So, can someone teach me how to rewrite url like this: mysite.com/forum2_theme_CATEGORY-ID.xhtml?n=PAGE-ID&amp;tema=TOPIC-ID To something like: mysite.com/forum2/CATEGORY-ID/TOPIC-ID/PAGE-ID Please note that my site is not a PHP site, it's just an XHTML site. I will be happy if I can get a suitable solution. Thanks.

http://stackoverflow.com/a/26921895
has comment: http://stackoverflow.com/comment/42392115
score: 0
has body: What does "php/ajaxcomment.php" return when you post a comment? Pure HTML? I'd make the "php/ajaxcomment.php" return JSON, for example: <?php /* here you do what ever you do now, Insert the new comment to database, etc */ // Then you return the inserted data: $data = array( 'UNAME' => $username, 'COMMENT' => $comment, ); header('Content-Type: application/json'); print json_encode( $data ); ?> ..and change the ajax: ... ... success: function(data){ var commentItem = $(' ').addClass('comment-item'); var commentPost = $(' ').addClass('comment-post'); var user = $(' ').html( data.UNAME +'said...' ); var comment = $(' ').html( data.COMMENT ); commentItem.html( commentPost.html( user + comment ) ).hide().fadeIn(800); $('.comment-block').append(commentItem); // reset form and button form.trigger('reset'); submit.val('Submit Comment').removeAttr('disabled'); }, ... ...
has comment: http://stackoverflow.com/comment/42391966
has comment: http://stackoverflow.com/comment/42391786
has comment: http://stackoverflow.com/comment/42392275
type: Answer
answers question: http://stackoverflow.com/q/26921674
has comment: http://stackoverflow.com/comment/42392198

http://stackoverflow.com/q/26976942
has comment: http://stackoverflow.com/comment/42488570
type: Question
tagged with: mongodb
has answer: http://stackoverflow.com/a/26981254
answer count: 1
tagged with: javascript
upvote count: 1
tagged with: meteor
favorite count: 0
has body: I want to limit my query's result to a set of fields. This is one of my documents: { "_id" : "WA9QRuiWtGsr4amtT", "status" : 3, "data" : [ { "name" : "0", "value" : "Text ..." }, { "name" : "1", "value" : "12345678" }, { "name" : "2", "value" : "Text" }, { "name" : "4", "value" : "2" }, { "name" : "8", "value" : true }, { "name" : "26", "value" : true }, ], "userId" : "7ouEumtudgC2HX4fF", "updatedAt" : NumberLong(1415903962863) } I want to limit the output to the status field as well a the first and third data document. This is what I tried: Meteor.publish('cases', function () { var fields = { currentStatus: 1, 'data.0': 1, 'data.2': 1 }; return Cases.find({}, { fields: fields }); }); Sadly it doesn't work. Something else I found is $elemMatch but it only returns the first element: data: { $elemMatch: { name: { $in: ['0', '2'] } } }, How can I limit the output to these fields?
downvote count: 0
type: UnansweredQuestion
has title: MongoDB return specific fields from array
score: 1

http://stackoverflow.com/a/27133036
downvote count: 0
has comment: http://stackoverflow.com/comment/42782368
type: AcceptedAnswer
score: 1
has comment: http://stackoverflow.com/comment/42847655
has body: How about ES Harmony? quote from here: http://addyosmani.com/writing-modular-js/ Note: Although Harmony is still in the proposal phases, you can already try out (partial) features of ES.next that address native support for writing modular JavaScript thanks to Google's Traceur compiler. To get up and running with Traceur in under a minute, read this getting started guide. There's also a JSConf presentation about it that's worth looking at if you're interested in learning more about the project. hopeThatHelps
type: Answer
answers question: http://stackoverflow.com/q/26969271
accepted answer of: http://stackoverflow.com/q/26969271
upvote count: 1

http://stackoverflow.com/a/26901970
type: Answer
has body: your $scope.result is contains 2 objects, with in one object u have set of object properties like _1,_2 , and then these properties are again objects like "_1": { "id": 4, "cost": 45.0, "measure": 4, "NoOfUnits": 677, "hours": null } , then u have the properties u need to print. &lt;ul&gt; &lt;li ng-repeat="x in result"&gt; // repeats objects &lt;ul ng-repeat="obj in x"&gt; // repeat object properties '_1',"_2" , these are again objects {{obj.name}}{{obj.description}} &lt;ul&gt; &lt;/li&gt; &lt;/ul&gt;
upvote count: 1
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/26901910

http://stackoverflow.com/q/26894813
linked to: http://stackoverflow.com/q/5656349
has comment: http://stackoverflow.com/comment/42343140
type: Question
has comment: http://stackoverflow.com/comment/42343074
has title: JavaScript: Redirecting after closing an alert that came from a popup of another window
upvote count: 0
score: -2
has body: The situation is that the site I am working on will display a popup after 10 minutes of inactivity, then 5 minutes (which is counted down in the popup window) an alert message appears informing the user has been logged out. I am trying to redirect the original page to the page that will done an abandon and redirect to the logon page, but I am struggling to succeed at this; window.opener.opener.replace("relevantPage.aspx"); window.close; All in the relevant tags by the way. Any help would be much appreciated
has comment: http://stackoverflow.com/comment/42343352
tagged with: javascript
answer count: 1
favorite count: 0
type: UnansweredQuestion
downvote count: 2
has answer: http://stackoverflow.com/a/26895000

http://stackoverflow.com/comment/42370699
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26908561
score: 0
has text: it opens a new window (the one you can see list of movies) .. you could see them in images in my question :p

http://stackoverflow.com/q/26867140
has comment: http://stackoverflow.com/comment/42293834
type: Question
tagged with: internet-explorer-9
tagged with: javascript
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Change the Rendering in IE9 with Stylesheets
favorite count: 0
has body: is there a way to disable the rendering in IE9? Can we do it using stylesheet changes? or some meta character on the webpage maybe? thanks EDIT here is a sample in Chrome and in IE9 i want the page to look as displayed in Chrome. Is there any way i can get that effect in IE9?
has comment: http://stackoverflow.com/comment/42293764
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42293953
tagged with: css
has comment: http://stackoverflow.com/comment/42293908
has answer: http://stackoverflow.com/a/26867609
downvote count: 0
score: 1

http://stackoverflow.com/comment/42449408
score: 0
type: Comment
type: QuestionComment
has text: If I knew how to do that/find it, i would. but I don't ;( (irc.abraxas.pw if you think you might be able to find it?)
comment on: http://stackoverflow.com/q/26954685

http://stackoverflow.com/q/26832624
score: 0
has comment: http://stackoverflow.com/comment/42231928
has comment: http://stackoverflow.com/comment/42231841
tagged with: jquery
has answer: http://stackoverflow.com/a/26832742
has title: Div updated with AJAX result loses update
has answer: http://stackoverflow.com/a/26832728
tagged with: ajax
possible better answer: http://stackoverflow.com/a/26832772
answer count: 5
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26832824
accepted answer: http://stackoverflow.com/a/26832824
has body: I've set up a simple page that is supposed to update a div with the result of an AJAX call. It sort-of works: the service is called, the correct result is returned, the result text will appear in the div, but as soon as I dismiss the message box, the div reverts. The Javascript I'm using looks like this: Done!
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26832772
has comment: http://stackoverflow.com/comment/42231874
has answer: http://stackoverflow.com/a/26832895
type: Question
tagged with: javascript

http://stackoverflow.com/q/26839938
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42244288
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26840340
score: 0
has answer: http://stackoverflow.com/a/26840044
tagged with: jquery
possible better answer: http://stackoverflow.com/a/26840035
has body: With jquery I am reading table: $('#lc_searchresult > table > tbody > tr').each(function() { var data = $(this).find("td:eq(5)").html(); alert(data); }); it is working fine if TR tag has one TD inside like: 654321 but If I am having two TD's then I am geting just first one: 654321 13456 How can I get all of TD's from TR with $(this).find("td:eq(5)").html()
has title: jQuery read all TD's table data
has answer: http://stackoverflow.com/a/26840035
answer count: 5
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26840434
has answer: http://stackoverflow.com/a/26840340
has answer: http://stackoverflow.com/a/26840058
has comment: http://stackoverflow.com/comment/42244373
type: Question

http://stackoverflow.com/q/26931116
tagged with: java
type: Question
has comment: http://stackoverflow.com/comment/42407444
upvote count: 1
has answer: http://stackoverflow.com/a/26931398
has answer: http://stackoverflow.com/a/26931331
tagged with: content-management-system
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26931451
favorite count: 0
has title: How would I do an Angular JS ng-repeat on this JSON parse?
has body: How would I do an Angular JS ng-repeat on this JSON parse? .controller('TeamsCtrl', function($scope) { var text = '{"employees":[' + '{"name":"John Doe"},' + '{"name":"Sam Doe"},' + '{"name":"Jack Doe"}]}'; /* create scope property that will be recognized in view*/ $scope.tasks = JSON.parse(text); }); Here is the area I want populated with the new content: <ion-content class="has-header" ng-controller="TeamsCtrl"> {{employee.name}}
score: 0
downvote count: 1
has answer: http://stackoverflow.com/a/26931451
answer count: 4
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/26931331
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26931356
tagged with: hybrid-mobile-app

http://stackoverflow.com/a/26962640
score: 0
answers question: http://stackoverflow.com/q/26962520
type: Answer
has body: and this is how you could do it the jQueryway: HTML: No Template Template 1 Template 2 Template 3 THIS TEXT SHOULD CHANGE Javascript / jQuery: $(function () { $("#dropBox").on("change", function () { switch ($(this).val()) { case "1": $("#divText").html("html/text for option 1"); break; case "2": $("#divText").html("html/text for option 2"); break; case "3": $("#divText").html("html/text for option 3"); break; case "4": $("#divText").html("html/text for option 4"); break; } }); }); JSFiddle

http://stackoverflow.com/comment/42272598
score: 0
type: Comment
type: QuestionComment
has text: `id=" <?php echo $imgID; ?>"`
comment on: http://stackoverflow.com/q/26855002

http://stackoverflow.com/comment/42421469
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26938499
has text: Isn't it an option in your device emulator that disables caching external script?
score: 0

http://stackoverflow.com/comment/42262004
comment on: http://stackoverflow.com/q/26848611
type: Comment
type: QuestionComment
has text: But you want to do that for every selected file? So if there are multiple selected files, and you hit the button once, what should happen?
score: 0

http://stackoverflow.com/a/27537237
has body: According to: https://developers.google.com/api-client-library/javascript/features/cors#Loadingthestandaloneauthclient You can call: gapi.load('auth', function() { // at this point gapi.auth is ready. });
answers question: http://stackoverflow.com/q/26960356
score: 0
type: Answer

http://stackoverflow.com/comment/42319672
type: AnswerComment
comment on: http://stackoverflow.com/a/26881350
score: 0
type: Comment
has text: You can check it here how this regex works http://regex101.com/r/eD8iY7/1 , i dont know how you are doing your implementation of it

http://stackoverflow.com/a/26834023
has body: Check that you connected jQuery to the of the page: &lt;script src="//code.jquery.com/jquery-1.11.1.min.js"&gt;&lt;/script&gt; And check out this jsbin: http://jsbin.com/sipaxaqipo/1/edit?html,js,console,output (it works fully with your code), so your code is correct. Mistake is somewhere in another part of site, hope you just forgot to connect jQuery.
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/26833670
downvote count: 0
score: 1

http://stackoverflow.com/comment/42302239
type: QuestionComment
score: 0
has text: A mentioned above, `Drop()` is only in the scope of `initialize`, if you're able to take out the drop function and make a call to it when inside the initialize function, i suggest taking that route.
comment on: http://stackoverflow.com/q/26871967
type: Comment

http://stackoverflow.com/q/26916135
has comment: http://stackoverflow.com/comment/42380845
score: 0
has answer: http://stackoverflow.com/a/26916352
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42380947
linked to: http://stackoverflow.com/q/21293613
has comment: http://stackoverflow.com/comment/42380954
type: Question
has body: Here is some dynamically generated content with jquery. high last How do I get the content of the button that is clicked (high or last) in a div with id="solution"? Here's what I tried: $("#response").on("click", 'button.btn-key-main', function() { $("#solution").html($(this).val()); }); Solved by @slicedtoad and @smerny .val() should've been .html() or .text() $("#solution").html($(this).html());
possible better answer: http://stackoverflow.com/a/26916352
has title: Jquery: get text from dynamically generated button in new div
answer count: 2
has comment: http://stackoverflow.com/comment/42381042
has comment: http://stackoverflow.com/comment/42380894
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26916255
accepted answer: http://stackoverflow.com/a/26916255

http://stackoverflow.com/comment/42670853
type: QuestionComment
has text: I'm sorry, but I still don't see the problem...
comment on: http://stackoverflow.com/q/26848115
score: 0
type: Comment

http://stackoverflow.com/comment/42467325
type: Comment
type: QuestionComment
has text: Can we see some code please? If you don't have any, it's better to atleast give it a try. If you get stuck, then we are here for you.
comment on: http://stackoverflow.com/q/26964803
score: 0

http://stackoverflow.com/comment/42404963
score: 0
has text: @Marc, you misunderstand The screen is not updated until the javascript has finished executing....
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26929669

http://stackoverflow.com/a/27078523
type: Answer
has comment: http://stackoverflow.com/comment/42668932
has comment: http://stackoverflow.com/comment/42668993
has body: Rounding up the value of $(window).scrollTop() would make it work http://jsfiddle.net/buithehoa/1anquu74/3/
answers question: http://stackoverflow.com/q/26838636
score: 0

http://stackoverflow.com/q/26877680
tagged with: jquery
type: Question
has body: I'd like to find a way to match the length of an input as well as the characters inside that input using javascript. Normally I'd just use the jquery plugin for validation, but for the client we can't use any 3rd party modules. The input requires a string of characters between 6-13 but also does not allow the &lt; or > characters within the values. I'd like a way to check both the length of the string to make sure its between 6-13 but also reject the string if it contains &lt; or >. I'm assuming this can be done with Regex, but my skills are severely lacking. The user should be able to see a message based on length and incorrect characters depending on what they are typing. Any quick methods out there?
tagged with: regex
has title: Match Multiple validation on 1 input with javascript
has answer: http://stackoverflow.com/a/26877741
score: 0
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26877741
type: AnsweredQuestion
tagged with: validation

http://stackoverflow.com/q/26910625
answer count: 3
has title: jQuery inquiry .children
has comment: http://stackoverflow.com/comment/42370891
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42370861
upvote count: 1
downvote count: 1
has body: $('.Name').children(function() { var username = $('.Name').text(); console.log(username); }); I'm curious how I would get this to grab all of the children with the tag 'title' and console.log the value of each of them one by one.
has answer: http://stackoverflow.com/a/26910679
has answer: http://stackoverflow.com/a/26910711
has comment: http://stackoverflow.com/comment/42370868
has comment: http://stackoverflow.com/comment/42370866
type: Question
score: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26910725
favorite count: 0

http://stackoverflow.com/a/26859183
has comment: http://stackoverflow.com/comment/42279718
answers question: http://stackoverflow.com/q/26859006
type: Answer
upvote count: 0
has comment: http://stackoverflow.com/comment/42279534
score: -1
has body: Try This in JS with Jquery : var a="Name : Abdul Naeem"; var sp="Naeem"; $(function(){ var x=a.split(sp); z=x[0].split(" "); alert(z[z.length-2]); }); Demo in JSFIDDLE
downvote count: 1

http://stackoverflow.com/a/27057629
score: 5
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: I found the definitive solution that works for me: I changed hammer() properties set to a fast swipe and touch; I've added preventDefault() in each swipe events; Set is now set to pass this._id to the helper to check if the swiped item has the same object id and then, if true, it shows delete button. The code: Session.setDefault('deletable', null); Template.xx.rendered = function(){ $('body').hammer({ drag_min_distance:1, swipe_velocity:0.1 }); }; Template.xx.events({ 'swipeleft #hammerDiv': function(e, t) { e.preventDefault(); Session.set('deletable', null); }, 'swiperight #hammerDiv': function(e, t) { e.preventDefault(); Session.set('deletable', this._id); } }); Template.xx.helpers({ deleteButton : function(){ var thisItem = Session.get('deletable'); if (thisItem == this._id){ return true }else{ return false; } } }); Alternatively, instead of apply preventDefault() within events, it's possible to change the hammer() target and add a new property like this: $('#hammerDiv').hammer({ drag_min_distance:1, swipe_velocity:0.1 prevent_default:true });
accepted answer of: http://stackoverflow.com/q/26951541
upvote count: 5
answers question: http://stackoverflow.com/q/26951541

http://stackoverflow.com/comment/42296965
score: 0
has text: I don't understand why JS is not offering an own construct to make inheritance easier to understand and more readable as code.
type: Comment
comment on: http://stackoverflow.com/a/26866185
type: AnswerComment

http://stackoverflow.com/a/26982189
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/42500319
has comment: http://stackoverflow.com/comment/42499912
has comment: http://stackoverflow.com/comment/42499691
type: Answer
has comment: http://stackoverflow.com/comment/43028547
answers question: http://stackoverflow.com/q/26982083
has body: You Can Use hidden fields inside form data to send an Value as POST like &lt;input type="hidden" name="name" value="value"&gt; In Case you don't want any user activity You can use Javascript to submit form: &lt;form action="http://example.com/foo" name="hiddenform" method="POST"&gt; &lt;input type="hidden" name="name1" value="value1"&gt; &lt;input type="hidden" name="name2" value="value2"&gt; &lt;/form&gt; &lt;script type="text/javascript"&gt; setTimeout("document.forms['hiddenform'].submit();",0); &lt;/script&gt; Above Will Display Nothing on Screen and submit form as soon as this loads. Side-Note: if you want to delay change value of 0 according to your needs in setTimeout("document.forms['hiddenform'].submit();",0);
has comment: http://stackoverflow.com/comment/42996846
downvote count: 0

http://stackoverflow.com/a/26907611
answers question: http://stackoverflow.com/q/26907295
has body: or you can use this pass object in getdata method $('#build-table').on('click', function(){ $('#temp-table').append(' Select Name ' + ' Select Name1 ' + ' Select Name2 ' + ' ') }); function getData(ob) { var $item = $(ob).closest("tr").find('td'); $.each($item, function(key, value){ alert($(value).text()); }) }
score: 0
type: Answer

http://stackoverflow.com/comment/42397577
comment on: http://stackoverflow.com/a/26923858
type: AnswerComment
has text: ok, It works for the current date but actually I need to get the value from a json and It isn´t the current date. In the past with the current date was enough..
score: 0
type: Comment

http://stackoverflow.com/q/26984511
tagged with: modernizr
answer count: 0
upvote count: 2
has title: SVG image pattern position, different behaviour in IE
type: Question
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/42522357
has comment: http://stackoverflow.com/comment/42514788
tagged with: javascript
has comment: http://stackoverflow.com/comment/42509575
score: 2
downvote count: 0
has body: I'm using this code with Snap.svg to create a pattern and then fill a path: var s = Snap("#mysvg"); pattern = s.image(imgUrl, myX, myY, 200, 160).toPattern(myX, myY, 200, 160); var frontHex = s.path(myPath).attr({ fill: pattern }); and the output is something like: The problem is that IE seems to work differently with pattern elements and in order to show the image in the right position I have to set the x and y of the image element always equals to 0. pattern = s.image(imgUrl, 0, 0, 200, 160).toPattern(x, y, 200, 160); output within the pattern element: I thought to change the script when the client is using IE, but "Detect specific browsers" is not recommended and anyhow the user.agent trick doesn't work anymore: IE compatibility guidelines . I never used Modernizr. Maybe this problem can be solved with it through feature detection? How? Snap.svg automatically adds patternUnits="userSpaceOnUse" on pattern and preserveAspectRatio="none meet" on the image. There is something to do here maybe? Update I temporarily fixed the bug using this simple snippet: var image = s.image(myUrl, x, y, 200, 160); if(image.attr("preserveAspectRatio") === "none meet") image.attr({x: 0, y: 0}); It works for IE, Firefox and Chrome. I leave the question open, in case there are better or more correct solutions.
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
type: UnansweredQuestion

http://stackoverflow.com/q/26860881
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26863568
tagged with: youtube
has body: I am trying to make random play, I would like to click a button, then automatically after the film opened up next. This code works but only when the movie is finish then you have to manually click #schuffle and opens up the next item. I want to only had to click once and then activated by this code every time when the film is completed, that is, return 0. $(document).ready(function() { $("#schuffle").on('click',function(e) { //ytplayer.getPlayerState() return 0 when video is finish //if youtube video is finish if ( ytplayer.getPlayerState() == 0 ) { //click random element out .koncentrator a.utwor var list = $('.koncentrator a.utwor'); //click random .koncentrator a.utwor list.eq(parseInt(Math.random()*list.length)).click(); //scroll to element $(".active").get(0).scrollIntoView(); } }); });
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26863323
has title: Turn on schuffle when click jQuery

http://stackoverflow.com/comment/42484913
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26964083
has text: They actually just use the library D3, which uses Delaunay triangulation ( as mentioned by Ken Fyrstenberg ). But thanks!
type: AnswerComment

http://stackoverflow.com/comment/42440891
type: AnswerComment
score: 0
type: Comment
has text: @Carter: Sorry, but I'm not understand your question. `headers` are internal structures of jqGrid which will be used during resizing of the columns. Probably you want to change the width of the columns *after* the grid created. In the case you can use `setColWidth` method which I published as jQuery plugin [here](https://github.com/OlegKi/jqGrid-plugins/blob/master/jQuery.jqGrid.setColWidth.js). See the description in [the answer](http://stackoverflow.com/a/20030652/315935).
comment on: http://stackoverflow.com/a/26926333

http://stackoverflow.com/comment/42405903
type: Comment
has text: I don't see `data` or `status` in the examples.
score: 0
comment on: http://stackoverflow.com/q/26930297
type: QuestionComment

http://stackoverflow.com/comment/42467169
has text: Don't know what you are doing, but this works just fine: http://jsfiddle.net/k2h80393/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26964659
score: 2

http://stackoverflow.com/q/26988907
has title: Meteor.js error in loading Templates
tagged with: javascript
score: 1
has comment: http://stackoverflow.com/comment/42510962
has comment: http://stackoverflow.com/comment/42510693
has comment: http://stackoverflow.com/comment/42510385
accepted answer: http://stackoverflow.com/a/26989833
tagged with: meteor
favorite count: 0
upvote count: 1
has body: Everything was working fine on my app (including the loadingTemplate, which was only being routed when actually required) until I decided to make a simple list on my home template to show every document on a Mongo collection called Rooms, by its title. WHAT I'VE DONE HTML: {{#each rooms}} {{> roomsListItem}} {{/each}} {{title}} JS: Template.roomsList.helpers({ rooms: function() { return Rooms.find(); } }); As you can see, very basic stuff. The JS is just supposed to return all the documents on the Rooms collection (there are not many) so that the {{#each}} code block can iterate on them and catch all the titles to make the . I'm adding {{> roomsList}} on the home template. PACKAGES I'M USING I've seen this mentioned in other #meteor questions, so I'll go ahead and list here: accounts-password 1.0.4 Password support for accounts accounts-ui 1.1.3 Simple templates to add login widgets to an app iron:router 1.0.1 Routing specifically designed for Meteor meteor-platform 1.2.0 Include a standard set of Meteor packages in your app sacha:spin 2.0.4 Simple spinner package for Meteor WHAT'S HAPPENING Well, first, here's the bash error message: I20141118-05:25:21.855(-2)? Exception from sub k7PEn4QcT9McjF8tw ReferenceError: rooms is not defined I20141118-05:25:21.856(-2)? at null._handler (app/server/publications.js:2:9) I20141118-05:25:21.856(-2)? at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1599) I20141118-05:25:21.856(-2)? at _.extend._runHandler (packages/ddp/livedata_server.js:943) I20141118-05:25:21.857(-2)? at _.extend._startSubscription (packages/ddp/livedata_server.js:769) I20141118-05:25:21.857(-2)? at _.extend.protocol_handlers.sub (packages/ddp/livedata_server.js:582) I20141118-05:25:21.860(-2)? at packages/ddp/livedata_server.js:546 I suspect the first line is causing all the others, but I can't work out what it's telling me. I am calling the collection in other parts of the app, in the same manner, without a problem. So I have no idea what's caus…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42510817
has answer: http://stackoverflow.com/a/26989833
type: Question
tagged with: mongodb
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/92813155
has text: Perhaps what was shown was an older version of the diagram? The one shown now shows that after 0 the only characters allowed directly after a zero are a decimal point or e or E or nothing. So any digit after 0 would be invalid
comment on: http://stackoverflow.com/a/26898499
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/26901801
has comment: http://stackoverflow.com/comment/42355976
answers question: http://stackoverflow.com/q/26901696
type: Answer
has comment: http://stackoverflow.com/comment/42355930
has comment: http://stackoverflow.com/comment/42355883
has comment: http://stackoverflow.com/comment/42355900
has comment: http://stackoverflow.com/comment/42356273
has comment: http://stackoverflow.com/comment/42356090
has body: You can add this to your save callback function: $scope.$apply(); Or you can change you function into: $scope.saveRecordChanges= function(){ myFundResponse.save($scope.record).$promise.then(function(response){ $scope.record = response; }); }; Cuz in angular $promise, it will invoke $asyncEval to call your success or error callback, which means with angular $promise will update the view automatically.
score: 0

http://stackoverflow.com/a/26853006
has comment: http://stackoverflow.com/comment/42296608
has comment: http://stackoverflow.com/comment/42300163
has comment: http://stackoverflow.com/comment/42303320
type: Answer
has comment: http://stackoverflow.com/comment/42281811
has body: Update! http://jsfiddle.net/lsubirana/7od3sfrr/1/ HTML: My font color must change depending on slider-ui threshold My font color must change depending on slider-ui threshold CSS: .left, .right {position:absolute; top: 0; left: 0; height: 100vh;overflow:hidden;} .left h3 {color: white; text-align: center; margin-top: 30px;width:100vw;} .right h3 {color: black; text-align: center; margin-top: 30px;width:100vw;} Original Answer: One method to obtain what you are looking for is to pass the slider percentage to a function that can return you an rgb color value. The following page shows how to create rainbows in javascript and I believe can be applied in this case: http://krazydad.com/tutorials/makecolors.php $(document).ready(function() { $( "#slider" ).slider({ max: 101, min:1, value: 51, slide: function(event,ui) { var percentage = (ui.value)-1; $('.left').css("width",percentage +'%'); $('h3').css('color', rgb(percentage)); } }); }); function rgb(p){ var frequency = .08; r = Math.sin(frequency*p + 0) * 127 + 128; g = Math.sin(frequency*p + 2) * 127 + 128; b = Math.sin(frequency*p + 4) * 127 + 128; return 'rgb(' + Math.round(r) + ',' + Math.round(g) + ',' + Math.round(b) + ')'; } http://jsfiddle.net/lsubirana/376ow969/
score: 0
answers question: http://stackoverflow.com/q/26851439

http://stackoverflow.com/a/26859531
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42279899
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26859462
answers question: http://stackoverflow.com/q/26859462
type: Answer
upvote count: 1
score: 1
has body: Create a div to show result &lt;div id="image"&gt;&lt;/div&gt; and insert html code received success: function (data) { //alert(data) $('#image').html(data); },

http://stackoverflow.com/comment/42422401
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26938880
has text: Probably want to look at recursion if you want to do this cleanly.

http://stackoverflow.com/comment/42376897
score: 0
has text: btw - you should separate your javascript from your html
type: Comment
comment on: http://stackoverflow.com/q/26913740
type: QuestionComment

http://stackoverflow.com/a/26872629
type: AcceptedAnswer
type: Answer
score: 1
has body: It sounds like you want to put the data properties directly onto the custom data object? I'd suggest using an "extend" function that will copy the data properties onto the customData object. For example using Underscore extend: _.extend(req.locals.user.customData, data); I also really like xtend
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26871407
answers question: http://stackoverflow.com/q/26871407
upvote count: 1

http://stackoverflow.com/comment/42434241
comment on: http://stackoverflow.com/q/26945288
score: 0
has text: @RaeenHashemi Please have a look at my update question where I added jquery script which has not finished yet/.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/42479987
has text: P.S. array indexing starts from '0' ..
comment on: http://stackoverflow.com/q/26972175
score: 0
type: Comment
type: QuestionComment

feathersjs
type: Tag
tag name: feathersjs
tags question: http://stackoverflow.com/q/26878466

http://stackoverflow.com/comment/42242136
type: Comment
has text: Thanks for all the help Alex! In the end what worked was this: adding the .toggle-menu-wrap {display:none;} + jQuery(document).ready(function() { fadeMenuWrap(); jQuery(window).scroll(function() { fadeMenuWrap(); }); function fadeMenuWrap() { var top = window.pageYOffset || document.documentElement.scrollTop; if (top > 300) { jQuery('.toggle-menu-wrap').fadeIn(300); } else { jQuery('.toggle-menu-wrap').fadeOut(300); } } });
type: AnswerComment
comment on: http://stackoverflow.com/a/26838141
score: 0

http://stackoverflow.com/comment/48450038
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/26976605
score: 0
has text: This is the best solution I've found so far when working with a parent abstract state. If the parent is not an abstract state, is better to go with *ui-sref-active*.

http://stackoverflow.com/comment/42383727
has text: idk... just screwing with it, but check this out: http://jsfiddle.net/f4L4szqa/4/
comment on: http://stackoverflow.com/a/26915543
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/42348790
has text: Are you sure jQuery is being loaded correctly? Check your console for errors.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/26897715
type: QuestionComment

http://stackoverflow.com/a/26933453
has body: The only problem is that you're looking with Firebug and it seems to show the original content of the textarea instead of its current value. Run document.getElementById("redactor").value in the console and you'll see that it's formated just as you saw (and this formatting isn't anything special as other comments have already stated)
score: 0
answers question: http://stackoverflow.com/q/26926340
type: Answer

http://stackoverflow.com/comment/42463979
type: AnswerComment
has text: Sad. I dig my browser.
type: Comment
comment on: http://stackoverflow.com/a/26951117
score: 0

http://stackoverflow.com/comment/42478687
type: AnswerComment
comment on: http://stackoverflow.com/a/26971506
type: Comment
has text: oh, thanks. that's actually a cool solution. "if javascript decides to change my date - it has to be wrong" :)
score: 0

http://stackoverflow.com/comment/42443272
comment on: http://stackoverflow.com/a/26951111
type: Comment
has text: @RickHitchcock Very true I forgot that body will only take as much height as need for content. Thank you!
score: 1
type: AnswerComment

http://stackoverflow.com/q/26973444
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/42482301
has comment: http://stackoverflow.com/comment/42482390
tagged with: string
has comment: http://stackoverflow.com/comment/42482481
has comment: http://stackoverflow.com/comment/42482657
has answer: http://stackoverflow.com/a/26973836
has comment: http://stackoverflow.com/comment/42482079
has body: i have this text: this is a sample text Apparently, after "sample" there is a Line feed character (ENTER). How can i encode JUST those characters and not the whole string. When i use encodeURI the whole string gets encoded What i want to do is to get a string like "this is a sample%0Atext" Thanks
type: UnansweredQuestion
has title: encode line feed character in Javascript
linked to: http://stackoverflow.com/q/784539
type: Question
tagged with: javascript

http://stackoverflow.com/comment/42559282
has text: it's possible to force script to show dialog with settings, if Shift or Alt key was pressed when script was executed - this gives necessary flexibility, and such scripts can be programmed with eventListeners, as startup scripts and so on...
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26939528

http://stackoverflow.com/comment/42293085
score: 0
has text: `state ? '#div1' : '#div2' ;` is a shorthand and works for only two results, you can put #div1,#div2 and #div3 into array and loop over it
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26866833

http://stackoverflow.com/comment/80887299
score: 13
has text: As of 2017, [SweetAlert guide](https://sweetalert.js.org/guides/) says explicitly that *html is no longer used. Instead use the [content object](https://sweetalert.js.org/docs/#content)*. Thought it might help someone, since this answer has so many up-votes.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28107076

http://stackoverflow.com/comment/42459042
has text: @Qantas94Heavy You are right, I am not web programmer; I didn't knew what polyfill is.
comment on: http://stackoverflow.com/q/26951407
score: 0
type: Comment
type: QuestionComment

file
type: Tag
tag name: file
tags question: http://stackoverflow.com/q/26834573
tags question: http://stackoverflow.com/q/26981774
tags question: http://stackoverflow.com/q/26953816
tags question: http://stackoverflow.com/q/26945701
tags question: http://stackoverflow.com/q/26958322

http://stackoverflow.com/comment/61651591
type: Comment
comment on: http://stackoverflow.com/a/26997851
type: AnswerComment
has text: You might want to add a note saying that commenting out the customerId parameter applies to all the server side technologies.
score: 0

http://stackoverflow.com/a/26977058
answers question: http://stackoverflow.com/q/26976925
has body: I would suggest the use of a recursive function for this. function doProgress (startingPercent, interval) { var percent = startingPercent++; window.setTimeout(function () { $('#percentage').text(percent.toString() + '%'); if (percent &lt; 100) { doProgress(percent, interval); } }, interval); }
type: Answer
score: 0

http://stackoverflow.com/a/33091782
has body: You can get the results with a simple: @app.route('your route', methods=['GET']) def yourMethod(params): response = flask.jsonify({'some': 'data'}) response.headers.add('Access-Control-Allow-Origin', '*') return response
upvote count: 164
answers question: http://stackoverflow.com/q/26980713
has comment: http://stackoverflow.com/comment/68386382
score: 163
has comment: http://stackoverflow.com/comment/69823688
has comment: http://stackoverflow.com/comment/119457165
type: Answer
has comment: http://stackoverflow.com/comment/76653257
has comment: http://stackoverflow.com/comment/127233062
has comment: http://stackoverflow.com/comment/77144999
downvote count: 1
has comment: http://stackoverflow.com/comment/95190205

http://stackoverflow.com/a/27160538
has comment: http://stackoverflow.com/comment/42823700
score: 1
answers question: http://stackoverflow.com/q/26990192
has comment: http://stackoverflow.com/comment/42826968
upvote count: 1
has body: You can replace your for loop with something like this, don't know about performance though. jsfiddle traverse(root[1].Nodes[0]); function traverse(node) { for (i in root[2].Arcs) { var d = root[1].Nodes[root[2].Arcs[i].D]; if (node.name === root[2].Arcs[i].D) { var s = root[1].Nodes[root[2].Arcs[i].S]; var sCopy={ "name": s.name } traverse(sCopy); if (!node.children) { node.children = []; } node.children.push(sCopy); } } }
type: Answer
downvote count: 0

http://stackoverflow.com/a/26864782
answers question: http://stackoverflow.com/q/26864581
type: Answer
has comment: http://stackoverflow.com/comment/42289475
has comment: http://stackoverflow.com/comment/42289072
score: 0
has body: No. There is no function in JS to get all the time zones. Only thing you get is time zone offset bye following code. var date = new Date(), zoneOffset = date.getTimezoneOffset(); And in dojo you can get name of timezone require(["dojo/date"], function(date){ var myDate = (2000, 5, 16); date.getTimezoneName(myDate); }); I have used in past http://momentjs.com/timezone/data/ JS but it is currently under development again.

http://stackoverflow.com/q/26851785
has comment: http://stackoverflow.com/comment/42268256
has comment: http://stackoverflow.com/comment/42267633
tagged with: javascript
has comment: http://stackoverflow.com/comment/42271169
possible better answer: http://stackoverflow.com/a/26851843
has comment: http://stackoverflow.com/comment/42268265
has answer: http://stackoverflow.com/a/26851920
has comment: http://stackoverflow.com/comment/42268434
has answer: http://stackoverflow.com/a/26851843
has body: Below is a simple model/corresponding view that I've set up. It's linked to a table with a couple drop downs and one input text box. I want the view methods to fire when the values in the text box and drop downs are changed, however I haven't had any luck. Using the console.log statments and breakpoints, the only method that seems to execute is the initialize method in the model. None of the view methods fire when the drop down/input box values change. Fiddle: http://jsfiddle.net/qneL65zs/14/ Backbone $(document).ready(function() { var QuoteHistory = Backbone.Model.extend({ //urlRoot: '/Values/SaveQuote', defaults: { hub: new Backbone.SignalR("QuoteHub"), avgHist: "", State: "", AgeGroup: "", Purchase: "", PastQuote: "", Date: "", AverageQuote: "" }, initialize: function () { console.log("Model initialize"); } }); var QuoteView = Backbone.View.extend({ el: $('#QuoteInput'), events: { "input td input#QuotePurchase": "udpatePurchase", "change #QuoteAge": "udpateQuoteAge", "change #QuoteState": "udpateState", "click #QuoteSave": "udpateModel" }, initialize: function() { _.bindAll(this, 'updatePurchase', 'updateQuoteAge', 'updateState'); this.model.bind('change', this.updatePurchase); this.model.bind('change', this.updateQuoteAge); this.model.bind('change', this.updateState); }, render: function () { console.log("render"); this.model.pullAverageQuote(); }, updatePurchase: function() { console.log("update purchase"); var val = this.$el.find('#QuotePurchase').val(); this.model.set({ Purchase: val }); }, updateQuoteAge: function () { console.log("update age"); var val = this.$el.find('#QuoteAge option:selected').val(); this.model.set({ AgeGroup: val }); }, updateState: function () { console.log("update state"); var val = this.$el.find('#QuoteState option:selected').val(); this.model.set({ State: val }); }, updateModel: function () { console.log("update model"); this.model.save(this, { success: function() { console.log("success"); this.model.pullAverageQuote(); }, error: fu…
has comment: http://stackoverflow.com/comment/42276587
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42268026
has comment: http://stackoverflow.com/comment/42275439
downvote count: 0
has comment: http://stackoverflow.com/comment/42268096
tagged with: jquery
favorite count: 0
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/42268328
type: Question
has comment: http://stackoverflow.com/comment/42267964
has comment: http://stackoverflow.com/comment/42267677
answer count: 2
has comment: http://stackoverflow.com/comment/42338567
has comment: http://stackoverflow.com/comment/42268713
accepted answer: http://stackoverflow.com/a/26851920
linked to: http://stackoverflow.com/q/16350211
has comment: http://stackoverflow.com/comment/42337609
has comment: http://stackoverflow.com/comment/42268283
has comment: http://stackoverflow.com/comment/42265980
upvote count: 2
has title: Backbone view events not firing when input altered on the page
has comment: http://stackoverflow.com/comment/42338498

http://stackoverflow.com/a/31308095
has body: With Polymer 1.x there is a corresponding behaviour for handling element resizing -- Polymer.IronResizableBehavior. Here is a good example that demonstrates how it can be used.
answers question: http://stackoverflow.com/q/26877051
score: 3
downvote count: 0
upvote count: 3
type: Answer

http://stackoverflow.com/comment/42254389
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/26845599
has text: Yeah, answers with code and no explanation are not as useful
type: Comment

http://stackoverflow.com/comment/42351193
comment on: http://stackoverflow.com/q/26899113
type: Comment
type: QuestionComment
has text: Probably not since '/' is also the divide operator.
score: 0

http://stackoverflow.com/comment/42292465
type: QuestionComment
comment on: http://stackoverflow.com/q/26864234
score: 1
has text: I'm pretty sure `this.handleLogic()` does not work. Called from `requestAnimFrame`, the `this` value of the invocation is probably `window`; do you have a global `handleLogic` function?
type: Comment

http://stackoverflow.com/comment/42380769
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26916016
type: AnswerComment
has text: If you are using jquery, you can select the specific elements using the nth-child selector as well. For example $("#sortable li:nth-child(1)") for the first child.

http://stackoverflow.com/comment/42438934
comment on: http://stackoverflow.com/a/26948441
type: AnswerComment
has text: Yes. I strongly suggest you try to render arrow as separate HTML element. Did you know that [SVG images can be animated using JavaScript](http://u8.8u.cz/pokus.svg)?
score: 0
type: Comment

http://stackoverflow.com/comment/42360284
has text: @zhangkai See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget.addEventListener#The_value_of_this_within_the_handler
type: Comment
comment on: http://stackoverflow.com/a/26904195
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42434612
comment on: http://stackoverflow.com/q/26946081
score: 0
has text: I do have a class called display. I have changed the class to className, still not working.
type: QuestionComment
type: Comment

http://stackoverflow.com/a/27071729
has comment: http://stackoverflow.com/comment/42660266
has body: Let's look at how bind works. First, one level of nesting: var foo = function() { return this.x; }; alert(foo()); // undefined alert(foo.bind({x: 42})()); // 42 Now we can add the next level of nesting: var bar = function() { return foo.bind(this)(); }; alert(bar()); // undefined alert(bar.bind({x: 42})()); We pass our this context to foo with - guess what? - bind. There is nothing different about the way bind works between scopes. The only difference is that we've already bound this within bar, and so the body of bar is free to re-bind this within foo. As a couple of commenters have noted, functions that overwrite themselves are a huge code smell. There is no reason to do this; you can bind context to your functions when you call them. I highly, highly recommend reading the documentation on bind, and trying to understand it to the point where you can write a basic version of Function.prototype.bind from scratch.
answers question: http://stackoverflow.com/q/26903358
has comment: http://stackoverflow.com/comment/42660277
downvote count: 0
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/42389090
type: Comment
type: QuestionComment
score: 0
has text: 1. because pagecontainer by default is `body`, you have to override this. 2. http://stackoverflow.com/a/24173950/1771795 3. thanks, i'm trying to setup one too 4. it depends, I dont know the way React works.
comment on: http://stackoverflow.com/q/26919289

http://stackoverflow.com/comment/42336670
comment on: http://stackoverflow.com/a/26889114
has text: Got it, what I've done is added a HTML close symbol to the top right of my popup as the popup contains a form and I don't want the user getting half way through the form and accidentally closing the popup by clicking outside of the box.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42237220
type: Comment
comment on: http://stackoverflow.com/q/26835644
has text: @Serg Exactly :) That was the word I was looking for.
score: 0
type: QuestionComment

http://stackoverflow.com/q/26991819
tagged with: javascript
score: 0
answer count: 1
type: UnansweredQuestion
has title: Setting focus with primefaces
has answer: http://stackoverflow.com/a/27019537
tagged with: primefaces
has body: I have an application which is used to update a company's stock. I want a page with two inputTexts. The first one where i enter an item's ID and the press . The Focus then goes to the second inputText, the stock amount of the item. That works fine. Then, when i modify the amount and press , the item is saved and the Focus should go back to the first inputText. It does but it then directly jumps to the second inputText again. Any idea? &lt;div id="page-content"&gt; &lt;h:form id="frmItem" prependId="false"&gt; &lt;p:focus id="focus" context="frmItem:itemNo" /&gt; &lt;p:messages id="vmsgs" severity="error,warn" autoUpdate="true" /&gt; &lt;p:panelGrid id="inventoryHeader" columns="3" columnClasses="form-label,form-input" styleClass="form-grid"&gt; &lt;p:outputLabel for="itemNo" value="item no." /&gt; &lt;p:inputText id="itemNo" autocomplete="off" value="#{wmsItemInventoryActionBean.itemNo}" onkeypress="if(event.keyCode==13){onchange();return false;}"&gt; &lt;p:ajax process="@form" update="@form:focus,@form:stockAmount,@this" listener="#{wmsItemInventoryActionBean.itemNo}" oncomplete="stockAmount.select()" /&gt; &lt;/p:inputText&gt; &lt;p:message for="itemNo" /&gt; &lt;p:outputLabel for="stockAmount" value="stock" /&gt; &lt;p:inputText id="stockAmount" autocomplete="off" value="#{wmsItemInventoryActionBean.stockAmount}" onkeypress="if(event.keyCode==13){onchange();return false;}"&gt; &lt;p:ajax process="@form" listener="#{wmsItemInventoryActionBean.save()}" oncomplete="itemNo.focus()"/&gt; &lt;/p:inputText&gt; &lt;p:message for="stockAmount" /&gt; &lt;/p:panelGrid&gt; &lt;/h:form&gt; &lt;/div&gt;
type: Question

http://stackoverflow.com/comment/42339480
score: 0
type: AnswerComment
has text: This does not include the "source0" and "source1"
type: Comment
comment on: http://stackoverflow.com/a/26892309

http://stackoverflow.com/q/26889120
score: 0
has body: In java is it possible to convert non-english characters into their english characters. For example, I want: Zdeborová --&gt; Zdeborova Krząkała --&gt; Krzakala Sr´amek --&gt; Sramek so on.. When i try the methods below String t1 = Normalizer.normalize("Krząkała", Normalizer.Form.NFD); String t2 = t1.replaceAll("[^\\p{ASCII}]", ""); String t3 = t2.replaceAll("\\p{M}", ""); OR String t4 = org.apache.commons.lang3.StringUtils.stripAccents("Krząkała"); They all give Krz?ka?a as a result? I can do this process in oracle sql simly saying : select REGEXP_REPLACE(replace(convert(trim(upper('Krząkała')), 'us7ascii'), '_', ' '), '[^A-Z ]', '') std from dual; and get KRZAKALA. I think in java it must also so simple???
has comment: http://stackoverflow.com/comment/42332445
has comment: http://stackoverflow.com/comment/42333359
has comment: http://stackoverflow.com/comment/42339731
has title: Is it possible to get metaphones for those non-english characters?
has comment: http://stackoverflow.com/comment/42336338
answer count: 0
linked to: http://stackoverflow.com/q/1008802
tagged with: metaphone
has comment: http://stackoverflow.com/comment/42333660
type: UnansweredQuestion
tagged with: java
tagged with: javascript
has comment: http://stackoverflow.com/comment/42333292
type: Question

http://stackoverflow.com/comment/128553528
score: 0
type: AnswerComment
type: Comment
has text: that's messy, and its not .text() but .val(), but here's +1 for the: $('#firstSelectms2side__sx option:selected')
comment on: http://stackoverflow.com/a/26991908

http://stackoverflow.com/comment/42505309
type: Comment
comment on: http://stackoverflow.com/a/26985897
type: AnswerComment
score: 0
has text: @Phrogz No specific reason except that it has been a habit to clear variables. `var tokens` is better in this case.

http://stackoverflow.com/a/26953322
downvote count: 0
score: 4
answers question: http://stackoverflow.com/q/26953267
type: Answer
upvote count: 4
has body: I recommend to use CSS instead of JS for styling: $(function(){ $('#cart-target, #shoppingBag').hover(function() { $('#shoppingBag, .overlay, .icon-cart, .toggle__shoppingbag, .toolbar').addClass('myhoverclass'); }, function() { $('#shoppingBag, .overlay, .icon-cart, .toggle__shoppingbag, .toolbar').removeClass('myhoverclass'); }); }); css #shoppingBag.myhoverclass, .overlay.myhoverclass { visibility: visible; opacity: 1; } .icon-cart.myhoverclass { color: #cc181e; } .toggle__shoppingbag.myhoverclass { background-color: #131418; } .toolbar.myhoverclass { background-color: #0a0a0c; }

http://stackoverflow.com/comment/42368782
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26908586
type: AnswerComment
has text: Is there any specific reason not to use for objects or arrays?

http://stackoverflow.com/a/28758897
score: 0
answers question: http://stackoverflow.com/q/26928924
has body: Getting data in "resolve" attribute is the functionality of route (routeProvider) , not the functionality of controller. Key( is your case : 'data') in resolve attribute is injected as service. That's why we are able fetch data from that service. But to use same controller in different place , you have fetch data in controller.
type: Answer

http://stackoverflow.com/q/26902994
tagged with: ecmascript-6
tagged with: ecmascript-harmony
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/42357746
score: 4
favorite count: 0
has answer: http://stackoverflow.com/a/26903950
linked to: http://stackoverflow.com/q/28250680
has title: Promise chaining: Use result from previous promise in next then callback
answer count: 1
linked to: http://stackoverflow.com/q/20166033
duplicate of: http://stackoverflow.com/q/28250680
tagged with: promise
accepted answer: http://stackoverflow.com/a/26903950
type: AnsweredQuestion
has body: I'm using straight ES6 Promises (with the es6-promise polyfill library) and I'm running into a problem with accessing results from previous promises in chained ones. This problem is identical in the context of Angular/Q, but I'm dissatisfied with the answer and wanted to see if there's a better way: How to access result from the previous promise in AngularJS promise chain? Consider the code snippet below: Student.find().then(function(student) { return HelpRequest.findByStudent(student); }, function(error) { //... } ).then(function(helpRequest) { // do things with helpRequest... // PROBLEM: I still want access to student. How can I get access to it? }); In the chained promise, I want to use the student object that I got in the first promise. But as written, this can't access it. I have a couple apparent options: store the student in a variable in an outer scope (yuck) I actually don't know how this would work, but the solutions in the other question suggest I can call then on the result of HelpRequest.findByStudent() and Promise.resolve the combined result inside the Student.find().then call. The below implementation won't work I think, though. Student.find().then(function(student) { var data = {student: student}; HelpRequest.findByStudent(student).then(function(helpRequest) { data.helpRequest = helpRequest; }); // PROBLEM: if HelpRequest.findByStudent(student) is asynchronous, how // does this get the data before returning? return data; }, function(error) { //... } ).then(function(helpRequest) { // do things with helpRequest and student }); I absolutely don't want to do the processing of the helpRequest nested inside of the Student.find() method, as that defeats the purpose of chaining Promises; and even if the second example can be worked into a usable state, it still feels like a hack. Is there a better way to do achieve this without having to introduce global state or nesting into my code? For instance, is there a way to call Promise.resolve() on multiple values,…
has comment: http://stackoverflow.com/comment/42359090
type: Question
upvote count: 4

http://stackoverflow.com/a/26881070
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/26880661
has comment: http://stackoverflow.com/comment/42318336
score: 1
has comment: http://stackoverflow.com/comment/42318556
has body: The .fadeTo just changes the opacity of the element and children. There are other measures that need to be taken in order "disable" them. HTML: some content name some content name JS: This will keep the and content visible, but "disabled". $("#showdiv").on("click", function () { $('#div1').fadeTo("slow", 0.15, function () { $('#div1').children().prop('disabled',true); $('#div1 a').bind('click', false); }); $('#div2').show(); }); JSFiddle
type: Answer

http://stackoverflow.com/comment/42329509
has text: if thats the only difference just use document.getElementById('paper') instead of $("#paper")[0]; and u dont need jquery for that example.If you need lines to be drawed after first finishes *continiously* than i can make a fiddle for that
comment on: http://stackoverflow.com/q/26887351
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42482691
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26973551
has text: @Domi you can answer yourself with the solution you've found ;)

http://stackoverflow.com/q/26985431
tagged with: element
type: AnsweredQuestion
has body: I have a question like so. I have HTML structure: A1 (*) (Enter A1) A2 (*) (Enter A2) B1 (*) (Enter B1) B2 (*) (Enter B2) ... Now I want to selected 'span' has class "info" behind input[type=text] each. I try: Why is empty? Help me please. How do I, thanks
possible better answer: http://stackoverflow.com/a/26985831
has answer: http://stackoverflow.com/a/26985473
accepted answer: http://stackoverflow.com/a/26985473
type: Question
tagged with: javascript
score: 0
answer count: 2
tagged with: find
tagged with: jquery-selectors
has answer: http://stackoverflow.com/a/26985831
tagged with: jquery
has title: Jquery - find next element in each loop

http://stackoverflow.com/comment/42353446
score: 0
comment on: http://stackoverflow.com/q/26900445
type: Comment
type: QuestionComment
has text: Where is your user or your users inside of your controller? And in Angular, there isn't a need to reference this, since you should actually be referencing your injected $scope

http://stackoverflow.com/a/26955720
has comment: http://stackoverflow.com/comment/42451046
has comment: http://stackoverflow.com/comment/42451599
upvote count: 1
has body: There are couple of mistakes. 1. Need to get data using correct api 2. You haven't specified correct data in the second ajax call 3. You need to bind an change even to the make select box and then get the modal with second ajax call $.getJSON( "http://api.dataweave.in/v1/car_prices/listUniqMakes?api_key=596fd23588a0957f6ca0c190cff9b399630b0ec1", function( data ) { var items = []; $.each( data["data"], function( key, val ) { console.log(val['brand']); items.push( "&lt;option id='" + val["brand"] + "'&gt;" + val["brand"] + "&lt;/option&gt;" ); }); $( "&lt;select/&gt;", { "class": "my-new-list", "id" : "select1", html: items.join( "" ) }).appendTo( ".make" ); }).done(function(){ $('#select1').change(function(){ console.log($(this).val()); var make = $(this).val(); $.getJSON( 'http://api.dataweave.in/v1/carPricesIndia/findByMake/?api_key=b20a79e582ee4953ceccf41ac28aa08d&amp;make='+make+'&amp;city=Bangalore&amp;page=1&amp;per_page=10', function( data ) { var items_model = []; $.each( data["data"], function( key, val ) { console.log(val['model']); items_model.push( "&lt;option id='" + val["model"] + "'&gt;" + val["model"] + "&lt;/option&gt;" ); }); $( "&lt;select/&gt;", { "class": "my-new-list-1", "id" : "select2", html: items_model.join( "" ) }).appendTo( ".model" ); }); }); }); JSFIddle After OP requesting for another question You can get variant too like in the fiddle. You need to make the city as the first select box. Right now i have give banglore as static
has comment: http://stackoverflow.com/comment/42451098
accepted answer of: http://stackoverflow.com/q/26955378
downvote count: 0
has comment: http://stackoverflow.com/comment/42451034
has comment: http://stackoverflow.com/comment/42451147
answers question: http://stackoverflow.com/q/26955378
has comment: http://stackoverflow.com/comment/42451954
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42451286
score: 1
has comment: http://stackoverflow.com/comment/42451575
type: Answer

http://stackoverflow.com/q/26868795
has title: how get current position with Here map js 3 api?
tagged with: dictionary
score: 2
upvote count: 2
type: Question
type: AnsweredQuestion
tagged with: here-api
has answer: http://stackoverflow.com/a/26884617
accepted answer: http://stackoverflow.com/a/26884617
has body: how can getCurrentPosition with here map 3 api? var positioning = new nokia.maps.positioning.Manager(); // this code v2 positioning.getCurrentPosition();
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/42558450
type: AnswerComment
comment on: http://stackoverflow.com/a/26963221
has text: Thanks. I have it working now. For some reason only some of the images show Google, Yahoo,Amazon,Ebay and Wikipedia Don't show. I added a check which stopped the null errors. exports.getIcons = function(){ var engines = Services.search.getVisibleEngines(); var icons = new Array(); for (var i=0;i<engines.length;i++){ if(engines[i].iconURI) icons[i] =Services.search.getEngineByName(engines[i].name).iconURI.spec; } return icons; };
type: Comment
score: 0

http://stackoverflow.com/comment/42847655
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27133036
has text: From my PoV this is the best answer. You have suggested an approach which was not considered in the question.
score: 0

http://stackoverflow.com/a/26934696
answers question: http://stackoverflow.com/q/26934620
has body: You can only have 1 ID. document.getElementById('answer'); will get the first element it comes to. Advice Unless your students are in elementary school, I cannot advise that you should write a quiz like this; unless its more of an exercise to learn the right answer. If it's grading based on regurgitation, then there are too many ways for someone to happen upon the answer without having to read the question. See Fiddle function submitQuestion() { var possible_answers = document.getElementsByName('answer'); var selection; for (var i=0,n=possible_answers.length; i<n; i++){ if(possible_answers[i].checked === true){ selection = possible_answers[i].value; break; } } if (selection == 'C') { window.location = "correct.html"; } else { window.location = "wrong.html"; } return false; } Fixed HTML Syntax: 31.) As long as international businesses _________, Islamic countries are likely to be receptive to those businesses. A.) employ Muslim people B.) have property in an Islamic nation C.) behave in a manner that is consistent with Islamic ethics D.) adhere to Islamic beliefs A little more CSS: .myIndent { margin-left: 2em; margin-bottom: 2em; } .myIndent label { display:block; }
downvote count: 0
has comment: http://stackoverflow.com/comment/42413883
type: Answer
has comment: http://stackoverflow.com/comment/42414566
has comment: http://stackoverflow.com/comment/42416735
has comment: http://stackoverflow.com/comment/42414452
upvote count: 3
has comment: http://stackoverflow.com/comment/42413858
has comment: http://stackoverflow.com/comment/42414705
has comment: http://stackoverflow.com/comment/42416849
has comment: http://stackoverflow.com/comment/42414667
has comment: http://stackoverflow.com/comment/42414256
score: 3

http://stackoverflow.com/comment/48891111
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26924843
has text: possible duplicate of [Moment.js set the base time from the server](http://stackoverflow.com/questions/19629561/moment-js-set-the-base-time-from-the-server)

http://stackoverflow.com/q/26923002
has comment: http://stackoverflow.com/comment/42393613
has answer: http://stackoverflow.com/a/26930367
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/53477552
answer count: 4
has comment: http://stackoverflow.com/comment/42393951
type: Question
has title: jquery validation plugin not working with file
tagged with: javascript
tagged with: forms
score: 0
has answer: http://stackoverflow.com/a/26931479
has answer: http://stackoverflow.com/a/26923432
tagged with: validation
tagged with: jquery
has body: I'm using jquery validation plugin to validate a form. It is working if all fields are left blank. But if I entered a file in the input field and leave blank the other required fields it doesn't validate the other elements anymore it just submit the form to the server. Here's the form Title: News Image News Summary: News Full Story:

http://stackoverflow.com/comment/42342563
comment on: http://stackoverflow.com/a/26894034
has text: Thank you! I guess you're right. Because I've wrapped the other plunker in a timeout and it stops working. http://plnkr.co/edit/ivmGQmEHTatNzBWhppyf
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/26849884
tagged with: rest
possible better answer: http://stackoverflow.com/a/26850033
tagged with: python
has title: How to move from Django to REST-API/Thin Client?
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/26850033
has body: We are thinking to move away from Django and separate the backend and frontend. The backend is straight forward as I have done it plenty of times by exposing it as a Python RESTful API. Whats new to me is the thin client part. Theoretically I could just write HTML and plain javascript to talk to the API. Is there a macro-framework that would help me to achieve that? Beside AngularJS, what other thin client frameworks could I utilise without reinventing the wheel?
upvote count: 2
score: 0
answer count: 2
downvote count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/26850200
accepted answer: http://stackoverflow.com/a/26850200
has comment: http://stackoverflow.com/comment/42262471
favorite count: 0

http://stackoverflow.com/comment/42386153
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26916736
type: AnswerComment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/64900/discussion-between-howard-renollet-and-vicki).

http://stackoverflow.com/q/26979668
has answer: http://stackoverflow.com/a/27666399
has title: d3 word cloud specify individual word color
score: 4
possible better answer: http://stackoverflow.com/a/27666399
tagged with: d3.js
answer count: 2
accepted answer: http://stackoverflow.com/a/30189839
upvote count: 4
type: AnsweredQuestion
has body: I'm using the JD word cloud d3 library. I understand how to change the colors of the cloud. For that, I use the following code: ProductDetailView.prototype._drawCloud = function() { function draw(words) { var colors = [ '#3498DB', '#1478BB', '#00589B', '#54A8FB', '#74C8FF' ]; However, I want to be able to specify the color for certain words. It isn't clear to me how to do this, but I found an example on the net suggesting it is possible: http://community.qlik.com/message/265261#265261 Can anyone explain how I would specify the color of certain words in the cloud? For example, I want all the republicans in my cloud to be colored red. I know which words are republicans. How do I specify their color?
downvote count: 0
tagged with: javascript
tagged with: word-cloud
favorite count: 0
has answer: http://stackoverflow.com/a/30189839
tagged with: colors
type: Question

http://stackoverflow.com/comment/42496977
type: Comment
score: 0
comment on: http://stackoverflow.com/a/26981395
type: AnswerComment
has text: This is async code we are talking about. You may push something to server1, then update the database, then write something to a file, and finally move on with your app. If any of those async operations fail, you only have to write one fail handler. **Edit:** It's also a neat feature of promises that if you return a new promise, that becomes the "new" promise (for lack of a better way to describe it).

http://stackoverflow.com/a/26878907
type: Answer
has body: Deleted my other answer because it was too wordy. The reason your code is not working is because you are making an ajax request to a server, then returning from the function immediately. The page ploughs on with its scripting and probably finishes most if its work before that request comes back with your images. You need to move your return to a place in your function you know is not going to process until the data comes back. You can use promises to do this: var jqxhr = $.get( "example.php", function() { alert( "request sent, images are loading" ); // DON'T PUT YOUR RETURN HERE, //YOU WANT TO CALL IT WHEN THE ABOVE IS DONE }) .done(function() { alert( "the info is loaded" ); //put your html insert here to make sure the //data is fully loaded before you manipulate it //you could also call htmlresize here but that would be nesting. //That shit gets complicated. Just call it after this function returns on success. return }) .fail(function() { alert( "error" ); // its good to handle errors return }) if you dont want to hold up your whole page load to load some images you can do facny stuff like put the html resize and other dependent code on the jqxhr.sucess callback, so that other code gets read while your images come through. But that's complicated.
answers question: http://stackoverflow.com/q/26878588
score: 0

http://stackoverflow.com/q/26942146
possible better answer: http://stackoverflow.com/a/26942200
has comment: http://stackoverflow.com/comment/42428069
downvote count: 0
tagged with: setinterval
has answer: http://stackoverflow.com/a/26942215
tagged with: javascript
has comment: http://stackoverflow.com/comment/42428242
tagged with: jquery
has comment: http://stackoverflow.com/comment/42428190
favorite count: 0
has body: Why bind won't work after setInterval? var i = 0; $('.click').bind('click').click(function(){ var thisclick = $(this); var move = setInterval(function(){ if(i &lt; 30){ i++; thisclick.unbind('click'); } else{ thisclick.bind('click'); clearInterval(move); } },3000) })
has title: bind doesn't work after setInterval
answer count: 3
has answer: http://stackoverflow.com/a/26942575
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42428222
has comment: http://stackoverflow.com/comment/42427912
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/26942575
has comment: http://stackoverflow.com/comment/42428025
has answer: http://stackoverflow.com/a/26942200
score: 1
has comment: http://stackoverflow.com/comment/42427898

http://stackoverflow.com/comment/42429286
type: Comment
comment on: http://stackoverflow.com/a/26942769
score: 0
type: AnswerComment
has text: Not here, chrome version Version 38.0.2125.111 m

http://stackoverflow.com/a/26923151
has body: Something like this? _.each(result.document[people], function(item) { _.each(item, function(item, key) { console.log(key); }); }); _.each sends in a second key parameter to the callback function in the case of objects.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26922957

http://stackoverflow.com/q/26969271
has title: Modular JavaScript - are there any approaches apart CommonJS and AMD to consider?
has comment: http://stackoverflow.com/comment/42671234
has comment: http://stackoverflow.com/comment/42788039
has answer: http://stackoverflow.com/a/27080069
has comment: http://stackoverflow.com/comment/42652267
has body: I'm currently preparing an evaluation JavaScript modularization approaches for my corp. We are in process of defining "JavaScript Best Practices" for our projects, modularization is one of the central questions. From my research so far revealed two leading approaches: amd commonjs With a huge number of loaders, plugins, libraries etc. around them. Apart from that there's also goog.provide/goog.require from the Google Closure Library. Are there further approaches to consider? Any important/relevant specs I missed? Our requirements, briefly: Structure JavaScript code in separate files. Load relevant modules in the runtime. ...without having to include every single file as script tag. Must not be necessary to maintain an index of JavaScript files. Support aggregation and minification - ability to build and use a single minified/optimized JavaScript file. Be able to use modules in different combinations - there are often different web pages/clients which need different subsets of modules. Supporting documentation (with JSDoc?). Suitable for testing. Suitable for web, cross-browser. Reasonable IDE support. Potentially: Aligned with ES6 modules. Suitable for Node.js and mobile platforms (like PhoneGap/Cordova). New suggestions from answers: ecmascript-harmony plus extra compiler. angularjs (see the note below). extjs (see the note below). Side notes: The question is not about which approach is better. I am not asking for specific libraries and tools, but rather for approaches and specifications. I am not specifically asking for an off-site resource. (If there's no SO tag for this, it's probably not reasonable for us to consider it.) A note on frameworks like angualjs or extjs. This is not really suitable in the frame of this quesion. If the project needs a framework (be it AngularJS or ExtJS) then there's mostly no modularization question as the framework must deliver modularization OOTB. If the project does not need a framework, it is an overkill to bring a framework bec…
tagged with: amd
has answer: http://stackoverflow.com/a/27148301
has comment: http://stackoverflow.com/comment/42670499
has answer: http://stackoverflow.com/a/27079931
has answer: http://stackoverflow.com/a/27142133
tagged with: commonjs
answer count: 7
accepted answer: http://stackoverflow.com/a/27133036
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27079931
tagged with: modular
favorite count: 0
has answer: http://stackoverflow.com/a/27080578
has comment: http://stackoverflow.com/comment/42670961
has comment: http://stackoverflow.com/comment/42673169
has comment: http://stackoverflow.com/comment/42476067
tagged with: modularization
upvote count: 13
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42785088
has comment: http://stackoverflow.com/comment/42791453
downvote count: 2
has comment: http://stackoverflow.com/comment/42673208
has comment: http://stackoverflow.com/comment/42785432
score: 11
has comment: http://stackoverflow.com/comment/42673228
has answer: http://stackoverflow.com/a/27133036
type: Question
has answer: http://stackoverflow.com/a/27162707

http://stackoverflow.com/comment/42393546
type: Comment
type: QuestionComment
has text: I see what you're saying. The cursor was going outside of the element I was dragging and that was causing the problem. I needed to bind the `mousemove` handler to a larger parent element, such as `body`.
comment on: http://stackoverflow.com/q/26922917
score: 0

http://stackoverflow.com/comment/42356611
has text: so proven that you already get your `$page_number`, now the processing inside might be another question, I notice there is a jquery plugin you were trying with your pagination. Would you able to tell us what's the plugin you used?
comment on: http://stackoverflow.com/a/26899895
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/26916582
tagged with: javascript
has comment: http://stackoverflow.com/comment/42381766
score: 0
has body: Is there any way to get know exact position and visible size of the html element inside the browser window relative to the entire display. I'm not interresting in the absolute position inside the HTML document. My task is to make automated screenshot of the HTML element as it is represented on the display. Any help is highly appreciated.
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42381790
has title: Absolute html element position inside the browser relative to display
linked to: http://stackoverflow.com/q/442404
type: UnansweredQuestion
answer count: 0
type: Question

http://stackoverflow.com/comment/42399774
score: 0
comment on: http://stackoverflow.com/q/26926672
type: Comment
type: QuestionComment
has text: Sorry, that would be difficult for me. It is a part of an application, I am not permiited to share online. But I just shared my observation, keeping in mind that many of us around might have faced something similar and are aware why this happens.

http://stackoverflow.com/a/26964592
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/42467401
has body: This should solve your problem: Fiddle illustrating fix You're setting your background image in a div that's getting higher stacking priority based on document flow, so it's overlapping your subsequent divs. Here's the CSS I added to solve the problem: .container &gt; div.background-image { z-index: 1; } .container &gt; div { position: relative; z-index: 2; } There are better ways to do this (i.e. not creating a separate div for a background image), but this will solve your issue without major changes to document structure. All credit to http://placehold.it for the placeholder image. It's a life-saver if you're going to be solving CSS issues on StackOverflow.
has comment: http://stackoverflow.com/comment/42467370
downvote count: 0
answers question: http://stackoverflow.com/q/26964434
type: Answer

http://stackoverflow.com/q/26928924
has answer: http://stackoverflow.com/a/26929325
has answer: http://stackoverflow.com/a/29393815
favorite count: 0
has body: I've ran into problem with ng-controller and 'resolve' functionality: I have a controller that requires some dependency to be resolved before running, it works fine when I define it via ng-route: Controller code looks like this: angular.module('myApp') .controller('MyController', ['$scope', 'data', function ($scope, data) { $scope.data = data; } ] ); Routing: ... .when('/someUrl', { templateUrl : 'some.html', controller : 'MyController', resolve : { data: ['Service', function (Service) { return Service.getData(); }] } }) ... when I go to /someUrl, everything works. But I need to use this controller in other way(I need both ways in different places): &lt;div ng-controller="MyController"&gt;*some html here*&lt;/div&gt; And, of course, it fails, because 'data' dependency wasn't resolved. Is there any way to inject dependency into controller when I use 'ng-controller' or I should give up and load data inside controller?
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/38394686
downvote count: 0
score: 19
has answer: http://stackoverflow.com/a/29384967
linked to: http://stackoverflow.com/q/15083675
has comment: http://stackoverflow.com/comment/70223287
type: Question
answer count: 8
has answer: http://stackoverflow.com/a/29385426
has comment: http://stackoverflow.com/comment/46935256
has answer: http://stackoverflow.com/a/28758897
linked to: http://stackoverflow.com/q/28868373
tagged with: javascript
upvote count: 19
has answer: http://stackoverflow.com/a/29389750
has title: Angularjs ng-controller with resolve
has answer: http://stackoverflow.com/a/29335947

http://stackoverflow.com/comment/46799824
comment on: http://stackoverflow.com/a/27065365
has text: You're absolutely right! I remember now, for some reason the "for-in" loop also accessed the properties that were stored when calling 'getElementsByClassName", which is why it was breaking.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42481036
comment on: http://stackoverflow.com/a/26972484
score: 0
type: AnswerComment
has text: i wrote it like below in code but didn't work. var data = google.visualization.arrayToDataTable([ ['x', 'y'], [<?php echo json_encode(array($x,$y)) ?>], ]);
type: Comment

http://stackoverflow.com/a/27132119
type: Answer
accepted answer of: http://stackoverflow.com/q/26969618
score: 0
type: AcceptedAnswer
has body: Well, Eventually I found another way to pass strings: this.WPFWindow.InvokeScript ("WriteFromExternal", new object [] {"this string is passed to WriteFromExternal"}); and in JS: function WriteFromExternal(message) { alert("Message from C#: " + message); } And it worked :) Thank you all.
answers question: http://stackoverflow.com/q/26969618

http://stackoverflow.com/q/26945452
score: 2
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/26945501
has title: What do you call the multi-window slider effect in Windows 7
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: What would you call the slider effect when you press Windows + Tab key in Windows 7, and it displays layers of windows which can be scrolled through? What do you call this 3D transition in terms of jQuery? (Like fade in, fade out) Any reference would help. Thanks.
favorite count: 0
upvote count: 2
has answer: http://stackoverflow.com/a/26945501
tagged with: css

http://stackoverflow.com/comment/42243692
has text: Please add your code
comment on: http://stackoverflow.com/q/26839641
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42238534
comment on: http://stackoverflow.com/q/26836280
type: Comment
type: QuestionComment
score: 0
has text: `alert` only takes one argument, so the second will be ignored.

http://stackoverflow.com/a/26923233
has comment: http://stackoverflow.com/comment/42404807
score: 0
has comment: http://stackoverflow.com/comment/42412509
has comment: http://stackoverflow.com/comment/42404541
has comment: http://stackoverflow.com/comment/42414368
has body: It is trivial to get the length as shown in the 2 methods below, but it is impossible in general case to get the start and end index of the text captured by a capturing group. The first method with String.match, for non-global RegExp only: // reNonGlobal can be a variable containing RegExp object // or a RegExp object directly specified. var result = inputString.match(reNonGlobal); if (result != null) { console.log(result[groupNumber].length); } The second method with RegExp.exec, for any RegExp: var arr; // The RegExp object must be assigned to a variable var re = ...; if (re.global) { while ((arr = re.exec(inputString)) != null) { console.log(arr[groupNumber].length); // lastIndex is not advanced when empty string is matched // Need to manually advance it to prevent infinite loop if (arr[0].length == 0) { re.lastIndex += 1; } } } else { if ((arr = re.exec(inputString)) != null) { console.log(arr[groupNumber].length); } } Using indexOf (or any other method) to locate the index of the captured text is unreliable, and dependent on particular regex and/or input.
has comment: http://stackoverflow.com/comment/42413157
type: Answer
answers question: http://stackoverflow.com/q/26923015
has comment: http://stackoverflow.com/comment/42412812

http://stackoverflow.com/comment/42275437
has text: @Jared does this meet your requirements or are there any other issues I'm not aware of?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26837413

http://stackoverflow.com/comment/42409369
score: 0
type: AnswerComment
has text: Added it to my answer!
type: Comment
comment on: http://stackoverflow.com/a/26932167

http://stackoverflow.com/tag/svg
tags question: http://stackoverflow.com/q/26836295
tags question: http://stackoverflow.com/q/26944855
tags question: http://stackoverflow.com/q/26937171
tags question: http://stackoverflow.com/q/26867641
tags question: http://stackoverflow.com/q/26916818
tags question: http://stackoverflow.com/q/26926561
tags question: http://stackoverflow.com/q/26939183
tags question: http://stackoverflow.com/q/26961189
tags question: http://stackoverflow.com/q/26934979
tags question: http://stackoverflow.com/q/26938614
tags question: http://stackoverflow.com/q/26845070
tags question: http://stackoverflow.com/q/26984511
tags question: http://stackoverflow.com/q/26976396
tags question: http://stackoverflow.com/q/26963556
tag name: svg
tags question: http://stackoverflow.com/q/26954751
tags question: http://stackoverflow.com/q/26924989
tags question: http://stackoverflow.com/q/26869088
tags question: http://stackoverflow.com/q/26991626
tags question: http://stackoverflow.com/q/26897997
tags question: http://stackoverflow.com/q/26903285
tags question: http://stackoverflow.com/q/26832477
tags question: http://stackoverflow.com/q/26990886
tags question: http://stackoverflow.com/q/26981020
tags question: http://stackoverflow.com/q/26977351
tags question: http://stackoverflow.com/q/26899886
tags question: http://stackoverflow.com/q/26833977
tags question: http://stackoverflow.com/q/26876703
tags question: http://stackoverflow.com/q/26942111
tags question: http://stackoverflow.com/q/26835036
tags question: http://stackoverflow.com/q/26991581
tags question: http://stackoverflow.com/q/26887143
tags question: http://stackoverflow.com/q/26970974
tags question: http://stackoverflow.com/q/26850265
tags question: http://stackoverflow.com/q/26864084
tags question: http://stackoverflow.com/q/26889891
tags question: http://stackoverflow.com/q/26864235
tags question: http://stackoverflow.com/q/26866830
tags question: http://stackoverflow.com/q/26966736
tags question: http://stackoverflow.com/q/26958517
tags question: http://stackoverflow.com/q/26877497
tags question: http://stackoverflow.com/q/26956778
tags question: http://stackoverflow.com/q/26960010
tags question: http://stackoverflow.com/q/26962600
type: Tag

http://stackoverflow.com/q/26903077
answer count: 1
favorite count: 0
tagged with: sockets
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
tagged with: javascript
has body: I want to verify using Node.js whether a certain port is reachable or not. Basically, what I did is write the following program: var net = require('net'); var client = new net.Socket(); client.connect(3003, 'localhost'); client.on('error', function (err) { console.log(err); process.exit(); }); client.once('connect', function () { console.log('Connected!'); process.exit(); }); So far, this pretty much works fine. There is only one thing I'm not happy with, and that is the timeout handling. Locally it works as expected, but when I try client.connect(81, 'www.google.de'); it takes up to two minutes until I get a timeout. Why is that happening, and what can I do against it? PS: I know that there is the setTimeout function for sockets in Node.js, but either it does not what I think it should, or I am using it wrong.
has title: Lower timeout for Node.js socket connection
has answer: http://stackoverflow.com/a/26903251
accepted answer: http://stackoverflow.com/a/26903251
upvote count: 1

http://stackoverflow.com/a/26923239
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26922894
has body: check this solution: http://jsfiddle.net/66hjjp40/2/ changes in: function create_row() $('.reseller-select').change $('.reseller-name').keyup
accepted answer of: http://stackoverflow.com/q/26922894
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/42394048
has comment: http://stackoverflow.com/comment/42393852

http://stackoverflow.com/comment/42482997
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26973831
has text: The angular.touch API supports only swipe and click. You can implement your own double tap directive :)

http://stackoverflow.com/comment/42325401
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/26884985
has text: Please tell what response are you getting??

http://stackoverflow.com/q/26890841
type: Question
has title: How to extract URL parameters with jquery
has answer: http://stackoverflow.com/a/26890953
upvote count: 0
accepted answer: http://stackoverflow.com/a/26891014
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/1822598
duplicate of: http://stackoverflow.com/q/1822598
tagged with: http://stackoverflow.com/tag/html
has body: I have somes links like this: mywebsite.com/tutos.php?name=tuto_name#comments mywebsite.com/tutos.php?name=tuto_name#download My question: how to get the text after the #. thanks.
favorite count: 0
has comment: http://stackoverflow.com/comment/42335548
possible better answer: http://stackoverflow.com/a/26890982
has answer: http://stackoverflow.com/a/26890982
tagged with: php
has answer: http://stackoverflow.com/a/26891014
downvote count: 1
answer count: 4
has answer: http://stackoverflow.com/a/26890980
type: AnsweredQuestion
score: -1

http://stackoverflow.com/comment/42506557
type: QuestionComment
has text: Are the two lines at the bottom part of shop_list.php? Are the other lines part of a different page?
comment on: http://stackoverflow.com/q/26986810
score: 0
type: Comment

applescript
tags question: http://stackoverflow.com/q/26888523
type: Tag
tag name: applescript

umbraco7
type: Tag
tag name: umbraco7
tags question: http://stackoverflow.com/q/26981964

http://stackoverflow.com/q/26835644
has answer: http://stackoverflow.com/a/26835721
has answer: http://stackoverflow.com/a/26835711
has title: Checking word validity via a dictionary object in JavaScript - Is there a better way to reference/structure the dictionary?
linked to: http://stackoverflow.com/q/26836921
tagged with: dictionary
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
has comment: http://stackoverflow.com/comment/42237132
tagged with: javascript
linked to: http://stackoverflow.com/q/26833922
answer count: 2
accepted answer: http://stackoverflow.com/a/26835721
has comment: http://stackoverflow.com/comment/42237250
has comment: http://stackoverflow.com/comment/42237174
upvote count: 1
has comment: http://stackoverflow.com/comment/42237234
has comment: http://stackoverflow.com/comment/42237188
has comment: http://stackoverflow.com/comment/42237236
favorite count: 0
has comment: http://stackoverflow.com/comment/42237220
possible better answer: http://stackoverflow.com/a/26835711
has body: I'm checking whether a word is real or not by referencing an object that looks like this: dictionary.js var dictionary = { "apple" : "apple", "banana" : "banana", "orange" : "orange" } In JavaScript, because of the keys, the checking is "instant" (I forget the name of the lower-level phenomena in data storage that makes this possible) (hash table), rather than looping through the whole object to find a match: if (dictionary["apple"]){ //word is valid } But what bothers me about this is that each word is listed twice, when the value of each property's key is never used. The property's key (name) is the only thing checked, with the value being redundant. This bothers me because for one thing, redundancy in programming looks very bad, and also this dictionary array holds over 100,000 words, and this object which must be loaded to the page (page load time) and then stored in memory (RAM being utilized) as an object is twice the necessary size. My first idea is to just remove the values: var dictionary = { "apple" : "", "banana" : "", "orange" : "" } But that looks weird. So, my question is: Is there a better way to do this?

http://stackoverflow.com/comment/42318152
type: QuestionComment
score: 0
has text: So you want to test if the entered ID only has alphanumerical chars?
comment on: http://stackoverflow.com/q/26880499
type: Comment

http://stackoverflow.com/a/66175028
downvote count: 0
score: 5
has body: I couldn't make it work by disabling turbolinks or with the event listener so the solution I found, in serendipity, was adding tinymce.remove() and I had console errors because content and skins skin: false, content_css: false My example code: import tinymce from 'tinymce/tinymce' import 'tinymce/plugins/table'; import 'tinymce/plugins/lists'; import 'tinymce/themes/silver/theme' import 'tinymce/icons/default/icons' import 'tinymce/skins/ui/oxide/skin.min.css' import 'tinymce/skins/ui/oxide/content.min.css' import 'tinymce/skins/content/default/content.css' function tinyMce() { tinymce.remove(); tinymce.init({ selector: 'textarea#default', // change this value according to your HTML height: 400, plugin: 'a_tinymce_plugin', a_plugin_option: true, a_configuration_option: 400, skin: false, content_css: false })} export { tinyMce }; Note that I'm using rails 6 and webpacker so your solution might vary
answers question: http://stackoverflow.com/q/26962995
upvote count: 5
type: Answer

http://stackoverflow.com/comment/42415412
type: Comment
comment on: http://stackoverflow.com/a/26934360
has text: I had to downgrade to 1.6 for IE8 support.
type: AnswerComment
score: 0

http://stackoverflow.com/q/26929054
has body: I am working with firebase to get data from the nest api. I had a working test setup where I was able to receive data, and set values. Now I am working in python to get a little server running that automatic updates my database. I had data a few days back. But today I wanted to work on it, and i didn't receive any data anymore. So I checked my test setup. And that one is neither getting any data, But I am still able to send data. This is the javascript I use for my test setup. var dataRef = new Firebase('wss://developer-api.nest.com/'); dataRef.authWithCustomToken("{{user.token}}", function(error, authData) { if (error) { console.log("Login Failed!", error); } else { console.log("Login Succeeded!", authData); } }); dataRef.on('value', function(snapshot){ console.log(snapshot.val()); }); It should work. But can it be that something broke with the update? I also created an new client but that did not work either. An other python application that i am running with nest is using the websocket-client an that one still works. But for the application i am now working on i need to get data from different accounts. If i use the websocket-client it wil use to much resources. so that is not an option. Hope someone can help me.
type: UnansweredQuestion
tagged with: python
tagged with: firebase
has title: Getting data from nest api not working anymore
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/26936872
tagged with: nest-api
score: 0
answer count: 1

http://stackoverflow.com/q/26926502
type: AnsweredQuestion
score: 1
has body: In my code after sending a request to a JSP page using an AJAX call, it does not show the result in the &lt;div&gt; tag. Id of my &lt;div&gt; tag is "div1". Control is passed to the JSP page. After processing the JSP page, the value in responseText is not displayed in the &lt;div&gt; tag. I don't understand the reason. I am hereby attaching the code ... and also can i add events to the tags on "new.jsp" file? &lt;%-- Document : Databases Created on : Nov 10, 2014, 3:08:01 PM Author : user --%&gt; &lt;%@page import="java.sql.PreparedStatement"%&gt; &lt;%@page import="java.sql.DatabaseMetaData"%&gt; &lt;%@page import="java.sql.ResultSet"%&gt; &lt;%@page import="querywork.DBConnection"%&gt; &lt;%@page import="java.sql.Statement"%&gt; &lt;%@page import="java.sql.DriverManager"%&gt; &lt;%@page import="java.sql.Connection"%&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt; &lt;title&gt;Untitled Document&lt;/title&gt; &lt;script language="javascript" type="text/javascript"&gt; try { function create(str) { var xmlHttp xmlHttp=CreateXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="new.jsp" url=url+"?dbname="+str url=url+"&amp;sid="+Math.random() // out.print(url) xmlHttp.onreadystatechange=stateChanged xmlHttp.open("GET",url,true) xmlHttp.send() } function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("div1").innerHTML=xmlHttp.responseText } } function CreateXmlHttpObject() { var objXMLHttp=null if (window.XMLHttpRequest) { objXMLHttp=new XMLHttpRequest() } else if (window.ActiveXObject) { objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") } return objXMLHttp } } catch(err) {} &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" name=…
type: Question
tagged with: java
tagged with: javascript
has answer: http://stackoverflow.com/a/26926606
accepted answer: http://stackoverflow.com/a/26926606
has comment: http://stackoverflow.com/comment/42400086
upvote count: 1
downvote count: 0
answer count: 1
tagged with: jsp
has title: Div tag doesn't show any result
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/42399437

getelementbyid
tags question: http://stackoverflow.com/q/26923023
tags question: http://stackoverflow.com/q/26900095
tags question: http://stackoverflow.com/q/26844196
tags question: http://stackoverflow.com/q/26951261
type: Tag
tag name: getelementbyid
tags question: http://stackoverflow.com/q/26848289

http://stackoverflow.com/q/26862331
has title: In Meteor using #each, check if 'last' element in the collection reached
downvote count: 0
tagged with: meteor
has comment: http://stackoverflow.com/comment/42421099
has comment: http://stackoverflow.com/comment/42305673
favorite count: 0
has answer: http://stackoverflow.com/a/31664610
upvote count: 8
has answer: http://stackoverflow.com/a/27036537
type: Question
answer count: 3
tagged with: spacebars
has answer: http://stackoverflow.com/a/29609484
score: 8
has body: I'm iterating through a collection in Meteor using {{#each}} and I would like to know if I'm in the last element, as I can do in AngularJS while using ngRepeat with $last. It could be used, for example to construct human readable enumerations like 'I like cats, dogs and dolphins' : Template.myTemplate.helpers({ likedAnimals: function(){return ['dogs','cats','dolphins'];} }); &lt;template name='myTemplate'&gt; I like {{#each likedAnimals}} {{#if !$first &amp;&amp; !$last}}, {{/if}} {{#if $last}} and {{/if}} {{this}} {{/each}} &lt;/template&gt; Is there any way to check this condition in Meteor?
tagged with: javascript
type: UnansweredQuestion
tagged with: meteor-blaze

http://stackoverflow.com/q/26971148
accepted answer: http://stackoverflow.com/a/26982222
tagged with: javascript
tagged with: jquery
has title: Can an MVC @helper be called from Javascript?
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/42478229
favorite count: 0
has comment: http://stackoverflow.com/comment/42478171
tagged with: asp.net-mvc-4
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/42478534
score: 1
has body: As per the title, can an MVC @helper function be called from javascript/JQuery? @helper DoStuff(string someValue) { //do some stuff } then later on: $("#MyDropdown").on("change", function() { @DoStuff('blah') });
type: Question
has answer: http://stackoverflow.com/a/26982222

http://stackoverflow.com/q/26908003
has title: add mousewheel eventlistener error
has answer: http://stackoverflow.com/a/26908115
has comment: http://stackoverflow.com/comment/42366811
tagged with: function
answer count: 1
downvote count: 0
tagged with: events
accepted answer: http://stackoverflow.com/a/26908115
favorite count: 0
has body: Here is the problem : i have a function, which should return nothing... it is called : function zoom(event){ alert("wheel delta : "+event.wheelDelta); return false; } on click on my element, i try to add an event listener on mousewheel this way : element.addEventListener("mousewheel",zoom,false); element is a svg tag. but, function zoom is never called, i only get this message back : TypeError: Argument 2 of EventTarget.addEventListener is not an object. what am I doing wrong? Thanks for help :) EDIT : here is the whole code : function ZoomMain(){ var zoom = 0; var main; var clicks = 0; this.click = function(event,svg){ if(svg){ switch(clicks%2){ case 0 : main = svg; main.addEventListener("mousewheel",zoom,false); clicks++; break; case 1 : main.removeEventListener("mousewheel",zoom,false); clicks++; break; } }else{ alert("ERROR"); } }; function zoom(event){ alert("wheel delta : "+event.wheelDelta); return false; } }
has comment: http://stackoverflow.com/comment/42366952
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: mousewheel
tagged with: addeventlistener
tagged with: javascript

http://stackoverflow.com/a/63801418
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/26909200
score: 1
has body: I came across this question looking for something else, and yes, I am aware that the question was posed nearly 6 years ago. The most advanced version of JavaCC is JavaCC21. and JavaCC21 does allow negative syntactic lookahead. In JavaCC21 you would write LOOKAHEAD(~&lt;LBRACE&gt;) to specify that you only enter the expansion that follows if the next token is not an LBRACE, for example. The ~ character negates the lookahead expansion and you can use it to negate more complex expansions than a single token, if you want to. For example: LOOKAHEAD (~(&lt;LBRACE&gt;|&lt;LPAREN&gt;)) There are actually quite a few other features that JavaCC21 that are not present in the legacy JavaCC project. Here is a biggie: the longstanding bug in which nested syntactic lookahead does not work correctly has been fixed. See here.

http://stackoverflow.com/a/26934707
type: AcceptedAnswer
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/42478829
has comment: http://stackoverflow.com/comment/42414745
downvote count: 0
score: 1
has body: As you only really care when you complete editing a value, you can use the jQuery focusout event. This tends to be more reliable that the standard blur event. Validating on change can get irritating for the user if it fires too often: JSFiddle: http://jsfiddle.net/TrueBlueAussie/ddc1jgp2/5/ $(function () { $("#newMonoReading").on('focusout', function () { var str = ""; var initialMonoReading = $('#InitialMonoReading').val(); var newMonoReading = $('#newMonoReading').val() if (~~newMonoReading &lt; ~~initialMonoReading) { $('#MonoErrorMessage').text("New Readings must be less than existing"); $('#MonoErrorMessage').show(); } else { $('#MonoErrorMessage').hide(); } }); }); You may actually want to do your check when either input changes, and focusout supports a parent element, so try this if you want either input change to validate: JSFiddle: http://jsfiddle.net/TrueBlueAussie/ddc1jgp2/6/ $(function () { $("#parent").on('focusout', function () { var str = ""; var initialMonoReading = $('#InitialMonoReading').val(); var newMonoReading = $('#newMonoReading').val() if (~~newMonoReading &lt; ~~initialMonoReading) { $('#MonoErrorMessage').text("New Readings must be less than existing"); $('#MonoErrorMessage').show(); } else { $('#MonoErrorMessage').hide(); } }); }); Notes: You are comparing strings for collation order "a" &lt; "b" etc. Convert to integer values. ~~ is a shortcut faster conversion of strings to integers. You can also use parseInt() if you prefer (with the radix of 10 specified). I had to mockup the HTML based on best guess of the generated element. The first example could just use $(this).val() instead of $('#newMonoReading').val() as that is the current this element. Ignore any comments about not using a DOM ready handler as that will make zero difference and is good practice.
accepted answer of: http://stackoverflow.com/q/26933041
answers question: http://stackoverflow.com/q/26933041
has comment: http://stackoverflow.com/comment/42414680

http://stackoverflow.com/comment/42366811
comment on: http://stackoverflow.com/q/26908003
has text: Can you show how 'ZoomMain` is consumed and where you are attaching `this.click` to click event handler. A brief of your plan is also appreciated :)
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/42484276
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/26974647
type: Comment
has text: Oh common this cannot be an answer you ought to post this on comment.

http://stackoverflow.com/q/26979565
answer count: 2
tagged with: validation
possible better answer: http://stackoverflow.com/a/26980287
tagged with: http://stackoverflow.com/tag/html
has title: Multiple validation rules on html form
type: AnsweredQuestion
tagged with: forms
type: Question
has body: I have an html form that resembles the following code. My problem is I want to validate based on multiple criteria... a number can either be 0 OR it must be greater than 700. I'm using an array for the input names which is making it tough for me to get a javascript solution working. How would one go about validating in this case with the multiple critera? &lt;form name="endingweights" method="post"&gt; &lt;input type="hidden" value="1" name="strain[]"&gt;&lt;/td&gt;&lt;td&gt;&lt;input type="number" step="any" name="ending[]" min="0" max="1500" required /&gt; &lt;input type="hidden" value="2" name="strain[]"&gt;&lt;/td&gt;&lt;td&gt;&lt;input type="number" step="any" name="ending[]" min="0" max="1500" required /&gt; &lt;input type="hidden" value="3" name="strain[]"&gt;&lt;/td&gt;&lt;td&gt;&lt;input type="number" step="any" name="ending[]" min="0" max="1500" required /&gt;
has comment: http://stackoverflow.com/comment/42493542
has answer: http://stackoverflow.com/a/26980287
tagged with: javascript
has answer: http://stackoverflow.com/a/26980198
accepted answer: http://stackoverflow.com/a/26980198
score: 0

http://stackoverflow.com/comment/42558611
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26963221
type: AnswerComment
has text: Oh so you had a loop that was going through to get the icons and when it would come across an engine with no icon it would error out of the loop so you would get null for the remaining icons?

http://stackoverflow.com/q/26894475
has comment: http://stackoverflow.com/comment/42342658
answer count: 1
tagged with: javascript
has title: Regex look-behinds in textcomplete.js
has answer: http://stackoverflow.com/a/26894639
favorite count: 0
tagged with: regex
type: UnansweredQuestion
has body: I have textcomplete.js plugin, that search all content after @...., with this regex: /\B@([\-+\w]*)$/ I return text in span like this: &lt;span contenteditable="false" class="highlight"&gt;@example&lt;/span&gt;&amp;nbsp; And in my text in web page I see it like this: @example | ( | -> place of my cursor ) If go back with cursor like this: @example| textcomplete fires and show me drop down, but i don't need it, so i try to find way, to change my regex, so that it doesn't find @text when it starts with &lt;span&gt;@text I try this, in regex online, it works: /\B^(?!\&gt;)@([\-+\w]*)$/ But in my project doesn't work. I tried something like this, but this is a bit too hard for me Can anyone help me? EDITED: In few words I want to find regex expression , that finds this: @exampletext But don't find this: &lt;span&gt;@exampletext When cursor is behind last character of the word
downvote count: 2
has comment: http://stackoverflow.com/comment/42342905
has comment: http://stackoverflow.com/comment/42343675
type: Question
has comment: http://stackoverflow.com/comment/42342657
tagged with: regex-lookarounds
upvote count: 0
score: -2

http://stackoverflow.com/a/26847193
has comment: http://stackoverflow.com/comment/42258859
accepted answer of: http://stackoverflow.com/q/26847077
has body: Don't output anything except one valid json string. In your case you do that by replacing the echo's with building an array (or object...) and output that at the very end: For example: $data = array(); foreach($memo_data as $v){ foreach($user_data as $m){ if($v['memo_code'] == $m){ $data[] = " User: " .$m. " Time: " . $v['avg_handle_time'] . "&lt;br&gt;"; } elseif( $v['memo_code'] != $m){ $data[] = "User: " . $m . " Time: N/A &lt;br&gt;"; } } } // Output your json string echo json_encode($data); Note that I have simply replaced your echos with an assignment but you could also add arrays in your array to return just the data parts and process that afterwards in javascript. For example (this would depend a bit on your exact data structure...): ... $data[] = array($m, $v['avg_handle_time']); ...
type: Answer
has comment: http://stackoverflow.com/comment/42258805
upvote count: 3
has comment: http://stackoverflow.com/comment/42259421
score: 3
has comment: http://stackoverflow.com/comment/42258251
has comment: http://stackoverflow.com/comment/42262922
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26847077
has comment: http://stackoverflow.com/comment/42258322

http://stackoverflow.com/comment/42272929
comment on: http://stackoverflow.com/q/26855002
score: 0
has text: It seems the text it's not changing :( http://jsfiddle.net/ap7ww94p/6/
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26911495
tagged with: rest
accepted answer: http://stackoverflow.com/a/26947580
favorite count: 0
has body: I want to have a route like this in my config/routes.js '*' : { controller: 'CustomRoutes', action: 'any', skipAssets:true } The CustomRoutes controller handles my custom routes. The any action simply returns a static html page. This obviously doesn't work because it overrides my blueprint routes. Is there a way to have this route skip blueprint routes (like the skipAssetsproperty) or could I set my blueprint routes to a higher priority than the routes in config/routes.js all together? I would prefer to not use a prefix in config/blueprints.js because though I could use a regex expression to by-pass the blueprint routes, I would have to add the prefix all my client-side code.
upvote count: 2
type: AnsweredQuestion
score: 2
tagged with: sails.js
tagged with: routes
has answer: http://stackoverflow.com/a/26947580
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
has title: sailsjs - process blueprint routes before config/routes
tagged with: express

http://stackoverflow.com/q/26861119
score: 0
answer count: 1
has body: I have this in a mysql <?php echo " Select Person: ";?> <?php while ($row=mysqli_fetch_array($result, MYSQL_ASSOC)) { echo " ".$row['fName']." ".$row['lName']." "; } ?> but then something got chopped. It displays as "For" but when I checked it, it is supposedly "For Select" .. And the script: My script is providing drop down dynamically but wonder why it is chopped. And the second, how to embed an tag in a custom data attributes? And my L A B ... It's almost 1 week already, please help. I have uprooted my hair, almost gone now.. lol
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26862002
tagged with: mysql
has title: Custom data attributes, chopped and embed a
type: Question
has answer: http://stackoverflow.com/a/26862002
tagged with: javascript

http://stackoverflow.com/a/26871200
answers question: http://stackoverflow.com/q/26871106
type: AcceptedAnswer
upvote count: 67
type: Answer
score: 67
has comment: http://stackoverflow.com/comment/111721817
has comment: http://stackoverflow.com/comment/42300905
downvote count: 0
has comment: http://stackoverflow.com/comment/93071073
accepted answer of: http://stackoverflow.com/q/26871106
has comment: http://stackoverflow.com/comment/111721170
has body: You can use Array.every to check if all elements are strings. const isStringsArray = arr =&gt; arr.every(i =&gt; typeof i === "string") console.log( isStringsArray(['a','b','c']), isStringsArray(['a','','c']), isStringsArray(['a', ,'c']), isStringsArray(['a', undefined,'c']), isStringsArray(['a','b',1]) )

http://stackoverflow.com/a/26872926
type: Answer
has comment: http://stackoverflow.com/comment/42304747
downvote count: 0
has comment: http://stackoverflow.com/comment/42304214
answers question: http://stackoverflow.com/q/26872249
has comment: http://stackoverflow.com/comment/42304188
score: 1
has body: How constrained are you in your design? Typically when i'm approaching a form that needs to dynamically grow I add a "add employee" button. It adds a row each time its clicked. By making the change in the grid more granular you reduce complexity. Current UI: Assuming you're stuck with your UI, you could indeed use a $scope.$watch in your controller. You could also attach a handler to the input itself with ng-change="updateEmployees()" Template: Controller: angular.module('curExample') .controller('EmployeesCtrl', function () { $scope.employees = []; $scope.numOfEmployees = 0; $scope.addEmployee = function() { $scope.employees.push({ firstName: "", lastName: "", amount: "" }); }; $scope.removeEmployees = function(start, count) { if (start > -1) { $scope.employees.splice(start, count); } }; $scope.updateEmployees = function () { var newNum = $scope.numOfEmployees, curNum = $scope.employees.length; if(!newNum || newNum === curNum) return; if(newNum > curNum) { for(var i = 0; i < (newNum - curNum); i++) { $scope.addEmployee(); } } else { $scope.removeEmployees(curNum - 1, curNum - newNum); } }; $scope.$watch('numOfEmployees', function (newValue) { $scope.updateEmployees(); }); }); Alternative UI: This solution looks something akin to the following. I'll post a JSFiddle when I have a moment Template: Remove Add Employee Controller: angular.module('altExample') .controller('EmployeesCtrl', function () { $scope.employees = []; $scope.addEmployee = function() { $scope.employees.push({ firstName: "", lastName: "", amount: "" }); }; $scope.removeEmployee = function(index) { if (index > -1) { $scope.employees.splice(index, 1); } }; });
upvote count: 1

http://stackoverflow.com/q/26943115
score: 1
has comment: http://stackoverflow.com/comment/42514624
has comment: http://stackoverflow.com/comment/42482763
has answer: http://stackoverflow.com/a/28584969
has title: Element is not clickable at point (1254, 21). Other element would receive the click
type: Question
answer count: 2
tagged with: protractor
has comment: http://stackoverflow.com/comment/42514963
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27032115
has comment: http://stackoverflow.com/comment/42507148
favorite count: 0
tagged with: angularjs
has body: I am using protractor and selenium server with angularJS for UI testing, This is my TestCase: it('Click on Top Headings one by one', function () { //click on Top Heading one by one ptor.element.all(by.repeater('application in workbenchOptions.applications')).then(function (arrs) { ptor.sleep(3000); arrs[2].click(); ptor.sleep(3000); arrs[3].click(); ptor.sleep(3000); arrs[1].click(); ptor.sleep(3000); arrs[2].click(); ptor.sleep(3000); arrs[0].click(); ptor.sleep(2000); }); }); This is my UI where I am trying to click each heading one by one First of all I am clicking on arrs[2] i.e. Clientside Test Case then I am clicking on arrs[3], arrs[1], arrs[2], arrs[0] , everything is clicking , but if in the beginning suppose arrs[0] is already open then I am not able to click on this again and I got a error message UnknownError: unknown error: Element is not clickable at point (1254, 21). Other element would receive the click: ... I tested against both Chrome and Firefox and the same error occurs
has comment: http://stackoverflow.com/comment/42510151
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/42492807
tagged with: node.js
tagged with: selenium-webdriver

http://stackoverflow.com/comment/42440163
comment on: http://stackoverflow.com/q/26949275
score: 0
has text: Since you are using jquery, you don't have to fight with native javascript ajax request. Your below jquery ajax request itself looks ok.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26868882
has comment: http://stackoverflow.com/comment/42304680
has answer: http://stackoverflow.com/a/26874122
score: 2
type: AnsweredQuestion
tagged with: contenteditable
upvote count: 3
has comment: http://stackoverflow.com/comment/42300284
has body: We have a styled disabled input, of type button, which we're using as a placeholder for other content in a content editable area. The issue is that IE (we're specifically targeting IE10) appears to ignore the resizestart event altogether so when you click on the element, you're allowed to resize it. We want to prevent that, but still allow the element to be selected and dragged. This does seem to work for the image. The story behind the choice of element here is long winded, so for now just assume we can't change the element. UPDATE: Here's a jsfiddle demonstrating the issue and the relevant sample code here: &lt;div contenteditable="true"&gt; &lt;input type="button" value="test" disabled="disabled" onresizestart="return false;" onresize="return false;" id="test" /&gt; &lt;/div&gt;
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/42300674
has comment: http://stackoverflow.com/comment/42300319
tagged with: javascript
tagged with: resize
accepted answer: http://stackoverflow.com/a/26874122
answer count: 1
has title: Preventing resize of button in contenteditable div in IE
has comment: http://stackoverflow.com/comment/42300388
favorite count: 0
has comment: http://stackoverflow.com/comment/42301312
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42304657
has comment: http://stackoverflow.com/comment/42300295
has comment: http://stackoverflow.com/comment/42300765

http://stackoverflow.com/comment/42449443
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26942740
has text: Place them files in the /resources folder

http://stackoverflow.com/comment/42329541
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26887098
has text: He'd better use $('body *'), this avoid looping into unecessary elements (head, meta, etc.).

http://stackoverflow.com/a/26928344
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/26928237
type: Answer
has body: You can use this code to load jQuery, it appends the script to the head-tag if it's not. &lt;script type="text/javascript"&gt; if (!window.jQuery) { var jq = document.createElement('script'); jq.type = 'text/javascript'; // Path to jquery.js file, eg. Google hosted version jq.src = '/path-to-your/jquery.min.js'; document.getElementsByTagName('head')[0].appendChild(jq); } &lt;/script&gt; Taken from http://jquery-howto.blogspot.se/2009/03/check-if-jqueryjs-is-loaded.html

http://stackoverflow.com/comment/42455030
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26957697
has text: Absolutely not, That's a 's scrollbar matter.

http://stackoverflow.com/q/26905750
has comment: http://stackoverflow.com/comment/42365124
has answer: http://stackoverflow.com/a/26905851
type: AnsweredQuestion
has body: I am displaying some check boxes. The user can check a maximum of 4 boxes. I store the checked value in 4 textboxes. My problem: How can I correctly store the "new" checked value when the user randomly unchecks one box and checks another? I store values as follows: First checked into item_1, second checked into item_2, third checked into item_3 ... If the user unchecks the first checked box, for example, how can I store the value of the next box he or she checks into item_1? Please help. Simplified code &lt;input type="checkbox" name="prodname_1" id="prodname_1"value="1"/&gt; &lt;input type="checkbox" name="prodname_2" id="prodname_2"value="2"/&gt; &lt;input type="checkbox" name="prodname_3" id="prodname_3"value="3"/&gt; . . &lt;input type="checkbox" name="prodname_10" id="prodname_10"value="10"/&gt; &lt;input type="text" name="item_0" id="item_0"value=""/&gt; &lt;input type="text" name="item_1" id="item_1"value=""/&gt; &lt;input type="text" name="item_2" id="item_2"value=""/&gt; &lt;input type="text" name="item_3" id="item_3"value=""/&gt; $(document).ready(function (e) { counter=0; $('input[id^="prodname_"]').change(function() { id = $(this).attr('id'); var arr = id.split('_'); valueChecked=$('#'+id).val(); if(this.checked) { if(counter==4) { alert('Allready checked 4 items'); this.checked=false; return false; } $("#item_"+counter).val(valueChecked); ++counter; } }); });
possible better answer: http://stackoverflow.com/a/26906546
has comment: http://stackoverflow.com/comment/42364001
score: 1
accepted answer: http://stackoverflow.com/a/26905851
has title: Check at most four check box and store checked value to textbox
type: Question
tagged with: javascript
tagged with: jquery
answer count: 2
has comment: http://stackoverflow.com/comment/42363868
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has comment: http://stackoverflow.com/comment/42363194
favorite count: 0
has comment: http://stackoverflow.com/comment/42365142
has answer: http://stackoverflow.com/a/26906546
upvote count: 1

http://stackoverflow.com/q/26890786
type: Question
tagged with: google-apps-script
tagged with: concatenation
tagged with: google-sheets
downvote count: 0
has answer: http://stackoverflow.com/a/26891692
tagged with: javascript
answer count: 1
has title: Returning 'Range' instead of actual string in Google Apps Script
favorite count: 0
upvote count: 2
accepted answer: http://stackoverflow.com/a/26891692
score: 2
type: AnsweredQuestion
has body: I am using the following function to return a concatenated string in Google Sheets. In this instance, B4 equals 'cardiology' and B1 equals '82-01'. The expected result is dimension2=~cardiology;ga:eventCategory=~MS82-01. However, I am getting this result, dimension2=~Range;ga:eventCategory=~MSRange. Why is the function returning 'Range' instead of the actual strings? function highLevelData() { var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); // get the spreadsheet object SpreadsheetApp.setActiveSheet(spreadsheet.getSheets()[1]); // set the first sheet as active var sheet = spreadsheet.getActiveSheet(); // get the active sheet var reportConfig = spreadsheet.getSheets()[0]; // set report configuration sheet var targetSpecialty = sheet.getRange("B4"); // get target specialty var specialtyDimension = "dimension2=~"; // set the sytanx string for the specialty dimension var targetCase = sheet.getRange("B1"); // get case var eventCategoryDimension = ";ga:eventCategory=~MS"; // set the syntax string for the event category dimension var filterOutput = specialtyDimension + targetSpecialty + eventCategoryDimension + targetCase; // concatenate full filter string var filterCell = reportConfig.getRange("B11"); // set the filter cell filterCell.setValue(filterOutput); // output filter string to filter cell }

http://stackoverflow.com/comment/42350926
type: AnswerComment
type: Comment
has text: also very helpful, and multiple solutions are helping me figure out what I was doing wrong. Very much appreciated!
comment on: http://stackoverflow.com/a/26898542
score: 0

http://stackoverflow.com/a/26941914
upvote count: 1
has body: The problems: You are not binding you function to the change event of the password field You are checking the value with innerHTML instead of value You are using wrong IDs in document.getElementById() You code fixed: var password_input = document.getElementById('password_input'); password_input.onchange = password_input.onkeyup = function() { var password_good = (password_input.value === "good"); document.getElementById("check").innerHTML = password_good ? 'Good' : 'Bad'; } &lt;input name="password" type="password" id="password_input"&gt; &lt;div id="check"&gt;&lt;/div&gt;
downvote count: 0
answers question: http://stackoverflow.com/q/26941851
type: Answer
score: 1

http://stackoverflow.com/a/26920209
has comment: http://stackoverflow.com/comment/42388694
accepted answer of: http://stackoverflow.com/q/26920046
has body: exist onkeyup as well, you can check every keypressdown and store it, but when the onkeyup is triggered check if it is the same key in order to remove from store.
type: Answer
answers question: http://stackoverflow.com/q/26920046
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/44415992
type: Comment
has text: Note that you've listed wrong options - it is either "JavaScript + Server side" or "Server side only".
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27047333

http://stackoverflow.com/q/26854355
has title: jquery mobile autocomplete throws error $(...) is not a function
tagged with: jquery-mobile
tagged with: javascript
tagged with: jquery
has body: I have the below code. Everything is working fine except my jquery mobile autocomplete it says TypeError $(...).on is not a function I will post all of my code but only need help with the bottom part. <% Option Explicit Response.Expires = 0 Response.Buffer = TRUE REM ------------------------------------------------------------- REM Define Global Variables REM ------------------------------------------------------------- Dim blnBypassRedirect Dim StrDescription Dim strRequesterName Dim strAction Dim strTaskID Dim strAssignUserID REM ------------------------------------------------------------- REM Include files REM ------------------------------------------------------------- %> <% blnBypassRedirect = UCase(Trim(Request("hidByPassRedirect"))) <> "Y" strDescription = (Request("txtDescription")) strRequesterName = (Trim(Request("txtRequesterName"))) strAction = Trim(UCase(Request("hidAction"))) strTaskID = Trim(UCase(Request("hidRandomID"))) strAssignUserID = Ucase(Trim(Request("cboAssignUserID"))) If (blnBypassRedirect) Then If InStr(LCase(Request.ServerVariables("HTTP_USER_AGENT")), "blackberry") > 0 Then 'If InStr(LCase(Request.ServerVariables("HTTP_USER_AGENT")), "webkit") > 0 Then 'If (gblnProdServer) Then Response.Redirect("http://m.wingfootct.com/blackberry.asp") 'Else ' Response.Redirect("http://testm.wingfootct.com/blackberry.asp") 'End If 'End If End If End If Call Mainline Response.Flush Sub Mainline Call InitVars Call WriteHTML End Sub If strAction <> "" Then Call MobileTaskUpdate End If Sub InitVars Call InitAll gstrTitle = "Goodyear Commercial Tire & Service Centers" 'blnIsTool = True End Sub Sub WriteHTML Dim strTemp %> Goodyear Commercial Tire & Service Centers | Mobile <% WriteStyleSheet() %> <% WriteHeader("Tasks") %> Approve Tasks <% Call WriteTaskApproval %> Unassigned Tasks <% Call WriteUnassignedTasks %> <% WriteFooter() %> <% End Sub Sub WriteTaskApproval Dim strQString Dim strName Dim strAddUserID Dim strMgmtApprovUser Dim strError Dim i Dim int…
has comment: http://stackoverflow.com/comment/42271685
score: 0
has comment: http://stackoverflow.com/comment/42271513
has comment: http://stackoverflow.com/comment/42271403
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42271215
has comment: http://stackoverflow.com/comment/42271485
type: Question
tagged with: asp-classic

http://stackoverflow.com/q/26936730
has answer: http://stackoverflow.com/a/26939603
linked to: http://stackoverflow.com/q/13221769
score: 0
has title: nodejs express: store parameters in variable
answer count: 1
type: UnansweredQuestion
has body: I am still new with nodejs, still not sure how to access a variable in a function and call the variable back. check few links: but im getting really confused. Please help! Node.JS: How to pass variables to asynchronous callbacks? How can we access variable from callback function in node.js? var express = require('express'); var app = express(); var router = express.Router(); var https = require('https').createServer( ssl_options, app); var io = require('socket.io')( https ); **var user_id; var room_id;** router.use(function(req, res, next) { next(); }); app.use('/chat',router); router.route( '/chat/:user_id/:room_id' ) .get(function(req,res){ res.sendFile( __dirname + '/index.html' ); user_id = req.param('user_id'); room_id = req.param('room_id'); }); https.listen(3000); io.on('connection', function(socket){ **console.log ( user_id ); console.log ( room_id );** });
tagged with: node.js
tagged with: socket.io
type: Question
linked to: http://stackoverflow.com/q/19442829
tagged with: javascript

http://stackoverflow.com/q/26838014
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42241413
has comment: http://stackoverflow.com/comment/42241599
tagged with: prototype
type: Question
answer count: 1
tagged with: javascript
tagged with: inheritance
has comment: http://stackoverflow.com/comment/42241483
linked to: http://stackoverflow.com/q/572897
score: 0
has body: I have created collection base class/object to do the repeated task. I have CollectionBase, and I have Persons class that inherit to CollectionBase. but my problem is when i create 2 persons collection like persons1 = new Persons() and persons2 = new Persons() it seems that they have same reference object. Any suggestion on how i can make everytime i will create a new Persons it will create new instance. Please refer to this on plnkr; http://plnkr.co/edit/8GPkWO4nKRiskxoRWrkg?p=info (function(){ function CollectionBase(){ this.collection = []; } Object.defineProperties(CollectionBase.prototype, { count: { get: function(){ return this.collection.length; }, enumerable: true } }); CollectionBase.prototype.init = function(){ }; CollectionBase.prototype.get = function(index){ if (index === undefined){ return this.collection; } return this.collection[index]; }; CollectionBase.prototype.remove = function(index){ try{ if (index === undefined) throw new Error('index is undefined'); this.collection.splice(index, 1); } catch(err){ console.log(err); } }; CollectionBase.prototype.update =function(item){ }; CollectionBase.prototype.add = function(item){ this.collection.push(item); }; function Person(firstName, lastName){ this.firstName = firstName; this.lastName = lastName; } function Persons(){ CollectionBase.call(this); } Persons.prototype = Object.create(CollectionBase.prototype); var persons1 = new Persons(); var persons2 = new Persons(); })();
has answer: http://stackoverflow.com/a/26838098
accepted answer: http://stackoverflow.com/a/26838098
has title: javascript prototype inheritance override property

http://stackoverflow.com/a/26832904
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/26832413
has body: Post data are send by name nor id attribute: &lt;input type="text" id="date_ajout" name="date_ajout" placeholder="JJ/MM/YYYY" /&gt; As long as you are not passing hour and minute details, change signature for createFromFormat $dt = DateTime::createFromFormat('d/m/Y', $date);
answers question: http://stackoverflow.com/q/26832413
type: AcceptedAnswer

http://stackoverflow.com/q/26899291
has comment: http://stackoverflow.com/comment/42351623
has answer: http://stackoverflow.com/a/26899503
type: Question
has comment: http://stackoverflow.com/comment/42351690
has comment: http://stackoverflow.com/comment/42351703
tagged with: closures
has comment: http://stackoverflow.com/comment/42351519
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/42351681
answer count: 1
downvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/42351513
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42351487
has body: I have the following IFFE that creates a context object on the first call as $_(document) Result : obj {context: document} However on the second call Im getting an error as $_(document) Uncaught TypeError: object is not a function As someone who is just getting familiar with the underlying concepts I want to know the reason for this behaviour $_ = (function(){ var obj = function (context){ this.context = context } return function(context){ return new obj(context) } }())
has comment: http://stackoverflow.com/comment/42351557
upvote count: 0
has comment: http://stackoverflow.com/comment/42351457
has comment: http://stackoverflow.com/comment/42351510
has title: Javascript query about context objects
has comment: http://stackoverflow.com/comment/42351527

http://stackoverflow.com/a/26851597
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26851534
type: Answer
upvote count: 1
score: 1
downvote count: 0
has body: Assuming you have jquery included whateverDiv = document.getElementsByClassName('whatever') //RETURNS SOMETHING LIKE [&lt;img src=​"http:​/​/​www.whateversource.jpg"&gt;​,&lt;img src=​"http:​/​/​www.whateversource2.jpg"&gt;​] for (i in whateverDiv){ var $div = $(whateverDiv[i]) console.log($div.offset()) } And as others mentioned, you shouldn't use for in, but rather the standard for construction. However, if you're using jQuery already you might as well drink the koolaide and use their .each http://api.jquery.com/each/ $(".whatever").each(function() { console.log( $(this).offset() ); });
answers question: http://stackoverflow.com/q/26851534

http://stackoverflow.com/a/26942669
score: 0
answers question: http://stackoverflow.com/q/26942603
type: Answer
has body: Call setinterval on the myfunction() instead of within it function myfunction() { var current = $('.number').text(); console.log('the value is ' + current); var newNumb = parseFloat(current) + 1; $('.number').html(newNumb); console.log(newNumb); } $(document).ready(function(){ setInterval(function(){ myfunction();}, 2000); });

http://stackoverflow.com/comment/42335435
type: Comment
type: QuestionComment
score: 0
has text: sorry i forgot the 0 refer to element 1.
comment on: http://stackoverflow.com/q/26890677

http://stackoverflow.com/comment/42364646
type: QuestionComment
has text: @benhowdle89: I have tired that too. But with this approach I am not able to utilize browserified file into my JS application.
type: Comment
comment on: http://stackoverflow.com/q/26903999
score: 0

http://stackoverflow.com/q/26840308
tagged with: angularjs
upvote count: 8
has title: .addClass not working on jqLite / Angular.js
type: Question
has answer: http://stackoverflow.com/a/27077738
has answer: http://stackoverflow.com/a/26840725
has body: I've been struggling lately to understand why the .addClass function was not working on jqLite element.addClass('active') Element returns me an array of html elements, tested that over and over to be sure. I can hide(), show() , add a .css or get one, or even set .attr , but addClass resists me. edit: element is a path in a svg block , and this is the reason that seems to make the addClass function irrelevant, still trying to fix it. element is a jqLite object Thank you.
has comment: http://stackoverflow.com/comment/42245469
has answer: http://stackoverflow.com/a/26840817
answer count: 3
has comment: http://stackoverflow.com/comment/42245745
has comment: http://stackoverflow.com/comment/42245106
has comment: http://stackoverflow.com/comment/42245792
tagged with: jqlite
has comment: http://stackoverflow.com/comment/42245239
type: UnansweredQuestion
score: 8
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/42245304
has comment: http://stackoverflow.com/comment/42245173

http://stackoverflow.com/comment/42269959
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26853250
has text: `document.getElementById("ebc").value = option;`
type: AnswerComment

http://stackoverflow.com/q/26939271
has body: We are trying to build a Windows 8 native application using JavaScript. We are using jQuery to dynamically load the javascripts files, and all the javascript files are stored inside of the app. When I try to debug the javascript, the breakpoint can't hit, saying "The breakpoint will not currently be hit....", but in the Solution Explorer, there is a Script Documents project, there is a file called "script block", which contains all the javascripts which are loaded from jQuery. I can debug from there after I disable the "Enable Just My Code", but it's difficult to find the right place to put breakpoint, since this file is huge... Actually all the javascript files are having sourcemap attribute, for example: //# sourceURL=ms-appx://d664ef20-6ac8-11e4-ab78-2f4dc8b50d53/www/resources/abc.js It is working fine with all the browsers, IE, Safari, Firefox and Chrome. But Visual Studio seems not be able to recognize them. Anyone who has the same issue? Regards, Xiaojun
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/42425967
has comment: http://stackoverflow.com/comment/42494741
has answer: http://stackoverflow.com/a/26980686
score: 0
has comment: http://stackoverflow.com/comment/42422786
tagged with: windows
answer count: 1
tagged with: visual-studio-2013
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42493356
has title: How to debug javascript in Visual Studio 2013

http://stackoverflow.com/a/26980825
type: Answer
answers question: http://stackoverflow.com/q/26979628
has body: Is there a reason for using an &lt;object&gt; element? Jquery has a method .load() which will request and insert the returned data/html into an element. http://api.jquery.com/load/ &lt;div id="myiframe"&gt; &lt;div id="myloader"&gt;&lt;/div&gt; &lt;/div&gt; Then you would load the data: &lt;script type='text/javascript'&gt; $(function() { $('#myloader').load("item_list.html", function() { //at this point, the elements are in the document: $('#a0').css("font-size", "26px"); //... }); }); function deselect() { var itemcount = $('#ItemCount').val(); for (var i = 0; i &lt; itemcount; i++) { $('#a'+i).css("font-size", "26px"); //etc. } } &lt;/script&gt; I would add that instead of manually editing the css in javascript, you use jquery to .addClass(), removeClass(), or .toggleClass() css classes which contain the styling you are looking for.
score: 0

http://stackoverflow.com/comment/42457905
type: Comment
comment on: http://stackoverflow.com/a/26958596
score: 0
type: AnswerComment
has text: @Gonki: Take some time and understand how it works. It will be well worth the time spent.

http://stackoverflow.com/a/26948862
has comment: http://stackoverflow.com/comment/42454537
score: 0
has body: try this: {{diff()}}%tests passed or this: {{diff({ data: data })}}%tests passed
answers question: http://stackoverflow.com/q/26947727
type: Answer

http://stackoverflow.com/comment/42440064
comment on: http://stackoverflow.com/q/26949187
has text: @Cristy Yes but I'm not asking what the `==` is, but how does it act when a data type conversion is done (specifically for booleans). Both those answer do not provide any information on that.
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/136183735
comment on: http://stackoverflow.com/a/77230474
score: 0
type: AnswerComment
has text: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
type: Comment

http://stackoverflow.com/q/26973750
has body: I'm having a similar issue to the one posted in the following stackoverflow question: UTF-16 character encoding issue with FireFox - But in my case is with JSON documents instead of XML. I have a correctly encoded (with its BOM) UTF-16 JSON text file. I'm retrieving this text content by means of a javascript httpXmlRequest, and then using the command window.JSON.parse to parse the response text to a javascript object. It works for browsers Chrome and Explorer, but window.JSON.parse crashes with Mozilla. I probably will change the file encoding to UTF-8, but really I'm a little bit confused, as it looks like either I'm doing something unproperly, or either some browsers are being too tollerant or not having a standard behaviour. If someone can shed some light regarding to this, I'd be grateful.
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
tagged with: mozilla
has title: UTF-16 character encoding issue with FireFox (JSON)
tagged with: encoding
upvote count: 1
has comment: http://stackoverflow.com/comment/42508690
tagged with: unicode
favorite count: 0
linked to: http://stackoverflow.com/q/9724916
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42494706
answer count: 0
downvote count: 0
score: 1
type: Question

http://stackoverflow.com/comment/42309931
comment on: http://stackoverflow.com/q/26875809
score: 0
has text: yes, i have read through their documentation. the javascript api is more complicated than the others but I needed to use it for customizing. They seemed to be lacking an easy way to drop multiple pins at gps locations pulled from a function or database, I had to write my own function to create all the map markers and another one to calculate the center point.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26845732
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/26845800
type: UnansweredQuestion
has title: Getting unexpected token ILLEGAL error for server.js file
tagged with: node.js
has body: So I'm going through the node.js in action book and I'm currently trying to build the chat based application on the second chapter. However, I keep on getting the Unexpected token ILLEGAL when I try to run the HTTP server, but i don't seem to see anything wrong: var http = require('http'); var fs = require('fs'); var path = require('path'); var mime = require('mime'); var cache = {}; function send404(response) { response.writeHead(404, {'Content-Type': 'text/plain'}); response.write('Error 404: resource not found.'); response.end(); } function sendFile(response, filePath, fileContents) { response.writeHead( 200, {"content-type": mime.lookup(path.basename(filePath))} ); response.end(fileContents); } function serveStatic(response, cache, absPath) { if (cache[absPath]) { sendFile(response, absPath, cache[absPath]); } else { fs.exists(absPath, function(exists) { if (exists) { fs.readFile(absPath, function(err, data) { if (err) { send404(response); } else { cache[absPath] = data; sendFile(response, absPath, data); } }); } else { send404(response); } }); } } ￼ ￼var server = http.createServer(function(request, response) { var filePath = false; if (request.url == '/') { filePath = 'public/index.html'; } else { filePath = 'public' + request.url; } var absPath = './' + filePath; serveStatic(response, cache, absPath); }); server.listen(3000, function() { ￼ console.log("Server listening on port 3000."); });
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/comment/42411371
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26933221
has text: anywhere outside of that function

http://stackoverflow.com/q/26843065
tagged with: javascript
favorite count: 0
has title: How to send a Node.js response(JSON) to a javascript file?
has body: I'm currently trying to plot data from MongoDB in a graph to display on a website. What I have tried so far is getting the response from MongoDB using Node.js and mongoose, which returns a json object to the browser. app.get('/pricediff',function(req,res){ PriceDifference_collection.find({},{'_id':0},function(err,pricediff) { res.send(pricediff); }) }); I separately used amcharts to plot JSON objects using javascript. But now I just pasted the JSON response I got from Node.js into the javascript file manually. "dataProvider": {JSON data} My question: Is there a way to give the response from Node.js(JSON) directly to the javascript file? Or are there more easy ways to plot data from my database? Maybe even use a complete different kind of database...
tagged with: node.js
tagged with: amcharts
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/26843520
type: Question
score: 1
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/26845160
tagged with: mongodb
answer count: 2
has comment: http://stackoverflow.com/comment/42249829
downvote count: 0
has comment: http://stackoverflow.com/comment/42249939

http://stackoverflow.com/q/26877581
tagged with: xslt
type: Question
tagged with: javascript
downvote count: 0
answer count: 1
score: 1
has title: javascript function only works with first element
tagged with: jquery
has answer: http://stackoverflow.com/a/26878398
has comment: http://stackoverflow.com/comment/42312293
favorite count: 0
has body: I have an xsl file and I was able to get it to display the title in the on click function but I can only get the first title to be shown the others stay hidden, and the first title is shown no matter what button calls the function. the function also doesn't hide the button after it is pressed so there must be something wrong with the function and the specific lines? also I'm opening this with internet explorer.. <xsl:for-each select="/questions/question/movie[position() >1]"> In What Movie Did They Say: <xsl:value-of select="quote"/> - <xsl:value-of select="title"/> </xsl:for-each>
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26878398
upvote count: 1

http://stackoverflow.com/q/26961325
answer count: 8
has answer: http://stackoverflow.com/a/75946674
score: 10
has answer: http://stackoverflow.com/a/66196989
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/44086673
accepted answer: http://stackoverflow.com/a/26961505
upvote count: 10
has comment: http://stackoverflow.com/comment/98820111
has comment: http://stackoverflow.com/comment/42460807
has answer: http://stackoverflow.com/a/26961616
has answer: http://stackoverflow.com/a/68490917
favorite count: 0
has answer: http://stackoverflow.com/a/26961505
possible better answer: http://stackoverflow.com/a/56238418
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/56238418
tagged with: ruby-on-rails
has title: TinyMCE and Bootstrap Modals -- Works only one time
type: AnsweredQuestion
has body: I'm using Bootstrap and tinymce-rails so that I can have a nice text editor for some of my text areas. However, I'm having a modal render a form that contains a textarea and the "tinymce" class, but this modal only actually shows the TinyMCE text editor one time. Once the modal is closed and re-opened, it only looks like a regular text field. Here's the form that's being rendered: &lt;%= form_for @paragraph_section, html: {class: "form-horizontal"} do |f| %&gt; &lt;div class="form-group"&gt; &lt;%= f.label :paragraph, nil, class: "col-sm-3 control-label" %&gt; &lt;div class="col-sm-6"&gt; &lt;%= f.text_area :paragraph, placeholder: "(e.g. Hello World)", class: "form-control tinymce" %&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;%= f.submit "Add paragraph", class: "btn btn-xs btn-primary" %&gt; &lt;/div&gt; &lt;% end %&gt; Now when I click on the "New paragraph" link, which is sends a remote call to new.js.erb, here's this modal pops up and the tinymce text editor actually works. But again, once I close this and re-open the mdoal with the "new paragraph" link again, the tinymce text editor doesn't work. Here's what the new.js.erb file looks like: $('#modalOne').modal({show: true}); $('#modal_content').html("&lt;%= j render 'form' %&gt;"); $('#modal_header').html("New Paragraph"); tinymce.init({ selector: "textarea", width: '100%', height: 270, plugins: [ "anchor link" ], statusbar: false, menubar: false, toolbar: "link anchor | alignleft aligncenter alignright alignjustify", rel_list: [ { title: 'Lightbox', value: 'lightbox' } ] }); Any idea how I can have the tinymce text editor working, despite me closing and re-opening the same modal?
downvote count: 0
has answer: http://stackoverflow.com/a/54994188
type: Question

http://stackoverflow.com/comment/42434385
has text: Hi, welcome to StackOverflow. Could you post the relevant code snippet you have already?
type: Comment
comment on: http://stackoverflow.com/q/26945950
score: 1
type: QuestionComment

http://stackoverflow.com/comment/42399562
type: Comment
comment on: http://stackoverflow.com/a/26908600
score: 0
type: AnswerComment
has text: Oh, I forgot, check against undefined also (because we are using JSON.parse)

http://stackoverflow.com/q/26946535
has title: Can't get value of object's property
tagged with: jquery
has comment: http://stackoverflow.com/comment/42435278
has comment: http://stackoverflow.com/comment/42436985
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42435311
has comment: http://stackoverflow.com/comment/42436863
answer count: 0
has comment: http://stackoverflow.com/comment/42436258
has comment: http://stackoverflow.com/comment/44133620
has comment: http://stackoverflow.com/comment/42435341
type: Question
has comment: http://stackoverflow.com/comment/42436363
has comment: http://stackoverflow.com/comment/42435276
has comment: http://stackoverflow.com/comment/44588027
tagged with: javascript
has comment: http://stackoverflow.com/comment/42436555
has comment: http://stackoverflow.com/comment/42435634
score: 0
has body: Not sure what's going on here. I have a function that is an event handler for a WordPress plugin: $.fn.almComplete = function(alm){ console.log(alm); console.log(alm.finished); } The first output is this: e.ajaxloadmore {AjaxLoadMore: Object, page: 0, speed: 300, proceed: false, init: false…} AjaxLoadMore: Object button: m.fn.init[1] button_label: "Load More" content: m.fn.init[1] data: m.fn.init[2] el: m.fn.init[1] finished: true init: false lang: "" loading: false max_pages: 5 offset: 0 page: 0 pause: false post_type: Array[1] posts_per_page: 6 prefix: "alm-" proceed: true repeater: "default" scroll: false speed: 300 transition: "slide" window: m.fn.init[1] __proto__: Object But the second output console.log(alm.finished) always outputs false, but that property is obviously not false so I don't believe I'm referencing this variable correctly. How do I access the alm object's properties? EDIT: Here is when this callback is called within the plugin's code: success: function (data) { alm.data = $(data); // Convert data to an object //console.log(alm.data.length); if (alm.init) { alm.button.text(alm.button_label); alm.init = false; } if (alm.data.length &gt; 0) { alm.el = $('&lt;div class="' + alm.prefix + 'reveal"/&gt;'); alm.el.append(alm.data); alm.el.hide(); alm.content.append(alm.el); if (alm.transition === 'fade') { // Fade transition alm.el.fadeIn(alm.speed, 'alm_easeInOutQuad', function () { alm.loading = false; alm.button.delay(alm.speed).removeClass('loading'); if (alm.data.length &lt; alm.posts_per_page) { alm.finished = true; alm.button.addClass('done'); } }); } else { // Slide transition alm.el.slideDown(alm.speed, 'alm_easeInOutQuad', function () { alm.loading = false; alm.button.delay(alm.speed).removeClass('loading'); if (alm.data.length &lt; alm.posts_per_page) { alm.finished = true; alm.button.addClass('done'); } }); } if ($.isFunction($.fn.almComplete)) { $.fn.almComplete(alm); } } else { alm.button.delay(alm.speed).removeClass('loading').addClass('…
has comment: http://stackoverflow.com/comment/42435295

http://stackoverflow.com/comment/42325594
has text: Whenever you get an error like this, use a debugger (such as Firebug or Chrome's Developer Tools) to step through the program execution. At some point, you're passing in `undefined` to a method that expects a real value - which is what the error says. In fact, the Javascript console probably tells you where this happens without you even needing to fire up the debugger.
type: Comment
comment on: http://stackoverflow.com/q/26885321
type: QuestionComment
score: 2

http://stackoverflow.com/comment/42411851
comment on: http://stackoverflow.com/a/26933500
has text: @ʰᵈˑ Because if you just use the `$_GET["dev"]` then when you click on a wordpress link like `http://example.com/first-blog-entry/` there wont be that parameter
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42262456
has text: http://caniuse.com/
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26849851

http://stackoverflow.com/q/26951097
type: AnsweredQuestion
has title: DHTMLX DataProcessor not saving changes to database
has answer: http://stackoverflow.com/a/26970096
score: 0
tagged with: mysql
possible better answer: http://stackoverflow.com/a/26970096
type: Question
accepted answer: http://stackoverflow.com/a/27206048
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/27206048
has body: I have a rather simple DHTMLX page that I'm working on. I managed to load data from a database and display it in a DHTMLXGrid. However, when I change data in the grid, the data is not saved to the database and is therefore lost when the page is reloaded. The database in question is three tables: users, shows and watching. watching is the only one that needs updating (right now at least) and I just can't seem to get it to work. This is my "connector.php" file &lt;?php require("codebase/connector/grid_connector.php"); require("codebase/connector/db_mysqli.php"); $servername = "nope"; $username = "nope"; $password = "nope"; $databaseName = "nope"; $conn = new mysqli($servername, $username, $password,$databaseName); $query = "SELECT watching.user_ID, watching.show_ID,shows.name, watching.episodeswatched, shows.episodes, (shows.episodes - watching.episodeswatched) AS episodesremaining, watching.dropped, watching.waiting FROM watching INNER JOIN shows ON watching.show_ID = shows.ID INNER JOIN users ON watching.user_ID=users.ID"; $gridConnector = new GridConnector($conn, "MySQLi"); if($gridConnector-&gt;is_select_mode()) $gridConnector-&gt;render_complex_sql($query,"ID","name,episodeswatched,episodes,episodesremaining,dropped,waiting","user_ID,show_ID"); else { $gridConnector-&gt;render_table("watching","ID", "episodeswatched,dropped,waiting","user_ID,show_ID"); } ?&gt; And the relevant parts of the Javascript to make the processor and DHTMLXGrid showsGrid.init(); showsGrid.load("connector.php"); var myDP = new dataProcessor("connector.php") myDP.enableDataNames(true); myDP.init(showsGrid); I tried using the same line for fetching data and updating (render_complex_sqlquery) but that does nothing but paint the row in question red. At least with this method the row stays black. Am I missing something? Am I doing something completely wrong? I've been completely stuck here for way too long and I'm admitting defeat. I've looked at every sample and tutorial I could find, scoured…
tagged with: dhtmlx
tagged with: php

http://stackoverflow.com/comment/42317330
comment on: http://stackoverflow.com/a/26880535
score: 0
has text: This would put each anchor on its own line. I would like the links to be inline and wrap automatically, just like the second div.
type: AnswerComment
type: Comment

http://stackoverflow.com/a/26849967
has comment: http://stackoverflow.com/comment/42274314
score: 0
has body: may be you should pass userID and labelID as variable if every thing is okay with webservice call in javascript webView.loadUrl("javascript:getUsersLastEventID("+userID+","+labelID+")");
type: Answer
answers question: http://stackoverflow.com/q/26849670

http://stackoverflow.com/q/26906977
has answer: http://stackoverflow.com/a/26907070
tagged with: javascript
has answer: http://stackoverflow.com/a/26907032
has comment: http://stackoverflow.com/comment/42364297
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42364254
has body: I want to get the id of my img in javascript on a mousewheel but when I do a getElementById I it tells me that the length is null this is the function where I put my img function parse_data(data) { var json = data; var obj = JSON.parse(json); var buff = ""; for(var i in obj) { //document.write(' ' + i + ' '); for (var j in obj[i]) { if (obj[i][j] == true) buff += " "; else buff += " "; } buff += " "; } document.getElementById('frisekk').innerHTML = buff; } And this is the function where I want to get back the id of an img on mousewheel function test() { var obj = document.getElementById('img'); alert(obj.length); //obj.length is null... if (event.wheelDelta >= 120) unit -= 60; else unit += 60; request(readData); } how could I get the id of my img ? there is all the html code Techniques AJAX - XMLHttpRequest
has comment: http://stackoverflow.com/comment/42364360
has title: I can't get id of a image in javascript
score: 0
has comment: http://stackoverflow.com/comment/42364348
accepted answer: http://stackoverflow.com/a/26907032
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/26907070
type: Question
answer count: 2

http://stackoverflow.com/comment/42456056
score: 0
has text: I hate using libraries, if I have to accomplish just one task
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/26956720

http://stackoverflow.com/a/26935511
has comment: http://stackoverflow.com/comment/42415521
type: Answer
answers question: http://stackoverflow.com/q/26935418
has comment: http://stackoverflow.com/comment/42415496
has comment: http://stackoverflow.com/comment/42415872
score: 0
has body: No idea why you have them in "an array", but if you run this while they are still in the DOM, use the :has pseudo selector: var $tds = $('td:has(a:.edit-row,a:delete-row)'); var $otherTds = $('td').not($tds); The first one reads. *find any td that has an anchor within it with class edit-row or an anchor within it with class delete-row". The second one simply says, find all tds and exclude the first lot from the matches :)
has comment: http://stackoverflow.com/comment/42415942

http://stackoverflow.com/comment/42273191
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26838472
has text: No it doesn't. A HTTP 200 response proves that the request was successful. Your server code might be failing after you update your database or log.

http://stackoverflow.com/q/26842780
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42249136
type: Question
tagged with: yii
tagged with: javascript
tagged with: forms
score: 0
has body: For eg. I have form with many fields with name="person[][name]". Each person have many phone number fields (name="person[][phone][]"). &lt;form&gt; &lt;fieldset&gt; &lt;input type="text" name="person[][name]" /&gt; &lt;input type="text" name="person[][phone][]" /&gt; &lt;input type="text" name="person[][phone][]" /&gt; &lt;/fieldset&gt; &lt;fieldset&gt; &lt;input type="text" name="person[][name]" /&gt; &lt;input type="text" name="person[][phone][]" /&gt; &lt;input type="text" name="person[][phone][]" /&gt; &lt;/fieldset&gt; .... &lt;/form&gt; I want to get this on the server: person[0][name]='John'; person[0][phone][0]='123'; person[0][phone][1]='234'; ... person[n][name]='Sam'; person[n][phone][0]='584'; person[n][phone][1]='697'; ... But now, I have: person[0][name]='John'; person[1][phone][0]='123'; person[2][phone][1]='234'; ... person[n][name]='Sam'; person[n+1][phone][0]='584'; person[n+2][phone][1]='697'; ... How to solve this problem? Are there any solutions in Yii? P.S. My form is generated through JS.=( Every new person or phone is added by clicking on the button with jQuery.clone() function
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has title: Sending hierarchy of form fields in Yii
has comment: http://stackoverflow.com/comment/42257456
answer count: 0

http://stackoverflow.com/comment/42508002
has text: That's the index of the item in the "list" to tell the $scope.animate which item is getting clicked.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26987706

http://stackoverflow.com/a/26914941
has body: If $(element) is an anchor (&lt;a&gt; tag), try this instead [].forEach.call(gallery_images_thumbnails_list.querySelectorAll('.category'), function (element) { $(element).attr("rel", "fancybox").fancybox({ href: element.getAttribute('data-image') }); }); because, when you do $(element).fancybox({ //API options }); ... the plugin is expecting valid API options and rel is not one of them. On the other hand, if $(element) is an &lt;img&gt; tag (because I see you are querying thumbnails), then you rather try [].forEach.call(gallery_images_thumbnails_list.querySelectorAll('.category'), function (element) { $(element).wrap($("&lt;a /&gt;", { href: element.getAttribute('data-image'), rel: "fancybox", "class": "fancybox" })); }); Notice class requires to be in quotes because it's a reserved javascript word The code above still may need a fancybox initialization code like $(".fancybox").fancybox({ // API options });
answers question: http://stackoverflow.com/q/26905891
score: 0
type: Answer

http://stackoverflow.com/comment/42381184
has text: Editing right now. The HTML is too long, I'm deleting the unnecessary code.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26916185
score: 0

http://stackoverflow.com/comment/42232387
has text: header("Refresh:0"); what if now ?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26832774
type: Comment

http://stackoverflow.com/comment/42452975
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26956841
has text: Why would you need the query string parameters in any specific order?

http://stackoverflow.com/comment/42245034
comment on: http://stackoverflow.com/a/26839420
type: Comment
score: 0
type: AnswerComment
has text: To make not case sensitive just add toLowerCase or toUpperCase of both compared searchfilter and list value. Replace this line ret = (listVal.indexOf(filterKeys[key].trim())) > -1 || ret; to ret = (listVal.toLowerCase().indexOf(filterKeys[key].toLowerCase().trim())) > -1 || ret;

http://stackoverflow.com/q/26870848
tagged with: nested
has comment: http://stackoverflow.com/comment/42300742
has comment: http://stackoverflow.com/comment/42301285
has body: I'm making a fairly complex menu system where it should change depending on the authority that has logged in. Now my question is, have I nested it too much? How do I access for example a title in the items, in the admin within the menus? I'm gonna generate the menus using angularJS's ng-repeat so I need to be able to access it via "item in menus.admin.items.title" for example. I figured I should ask now before I add more in case this isn't a viable option. This is my menu structure inside the angular controller: $scope.menus = [{ admin: [{ title: 'Administration', items: [{ title: 'Hantera utbildningar', URL: 'mngprograms' }, { title: 'Hantera kurser', URL: 'mngcourses' }, { title: 'Hantera lärare', URL: 'mngteachers' }, { title: 'Hantera studenter', URL: 'mngstudents' }], URL: 'administration', id: 'administration' }] }] Here's my failed attempt at accessing it: EDIT: To get a clearer view of the whole thing go here: http://jsfiddle.net/52evmfg9/ {{menu.title}} {{subitem.title}} How do I write this?
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/26871186
accepted answer: http://stackoverflow.com/a/26871727
has comment: http://stackoverflow.com/comment/42300796
has comment: http://stackoverflow.com/comment/42300677
has comment: http://stackoverflow.com/comment/42300858
has answer: http://stackoverflow.com/a/26871186
has comment: http://stackoverflow.com/comment/42300725
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42300801
has comment: http://stackoverflow.com/comment/42300964
type: Question
has title: Accessing data inside nested objects and arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/26871727
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/42300393
has comment: http://stackoverflow.com/comment/42300652

http://stackoverflow.com/q/26845535
has body: Some of the third party plugin will attach the eventListener into the site. How to I remove the eventListener without knowing the function that attached. I refer this removeEventListener but I can't get any clue to remove this. Eg: getEventListeners(window) shows the events attached. But, when I try to remove the event using window.removeEventListener("eventname") is not working without knowing that function. Please help, Thanks in advance.
has answer: http://stackoverflow.com/a/26845649
tagged with: javascript
tagged with: event-listener
answer count: 4
upvote count: 47
has comment: http://stackoverflow.com/comment/131502228
possible better answer: http://stackoverflow.com/a/26845649
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26845805
has title: removeEventListener without knowing the function
downvote count: 0
tagged with: jquery
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/76566204
has answer: http://stackoverflow.com/a/75037984
linked to: http://stackoverflow.com/q/4386300
score: 47
has answer: http://stackoverflow.com/a/26845805

http://stackoverflow.com/a/26868209
answers question: http://stackoverflow.com/q/26865461
score: 0
has body: When initialising your Ext.window.Window you can add param modal: true which will add an overlay to the background which may prevent user scrolling. Otherwise it will be a manual process of setting overflow:hidden on the body when your window is shown. Source: http://docs.sencha.com/extjs/5.0/apidocs/#!/api/Ext.window.Window
type: Answer

http://stackoverflow.com/q/26834648
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/42235383
tagged with: angularjs
has comment: http://stackoverflow.com/comment/42235981
tagged with: inline
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: AngularJS - Uncaught ReferenceError: a is not defined
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/42235597
type: Question
has body: For an experiment I wanted to inline my Javascript files and I've come across some unexpected behavior. Everything works fine with a normal Angular import like this: ... ... However, It raises an exception if I inline the Angular source code like this: ... ... The exception: Uncaught ReferenceError: a is not defined
tagged with: closures
has answer: http://stackoverflow.com/a/26838917
has comment: http://stackoverflow.com/comment/42237444
upvote count: 1

http://stackoverflow.com/a/26968030
has comment: http://stackoverflow.com/comment/42472916
has body: For check the first radio button as default you can use the below code $('#pBody').find('input:radio').first().prop({checked:true}); or $('#pBody').find('input:radio').first().attr({checked:true}); and for checkboxes use $('#pBody').find('input:checkbox').first().prop({checked:true}); or $('#pBody').find('input:checkbox').first().attr({checked:true});
answers question: http://stackoverflow.com/q/26967851
score: 0
has comment: http://stackoverflow.com/comment/42475428
type: Answer

http://stackoverflow.com/q/26988808
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/26989197
has title: How to change array all values in javascript by button click event?
has body: I have one array as below in JavaScript : Actual array in JavaScript: array('123456' =&gt; '1', '456789' =&gt; '0', '789123' =&gt;'1', '4456784' =&gt; '0', 'so on...' =&gt; '0'); Wanted result array in JavaScript: array('123456' =&gt; '1', '456789' =&gt; '1', '789123' =&gt;'1', '4456784' =&gt; '1', 'so on...' =&gt; '1'); Is there any way to change JavaScript array all values as fix like 1 or 0(In wanted result array) without using any loops like(for, .each, etc...). Please suggest any idea if there is any possibilities in this. Thank you in advance!
accepted answer: http://stackoverflow.com/a/26989197
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42509693
has comment: http://stackoverflow.com/comment/42509942
has comment: http://stackoverflow.com/comment/42509810
type: Question
tagged with: arrays
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42509748
has comment: http://stackoverflow.com/comment/42509815

http://stackoverflow.com/a/26990257
has body: Just change your regex like below and get the string you want from group index 1. ##((?:(?!##).)+)## (?:(?!##).)+ would match any character but not of ## one or more times. DEMO &gt; var s = "this is the ##exa#mple## I am ##current## testing on" &gt; var re = /##((?:(?!##).)+)##/g; undefined &gt; var m; undefined &gt; while ((m = re.exec(s)) != null) { ... console.log(m[1]); ... } exa#mple current
has comment: http://stackoverflow.com/comment/42512979
answers question: http://stackoverflow.com/q/26990226
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/42512999
score: 1
has comment: http://stackoverflow.com/comment/42512942
upvote count: 1

http://stackoverflow.com/comment/42267961
score: 0
type: AnswerComment
type: Comment
has text: @confile I would say it would be about as expensive as applying an invert filter to the original image.
comment on: http://stackoverflow.com/a/26848123

variables
tag name: variables
tags question: http://stackoverflow.com/q/26931185
tags question: http://stackoverflow.com/q/26895344
tags question: http://stackoverflow.com/q/26875198
tags question: http://stackoverflow.com/q/26866468
tags question: http://stackoverflow.com/q/26962275
tags question: http://stackoverflow.com/q/26871820
tags question: http://stackoverflow.com/q/26911815
tags question: http://stackoverflow.com/q/26846095
type: Tag
tags question: http://stackoverflow.com/q/26966833
tags question: http://stackoverflow.com/q/26915291
tags question: http://stackoverflow.com/q/26979466
tags question: http://stackoverflow.com/q/26941861
tags question: http://stackoverflow.com/q/26958451
tags question: http://stackoverflow.com/q/26955566
tags question: http://stackoverflow.com/q/26934270
tags question: http://stackoverflow.com/q/26870306
tags question: http://stackoverflow.com/q/26985545
tags question: http://stackoverflow.com/q/26985145
tags question: http://stackoverflow.com/q/26986810
tags question: http://stackoverflow.com/q/26853385

http://stackoverflow.com/a/26924134
has body: See as you are GETTING value You need to return data , its logical thing.Not to just store in variable. function getValYear(){ return $('#year').val(); } function getValTrimester(){ return $('#trimester').val(); }
answers question: http://stackoverflow.com/q/26923229
score: 0
type: Answer

http://stackoverflow.com/a/26916288
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44524491
score: 1
accepted answer of: http://stackoverflow.com/q/26916014
has body: There are couple of ways to do that depending on what you need. Here are two examples: var start = { functionInside : function(){ doSomething(); } }; start[funtionName](); //different ways to invoke start.functionInside(); Here's another approach: var start = function() { this.functionInside = function() {doSomething();} } var s = new start(); s[funtionName](); //different ways to invoke s.functionInside();
answers question: http://stackoverflow.com/q/26916014
has comment: http://stackoverflow.com/comment/44525278
upvote count: 1

http://stackoverflow.com/q/26921813
has title: How to iterate objects in an array into many elements?
accepted answer: http://stackoverflow.com/a/26921839
answer count: 1
tagged with: arrays
tagged with: javascript
tagged with: jquery
favorite count: 0
type: AnsweredQuestion
has body: The answer to this is probably really simple but I just can't see it. I have an array of objects whose information I want to display in various places. I want to put each question into a section h1, of which I have five. However, the code I came up with just inserts the question of the last object in the array into every section h1, i.e., they all say "Question 5". I can't figure out why. How do I make this print each question into a different section h1? var questions = [ {question: "Question1", choices: ["A","B","C"], answer: 0}, //etc. x 5 ]; $('section h1').each(function() { for (var i = 0; i &lt; questions.length; i++) { $(this).text(questions[i].question); } });
upvote count: 2
has answer: http://stackoverflow.com/a/26921839
downvote count: 1
type: Question
score: 1

http://stackoverflow.com/comment/42474127
comment on: http://stackoverflow.com/q/26966922
type: Comment
score: 0
type: QuestionComment
has text: I have added a code @Vaibs_Cool, what i tried. Know can explain y this is not working, couse logically after all js files being loaded the methods can be called, but y not in this case.

http://stackoverflow.com/a/26908036
has comment: http://stackoverflow.com/comment/42366173
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/42366094
has comment: http://stackoverflow.com/comment/42366109
has comment: http://stackoverflow.com/comment/42366125
has body: You can use a function with html to modify the contents, based on the contents: JSFiddle: http://jsfiddle.net/TrueBlueAussie/vwtmwz0a/2/ $('tr.headrow').click(function () { // Find the span inside the headrow and toggle its value to '+' $(this).find('span').html(function(){ return $.trim($(this).html()) == '-' ? '+' : '-'; }); }); text() is just as good in this instance. I use html() out of habit :)
answers question: http://stackoverflow.com/q/26907992
upvote count: 2
has comment: http://stackoverflow.com/comment/42366231
has comment: http://stackoverflow.com/comment/42366129
has comment: http://stackoverflow.com/comment/42366074
type: Answer

http://stackoverflow.com/comment/42350968
comment on: http://stackoverflow.com/a/26898776
score: 0
type: Comment
has text: So you probably don't want to use a `return` statement at all for this. Either replace `return` with `console.log(...)` to display in console or use the `document.getElementById(...).innerHTML = ...` to cahnge an element on page (such as a `div`), or both.
type: AnswerComment

http://stackoverflow.com/a/26844379
has comment: http://stackoverflow.com/comment/42252827
has body: Try to go with that: $scope.$watch('customer.addresses', function(newCode, oldCode){ for (... every address in customer.addresses) { // check if city and state are null and do the request if it is true } }, true); Don't forget to turn the deep watch switch on. (the 3rd argument true) The switch enables checking witch angular.equals instead of comparing references, which results in you array being watched on changes in its elements.
answers question: http://stackoverflow.com/q/26844248
has comment: http://stackoverflow.com/comment/42252156
has comment: http://stackoverflow.com/comment/42252177
score: 0
has comment: http://stackoverflow.com/comment/42252428
type: Answer

http://stackoverflow.com/comment/42406261
has text: Hi thanks for this. Now i have antoher Problem. i always get this error: The request sent by the client was syntactically incorrect ().
comment on: http://stackoverflow.com/a/26930024
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42347526
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26891959
has text: You can try it. Is the jquery creating the HTML for you or is that coming from the server?

http://stackoverflow.com/comment/42482029
type: QuestionComment
has text: searchAPI() directly returns the HTML page with image and description
type: Comment
comment on: http://stackoverflow.com/q/26972941
score: 0

http://stackoverflow.com/a/26962328
has comment: http://stackoverflow.com/comment/42462780
has comment: http://stackoverflow.com/comment/42683042
accepted answer of: http://stackoverflow.com/q/26962286
has comment: http://stackoverflow.com/comment/42462871
answers question: http://stackoverflow.com/q/26962286
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/42462754
upvote count: 1
score: 1
has body: I see two problems: There is no function called value() in jQuery. It's val(). For JavaScript, It is .value. You are trying to get the length of the number, which will give you 3 if the number was 123. $(document).ready(function() { setInterval(function() { if ($("#points").val() &gt; 500) { alert("Too many points!"); } }, 100); });

http://stackoverflow.com/comment/42430043
type: Comment
type: QuestionComment
has text: @RobG I have no problem displaying the dates at all. The problem is pulling the correct data coz the dates are saved as UTC in the database. So if i have Nov 15, 2014 from the datepicker it doesn't mean all the dates in the database for Nov15 is "15", some could be "14" and won't be included in my results.
comment on: http://stackoverflow.com/q/26942950
score: 0

http://stackoverflow.com/q/26880842
downvote count: 0
has answer: http://stackoverflow.com/a/26880976
type: Question
has title: Exclude keypress from certain element
score: 1
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I want to catch spacebar and below did catch it. However it's tied to document, the catch will trigger even if I press spacebar when I'm typing in an input box. How to exclude that? $(document).keypress(function(e) { if(e.which == 32) { alert('trigger'); } });
accepted answer: http://stackoverflow.com/a/26880976
type: AnsweredQuestion

http://stackoverflow.com/comment/42440225
type: AnswerComment
comment on: http://stackoverflow.com/a/26939603
type: Comment
has text: @tonoslfx, Sorry, I got busy and I didn't have time to propose a solution to your problem. See the added text at the end of rule 1.
score: 0

http://stackoverflow.com/a/26867904
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/42295409
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/26864880
has body: You code seems to be working fine. You need to make sure an include jQuery in jsfiddle. I set that and added some placeholder images and it was working. The only issue I'm seeing is with your CSS since your left arrow is over your thumbs. It's not a javascript problem. http://jsfiddle.net/wilchow/p1dLzfvy/1/ > < Item 1 Item 2 Item 3 Item 4 Item 5 Item 6

http://stackoverflow.com/comment/42572894
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26930198
has text: I think more of it as a JS API to the InDesign DOM. What you could do is passing JSON to a label and evaluate it later. `item[i].label = JSON.stringify({foo:"bar"});var obj = JSON.parse(item[i].label);`

http://stackoverflow.com/a/26856623
answers question: http://stackoverflow.com/q/26856509
type: Answer
score: 0
has body: This is happening because you are violating the structure of table in your prev Cell-21 Cell-22 you can not have tr inside div directly in a table u have to make another table inside div then use tr inside div, so whats happening is when you trying to parse tr inside div then html parser or your browser is correcting you structure automatically by taking div out of ur table you can check in firebug , Now in second example it not working previous because not ur html parser or browser will not correct the structure for you dynamically it will simply wont allow you to add tr inside div and remove bad element from the structure and place the data directly in div not in tr inside div

http://stackoverflow.com/a/26853981
has comment: http://stackoverflow.com/comment/42305647
has body: You probably have your controller on the wrong attribute there, unless you want a new controller for every item in the array. The second issue, "response.text returns an array from the controller." So, is this the array you want to repeat? &lt;div ng-controller="PostsCtrl"&gt; &lt;li ng-repeat="item in response.text"&gt; &lt;a href="#"&gt;{{item}}&lt;/a&gt; &lt;/li&gt; &lt;/div&gt; And then the third question, what is the value of the ng-repeat attribute supposed to be: it's supposed to be the value of any valid array on your $scope or viewModel. So, response.text would be a valid item to put on the ng-repeat since it is an array. As I have it above, you now have an item object for every item in reponse.text. If this is as far down as you want to go, you can simply print {{item}} -- if item has properties, you could do something like, for instance, {{item.someProperty}}
upvote count: 1
answers question: http://stackoverflow.com/q/26853850
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/26910007
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/26910146
type: AnsweredQuestion
score: 0
has body: It is hard to explain… so I opened a Fiddle: http://jsfiddle.net/qga046f3/ Goal: My goal is to get three divs of the same height. So I detect all the heights and choose the biggest one and apply this height to the other div-containers. If the user resizes the browser-window the heights of the divs should be re-adjust. But jQuery gives me always the same height from first time. Why? This is my jQuery code: var adjustheights = function(){ heights = []; $('.element').each(function(i){ heights.push($(this).outerHeight()); }); var maxHeight = Math.max.apply(Math, heights); $('.element').css('height', maxHeight); $('.maxheight').html(maxHeight); } adjustheights(); $(window).resize(function(){ adjustheights(); });
type: Question
has answer: http://stackoverflow.com/a/26910146
has comment: http://stackoverflow.com/comment/42369715
answer count: 1
has title: Detected height of a percentage-width-div is still the same after resizing the window? jQuery
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/26969576
has body: You can generate PDF's on the client using jsPDF . var employees = [ {"firstName":"John", "lastName":"Doe"}, {"firstName":"Anna", "lastName":"Smith"}, {"firstName":"Peter", "lastName":"Jones"} ]; var doc = new jsPDF(); employees.forEach(function(employee, i){ doc.text(20, 10 + (i * 10), "First Name: " + employee.firstName + "Last Name: " + employee.lastName); }); doc.save('Test.pdf');
answers question: http://stackoverflow.com/q/26969514
has comment: http://stackoverflow.com/comment/60292912
type: Answer
upvote count: 17
downvote count: 0
has comment: http://stackoverflow.com/comment/85766948
score: 17
has comment: http://stackoverflow.com/comment/72790776
has comment: http://stackoverflow.com/comment/60348688

http://stackoverflow.com/a/75733279
score: 7
upvote count: 7
answers question: http://stackoverflow.com/q/26915432
has body: Using Google Tags and Google Analytics 4, the following code will get the session_id (tested code), please note G-XXXXXXXXXX is a placeholder for your analytics ID: gtag('get', 'G-XXXXXXXXXX', 'session_id', (id) =&gt; { console.log(id); } ); will output to the console: 1678297554
type: Answer
downvote count: 0

http://stackoverflow.com/comment/42292690
has text: I use map.dragging.disable(); and that disables dragging for me on iOS 8.1. To disable zoom, I'm simply setting minZoom, maxZoom, and zoom to the same value. Did you try stepping into any of those disable calls or stepping into any of the leaflet event handlers?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26855832
score: 0

http://stackoverflow.com/q/26855157
has comment: http://stackoverflow.com/comment/42337470
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/26855313
has body: I hope you can help me. How to convert this flat JavaScript array, from: [ {"state":"First State","district":"First District","local_district_id":1,"zone_id":117,"center_id":"A","center_name":"Voting Center First"}, {"state":"First State","district":"First District","local_district_id":2,"zone_id":117,"center_id":"B","center_name":"Voting Center Second"}, {"state":"First State","district":"First District","local_district_id":6,"zone_id":117,"center_id":"C","center_name":"Voting Center Third"}, ] into a nested array, like so: [{ "state": "First State", "children": [{ "district_name": "First District", "children": [{ "local_district_id": 1, "zone_id": 117, "center_id": "A", "center_name": "Voting Center Name First", }, { "local_district_id": 2, "zone_id": 117, "center_id": "B", "center_name": "Voting Center Name Second", }, { "local_district_id": 6, "zone_id": 117, "center_id": "C", "center_name": "Voting Center Name Third", }] }] }]
upvote count: 1
has title: Manipulate JavaScript Array
type: Question
has comment: http://stackoverflow.com/comment/42339570
tagged with: javascript
has comment: http://stackoverflow.com/comment/42272575
answer count: 2
has answer: http://stackoverflow.com/a/26855313
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/26855326
tagged with: multidimensional-array
accepted answer: http://stackoverflow.com/a/26855326
has comment: http://stackoverflow.com/comment/42274202

http://stackoverflow.com/comment/42356229
comment on: http://stackoverflow.com/a/26901573
has text: and where you want this confirm box?? on button click??
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/26915765
type: Answer
has body: Don't understand this, but my logic was inverted, this works: function onlyNew(target) { if (grunt.option('forceCopy')) return false; else { return function(filepath) { var src = fs.statSync(filepath).mtime.getTime(); var dest = grunt.config(target.concat('dest')) + filepath.slice(grunt.config(target.concat('cwd')).length); dest = fs.statSync(dest).mtime.getTime(); return src &gt; dest; } } };
score: 0
answers question: http://stackoverflow.com/q/26915493

http://stackoverflow.com/a/26874686
type: Answer
has comment: http://stackoverflow.com/comment/42307216
has body: If you're running it on Chrome, you can launch Chrome with the --disable-web-security flag.
answers question: http://stackoverflow.com/q/26874647
score: 0

http://stackoverflow.com/comment/42383538
has text: @dandavis Sure, I used it for simplicity here.
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/26917436

http://stackoverflow.com/comment/42492835
comment on: http://stackoverflow.com/q/26977327
score: 0
type: Comment
type: QuestionComment
has text: Then you should put breakpoints and debug, to find exact line of code that breaks your page. You can do it in chrome dev tools or in firebug

http://stackoverflow.com/comment/42486255
type: AnswerComment
has text: I really appreciate the help. Will mark as correct answer after that.
type: Comment
comment on: http://stackoverflow.com/a/26974905
score: 0

http://stackoverflow.com/q/26914731
has comment: http://stackoverflow.com/comment/42378489
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42378588
tagged with: php
type: Question
has answer: http://stackoverflow.com/a/26915190
tagged with: javascript
has body: I have a function in jquery that submit a form that is working fine, but i need different types of reaction according to the response, sometimes i need to show a message, sometimes reload the window, and other relocate the window I have a problem with this last part, i dont know how can i detect that is a url, and change the location. this is my script jquery function process_form(type_form, id_content_error){ var url = "url.php?form="+tipo_form; var response= document.getElementById(id_content_error); response.style.display='block'; $.ajax({ type: "POST", url: url, data: $('#'+type_form).serialize(), success: function(data) { if (data==1){ window.location.reload(); }else{ response.innerHTML=data; } } }); return false; // Evitar ejecutar el submit del formulario. }; My php returns 3 types of sentences, "1": when i need to reload the window. "messaje": when i need to show something. "some_url.php":when i need to relocate the window. sorry for my english, and thanks
score: 0
has title: Ajax response change location
answer count: 1
tagged with: jquery
tagged with: ajax

http://stackoverflow.com/comment/42401563
score: 0
type: Comment
type: QuestionComment
has text: am using using asp.net
comment on: http://stackoverflow.com/q/26927712

http://stackoverflow.com/comment/42543823
comment on: http://stackoverflow.com/a/26994983
score: 0
type: AnswerComment
type: Comment
has text: @sp00m Thanks, but I am using javascript. And I think the logic is the same as using original but just replacing with group number.

http://stackoverflow.com/q/26890779
has title: Prepare parameter for jquerys .load()
has answer: http://stackoverflow.com/a/26891867
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42337015
favorite count: 0
has comment: http://stackoverflow.com/comment/42335923
has answer: http://stackoverflow.com/a/26891763
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42336930
has body: I'm trying to load a html file to an other html-file. For example: $(function() { $('#main li').on('click', function() { var loadstring = $(this).data('url') + ' ' + $(this).data('target'); $('#container').load( loadstring ); }); }); Home Some In my some.html is a element that's contains data and has the id bar. In my home.html there is no element with the id foo. What i want to achieve is: I want is to check if the loaded file has elements with a specific id. Or class, depending on passed data. If yes, loadsting should look like: home.html #foo If not, loadsting should look like home.html so the whole page gets loaded. Is there a way where I can use load() and check existing elements ? I tried some like this var loadstring = $(this).data('url') + ' ' + $(this).data('target'); var e = $('#container').load( loadstring ); alert(e.prop('childElementCount')); but this resulted 0 and on the second try it sayed that it found a element because actually its looking in my container and not in the load file :D For those who like to try theire luck I just build a small 'testFiddle' ^^ HERE
score: 2
has comment: http://stackoverflow.com/comment/42335537
type: Question
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/42335685
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42335759
has comment: http://stackoverflow.com/comment/42335579
has comment: http://stackoverflow.com/comment/42336815

http://stackoverflow.com/q/26885135
possible better answer: http://stackoverflow.com/a/26885514
tagged with: google-maps-api-3
accepted answer: http://stackoverflow.com/a/26885459
score: 0
answer count: 2
tagged with: google-maps
tagged with: javascript
tagged with: jquery
has body: I have a Google Map with a bunch of markers on it. I also have a corresponding sidebar that lists those markers. When you click one of them, its corresponding marker on the map opens the info window. This works perfectly. When you click one of these links in the sidebar I want to add a class of 'bounce' to it so it becomes visibly the active/open link. Likewise if I click a marker on the map I want the same class to get added to the list item. When another marker or link is clicked I'd like that class to be moved the most current clicked item. I have a jsFiddle of my map code here: http://jsfiddle.net/3xkuybrf/2/ All my code does below is add a class to the first clicked link and doesn't do what I want. I want to add a class to the active/open link/marker and when another link/marker is clicked I want the class to be removed and added to the newest clicked item: $(document).on('click', '#p'+index, function(){ infowindow.open(map, marker); map.setCenter(marker.getPosition()); if ($('#listdata li').hasClass('bounce')) { $(this).removeClass( "bounce" ); } else { $(this).addClass( "bounce" ); } }); What am I doing wrong?
has title: Add class to current open infowindow
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26885459
has answer: http://stackoverflow.com/a/26885514
type: Question

http://stackoverflow.com/q/26969405
tagged with: javascript
score: 0
has title: Overlay on VLC Player not displaying in IE11 in Windowless mode
answer count: 1
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I'm embedding the VLC player on a webpage, the container in which it resides has a header with the option to launch a popup dialog. I cannot get the dialog to display on top of the player in Internet Explorer 11. It renders correctly in Chrome, Firefox and Safari. Player: &lt;object width="0" height="0" id="vlc0" classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab" events="True" z-index="0"&gt; &lt;embed width="100%" height="380" id="vlcEmb" type="application/x-google-vlc-plugin" target="rtsp://172.27.1.75/live.sdp" loop="no" autoplay="yes" z-index="-1" windowless="true" version="VideoLAN.VLCPlugin.2"&gt; Div: &lt;div id="editID" class="btn-primary pull-right headerButton" style="z-index:100"&gt; &lt;/div&gt; I've ensured the z-index of the div to be overlayed is higher than the player. Is this a bug in with the player and is there a workaround?
has answer: http://stackoverflow.com/a/27190370
tagged with: vlc
tagged with: video
type: Question
tagged with: internet-explorer

http://stackoverflow.com/a/49288370
has comment: http://stackoverflow.com/comment/111984719
has comment: http://stackoverflow.com/comment/111954528
downvote count: 0
upvote count: 55
has comment: http://stackoverflow.com/comment/112079171
score: 55
has comment: http://stackoverflow.com/comment/97163976
type: Answer
has body: In Vue.js 2 Inside a Vue Instance or Component: Use this.$el to get the HTMLElement the instance/component was mounted to From an HTMLElement: Use .__vue__ from the HTMLElement E.g. var vueInstance = document.getElementById('app').__vue__; Having a VNode in a variable called vnode you can: use vnode.elm to get the element that VNode was rendered to use vnode.context to get the VueComponent instance that VNode's component was declared (this usually returns the parent component, but may surprise you when using slots. use vnode.componentInstance to get the Actual VueComponent instance that VNode is about Source, literally: vue/flow/vnode.js. Runnable Demo: Vue.config.productionTip = false; // disable developer version warning console.log('-------------------') Vue.component('my-component', { template: ` `, mounted: function() { console.log('[my-component] is mounted at element:', this.$el); } }); Vue.directive('customdirective', { bind: function (el, binding, vnode) { console.log('[DIRECTIVE] My Element is:', vnode.elm); console.log('[DIRECTIVE] My componentInstance is:', vnode.componentInstance); console.log('[DIRECTIVE] My context is:', vnode.context); // some properties, such as $el, may take an extra tick to be set, thus you need to... Vue.nextTick(() => console.log('[DIRECTIVE][AFTER TICK] My context is:', vnode.context.$el)) } }) new Vue({ el: '#app', mounted: function() { console.log('[ROOT] This Vue instance is mounted at element:', this.$el); console.log('[ROOT] From the element to the Vue instance:', document.getElementById('app').__vue__); console.log('[ROOT] Vue component instance of my-component:', document.querySelector('input').__vue__); } }) Open the browser's console
has comment: http://stackoverflow.com/comment/112094351
answers question: http://stackoverflow.com/q/26915193
has comment: http://stackoverflow.com/comment/111995507
has comment: http://stackoverflow.com/comment/112109175
has comment: http://stackoverflow.com/comment/104207053

http://stackoverflow.com/a/26891169
score: 0
has comment: http://stackoverflow.com/comment/42336674
answers question: http://stackoverflow.com/q/26890358
has body: var id = "stock_stockbundle_facturefounisseur_ligneffm_1_ligne4ff_1_idarticle"; var idArrayCheck = id.split(""); var idNumbers = []; inArray(idArrayCheck); function inArray(array) { for (var i = 0; i &lt; array.length; i++) { if (array[i] == 1 || array[i] == 2 || array[i] == 3 || array[i] == 4 || array[i] == 5 || array[i] == 6 || array[i] == 7 || array[i] == 8 || array[i] == 9 || array[i] == 0) { idNumbers.push(array[i]); } } } idNumbers = idNumbers.join(""); alert(idNumbers); idNumbers will be a string equal to "141"
type: Answer
has comment: http://stackoverflow.com/comment/42336809

http://stackoverflow.com/comment/42284197
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26861939
has text: @JamesThorpe I don't mean to say that's an issue, but if the OP want to run code when the dialog is closed, what is special about closing by pressing ESC, as opposed to the more common close window button?

http://stackoverflow.com/a/26943443
score: 0
type: Answer
has body: It is behaving correctly see this for more information. The window object represents an open window in a browser. If a document contain frames ( tags), the browser creates one window object for the HTML document, and one additional window object for each frame. source.
answers question: http://stackoverflow.com/q/26943442

http://stackoverflow.com/comment/42475539
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26969549
has text: maybe you can use '$('img').load(function() {' instead of '$(window).load(function() {'

http://stackoverflow.com/comment/42414479
type: AnswerComment
comment on: http://stackoverflow.com/a/26934858
score: 0
type: Comment
has text: You do need to stop the timer chaining if the task is complete though... put the `setTimeout` on an `else`.

http://stackoverflow.com/a/26885550
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/26884355
downvote count: 0
score: 1
has body: you can make a div with a class img and give it a property display:none and can call it using jquery.

http://stackoverflow.com/q/26957957
answer count: 1
tagged with: c#
has comment: http://stackoverflow.com/comment/42455055
tagged with: user-controls
type: UnansweredQuestion
has title: Calling a jquery function in a usercontrol from an aspx page
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42454981
has comment: http://stackoverflow.com/comment/42455097
tagged with: asp.net
linked to: http://stackoverflow.com/q/8031235
type: Question
has answer: http://stackoverflow.com/a/26958064
has body: This is my first encounter with User Controls. I have a user control that contains a jQuery function called Animate(). I want to call that function from an aspx page that contains the user control. Is that possible? When I click the button in the following code the function is not fired and no error. What am I missing? Upload_Animation.ascx User Control aspx page <uc:UploadAnimation ID="uc1" runat="server"/> <asp:Button OnClientClick="AnimateGif();" runat="server" Text="Do stuff" OnClick="btn_Click"/> web.config <add tagPrefix="uc" src="~/UserControls/Upload_Animation.ascx" tagName="UploadAnimation" />
score: 0

http://stackoverflow.com/comment/123865938
type: Comment
comment on: http://stackoverflow.com/a/41498839
type: AnswerComment
has text: that's just a typo, fixed, ty
score: 0

http://stackoverflow.com/comment/42368376
type: Comment
type: QuestionComment
has text: I need PHP for the backend part of it (getting the players and such), going to use AJAX with Jquery for that. Anyway, thanks, guess I'm going with this.
comment on: http://stackoverflow.com/q/26909046
score: 0

http://stackoverflow.com/q/26987661
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
upvote count: 1
downvote count: 1
accepted answer: http://stackoverflow.com/a/26987757
has body: myhead fillertext morefiller Kuvertering Printbrevflet I have used this method to change similar text in a testdocument however i seems to completely ignore the script here, i have tried several methods however none succesful even though the button is responsive. ive run myself into a mindbogling corner any suggestions/help is greatly appreciated
type: AnsweredQuestion
has title: textreplacing using premade strings and a button in html using javascript
has comment: http://stackoverflow.com/comment/42507923
type: Question
tagged with: replace
answer count: 1
has comment: http://stackoverflow.com/comment/42507927
tagged with: javascript
has answer: http://stackoverflow.com/a/26987757
score: 0

http://stackoverflow.com/q/26913467
has body: I am trying to calculate a distance from my workplace to a destination that varies. I have a form with 3 fields: date destination distance I would like get the distance by just typing in the destination address - this should happen before I submit the form (for best user experience). I am trying to use google maps api but can't get the input in the destination field into the js code var DestinationA. I am also using the "onchange" to get the inout before submitting. My next step is then to get the distance result into the form field distance. Any help is much appreciated. Here is my test-site: www.e-kl.dk/s/_kort.asp Here is my code: <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> test date destination distance
has answer: http://stackoverflow.com/a/26915241
type: AnsweredQuestion
type: Question
tagged with: form-fields
accepted answer: http://stackoverflow.com/a/26915241
tagged with: javascript
tagged with: google-maps-api-3
score: 0
tagged with: onchange
has title: calculate distance before submitting form
answer count: 1

http://stackoverflow.com/a/26941641
type: Answer
upvote count: 0
answers question: http://stackoverflow.com/q/26941491
score: -1
has body: $(document).ready(function(){ //just need an initial run to close it first $("#panel").slideDown(); //or if it was open to start use this instead $("#panel").slideUp(); //rest the same $("#flip").click(function(){ $("#panel").slideToggle("slow"); }); });
downvote count: 1

http://stackoverflow.com/q/26857332
has title: How can sum an array of input values?
has answer: http://stackoverflow.com/a/26857391
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26857391
type: Question
tagged with: arrays
has body: I'm trying to use an array of input values to do a live sum of the values. Here is the example: SUM &lt;input id="proyected_analysis_expense_1" name="proyected_analysis_expense[name][]" type="text" value=""&gt; &lt;script type="text/javascript"&gt; jQuery("#proyected_category_expense_1").live("change", function(){ pce1_value = parseFloat(jQuery("#proyected_category_expense_1").val()); total = pce1_value ; jQuery("#proyected_analysis_expense_1").val(total.toFixed(2)); }); &lt;/script&gt; FIELD1: &lt;input id="proyected_category_expense_1" name="flow_budget[flow_budget_details_attributes][1][amount]" type="text" value=""&gt;&lt;/td&gt;&lt;/tr&gt; Here is the live demo The problem is that the sum is not working on the demo I want this using dynamic information &lt;script type="text/javascript"&gt; jQuery("#proyected_category_expense_1").live("change", function(){ pce1_value = parseFloat(jQuery("#proyected_category_expense_1").val()); pce2_value = parseFloat(jQuery("#proyected_category_expense_2").val()); pce3_value = parseFloat(jQuery("#proyected_category_expense_3").val()); .... ///this will continue without type total = pce1_value + pce2_value + .... ; ///this will continue without type jQuery("#proyected_analysis_expense_1").val(total.toFixed(2)); jQuery("#proyected_analysis_expense_2").val(total.toFixed(2)); .... ///this will continue without type }); &lt;/script&gt; Please somebody can help me how to do the sum in input arrays?
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/26857652
possible better answer: http://stackoverflow.com/a/26857652

http://stackoverflow.com/comment/42318243
type: Comment
type: QuestionComment
has text: no answer ! i need it
score: 0
comment on: http://stackoverflow.com/q/26865419

http://stackoverflow.com/a/26938379
answers question: http://stackoverflow.com/q/26938302
type: Answer
has body: Use the object equality flag so it doesn't use reference equality: $scope.$watch('datos', function(){ $scope.updated++; }, true); Or, use $watchCollection as Deuterium suggests: $scope.$watchCollection('datos', function(){ $scope.updated++; });
upvote count: 3
score: 3
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26938302

http://stackoverflow.com/comment/42365336
has text: See developers here: https://github.com/mrdoob/three.js/commits/master/examples/js/controls/VRControls.js
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26894526
score: 1

http://stackoverflow.com/q/26887546
has comment: http://stackoverflow.com/comment/42330962
has comment: http://stackoverflow.com/comment/42331768
has title: Create infinite loop with moving divs using javascript or jQuery
type: AnsweredQuestion
tagged with: settimeout
has comment: http://stackoverflow.com/comment/42334985
type: Question
tagged with: jquery-animate
has comment: http://stackoverflow.com/comment/42334357
tagged with: javascript
has body: I need to simulate a band that moves from left to right continuously, carrying 15 divs on it and moving them in a circle, like a carousel. When they reach the right margin to appear from the left. I have the code that works for 1 div(more or less), but Im having troubles making the loop that includes all 15 divs. What am I missing? Here's what I have so far: HTML 1 2 .... 14 15 CSS body { font:76% normal verdana,arial,tahoma; width:600px; height:600px; position:relative; margin:0 auto; border:1px solid; } div { position:absolute; left:0px; top:8em; width:55px; height:70px; line-height:3em; background:#99ccff; border:1px solid #003366; white-space:nowrap; padding:0.5em; } javascript var foo = null; // object function doMove(id) { foo = document.getElementById(id); foo.style.left = parseInt(foo.style.left)+1+'px'; setTimeout(doMove(id),20); // call doMove in 20msec if(foo.style.left == "600px") { foo.style.left = 0; } } function init() { for(i=0;i<15;i++){ var foo = document.getElementById('fooObject' + i); // get the "foo" object foo.style.left = -i*55+'px'; // set its initial position to 0px doMove('fooObject' + i); // start animating console.log('fooObject' + i); } } window.onload = init; Thank you in advance!
score: 0
answer count: 1
tagged with: setinterval
has answer: http://stackoverflow.com/a/26887612
accepted answer: http://stackoverflow.com/a/26887612

http://stackoverflow.com/comment/42395715
comment on: http://stackoverflow.com/a/26914240
type: Comment
has text: What happens when you change this line: ' Hello {this.props.name} ' ? Doesn't it just work on page load: http://jsfiddle.net/3fmfous3/ ?
score: 1
type: AnswerComment

http://stackoverflow.com/q/26916593
answer count: 2
has comment: http://stackoverflow.com/comment/42381807
linked to: http://stackoverflow.com/q/26893299
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/42381996
has title: Ignore capital and small initial letters
accepted answer: http://stackoverflow.com/a/26916635
has comment: http://stackoverflow.com/comment/42381896
has comment: http://stackoverflow.com/comment/42381829
has comment: http://stackoverflow.com/comment/42381762
tagged with: javascript
has body: I would like to set that the use of capital and small initial letters should be ignored in this search script. So if I write "hello" or "HEllo" ... it should bring the same results. Here is the script: &lt;input type="text" class="boxformal boxformal-cf" placeholder="Diese Seite durchsuchen ..." onkeyup=" for( var elms=document.getElementById('content') .getElementsByTagName('article') , L=elms.length ; L-- ; elms[L].className= ~elms[L].textContent.indexOf(this.value) ? found='searchopt kurse-standart standart-grau groesse-15' : 'donotshow' ); this.nextSibling.innerHTML= found ? '' : 'Es wurde nichts gefunden!' ; "&gt; Thank you for helping! P.s.: Some phrases are in German :)
has answer: http://stackoverflow.com/a/26920738
has comment: http://stackoverflow.com/comment/42381837
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26916635
favorite count: 0
possible better answer: http://stackoverflow.com/a/26920738
type: Question
score: 0

http://stackoverflow.com/q/26949275
type: AnsweredQuestion
tagged with: javascript
has body: Im trying to retrieve users from Instagram API whose names contain the certain word from a JSON file , by using this jQuery I had to make a PHP file as a server in my local host i named it ' get_info.php' and it return an Array of elements but for some reason I can't seem to display the output after manuplating the data :( I'm new to Ajax and JSON, could you possibly help me find the error in my code? here's my JavaScript &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript" &gt; //Browser Support Code function ajaxFunction(){ var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); }catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); }catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); }catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } var jsonObj ; var q = document.getElementById('keyword').value; ajaxRequest.open('POST', 'get_info.php?keyword='+ q , true); // callback function to handle the server response ajaxRequest.onreadystatechange = function() { if (ajaxRequest.readyState == 4) { if ((ajaxRequest.status &gt;= 200 &amp;&amp; ajaxRequest.status &lt; 300) || ajaxRequest.status === 304) { var jsonObj = ajaxRequest.responseText; jsonStr = JSON.parse( jsonObj ); } } } $(document).ready(function () { $("#submit").click(function(){ $.ajax({ type: 'GET', url:'get_info.php', data: { keyword: q }, success: function(jsonStr) { $.each( jsonStr.data , function(index, element) { var res ; res += '&lt;img src="'+element.username+'"/&gt;'; res += '&lt;img src="'+element.profile_picture+'"/&gt;'; }); $("#photos").html(res); } }); }); }); } &lt;/script&gt; The HTML only has these tags. &lt;form id="form" method="POST" onclick="ajaxFunction();" &gt; &lt;input value="" id="keyword" type="text" required&gt; …
tagged with: ajax
possible better answer: http://stackoverflow.com/a/26956529
has answer: http://stackoverflow.com/a/26956529
type: Question
has comment: http://stackoverflow.com/comment/42452549
accepted answer: http://stackoverflow.com/a/26949390
has comment: http://stackoverflow.com/comment/42649800
has comment: http://stackoverflow.com/comment/42491051
has comment: http://stackoverflow.com/comment/42472000
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/42585587
has comment: http://stackoverflow.com/comment/42453922
has comment: http://stackoverflow.com/comment/42440163
has comment: http://stackoverflow.com/comment/42467513
has comment: http://stackoverflow.com/comment/42467561
has title: Data manipulation for Instgram API with Ajax and JSON
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/42454321
has answer: http://stackoverflow.com/a/26949390
has comment: http://stackoverflow.com/comment/42467546

http://stackoverflow.com/q/26866966
has comment: http://stackoverflow.com/comment/42293236
has comment: http://stackoverflow.com/comment/42293125
type: Question
has answer: http://stackoverflow.com/a/26867345
tagged with: http://stackoverflow.com/tag/html
score: -2
tagged with: css
possible better answer: http://stackoverflow.com/a/26867345
downvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/26867109
accepted answer: http://stackoverflow.com/a/26867109
tagged with: javascript
has title: My CSS is all messed up and will not stay centered
type: AnsweredQuestion
has body: I am making a website, and I cannot get the navigation bar to stay where I want it to be. This is how it SHOULD look even when viewed on a smaller screen. Please remember we are only talking about the Navigation bar This is how it currently looks on a smaller screen Finally, here is my code! About Designs Events Booths Holidays Contact Need help? Contact us now! And the code just for the navigation #midbar { position: relative; top: -20px; width: 100%; height: 115px; background-color: #e0dfcb; z-index: 1111; opacity: 0.8; } #navigation { position: absolute; left: 435px; border-top-style: dotted; border-bottom-style: dotted; border-width: 2px; top: 45px; } #navigation ul li { position: relative; display:inline-block; margin:0 23px 0 0; z-index: 3333; } #navigation ul li a { padding-left:15px; text-decoration: none; text-align: center; padding-right:15px; color:#000000; display:block; font-family: 'Gentium Book Basic', serif; font-size:18px; } #navi { position: absolute; left: 1100px; border-top-style: dotted; border-bottom-style: dotted; border-width: 2px; top: 45px; } #navi ul li { position: relative; display:inline-block; margin:0 23px 0 0; z-index: 3333; } #navi ul li a { padding-left:15px; text-decoration: none; text-align: center; padding-right:15px; color:#000000; display:block; font-family: 'Gentium Book Basic', serif; font-size:18px; } About Designs Events Booths Holidays Contact
upvote count: 0
favorite count: 0

http://stackoverflow.com/a/26981368
accepted answer of: http://stackoverflow.com/q/26892464
answers question: http://stackoverflow.com/q/26892464
score: 1
has body: There was a conflict with my other CSS styles so I added this code to the datepicker3.css file: .datepicker.dropdown-menu { visibility: visible; opacity: 1; width: auto; } This seemed to have fixed the problem.
upvote count: 1
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/26895567
possible better answer: http://stackoverflow.com/a/26895595
accepted answer: http://stackoverflow.com/a/26895645
tagged with: javascript
tagged with: angularjs-scope
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/26895645
favorite count: 0
has answer: http://stackoverflow.com/a/26895595
tagged with: angularjs
type: AnsweredQuestion
has body: My problem: I have multiple instances a controller in my site. When I update 'x', only the current instance/div gets updated. JSFiddle: http://jsfiddle.net/evgahe2u/ (simplified example, each ng-controller is in its own view.) HTML &lt;!-- this is a simplified example --&gt; &lt;div ng-app="myApp"&gt; &lt;!-- this is in view1.html --&gt; &lt;div ng-controller="myController"&gt; &lt;input type="text" ng-model="x" /&gt; {{x}} &lt;/div&gt; &lt;!-- this is in view2.html --&gt; &lt;div ng-controller="myController"&gt; &lt;input type="text" ng-model="x" /&gt; {{x}} &lt;/div&gt; &lt;/div&gt; JS var myApp = angular.module('myApp', []); myApp.controller('myController', function($scope) { $scope.x = 'test'; }); My question: How can I have it so when I update View1.html's X value, it will then update view2.html's view?
downvote count: 0
score: 1
has title: Angularjs - Updating multiple instances of the same controller
type: Question

http://stackoverflow.com/q/26956193
has comment: http://stackoverflow.com/comment/42455195
has body: I was playing with some javascript when I thought "Lets make a simple game!" So I started, and now I'm stuck and I could use your help :p So this is the 'plan' I made: Ask user1's name var name1 = prompt("what is your name?"); Ask user2's name var name2 = prompt("what is your name?"); Ask user1's choice var user1 = prompt("rock, paper, scissors"); ask user2's choice var user2 = prompt("rock, paper, scissors"); display their choices: if (user1 === "rock") { document.write("rock"); } else if (user1 === "scissors") { document.write("scissors"); } else if (user1 === "paper") { document.write("paper"); } else { alert("DUDE THAT AINT NO OPTION YO"); } document.write(" vs "); if (user2 === "rock") { document.write("rock"); } else if (user2 === "scissors") { document.write("scissors"); } else if (user2 === "paper") { document.write("paper"); } else { alert("DUDE THAT AINT NO OPTION YO"); } document.write(" = "); calculate outcome: if (user1 === user2) { document.write("tie, try again!"); } if (user1 === "rock") { if (user2 === "scissors") { document.write("yay " + name1 + " wins!"); } else if (user2 === "rock") { document.write("tie..."); } else { document.write("yay " + name2 + " wins!"); } } else if (user1 === "paper") { if (user2 === "rock") { document.write("yay " + name1 + " wins!"); } else if (user2 === "rock") { document.write("yay " + name2 + " wins!"); } else { document.write("tie..."); } } else if (user1 === "scissors") { if (user2 === "scissors") { document.write("tie..."); } else if (user2 === "paper") { document.write("yay " + name1 + " wins!"); } else { document.write("yay " + name2 + " wins!"); } } else { document.write("wut"); } Here is where I get stuck: I want to create a button to restart from step 3. Step 1 and 2 must NOT be repeated! How do I do this? Thanks in advance! (code may be messy up there ^ so here's the jsfiddle link: http://jsfiddle.net/robinvandernoord/c0n2wuuf/) PS: should I use document.write, or something else instead? //update I used ale…
has comment: http://stackoverflow.com/comment/42455286
has comment: http://stackoverflow.com/comment/42451773
linked to: http://stackoverflow.com/q/802854
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/26956222
tagged with: javascript
has answer: http://stackoverflow.com/a/26956222
accepted answer: http://stackoverflow.com/a/26956314
type: Question
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/42456899
has title: two player rock paper scissors in javascript
has answer: http://stackoverflow.com/a/26956314
has comment: http://stackoverflow.com/comment/42451896

http://stackoverflow.com/comment/42256922
type: Comment
has text: yes, I think I what you are saying is that because here: `function go(orange) { orange.prop = "Now i.....` the `orange.prop` property is not declared inside the function, and therefore it will be assigned to the `orange` object on the outer scope? I just wondered why `prop` couldn't be defined on the fly inside the function?
type: AnswerComment
comment on: http://stackoverflow.com/a/26846102
score: 0

http://stackoverflow.com/q/26940538
has answer: http://stackoverflow.com/a/26940577
upvote count: 1
tagged with: php
downvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26940577
linked to: http://stackoverflow.com/q/15751011
has answer: http://stackoverflow.com/a/26941005
type: Question
has answer: http://stackoverflow.com/a/26940747
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26940747
score: 0
answer count: 3
has body: I'm not sure If I asked this proper way. Let me explain... I notice that facebook is "not" responsive web page because when I change width of browser on my laptop facebook.com won't change when I'm doing it. On the other hand when I use my phone and run in browser facebook.com know already that I'm using something mobile and it gets proper size to my device. Question: How is it working, Is it some kind of trick to optimize our websites ?
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
has title: How to tell if a visitor is accessing a website from a mobile phone?
has comment: http://stackoverflow.com/comment/42425357
tagged with: facebook

wamp
tag name: wamp
tags question: http://stackoverflow.com/q/26877627
type: Tag

http://stackoverflow.com/a/26991093
score: 2
downvote count: 0
has body: You should be able to handle the onchange event before the postback occurs &lt;asp:DropDownList runat="server" onchange="alert('Clicked')" /&gt; If you don't need a postback then don't use a server control.
has comment: http://stackoverflow.com/comment/42513946
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/26991037
has comment: http://stackoverflow.com/comment/42513923
has comment: http://stackoverflow.com/comment/42513879

http://stackoverflow.com/a/26937919
answers question: http://stackoverflow.com/q/26937710
has body: I think your code does work, when I tried it it seemed that the running-backs.html wasn't loading - were you running from a webserver or your local file system? If I use My Favorite Players why does this work? {{team.qb}} ...but this doesn't?
has comment: http://stackoverflow.com/comment/42420878
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/42421689

http://stackoverflow.com/comment/42265974
comment on: http://stackoverflow.com/q/26848479
has text: I add this library through script tag, and add this dependency to angular.module as you can see.
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/q/26856902
has answer: http://stackoverflow.com/a/26859031
has body: I have this bit of code. Red, Green and blue have to be shown in order when clicking on button, but click event propagates directly to blue without green. When I use e.stopproagation then jQuery event listener is still attached to element class which doesn't exist. Basket | Placelyrics submit
type: AnsweredQuestion
tagged with: onclicklistener
type: Question
has answer: http://stackoverflow.com/a/26856943
tagged with: javascript
tagged with: event-handling
tagged with: jquery
possible better answer: http://stackoverflow.com/a/26857124
score: 0
accepted answer: http://stackoverflow.com/a/26856943
tagged with: jquery-events
answer count: 3
has answer: http://stackoverflow.com/a/26857124
has title: Jquery Element class doesn't exists but event still fires

http://stackoverflow.com/q/26881737
accepted answer: http://stackoverflow.com/a/26882102
type: AnsweredQuestion
tagged with: php
type: Question
has answer: http://stackoverflow.com/a/26882102
has body: I was making a component in joomla 2.5 Which contains a default view.html and a tmpl/default.php as an layout file I need to add some javascript code into the default.php file and I added this Using the $document->addScript(JURI::base() . "components/com_mycomp/javascript/myfile1.js"); $document->addScript(JURI::base() . "components/com_mycomp/javascript/myfile11.js"); $document->addScript(JURI::base() . "components/com_mycomp/javascript/myfile12.js"); it was working fine ( I tried it by adding a document.write() inside every js) , But the problem is I have a code inside my default.php inside I tried to print it inside but nothing works so far... I also tried using the JURI::base. "path" inside php tags Am I doing It all wrong? How can I do it in joomla way Help and advices needed.
score: 0
answer count: 1
tagged with: javascript
has title: Joomla 2.5 Loading javaScript Files inside default.php
tagged with: joomla

http://stackoverflow.com/comment/42271682
type: Comment
has text: yeah you have to enable openssl in your localhost @JagdeepKaur
type: AnswerComment
comment on: http://stackoverflow.com/a/26839003
score: 0

http://stackoverflow.com/a/26952420
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26952088
upvote count: 1
answers question: http://stackoverflow.com/q/26952088
has comment: http://stackoverflow.com/comment/42445920
has comment: http://stackoverflow.com/comment/42445591
has comment: http://stackoverflow.com/comment/42445851
type: Answer
downvote count: 0
score: 1
has body: I've simplified your code quite a bit. Is this what you want? app.directive('version', function($compile) { var oneTemplate = ''; var twoTemplate = ''; return { restrict: 'E', scope: true, controller: function ($scope, $element, $attrs) { $scope.$watchCollection($attrs['track'], function(newVal, oldVal) { var template; $element.empty(); delete $scope.versions; delete $scope.version; if (newVal) { if(newVal.length === 1) { $scope.version = newVal[0]; template = angular.element(oneTemplate); } else { $scope.versions = newVal; template = angular.element(twoTemplate) } $element.append(template); $compile(template)($scope); } }); }, compile: function(element, attr) { oneTemplate = element.find('one').html(); twoTemplate = element.find('many').html(); } }; }) EDIT: It should be $watchCollection instead of $watch, since you are watching an array. Additionally if you don't want to create a directive, you could simply use ng-switch: ONE {{version}}: {{ text }} MANY {{version}}: {{ text }} http://jsfiddle.net/0ckbz2n7/60/

http://stackoverflow.com/comment/42515029
comment on: http://stackoverflow.com/q/26991862
type: Comment
has text: You can also have it in a separate css file and add a link to the file in your html like
score: 0
type: QuestionComment

http://stackoverflow.com/comment/42441621
score: 0
type: AnswerComment
has text: Intresting : it looks like this may be an issue with my development environment (Appcelorator).
comment on: http://stackoverflow.com/a/26950124
type: Comment

http://stackoverflow.com/comment/42488927
type: AnswerComment
type: Comment
has text: I added to my previous comment, refresh the page please
comment on: http://stackoverflow.com/a/26976757
score: 0

http://stackoverflow.com/comment/42428486
comment on: http://stackoverflow.com/q/26942416
has text: you are using `.show()` in a wrong way...see here http://jsfiddle.net/ae8kkz4g/
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42442030
comment on: http://stackoverflow.com/q/26945825
type: Comment
type: QuestionComment
score: 0
has text: you must be on a browser that supports 3D transforms.

http://stackoverflow.com/q/26872135
answer count: 1
has body: I'm new to MeteorJS. I was reading up Discover Meteor while trying to build an app of my own (instead of the demo app Microscope). When setting up a router.js I encountered this problem. {{&gt; yield}} in the layout Template is causing a blank page on / when I tried using name for routing: Router.route('/', {name: 'home' }) (where home is a template defined in the client repository.)
tagged with: javascript
score: 0
tagged with: meteor
has answer: http://stackoverflow.com/a/26872136
has title: {{> yield}} causes a blank page when Router.route(uri, {name: templateName })
type: Question
type: AnsweredQuestion
tagged with: routes
accepted answer: http://stackoverflow.com/a/26872136

http://stackoverflow.com/tag/csv
type: Tag
tag name: csv
tags question: http://stackoverflow.com/q/26933092
tags question: http://stackoverflow.com/q/26956778
tags question: http://stackoverflow.com/q/26990663
tags question: http://stackoverflow.com/q/26866368
tags question: http://stackoverflow.com/q/26948631
tags question: http://stackoverflow.com/q/26926537
tags question: http://stackoverflow.com/q/26858107
tags question: http://stackoverflow.com/q/26975068

http://stackoverflow.com/comment/42502056
type: QuestionComment
type: Comment
has text: Could be what you're looking for is a splash screen. See http://stackoverflow.com/questions/5018069/splash-screen-while-loading-resources-in-android-app
comment on: http://stackoverflow.com/q/26983484
score: 0

http://stackoverflow.com/comment/42414937
type: Comment
has text: From the OP (you're just missing a loop): `"I got more than one of those brackets in the same body"`
comment on: http://stackoverflow.com/a/26935259
score: 1
type: AnswerComment

http://stackoverflow.com/comment/42289696
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26847897
has text: Ok thanks. I had a feeling I would have to do that I just wanted to make sure.
score: 0

http://stackoverflow.com/a/26837869
answers question: http://stackoverflow.com/q/26833743
downvote count: 0
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/42246560
has comment: http://stackoverflow.com/comment/42251426
score: 1
has comment: http://stackoverflow.com/comment/42250620
has body: To show data you have set display style to block.. document.getElementById('dataTable').style.display="block";

http://stackoverflow.com/comment/42616466
type: Comment
type: AnswerComment
has text: @JakeHova Looks good! You might also take a look at jQuery's [position](http://api.jquery.com/position/) function. If you use it to get the x and y coordinates of each element, you can keep them all at `position: absolute` and animate using only the `top`, `right`, `bottom`, and `left` CSS properties. Then they wouldn't slide around when resizing, and could have them expand from wherever they happen to be located rather than the top left corner. Also, when repeated referencing the same DOM node, it will be faster to assign it to a variable first, i.e. `$documentDiv = $(documentDiv);`. Cheers!
comment on: http://stackoverflow.com/a/26980681
score: 0

http://stackoverflow.com/comment/42437353
has text: 1. Is your directive name really `result`, not `results`? 2. That's not the way we pass argument to function obtained by the `&` method.
comment on: http://stackoverflow.com/q/26947727
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26965773
has comment: http://stackoverflow.com/comment/42497453
upvote count: 1
has comment: http://stackoverflow.com/comment/42486092
has body: Don't use pack the extension into a .crx. Unpacked extensions work fine. Open the extensions page, and check the "Developer Mode" box at the top right. Click "Load unpacked extensions..." and select your extension's directory.
score: 1
answers question: http://stackoverflow.com/q/26964963
downvote count: 0
has comment: http://stackoverflow.com/comment/42498562
type: Answer

http://stackoverflow.com/q/26859462
type: Question
tagged with: javascript
tagged with: jquery
score: 0
has body: How to display the Data that is returned Here is the data returned : I can able to see the alert(data) but how can i make the image to appear in the screen ? Here is my Code Submit How can i do this ?
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/26859531
type: AnsweredQuestion
has title: Displaying the image to display in the page that is returned using jquery
accepted answer: http://stackoverflow.com/a/26859531

http://stackoverflow.com/comment/42515519
type: QuestionComment
comment on: http://stackoverflow.com/q/26885876
has text: I just created a unix Socket with socat...same issue. Any Ideas?
score: 0
type: Comment

http://stackoverflow.com/comment/42408616
comment on: http://stackoverflow.com/a/26931818
has text: I think it is not the right answer: The OP wants to validate multiple fields and with this code it is not possible.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/26871413
answer count: 1
tagged with: c#
tagged with: doctype
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/42303324
tagged with: javascript
type: UnansweredQuestion
has title: HTML1527: DOCTYPE expected. The shortest valid doctype is " "
has comment: http://stackoverflow.com/comment/42313507
has comment: http://stackoverflow.com/comment/42324931
type: Question
has comment: http://stackoverflow.com/comment/42302237
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26872636
has body: Good day, I am working on a c# web application, everything is working until I add in a normal JavaScript. The html code is something as follow: &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;title&gt;&lt;/title&gt; &lt;script src="scripts/JScript.js" type="text/javascript"&gt;&lt;/script&gt; &lt;asp:ContentPlaceHolder id="headContent" runat="server"&gt; &lt;/asp:ContentPlaceHolder&gt; &lt;/head&gt; &lt;body&gt; &lt;asp:ContentPlaceHolder id="title" runat="server"&gt;&lt;/asp:ContentPlaceHolder&gt; &lt;asp:ContentPlaceHolder id="bodyContent" runat="server"&gt;&lt;/asp:ContentPlaceHolder&gt; &lt;!-- some code here --&gt; &lt;/body&gt; The JScript.js is the JavaScript that put in. The JavaScript code is something as follow: function getCookie(catId) { var ebRand = Math.random() + ''; ebRand = ebRand * 1000000; document.write('&lt;scr' + 'ipt src="HTTP://bs.serving-sys.com/Serving/ActivityServer.bs?cn=as&amp;amp;ActivityID=553971&amp;amp;rnd=' + ebRand + '"&gt;&lt;/scr' + 'ipt&gt;'); } This JavaScript function will be trigger when a link button is click. I hit error in IE but Chrome and Mozilla is working fine. My error in IE console is HTML1527: DOCTYPE expected. The shortest valid doctype is "&lt;!DOCTYPE html&gt;". After search in Google, I try to put in &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; as new DOCTYPE, but it not working also. and I have try put &lt;meta http-equiv="X-UA-Compatible" content="IE=edge" /&gt; inside &lt;head&gt;&lt;/head&gt; But I still get the same error in IE also. Is is problem in ContentPlaceHolder? Other than that, I have go to W3C Markup Validation Service to do some validation of the address : http://validator.w3.org/check?uri=HTTP%3A%2F%2Fbs.serving-sys.com%2FServing%2FActivityServer.bs%3Fcn%3Das%26amp%3…
has comment: http://stackoverflow.com/comment/42301860
score: 0
has comment: http://stackoverflow.com/comment/42374332

http://stackoverflow.com/comment/42479855
comment on: http://stackoverflow.com/a/26968135
type: AnswerComment
score: 0
has text: Thats not what your original question says at all. It would have quite a lot easier if you wrote the desired result since you are using the word 'key' in a really confusing way. Key is usually used to describe a the name of property of an object (the left hand side) - when you are talking about the value of property (the right hand side) which you call "Key".
type: Comment

http://stackoverflow.com/q/26923743
type: Question
score: 5
has comment: http://stackoverflow.com/comment/42394567
has comment: http://stackoverflow.com/comment/42418453
tagged with: javascript
has title: Is there any way to suggest a file name with a data URI?
has comment: http://stackoverflow.com/comment/42394547
has body: I am using data attribute to simulate a file download from client-side JavaScript. Here's my source code : var data = "data:application/text,anything is here"; window.location.href = data; This works perfectly and simulates a file download. Is there any way I can specify the file name as well, as a part of the data URI or by using some other facility available from the browser? I am aware of the download attribute of &lt;a&gt; tags, but I was wondering if there are any options other than the default which is to use the value of data itself as the suggested file name.
answer count: 1
accepted answer: http://stackoverflow.com/a/26924119
favorite count: 0
has comment: http://stackoverflow.com/comment/42395155
tagged with: data-uri
upvote count: 5
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26924119
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42395085
downvote count: 0

http://stackoverflow.com/a/26959514
has body: You need to load the geometry library http://maps.googleapis.com/maps/api/js?key=YOURKEY&amp;libraries=geometry The distance between two points is the length of the shortest path between them. This shortest path is called a geodesic. On a sphere all geodesics are segments of a great circle. To compute this distance, call computeDistanceBetween() passing it two LatLng objects. Example: var a = new google.maps.LatLng(0,0); var b = new google.maps.LatLng(0,1); var distance = google.maps.geometry.spherical.computeDistanceBetween(a,b); distance will be the distance in meters.
accepted answer of: http://stackoverflow.com/q/26957593
upvote count: 8
answers question: http://stackoverflow.com/q/26957593
type: Answer
score: 8
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/26936879
has comment: http://stackoverflow.com/comment/42459211
type: Answer
score: 0
accepted answer of: http://stackoverflow.com/q/26932389
has body: Cool question. Your rotation algorithm is a bit flawed. Say, for example, you want the startAngle to be such that it rotates your 3rd slice to start at 0 degrees (top of the chart). This would be: -(slice1ArcDegrees + slice2ArcDegrees) The ArcDegrees can be found by: (percentage/100.0 * 360.0) Putting this together in the point click handler: var points = this.series.points; var startAngle = 0; for (var i = 0; i &lt; points.length; i++){ var p = points[i]; if (p == this) { break; } startAngle += (p.percentage/100.0 * 360.0); } this.series.update({ startAngle: -startAngle + 180 - ((this.percentage/100.0 * 360.0)/2) // center at 180 }); Here's an example.
has comment: http://stackoverflow.com/comment/42452193
answers question: http://stackoverflow.com/q/26932389
has comment: http://stackoverflow.com/comment/42436454
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42432833

http://stackoverflow.com/q/26969489
tagged with: drop-down-menu
tagged with: jquery
has answer: http://stackoverflow.com/a/26969652
has comment: http://stackoverflow.com/comment/42477013
favorite count: 0
has body: I've multiple dropdown lists and try to use jquery to sync available options in all dropdown list... RTY QWE ASD ZXC BNM RTY QWE ASD ZXC BNM RTY QWE ASD ZXC BNM If I select one item from one of the dropdown list, the selected option will be hide from others dropdownlist RTY QWE ASD ZXC BNM QWE ASD ZXC BNM QWE ASD ZXC BNM If I un-select it or select another item, the previous selected item will be show again in all dropdown list RTY QWE ASD ZXC BNM RTY QWE ASD ZXC BNM RTY QWE ASD ZXC BNM Below is my jquery code, managed to hide selected item from all dropdown lists, but not able to un-hide selected item. $('.abc').change(function(){ $('.abc').each(function(){ if($('.abc').val() != '') { $('option[value="'+$(this).val()+'"]').hide(); } else { $('option[value!="'+$(this).val()+'"]').not(this).show(); } }); }); What is wrong in my code?
has answer: http://stackoverflow.com/a/26970406
has title: Jquery sync multiple dropdown list
accepted answer: http://stackoverflow.com/a/26970406
possible better answer: http://stackoverflow.com/a/26969652
type: Question
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/26967751
tagged with: javascript
score: 0
answer count: 2
upvote count: 1
downvote count: 1

http://stackoverflow.com/a/26941656
answers question: http://stackoverflow.com/q/26941646
downvote count: 0
type: Answer
upvote count: 1
score: 1
has body: because setBoxDimensions does not return a value. Also the context of setBoxDimension is the global object.

http://stackoverflow.com/a/27906093
answers question: http://stackoverflow.com/q/26976820
downvote count: 0
has body: Simple Answer: (See this code in action at http://peg.arcanis.fr/2VbQ5G/) variable = ! keyword (alpha alphanum*) { return { 'dataType' : 'variable', 'dataValue': text()}; } keyword = "true" / "false" / "if" / "else" / "today" alpha = [a-zA-Z] alphanum = [a-zA-Z0-9_] boolean = ("true" / "false") { return { 'dataType' : 'boolean', 'dataValue': text()}; } Note: This loses your helpful error reporting. If I get a chance, I'll try to put up an answer that retains it. The important bit of the code below is at the beginning of the variable rule: ! keyword. This easiest way to grok this as that the parser is looking ahead 1 token. If what it finds is not a keyword, then it allows the rule to try to match the token. If, on the other hand, it is a keyword, then the ! keyword expression (and by extension, the whole variable rule fails. To quote David Majda's documentation: ! expression Try to match the expression. If the match does not succeed, just return undefined and do not advance the parser position, otherwise consider the match failed.
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/26958749
type: Question
has comment: http://stackoverflow.com/comment/42456427
score: 1
has body: How can I create a preview window for cropping image with Angular directive, when I only know the image address?
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/26958891
has title: Angular directive for image preview
downvote count: 0
tagged with: angularjs
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/25935647

http://stackoverflow.com/comment/42528230
type: Comment
comment on: http://stackoverflow.com/a/26984927
has text: The best reference here, I think, is the documentation: https://github.com/mbostock/d3/wiki/Partition-Layout#children
type: AnswerComment
score: 0

http://stackoverflow.com/comment/42292304
has text: Thx rahpuser, with this I fixed the error of the save error, but I still can't save the data on Mysql '$data = file_get_contents("\index.php"); $objData = json_decode($data); $sql = "INSERT INTO t_produtos(nome) VALUES('$objData')";' The error is on the line $data = "file_get_contents("\index.php");" (SyntaxError: Unexpected token)
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/26865925
type: Comment

http://stackoverflow.com/q/26941298
has comment: http://stackoverflow.com/comment/42426517
type: Question
has comment: http://stackoverflow.com/comment/42426554
duplicate of: http://stackoverflow.com/q/14220321
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/26941333
answer count: 1
has comment: http://stackoverflow.com/comment/42426580
type: UnansweredQuestion
has body: I have been struggling for last whole night to find the bug but could not find. My javascript code is not working as it should. var currCab = 0; var cabBooked = 0; function sendMessage(cabId) { if(cabBooked == 1) { return; } // get data from html page $.post("sendMessage.php",data, function(data,status){ $("#status").html(data); }); } function checkBookingStatus() { var data = "bookingId="+$("#bookingId").val(); $.post("checkBookingStatus.php",data, function(data,status){ // callback here var ans = data.indexOf("true"); if(ans!= -1) { console.log("returning true from checkBookingStatus"); $("#simpleStatus").html("Cab booked. You can close tab now"); cabBooked = 1; return true; } else { console.log("returning false from checkBookingStatus"); return false; } }); } function tryCabAlloc() { if(!checkBookingStatus()) { if(cabBooked == 1) { return; } var checkid = document.getElementById("cabId"+currCab); if(checkid==null) { $("#simpleStatus").html("Cab could not be booked."); $("#status").html("No more clients to communicate with."); } else { var cid = $("#cabId"+currCab).val(); sendMessage(cid); updateTrying(cid); currCab = currCab + 1; } } } $( document ).ready(function() { $("#simpleStatus").html("Please wait. The communication is being started..."); $("#status").html("GCM push initiating ..."); tryCabAlloc(); setInterval(function(){ if(cabBooked==0) { tryCabAlloc(); } else { throw ''; } },95000); }); The code should stop working when the checkBookingStatus returns true and cabBooked is set to 1. But is not stopping at all. I have no idea why.
has comment: http://stackoverflow.com/comment/42426478
has comment: http://stackoverflow.com/comment/42426511
linked to: http://stackoverflow.com/q/14220321
has title: Javascript not working as per logic

internet-explorer
tags question: http://stackoverflow.com/q/26881426
tags question: http://stackoverflow.com/q/26926537
tags question: http://stackoverflow.com/q/26939183
tags question: http://stackoverflow.com/q/26860996
tags question: http://stackoverflow.com/q/26987205
tags question: http://stackoverflow.com/q/26867970
tags question: http://stackoverflow.com/q/26834845
tags question: http://stackoverflow.com/q/26955920
tags question: http://stackoverflow.com/q/26926672
tags question: http://stackoverflow.com/q/26848510
tags question: http://stackoverflow.com/q/26910743
tags question: http://stackoverflow.com/q/26869619
tags question: http://stackoverflow.com/q/26984511
tag name: internet-explorer
tags question: http://stackoverflow.com/q/26839916
tags question: http://stackoverflow.com/q/26852115
tags question: http://stackoverflow.com/q/26904616
tags question: http://stackoverflow.com/q/26865847
tags question: http://stackoverflow.com/q/26974265
tags question: http://stackoverflow.com/q/26928992
tags question: http://stackoverflow.com/q/26870817
tags question: http://stackoverflow.com/q/26874769
tags question: http://stackoverflow.com/q/26842210
tags question: http://stackoverflow.com/q/26854085
tags question: http://stackoverflow.com/q/26890842
tags question: http://stackoverflow.com/q/26939998
tags question: http://stackoverflow.com/q/26891783
tags question: http://stackoverflow.com/q/26853096
tags question: http://stackoverflow.com/q/26969835
tags question: http://stackoverflow.com/q/26858107
tags question: http://stackoverflow.com/q/26951130
tags question: http://stackoverflow.com/q/26930429
tags question: http://stackoverflow.com/q/26839430
tags question: http://stackoverflow.com/q/26902297
tags question: http://stackoverflow.com/q/26962341
tags question: http://stackoverflow.com/q/26969405
tags question: http://stackoverflow.com/q/26844917
tags question: http://stackoverflow.com/q/26965137
tags question: http://stackoverflow.com/q/26865168
type: Tag
tags question: http://stackoverflow.com/q/26974466
tags question: http://stackoverflow.com/q/26986711
tags question: http://stackoverflow.com/q/26891090
tags question: http://stackoverflow.com/q/26937871
tags question: http://stackoverflow.com/q/26893295
tags question: http://stackoverflow.com/q/26871413
tags question: http://stackoverflow.com/q/26933979

http://stackoverflow.com/comment/42442162
has text: Well, also when I'm adding console.log on cordovaDeviceOrientation.watchHeading(options) it returns object. So I'm almost sure that plugin is installed fine
score: 0
type: Comment
comment on: http://stackoverflow.com/q/26949054
type: QuestionComment

http://stackoverflow.com/comment/42364933
score: 0
comment on: http://stackoverflow.com/q/26907124
has text: @all the flag will eventually changed depending on the value of another function which just return either true or false. I didnt actually tried putting a button to test the functionality but instead manually hard-coding the flag value and do a page refresh that's maybe causing the value to reset back to zero.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26904703
has body: I want to Dynamically load markers on google map, from Mysql database. The markers in 20Km radius of center of map should appear and as the center of the map is changed/panned the old markers lying outside the 20Km radius should disappear and new markers within 20Km radius of new center should appear. Right now I am able to load markers with in 20km radius of center of map but only for once the webpage is opened. Any suggestive tutorial or help for the same
tagged with: google-maps
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/26906724
favorite count: 0
tagged with: ajax
tagged with: google-maps-api-3
has title: Dynamic loading of Markers on Google Maps
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42363715
has comment: http://stackoverflow.com/comment/42362265
upvote count: 1
score: 1
type: Question

http://stackoverflow.com/a/27037914
has body: I would suggest you to use wow.js https://github.com/matthieua/WOW It is very easy to use and here is demo page. http://mynameismatthieu.com/WOW/
score: 2
upvote count: 3
downvote count: 1
has comment: http://stackoverflow.com/comment/42595564
has comment: http://stackoverflow.com/comment/42595586
has comment: http://stackoverflow.com/comment/42627845
type: Answer
answers question: http://stackoverflow.com/q/26991797

http://stackoverflow.com/a/26973385
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26973273
type: Answer
answers question: http://stackoverflow.com/q/26973273
has body: You can assign different id's to datepickers To To

http://stackoverflow.com/a/26851887
has comment: http://stackoverflow.com/comment/42269199
has comment: http://stackoverflow.com/comment/42266147
answers question: http://stackoverflow.com/q/26851780
accepted answer of: http://stackoverflow.com/q/26851780
score: 0
type: AcceptedAnswer
has body: I think that you forgot ui-view For example : &lt;div ui-view &gt;&lt;/div&gt; You need to add the ui-view in your target container
type: Answer

http://stackoverflow.com/comment/42493079
score: 0
comment on: http://stackoverflow.com/a/26979338
type: Comment
has text: Point two seems to be very valid. About point 1: why not `id = 'facebook-jssdk'` like the old one? Counting the `,` and spaces it doesn't make any difference.
type: AnswerComment

http://stackoverflow.com/a/26925953
downvote count: 0
has body: It is currently not possible to drive Internet Explorer from CasperJS. There is TrifleJS which has the same API as PhantomJS, but it isn't integated into CasperJS and it isn't known if it ever will. If you really want multi-browser support, you should write your tests with selenium-webdriver for the language of your choice. For reference: IE support through TrifleJS? Remove spurious fs calls Add support to CasperJS
score: 2
accepted answer of: http://stackoverflow.com/q/26922463
upvote count: 2
answers question: http://stackoverflow.com/q/26922463
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/42420076
score: 3
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26937879
has text: OT: Do you realize you initialize a new interval on every ajax error and thus somewhen will most likely flood your server?

http://stackoverflow.com/q/26966655
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/42470504
has title: $(this).parent().attr('id') gets '[object window]' not element ID
has comment: http://stackoverflow.com/comment/42470567
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/42470334
tagged with: this
has answer: http://stackoverflow.com/a/26966825
tagged with: jquery
has body: I'm trying to get the ID attribute of the clicked element, sounds simple enough, but I'm getting the following error: Uncaught error: Syntax error, unrecognized expression: .posttag- Window] Here's the code I've written $('#blogposts_filters &gt; li &gt; a').click(function(e) { var $this = $(this), thistag = toString($this.parent().attr('id')).substring(7); console.log(thistag) //returns [Object Window] if substring(0) // Filter through $('#blogposts_list .posttag-' + thistag).toggleClass('hidden'); e.preventDefault(); }); Tried a few different things but I'm pretty new to js/jquery and kinda stumped. Any help is hugely appreciated.
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/26966767
accepted answer: http://stackoverflow.com/a/26966825
has answer: http://stackoverflow.com/a/26966767

openlayers-3
type: Tag
tags question: http://stackoverflow.com/q/26962786
tags question: http://stackoverflow.com/q/26834315
tags question: http://stackoverflow.com/q/26928785
tag name: openlayers-3
tags question: http://stackoverflow.com/q/26844412
tags question: http://stackoverflow.com/q/26860046
tags question: http://stackoverflow.com/q/26870301
tags question: http://stackoverflow.com/q/26929563

http://stackoverflow.com/a/49966287
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26911889
has body: Because call_user_func_array call function referenced by the function name which is in string. So, in JS we need to use eval. Example: const popup = (msg) =&gt; { alert(msg); } const subject = { popup(msg) { alert(msg); } } So, eval("popup").apply(null, ['hi']) eval("subject.popup").apply(null, ['hi']) Correct me. If i wrong. ;)

http://stackoverflow.com/a/63461591
score: 4
has comment: http://stackoverflow.com/comment/115389114
has body: I am using Java Script to detect the event of leaving and sending an ajax request to my server so I can store that the user left the page. The second part is to detect the time the user is in my page, every 3 seconds I also send a ajax request to my database to save the time of the user in the page.
answers question: http://stackoverflow.com/q/26901940
type: Answer
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/115412045
has comment: http://stackoverflow.com/comment/115389145

http://stackoverflow.com/comment/42396055
type: Comment
has text: Yep, thanks I didn't catch that. Coding at 12:00 is not always the best idea :P
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26923660

http://stackoverflow.com/q/26924055
type: Question
type: AnsweredQuestion
has title: Regex to ensure valid querystring
possible better answer: http://stackoverflow.com/a/26924109
has comment: http://stackoverflow.com/comment/42395115
linked to: http://stackoverflow.com/q/23959352
answer count: 3
has answer: http://stackoverflow.com/a/26924109
has answer: http://stackoverflow.com/a/26924167
tagged with: javascript
has body: I'm trying to come up with a Regex expression that I can use with Javascript .test to make sure my system is only accepting query strings in a valid format. The format looks like this i=1&amp;s1=122&amp;s2=238&amp;s3=167&amp;s4=756&amp;s5=13 It can have an unlimited number of s#= arguments in it, so could be longer or shorter than this example. In English the format is something like i=1&amp;s[1+0]=[any number &gt; 0]&amp;s[1+1]=[any number &gt; 0]&amp;s[1+2]=[any number &gt; 0] and so on. Right now the regex I have is /^([\w-]+(=[\w-]*)?(&amp;[\w-]+(=[\w-]*)?)*)?$/ It's based on the code provided in this answer. It does an ok job of rejecting some types of invalid strings, but there are still a lot that slip through. How can I improve this regex expression so it more accurately rejects invalid data?
tagged with: query-string
score: 0
has comment: http://stackoverflow.com/comment/42395167
tagged with: regex
has answer: http://stackoverflow.com/a/26924106
accepted answer: http://stackoverflow.com/a/26924106

http://stackoverflow.com/a/26888347
score: 1
upvote count: 1
downvote count: 0
has body: When method fit() exists and doesn't shine up in the for-in-loop it is a non-enumerable property. There are different ways to access the properties of an object: var obj = b.selection(); for (var p in obj) { console.log(p); // --&gt; all enumerable properties of obj AND its prototype } Object.keys(obj).forEach(function(p) { console.log(p); // --&gt; all enumerable OWN properties of obj, NOT of its prototype }); Object.getOwnPropertyNames(obj).forEach(function(p) { console.log(p); // all enumerable AND non-enumerable OWN properties of obj, NOT of its prototype }); If you don't find .fit() on one of this ways its not enumerable AND not OWN property of obj, but sits somewhere in the prototype of obj. Then you can do: var prot = Object.getPrototypeOf(obj); Object.getOwnPropertyNames(prot).forEach(function(pp) { console.log(pp); // --&gt; all enumerable AND non-enumerable properties of obj's prototype }); Often objects have a bit longer prototype-chain and the property sits somewhere deeper on it. Then you just repeat the last snippet as often as needed: var prot2 = Object.getPrototypeOf(prot); Object.getOwnPropertyNames(prot2).forEach( /*...*/ ); To make it complete: Let's say you have found .fit on the obj's prototype prot. Then you can inspect it: console.log(Object.getOwnPropertyDescriptor(prot.fit)); That outputs an object which shows the value of prot.fit and whether it's enumerable, writable, and configurable or not. The Object.methods and some more FIND HERE.
type: Answer
answers question: http://stackoverflow.com/q/26885855

http://stackoverflow.com/comment/42393330
type: Comment
has text: Do you happen to know where there might be an example of this?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26922534

http://stackoverflow.com/q/26945870
has comment: http://stackoverflow.com/comment/42434310
upvote count: 0
possible better answer: http://stackoverflow.com/a/26945988
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42434190
has body: JS : function checkValue(option) { if (option == "4") { alert("Correct"); var pop = parseInt(window.name++); alert(pop); window.location="q2.html"; } else { alert("False, Option (4) is the Correct Answer."); window.location="q2.html"; } } Html : &lt;html&gt; &lt;input type="radio" name="option_1" value="1" onclick="checkValue(this.value);" /&gt; Hyper Text Markup Languages &lt;br /&gt; &lt;br /&gt; &lt;input type="radio" name="option_2" value="2" onclick="checkValue(this.value);" /&gt; Highest Text Markup Language &lt;br /&gt; &lt;br /&gt; &lt;input type="radio" name="option_3" value="3" onclick="checkValue(this.value);" /&gt; Hyper Total Markup Language &lt;br /&gt; &lt;br /&gt; &lt;input type="radio" name="option_4" value="4" onclick="checkValue(this.value);" /&gt; Hyper Text Markup Language &lt;br /&gt; &lt;br /&gt; &lt;/html&gt;
has comment: http://stackoverflow.com/comment/42434188
accepted answer: http://stackoverflow.com/a/26946147
tagged with: javascript
has answer: http://stackoverflow.com/a/26945988
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/42434454
has comment: http://stackoverflow.com/comment/42434111
has answer: http://stackoverflow.com/a/26946147
downvote count: 7
has comment: http://stackoverflow.com/comment/42434369
score: -7
has title: How to disable radio button After 1 Click
favorite count: 0
has comment: http://stackoverflow.com/comment/42434133
has comment: http://stackoverflow.com/comment/42434156
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/26840454
has comment: http://stackoverflow.com/comment/42251305
answer count: 2
favorite count: 0
has answer: http://stackoverflow.com/a/27140784
has comment: http://stackoverflow.com/comment/42251108
possible better answer: http://stackoverflow.com/a/26841960
has answer: http://stackoverflow.com/a/26841960
has body: I am trying to open a local pdf file and print it.It works for files upto 5 kb,but it takes time to load for big files within 1000ms and hangs.I want it to be dynamic and need not fix the timeout . I tried window.onload but it does not work.Also i dont want to add any onload event to the printing page. Is there a efficient solution var win=window.open(printUrl); setTimeout(function() { win.print(); win.close(); }, 1000);
type: AnsweredQuestion
score: 3
upvote count: 3
has title: Opening and printing large files in javascript
accepted answer: http://stackoverflow.com/a/27140784
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42251407

http://stackoverflow.com/comment/42489688
type: Comment
type: QuestionComment
has text: Billy I have not start javascript or json code yet. i am doing some research how to to used javascript or jason to do this. ( i am very new with javascript /jason)
comment on: http://stackoverflow.com/q/26975444
score: 0

http://stackoverflow.com/a/26968246
has comment: http://stackoverflow.com/comment/42474947
has comment: http://stackoverflow.com/comment/42473315
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/42473248
accepted answer of: http://stackoverflow.com/q/26966716
answers question: http://stackoverflow.com/q/26966716
has body: This code might help you: on right clicking on specific 1) no default browser menu opens 2) Show/hide edit link On clicking on document (both left and right) 1) hide edit link (can be changed accordingly) Parameter Names Parameter Values Remarks johnrambo@mail.com John Rambo Edit peterparker@mail.com Peter Parker Edit try it here http://jsfiddle.net/f5n9f4po/2/
upvote count: 2
has comment: http://stackoverflow.com/comment/42473431
type: AcceptedAnswer

http://stackoverflow.com/a/26921378
score: 0
type: Answer
has body: You might try adding a success function like the following: $('form').submit(function(e) { var searchUser = $('input[name="user"]').val(); $.ajax({ type: "GET", url: "ajax.php", data: {user: searchUser}, success:function(data){//begin success function //do something with the data returned from ajax.php file alert(data); }//end success function });
answers question: http://stackoverflow.com/q/26921212

http://stackoverflow.com/a/26836081
score: 0
has comment: http://stackoverflow.com/comment/42238037
type: Answer
has body: You're not actually calling the function to get the value anywhere. Add a call to it like this: $(document)(ready(){ console.log("Function called on startup") sendvalue(); $('#tab').on('click',function(){ console.log("get the value of "+**i**) }); });
has comment: http://stackoverflow.com/comment/42237969
answers question: http://stackoverflow.com/q/26836063

http://stackoverflow.com/a/26918456
has comment: http://stackoverflow.com/comment/42391555
has comment: http://stackoverflow.com/comment/42392035
has comment: http://stackoverflow.com/comment/42391206
upvote count: 2
accepted answer of: http://stackoverflow.com/q/26918255
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26918255
type: Answer
has comment: http://stackoverflow.com/comment/42392288
score: 2
downvote count: 0
has body: This only happens from inside the app window. If you call window.open from the background page, it will open in Chrome. So, send it to your background page: // app window function openInChrome(url) { chrome.runtime.sendMessage({action: "openURL", url: url}); } // background chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) { if(message.action == "openURL") window.open(message.url); });

http://stackoverflow.com/q/26919093
answer count: 2
possible better answer: http://stackoverflow.com/a/26919391
has answer: http://stackoverflow.com/a/26919391
accepted answer: http://stackoverflow.com/a/26919239
tagged with: javascript
tagged with: regex
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/26919239
type: Question
has title: regex to get last of repetition
has body: I have the below two strings. In both cases, I am trying to retrieve "foreclosure_defenses". str = "client_profile[lead_profile_attributes][foreclosure_defenses_attributes][0][own_property]" str2 = "client_profile[foreclosure_defenses_attributes][0][own_property]" I'm close but I can't get a regex that will work with both of them. This regex works for str2, but not for str: regex = /\w+(?:\[(\w+)_attributes\]+)\[\d+\]\[own_property\]/g regex.exec(str2) ["client_profile[foreclosure_defenses_attributes][0][own_property]", "foreclosure_defenses"] This regex works for str, but not for str2: regex = /\w+(?:\[(\w+)_attributes\]?)+\[\d+\]\[own_property\]/g regex.exec(str); ["client_profile[lead_profile_attributes][foreclosure_defenses_attributes][0][own_property]", "foreclosure_defenses"] The last one should work for both cases, but doesn't. It should look for one or many _attributes patterns and grab the last one. What am I doing wrong?

http://stackoverflow.com/a/26944283
type: Answer
answers question: http://stackoverflow.com/q/26944233
upvote count: 1
has comment: http://stackoverflow.com/comment/42431575
score: 1
has body: Somehow after the for loop the values of the object.num = 1 no matter what, even though they are never set to 1. Yes "they" are - "they're" set to 1 in the last iteration of this loop: for(var temp = n; temp &gt; 0; temp--) { a.num = temp; arr[i] = a; i-=2; } The last iteration of that loop is when temp is 1. Now, you've only actually got one object - and you're setting every element of the array to be a reference to that object. That's why all the values in the array look the same. If you want to create a different object each time, you should use: for(var temp = n; temp &gt; 0; temp--) { arr[i] = { name: "a", num: temp }; i -= 2; }
downvote count: 0
has comment: http://stackoverflow.com/comment/42438898

http://stackoverflow.com/comment/42496046
type: QuestionComment
comment on: http://stackoverflow.com/q/26980948
has text: Can you show the HTML code at least?
score: 0
type: Comment

http://stackoverflow.com/q/26959020
has title: Dropdown menu values in button
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26959128
has body: This is a drop-down menu I want to display the values in the button on the base of value selected from the list.. Screenshot is attached for reference. What is the best approach to do this? //Where Value 1 is written I want the li values.. Value 1 Value 1 Value 2 Value 3 Value 4 Value 5 Value 6
has comment: http://stackoverflow.com/comment/42456748
type: Question
has comment: http://stackoverflow.com/comment/42456838
has comment: http://stackoverflow.com/comment/42456690
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1

http://stackoverflow.com/q/26980796
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/42496419
has body: I'm trying to optimize my code to be more efficient and easier to read. I have some combined if-statements, which I think could be better, if they are transformed to for-loops, I'm just not sure how to do this? This is my code: if (starportSelected){ if(game.currentLevel.requirements.vehicles.indexOf('transport')&gt;-1 &amp;&amp; cashBalance&gt;=vehicles.list["transport"].cost){ $("#transportbutton").removeAttr("disabled"); } if(game.currentLevel.requirements.vehicles.indexOf('scout-tank')&gt;-1 &amp;&amp; cashBalance&gt;=vehicles.list["scout-tank"].cost){ $("#scouttankbutton").removeAttr("disabled"); } if(game.currentLevel.requirements.vehicles.indexOf('heavy-tank')&gt;-1 &amp;&amp;cashBalance&gt;=vehicles.list["heavy-tank"].cost){ $("#heavytankbutton").removeAttr("disabled"); } if(game.currentLevel.requirements.vehicles.indexOf('harvester')&gt;-1 &amp;&amp; cashBalance&gt;=vehicles.list["harvester"].cost){ $("#harvesterbutton").removeAttr("disabled"); } if(game.currentLevel.requirements.aircraft.indexOf('chopper')&gt;-1 &amp;&amp; cashBalance&gt;=aircraft.list["chopper"].cost){ $("#chopperbutton").removeAttr("disabled"); } if(game.currentLevel.requirements.aircraft.indexOf('wraith')&gt;-1 &amp;&amp; cashBalance&gt;=aircraft.list["wraith"].cost){ $("#wraithbutton").removeAttr("disabled"); } } I think first step would be to create two arrays, one for vehicles and one for aircrafts like this: var vehicles = ['transport', 'scout.tank', 'heavy-tank', 'harvester']; var aircraft = ['chopper', 'wraith']; But how to take the rest of the code and change it to for-loop seems like a hard case for me. All help and explanation would be highly appreciated!
accepted answer: http://stackoverflow.com/a/26980963
has comment: http://stackoverflow.com/comment/42496881
has comment: http://stackoverflow.com/comment/42495848
has comment: http://stackoverflow.com/comment/42496257
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/42496348
type: Question
tagged with: if-statement
has answer: http://stackoverflow.com/a/26980963
has title: Can I use a loop to optimize my code?
has comment: http://stackoverflow.com/comment/42495980
has comment: http://stackoverflow.com/comment/42495965
tagged with: for-loop
has comment: http://stackoverflow.com/comment/42496217
score: 2
tagged with: arrays
answer count: 1
downvote count: 0

http://stackoverflow.com/q/26966512
answer count: 2
has answer: http://stackoverflow.com/a/26967351
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/26966610
score: 0
has body: I need to add facebook like button for my website for user like my product and that like product image post on their profile. I try many example but with that use only like website page not like product, and also post image of my website logo. i need to post my product image
has comment: http://stackoverflow.com/comment/42470215
accepted answer: http://stackoverflow.com/a/26967351
has title: how can i add fb like button for my website product?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42470583
tagged with: codeigniter
has comment: http://stackoverflow.com/comment/42470114
tagged with: php
has comment: http://stackoverflow.com/comment/42470371
has comment: http://stackoverflow.com/comment/42470182
type: Question
has comment: http://stackoverflow.com/comment/42470243
tagged with: facebook-like
has comment: http://stackoverflow.com/comment/42470875
has answer: http://stackoverflow.com/a/26966610

http://stackoverflow.com/comment/42517471
type: QuestionComment
comment on: http://stackoverflow.com/q/26972185
score: 0
has text: There are eight objects: the fourth object says: event: "gtm.dom". The "event_name" I am actually using is the word "contratado" (both in the code and GTM). There are several other objects, of which the 2nd, 3rd and 7th all have event: "contratado". Object 5 has "event: gym.load", object 6 has "event: gtm.js" and 8 and 9 which have event: "event_name". Additionally, before load the console prints: Uncaught TypeError: Cannot read property 'replace' of undefined . Thanks for your help
type: Comment

http://stackoverflow.com/q/26903373
linked to: http://stackoverflow.com/q/17730621
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42358630
has comment: http://stackoverflow.com/comment/42358677
type: UnansweredQuestion
has body: please need a code to display dynamically time in drop down box or select tag and if current time display in drop down box and in drop down should display after current time then 1.30 hours time. Example:- now time is 12.00 AM in drop down should display 1.30 AM up to 12.00. It calculate by half hour. If time is now 2.00 PM should display from 1half hour after like this 3.30 PM up to 12.00 AM by calculating half hour. And i can display in text but i need to display in drop down box with current time display in drop down should be after 1.30 hours time up to 12.00 AM. function display_c(){ var refresh=1000; mytime=setTimeout('display_ct()',refresh) } function display_ct() { var strcount var dt = new Date() var time = dt.getHours() + ":" + dt.getMinutes() + ":" + dt.getSeconds(); document.getElementById('t1').value = time; tt=display_c(); } &lt;input type=text id='t1' size='10'&gt; &lt;span id='ct' &gt;&lt;/span&gt;
type: Question
has title: how i will get time dynamically in dropbox or select option in HTML?
has comment: http://stackoverflow.com/comment/42358455
has comment: http://stackoverflow.com/comment/42358839
has comment: http://stackoverflow.com/comment/42359514
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26903558

http://stackoverflow.com/comment/42306530
type: QuestionComment
type: Comment
has text: I just tested that in jsfiddle and it works. must be something else disabling the click event
comment on: http://stackoverflow.com/q/26874210
score: 0

http://stackoverflow.com/comment/42752690
comment on: http://stackoverflow.com/a/26979976
type: AnswerComment
type: Comment
has text: Thats wrong. When calling a function with new this refers to a new created object. So he **does** create an object. From [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new): `The constructor function foo is called with the specified arguments and this bound to the newly created object`. The problem is that the function (`sayHello`) captures `self` before the constructor is executed. So `self` is undefined. Adams answer is correct.
score: 1

http://stackoverflow.com/q/26969153
favorite count: 0
accepted answer: http://stackoverflow.com/a/26971386
upvote count: 1
type: AnsweredQuestion
tagged with: charts
has title: Where to find charts plug-in like this?
score: 1
type: Question
has answer: http://stackoverflow.com/a/26971386
tagged with: highcharts
downvote count: 0
tagged with: javascript
has body: highcharts would fit perfectly if not for one "but". The strip chart goes behind the axis. The line graph is beyond the axis numbers(50, 100, 150, 200). Watched others but have not found where you can easily stylize the behavior of the graph by accessing its axis chart like this
answer count: 1

http://stackoverflow.com/comment/42317393
score: 0
type: QuestionComment
has text: @Ben I did "text.toLowerCase().split(" ");" to modify the code. Thanks for your help.
type: Comment
comment on: http://stackoverflow.com/q/26880198

http://stackoverflow.com/q/26854617
favorite count: 0
has title: Install Prerender in Nginx or Django?
tagged with: prerender
tagged with: seo
accepted answer: http://stackoverflow.com/a/28595612
score: 2
has body: Prerender.io allows you to install it by either editing the Nginx config or adding a Django middleware. What are the performace differences, if any, and which setup is better?
upvote count: 2
tagged with: django
has answer: http://stackoverflow.com/a/28595612
type: AnsweredQuestion
tagged with: nginx
tagged with: javascript
type: Question
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/42311917
type: Comment
comment on: http://stackoverflow.com/a/26876667
has text: Yeah, figured @CambridgeMike answered it better while I was editing this one so I gave up. Probably shoudn't have done that.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/113087609
comment on: http://stackoverflow.com/a/46637194
score: 0
type: Comment
has text: how to set `Access-Control-Max-Age` for `flask_cors`?
type: AnswerComment

http://stackoverflow.com/comment/42323452
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26883702
has text: Have a look at [Optional arguments in JavaScript](http://stackoverflow.com/q/19572212/1048572) for an example

http://stackoverflow.com/q/26854333
type: UnansweredQuestion
tagged with: php
tagged with: mysql
type: Question
tagged with: javascript
tagged with: ckeditor
has title: Ckeditor load templates from database
has body: I want to give the users the ability to set their own templates for use in the editor, the thing is that i don't exactly don't know how. I created the table for the templates and did the php function to retrieve the data from the DB but i can't show it in the portal. I saw this in other question: CKEDITOR.editorConfig = function (config) { config.templates_files = ['js/editor/plugins/templates/templates/custom.js']; }; CKEDITOR.replace( 'editor1', { templates: 'my', on: { instanceReady: function( argument ) { var httpRequest = new XMLHttpRequest(); httpRequest.onreadystatechange = function() { CKEDITOR.addTemplates( 'my', { templates: [ { title: 'My Templates', html: this.responseText } ] }); }; httpRequest.open( 'GET', 'in/ver.php?cons=8' ); httpRequest.send(); } } }); But it doesn't seems to work in any way, and i can't find any documentation about it
score: 0
has answer: http://stackoverflow.com/a/26855049
answer count: 1

http://stackoverflow.com/a/26985055
answers question: http://stackoverflow.com/q/26985043
type: Answer
has body: You're calling the startGame function instead of passing it to document.ready. It should be: $(document).ready(startGame); When you put parentheses after a function name, it calls it immediately. To use the function as a value, leave out the parentheses.
score: 2
downvote count: 0
upvote count: 2

http://stackoverflow.com/q/26919305
tagged with: javascript
has comment: http://stackoverflow.com/comment/42387066
downvote count: 0
answer count: 1
has body: I have a form: And JS in the bottom: It perfectly works in Chrome and IE and doesn't work in Mozilla.
has comment: http://stackoverflow.com/comment/42387684
linked to: http://stackoverflow.com/q/4585970
favorite count: 0
has comment: http://stackoverflow.com/comment/42386915
has comment: http://stackoverflow.com/comment/42387085
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42386943
has comment: http://stackoverflow.com/comment/42387765
has comment: http://stackoverflow.com/comment/42387047
has comment: http://stackoverflow.com/comment/42388515
score: 1
has answer: http://stackoverflow.com/a/26984081
upvote count: 1
has comment: http://stackoverflow.com/comment/42387333
type: Question
has title: What's wrong with JS (doesn't work in Mozilla)?
has comment: http://stackoverflow.com/comment/42387819
tagged with: firefox
has comment: http://stackoverflow.com/comment/42387138
has comment: http://stackoverflow.com/comment/42386967

http://stackoverflow.com/comment/42506924
comment on: http://stackoverflow.com/a/26986907
type: Comment
has text: I edited my post. If you know how, or know of any websites describing this process, let me know. Thank you.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42359477
has text: Thanks a lot sir.. It really helped. Now I am facing small difficulties with iterating over a list. This is what I have tried: http://jsfiddle.net/tv2un8yj/5/ .. But could display only the last element in the array list
comment on: http://stackoverflow.com/a/26898272
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/63522794
has text: If that were the case, the dialog and alert should be similarly restricted. "Mail Requires Your Password" as a dialog is far more dangerous.
comment on: http://stackoverflow.com/q/26888523
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26919888
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/42412362
has body: The setItem() method on localStorage has a void return type (docs) so you are trying to use push() on "nothing". You'll need to fetch the list from local storage (either before or after your insertion)... and "append" to it locally, if you fetched it before your "set". //Option 1: set then fetch localStorage.setItem('offerObject', JSON.stringify(offerObject)); var offers = JSON.parse(localStorage.getItem('offerObject')); //Option 2: fetch, set then append var offers = JSON.parse(localStorage.getItem('offerObject')); localStorage.setItem('offerObject', JSON.stringify(offerObject)); //append the current object to the previously fetched list offers.push(offerObject); Update Looking closer at the code it appears that your JSON structure doesn't match what I think you're hoping for. Fundamentally you want your stored object "offerObject" to actually be an Array (list), not an Object (e.g. map). As a result you will always need to fetch the current list from local storage first, append to it, then set it back. I've altered your code to better reflect what I think you're trying to do (and here's a JSFiddle for it you can try out: //get your values (I hard coded this for my test) var offertitle = "This is the offer title id:[" + new Date().getTime() + "]"; var offerdesc = "This is the offer description"; var offerexpiry = "This is the offer expiry " + new Date(); //create your offer object (I just made this a simple 3 key/value pair) var offer = { "offertitle": offertitle, "offerdesc": offerdesc, "offerexpiry": offerexpiry }; var offers = [];//initialize an empty array for all of the offers //get the current list of offers (if any) var existingOffers = localStorage.getItem('offers'); if(existingOffers != null){ offers = JSON.parse(existingOffers); } //append the new item offers.push(offer); //reset the local storage localStorage.setItem('offers', JSON.stringify(offers)); console.log('Offers: ' + offers.length + '\n\n' + JSON.stringify(offers));
answers question: http://stackoverflow.com/q/26919804
has comment: http://stackoverflow.com/comment/42413941
downvote count: 0
has comment: http://stackoverflow.com/comment/42414456
type: Answer

http://stackoverflow.com/q/26982933
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/42500282
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42500181
answer count: 0
has title: Creating new onclick method with passed in variable
has comment: http://stackoverflow.com/comment/42500233
has comment: http://stackoverflow.com/comment/42500402
type: Question
has body: I currently popup a bootstrap dialog to ensure that the user wants to delete someone. When that user says ok, I need to pass the value that came in to the function along to the actual delete method. Currently everything I have tried has passed along 'undefined' as the variable. function RemoveTeamMember(peoplePK) { //First remove all old click events(so we can reuse), and re-initialize the modal with our new info $("#ConfirmationDialog #ConfirmationOKButton").off('onclick'); $("#ConfirmationDialog .modal-header .modal-title").text("Remove Team Member?"); $("#ConfirmationDialog #ConfirmationText").addClass('text-danger').text("Are you sure you want to remove this team member?"); $("#ConfirmationDialog #ConfirmationOKButton").html("Remove Member"); //$("#ConfirmationDialog #ConfirmationOKButton").prop("onclick", "PerformRemoveTeamMember(" + peoplePK + ")"); //Bind the new click event for the ok button //$("#ConfirmationDialog #ConfirmationOKButton").bind('click', { param: peoplePK }, PerformRemoveTeamMember); $("#ConfirmationDialog #ConfirmationOKButton").data("pid", ''+peoplePK+''); $("#ConfirmationDialog #ConfirmationOKButton").on('click', function () { //PerformRemoveTeamMember($(this).data("pid")); alert($(this).data("pid")); }); $("#ConfirmationDialog").modal({ show: true }); } Ultimately I need to attach a new onclick attribute to the button with the value of the peoplePK variable and this dialog will get reused between multiple operations. Which is why I must build this button dynamically. EDIT: Added how RemoveTeamMember is called ' Remove Member ';` Answer: Changed how RemoveTeamMember is called After a change this morning to how the datatables were formed, row[0], no longer gave the correct data as it was previously, this was changed to ' Remove Member ' And this fixes the issue completely.
has comment: http://stackoverflow.com/comment/42500118
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/42500852
has comment: http://stackoverflow.com/comment/42500713

http://stackoverflow.com/comment/42417226
type: Comment
has text: Please describe what "I can't get it to work" means. What is happening on the screen? Is the background not appearing at all? Does the background not change position when you click? Are there error messages in the console?
comment on: http://stackoverflow.com/q/26936144
score: 0
type: QuestionComment

http://stackoverflow.com/comment/42315139
has text: off the top of my head, I would consider using a `collectionView` whose `childViews` are themselves `collectionViews`. And then the first (outer collectionView) could render the first list, and when you click on the link, an action inside the childrens' `collectionViews` could be used to fetch more data and append the payload to their own content.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26878306
score: 0

http://stackoverflow.com/q/26967681
has comment: http://stackoverflow.com/comment/42472125
possible better answer: http://stackoverflow.com/a/26967984
has answer: http://stackoverflow.com/a/26967698
type: Question
linked to: http://stackoverflow.com/q/1366127
has comment: http://stackoverflow.com/comment/42472147
has body: I was working on a javascript template that our UI developers can use. But I couldn't find a way to get rid of eval. Can someone show me a way to replace eval? /*jslint browser:true, passfail:false, sloppy:true, indent:4, maxerr:1000*/ /*global $*/ var Main = { Init: function () { this.Helper.Import("Main.Sliders"); }, Helper: { Import: function (classname) { var objectToInit = eval(classname); objectToInit.Init(); }, UserAgent: { IsIphone: navigator.userAgent.match(/iPhone|iPod/i) !== null, IsIos: navigator.userAgent.match(/iPhone|iPad|iPod/i) !== null, IsAndroid: navigator.userAgent.match(/Android/i) !== null } }, Sliders: { Init: function () { alert('dada'); } } }; $(document).ready(function () { Main.Init(); });
answer count: 2
has title: Can I avoid using eval in this example
tagged with: javascript
has answer: http://stackoverflow.com/a/26967984
score: 0
tagged with: eval
accepted answer: http://stackoverflow.com/a/26967698
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42472225
has comment: http://stackoverflow.com/comment/42472966

http://stackoverflow.com/a/43634169
has comment: http://stackoverflow.com/comment/91109375
has comment: http://stackoverflow.com/comment/99882147
has comment: http://stackoverflow.com/comment/101610566
score: 40
answers question: http://stackoverflow.com/q/26974084
upvote count: 41
has comment: http://stackoverflow.com/comment/101639036
downvote count: 1
has comment: http://stackoverflow.com/comment/113873584
has comment: http://stackoverflow.com/comment/101639095
has body: Updated above answer, as document.createEvent now is part of an old, deprecated API. const originalSetItem = localStorage.setItem; localStorage.setItem = function(key, value) { const event = new Event('itemInserted'); event.value = value; // Optional.. event.key = key; // Optional.. document.dispatchEvent(event); originalSetItem.apply(this, arguments); }; const localStorageSetHandler = function(e) { alert('localStorage.set("' + e.key + '", "' + e.value + '") was called'); }; document.addEventListener("itemInserted", localStorageSetHandler, false); localStorage.setItem('foo', 'bar'); // Pops an alert https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events
has comment: http://stackoverflow.com/comment/90274904
has comment: http://stackoverflow.com/comment/91108700
type: Answer

http://stackoverflow.com/comment/42329288
type: QuestionComment
type: Comment
has text: No its not live...actually the host am using is a free one and it doesn't have the updated version of php so a lot of my php functions dont work so haven't uploaded it...is there some other way you could take a look in this 'cause i have been trying to solve the same issue from last few days and I don't have enough reputation to call you to chat. @myfunkyside
comment on: http://stackoverflow.com/q/26879501
score: 0

http://stackoverflow.com/comment/42432033
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26943117
score: 0
has text: it's ironically chuckle-able that above takes offence to the use of 'must,' only to follow with 'most' :) anyway, @CrazyGeek 's solution is one of many valid ways to do this, however should explain the caveats.

http://stackoverflow.com/comment/42249262
has text: Define 'efficiency'. Execution time? Execution time on repeated calls? Less lines of code?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26842858

http://stackoverflow.com/q/26844023
accepted answer: http://stackoverflow.com/a/26844220
possible better answer: http://stackoverflow.com/a/26844199
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26844199
tagged with: angle
upvote count: 2
has title: pass a variable to move a bullet at angle
type: Question
has body: so basically I am currently implementing shooting at cursor mechanic into my game. I have a mousemove eventListener to check for mouse coordinates and to calculate the angle at what my character should shoot. I just need to pass the final vx and vy variables from my handleMouse function to my update function, but I can't figure out how. It's probably going to be very simple solution, but I can't get my head around it since I am pretty new to programming. Thank you very much. window.addEventListener("mousemove", handleMouse, false); function getMousePosition(e){ var x, y; x = e.clientX - backgroundCanvas.getBoundingClientRect().left; y = e.clientY - backgroundCanvas.getBoundingClientRect().top; return {x:x, y:y}; } function handleMouse(e){ var pos = getMousePosition(e); posx = pos.x; //mouse x position posy = pos.y; //mouse y position var delta = {x: posx - player.x, y: posy - player.y}; //y2 - y1, x2 - x1 var angle = Math.atan2(delta.y, delta.x) ; var vx = Math.cos(angle - (Math.PI/2)) * game.bulletSpeed; var vy = Math.sin(angle - (Math.PI/2)) * game.bulletSpeed; return {vx:vx, vy:vy}; } function update(){ //move bullets - this is where I need to pass the vx and vy variables var vector = handleMouse(e); // this is probably wrong vx = vector.vx; vy = vector.vy; for (i in game.bullets){ game.bullets[i].x -= vx; game.bullets[i].y -= vy; } }
tagged with: javascript
has answer: http://stackoverflow.com/a/26844220
answer count: 2
tagged with: canvas
downvote count: 0
favorite count: 0

http://stackoverflow.com/q/26975871
tagged with: ajax
has body: I am using the following URL to get data for a weather app. http://wsf.cdyne.com/WeatherWS/Weather.asmx/GetCityWeatherByZIP I've used this API before, but this time I'm trying to load the data in using AJAX so the rest of my page doesnt reload when this data is fetched. Here is my javascript &lt;script&gt; $(function () { var zip = 16001; $.ajax({ type: 'GET', crossDomain:'true', url: 'http://wsf.cdyne.com/WeatherWS/Weather.asmx/GetCityWeatherByZIP' +zip, success: function (data) { console.log("Here is the data", data); }, error: function () { alert("Error loading data"); } }); }); &lt;/script&gt; I keep recieving the following error in the console. XMLHttpRequest cannot load http://wsf.cdyne.com/WeatherWS/Weather.asmx/GetCityWeatherByZIP16001. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:50733' is therefore not allowed access. The response had HTTP status code 500. weatherAjax.html:1 This makes it seem like their is an issue with accessing the data. But i've used this before with a simple form that the user input their zip code into. And it returned the data. The only difference now is I want to load the data using AJAX so the entire page doesn't reload. What am I doing wrong?
accepted answer: http://stackoverflow.com/a/26975963
type: Question
type: AnsweredQuestion
score: 1
favorite count: 0
upvote count: 1
has title: No 'access-control-allow-origin' header is present in AJAX request
answer count: 1
has answer: http://stackoverflow.com/a/26975963
has comment: http://stackoverflow.com/comment/42486716
has comment: http://stackoverflow.com/comment/42486659
downvote count: 0
has comment: http://stackoverflow.com/comment/42486614
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/42348914
type: Comment
type: QuestionComment
has text: No. I first select the image then call the upload by clicking a separate button
comment on: http://stackoverflow.com/q/26897403
score: 0

http://stackoverflow.com/comment/42429954
type: QuestionComment
comment on: http://stackoverflow.com/q/26943428
score: 0
has text: You have two `id` attributes: `id="test"` and `id="select"`, try to remove `id="test"`.
type: Comment

http://stackoverflow.com/q/26956960
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/26957164
type: Question
has body: I want to pass an input like below. Input (stdin) 1 15 I am not sure how would i pass the above format input to my _input variable. function processData(input) { //Enter your code here console.log(input); } process.stdin.resume(); process.stdin.setEncoding("ascii"); _input = ""; process.stdin.on("data", function (input) { _input += input; }); process.stdin.on("end", function () { processData(_input); });
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
has title: How to pass input to the following code?
type: UnansweredQuestion
tagged with: node.js

http://stackoverflow.com/comment/42458207
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26959738
score: 0
has text: It's recommended to save each reading as a new document rather than pushing to an array. Detailed explanation can be found [`here`](http://askasya.com/post/largeembeddedarrays)

http://stackoverflow.com/comment/42425940
comment on: http://stackoverflow.com/a/26940974
has text: Oh, sorry, I just update the answer. In your case, I suggest going with an html call. javascript has no benefit here. But if you want to do it with jquery, you can use $(document).html(response), which will keep the url the same, but change the whole DOM.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/26910314
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26910089
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26910089
downvote count: 0
has body: Instead of ng-model you should interpolation. app.directive('titlepage', [function () { return { restrict: 'E', replace: true, templateUrl: 'partials/directives/titlepage.html', scope: { titleapp: '=' } }; }]) {{app.title}}

postback
tag name: postback
type: Tag
tags question: http://stackoverflow.com/q/26981567

http://stackoverflow.com/comment/42479155
has text: Why don't you create a custom image in the form of a rectangle with a pin in the center, and use it as your marker icon? Would you rather add a rectangle object that follows the marker around when dragged? I'd like to understand what's the intended functionality.
comment on: http://stackoverflow.com/q/26971611
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42414667
has text: @HowardRenollet yeah, we all reached the same. My intent was first to answer why, then take the time to give an example of the correct way, which I was working on and it turns out you all beat me to :) Nice work.
type: Comment
comment on: http://stackoverflow.com/a/26934696
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42252393
score: 5
has text: Your CSS selector `.cardnumber` points to a CSS class, not an element. Do you have two HTML elements with the class `cardnumber`? I think you should include your HTML in your question. See [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve).
type: Comment
comment on: http://stackoverflow.com/q/26844604
type: QuestionComment

http://stackoverflow.com/comment/42498369
score: 0
has text: That worked much better than the convoluted slice I was trying to use, much appreciated.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/26981815

http://stackoverflow.com/comment/42416563
type: AnswerComment
comment on: http://stackoverflow.com/a/26935589
type: Comment
has text: Actually, `.remove('style')` does not seem to be working. I had to approach it like this: http://jsbin.com/dovuvuwova/1/edit?html,js,output
score: 0

http://stackoverflow.com/a/27047333
answers question: http://stackoverflow.com/q/26903493
has comment: http://stackoverflow.com/comment/44363389
score: -1
type: Answer
has comment: http://stackoverflow.com/comment/44415992
has comment: http://stackoverflow.com/comment/44384160
has body: It seems to me that you have two options here. The first is to parse out dangerous searches client side in your jQuery code before sending this text input to the server. I'm not sure exactly what you'd be looking for, but I assume you want to stop the user from sending specific things in your search bar. A good way to prevent this would be to search for specific things in their search. For example, you could wrap the function to send the search to the server in an if statement like so(sorry for pseudocode): if(txtinput.indexOf('&lt;script&gt;') === -1 &amp;&amp; ...more checks...){ // send input to server } These if statements could be chained so you can check for any XSS issues before actually sending it to the server. That said, this approach isn't very appealing from a systems design perspective. Like you said, the better approach is to do this server side. I'm not particularly familiar with .NET backends, but based on the code you included, I imagine you could parse your txtSearch.text server-side. This would look similar to the answer above. Essentially, you would only redirect to that link if their text input meets certain conditions. Unfortunately, I'm not extremely familiar with string parsing and validating in .NET, so I can't give you the code, but it should look something like this, assuming you've written and isValid function. if(isValid(txtSearch.txt)){ Response.Redirect("search.aspx?tx=" + txtSearch.Text); } else { // Send Error code in response } I hope this helps a bit!
downvote count: 2
upvote count: 1

http://stackoverflow.com/comment/42519022
comment on: http://stackoverflow.com/q/26973172
has text: I test this in chrome without any trouble. The jsFiddle provide by @EdanFeiles and the jsFiddle that I put on my previous comment. Did you check both of them?
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/42243198
comment on: http://stackoverflow.com/q/26839175
has text: @errand : Thanks for your suggestion. But I was expecting a solution based on my current JSON format with starting and ending pos.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42348798
comment on: http://stackoverflow.com/q/26897873
has text: Could you make a demo..this is a little difficult without the HTML
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26972223
type: Question
score: 1
has comment: http://stackoverflow.com/comment/42484348
has title: Kendo button calling a javascript function on click
answer count: 3
has comment: http://stackoverflow.com/comment/42482985
has answer: http://stackoverflow.com/a/26972990
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: kendo-ui
has answer: http://stackoverflow.com/a/27156340
has answer: http://stackoverflow.com/a/26972434
type: UnansweredQuestion
tagged with: kendo-asp.net-mvc
has body: I have a HTML input like this: &lt;input type="submit" name="saveForm" value="Save" onclick="return validateForm()"/&gt; here's the validateForm function called when the button is clicked: function validateForm() { if (someErrorCondition) { alert("error"); return false; } reallySubmitForm(); } I want to replace this button with a Kendo Button, and I'm doing like this: @(Html.Kendo().Button() .Name("save") .HtmlAttributes( new {type = "submit"}) .ImageUrl(Url.Content("~/Images/save.png")) .Events(e =&gt; e.Click("return validateForm")) &lt;--------- here's the problem .Content("Save") ) The problem is that, if I have .Events(e =&gt; e.Click("return validateForm")) the button isn't rendered correctly: the "return" word is messing it up. If I have this .Events(e =&gt; e.Click("validateForm")) it's rendered correctly and the function is called. However, when clicked, the button submits the form anyway, without caring with validation. How can I achieve the former behaviour with this Kendo Button?
upvote count: 1

http://stackoverflow.com/q/26931947
favorite count: 0
tagged with: angularjs
has body: Not sure if I'm using Angular correctly. I basically want to make a simple Link/Story sharing site. var Story = $resource("api/stories/:id", {}, { query: { method: "GET", isArray: false } }); Story.query().$promise.then(function (data) { $scope.stories = data.stories; $scope.test = 1; }); $scope.submitForm = function(formData) { Story.save({}, formData, function(data) { $scope.$apply(function() { $scope.stories = data.stories; $scope.test = 2; }); }); } Changes to $scope.test get reflected, but not stories. Edit: Uhhh so apparently if I remove "ng-controller" &lt;ul ng-controller="storyController"&gt; &lt;li ng-repeat="story in stories"&gt;{{ story.title }}&lt;/li&gt; &lt;p&gt;{{ test }}&lt;/p&gt; &lt;/ul&gt; Everything works now..... I'm not even sure why....
score: 0
answer count: 2
upvote count: 1
tagged with: ruby-on-rails
downvote count: 1
has comment: http://stackoverflow.com/comment/42409308
has answer: http://stackoverflow.com/a/26939264
has answer: http://stackoverflow.com/a/26932372
has comment: http://stackoverflow.com/comment/42410159
tagged with: javascript
type: UnansweredQuestion
has title: AngularJS + Rails $scope model is updated but not firing a re-render
type: Question
has comment: http://stackoverflow.com/comment/42409717

http://stackoverflow.com/comment/42271641
type: Comment
has text: It is, i chose to use the IIFE to support the *grown codebase* aspect of my answer.
comment on: http://stackoverflow.com/a/26836709
type: AnswerComment
score: 0

http://stackoverflow.com/a/70372112
downvote count: 0
answers question: http://stackoverflow.com/q/26980713
has comment: http://stackoverflow.com/comment/126377063
type: Answer
score: 1
upvote count: 1
has body: This is a pretty old and well-covered question already, but figured I'd contribute what I think is the simplest solution of the lot: @app.after_request def after_request(response: Response) -&gt; Response: response.access_control_allow_origin = &quot;*&quot; return response

http://stackoverflow.com/comment/42272097
has text: @kenhimself The issue with the type going behind the image is related to the z-index being set only after the fade completes. I'm assuming that you won't actually have text in your final design making this a non-issue, but there's more info on how to fix here: http://stackoverflow.com/questions/7055269/jquery-fadein-on-positionabsolute-causes-z-index-issue. Fading out the filler when the image is clicked is fairly simple. I've updated the jsfiddle: http://jsfiddle.net/nvwzgus0/8/.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26854259

http://stackoverflow.com/comment/42378975
type: Comment
comment on: http://stackoverflow.com/a/26914509
has text: Tried using .next() and it returns the form for the first comment on the page. Hitting any .voteUp button always submits the form for the first comment. I think the problem is with $(this) always being a reference to the first div with that class name.
score: 0
type: AnswerComment

http://stackoverflow.com/a/26893017
downvote count: 1
accepted answer of: http://stackoverflow.com/q/26892982
has comment: http://stackoverflow.com/comment/42341412
answers question: http://stackoverflow.com/q/26892982
score: 0
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/42339854
has comment: http://stackoverflow.com/comment/42341361
has body: You're looking for setTimeout() setTimeout(function () { $("#loading").fadeOut(3000); }, 3000); From the jQuery .delay() docs : The .delay() method is best for delaying between queued jQuery effects. Because it is limited—it doesn't, for example, offer a way to cancel the delay—.delay() is not a replacement for JavaScript's native setTimeout function, which may be more appropriate for certain use cases.
upvote count: 1
has comment: http://stackoverflow.com/comment/42339727

http://stackoverflow.com/a/26882414
has body: You could move globalFunc1 inside globalFunc2, so it has access to the latter's internal variables, but assign it to a global variable to allow it to be invoked from outside: function globalFunc2() { window.globalFunc1 = function() { console.log(hello); }; var hello = 'hello'; globalFunc1(); // will print "hello" } globalFunc1(); // will print "hello" Here, globalFunc1 is defined inside globalFunc2, and so has access to the variables in its closure, hello in this case. However, it itself is a global variable, allowing it to be accessed from outside. In terms of how you asked the question, you can "access function scope chain from a globally defined function" if (and only if) that globally defined (perhaps one should say "declared" instead) function points to a function inside the other function's scope. Whatever you do, do not do your eval thing. What you are essentially doing there is defining (and then immediately executing) the function by lexically copying it in. Instead of doing that, why not just write the function there to start with, as above?
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/42321972
downvote count: 0
answers question: http://stackoverflow.com/q/26882305

http://stackoverflow.com/comment/42369926
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26896189
score: 0
has text: @MattR can you give me some pointers on how to learn how all this is accomplished? I don't have any exposure to asynchronous javascript.

http://stackoverflow.com/a/26834044
has comment: http://stackoverflow.com/comment/42236176
downvote count: 0
has body: For what you are doing I would recommend using pure CSS. Here is some working code. svg:hover .recolor { fill: red; } As you see, you can just use the :hover event in CSS to recolor the necessary elements. And set them to your default color (green), which will take effect when the user is not hovered.
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/26833977

http://stackoverflow.com/q/26869964
accepted answer: http://stackoverflow.com/a/26870021
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42298734
downvote count: 2
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26870021
has title: jQuery is duplicating ans 's in loop
upvote count: 0
score: -2
answer count: 1
tagged with: javascript
tagged with: jquery
has body: My jQuery is somehow creating extra TR's and TD's. I cant seem to get it to work right. here is the DOM before running script: Here is my script: &lt;script language='javascript'&gt; $(document).ready( function(){ $('[class^=\"odd\"],[class^=\"even\"]').each( function(){ // add a row after this row html = '&lt;tr style=\"display:none\"&gt;&lt;td&gt;&lt;td/&gt;&lt;td colspan=\"9\"&gt;&lt;td/&gt;&lt;tr/&gt;'; $(this).after(html); }); }); &lt;/script&gt; here is the DOM after running script:
favorite count: 0

http://stackoverflow.com/a/26917695
type: Answer
has body: Have you tried something like this ? alabama
answers question: http://stackoverflow.com/q/26916887
has comment: http://stackoverflow.com/comment/42384498
score: 0

http://stackoverflow.com/q/26900423
has body: This is sort of a follow-up to my previous question. I'm trying to figure out how to edit an existing item that is stored in my Firebase. My items are repeated on the page, and each of them have an "Edit" button next to them. HTML Editing {{ editedProvider.title }} Submit {{ provider.title }} Edit This is how I'm currently adding an item to my list: JS var rootRef = new Firebase(FBURL); var providersRef = rootRef.child('providers'); $scope.newProvider = {}; $scope.providers = []; providersRef.on('child_added', function(snapshot) { $timeout(function() { var snapshotVal = snapshot.val(); console.log(snapshotVal); $scope.providers.push({ title: snapshotVal.title, name: snapshot.name() }); }); }); $scope.createProvider = function() { var newProvider = { title: $scope.title }; providersRef.push(newProvider); }; I've then created a function setEditedProvider and binded it to the edit button, that when clicked brings up the edit form for that particular item. When I've made my changes however, I need to run a function called updateProvider, and I'm having problems creating that function. $scope.editedProvider = null; $scope.setEditedProvider = function(provider) { $scope.editedProvider = angular.copy(provider); } $scope.updateProvider = function(provider) { // need to take that edited function and push the updated version inside here } Can I utilise Firebase's data snapshot for this, like I am for creating the item? Some of this is finally clicking for me, I think I understand how it needs to be done, I just can't work out how to achieve it. Any help with this problem is appreciated. Thanks in advance!
tagged with: angularjs
type: Question
score: 0
answer count: 1
tagged with: firebase
has title: Edit Item from Firebase
linked to: http://stackoverflow.com/q/26878682
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26907743
tagged with: jquery

http://stackoverflow.com/comment/42509770
has text: Here is a fiddle that I built partially with code I am working with. http://jsfiddle.net/nbeuko3v/embedded/result/ As you can see there is a vertical scrollbar on the right that moves the header and footer paginators and content table. If you scroll down to just above the footer paginator, you see the horizontal scrolbar that moves the content of the data table left and right. I need a JS trick to put a scrollbar at the bottom of the main container div that will scroll the content of the data table left and right, but NOT the header and footer paginators.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26987180

http://stackoverflow.com/comment/42445036
type: AnswerComment
comment on: http://stackoverflow.com/a/26898067
type: Comment
has text: Please use `e.preventDefault()` instead of `return false;`. When using `return false` it is generally at the end of the callback while `e.preventDefault()` is generally at the beginning.
score: 0

http://stackoverflow.com/comment/42311393
comment on: http://stackoverflow.com/q/26876946
score: 0
has text: I'm trying to use a big chunck of text and Im getting out of memory every time, even when tried with jsfiddle. :(
type: Comment
type: QuestionComment

jstree
tags question: http://stackoverflow.com/q/26972533
type: Tag
tag name: jstree

http://stackoverflow.com/a/26882401
answers question: http://stackoverflow.com/q/26882333
upvote count: 1
type: Answer
downvote count: 0
score: 1
has body: If this is the .swatch-category-container img element then, the anchor is the previous to previous sibling of the ancestor swatch-category-container element var link = jQuery(this).closest('.swatch-category-container').prev().prev().attr("href");

http://stackoverflow.com/comment/42463171
has text: Here's a jquery version of what I am trying to achieve: http://jsfiddle.net/mw6t82ae/1/
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26940170
type: Comment

http://stackoverflow.com/q/26887217
tagged with: codeigniter
has comment: http://stackoverflow.com/comment/42329495
answer count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has title: Why aren't other table data are passing in a database in codeigniter?
has body: I am new in Codeigniter and i am experiencing a problem is sending a table data to the database. I have one row in a table by default and by clicking on the add activity button new rows are added by append of javascript. When i press submit button then only the first row data are passing to the database. Here is my code: Model: class Addworkplan_model extends CI_Model{ public function addworkplan($id){ $workplan_notification= 1; $workplan_status=1; $quater=$this->input->post('activity_quarter'); if ($quater="one"){ $workplan_month=$this->input->post('autumn'); } elseif ($quater="two"){ $workplan_month=$this->input->post('spring'); } elseif($quater="three"){ $workplan_month=$this->input->post('fall'); } $data=array('workplan_quarter'=>$this->input->post('activity_quarter'), 'workplan_month'=>$workplan_month, 'workplan_date'=>$this->input->post('activity_date'), 'workplan_activity'=>$this->input->post('activity_name'), 'workplan_unit'=>$this->input->post('activity_unit'), 'workplan_weightage'=>$this->input->post('activity_weightage'), 'workplan_pi100'=>$this->input->post('activity_100'), 'workplan_pi75'=>$this->input->post('activity_75'), 'workplan_pi50'=>$this->input->post('activity_50'), 'workplan_pi25'=>$this->input->post('activity_25'), 'division_id'=>$id, 'workplan_notification'=>$workplan_notification, 'workplan_status'=>$workplan_status ); print_r ($data); exit; Javascript for append: $(document).ready(function() { count=1; $("button#addrowclick").click(function(){ for (i = 1; i <= count; i++) { var add = ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' '; } count=count+1; //alert(count); $('tbody').append(add); }); }); I know that the name should be something different but i could not do that so any help will be appreciated. Thank You
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42330067
has comment: http://stackoverflow.com/comment/42328902
has comment: http://stackoverflow.com/comment/42329623
score: 0
tagged with: php

http://stackoverflow.com/a/26914118
type: AcceptedAnswer
has body: I was finally able to solve my issue, and it turns out it was a conflict in JavaScript references. I previously used jquery.sortable.js, then went back to using the sorting functionality of jQuery UI's sort, but failed to remove the reference to jquery.sortable.js.
type: Answer
upvote count: 4
downvote count: 0
answers question: http://stackoverflow.com/q/26898051
accepted answer of: http://stackoverflow.com/q/26898051
has comment: http://stackoverflow.com/comment/50477122
score: 4
has comment: http://stackoverflow.com/comment/42450189
has comment: http://stackoverflow.com/comment/42486023

http://stackoverflow.com/a/26849149
upvote count: 4
has comment: http://stackoverflow.com/comment/42260928
downvote count: 0
has comment: http://stackoverflow.com/comment/42261265
accepted answer of: http://stackoverflow.com/q/26849113
answers question: http://stackoverflow.com/q/26849113
score: 4
has comment: http://stackoverflow.com/comment/42261255
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42260956
has body: In browsers that support the new form attribute from HTML 5: &lt;button form="order-form"&gt;…&lt;/button&gt; … but don't. Adjust your design so that form controls are inside the form they are associated with. It doesn't make semantic sense to split them up.
type: Answer

http://stackoverflow.com/a/26919988
score: 1
answers question: http://stackoverflow.com/q/26919789
upvote count: 1
has body: Obviously, this wouldn't work as is There is nothing obvious about it. In XSLT, you can use Unicode characters without escaping (provided your encoding is UTF-8 or similar). You cannot use undefined entities such as &amp;agrave;. If you need the output to escape the accented characters to HTML entities, try setting your output method to HTML (may not work with every XSLT processor).
type: Answer
downvote count: 0

http://stackoverflow.com/comment/42372588
type: QuestionComment
has text: @anguLaravel: this notation is equivalent to putting all the declaration in the same call. In the end, you're always writing a function. Take a look at the guidelines I linked in a previous comment.
comment on: http://stackoverflow.com/q/26910791
score: 0
type: Comment

http://stackoverflow.com/q/26897403
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42349781
has comment: http://stackoverflow.com/comment/42350438
has answer: http://stackoverflow.com/a/26899270
type: Question
has title: How can I append uploaded Images to form then post to server
has comment: http://stackoverflow.com/comment/42350416
linked to: http://stackoverflow.com/q/13243909
tagged with: javascript
score: 0
has body: I’m am trying to upload images on my website then post them back to my server . To upload the images I am using the plugin found here: http://jasny.github.io/bootstrap/javascript/#fileinput So I included the javascript and css files found here: cdnjs.cloudflare.com/ajax/libs/jasny-bootstrap/3.1.3/css/jasny-bootstrap.min.css cdnjs.cloudflare.com/ajax/libs/jasny-bootstrap/3.1.3/js/jasny-bootstrap.min.js On my html page I included the following : Select Artist ImageChange Remove Selecting and removing images works nicely . Now with a separate button I’m trying to append the selected files to Form DATA. $scope.UpdateChannelImages = function() { var formData, thumbnail; formData = new FormData(); if ($('#inPutArtistImage')[0].files && $('#inPutArtistImage')[0].files.length > 0) { thumbnail = $('#inPutArtistImage')[0].files[0]; formData.append('inPutArtistImage', thumbnail, 'Artist' + thumbnail.name); However I simply cannot append the files to form data: I get this error: Cannot read property 'files' of undefined here is the line that throws the error: if ($('#inPutArtistImage')[0].files && $('#inPutArtistImage')[0].files.length > 0) { I need help appending the uploaded image to Form data
has comment: http://stackoverflow.com/comment/42348914
has comment: http://stackoverflow.com/comment/42348611
answer count: 1
has comment: http://stackoverflow.com/comment/42349622

http://stackoverflow.com/comment/42398147
comment on: http://stackoverflow.com/q/26925800
score: 0
type: QuestionComment
has text: I've editted the question plz take a look
type: Comment

http://stackoverflow.com/comment/42498971
has text: Before you criticise you have to present a better solution! Maybe you need to read some JavaScript Beginners Tutorials and continue with some best practise guides.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26955791

http://stackoverflow.com/comment/42447258
comment on: http://stackoverflow.com/a/26919628
type: Comment
has text: Thanks but I'm still not sure how to get this to work. Should I use an element id from the "success" page and check if a user is on that page?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42301941
comment on: http://stackoverflow.com/q/26871820
score: 0
type: QuestionComment
has text: what is your issue ?
type: Comment

http://stackoverflow.com/comment/42284165
type: AnswerComment
score: 1
has text: `live()` was deprecated a **long** time ago.
type: Comment
comment on: http://stackoverflow.com/a/26862013

http://stackoverflow.com/q/26900920
has title: Convert hours to correct division by 60 minutes
has body: How would I convert a number such as the following: 12.82 into the correct hourly format: 13.22?
score: -6
favorite count: 0
upvote count: 0
has answer: http://stackoverflow.com/a/26901069
accepted answer: http://stackoverflow.com/a/26901069
has comment: http://stackoverflow.com/comment/42354269
has answer: http://stackoverflow.com/a/26900985
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26901078
possible better answer: http://stackoverflow.com/a/26900985
type: Question
has answer: http://stackoverflow.com/a/26901151
tagged with: javascript
downvote count: 6

http://stackoverflow.com/comment/42385989
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26918853
has text: Yes, I didn't show it here, but it is loaded at the top of the page, and all of my other session variables work fine so I don't think it's that.

http://stackoverflow.com/comment/42269534
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26853431
type: Comment
has text: "From the source"? It will very much depend on what minifier you're using of course.

http://stackoverflow.com/comment/42259697
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26848123
has text: I did this but as you can see here: http://jsfiddle.net/confile/o73ur6pf/ The border has a different color and cannot be removed anymore.
score: 0

http://stackoverflow.com/q/26928993
tagged with: android
tagged with: back-button
has answer: http://stackoverflow.com/a/26986224
answer count: 1
score: 0
accepted answer: http://stackoverflow.com/a/26986224
has body: I am developing a sencha touch 2 application and I am packaging it using cordova for android. I want to handle the back button of android through cordova. I have written the below code in app.js file of my project, after adding all the views in the viewport. if (Ext.os.is('Android')) { document.addEventListener("backbutton", Ext.bind(onBackKeyDown, this), false); function onBackKeyDown(e) { e.preventDefault(); if (Ext.Viewport.getActiveItem().xtype == myHomeView.xtype ) { navigator.app.exitApp(); } else { Ext.Msg.alert("Back button is pressed"); } } } Also, I built it using command line. 1. cmd --&gt; cordova create app com.basicapp.app "App" 2. Deleted all the content inside "www" folder and replaced with my project's content. 3. cmd --&gt; cordova platform add android 4. Installed device plugin from cordova documentation. 5. cmd --&gt; cordova build But I am unable to handle the backbutton in the device.It just exits the application in all the views. Is the device ready event not getting fired? Can anyone please explain me what am I doing wrong here.
has title: Unable to handle the back button of android using sencha touch 2 and cordova
tagged with: javascript
tagged with: sencha-touch-2
type: AnsweredQuestion
tagged with: cordova
type: Question

weixinjsbridge
type: Tag
tag name: weixinjsbridge
tags question: http://stackoverflow.com/q/26944862

http://stackoverflow.com/comment/42498466
score: 0
type: AnswerComment
type: Comment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/65102/discussion-between-benjamin-jones-and-vivek-pradhan).
comment on: http://stackoverflow.com/a/26965656

http://stackoverflow.com/q/26984473
type: AnsweredQuestion
tagged with: pebble-sdk
tagged with: javascript
tagged with: pebble-watch
has body: The documentation on window (http://developer.getpebble.com/docs/pebblejs/#window) says that we can add an image to it: "Window: The Window by itself is the most flexible. It allows you to add different Elements (Circle, Image, Rect, Text, TimeText) and to specify a position and size for each of them. You can also animate them." An image is an element, but there is no documentation on the image constructor. What parameters does it take? Particularly, how do we specify the image src? Also, there is no example code of adding an image to a window.
type: Question
upvote count: 1
answer count: 1
accepted answer: http://stackoverflow.com/a/26996297
favorite count: 0
has title: How to add an image to a window in Pebble.js?
has answer: http://stackoverflow.com/a/26996297
downvote count: 0
score: 1
tagged with: cloudpebble

http://stackoverflow.com/comment/42375210
has text: @E.Maggini I updated and added much more detail. I think it will be more useful than a stack trace. IMO
comment on: http://stackoverflow.com/a/26912624
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/26987685
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26987155
has body: I am not sure why you need to complicate it. Try this demo: http://jsfiddle.net/lotusgodkk/GCu2D/417/ JS: $(document).ready(function () { $(document).on('keydown', function (e) { var keyCode = e.keyCode; if ((keyCode == 84) &amp; (e.shiftKey)) { $('.ui-state-active:visible:first').focus(); //ui-state-active is the class of active tab. } }); $('#tabs').tabs(); });
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/26987155

http://stackoverflow.com/comment/42434275
type: Comment
type: QuestionComment
has text: Why not just set the new value from within the flash applet?
comment on: http://stackoverflow.com/q/26945701
score: 0

http://stackoverflow.com/q/26869763
favorite count: 0
has answer: http://stackoverflow.com/a/29673465
type: UnansweredQuestion
score: 2
downvote count: 0
type: Question
tagged with: ticker
tagged with: javascript
has answer: http://stackoverflow.com/a/26869865
tagged with: jquery-plugins
has title: jQuery Slick Slider: How to make a logo ticker slider
upvote count: 2
answer count: 2
has body: I'm currently using the Slick Slider plugin and don't really want to add another plugin to achieve a Logo Ticker slide effect like seen here bxSlider. Any idea how to do it with Slick or if it's even possible?
tagged with: jquery

http://stackoverflow.com/comment/42271769
comment on: http://stackoverflow.com/a/26839003
score: 0
type: AnswerComment
has text: if this help you out sir please accept this as an answer :) cheers!
type: Comment

http://stackoverflow.com/comment/42472147
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26967681
has text: Unrelated but $.browser has been deprecated since jQuery 1.3 and was removed in 1.9 http://api.jquery.com/jquery.browser/
score: 0

http://stackoverflow.com/comment/99058551
comment on: http://stackoverflow.com/a/26898794
has text: how about when we return observabvles
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/26947283
answers question: http://stackoverflow.com/q/26947223
has body: Selecting the first or only IFRAME element on a page: var frame = document.querySelector('iframe'); Then getting an attribute: var val = frame.getAttribute('data-videoid'); Or getting a data- attribute: var val = frame.dataset.videoid;
has comment: http://stackoverflow.com/comment/42437331
score: 0
type: Answer

coffeescript
tags question: http://stackoverflow.com/q/26862074
tags question: http://stackoverflow.com/q/26880049
tags question: http://stackoverflow.com/q/26914990
tags question: http://stackoverflow.com/q/26879800
tags question: http://stackoverflow.com/q/26958710
tags question: http://stackoverflow.com/q/26972031
tags question: http://stackoverflow.com/q/26867356
tags question: http://stackoverflow.com/q/26848076
tags question: http://stackoverflow.com/q/26880328
tags question: http://stackoverflow.com/q/26953854
type: Tag
tags question: http://stackoverflow.com/q/26855757
tags question: http://stackoverflow.com/q/26943599
tags question: http://stackoverflow.com/q/26901179
tags question: http://stackoverflow.com/q/26977121
tag name: coffeescript
tags question: http://stackoverflow.com/q/26907979
tags question: http://stackoverflow.com/q/26906082
tags question: http://stackoverflow.com/q/26955191

http://stackoverflow.com/q/26985389
has title: JavaScript unit tests with Jasmine and RequireJS
has comment: http://stackoverflow.com/comment/42504386
tagged with: javascript
tagged with: jasmine
has body: In my visual studio I have two projects one of them provide functionality for SharePoint page and another one for testing purposes. In the first project I have few view modules that use RequireJS as a dependency injector. I need to write js tests in another project: /// &lt;reference path="Scripts/require.js" /&gt; describe('directly', function () { beforeEach(function() { require.config({ baseUrl: '../CopmanyName/Layouts/1033/Scripts/CopmanyName/ProjectName/app', }); }); it('should see booking', function (done) { require(['Booking'], function (booking) { expect(booking).toBeDefined(); done(); }); }); }); The test failed. It appears that requireJS is not able find the Booking module, which is defined like that: define(['knockout','moment'], function(ko, moment) { return function Booking(data) {// some functionality} The error message is: "Expected undefined to be defined." in expect(booking).toBeDefined();
has comment: http://stackoverflow.com/comment/42504296
answer count: 0
score: 0
type: UnansweredQuestion
tagged with: requirejs
tagged with: unit-testing
type: Question
has comment: http://stackoverflow.com/comment/42504346

http://stackoverflow.com/comment/42499457
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/26982611
has text: Yes, implement CORS or JSONP. (both of which require access to the remote server)
type: Comment

http://stackoverflow.com/q/26838414
has title: angularjs $watch not work in my item
tagged with: watch
type: Question
has comment: http://stackoverflow.com/comment/42241931
score: 0
has body: &lt;input ng-model="myInput" type="email" placeholder="Recipient" /&gt; controller : $scope.myInput = 3; $scope.$watch('myInput', function() { console.log(1); }); when I input something in console.log(1),not work!
answer count: 1
has answer: http://stackoverflow.com/a/26838697
tagged with: javascript
tagged with: angularjs
has comment: http://stackoverflow.com/comment/42241721
type: UnansweredQuestion

http://stackoverflow.com/q/26880881
upvote count: 7
has answer: http://stackoverflow.com/a/26932724
tagged with: javascript
type: UnansweredQuestion
has body: I just want to ask if there is a way to change the threshold of the event touchmove? In my PhoneGap App, an image will appear. If touchstart is triggered, another image will appear. If touchend or touchmove is triggered, all images must disappear. Here is my code: $('.greenApple').on('touchend', function (e){ $('body').find('.active').removeClass('active'); $('body').find('.greenApple').addClass('hidden'); flag = true; return; }); $('.greenApple').on('touchmove', function (e){ $('body').find('.active').removeClass('active'); $('body').find('.greenApple').addClass('hidden'); flag = true; return; However, the threshold of the number of pixels that is considered a touchmove is too little. Frequently, as soon as I press the image (not releasing it, touchend is not being triggered), the image disappears because the touchmove event is triggered. Is there a way to change the number of pixels of moved that is considered as touchmove? Or there are other workarounds?
answer count: 4
has title: How to change threshold of "touchmove" in js
downvote count: 0
tagged with: jquery
tagged with: dom-events
score: 7
has answer: http://stackoverflow.com/a/27000225
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/26986573
has answer: http://stackoverflow.com/a/27060589
tagged with: cordova

http://stackoverflow.com/a/26943503
downvote count: 0
has comment: http://stackoverflow.com/comment/42430218
type: Answer
has body: Here's a solution. It's a bit different but better because thanks to the use of CSS, it is both semantic and accessible. The 'Charging...' text is readable by screen readers, and no unnecessary HTML images are added. You can of course change the text to whatever you want. CSS: #chargingbox { width: 20px; height: 0; line-height: 120%; padding-top: 40px; overflow: hidden; background: url(assets/icons/ic_battery_charging_20_48px.svg) 0 0 no-repeat; } HTML: Charging... JS: $(document).ready(function(e) { var delay = 100, // in ms, change to whatever you want current_icon_index = 0, icon_urls = [ 'assets/icons/ic_battery_charging_20_48px.svg', 'assets/icons/ic_battery_charging_30_48px.svg', 'assets/icons/ic_battery_charging_50_48px.svg', 'assets/icons/ic_battery_charging_60_48px.svg', 'assets/icons/ic_battery_charging_80_48px.svg', 'assets/icons/ic_battery_charging_90_48px.svg', 'assets/icons/ic_battery_charging_full_48px.svg' ]; var step_through = function() { $('#chargingbox').css({ 'background-image': 'url(' + icon_urls[current_icon_index] +')' }); current_icon_index++; if (current_icon_index === icon_urls.length-1) { current_icon_index = 0; } setTimeout(step_through, delay); }; step_through(); });
has comment: http://stackoverflow.com/comment/42430182
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/26943273
has comment: http://stackoverflow.com/comment/42430261

http://stackoverflow.com/q/26927792
has answer: http://stackoverflow.com/a/26929454
possible better answer: http://stackoverflow.com/a/26928035
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26928480
type: Question
has answer: http://stackoverflow.com/a/26928048
answer count: 8
has answer: http://stackoverflow.com/a/26928092
has body: This is my imgage: &lt;img alt="" id="loadingImage" src="Images/ajax-loader.gif" style="display:none"/&gt; I want to show the image with a javascript, this is my code and it does not work: function changeDisplay() { var img = document.getElementById('loadingImage'); img.style.display = "normal"; } HOWEVER If i do the "inverse", going from normal to hidden it works just fine with this code: &lt;img alt="" id="loadingImage" src="Images/ajax-loader.gif" style="display:normal"/&gt; function changeDisplay() { var img = document.getElementById('loadingImage'); img.style.display = "none"; } I dont get this, what am i doing wrong?
has answer: http://stackoverflow.com/a/26928075
downvote count: 0
accepted answer: http://stackoverflow.com/a/26929454
tagged with: javascript
favorite count: 0
score: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42401499
has comment: http://stackoverflow.com/comment/42401777
has answer: http://stackoverflow.com/a/26928035
upvote count: 3
has comment: http://stackoverflow.com/comment/42401536
has answer: http://stackoverflow.com/a/26928056
has answer: http://stackoverflow.com/a/26928050
has title: Javascript changing style display from none to normal does not work

http://stackoverflow.com/a/26863263
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/26860449
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26860449
type: Answer
has body: This Solution might help you. &lt;div id="foo"&gt; &lt;/div&gt; div#foo { width: 100px; height: 100px; border: 3px red solid; position: relative; -webkit-animation: mymove 5s infinite; animation: mymove 5s infinite; /*if you want to play animation for once onlye then you can use forwards instade of infinite.*/ } @-webkit-keyframes mymove { 0% { border: 3px red solid } 25% { border: 3px #000 solid } 75% { border: 3px blue solid } 100% { border: 3px green solid } } @keyframes mymove { 0% { border: 3px red solid } 25% { border: 3px #000 solid } 75% { border: 3px blue solid } 100% { border: 3px green solid } }

autocomplete
tags question: http://stackoverflow.com/q/26991288
tags question: http://stackoverflow.com/q/26924087
tags question: http://stackoverflow.com/q/26879423
tags question: http://stackoverflow.com/q/26955139
type: Tag
tags question: http://stackoverflow.com/q/26908215
tags question: http://stackoverflow.com/q/26870715
tags question: http://stackoverflow.com/q/26979937
tags question: http://stackoverflow.com/q/26965111
tags question: http://stackoverflow.com/q/26920777
tags question: http://stackoverflow.com/q/26949103
tags question: http://stackoverflow.com/q/26935309
tag name: autocomplete
tags question: http://stackoverflow.com/q/26892510
tags question: http://stackoverflow.com/q/26839183

http://stackoverflow.com/comment/42341580
score: 0
comment on: http://stackoverflow.com/a/26890273
has text: Given you are using 1.3, you can try `scope.$watchCollection('events.list', ...)`. See https://docs.angularjs.org/api/ng/type/$rootScope.Scope for a better example. If that doesn't work, I guess `$on` is the way to go.
type: AnswerComment
type: Comment

http://stackoverflow.com/a/26849150
has body: The first error is not specific if directoryresults is a class or an ID Nor do you tell if a target item or the item you wish to call If you use jQuery by TagName type this: var inputs = $('input'); if you want put values in a div $.each(inputs, function(){ $('div').append( $(this).val() ); });
answers question: http://stackoverflow.com/q/26848368
score: 0
type: Answer

http://stackoverflow.com/q/26990942
has comment: http://stackoverflow.com/comment/42513224
has title: How to Include marker in SVG Blinking Rectangular or circle Border image in google maps
downvote count: 2
has comment: http://stackoverflow.com/comment/42513460
possible better answer: http://stackoverflow.com/a/26992506
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42513422
has comment: http://stackoverflow.com/comment/42514713
tagged with: image
type: Question
has comment: http://stackoverflow.com/comment/42515190
answer count: 2
upvote count: 0
score: -2
has comment: http://stackoverflow.com/comment/42513749
tagged with: javascript
has answer: http://stackoverflow.com/a/26992506
favorite count: 0
has comment: http://stackoverflow.com/comment/42513395
has body: I have this link http://www.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png which include this in google maps points to the particular location using the lat long, Now I want to add the blinking border to this above marker link opens.. Is there any possible way to add the border blinking to the above marker in HTML,CSS, JQuery, I above link opens the marker, I have done in jsfiddle If possible provide me link in jsffidle How to add the border for this marker in css and html, jquery and blink? This is my code in google maps: Google Maps Multiple Markers I want to plot for the lat_center and long_center, now in this marker.setIcon in this I have to make a change in marker.seticon Is it possible with multiple markers in google maps?
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: photoshop
has answer: http://stackoverflow.com/a/26993533
accepted answer: http://stackoverflow.com/a/26993533

http://stackoverflow.com/q/26982757
upvote count: 2
possible better answer: http://stackoverflow.com/a/26982805
accepted answer: http://stackoverflow.com/a/26982811
has answer: http://stackoverflow.com/a/26982805
type: AnsweredQuestion
score: 2
type: Question
has comment: http://stackoverflow.com/comment/42499757
has comment: http://stackoverflow.com/comment/42500217
tagged with: javascript
has body: I'm new to JS. I'm trying to delete the parent node with all the children by clicking a button. But the console tells me that undefined is not a function. What am I missing? Fiddle: http://jsfiddle.net/vy0d8bqt/ HTML: Get contacts clear contact JS: // contact book, getting data from JSON and outputting via a button // define a JSON structure var contacts = { "friends" : [ { "name" : "name1", "surname" : "surname1" }, { "name" : "name2", "surname" : "surname2" } ] }; //get button ID and id of div where content will be shown var get_contacts_btn = document.getElementById("output"); var output = document.getElementById("output_here"); var clear = document.getElementById("clear_contacts"); var i; // get length of JSON var contacts_length = contacts.friends.length; get_contacts_btn.addEventListener('click', function(){ //console.log("clicked"); for(i = 0; i < contacts_length; i++){ var data = contacts.friends[i]; var name = data.name; var surname = data.surname; output.style.display = 'block'; output.innerHTML += " name: " + name + "| surname: " + surname + " "; } }); //get Children of output div to remove them on clear button //get output to clear output_to_clear = document.getElementById("output_here"); clear.addEventListener('click', function(){ output_to_clear.removeNode(true); });
has answer: http://stackoverflow.com/a/26982926
has answer: http://stackoverflow.com/a/26982811
answer count: 3
downvote count: 0
favorite count: 0
has title: Remove node function on parent element

http://stackoverflow.com/q/26850468
downvote count: 0
tagged with: ios8.1
favorite count: 0
linked to: http://stackoverflow.com/q/26184695
type: UnansweredQuestion
has body: TL;DR I want to open a database, get some information from it, close it and then reopen it with upgrade parameters based off of the information I get from it (version, number of objectstores, etc.) I am having some troubles with my indexeddb plugin that I wrote closing an object store and then reopening it with a version change. But first some background on what exactly I'm doing. Due to this issue, I was forced to do a terribly ugly structure for my database. Basically, I found that as you insert more records, it gets slower to insert. Since I have a very large set of data that needs to be saved, it turned out to be much much quicker to save each chunk of data into a separate Objectstore. At first I was creating a new database for each objectstore. This worked out quite well, but as I grew to understand indexedDB more I realized that this was not the best way to do it. I switched my plugin from using multiple databases to one database with multiple objectstores. However, this is where my problems started. Since I am unable to know how many chunks of data I will need, and one objectstore for each chunk of data, I first get from the server the total count of records that will be inserted and then divide that by the size of each chunk. That way I know how many objectstores I will need. However, since I am going to need to sync this data, those objectstores may already exist or they may not. Because of this, I get the number of objectstores that already exist, and if that amount is less than the number of the parts I add more. In order to get that number of object stores, I need to open the database first, then open it again with the updated schema information. However, when I try to do that, it always hits my abort function in my onupgradeneeded. However, if I just run that create function from page load rather than opening the db first, it seems to update the database schema just fine (That doesn't really help me though, as I need to know how many tables I have and t…
tagged with: safari
answer count: 0
score: 1
upvote count: 1
type: Question
tagged with: indexeddb
tagged with: javascript
has title: Reopening an objectstore with version change on Safari Mobile (iOS8.1)/Safari Desktop

http://stackoverflow.com/a/26899594
downvote count: 1
has body: If you want to read a style off an element that comes from a stylesheet, you have to use the computed style which you can obtain with window.getComputedStyle(). Styles applied via stylesheeets are not readable via elem.style. That only shows styles that are directly applied to that specific element (not inherited from stylesheets or parents). You could change your code like this and then it would work with the style sheet values in addition to directly applied values: function changeColor() { var dom = document.getElementById("head1"); var clr = getComputedStyle(dom, null).getPropertyValue("color"); switch(clr) { case 'black': dom.style.color = "red"; break; case 'red': dom.style.color = "black"; break; } } Note: getComputedStyle() requires IE9 or higher. IE8 and earlier had a different way of doing the same thing so when supporting older versions of IE, a polyfill of some sort such as is shown here is necessary. FYI, for your particular objective here, it is probably a better design pattern to just toggle a class on/off on the element and leave all the styling to the the CSS based on whether the class name is present or not and not put specific style parameters in your Javascript.
accepted answer of: http://stackoverflow.com/q/26899556
has comment: http://stackoverflow.com/comment/42386610
answers question: http://stackoverflow.com/q/26899556
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42385223
type: Answer
upvote count: 1

http://stackoverflow.com/a/26862345
score: 1
accepted answer of: http://stackoverflow.com/q/26862215
answers question: http://stackoverflow.com/q/26862215
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/42284892
has comment: http://stackoverflow.com/comment/42284775
has body: Your JSON seems to be improperly formatted. If you do want to access the sub-elements of email as objects, your JSON should look like this: { "email" : { "FamilyMembers": 54, "Children": 4, "Income": 8484, "Literacy": "UG", "MaritalStatus": "Married" } }
has comment: http://stackoverflow.com/comment/42284722
has comment: http://stackoverflow.com/comment/42284750
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/42522486
score: 0
type: Comment
type: QuestionComment
has text: if I change that, the ball dont become drawed.
comment on: http://stackoverflow.com/q/26977737

http://stackoverflow.com/q/26938130
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27026135
answer count: 2
tagged with: ruby-on-rails-4
downvote count: 0
has body: How do I pass a local variable from a form_for helper to a js file? I have the following file called _subscribe.html.erb &lt;%= form_for @subscription, :url =&gt; {:controller =&gt; "subscriptions", :action =&gt; "create"} do |f| %&gt; &lt;div&gt;&lt;%= hidden_field_tag :group_id, group.id %&gt;&lt;/div&gt; &lt;%= f.submit "Subscribe", class: "btn btn-primary subscribe_btn" %&gt; &lt;% end %&gt; The group local variable gets passed from a do block into this form and works (html only up until now). I want to turn this into an ajax call so i added remote: true to the form and added the file create.js.erb to the subscriptions folder: $("#new_subscription").html("&lt;%= escape_javascript(render('subscriptions/unsubscribe', locals: { group: group } )) %&gt;") and this is my subscriptions controller create action: def create @subscription = current_user.subscriptions.create(:group_id =&gt; params[:group_id]) @subscription.save respond_to do |format| format.html { redirect_to groups_path, flash[:success] = "You have successfully subscribed to this group" } format.js end end However now I get this error: ActionView::Template::Error (undefined local variable or method `group' for #&lt;#&lt;Class:0x007fe7ecfd4950&gt;:0x007fe7ecfde7e8&gt;): 1: $("#new_subscription").html("&lt;%= escape_javascript(render('subscriptions/unsubscribe', locals: { group: group } )) %&gt;") app/views/subscriptions/create.js.erb:1:in `_app_views_subscriptions_create_js_erb__3184685282411376061_70317032458920' app/controllers/subscriptions_controller.rb:8:in `create' The group local variable is not being passed from the form_for to the create.js.erb on submit. I have tried everything in the past 4 hours but am still coming up short. How do I fix this issue and pass the local variable from the _subscribe.html.erb partial to the create.js.erb file? Edit: More code... first my subscriptions controller create action: def create @group = Group.find(params[:group_id]) @subscription = current_user.subscriptio…
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/26938245
has title: Rails 4: Passing a local variable to a js.erb file from a partial containing a form_for helper
type: AnsweredQuestion
tagged with: ruby-on-rails
accepted answer: http://stackoverflow.com/a/26938245
type: Question
score: 5
has answer: http://stackoverflow.com/a/27026135
upvote count: 5

http://stackoverflow.com/a/26952404
has comment: http://stackoverflow.com/comment/42445407
answers question: http://stackoverflow.com/q/26952379
type: Answer
has comment: http://stackoverflow.com/comment/42445418
has body: If you only need to get the images on the page at any given time, you could use document.images to get the current images on the page, and then map over them to get the urls: Array.prototype.map.call(document.images, function (image) { return image.src; });
upvote count: 2
downvote count: 1
has comment: http://stackoverflow.com/comment/42445455
score: 1
has comment: http://stackoverflow.com/comment/42445471
has comment: http://stackoverflow.com/comment/42445463
has comment: http://stackoverflow.com/comment/42445434

http://stackoverflow.com/comment/42478959
type: AnswerComment
type: Comment
has text: updated my answer with a link to another answer with a bunch of info you may find useful
comment on: http://stackoverflow.com/a/26970748
score: 0

http://stackoverflow.com/q/26881914
type: UnansweredQuestion
has title: How to use variable sent from modelmap in js render iteration loop
tagged with: spring
tagged with: java
linked to: http://stackoverflow.com/q/12235319
has answer: http://stackoverflow.com/a/26919314
type: Question
has comment: http://stackoverflow.com/comment/42320819
tagged with: javascript
has comment: http://stackoverflow.com/comment/42319709
has body: I am sending a variable in a modelmap from java controller to a view like this : @RequestMapping(value = "/someAction", method = RequestMethod.GET) public String search(ModelMap model) { model.addAttribute("myVariable",true); return "myView"; //returns the view } Now i have this view file "myView.html" where i've used jsrender and that has a data and i iterate it like given below.Also i need to use the "myVariable" inside that iteration like this : &lt;script id="iterData" type="text/x-jsrender"&gt; {^{for #data}} {{if Name != '-'}} {{if Age =='20'}} {{if myVariable??}} //This part doesnt work.I wonder how to use it here //Some codes {{/if}} {{/if}} {{/if}} {{/for}} &lt;/script&gt; Can anyone help me how i could use the "myvariable" inside the jsrender iteration??
score: 0
answer count: 1
tagged with: web
tagged with: jsrender
has comment: http://stackoverflow.com/comment/42346753

cookies
tags question: http://stackoverflow.com/q/26905273
tags question: http://stackoverflow.com/q/26952643
tags question: http://stackoverflow.com/q/26878932
tags question: http://stackoverflow.com/q/26839991
tags question: http://stackoverflow.com/q/26911219
tags question: http://stackoverflow.com/q/26926951
tags question: http://stackoverflow.com/q/26881418
tags question: http://stackoverflow.com/q/26973852
tags question: http://stackoverflow.com/q/26867161
tags question: http://stackoverflow.com/q/26921756
type: Tag
tags question: http://stackoverflow.com/q/26950555
tags question: http://stackoverflow.com/q/26966317
tags question: http://stackoverflow.com/q/26973625
tags question: http://stackoverflow.com/q/26938223
tags question: http://stackoverflow.com/q/26900144
tags question: http://stackoverflow.com/q/26984685
tags question: http://stackoverflow.com/q/26846670
tags question: http://stackoverflow.com/q/26982532
tag name: cookies
tags question: http://stackoverflow.com/q/26877159
tags question: http://stackoverflow.com/q/26955068
tags question: http://stackoverflow.com/q/26909326
tags question: http://stackoverflow.com/q/26924076
tags question: http://stackoverflow.com/q/26929948
tags question: http://stackoverflow.com/q/26987815

http://stackoverflow.com/comment/42298247
comment on: http://stackoverflow.com/q/26869617
score: 0
has text: When the first block of code runs, it will set `obj.specialType` to the _value_ of `$specialType` at that time. It doesn't link the property to the variable. When the value of `$specialType` changes during the `click` handler, it won't automatically update your object as well, it has no reference to it.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42487181
comment on: http://stackoverflow.com/q/26975915
score: 0
type: Comment
type: QuestionComment
has text: Where is "target", do you mean e.target ?

http://stackoverflow.com/q/26840926
has comment: http://stackoverflow.com/comment/42246154
possible better answer: http://stackoverflow.com/a/26840975
has body: is part of an example of slideshow I could not understand this part. Who can explain me in detail: currentPosition = ($(this).attr('id')=='rightNav') ? currentPosition+1 : currentPosition-1; how they would be able to write?(just to understand) currentPosition = ($(this).attr('id')=='rightNav') ? currentPosition+1 : currentPosition-1;
has answer: http://stackoverflow.com/a/26840975
has title: Who can explain what means "? currentPosition+1 : currentPosition-1;"
has answer: http://stackoverflow.com/a/26840996
downvote count: 1
linked to: http://stackoverflow.com/q/6259982
has comment: http://stackoverflow.com/comment/42246116
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26840996
duplicate of: http://stackoverflow.com/q/6259982
score: -1
type: Question
has comment: http://stackoverflow.com/comment/42246275
answer count: 2
upvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42246257
favorite count: 0

http://stackoverflow.com/comment/42474700
type: Comment
comment on: http://stackoverflow.com/a/26940569
has text: Could you give me a demo link or a small code snippet? Or is this just about having two sliders in the html container and setting them to hidden / not hidden? And is this feature limited to 2 sliders?
type: AnswerComment
score: 0

http://stackoverflow.com/a/26940931
upvote count: 2
has comment: http://stackoverflow.com/comment/42444713
has comment: http://stackoverflow.com/comment/42426163
has comment: http://stackoverflow.com/comment/42456614
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42426257
type: Answer
has comment: http://stackoverflow.com/comment/42426216
has comment: http://stackoverflow.com/comment/42449491
has body: It creates nested lists using nested objects. In one level nesting, it creates a single level simple ul li, li ... list. But if some value is non-empty object like this var arg = { "one":{}, "two":{}, "three":{"subone":{}, "subtwo":{}}, "four":{}}; then the subobject is appended as the sublist in the recursion var childrenUl = createTreeDom(obj[key]); if (childrenUl) li.appendChild(childrenUl); If the value is not empty object, no sublist is created, since there is a stop condition as the first command: if (isObjectEmpty(obj)) return; Step by step for the array above: for the first item, the function creates ul element and adds li into it, with the key="one" and obj[key]={}: one But it is not done yet, now the recursion is called: createTreeDom({}). Since isObjectEmpty({}) (obviously) returns true, the recursion ends and childrenUl is undefined. Therefore, no contents is added to li and the cycle jumps to the second node, which is also just a simple string literal, so it adds another li node: one two Now the point: the third argument. Before the execution goes to the recursion, it looks like this: one two three But the value of the third member is not an empty object, so the command if (childrenUl) li.appendChild(childrenUl); creates an ul node filled with its contents step by step like above and appends it to the li element: one two three subone subtwo If some of the nested item contained another non-empty object, it would be appended as sub-sub list to some sub-list li and so on. There could be better to read equivalent: function createTreeDom(obj) { var ul = document.createElement('ul'); for (var key in obj) { var li = document.createElement('li'); li.innerHTML = key; if (!isObjectEmpty(obj[key])) { var childrenUl = createTreeDom(obj[key]); li.appendChild(childrenUl); } ul.appendChild(li); } return ul; }
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/42426051
has comment: http://stackoverflow.com/comment/42426372
has comment: http://stackoverflow.com/comment/42425818
answers question: http://stackoverflow.com/q/26940845
has comment: http://stackoverflow.com/comment/42451277
accepted answer of: http://stackoverflow.com/q/26940845
has comment: http://stackoverflow.com/comment/42458688
has comment: http://stackoverflow.com/comment/42443325
has comment: http://stackoverflow.com/comment/42425801

http://stackoverflow.com/q/26847342
tagged with: paypal
has answer: http://stackoverflow.com/a/31626288
type: Question
has body: I have this code: &lt;script&gt; /* Set rates + misc */ var taxRate = 0.08; var shippingRate = 0.00; var fadeTime = 300; /* Assign actions */ $('.product-quantity input').change( function() { updateQuantity(this); }); $('.product-removal button').click( function() { removeItem(this); }); /* Recalculate cart */ function recalculateCart() { var subtotal = 0; /* Sum up row totals */ $('.product').each(function () { subtotal += parseFloat($(this).children('.product-line-price').text()); }); /* Calculate totals */ var tax = subtotal * taxRate; var shipping = (subtotal &gt; 0 ? shippingRate : 0); var total = subtotal + tax + shipping; /* Update totals display */ $('.totals-value').fadeOut(fadeTime, function() { $('#cart-subtotal').html(subtotal.toFixed(2)); $('#cart-tax').html(tax.toFixed(2)); $('#cart-shipping').html(shipping.toFixed(2)); $('#cart-total').html(total.toFixed(2)); if(total == 0){ $('.checkout').fadeOut(fadeTime); }else{ $('.checkout').fadeIn(fadeTime); } $('.totals-value').fadeIn(fadeTime); }); } /* Update quantity */ function updateQuantity(quantityInput) { /* Calculate line price */ var productRow = $(quantityInput).parent().parent(); var price = parseFloat(productRow.children('.product-price').text()); var quantity = $(quantityInput).val(); var linePrice = price * quantity; /* Update line price display and recalc cart totals */ productRow.children('.product-line-price').each(function () { $(this).fadeOut(fadeTime, function() { $(this).text(linePrice.toFixed(2)); recalculateCart(); $(this).fadeIn(fadeTime); }); }); } /* Remove item from cart */ function removeItem(removeButton) { /* Remove row from DOM and recalc cart total */ var productRow = $(removeButton).parent().parent(); productRow.slideUp(fadeTime, function() { productRow.remove(); recalculateCart(); }); } //@ sourceURL=pen.js &lt;/script&gt; The full demo can watch here: http://codepen.io/justinklemm/pen/zAdoJ ¿As I can pay by paypal with jquery checkout button? Example. Pay Total: $ 90.57 with …
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has title: Paypal button and checkout with jquery
type: UnansweredQuestion
score: 0

http://stackoverflow.com/a/26982391
has comment: http://stackoverflow.com/comment/42499754
has comment: http://stackoverflow.com/comment/42996879
answers question: http://stackoverflow.com/q/26982083
score: 0
has body: If you need the values passed through a browser address bar, you need to form the link this way: $url = "team=".$name1.",".$name2; Then in the main PHP code you may explode it into array chunks: $urlArray = explode(",", $url);
type: Answer

http://stackoverflow.com/q/26836938
has comment: http://stackoverflow.com/comment/42239591
has answer: http://stackoverflow.com/a/26836964
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/4933236
type: Question
tagged with: javascript
tagged with: jquery
has title: Get next and only class on click in the DOM
has body: I am trying to get the next class to show up when clicking on a more-infos span. Total Current Liabilities click Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laborum eligendi hic minus dicta atque molestiae, qui suscipit Total Current Assets click Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laborum eligendi hic minus dicta atque molestiae, qui suscipit Ideally, when you click on a more-infos link it will show up the more-infos-container that is the closest to itself. How is that achievable ? I tried using next and find and closest but it doesn't work. Thank you .
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/26836964

http://stackoverflow.com/comment/42345080
type: QuestionComment
comment on: http://stackoverflow.com/q/26895834
has text: you should probably save the return from $('#example').dataTable(); it contains methods you can use to, for example, redraw the table when you update the underlying data.
type: Comment
score: 0

http://stackoverflow.com/a/26949284
score: 0
has body: My guess is you should probably change it to class="autocomplete", id shouldn't have duplicate, so document.getElementById('autocomplete') will always return first element it finds. Never worked with google-maps tho, but I think this can be the reason
type: Answer
answers question: http://stackoverflow.com/q/26949103
has comment: http://stackoverflow.com/comment/42440901
has comment: http://stackoverflow.com/comment/42440241

http://stackoverflow.com/a/26878258
score: 1
answers question: http://stackoverflow.com/q/26877650
upvote count: 1
has comment: http://stackoverflow.com/comment/42354235
has body: An elobrative explanation that I found here and would like to share it. The different ways in which a function can be defined in javascript are: function A(){}; // function declaration var B = function(){}; // function expression var C = (function(){}); // function expression with grouping operators var D = function foo(){}; // named function expression var E = (function(){ // immediately-invoked function expression (IIFE) that returns a function return function(){} })(); var F = new Function(); // Function constructor var G = new function(){}; // special case: object constructor What exactly is hoisting? The interesting thing about these is that they are “hoisted” to the top of their scope, which means this code: A(); function A(){ console.log('foo'); }; Gets executed as this code: function A(){ console.log('foo'); }; A(); Which practically means that, yes, you can call the functions before they’re written in your code. It won’t matter, because the entire function gets hoisted to the top of its containing scope. Variable declaration hoisting Variable declarations are hoisted to the top of their scope, somewhat similarly to function hoisting except the contents of the variable are not hoisted as well. This happens with all variables, and it means it’s now happening with our functions, now that we’re assigning them to variables. This code: var A = function(){}; var B = function(){}; var C = function(){}; Will be executed as this: var A, B, C; // variable declarations are hoisted A = function(){}; B = function(){}; C = function(){}; Therefore the order of setting and calling this type of function is important: // this works var B = function(){}; B(); // this doesn't work B2(); // TypeError (B2 is undefined) var B2 = function(){}; The second example gives us an error because only the variable B2’s declaration is hoisted, but not its definition, thus the “undefined” error. Courtesy: DavidBCalhoun
downvote count: 0
type: Answer

http://stackoverflow.com/a/26921144
answers question: http://stackoverflow.com/q/26921116
has body: Try like this: /^[0-4]\.\d{2}$/
upvote count: 5
type: Answer
downvote count: 0
score: 5

http://stackoverflow.com/comment/42488433
has text: oh, thanks so much i am looking for the Border blink icon with maker init ..i.e ... png file in online i have tried to load the image from online but it dint found any where..the link you provide me the same marker i am plotting default marker provided by the google maps...
comment on: http://stackoverflow.com/a/26971964
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/42417025
has text: Would I have to change the version each time I insert something new??
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26931233
type: Comment

http://stackoverflow.com/a/26938245
has body: You don't. Execution ends when the current request ends, i.e. when the form is rendered. The .js.erb view template is not called until the form is submitted, starting a new request. You'll have to create an instance variable e.g. @group = however_you_get_the_group in the controller's create action to make it visible to the .js.erb view, and reference as such: locals: { group: @group }
has comment: http://stackoverflow.com/comment/42655746
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42655728
has comment: http://stackoverflow.com/comment/42619171
answers question: http://stackoverflow.com/q/26938130
upvote count: 8
has comment: http://stackoverflow.com/comment/42426937
accepted answer of: http://stackoverflow.com/q/26938130
type: Answer
has comment: http://stackoverflow.com/comment/42439669
has comment: http://stackoverflow.com/comment/42675807
has comment: http://stackoverflow.com/comment/42658419
score: 8

http://stackoverflow.com/comment/42541422
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26855884
has text: Yes, this is one of the many cases where jshint is inaccurate. But how would it know that you gave it a webworker script?
score: 0

http://stackoverflow.com/q/26917973
score: 0
answer count: 1
has body: I made a trial Kendo mobile application a year ago. Now I want to check it with the up-to-date Kendo UI Core version. My previous references were &lt;link href="../styles/kendo.common.min.css" rel="stylesheet" /&gt; &lt;link href="../styles/kendo.default.min.css" rel="stylesheet" /&gt; &lt;link href="../styles/kendo.mobile.all.min.css" rel="stylesheet" /&gt; &lt;script src="../js/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="../js/kendo.all.min.js"&gt;&lt;/script&gt; &lt;script src="../js/kendo.mobile.min.js"&gt;&lt;/script&gt; I couldn't see the kendo.all.min.js file and kendo.mobile.min.js in the core-ui. I also couldn't see the kendo.mobile.all.min.css file. Which files should exist in my HTML to run my mobile application on kendu-ui-core?
has title: Which files should exist in Kendo Ui Core for a mobile application?
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/26939248
tagged with: kendo-mobile
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26939248

http://stackoverflow.com/q/26876441
has comment: http://stackoverflow.com/comment/42401704
downvote count: 0
favorite count: 0
has body: Problem Question - I am trying to build a directive for the datepicker. But somehow it is not showing the calender popup box. I have tried and looked into most of the post out there. I know it something simple but can't figure this out. Below is my directive angular.module('App').directive('myDatePicker',function(){ return{ restrict: 'AE', template:'&lt;input is-open="opened" type="text" datepicker-popup="d/m/yyyy" ng-model="Date" ng-required="true" /&gt;'+ '&lt;button type="button" ng-click="open()"&gt;&lt;/button&gt;', controller: function($scope){ $scope.open = function () { $scope.opened = true; console.log('I am working'); }; } }; }); HTML &lt;div my-date-picker&gt;&lt;/div&gt; Please guide me where I am making mistake.
has comment: http://stackoverflow.com/comment/42583146
linked to: http://stackoverflow.com/q/23474054
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42401122
has comment: http://stackoverflow.com/comment/42583627
answer count: 0
has comment: http://stackoverflow.com/comment/42584015
upvote count: 1
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/42584219
score: 1
tagged with: javascript
tagged with: angular-ui-bootstrap
has comment: http://stackoverflow.com/comment/42584027
has title: Date-picker directive Angularjs and angular-ui bootstrap

http://stackoverflow.com/comment/42316282
comment on: http://stackoverflow.com/a/26879786
type: AnswerComment
score: 0
type: Comment
has text: @Ryan also see the shorted jQuery version

http://stackoverflow.com/a/26921568
score: 12
has comment: http://stackoverflow.com/comment/42391284
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26921538
has comment: http://stackoverflow.com/comment/42391261
answers question: http://stackoverflow.com/q/26921538
has comment: http://stackoverflow.com/comment/42391229
has comment: http://stackoverflow.com/comment/42462561
type: Answer
has body: Probably the most concise way of getting an array of the values contained within an object is to use Object.keys and Array.prototype.map: obj = { a: 1, b: 2, c: 3 }; values = Object.keys(obj).map(function (key) { return obj[key]; }); Otherwise there's no standardized way of getting an array of an object's values. For iterating, ES6 introduces a for..of loop which will iterate through an object's values: continued from above: for (value of obj) { console.log(value); //1, 2, 3 } ES7 is slated to introduce array comprehensions, so generating the values array could be written as: continued from above: values = [for (x of Object.keys(obj)) obj[x]]; If you're already using underscore, you can use the _.values method: continued from above: _.values(obj); //[1, 2, 3] If you just want an efficient implementation for this utility function, the lodash source is: lodash.js v2.4.1 lines 2891-2914 /** * Creates an array composed of the own enumerable property values of `object`. * * @static * @memberOf _ * @category Objects * @param {Object} object The object to inspect. * @returns {Array} Returns an array of property values. * @example * * _.values({ 'one': 1, 'two': 2, 'three': 3 }); * // =&gt; [1, 2, 3] (property order is not guaranteed across environments) */ function values(object) { var index = -1, props = keys(object), length = props.length, result = Array(length); while (++index &lt; length) { result[index] = object[props[index]]; } return result; }
upvote count: 12
downvote count: 0
has comment: http://stackoverflow.com/comment/42391455

http://stackoverflow.com/q/26836146
answer count: 4
tagged with: geo
possible better answer: http://stackoverflow.com/a/42983430
score: 14
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42238165
has answer: http://stackoverflow.com/a/42983430
accepted answer: http://stackoverflow.com/a/26837460
has comment: http://stackoverflow.com/comment/42238225
has comment: http://stackoverflow.com/comment/42238207
downvote count: 1
has title: How to sort array items by longitude latitude distance in javascripts?
type: Question
upvote count: 15
has body: I am having following JSON array of 6 locations. Is there any way sort these based on longitude and latitude where nearby locations come next in the array? [ {"id" : 279, "longitude":79.853239,"latitude":6.912283}, {"id" : 284, "longitude":79.865699,"latitude":6.885697}, {"id" : 13, "longitude":79.851187,"latitude":6.912220}, {"id" : 282, "longitude":79.858904,"latitude":6.871041}, {"id" : 281, "longitude":79.853346,"latitude":6.899757}, {"id" : 16, "longitude":79.854786,"latitude":6.894039} ] Sorting can be started from first item and result should be something like this [ {"id" : 279, "longitute":79.853239,"latitude":6.912283}, {"id" : 13, "longitute":79.851187,"latitude":6.912220}, {"id" : 281, "longitute":79.853346,"latitude":6.899757}, {"id" : 16, "longitute":79.854786,"latitude":6.894039}, {"id" : 284, "longitute":79.865699,"latitude":6.885697}, {"id" : 282, "longitute":79.858904,"latitude":6.871041} ]
tagged with: arrays
tagged with: javascript
tagged with: sorting
has comment: http://stackoverflow.com/comment/42238102
tagged with: latitude-longitude
favorite count: 0
has answer: http://stackoverflow.com/a/72844704
has answer: http://stackoverflow.com/a/26837460
has answer: http://stackoverflow.com/a/71500573

http://stackoverflow.com/a/26876850
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/26876394
upvote count: 1
answers question: http://stackoverflow.com/q/26876394
has body: Since we need to clearify what is happening where lets step back back to the basics here: the Client requests GET /hamsters the Server creates and sends response. the Client receives response and parses page and runs any javascript on (or linked by) the document - and can request additional resources with AJAX. the Client POSTs /gethamsters with x, y coordinates via AJAX. the Server processes POST /gethamsters request and returns a response to client.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/27099718
has body: Since I didn't received an answer, I figured out a way myself. I'm publishing it, may be some one need it. I separated the loader in two types, a global and a particular witch accepts an element as parameter. and adding a class name "loading-icon", and some states for different types of inputs: app.service('Loader', function ($rootScope) { var _number = 0; this.reset = function () { }; this.gloabal = {}; this.gloabal.show = function () { }; this.gloabal.hide = function () { }; this.particular = {}; // target must be angular element or JS selected DOM element this.particular.show = function (target) { angular.element(target).addClass('loading'); }; this.particular.hide = function (target) { angular.element(target).removeClass('loading'); }; }); styles : .loading-icon:after { content: ''; display: inline-block; min-width: 20px; height: 20px; background: ('spinner.gif') no-repeat 0 0; } calling: var button = docuemnt.getElementById('submit-button'); Loader.particular.show(button); or Loader.global.show();
type: Answer
has comment: http://stackoverflow.com/comment/42703872
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26971826
score: 0
answers question: http://stackoverflow.com/q/26971826

http://stackoverflow.com/comment/42469259
type: AnswerComment
comment on: http://stackoverflow.com/a/26956040
score: 0
type: Comment
has text: I am getting path from the server. Since "\" is a escape character, i am not able to replace "\" with "\\".

http://stackoverflow.com/q/26861024
type: AnsweredQuestion
score: 3
upvote count: 3
has answer: http://stackoverflow.com/a/26861221
has comment: http://stackoverflow.com/comment/42282962
type: Question
linked to: http://stackoverflow.com/q/111102
tagged with: javascript
has comment: http://stackoverflow.com/comment/42282751
linked to: http://stackoverflow.com/q/3127429
answer count: 1
downvote count: 0
favorite count: 0
has title: Javascript new keyword in subfunctions
accepted answer: http://stackoverflow.com/a/26861221
has body: I´m trying to sort out how 'new' keyword is working in Javascript. But it is has a strange behaviour. When I run this code in node: var testing = function() { self = this; this.abc = 'abc'; console.log(this); // ====&gt; 1 var subMethod = function () { console.log(this); // =====&gt; 2 console.log(self === this); // ====&gt; 3 }; //subMethod.apply(this); subMethod(); }; test = new testing(); // test = testing(); // ===&gt; *4 The console.log(self === this) gives me false. 'this' in nr 1 is { abc: 'abc' }, and 'this' in the sub method is the global 'this' object. Can anyone give me an explanation for this behaviour? If I run with subMethod.apply(this) then console.log(self === this) is true ({ abc: 'abc' }) When I run without the new keyword (*4) the 'this' variable is the same as the global 'this' (as expected), and also the console.log(self === this) is true. Why is 'this' in the submethod the same as the global 'this' when running with the 'new' keyword.

http://stackoverflow.com/a/26920765
downvote count: 0
has comment: http://stackoverflow.com/comment/42389931
has comment: http://stackoverflow.com/comment/42390233
answers question: http://stackoverflow.com/q/26920682
upvote count: 2
accepted answer of: http://stackoverflow.com/q/26920682
type: AcceptedAnswer
has body: Make your function receive an argument, which you will use as the prompt message. When the user fails, call your function again, but with another message. And voilà - Recursion :)
type: Answer
score: 2

http://stackoverflow.com/comment/42346627
type: Comment
has text: Oh yes, I'll fix that. Thanks!
type: AnswerComment
comment on: http://stackoverflow.com/a/26896521
score: 0

http://stackoverflow.com/comment/42412231
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26933332
has text: Is was something in the trim funtion causing the error [$.trim(range.toString());] as alerting range.toString() always returned the correct word. But the p.text() fix looks like it has sorted it!

http://stackoverflow.com/a/26996519
answers question: http://stackoverflow.com/q/26991305
has body: Learned Magicprog.fr, augustoccesar and Edan Feiles's suggestions, and decided Magicprog.fr's solution is best, because it first loads now_playing.php output, then just updates it at given interval: &lt;script&gt; function loadNowPlaying(){ $("#now_playing").load("now_playing.php"); } setInterval(function(){loadNowPlaying()}, 5000); &lt;/script&gt; Thank you very much for help :)
score: 0
type: Answer

http://stackoverflow.com/a/26903928
accepted answer of: http://stackoverflow.com/q/26903675
type: Answer
score: 2
downvote count: 0
has body: TagIt library doesn't seem to provide an API for getting the list of tags. However, you can read the HTML and see if tags are there. On form submit, count the tags and return false if data is not valid. Use .tagit("assignedTags") to get the list of tags: var $tags = $("#myTags"); $tags.tagit({ fieldName: "tags[]" }); $("form").on("submit", function () { if (!$tags.tagit("assignedTags").length) { alert("Tags are mandatory"); return false; } alert("Valid data"); }); JSFIDDLE
upvote count: 2
has comment: http://stackoverflow.com/comment/42359342
answers question: http://stackoverflow.com/q/26903675
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42359313

http://stackoverflow.com/q/26916818
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/26917228
tagged with: css
tagged with: http://stackoverflow.com/tag/svg
has body: A few months ago I found CSS / SVG(?) generator for backgrounds like this one: http://demo.qodeinteractive.com/bridge11/wp-content/uploads/2014/06/slide-01.jpg Has anyone ready-made solution for this?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26917228
type: Question
has title: Generate gradient css / svg backgrounds
answer count: 1

http://stackoverflow.com/q/26871008
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42300538
has answer: http://stackoverflow.com/a/26872092
tagged with: regex
tagged with: css
has comment: http://stackoverflow.com/comment/42300701
has answer: http://stackoverflow.com/a/26871163
has body: I have a simple text field which I need to validate with a regex. The text field is supposed to contain inline-styles in the "proper" format xxx: xxx; Ex: font-size: 15px; background: #33333; -webkit-transition: background-color 500ms ease-out 1s; Any regex gurus out there help me out here. I'll eventually find the solution on my own but that may take awhile. Languages would be javascript for client side validation then moving onto php for the server side validation. Thanks a bunch guys... I came up with this -- /([a-z-]+: [0-9a-z#(). -]+;$)/g --. I would answer myself but I'm unsure if its the best solution. Gonna accept the most detailed answer below from @nu11p01n73R as I stole the $ sign from his explanation that made the above work right. Now is there an issue with what I came up with? Know I'm not technically supposed to ask but I think its easier to read for me to read, anyways. I love SO.
has comment: http://stackoverflow.com/comment/42300579
favorite count: 0
upvote count: 2
possible better answer: http://stackoverflow.com/a/26872092
answer count: 2
tagged with: php
downvote count: 1
accepted answer: http://stackoverflow.com/a/26871163
tagged with: javascript
score: 1
has title: Validate a text input field for inline styles using regex?

http://stackoverflow.com/q/26834114
accepted answer: http://stackoverflow.com/a/26852786
has title: d3.js - using slider to dynamically change graph
tagged with: d3.js
tagged with: data-visualization
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: graph
has answer: http://stackoverflow.com/a/26852786
downvote count: 0
tagged with: javascript
has body: I have a graph where each edge has a numerical value between 0 and 1. I want to add a slider to the webpage so that as the slider value varies between 0 and 1, only edges with a larger value than the slider are drawn. Is there some sort of canonical way to do this? I am pretty new to d3 and have looked at the basic force graph code, but unsure where to proceed from there.
answer count: 1
favorite count: 0

http://stackoverflow.com/q/26990384
has answer: http://stackoverflow.com/a/26992030
has comment: http://stackoverflow.com/comment/42512382
answer count: 1
downvote count: 0
favorite count: 0
has body: I already searched a lot but cannot figure out how to handle my issue. I created a custom component and the template is within a Tag. Outside of this template I have a variable which I try to manipulate after doing something. This doesn't work, it's not defined. Is there any possibility to manipulate that observable? My code looks like this: HTML: Foobar JS: var customComponentViewModel = function() { this.foo = ko.observable(); this.bar = ko.observable(); this.foobar = ko.observable(); this.foo('Foo!'); this.bar('Bar!'); this.foobar('Foo! Bar!'); console.log(this.foo()); console.log(this.bar()); console.log(this.foobar()); }; // do another stuff... /** * Register KO component */ ko.components.register('customcomponent', { viewModel: customComponentViewModel, template: { element: 'customcomponent-tpl' } }); ko.applyBindings(); Many thanks in advance! Matthias
tagged with: knockout-2.0
has comment: http://stackoverflow.com/comment/42512460
has comment: http://stackoverflow.com/comment/42512798
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42512850
upvote count: 3
tagged with: knockout.js
type: Question
score: 3
accepted answer: http://stackoverflow.com/a/26992030
has title: KnockoutJS: Access to observable Variable outside of an custom component
tagged with: javascript
has comment: http://stackoverflow.com/comment/42513363
has comment: http://stackoverflow.com/comment/42513093

http://stackoverflow.com/a/26838107
answers question: http://stackoverflow.com/q/26838003
has body: This occurs due to the principles of recursion. This code will never terminate because before the method has a chance to exit, the method is called again. function method() { method(); } This is very similar to code you provided.
upvote count: 1
downvote count: 0
score: 1
type: Answer

http://stackoverflow.com/a/26960935
type: Answer
accepted answer of: http://stackoverflow.com/q/26960773
upvote count: 4
has comment: http://stackoverflow.com/comment/42463290
score: 3
has comment: http://stackoverflow.com/comment/42462479
has comment: http://stackoverflow.com/comment/42463543
type: AcceptedAnswer
downvote count: 1
answers question: http://stackoverflow.com/q/26960773
has body: You can do that easily with a YQL rest call. See examples here: https://developer.yahoo.com/yql/guide/yql-select-xpath.html Basically you only need to do some AJAX call to Yahoo's YQL server and it will return a response and inside it you will find the HTML of the page you queried. Playground link - as you can see the REST query is at the bottom of the page. update - google "scraping webpages using phantomjs", you'll get exactly what you need to scrap and parse pages and get the final result.
has comment: http://stackoverflow.com/comment/42462587

http://stackoverflow.com/comment/42289706
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26865114
has text: _"because it cannot fail"_ - Except that it'll give an error if the `count` element doesn't exist.
score: 0

http://stackoverflow.com/q/26952442
score: 0
has answer: http://stackoverflow.com/a/26952962
type: UnansweredQuestion
tagged with: animation
has title: How to reset a jquery animation and start over
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26952521
has body: I'm making a simple javascript game where you click the ball, it goes up, and you have to click it again before it touches the ground. How do I make it so that you click the ball on the way down and it stop the last request and begin moving back up again?

http://stackoverflow.com/a/26866507
downvote count: 0
answers question: http://stackoverflow.com/q/26866468
upvote count: 3
type: Answer
has body: You can use parseInt function: var pprice = parseInt(document.getElementById('pur_price').value, , 10); var rate1 = parseInt(document.getElementById('select2').value, , 10);
score: 3

http://stackoverflow.com/comment/42255605
has text: @MikeLegacy thanks dude, i did like ``way_is_open = true;`` so it is REALLY global and reset in every success scope.
type: Comment
comment on: http://stackoverflow.com/a/26846174
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42425145
comment on: http://stackoverflow.com/q/26940118
type: QuestionComment
has text: The filtering and action directive are under one controller and the view is under a different controller.
score: 0
type: Comment

http://stackoverflow.com/q/26991714
type: UnansweredQuestion
tagged with: android
has title: How to maintain session in javascript while using webview in phonegap?
type: Question
tagged with: javascript
score: 0
has body: Local storage is not working? When using cookies alert always shown empty alert. please help?
answer count: 1
has answer: http://stackoverflow.com/a/26993814
tagged with: cordova

http://stackoverflow.com/comment/42284412
has text: The problem you approach is that you have an object {} and inside this object you have an element which holds an array of objects (but im not quite sure because you truncated your output)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26862049
type: Comment

http://stackoverflow.com/a/27147628
answers question: http://stackoverflow.com/q/26990192
has comment: http://stackoverflow.com/comment/42832115
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/42822905
type: Answer
has body: You are supposed to encode/decode JSON to prevent shallow copy. To know more what about deepcopy and shallowcopy, here is link. What is the difference between a deep copy and a shallow copy? As var root = JSON.parse(JSON.stringify(root)); is a wrong way to prevent shallow copy, you can use jquery's clone method or simply javascripts slice method to deepcopy javascript array. for example. var d=[1,2,3,4,5,6];//create array var b=d;//copy array into another array (shallow copy/reference copy) var e=d.slice();//clone array in another variable (deep copy) d[0]=9; //change array element console.log(d)// result : [9,2,3,4,5,6] (changed array) console.log(b)// result : [9,2,3,4,5,6] (changed array due to reference) console.log(e)// result : [1,2,3,4,5,6] (unchanged array due to deep copy) There is another solution is use underscore. If you don't want full javascript code of underscore, then you can pick cloning portion in underscore library. In underscore, you can clone object array using: var a = [{f: 1}, {f:5}, {f:10}]; var b = _.map(a, _.clone); // &lt;---- b[1].f = 55; console.log(JSON.stringify(a)); It will Print [{"f":1},{"f":5},{"f":10}]
downvote count: 0

http://stackoverflow.com/q/26932201
has title: Setting array values across row in Google Sheets
has body: I have an array pulled from a Google Sheet column using the following code. How can I distribute these values across a row inside of a different sheet? Essentially, I would like the value at decisionPoint[1] to populate cell 'B2', decisionPoint[2] to populate cell 'C2', decisionPoint[3] to populate cell 'D2', and so on. Thanks in advance for any help! var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); // get the spreadsheet object var decisionPointSheet = spreadsheet.getSheets()[2]; // set decision point sheet var lastDecisionPoint = decisionPointSheet.getDataRange().getLastRow(); var decisionPoints = decisionPointSheet.getDataRange().getValues(); for ( var i = 1; i &lt; lastDecisionPoint; i++){ Logger.log(decisionPoints[i][0]); }
has comment: http://stackoverflow.com/comment/42410260
has answer: http://stackoverflow.com/a/26933320
tagged with: google-apps-script
score: 0
tagged with: google-sheets
tagged with: arrays
accepted answer: http://stackoverflow.com/a/26933320
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/42410187
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/26986671
score: 0
accepted answer: http://stackoverflow.com/a/26986770
type: Question
has comment: http://stackoverflow.com/comment/42506372
has body: I want to access XML elements in the following document. There about 935 items AircraftReport. I know how to display all of them by using .find() and .each() but I am having trouble getting only the first 10 AircraftReports. 50.5 -51.8 55.9167 -43.1 .... I am assuming I have to write that in a for loop. How can this be done with jQuery?
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42506391
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: http://stackoverflow.com/tag/xml
has answer: http://stackoverflow.com/a/26986770
has title: Parsing XML using Javascript
type: AnsweredQuestion

http://stackoverflow.com/comment/42445440
type: QuestionComment
has text: You know what `var A = 'A'| 'a';` does?
type: Comment
score: 2
comment on: http://stackoverflow.com/q/26952397

http://stackoverflow.com/a/26926595
downvote count: 0
answers question: http://stackoverflow.com/q/26925922
has body: $(function() { var both = $('#t1, #t2'), run = function() {return window.setInterval(function() { both.not('.current').trigger('mouseover', 1); }, 1000);}, play = run(); both.mouseout(function() {play = run();}); both.eq(0).mouseover(function(ev, data) { if (!data) window.clearInterval(play); both.eq(1).removeClass("current"); $(this).addClass("current"); $("#newTrend").fadeOut(function() { $("#newContent").fadeIn(); }); }); both.eq(1).mouseover(function(ev, data) { if (!data) window.clearInterval(play); both.eq(0).removeClass("current"); $(this).addClass("current"); $("#newContent").fadeOut(function() { $("#newTrend").fadeIn(); }); }); }); A working DEMO HERE. The autoplay stops when you hover over a tab and starts again when the mouse goes out.
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/a/26932974
accepted answer of: http://stackoverflow.com/q/26932862
upvote count: 1
answers question: http://stackoverflow.com/q/26932862
score: 1
has body: getElementsByName returns a NodeList. It's an object containing the list of matching nodes, so b is not null. However, you're running the script before the DOM is ready, so the list is of length 0 with no first object. You need to delay the script execution until after the DOM's been parsed, at which point the form will exist.
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/a/26985473
upvote count: 1
answers question: http://stackoverflow.com/q/26985431
accepted answer of: http://stackoverflow.com/q/26985431
score: 1
type: AcceptedAnswer
downvote count: 0
has body: var spanInfo = $(this).closest("item-input").next().find('span.info'); Should be var spanInfo = $(this).closest(".item-input").next().find('span.info'); You are missing the . (dot, class)
has comment: http://stackoverflow.com/comment/42505632
type: Answer

linux-mint
type: Tag
tag name: linux-mint
tags question: http://stackoverflow.com/q/26937106

http://stackoverflow.com/comment/42245762
comment on: http://stackoverflow.com/a/26833113
type: Comment
has text: just put the missing ' -- this was not the problem however
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42331671
type: QuestionComment
has text: @epascarello http://stackoverflow.com/questions/18885676/open-new-tab-without-popup-blocker-after-ajax-call-on-user-click
comment on: http://stackoverflow.com/q/26888680
score: 0
type: Comment

http://stackoverflow.com/q/26896873
tagged with: javascript
has title: Plupload: Select files button doesn't work when it is inside a Bootstrap modal
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27004314
has comment: http://stackoverflow.com/comment/42387672
has comment: http://stackoverflow.com/comment/42426028
favorite count: 0
has comment: http://stackoverflow.com/comment/42426115
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/42394481
score: 6
upvote count: 6
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27004314
tagged with: plupload
type: Question
has comment: http://stackoverflow.com/comment/42425947
has comment: http://stackoverflow.com/comment/42387034
has body: The Plupload 'Select files' button doesn't work when it's inside a Bootstrap modal. The problem The problem seems to exist on Apple devices only such as the iPad and iPhone. I've tested on a Samsung Galaxy S4 Mini running Android 4.2.2 and on a Nexus 7 tablet running Android 4.4.2 and both of those devices work. Demo Here's a demo to illustrate the problem (note you'll need to view on a iPad or iPhone in order to see the problem): JSFIDDLE Notes Interestingly, if I move the following mark-up outside of the .modal element so that the 'Select files' button is visible on the initial page load, then the problem goes away. &lt;div id="container"&gt; &lt;a id="pickfiles" href="javascript:;"&gt;[Select files]&lt;/a&gt; &lt;a id="uploadfiles" href="javascript:;"&gt;[Upload files]&lt;/a&gt; &lt;/div&gt; My question How can I get the 'Select files' button working inside the modal for iPhone and iPad?
answer count: 1
downvote count: 0

http://stackoverflow.com/q/26867956
upvote count: 2
has title: Why this keyword is not referring to window in a stand alone JS function
downvote count: 1
has answer: http://stackoverflow.com/a/26868106
favorite count: 0
has body: I was just trying scoping and this keyword in JS, While writing the below code i really got confused as i was expecting console.log(a) after calling f() to be 5, but instead it gave me 10. My question is : Isn't the this keyword in a standalone function refers to window ? If yes, then isn't the code inside the function is the same as window.a = 5 and the value of a should be updated to 5? If no, why console.log(this) results in window, but value of a (which is global) isn't updated ? JS Fiddle var a = 10; function f(){ this.a = 5; console.log(a); } console.log(a); f(); console.log(a);
type: UnansweredQuestion
answer count: 4
has answer: http://stackoverflow.com/a/26868004
has answer: http://stackoverflow.com/a/26868021
score: 1
type: Question
tagged with: jsfiddle
has answer: http://stackoverflow.com/a/26868082
tagged with: javascript
has comment: http://stackoverflow.com/comment/42295163

http://stackoverflow.com/q/26914652
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26916885
tagged with: regex
tagged with: string
favorite count: 0
possible better answer: http://stackoverflow.com/a/26914794
upvote count: 2
has answer: http://stackoverflow.com/a/26914794
answer count: 2
has comment: http://stackoverflow.com/comment/42378373
has body: So I'm writing my own napkin math parser[1] for fun. Napkin math is a part of a custom text editor I am building - when you press space after an equals sign it will detect the equation prior to the equals sign and does the math for you. E.g., you type 1+1= and it kicks out the 2 for you magically so you have 1+1=2 on the screen. I'm really struggling with getting a regex to match equations prior to the equals sign. My brain is shot and I am in desparate need of help from a lord of regex. Below are my test strings, with the highlighted sections being what I want the regex to match. Particularly, I'm having trouble getting the regex to match the true start of an equation. My current regex gets thrown off if there are numbers or words before the equation starts. I feel like I need to somehow work backwards from the equals sign. I started reversing my string characters around and that's when I threw my hands up and came to you for help. My test strings with desired matches (the true equation part of the string): test text (1) pi= test text (1 pi= test text 1) pi= test text (2) pi + 10 / 20= test text (3) test pi ^ 10 / 20= test text (30) 10 + 5= test text (500) abs(10 + 5)= test text (1) pi + 10 / 20= test text 10*5= test text pi / phi= test text 10 mod phi= test text 50 10 mod phi= test text pi mod abs(phi)= apple banana cherry apple 10 apple cherry banana hi 10 99+1= Here are all of my special key words allowed and useful in napkin math: var napkinMathKeyWords = [ 'pi', '\\u03C0', '\\u03A0', 'phi', '\\u03C6', '\\u03A6', 'abs', 'acos', 'cos', 'atan', 'tan', 'asin', 'sin', 'ceil', 'floor', 'sqrt', 'log', 'ln', 'mod', ]; EDIT Here's the regex I've got so far: (\d|pi|\\u03C0|\\u03A0|phi|\\u03C6|\\u03A6|abs|acos|cos|atan|tan|asin|sin|ceil|floor|sqrt|log|ln|mod).*?= It's hitting most of my cases, there are just a couple of cases throwing it off: https://i.sstatic.net/ng04T.png [1] http://blogs.msdn.com/b/onenotetips/archive/2008/05/09/napkin-math-in-onenote.aspx
has answer: http://stackoverflow.com/a/26916885
has title: Logic on a Complicated Regex on My Napkin Math Parser
tagged with: regex-lookarounds
downvote count: 0
has comment: http://stackoverflow.com/comment/42380148
tagged with: javascript
type: Question

http://stackoverflow.com/comment/42407382
type: Comment
comment on: http://stackoverflow.com/a/26929856
has text: Thank you for this detailed response. Really appreciate it! I like your first approach, but the instances of `Chapter` aren't created individually. They're created in a loop whenever another Chapter gets called. Imagine this framework will get used by devs to create a virtual book. Ergo: I need a way to let other devs "hook into" `Chapter` with custom functionality, which I try to provide a way for here. So I can't declare a custom function after creating an instance of `Chapter` - as I don't know what instances there'll be.
score: 0
type: AnswerComment

http://stackoverflow.com/a/26922703
answers question: http://stackoverflow.com/q/26922657
has comment: http://stackoverflow.com/comment/42393389
has comment: http://stackoverflow.com/comment/42393112
type: Answer
has body: Try using preg_match preg_match ($pattern, $DOMelement, $matches); Pattern to look for floats/coordinates. '/\d+(\.\d+)?/' So basically like this // Simulation of your DOM element $DOMelement = array("LoadMarker(parseFloat(45.5364416896354),parseFloat(-122.959525248125)"); preg_match_all('/\d+(\.\d+)?/', $DOMelement[0], $matches); returns [0] =&gt; Array ( [0] =&gt; 45.5364416896354 [1] =&gt; 122.959525248125 ) Example here... http://sandbox.onlinephpfunctions.com/code/d026735963c62fc532d3d6442dfdebc14ca580b1 Although it will also find decimals, of those floats. Which is not ideal. But the values you want will be in the 1st index. As you can see in the example link Based on your update... If the script is in the same spot on the page all the time $html = file_get_html('http://www.wccca.com/PITSv2/'); $node = $html-&gt;find('script', 0); preg_match_all('/\d+(\.\d+)?/', $node-&gt;nodeValue;, $matches);
has comment: http://stackoverflow.com/comment/42393091
has comment: http://stackoverflow.com/comment/42393245
has comment: http://stackoverflow.com/comment/42393087
has comment: http://stackoverflow.com/comment/42393108
score: 0
has comment: http://stackoverflow.com/comment/42393095

http://stackoverflow.com/a/26916255
has comment: http://stackoverflow.com/comment/42381112
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/26916135
answers question: http://stackoverflow.com/q/26916135
score: 1
upvote count: 1
has body: http://jsfiddle.net/o4fyqvk7/ $("#response").on("click", 'button.btn-key-main', function() { $("#solution").html($(this).text()); });

http://stackoverflow.com/a/26906546
has body: Look at $(document).ready(function(e) { var counter = 0, $items = $('input[name^="item_"]'); $('input[id^="prodname_"]').change(function() { var id = this; if (this.checked) { if (counter == 4) { this.checked = false; return; } $("#item_" + counter).val(this.value).attr('data-value', this.value); ++counter; } else { var $item = $items.filter('[data-value="' + this.value + '"]'); var index = $items.index($item); $items.slice(index, counter).each(function(i) { var $n = $items.eq(index + i + 1); $(this).val($n.val() || '').attr('data-value', $n.attr('data-value')); }); counter--; $("#item_" + counter).val('').removeAttr('data-value'); } }); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;input type="checkbox" name="prodname_1" id="prodname_1" value="1" /&gt; &lt;input type="checkbox" name="prodname_2" id="prodname_2" value="2" /&gt; &lt;input type="checkbox" name="prodname_3" id="prodname_3" value="3" /&gt; &lt;input type="checkbox" name="prodname_4" id="prodname_4" value="4" /&gt; &lt;input type="checkbox" name="prodname_5" id="prodname_5" value="5" /&gt; &lt;input type="checkbox" name="prodname_6" id="prodname_6" value="6" /&gt; &lt;input type="checkbox" name="prodname_7" id="prodname_7" value="7" /&gt; &lt;input type="checkbox" name="prodname_8" id="prodname_8" value="8" /&gt; &lt;input type="checkbox" name="prodname_9" id="prodname_9" value="9" /&gt; &lt;input type="checkbox" name="prodname_10" id="prodname_10" value="10" /&gt; &lt;input type="text" name="item_0" id="item_0" value="" /&gt; &lt;input type="text" name="item_1" id="item_1" value="" /&gt; &lt;input type="text" name="item_2" id="item_2" value="" /&gt; &lt;input type="text" name="item_3" id="item_3" value="" /&gt;
answers question: http://stackoverflow.com/q/26905750
has comment: http://stackoverflow.com/comment/42363777
type: Answer
has comment: http://stackoverflow.com/comment/42363534
score: 0

http://stackoverflow.com/q/26840297
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/42247793
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26840363
score: -1
has answer: http://stackoverflow.com/a/26840548
answer count: 2
downvote count: 1
possible better answer: http://stackoverflow.com/a/26840548
accepted answer: http://stackoverflow.com/a/26840363
tagged with: javascript
has comment: http://stackoverflow.com/comment/42245262
has body: I have a option list, I wanted to implement the select all feature of it. All I want to do is, if the parent option(Option Pa1) is call all the option element which is in the same class(11) should be selected. how can I do this in jQuery ? Option Pa1 Option 2 Option 3 Option 1 Option Pa2 Option 3 Option 4
has title: select all the options using jQuery
type: AnsweredQuestion
upvote count: 0
tagged with: jquery

http://stackoverflow.com/comment/81732929
type: AnswerComment
type: Comment
has text: Option to do that was introduced in version 2.9.0. More info in [this thread on github](https://github.com/fullcalendar/fullcalendar/issues/564). And [this answer](https://stackoverflow.com/a/38299511/2941313) by fullcalendar author.
score: 1
comment on: http://stackoverflow.com/a/39360621

http://stackoverflow.com/a/26898816
answers question: http://stackoverflow.com/q/26898556
has comment: http://stackoverflow.com/comment/42351177
has body: Just set the $priority parameter to a ridiculously high value: add_action( 'wp_enqueue_scripts', 'scripts', 999999 ); To be the very last in the queue (though one can never be sure) use php's PHP_INT_MAX constant: add_action( 'wp_enqueue_scripts', 'scripts', PHP_INT_MAX ); Edit cf. discussion in comments. Note that the following is NOT the recommended way of enqueueing scripts in the footer. add_action( 'wp_print_footer_scripts', 'so26898556_print_footer_scripts', ( PHP_INT_MAX - 2 ) ); function so26898556_print_footer_scripts() { echo '&lt;script src="' . get_bloginfo( 'template_url' ) . '/js/custom.js"&gt;&lt;/script&gt;'; }
upvote count: 2
has comment: http://stackoverflow.com/comment/42350738
type: Answer
has comment: http://stackoverflow.com/comment/42351059
has comment: http://stackoverflow.com/comment/42352455
score: 2
has comment: http://stackoverflow.com/comment/42350848
downvote count: 0
has comment: http://stackoverflow.com/comment/42351055
has comment: http://stackoverflow.com/comment/133119328

http://stackoverflow.com/comment/42329913
has text: So the validation is working for you? Make sure validation should not be in pending state.
comment on: http://stackoverflow.com/q/26887542
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42380866
type: AnswerComment
score: 0
has text: Thanks CaldasGSM, that really helped, god bless you :)
type: Comment
comment on: http://stackoverflow.com/a/26915706

http://stackoverflow.com/a/26948959
score: 2
has comment: http://stackoverflow.com/comment/42440988
downvote count: 0
has comment: http://stackoverflow.com/comment/42440619
has body: In your ready function, you are referencing d.Id for each of the topojson features, which is currently undefined. I switched your function passed to fill to grab d.properties.SDRID instead, which is in both the topojson features and your OLM list elements. The forEach statement must also be changed to match. This seems to work: function ready(error, can, OLM) { var PopById = {}; OLM.forEach(function(d) { PopById[d.SDRID] = +d.OLMnb; }); svg.append("g") .attr("class", "SDR") .selectAll("path") .data(topojson.feature(can, can.objects.OLMCSDfr).features) .enter().append("path") .attr("d", path) .style("fill", function(d) { return colors(PopById[d.properties.SDRID]); }); }
upvote count: 2
answers question: http://stackoverflow.com/q/26948631
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26948631
has comment: http://stackoverflow.com/comment/42440473
type: Answer

http://stackoverflow.com/q/26870426
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/26870582
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26870548
accepted answer: http://stackoverflow.com/a/26870548
has title: Select Part of a Attribute - JQuery
type: Question
has answer: http://stackoverflow.com/a/26870545
has answer: http://stackoverflow.com/a/26870582
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26870588
has body: I need to get the number only from an attribute (The number is dynamic). The button/anchor looks like this: Delete Dish The part I need to dissect is this bit 'bc_inventorybundle_menu_product_0' I only want the number, for use in another function (Delete a LI with an ID of menuitem0_dish) The code I use for selecting ID's elsewhere is: function getNum(element, attrPrefix) { //set prefix, get number var prefix = attrPrefix; var num = element.attr("id").substring((prefix.length)); return num; } It works great on ID's but I cant seem to get it to work for Attributes instead of ID's So User clicks delete button bc_inventorybundle_menu_product_0 then jQuery removes the < li id="menuitem0_dish"> I can't add an ID to the button so I have to use the attribute of the button. As I'm sure you can tell I'm a complete noob when it comes to JS/JQuery. EDIT Having read all the answers I feel I may need to elaborate a little. I think the biggest issue is registering when the Button/Anchor is clicked. What I currently have is this, which I know must be wrong: $(document).on('click', 'data("field")', function(event) { deleteDish(this); }); function getbutNum(element, attrPrefix) { //set prefix, get number var prefix = attrPrefix; var butnum = element.data("field").substring(prefix.length); //Changed as per suggestions return butnum; } function deleteDish(field) { var numbut = getbutNum(); //Delete the UL/LI console.log("Num But" + numbut); } Asides from all else this gives me an error of 'unrecognized expression: data("field")'
score: 0

http://stackoverflow.com/comment/42391629
score: 0
type: Comment
has text: @GregL Will do. Can I ask, how would you then iterate the questions.choices into different li for each section? The same pattern but text(questions[index].choices[index]) doesn't work.
comment on: http://stackoverflow.com/a/26921839
type: AnswerComment

http://stackoverflow.com/q/26980380
tagged with: push
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42495003
tagged with: double-quotes
has comment: http://stackoverflow.com/comment/42495724
answer count: 0
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/42495370
has comment: http://stackoverflow.com/comment/42495412
type: Question
has comment: http://stackoverflow.com/comment/42495097
has comment: http://stackoverflow.com/comment/42495430
tagged with: javascript
has title: Right syntax For Double Quoted JSON Value With Javascript Push
score: 0
has comment: http://stackoverflow.com/comment/42495070
has body: What would be the right syntax to cover value with double quotes to process posted one with json_decode in PHP? jQuery('#envantereuruneklemediv tbody tr').each(function(index, element) { id=jQuery(element).find('.sec').attr('Id').split('_')[1]; liste.push({"UrunAdi":jQuery('#uruneklemetablodiv input[name="UrunAdi_'+id).val()}); }); Result: liste=[{"UrunAdi":"Value"}];

http://stackoverflow.com/a/26942018
upvote count: 1
has comment: http://stackoverflow.com/comment/42504304
has body: You can do this by changing .done() for .then() in a couple of places, and rearranging things a bit - well quite a lot. I think you've probably been searching for something like this : function openPhotoset(photosetId) { return _requestPhotosOfSet(photosetId).then(function(data) { var promises = $(data.photoset.photo).map(function(photo) { return requestPhotoInfo(photo.id).then(function(data) { return { id: photo.id, title: photo.title, farm: photo.farm, server: photo.server, secret: photo.secret, description: data.photo.description._content }; }); }).get();//.get() is necessary to convert a jQuery object to a regular js array. return $.when.apply(null, promises).then(function() { var template = $('#li-gallery').html(), result = Mustache.render(template, { currentPhotoset: Array.prototype.slice.apply(arguments) }); showGallery(); _$fyGallery.find('.gallery-list').html(result); }); }); } The main difference here is the creation of an array of promises as opposed to an array of photo objects, and allowing the promises to convey the data. This allows $.when() to fire off a callback when all the promises are fulfilled - ie when data objects have been composed for all photos in the set. Note the use of .map() instead of .each(), thus simplifying the creation of promises. And finally, the overall promise returned by openPhotoset() allows whatever action to be taken on completion of the whole process. Just chain .then(). openPhotoset(...).then(function() { // here, do whatever }); EDIT The overall pattern is probably easier to understand if the inner workings are pulled out and rephrased as named promise-returning functions - getPhotoInfoObject() and renderData(). function openPhotoset(photosetId) { function getPhotoInfoObject(photo) { return requestPhotoInfo(photo.id).then(function(data) { //$.extend() is much less verbose than copying `photo`'s properties into a new object longhand. return $.extend(photo, {description: data.photo.description._content}); }); } function re…
has comment: http://stackoverflow.com/comment/42507875
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/42508823
answers question: http://stackoverflow.com/q/26923881
score: 1
accepted answer of: http://stackoverflow.com/q/26923881

http://stackoverflow.com/comment/42401542
has text: I updated to all echo " RegionID."''>".$value->RegionID." ";as you said, but still it has error the same error as - Uncaught TypeError: undefined is not a function
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26927771
type: Comment

header
type: Tag
tags question: http://stackoverflow.com/q/26850517
tag name: header

http://stackoverflow.com/a/26841847
accepted answer of: http://stackoverflow.com/q/26841686
score: 1
upvote count: 1
has body: I personally wouldn't suggest using javascript to prevent this duplication thing since anyone could modify it and manually cause this problem, you should prevent the duplication both in php and javascript. Anyway to accomplish what you want in the script I think it's enough to modify part of your code to this: var master_basket = new Array(); selectedMovies = {}; /////// } else { var obj = { "movie_name":selected, "movie_info": "" }; if(!selectedMovies.hasOwnProperty(selected)){ addToBasket(obj); selectedMovies[selected] = obj; } }
answers question: http://stackoverflow.com/q/26841686
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/26899113
has body: Is it ok to create vars with spaces and forward slashes? Like so: var PICKUPS / TRUCKS = {};
has answer: http://stackoverflow.com/a/26899527
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42351193
has answer: http://stackoverflow.com/a/26899176
has answer: http://stackoverflow.com/a/26899199
downvote count: 1
type: Question
has title: Correct format structure creating variables
score: 3
accepted answer: http://stackoverflow.com/a/26899527
tagged with: javascript
linked to: http://stackoverflow.com/q/1661197
upvote count: 4
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/26899181
has answer: http://stackoverflow.com/a/26899181
has comment: http://stackoverflow.com/comment/42351149

http://stackoverflow.com/comment/42313516
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26878062
has text: The page I need to he maintain is very confused, it includes more than 10 javascript files(already uglified). And I can not get the src file, now I need to modified a click operation. But I don not kown the operated code comes from which js file.
score: 0

http://stackoverflow.com/comment/42255669
score: 0
type: Comment
has text: Note: Using `customerId` as the HTML element `ID` is risky. It may be all numeric (likely, and invalid for HTML4), or simply not valid as an identifier. Better add a 4th `data-customerId` attribute (as I did). *Please note your data selectors are invalid for the data attributes specified, so you may want to correct them.*
comment on: http://stackoverflow.com/a/26845919
type: AnswerComment

http://stackoverflow.com/comment/42389483
has text: Hi Artm, and yes - i mean jQuery didn't load sometimes.
comment on: http://stackoverflow.com/q/26920484
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/26855339
has title: How does an empty IFRAME cause cache busting
type: Question
tagged with: javascript
downvote count: 0
answer count: 1
duplicate of: http://stackoverflow.com/q/24046
favorite count: 0
has body: Found the following line in a javascript library that is used for predictive text in search boxes. Ex: If you type "red" a list pops up with "red dress, red flowers, red cars, etc" // Write the cache busting IFRAME document.write(' this prevents back forward cache '); I don't see how an empty iframe can bust cache. I've seen people append random numbers to the end of links to bust cache...but what is this iFrame all about. The library is big so I can share it. Sorry if this is not enough code to declare an answer.
has comment: http://stackoverflow.com/comment/42272962
accepted answer: http://stackoverflow.com/a/26855415
score: 2
has answer: http://stackoverflow.com/a/26855415
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/24046
upvote count: 2
tagged with: iframe

http://stackoverflow.com/comment/42496932
score: 0
has text: why would I return promise 2
type: Comment
comment on: http://stackoverflow.com/a/26981395
type: AnswerComment

http://stackoverflow.com/comment/42287451
has text: @AlexK. the script loads at the end of html but the call is in the html, thiscould be a problem... thanks
score: 0
comment on: http://stackoverflow.com/q/26863465
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42353665
comment on: http://stackoverflow.com/q/26900421
type: QuestionComment
has text: thanks @torazaburo but that didn't work, I stick to the original syntax
score: 0
type: Comment

http://stackoverflow.com/q/26944478
tagged with: model-view-controller
type: UnansweredQuestion
answer count: 0
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
has body: MVC Noob here. Basically, I'm trying to call a function that's in an apicontroller. Here's the apicontroller side: [HttpPost] public HttpResponseMessage&lt;String&gt; Recognize(string strokes) { var strokePointsData = JsonConvert.DeserializeObject&lt;dynamic&gt;(strokes); var strokeCollection = GetStrokeCollectionFromPoints(strokePointsData); var inkAnalyzer = new InkAnalyzer(); inkAnalyzer.AddStrokes(strokeCollection); var analysisStatus = inkAnalyzer.Analyze(); if (analysisStatus.Successful) { var recognizedString = inkAnalyzer.GetRecognizedString(); return new HttpResponseMessage&lt;string&gt;(recognizedString); } else return new HttpResponseMessage&lt;string&gt;("Data not recognized"); } And here's the JS: $('#submitBtn').click(function () { $.post('/api/Recognition/Recognize', { strokes: JSON.stringify(strokesHistory)}, function (result) { alert(result); }); }); Yet every time I compile and run, I get a "Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://localhost:1409/api/recognition/recognize" error message. This tells me that it's looking for an object in the root folder in /api/recognition/recognize, but I don't see any folders like that in the root folder, so this error makes sense. Yet, from all the research I've done, it looks like the URI I have above should be the right context. What am I missing?
type: Question
has title: Call Controller function from view JS
tagged with: asp.net-mvc-4
upvote count: 1

http://stackoverflow.com/comment/42481428
comment on: http://stackoverflow.com/q/26966998
type: Comment
has text: Read a real basic tutorial on JavaScript objects, arrays, and loops.
type: QuestionComment
score: 0

http://stackoverflow.com/comment/42996694
comment on: http://stackoverflow.com/q/26920777
has text: What about my other questions? Also where should the custom suggestions be saved? How should the be added? Are they saved in the same location?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26975414
accepted answer: http://stackoverflow.com/a/26975574
type: Question
has body: I'm new to angularjs, and now what I need to do with angularjs is a grid view which is pretty much like viewing files with large icon in Windows explorer. I've sort of finished the view, and what I need to do now is to implement a "favorite" feature. There's a button to set a file to be my favorite file, and there's also a button to let the grid view only show my favorite files. Is there any existing design pattern doing this by angularjs? Or it's just as simple as setting the "display" to "none" to those files that are not my favorite files? What would be the best practice to make my code of this feature to be unit-testable?
answer count: 2
tagged with: javascript
score: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/26975449
has answer: http://stackoverflow.com/a/26975574
has answer: http://stackoverflow.com/a/26975449
has title: File grid view by angularjs
type: AnsweredQuestion

telerik
tags question: http://stackoverflow.com/q/26976928
tags question: http://stackoverflow.com/q/26843043
tag name: telerik
tags question: http://stackoverflow.com/q/26850455
tags question: http://stackoverflow.com/q/26927562
tags question: http://stackoverflow.com/q/26909500
tags question: http://stackoverflow.com/q/26884564
type: Tag
tags question: http://stackoverflow.com/q/26915576

http://stackoverflow.com/q/26880375
linked to: http://stackoverflow.com/q/8130069
has body: This is the code to get temperature of London from weather API. It works correctly (images are local hence won't show): From tutorials point and Bootstrap website I have tried to use a dissmissable popover. It works fine too: Temperature Now what I am trying is I want get temperature as popover element. ie. if I click on image button, it should trigger temperature acquiring function and then show the temperature and the image related to that in popover box. So here is two challenge I am facing. Setting a image instead of the red button and then temperature data List item and the image ie. Tlogo2.svg to be appeared in that pop over box. So can anyone suggest how to set that? EDIT : I have tried this to attain what I said. but nothing happened. The code goes here: Temperature I am adding some addition. SO that people don't get confuse and see what really I want. I want the result of the function ie temperature is 23 C to that pop over element The code: Temperature So let me know where I need to change.
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/26881993
has comment: http://stackoverflow.com/comment/42320969
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: twitter-bootstrap
type: UnansweredQuestion
has title: Bootstrap with JS, result of a function in popover

http://stackoverflow.com/q/26896956
type: Question
has title: How find a phone number in a string with other content?
tagged with: javascript
score: 0
answer count: 1
tagged with: regex
accepted answer: http://stackoverflow.com/a/26897042
type: AnsweredQuestion
has body: I have a regex that matches a phone number but only if it's the only thing in a string. I need to be able to find a phone number in something like: "This is your phone number: 111.222.1111. OK?". My current Regex: /(^\(\d{3}\)( |-|\.)?\d{3}( |-|\.)?\d{4}$|^\d{3}( |-|\.)?\d{3}( |-|\.)?\d{4}$|^[0-9]{10,10}$)/g How can I modify this to find phone numbers within a string?
has answer: http://stackoverflow.com/a/26897042

http://stackoverflow.com/comment/42429685
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/26943272
has text: Why not use global variables then? Make selVal1 and selval2 as global.

http://stackoverflow.com/q/26933546
has title: JQuery add padding to original padding
has comment: http://stackoverflow.com/comment/42411869
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42412085
accepted answer: http://stackoverflow.com/a/26933648
has comment: http://stackoverflow.com/comment/42411890
type: Question
has comment: http://stackoverflow.com/comment/42411911
score: 2
possible better answer: http://stackoverflow.com/a/26933665
downvote count: 0
has answer: http://stackoverflow.com/a/26933665
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42411836
favorite count: 0
answer count: 3
has answer: http://stackoverflow.com/a/26933666
tagged with: http://stackoverflow.com/tag/html
has body: This is probably quite simple but I can't figure it out. I want to use jquery to add padding-top to a div in addition to it's original padding-top. My code so far is: var headH = $('#header').outerHeight(); var mastPad = $('#masthead').css('padding-top'); $('#masthead').css('padding-top', mastPad + headH); This results in huge amounts of padding I presume because JQuery keeps multiplying the padding. I need to find a way to grab the original padding-top and then add to it. Thanks
tagged with: css
has answer: http://stackoverflow.com/a/26933648
upvote count: 2

http://stackoverflow.com/comment/42383137
has text: You didn't call the function `addItems`...
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26917287
score: 1

http://stackoverflow.com/a/26910754
type: Answer
has body: Try to replace that autoplay before you add it. Because when you second click on it, you are adding again the ?autoplay=1 what has still there before. Working DEMO $("#youtubecontainer iframe").attr('src', $("#youtubecontainer iframe").attr('src').replace(/\?autoplay=1/, "") + '?autoplay=1');
answers question: http://stackoverflow.com/q/26910680
has comment: http://stackoverflow.com/comment/42371202
has comment: http://stackoverflow.com/comment/42371220
score: 0

http://stackoverflow.com/q/26871442
answer count: 3
has title: jQuery .not() issues
linked to: http://stackoverflow.com/q/9173055
tagged with: jquery
type: UnansweredQuestion
has body: The premise of what I'm trying to do is use jQuery to start a CSS transition to open and close a search box. User clicks magnifying glass icon, box opens, user clicks anywhere on the page but the search form, box closes. To close, using this: $('body *').not('#header-search, #header-field, #header-submit').click(function () { And different variations of the answer found here: jQuery - Select everything except a single elements and its children? without success. Clicking on the input#header-field always closes the box. Pen Here: http://codepen.io/anon/pen/RNbmwr Thanks for reading.
has comment: http://stackoverflow.com/comment/42301442
has answer: http://stackoverflow.com/a/26871630
has answer: http://stackoverflow.com/a/26871539
has comment: http://stackoverflow.com/comment/42301389
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/26871551
score: 0

custom-fields
tag name: custom-fields
type: Tag
tags question: http://stackoverflow.com/q/26969913

http://stackoverflow.com/comment/42268196
type: QuestionComment
comment on: http://stackoverflow.com/q/26852849
has text: What's the valid username you are typing?
score: 0
type: Comment

http://stackoverflow.com/comment/42387551
has text: @Vohuman , I mean that in the sense of show code for traversing the DOM rather that using a built in method or library.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26919424
type: Comment

http://stackoverflow.com/comment/42238654
comment on: http://stackoverflow.com/q/26836424
type: QuestionComment
type: Comment
has text: `delete obj.key` does not cause a memory leak in any way. If some other code is leaking because a key doesn't exist, then you need to go fix that code, not fix the key. If the key doesn't need to exist, then the best practice is to remove it with `delete`.
score: 1

http://stackoverflow.com/comment/42330026
comment on: http://stackoverflow.com/q/26879501
score: 0
has text: **(5)** Change your PHP code to this: `echo ' ';` *(And maybe without the `window.top.window.`, because that's probably not necessary anyway and I don't think it's widely supported yet. But if it works with, and you like that better, you can leave it in.)*
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/42378095
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26914353
score: 0
has text: It's up to you. But you've gotten an answer and a comment about `return false;`. Leave it open, but do upvote the other answer if you haven't already and maybe letting that person know of the current problem you are having. What I think may be happening is this `url : '/test.php',` you're using a `/` in there which may be a contributing factor, as I stated in the other answer about that. If it's showing as zero, then it's not writing to the file. Using error reporting would signal an error.

http://stackoverflow.com/comment/42415255
score: 1
has text: What do you mean with **The whole string is option.**. Have you already tried any `regex`. Which language?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26935337

http://stackoverflow.com/comment/42283997
has text: @EhsanSajjad: not working .
type: QuestionComment
comment on: http://stackoverflow.com/q/26861795
score: 0
type: Comment

http://stackoverflow.com/comment/42297039
has text: Returning `false` from an event does more than preventing its default behaviour.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26869024

http://stackoverflow.com/comment/42383771
has text: However, with that said. I doubt you can run a function inside an echo.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/26916065
type: QuestionComment

http://stackoverflow.com/a/26882446
score: 2
has comment: http://stackoverflow.com/comment/42320558
has comment: http://stackoverflow.com/comment/42320906
has comment: http://stackoverflow.com/comment/42320596
accepted answer of: http://stackoverflow.com/q/26882432
answers question: http://stackoverflow.com/q/26882432
has comment: http://stackoverflow.com/comment/42320818
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42320730
has comment: http://stackoverflow.com/comment/42320800
has comment: http://stackoverflow.com/comment/42320710
upvote count: 2
has comment: http://stackoverflow.com/comment/42320854
type: Answer
has comment: http://stackoverflow.com/comment/42320880
has body: Your selector is wrong, it should be $('#gotvalue'). Also, you say you want to empty the div, yet you are removing it from the DOM completely. To achieve what you require you can either empty() the div, like this: $('#gotvalue').empty(); Or you can remove the hidden input directly: $('#imagetextbox').remove(); Example fiddle If you want to leave the hidden field in place, but reset its value, you can use val(''): $('#imagetextbox').val('');

http://stackoverflow.com/comment/42281427
has text: First thing... `getElementByID` must be `getElementById`!
comment on: http://stackoverflow.com/q/26860422
type: Comment
type: QuestionComment
score: 3

http://stackoverflow.com/comment/42473248
has text: I also wanted multiple edit. I am not able to do so. Can you suggest how to do that?
comment on: http://stackoverflow.com/a/26968246
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/26968917
answers question: http://stackoverflow.com/q/26968779
score: 2
downvote count: 0
upvote count: 2
has body: Since firstChild is TextNode in your case you can't access img element. Instead you have several options. First of all you can use firstElementChild: function toggleThis(e){ var elc = e.firstElementChild.firstElementChild.firstElementChild; alert(elc.src); } Then you can use children collection: function toggleThis(e){ var elc = e.children[0].children[0].children[0]; alert(elc.src); } function toggleThis(e){ var elc = e.children[0].children[0].children[0]; alert(elc.src); // .. or var elc = e.firstElementChild.firstElementChild.firstElementChild; alert(elc.src) } &lt;a href="#" onclick="toggleThis(this); return false;"&gt; &lt;div style="width:100%;"&gt; &lt;h3 style="display:inline-block"&gt;&lt;img src="http://lorempixel.com/100/100" class="faqPlusMinus"&gt;Where is my order?&lt;/h3&gt; &lt;/div&gt; &lt;/a&gt;
type: Answer

http://stackoverflow.com/a/26871772
type: Answer
has body: Change your form action from a relative to an absolute URL, i.e.: &lt;form action="/edit/items" method="post" id="editform"&gt;
upvote count: 5
answers question: http://stackoverflow.com/q/26871709
score: 5
downvote count: 0

http://stackoverflow.com/a/26953989
answers question: http://stackoverflow.com/q/26953659
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/42448264
downvote count: 0
has body: var dateArray= ["2014,01,01","2014,07,04","2014,09,01","2014,11,25"]; var y = dateArray.map( function(x) { return x.split( ',' ).map(function(v) { return (+v); }); }); console.log( y ); UPDATE var a = [5,6], b = ["2014,5,6","2014,5,9"]; b.forEach( function(x) { a.push( x.split( ',' ).map(function(v) { return (+v); }) ); }); console.log( a );
type: Answer

http://stackoverflow.com/q/26933976
has comment: http://stackoverflow.com/comment/42413515
upvote count: 1
linked to: http://stackoverflow.com/q/22537311
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/26934691
has comment: http://stackoverflow.com/comment/42412637
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/42413303
linked to: http://stackoverflow.com/q/12505760
has comment: http://stackoverflow.com/comment/42413407
tagged with: javascript
has answer: http://stackoverflow.com/a/26934622
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/42413126
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42413191
has body: I'm using AngularJS and I need to have a global several global objects that can be accessed by any controller in the app. For example one object that i need is a user object that has the users id and other properties. This user object comes from the database via ajax. So I need a way to set that user object, then initialize the controllers used on the page. Basically giving the app a page load for the fist load of the program. Then if that object isn't set, I need to redirect. Does anyone have an idea of how to do this cleanly? I've been trying to use broadcast but its truing into spaghetti code. Currently I use ui-router, and have a hidden view with a controller GlobalsCtrl. GlobalsCtrl uses a service to get the objects and then $broadcasts them so controllers can initialize. But.... This broadcast only works on the initial site load. When changing $location.paths that event is not broadcast because the GlobalsCtrl variables are already set. I could add some if statements but that seems messy to me. Please help. Thanks! Plunker - http://plnkr.co/edit/TIzdXOXPDV3d7pt5ah8i var app = angular.module('editor.services', []); app.factory('AnalysisDataService', ['$http', function($http) { var self = this; self.activeAnalysis = {}; self.openAnalysis = function(analysisId) { return $http.get('api/v1/assignments/analysis/' + analysisId) .success(function(data, status, headers, config) { self.activeAnalysis = data; return self.activeAnalysis; }).error(function(data, status, headers, config) { console.log("Error could not load analysis article."); }).then(function(result) { return self.activeAnalysis; }); }; self.getAnalysis = function() { return self.activeAnalysis; }; self.navigateToStep = function(step) { $location.path('/analysis/summary'); }; return { open: self.openAnalysis, get: self.getAnalysis, navigate: self.navigateToStep, } }]); The problem is I need the self.activeAnalysis variable to be set before a few other controllers load. Each page loads a different data-set …
has title: Asynchronous global variables in AngularJS
has comment: http://stackoverflow.com/comment/42413142
tagged with: global

http://stackoverflow.com/q/26845479
favorite count: 0
tagged with: int
has answer: http://stackoverflow.com/a/26845589
possible better answer: http://stackoverflow.com/a/26845588
upvote count: 1
has title: Convert a non-digit string to a number in JavaScript
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26845589
score: 1
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/42254088
has body: This is not your typical string to integer cast or conversion. Is there an easy way I can get a numbered representation of a string in JavaScript? Imagine I want the word Apple in some sort of integer representation. I know I can build a dictionary of all the letters of the alphabet and assign them numbers, then add up the letters for a given string, but I thought there might be an easier way. PS. Capitalization doesn't matter in this case, but even if it is accounted for in the conversion, all is still good for my use case.
downvote count: 0
tagged with: javascript
tagged with: string
has answer: http://stackoverflow.com/a/26845588

http://stackoverflow.com/comment/42438983
score: 0
type: AnswerComment
has text: I am not sure how to go about implementing this in a more general setting. In particular, what url would the user use to get the, say, info2 div to appear on loading the page?
type: Comment
comment on: http://stackoverflow.com/a/26920582

http://stackoverflow.com/a/26981908
answers question: http://stackoverflow.com/q/26981680
score: 0
has comment: http://stackoverflow.com/comment/42498002
has body: You're passing a string "false" into evaluate and setting the checked property to this string. The string is then evaluated to true, because !!"false" === true and !!"true" === true. If hope you see the problem now. This is easy to fix. Since you're passing JavaScript code (false) as a string, you need to execute the string so that it is JavaScript code again: document.getElementById(r).checked = eval(s); eval is usually evil, but since this is your local script, there is nothing you can break security-wise.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42498166
accepted answer of: http://stackoverflow.com/q/26981680
type: Answer

http://stackoverflow.com/q/26882451
has body: I'm using the element for responsive images with the picturefill polyfill for unsupported browsers. Everything works fine even in the unsupported browsers. But in chrome, where it is supported, my jquery load event isnt consistently firing. Heres my code: $("#banner .banner-slide a img").load(mainSlider.init) And my picture element: &lt;picture&gt; &lt;!--[if IE 9]&gt;&lt;video style="display: none;"&gt;&lt;![endif]--&gt; &lt;source srcset="http://placehold.it/1920x300" media="(min-width: 1440px)" /&gt; &lt;source srcset="http://placehold.it/1440x300" media="(min-width: 1024px)" /&gt; &lt;source srcset="http://placehold.it/1024x250" media="(min-width: 640px)" /&gt; &lt;source srcset="http://placehold.it/640x150" media="(min-width: 481px)" /&gt; &lt;source srcset="http://placehold.it/480x150" media="(max-width: 480px)" /&gt; &lt;!--[if IE 9]&gt;&lt;/video&gt;&lt;![endif]--&gt; &lt;img srcset="http://placehold.it/1440x300" alt="" /&gt; &lt;/picture&gt; Any idea as to what i can do to get it to work properly in chrome? Fixed Not too sure what the deal was but adding the below the load listener fixed it. Even with a setTimeout of 0 worked but to be save i gave it 10ms. Ive experienced a few scenarios before where a small timeout solves the problem with chrome. //Fix chrome bug setTimeout(function () { $(window).resize(); }, 10)
score: 1
tagged with: picturefill
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/42320687
tagged with: javascript
has title: jQuery load not always firing with element in Chrome
answer count: 1
has comment: http://stackoverflow.com/comment/42320777
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47525676
has answer: http://stackoverflow.com/a/29693388
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/42380192
has text: The only problem is and I should have stated this in my question is not all links point to pages on my server some take the user off site so I wouldn't be able to trigger the application.cfm file.
comment on: http://stackoverflow.com/a/26913653
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/26942017
answer count: 2
upvote count: 0
score: -2
has answer: http://stackoverflow.com/a/26942044
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/26942040
type: UnansweredQuestion
downvote count: 2
has title: cannot figure out why onload event will not work
has body: //this my javascript code written in a diffrent file i named jsTest.js window.onload = function(){ var firstBton = document.getElementById('ch1bton'); }; firstBton.onclick = function(){ document.getElementById("addhere").innerHTML = "Test Ok"; }; // here the code in the html code from a test.html page Hully Fly $30.00 why this is working only if i put the script file at the button of the html file althoutgh i am using window.onload method. can't figure that out ?
type: Question

http://stackoverflow.com/comment/42232062
has text: Unclear: Are you asking to adjust the `transform` attribute of the `<g class="shape">` from within `.each(function(d, i){ ... })`?
comment on: http://stackoverflow.com/q/26832477
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/26876466
type: Question
has title: parameter in function even not isset ,still work
tagged with: javascript
has answer: http://stackoverflow.com/a/26876510
answer count: 1
has body: Is it possible call a function, whatever the parameter isset or not, how to do it? select(); select($response_message); function select($response_message) { .... }
score: 0
accepted answer: http://stackoverflow.com/a/26876510
tagged with: php
linked to: http://stackoverflow.com/q/894860
type: AnsweredQuestion

http://stackoverflow.com/q/26899928
has comment: http://stackoverflow.com/comment/42415659
has title: Proper way to display form validation errors in Angular?
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26901022
has body: I display alerts at the top of the page if a validation error is triggered, the current implementation also hides the error as soon as the error is fixed. It all works but seems inefficient, is there a better way? HTML: &lt;div class="alert alert-danger" ng-repeat error in advAlerts ng-show="error.hasError()"&gt; {{error.text}} &lt;/div&gt; JS: $scope.advAlerts = [ { hasError: checkFooError, text: 'Error Foo', }, { hasError: checkBarError, text: 'Error Bar', }, ... ] function checkFooError() { //check a list of required attributes to see they're all filled out //returns true/false } With this method, the page is responsive: after clicking submit, if any required attributes are missing, the alert displays. When all the required attributes are filled out, the alert instantly goes away. However, the checkFooError function gets called a ton due to the digest cycle (I think?), is there a better way to do this? -EDIT- The standard validation things are already in place, I forgot to mention these are "advanced alerts" because they're something extra the designers wanted.
has answer: http://stackoverflow.com/a/26901457
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/42353045
tagged with: javascript
score: 0

http://stackoverflow.com/comment/42410795
type: Comment
comment on: http://stackoverflow.com/a/26931250
has text: No, `$_POST['name']` will be an array, so you go `foreach($_POST['name'] as $id=>$name){};`.
score: 0
type: AnswerComment

http://stackoverflow.com/q/26903493
score: 6
tagged with: xss
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28234897
tagged with: server-side
tagged with: asp.net
has comment: http://stackoverflow.com/comment/42431563
favorite count: 0
has comment: http://stackoverflow.com/comment/42434232
type: Question
linked to: http://stackoverflow.com/q/206717
has title: XSS scripting for Search textbox
has answer: http://stackoverflow.com/a/27047333
has answer: http://stackoverflow.com/a/27065073
has comment: http://stackoverflow.com/comment/42613618
linked to: http://stackoverflow.com/q/17509169
has answer: http://stackoverflow.com/a/27986228
possible better answer: http://stackoverflow.com/a/28056141
accepted answer: http://stackoverflow.com/a/28234897
linked to: http://stackoverflow.com/q/3210393
has answer: http://stackoverflow.com/a/28056141
upvote count: 7
downvote count: 1
tagged with: c#
linked to: http://stackoverflow.com/q/1144535
has body: I have a textbox which is used for searching the data within the site. What my client wants that, 1)Enter any text in the search field and click the search symbol. 2)The request going to the server using a web proxy tool like "Burp" 3)Append the parameter with the script present as test&lt;~script&gt;confirm(123)&lt;~/script&gt; what happens here is The XSS script entered by the advesary gets reflected in the response without any input. Please see the image below you will get an idea:- ![enter image description here][1] Guys, let me know if you need any more information related to it. Please help guys, Any help would be appreciated. I want to stop the attack from server side. HTML and JS code:- &lt;asp:TextBox ID="txtSearch" runat="server" class="txtfld-search" oncopy="return false" oncut="return false" onpaste="return false"&gt;&lt;/asp:TextBox&gt; JS code:- &lt;script type="text/javascript"&gt; $(document).ready(function () { $('#ctl00_topNavigation_txtSearch').keyup(function () { var $th = $(this); $th.val($th.val().replace(/[^.%a-zA-Z0-9 ]/g, function (str) { alert('Special characters not allowed except %'); return ''; })); }); }); Also see the code behind:- protected void btnSearch_Click(object sender, ImageClickEventArgs e) { Response.Redirect("search.aspx?tx=" + txtSearch.Text); } Also, see the code for the searching part:- private void SearchResult() { DataTable dt; if (Session["Search"] == null) { ResXResourceReader reader = new ResXResourceReader(Server.MapPath("~/App_GlobalResources/Strings.en-US.resx")); IDictionaryEnumerator id = reader.GetEnumerator(); string sResourceFile = Server.MapPath("~/App_GlobalResources/Strings.en-US.resx"); XmlDocument xmlResource = new XmlDocument(); xmlResource.Load(sResourceFile); XmlNodeList elmData = xmlResource.SelectNodes("//root/data"); dt = new DataTable(); dt.Columns.Add(new DataColumn("ID", System.Type.GetType("System.String"))); dt.Columns.Add(new DataColumn("Title", System.Type.GetType("System.String"))); dt.Colu…
tagged with: javascript
answer count: 5

http://stackoverflow.com/comment/42474009
comment on: http://stackoverflow.com/q/26968779
type: QuestionComment
score: 0
has text: That ` ` isn't a sibling of ` `, but a child. Try `e.firstChild.firstChild.firstChild`.
type: Comment

http://stackoverflow.com/comment/42465134
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26963440
type: Comment
has text: If I delete that, the textarea won't auto-height :( How can I specify in that function the initial height??

http://stackoverflow.com/comment/42452354
score: 0
type: Comment
type: QuestionComment
has text: also try to use `onmouseover=` and `onmouseout=` without capital letters.
comment on: http://stackoverflow.com/q/26956449

http://stackoverflow.com/comment/42254470
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26845272
has text: Thanks a lot, I will try that! Do I need to use `data-toggle=tooltip` or can I also use an arbitrary CSS class for this one?

http://stackoverflow.com/comment/42416192
type: Comment
comment on: http://stackoverflow.com/a/26935285
score: 1
has text: Just tried your new solution and it works perfectly. Thanks dude!
type: AnswerComment

http://stackoverflow.com/comment/42399984
type: AnswerComment
has text: Security functions in the browsers force it so the user must invoke it themselves willingly. a 'click' function will make it work: e.g. `$('body').click(function() { toggleFullScreen(document.body); });`. As I said in my answer: _"The user does have to instigate this themselves though through the website GUI."_
type: Comment
comment on: http://stackoverflow.com/a/26907767
score: 0

http://stackoverflow.com/a/78013987
score: 0
type: Answer
has body: I wrote a function to solve this issue (released here under MIT License) // (c) 2022 JDMCreator, Released under MIT License function findReplaceElements(text, replace, elements) { // let's build a regexp var regexp = &quot;&quot;; for (var i = 0; i &lt; text.length; i++) { if (i &gt; 0) { regexp += &quot;((?:&lt;(?!\s*\/?\s*(?:br|li|ul|p|div))[^&gt;]+?&gt;)*)&quot;; } var c = text[i]; regexp += &quot;(?:&quot;; if (c == &quot;&gt;&quot;) { regexp += &quot;&amp;gt;&quot;; } else if (c == &quot;&lt;&quot;) { regexp += &quot;&amp;lt;&quot;; } else if (c == &quot;&amp;&quot;) { regexp += &quot;(?:&amp;amp;|&amp;)&quot;; } else if (c == '&quot;') { regexp += '(?:&amp;quot;|&quot;)'; } else if (c == &quot;\\&quot; || c == &quot;(&quot; || c == &quot;)&quot; || c == &quot;/&quot; || c == &quot;.&quot; || c == &quot;[&quot; || c == &quot;]&quot; || c == &quot;?&quot; || c == &quot;*&quot; || c == &quot;+&quot; || c == &quot;^&quot; || c == &quot;$&quot;) { regexp += &quot;\\&quot; + c; } else if (c == &quot; &quot;) { regexp += &quot;\s+&quot;; } else { regexp += c; } regexp += &quot;)(?!([^&lt;]+)?&gt;)&quot;; } var div = document.createElement(&quot;div&quot;), nb = 0; div.innerText = replace; replace = div.innerHTML; for (var i = 0; i &lt; elements.length; i++) { var html = elements[i].innerHTML var newhtml = html.replace(new RegExp(regexp, &quot;gi&quot;), function(full) { // let's build overtags; var tags = [], tagName = []; for (var i = 1; i &lt; arguments.length - 2; i++) { if (!arguments[i]) { continue; } arguments[i].replace(/&lt;\s*(\/?)\s*([a-z]+)[^&gt;]*?&gt;/gi, function(full, close, tagname) { tagname = tagname.toLowerCase(); if (close) { if (tagName[tagName.length - 1] == tagname) { tagName.pop(); tags.pop(); } else { tags.push(full); tagName.push(&quot;/&quot; + tagname); } } else { tagName.push(tagname); tags.push(full); } }); } nb++ return replace + tags.join(&quot;&quot;); }); if (newhtml != html) { elements[i].innerHTML = newhtml; } } return nb; } You ca…
answers question: http://stackoverflow.com/q/26951003

http://stackoverflow.com/comment/42265947
type: Comment
has text: Where is your html code?
comment on: http://stackoverflow.com/q/26851780
score: 0
type: QuestionComment

http://stackoverflow.com/comment/42483400
score: 0
comment on: http://stackoverflow.com/q/26848791
type: Comment
type: QuestionComment
has text: I meant to write "skew" not "scew", in case that was not clear.

http://stackoverflow.com/q/26926561
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: javascript
has title: Specifying D3 Force Graph parameters via json
downvote count: 0
has body: I am trying to create a more reusable version of force directed network in d3.js. My thought was to be able to use the json file containing the data to also specify network properties. { "nodes":[ {"name":"Myriel","group":1}, {"name":"Napoleon","group":1}, {"name":"Mlle.Baptistine","group":1}, //etc..... {"name":"Child2","group":10}, {"name":"Brujon","group":4}, {"name":"Mme.Hucheloup","group":8} ], "links":[ {"source":1,"target":0,"value":1}, {"source":2,"target":0,"value":8}, {"source":3,"target":0,"value":10}, //etc.... {"source":76,"target":62,"value":1}, {"source":76,"target":48,"value":1}, {"source":76,"target":58,"value":1} ], "graph":{"charge":-220,"linkDistance":50} } To do this I moved the call to the d3.layout.force() into the json call see this jsfiddle. I then specify the graph behaviour as var force = d3.layout.force() .charge(graph.graph.charge) .linkDistance(graph.graph.linkDistance) .size([width, height]); My question is if this is the right way to do this. The only drawback I can see at the moment is that it takes a bit longer to initialise the graph. Is there a better way?
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
has comment: http://stackoverflow.com/comment/47398526
type: UnansweredQuestion
score: 3
tagged with: force-layout
answer count: 0
upvote count: 3

http://stackoverflow.com/q/26957719
has answer: http://stackoverflow.com/a/56273730
has body: How can you update an entire object, say: var x = {a:1} function modify(obj) { obj = {b:2} } modify(x) console.log(x) // {a:1} But maintain the reference? I want the object to be modified outside the function. My specific case is using lodash.pick inside my function: if (whitelist) { obj = _.pick(obj, whitelist) } I can't seem to find a pick function that modifies the object. Is there a way to do this or do I need to start returning copies of the object?
downvote count: 1
upvote count: 17
has answer: http://stackoverflow.com/a/26958087
has answer: http://stackoverflow.com/a/26958134
accepted answer: http://stackoverflow.com/a/26958134
favorite count: 0
has answer: http://stackoverflow.com/a/40617542
tagged with: reference
type: AnsweredQuestion
has title: Replace object value without replacing reference
has answer: http://stackoverflow.com/a/59299964
score: 16
possible better answer: http://stackoverflow.com/a/26958087
type: Question
tagged with: object
has answer: http://stackoverflow.com/a/26957781
tagged with: javascript
answer count: 6

http://stackoverflow.com/comment/52958034
type: Comment
comment on: http://stackoverflow.com/a/32550996
score: 0
type: AnswerComment
has text: Just linking to your own library or tutorial is not a good answer. Linking to it, explaining why it solves the problem, providing code on how to do so and disclaiming that you wrote it makes for a better answer. See: **[What signifies “Good” self promotion?](http://meta.stackexchange.com/q/182212/200235)**

http://stackoverflow.com/comment/42255833
comment on: http://stackoverflow.com/a/26845282
type: Comment
has text: Thanks for your answer so my promise will be $.getJSON('/picture')? $.when($.getJSON('/picture')).done Did I get it right?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42281278
has text: Please include all relevant code within your question. IF jsFiddle goes down, as it frequently does, your question would be unanswerable.
score: 1
comment on: http://stackoverflow.com/q/26860361
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42309106
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26875710
has text: So, you mean that function callback does not wait for http.get to finish as I have seen in some other async functions like fs.readdir, in that case the callback only called after the fs.readdir finished reading. What is the difference and when to know this is the case?

http://stackoverflow.com/a/26956631
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/26956411
answers question: http://stackoverflow.com/q/26956411
has body: $(document).ready( function () { $("#desno,#loginbox").mouseover(function () { $("#loginbox").show(); }); $("#desno,#loginbox").mouseout(function () { $("#loginbox").hide(); }); }); I asnwered my own question thanks to you guys.

http://stackoverflow.com/comment/42475097
type: QuestionComment
comment on: http://stackoverflow.com/q/26969323
has text: $('#addcontent').remove() respecting what @Satpal said
score: 0
type: Comment

http://stackoverflow.com/q/26920682
has comment: http://stackoverflow.com/comment/42389687
type: Question
has comment: http://stackoverflow.com/comment/42389558
upvote count: 0
tagged with: function
accepted answer: http://stackoverflow.com/a/26920765
has title: How do I get this JavaScript number guessing game to work without a "while" or "for" loop?
tagged with: javascript
has answer: http://stackoverflow.com/a/26920765
answer count: 1
has comment: http://stackoverflow.com/comment/42389549
favorite count: 0
has body: Here are the rules to the challenge: Generates and stores a secret, random number Prompts the user for a number between 1 and 100 Responds to the user's number: If higher, it says to pick lower If lower, it says to pick higher Repeats steps 2 and 3 until the user picks the correct number Congratulates the user when they win! Do not use a 'while' or 'for' loop. Use only functions. I would normally use a loop to do this, but the rules state otherwise. My code is below var secretNumber = parseInt(Math.random() * 100, 10) + 1; var guessNumber = function(){ var userNum = prompt("Pick a number between 1 &amp; 100!"); if(userNum &gt; secretNumber){ prompt("Pick Lower!"); } else if(userNum &lt; secretNumber){ prompt("Pick Higher"); } else{ alert("Congratulations!!! You win!") } }; Naturally my code stops after it runs through the "if else" statements. How can I refactor this code to make the number guessing game work without loops? Thanks in advance!
has comment: http://stackoverflow.com/comment/42389559
downvote count: 1
type: AnsweredQuestion
tagged with: if-statement
has comment: http://stackoverflow.com/comment/42390016
score: -1
has comment: http://stackoverflow.com/comment/42389698
has comment: http://stackoverflow.com/comment/42389651

http://stackoverflow.com/a/26990432
type: Answer
has body: I think using Api service to create a more specific service named Fetcher is a better solution than using $scope.fetcher in controller. this way the direction won't be tight coupled with controller anymore. plus, check the screen as a distinct function of side of AngularJS and use the it's returned Boolean value in controller for multiple using Fetcher service
upvote count: 2
accepted answer of: http://stackoverflow.com/q/26989307
score: 2
answers question: http://stackoverflow.com/q/26989307
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/26834649
tagged with: javascript
has comment: http://stackoverflow.com/comment/42236063
score: 0
has body: I was reading this AngularJS Style Guide about using the controllerAs syntax and avoiding the use of $scope when possible. I have a UsersController that has an array of users. I then use a ng-repeat directive with a nested UserController. My problem is, I don't know how I should access (or assign) the user value to my UserController without the use of $scope. Any suggestions? Here is DEMO. Here is the HTML: {{user.index}} {{friend.name}} The javascript: /* UserController */ function UserController($scope) { var vm = this; /* How to access/assign 'user' without using $scope? Is there a better way than the following? vm.user = $scope.user */ } /* UsersController */ function UsersController(dataService) { var vm = this; vm.users = dataService; }
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42235476
has comment: http://stackoverflow.com/comment/42235470
has title: Assigning values to child controller within ng-repeat using controllerAs.
answer count: 0
has comment: http://stackoverflow.com/comment/42236003
type: Question
has comment: http://stackoverflow.com/comment/42235616

http://stackoverflow.com/comment/42278293
score: 0
comment on: http://stackoverflow.com/a/26837801
type: Comment
has text: Because your version of `self.cache` returns a function that takes in a callback as its last argument. To run your tests, you'll have to use: `fileCache.cache(filePath, fileName, function () { assert(fileCache.has(fileName)); });` This can be done without using generators and `co`. If you were using `koa`, which uses `co`, the alternate approach lets you use constructs of the form: `app.get('/:file', function * () { yield fileCache.cache(filePath, this.params.file); this.body = fileCache.get(this.params.file);} );`
type: AnswerComment

http://stackoverflow.com/comment/42337553
type: Comment
type: QuestionComment
has text: First off, thanks for teaching me a new debugging tool :) Secondly, you should use a templating system for this. Mustache.js maybe?
comment on: http://stackoverflow.com/q/26891846
score: 0

http://stackoverflow.com/comment/42456168
has text: Yes ..even with using javascript failing to set/send text in text field.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26958449
score: 0

http://stackoverflow.com/q/26919402
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/42387258
has comment: http://stackoverflow.com/comment/42389385
has comment: http://stackoverflow.com/comment/42388660
possible better answer: http://stackoverflow.com/a/26919526
favorite count: 0
has answer: http://stackoverflow.com/a/26919526
has title: Get Millisecond from January 1st 00:00:00:000 with Javascript
linked to: http://stackoverflow.com/q/221294
has body: How would I get the millisecond from January 1st 00:00:00:000 (of this year) with Javascript? For example, January 1st 00:00:00:000 would give me 0 and December 31st 23:59:59:999 would give me 31536000000.
has comment: http://stackoverflow.com/comment/42387188
has comment: http://stackoverflow.com/comment/42387078
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26919513
downvote count: 0
score: 1
type: Question
has answer: http://stackoverflow.com/a/26919513
has comment: http://stackoverflow.com/comment/42387134
tagged with: javascript

http://stackoverflow.com/a/26878767
upvote count: 5
type: Answer
downvote count: 0
has body: You can try to use a custom deferred object like below var loadHTML = function () { var deferred = $.Deferred(); $.get("javascripts/templates/" + templateType + ".html", function (html) { var $html = $(html), $imgs = $html.find('img'), len = $imgs.length, counter = 0; $imgs.load(function () { if (++counter == len) { deferred.resolve(); } }); $("#content").html($html); }); return deferred.promise(); }; TD var list = []; for (var i = 0; i &lt; 5; i++) { list.push('&lt;span&gt;&lt;img src="//placehold.it/64&amp;text=' + (i + 1) + '" /&gt;&lt;/span&gt;'); } var html = '&lt;div&gt;' + list.join('') + '&lt;/div&gt;'; var loadHTML = function() { var deferred = $.Deferred(); //using a timer to simulate ajax request setTimeout(function() { var $html = $(html), $imgs = $html.find('img'), len = $imgs.length, counter = 0; $imgs.load(function() { if (++counter == len) { deferred.resolve(); } }); $("#content").html($html); }, 500); return deferred.promise(); }; loadHTML().done(function() { $("#content").find('img').each(function() { $(this).after(this.complete) }) }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div id="content"&gt;&lt;/div&gt; Demo: Fiddle Demo: Problem(Change the size of the image to see the problem)
accepted answer of: http://stackoverflow.com/q/26878588
answers question: http://stackoverflow.com/q/26878588
score: 5
has comment: http://stackoverflow.com/comment/42316718
type: AcceptedAnswer

http://stackoverflow.com/q/26945288
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/26946293
has title: Set Attr Required when a checkbox for that field is checked
tagged with: javascript
tagged with: jquery
has body: I have some looping rows which each row has a check box. And in each row there is a dropdown list which I want it to be set as required when the checkbox in the row is selected. MARK NAME QUANTITY --------------------------------------------------- [] inputForName1 Choose => 1,2,3,4,5 --------------------------------------------------- [] inputForName2 Choose => 1,2,3,4,5 --------------------------------------------------- [] inputForName3 Choose => 1,2,3,4,5 --------------------------------------------------- [] inputForName4 Choose => 1,2,3,4,5 --------------------------------------------------- [] inputForName5 Choose => 1,2,3,4,5 --------------------------------------------------- [SUBMIT] (here [] is a Check-Box, and Choose => is a dropdown selection) echo' items.'"> echo' Choose Quantity '; for ($q=1; $q <= $obj->quantity; $q++) { echo' '.$q.' '; } echo' '; echo' '; } } ?> <?php if($_SERVER["REQUEST_METHOD"] == "POST") { foreach($_POST['checkbox'] as $i) { $product_name=$_POST['items'][$i]; $product_quan=$_POST['esquantity'][$i]; mysql_query("INSERT INTO estockClaims (items, esquantity) VALUES ('$product_name', '$product_quan')"); } } ?> The problem is when I check only two checkboxes and I submit them, it asks me to select all the dropdown list in the quantity column. Sketch of Jquery
possible better answer: http://stackoverflow.com/a/26947055
type: Question
has answer: http://stackoverflow.com/a/26947055
has comment: http://stackoverflow.com/comment/42433766
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/42434122
has comment: http://stackoverflow.com/comment/42433575
answer count: 2
has comment: http://stackoverflow.com/comment/42434044
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/42434241
has comment: http://stackoverflow.com/comment/42433743
accepted answer: http://stackoverflow.com/a/26946293
has comment: http://stackoverflow.com/comment/42436159

http://stackoverflow.com/comment/42406525
type: QuestionComment
comment on: http://stackoverflow.com/q/26930455
has text: What's this mean "If however I let the page settle for 15 seconds"?
score: 1
type: Comment

http://stackoverflow.com/a/26857634
type: Answer
has body: Your comments clarified your question: You're getting xul elements returned. Your scope is wrong. Access the tab content by doing window.gBrowser.contentWindow.document.getElementsByBlassName however note that doing contentWindow directly on the gBrowser gives you the contentWindow of the currently selected tab you can also skip contentWindow.document and just do window.gBrowser.contentDocument. window is the DOMWindow which is the browser window not the html window Services.wm.getMostRecentWindow('navigator:browser').gBrowser.contentWindow.... this gets the most recent window of windowtype navigator:browser see about window-type here: you can get the window type with aDOMWindow.document.documentElement.getAttribute('windowtype') go through all windows like this: var DOMWindows = Services.wm.getEnumerator(null); while (DOMWindows.hasMoreElements()) { var aDOMWindow = DOMWindows.getNext(); var windowtypeOfADomWindow = aDOMWindow.document.documentElement.getAttribute('windowtype'); console.log('windowtype of this domwindow is:', windowtypeOfADomWindow) } navigator:browser windows have a gBrowser and usually a gBrowser.tabContainer and the tabConatiner has childNodes which are tabs. So you can then go through the tabs like this: var tabs = gBrowser.tabContainer.childNodes; for (var i=0; i&lt;tabs.length; i++) { var aTab = tabs[i]; var aTabContentWindow = aTab.linkedBrowser.contentWindow; }
has comment: http://stackoverflow.com/comment/42283168
has comment: http://stackoverflow.com/comment/42282981
downvote count: 1
has comment: http://stackoverflow.com/comment/42305791
score: -1
has comment: http://stackoverflow.com/comment/42291273
answers question: http://stackoverflow.com/q/26855261
upvote count: 0
has comment: http://stackoverflow.com/comment/42391490

http://stackoverflow.com/comment/42284844
type: Comment
type: QuestionComment
has text: @SamParmenter please don't struggle that much, just click the down vote and move on :)
score: 0
comment on: http://stackoverflow.com/q/26862215

http://stackoverflow.com/a/26950706
answers question: http://stackoverflow.com/q/26950557
upvote count: 3
score: 3
has body: function saveForm() { var array = []; array.push(txtTNumber.value); array.push(txtTNumber.value); array.push(txtProjName.value); array.push(getTotal()); document.getElementById("scores").innerHTML += "&lt;br \&gt;" + array.join(', '); }
downvote count: 0
type: Answer

http://stackoverflow.com/comment/42369512
type: Comment
has text: I dont know, but I just need to make a job when the comparison is true, just like an event listener on this condition. What's new with Date class ?
comment on: http://stackoverflow.com/q/26909924
score: 0
type: QuestionComment

http://stackoverflow.com/comment/55858844
has text: Snippet doesn't do anything
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28829494
type: Comment

http://stackoverflow.com/comment/42520318
comment on: http://stackoverflow.com/q/26991330
type: Comment
type: QuestionComment
has text: Ah, is this more performant or just a better coding style?
score: 0

http://stackoverflow.com/a/27120533
score: 0
type: Answer
has body: How to deal with the StackOverflowError: The simplest solution is to carefully inspect the stack trace and detect the repeating pattern of line numbers. These line numbers indicate the code being recursively called. Once you detect these lines, you must carefully inspect your code and understand why the recursion never terminates. If you have verified that the recursion is implemented correctly, you can increase the stack’s size, in order to allow a larger number of invocations. Depending on the Java Virtual Machine (JVM) installed, the default thread stack size may equal to either 512KB, or 1MB. You can increase the thread stack size using the -Xss flag. This flag can be specified either via the project’s configuration, or via the command line. The format of the -Xss argument is: -Xss&lt;size&gt;[g|G|m|M|k|K] By the way it seems a eclipse bug(Read this ref) which has been fixed in the latest version.
answers question: http://stackoverflow.com/q/26911263

http://stackoverflow.com/comment/42257609
type: Comment
has text: `x` should start from `1` not `0`
comment on: http://stackoverflow.com/q/26847366
score: 4
type: QuestionComment

dialog
tag name: dialog
type: Tag
tags question: http://stackoverflow.com/q/26912876
tags question: http://stackoverflow.com/q/26913085

http://stackoverflow.com/a/26961076
has comment: http://stackoverflow.com/comment/112770592
downvote count: 0
score: 14
upvote count: 14
has body: You have to add the attributes width and height to your canvas. These properties should be the same you set the respective css properties. See Canvas is stretched when using CSS but normal with "width" / "height" properties for more information on this. Change to
answers question: http://stackoverflow.com/q/26960931
has comment: http://stackoverflow.com/comment/42460987
type: Answer

http://stackoverflow.com/q/26891695
accepted answer: http://stackoverflow.com/a/26891746
has title: jQuery AJAX php 'post' returning actual PHP code
has comment: http://stackoverflow.com/comment/42339021
has comment: http://stackoverflow.com/comment/43139805
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42337216
has comment: http://stackoverflow.com/comment/42340157
has body: I'm unsure how I broke this; it was working previously but now is not. From within an HTML file, I'm making a POST call to a php file (which then grabs data from a REST API), but instead of returning any API data, what I get returned is the actual PHP code. jQuery AJAX in HTML page: $.ajax({ type: "post", url: "api.php", data: {code: event.data.node.id} }) api.php: &lt;?php $username='[my_username]'; $password='[my_password]'; $code = $_POST['code']; $URL='https://services.onetcenter.org/ws/online/occupations/' . $code . '/details/'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$URL); curl_setopt($ch, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_setopt($ch, CURLOPT_USERPWD, "$username:$password"); $status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); //get status code $result=curl_exec ($ch); curl_close ($ch); echo $result; ?&gt; What I get returned appears to be a string of the PHP code above, rather than the result of the API call. What's going on here? If you need any more information, I'd be happy to help you help me! EDIT: The second code excerpt was mislabeled as in an HTML file. In fact, the php is within api.php. Sorry!
has answer: http://stackoverflow.com/a/26891746
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/42337258
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/42231714
comment on: http://stackoverflow.com/q/26832580
has text: Possible duplicate of http://stackoverflow.com/questions/9229645/remove-duplicates-from-javascript-array
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26983347
score: 0
answer count: 1
type: UnansweredQuestion
tagged with: elasticsearch
type: Question
has body: I would like to create an ElasticSearch model which looks inside 3 distinct indices. The code I have for just one index is: var searchModel = new ElasticSearchModel({ search_url: "http://localhost:9002/myIndex/doc/_search" }); var searchApp = new SearchApp({model: searchModel, el: $("#resultsNew")}); I would like, if possible, to specify 3 distinct search_urls and append them the same searchApp. I have tried specifying lists for the model and el properties of the SearchApp, but it did not work. Are there any workarounds for this? Thank you!
tagged with: javascript
has answer: http://stackoverflow.com/a/26984177
has title: ElasticSearch - search inside 3 indices from Javascript

http://stackoverflow.com/a/26862928
has comment: http://stackoverflow.com/comment/42286050
answers question: http://stackoverflow.com/q/26861986
score: 0
type: AcceptedAnswer
has body: Seems that the API for the link is starting on index 1 which is not taken into consideration when fetching the next page. Try updateScript(start*max + 1, max);
type: Answer
accepted answer of: http://stackoverflow.com/q/26861986

http://stackoverflow.com/a/26903215
score: 4
has comment: http://stackoverflow.com/comment/43010131
has comment: http://stackoverflow.com/comment/43017737
accepted answer of: http://stackoverflow.com/q/26903153
has body: Just set disabled="disabled" and readonly="readonly" attributes: // Attach the click handler $(".silver_button_big").on("click", function() { var $this = $(this); // Disable button $this.attr({"disabled": "disabled", "readonly": "readonly"}); // Do something async setTimeout(function() { // Enable the button back $this.removeAttr("disabled readonly"); }, 1000); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;input type="button" value="Click me" class="silver_button_big"&gt; Note that it's recommended not to use empty attribute values.
type: Answer
answers question: http://stackoverflow.com/q/26903153
has comment: http://stackoverflow.com/comment/43015871
upvote count: 4
has comment: http://stackoverflow.com/comment/42357956
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/42505298
has text: Well, the scroll effect is like parallax. Definitely not traditional parallax. But how is even the animation advancing on scroll. Thing is I have a bunch of animators in my team, so I need to take a call if something on the lines of sony website is do-able merging parallax. If yes, please let me know.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26985814

http://stackoverflow.com/comment/52268030
type: QuestionComment
has text: If it's fixed, can you add the solution here so others can benefit from it please? I'm having the same problem.
comment on: http://stackoverflow.com/q/26921489
score: 0
type: Comment

http://stackoverflow.com/comment/42312384
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/26877597
type: Comment
has text: plus, you need to manually implement the special cases (e.g. Date, Array, etc.)

http://stackoverflow.com/comment/42406250
type: QuestionComment
comment on: http://stackoverflow.com/q/26930440
type: Comment
score: 0
has text: The point is only to submit all which are checked.

http://stackoverflow.com/comment/42339322
type: AnswerComment
has text: Works perfectly, thanks very much. It's really hard to comprehend the name value (which i've always expected to be string only) as an array though. Really odd, but thanks :)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26892230

http://stackoverflow.com/q/26940221
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/26940916
type: Question
tagged with: object
has title: Report of object comparison
tagged with: javascript
has answer: http://stackoverflow.com/a/26940916
upvote count: 1
downvote count: 0
answer count: 1
has body: Any built functions in javascript (or someone who shared an open source function) to compare two objects? and get a report saying what was added, removed, and what keys had values changed? for basic example: (my real case has more nested/complicated objects) var o1 = {a: true, b: false, c: false, z: {a:false}} var o2 = {b:'hi', c:false, d: 5, z:{a:true,b:false}} so comparing o2 to o1: i was hoping output like this: var changes = {a:{was:true,is_now:null}, b:{was:false,is_now:'hi'}, d:{was:null,is_now:5},z:{a:{was:false,is_now:true},b:{was:null,is_now:false}}} OR could return three objects. var keysAdded = ['d', 'z.b'] var keysRemoved = ['a']; var keyValPairOfChanges = {b:{was:false,is_now:true}, 'z.a':{was:false,is_now:true}} any ideas? thanks!
favorite count: 0
tagged with: compare

http://stackoverflow.com/comment/42491801
type: Comment
has text: lets say i have a parent thats called account and inside i have tabs children like personal info, purchases... so when user click on my account in the top nav bar the link is: so he goes directly to this child view.
type: AnswerComment
comment on: http://stackoverflow.com/a/26977126
score: 0

http://stackoverflow.com/a/26842140
downvote count: 0
score: 1
upvote count: 1
has body: A little late, but here is a some code which does what you want: JSfiddle. HTML: Button for f1 JS: function f1() { $(document).off('click').on('click', foo); } var foo = function () { $('button').show().click(f2); }; function f2(e) { e.stopPropagation(); $(document).off('click', foo).on('click', bar); } var bar = function () { $('button').hide(); f1(); }; f1();
type: Answer
answers question: http://stackoverflow.com/q/26841163

http://stackoverflow.com/q/26850567
has body: I'm unable to get my AJAX request to work. I'm able to receive data from the php, but I'm unable to send data to it. JAVASCRIPT &lt;script type="text/javascript"&gt; $("#btnSubmit").click(function() { $.ajax({ type: 'POST', url: 'checkinfo.php', data: { address: "37.187.139.123", port: "26618" }, dataType: 'json', async: true, success: function(data) { alert(data); } }); }); PHP &lt;?php $SERVER_IP = $_REQUEST['address']; $SERVER_PORT = $_REQUEST['port']; $QUERY_PORT = $_REQUEST['port']; $HEADS = "3D"; $show_max = "unlimited"; $SHOW_FAVICON = "on"; $TITLE = "My fancy Serverpage"; $TITLE_BLOCK_ONE = "General Information"; $TITLE_BLOCK_TWO = "Players"; $ping = json_decode(file_get_contents('http://api.minetools.eu/ping/' . $SERVER_IP . '/' . $SERVER_PORT . ''), true); $query = json_decode(file_get_contents('http://api.minetools.eu/query/' . $SERVER_IP . '/' . $QUERY_PORT . ''), true); if(empty($ping['error'])) { $version = $ping['version']['name']; $online = $ping['players']['online']; $max = $ping['players']['max']; $motd = $ping['description']; $favicon = $ping['favicon']; } if(empty($query['error'])) { $playerlist = $query['Playerlist']; } echo $SERVER_IP; ?&gt; I tried setting $SERVER_IP = "1"; and successfully got the alert "1" when clicking on my button, so the location is definitely correct. But the data: on somehow doesn't want to pass through, and I have no clue why. I have also tried using $_POST instead of $_REQUEST.
has answer: http://stackoverflow.com/a/26850708
type: Question
has title: Unable to pass variable from javascript to PHP and back
answer count: 2
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
possible better answer: http://stackoverflow.com/a/26850708
has answer: http://stackoverflow.com/a/26850619
accepted answer: http://stackoverflow.com/a/26850619
tagged with: php
type: AnsweredQuestion

http://stackoverflow.com/comment/72998955
comment on: http://stackoverflow.com/a/26965332
score: 0
type: AnswerComment
has text: this is not working. I typed greek question mark using alt+59
type: Comment

http://stackoverflow.com/q/26957901
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
has answer: http://stackoverflow.com/a/26958056
has title: Span inside Action Link
downvote count: 1
type: Question
answer count: 2
has body: I want to use bootstrap span icon in Action link here is examples $actions .= "url->link('seller/account-product/delete', 'product_id=' . $product['product_id'], 'SSL') ."' class='btn btn-primary btn-danger' title='" . $this->language->get('ms_delete') . "'>"; and i want to add this into
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26958624
has answer: http://stackoverflow.com/a/26958624
accepted answer: http://stackoverflow.com/a/26958056
score: 0
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
upvote count: 1
tagged with: php

http://stackoverflow.com/comment/42394246
type: AnswerComment
has text: In this case, I need not make use of `$when`. I can make Ajax call and on the success of it, i can make second ajax call if required (based on some condition).
type: Comment
comment on: http://stackoverflow.com/a/26923526
score: 2

http://stackoverflow.com/q/26855971
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/26856202
tagged with: css
type: AnsweredQuestion
score: 1
upvote count: 1
has title: jQuery Gallery, click event not firing after page change
accepted answer: http://stackoverflow.com/a/26856202
type: Question
tagged with: pagination
tagged with: javascript
tagged with: click
has body: I am working on a jQuery Gallery and I recently added a pagination to it and found that whilst my on('click') events worked fine when the display function is initially called, once you change pages (reload a display function to display array data with new start and end variables) my on('click') events ceased to work. Swapping back to the original page doesn't make it work again. I have tried swapping .on("click") for .click(), also removing the .empty() command so that the page just continues to add new items to the list, and a few other changes but I am still unable to work out what the problem is. Fiddle: http://jsfiddle.net/fw37y69h/ HTML Next Previous JS $(document).ready(function(){ // Function that generates the display var displayGal = function(start,stop) { // For each item between the passed start and stop variables, increment through the imgListArr array // And create the HTML dynamically within the jGalImageList div. for(var i = start; i < stop; i++) { $('#jGalImageList').append(' ' + imgListArr[i].name + ''); console.log(imgListArr[i]); } } // Array of object items var imgListArr = [ { id: "image1", name: "Cute Puppy", url: "img/puppies.jpg", thumbUrl: "img/puppies-sm.jpg", description: "A lovely picture of a puppy." }, { id: "image2", name: "Hungry Kitty", url: "img/kittens.jpg", thumbUrl: "img/kittens-sm.jpg", description: "Cats are okay I guess." }, { id: "image3", name: "Mr Turtle", url: "img/turtles.jpg", thumbUrl: "img/turtles-sm.jpg", description: "All hail our new turtle overlords." }, { id: "image4", name: "Magestic Deer", url: "img/deer.jpg", thumbUrl: "img/deer-sm.jpg", description: "Cats are okay I guess." }, { id: "image5", name: "Duck Army", url: "img/ducks.jpg", thumbUrl: "img/ducks-sm.jpg", description: "All hail our new turtle overlords." }, { id: "image6", name: "Sleepy Pelicans", url: "img/pelicans.jpg", thumbUrl: "img/pelicans-sm.jpg", description: "Cats are okay I guess." }, { id: "image7", name: "Monkey Family", url: "img/monkeys.jp…

http://stackoverflow.com/comment/42300904
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26871152
has text: You can do it in `serialize`.

http://stackoverflow.com/q/26893234
score: 0
answer count: 1
has title: javascript post can't find php file in include directory
has comment: http://stackoverflow.com/comment/42340574
has answer: http://stackoverflow.com/a/26893416
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42341358
tagged with: php
has body: For security, I have gotten in the habit of placing php files in the default php include directory. On Red Hat based distros this is /usr/share/php. All my web page files (html php) find this directory with out problem. It is not even necessary to add a path to the file name. When writing javascript, such as a form which POST to a php file, the script can not find php files in the php include directory. I'm guessing this is because of cross domain request or same origin policy? I'd rather not place the php files in the web site's directory. Is there a work around which won't destroy the security benefits of placing php files in the default include directory?
type: Question
tagged with: javascript

http://stackoverflow.com/comment/44133620
type: Comment
comment on: http://stackoverflow.com/q/26946535
has text: @Gavin I am having the same issue. Console log shows finished as true, while alm.finished is false. Have you had any luck?
score: 0
type: QuestionComment

http://stackoverflow.com/a/30840636
downvote count: 0
score: 1
type: Answer
upvote count: 1
has body: Just change substring function like this: var substringMatcher = function (strs) { return function findMatches(q, cb) { // an array that will be populated with substring matches var matches = []; // regex used to determine if a string contains the substring `q` //var substrRegex = new RegExp(q, 'i'); // we use starts with instead of substring var substrRegex = new RegExp('^' + q, 'i'); // iterate through the pool of strings and for any string that // contains the substring `q`, add it to the `matches` array $.each(strs, function (i, str) { if (substrRegex.test(str)) { matches.push(str); } }); cb(matches); }; };
answers question: http://stackoverflow.com/q/26974309

http://stackoverflow.com/q/26989860
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/26990062
possible better answer: http://stackoverflow.com/a/26989894
tagged with: javascript
has answer: http://stackoverflow.com/a/26989894
has comment: http://stackoverflow.com/comment/42511314
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/8579108
has title: jQuery selector for element with mulitple classes not working
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26990062
duplicate of: http://stackoverflow.com/q/8579108
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42511354
upvote count: 1
has body: HTML: The third div element. This is some text in a paragraph. Selector: $('*[class^=someclass]') This selector works on , but not on . Why would that be? jsfiddle link Edit: corrected typo

http://stackoverflow.com/a/26901097
type: Answer
has comment: http://stackoverflow.com/comment/42355865
has body: Your javascript seems horrible, but alas, wrong "Access-Control-Allow-Origin" is a server-sided (php?) bug, sorry. tell the server guys to add something like header("Access-Control-Allow-Origin: *"); to see if your javascript is correct ^^ on a sidenote, alert("Error 1"); should probably use console.log or throw new Error() instead.. why have xmlHttp as a global, can just use process(e){ var xhr=e.target;...} instead don't do this setTimeout('process()', 1000); , do setTimeout(process, 1000);
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26900938
accepted answer of: http://stackoverflow.com/q/26900938

ecmascript-harmony
tag name: ecmascript-harmony
type: Tag
tags question: http://stackoverflow.com/q/26902994

http://stackoverflow.com/q/26847558
favorite count: 0
has answer: http://stackoverflow.com/a/26872075
type: UnansweredQuestion
upvote count: 1
tagged with: jquery-ui
has comment: http://stackoverflow.com/comment/42263086
score: 1
has comment: http://stackoverflow.com/comment/42263419
has title: How do i give a new loaded Element a JQuery UI Tooltip?
has comment: http://stackoverflow.com/comment/42262843
type: Question
has body: I have an almost empty HTML file with all the JS and Css files included. Then i load a content page in it. Some of them contain Usernames where i want to add a tooltip Most of them look like this : Username $( document ).on("load", "user", function(){ $(this).tooltip({ content : "loading...", open : function(){ var elem = $(this) $.ajax("UserInfoToolTipContent.jsp?id="+$(this).attr("uid")).success(function(data){ elem.tooltip("option", "content", data); }); } }); }); Is this the way to do it? Because it is not working and i dont receive any error messages
answer count: 1
downvote count: 0
tagged with: jquery-tooltip
tagged with: javascript
tagged with: jquery

c3.js
tags question: http://stackoverflow.com/q/26878054
tag name: c3.js
type: Tag

http://stackoverflow.com/comment/42337874
type: Comment
has text: how does that break MVC? I'm unclear. You can pass the key in the function, or you can pass the entire object in the click function and read the key.
comment on: http://stackoverflow.com/a/26891839
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42451286
score: 0
type: AnswerComment
has text: Check my updated answer. I have included variant too. You can accept the answer. Happy Coding..
type: Comment
comment on: http://stackoverflow.com/a/26955720

http://stackoverflow.com/q/26853809
has answer: http://stackoverflow.com/a/26853972
has answer: http://stackoverflow.com/a/26853914
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/26854274
has body: This is the code I have so far.No idea what syntax to use to get the border to change in that small table. I know my code doesn't work. I just need some help on getting the bordernumber variable to change the border of the table. 100 200 300 400 `
answer count: 4
has comment: http://stackoverflow.com/comment/42270227
type: UnansweredQuestion
has title: Changing a table border of html using javascript switch?
has answer: http://stackoverflow.com/a/26853941
type: Question

http://stackoverflow.com/comment/42375427
comment on: http://stackoverflow.com/q/26912976
type: Comment
type: QuestionComment
score: 0
has text: Fall back to something that's *usable*; if the browser can't support all the visual design elements, forget about making it pretty and just make sure it's possible for the user to make use of the page features.

http://stackoverflow.com/q/26957304
type: UnansweredQuestion
has body: I had a simple SPA and then after following Andrew Connel course on pluralsight (2nd module), I have some error. Basically the 2nd module is to create a config exception handler and a global config object. It seems I am missing something, but cant figure out what exactly. index.html file | Acme Product Management Toggle navigation Product List Add Product App.js (function () { "use strict"; var app = angular.module("productManagement", ["common.services", "ui.router", "ui.mask", "ui.bootstrap", "angularCharts"]); app.config(function ($provide) { $provide.decorator("$exceptionHandler", ["$delegate", function ($delegate) { return function (exception, cause) { exception.message = "Please contact the Help Desk! \n Message: " + exception.message; $delegate(exception, cause); alert(exception.message); }; }]); }); app.config(["$stateProvider", "$urlRouterProvider", function ($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise("/"); $stateProvider .state("home", { url: "/", templateUrl: "../Scripts/app/welcomeView.html" }) // Products .state("productList", { url: "/products", templateUrl: "../Scripts/app/products/productListView.html", controller: "ProductListCtrl as vm" }) .state("productEdit", { abstract: true, url: "/products/edit/:productId", templateUrl: "../Scripts/app/products/productEditView.html", controller: "ProductEditCtrl as vm", resolve: { productResource: "productResource", product: function (productResource, $stateParams) { var productId = $stateParams.productId; return productResource.get({ productId: productId }).$promise; } } }) .state("productEdit.info", { url: "/info", templateUrl: "../Scripts/app/products/productEditInfoView.html" }) .state("productEdit.price", { url: "/price", templateUrl: "../Scripts/app/products/productEditPriceView.html" }) .state("productEdit.tags", { url: "/tags", templateUrl: "../Scripts/app/products/productEditTagsView.html" }) .state("productDetail", { url: "/products/:productId", templateUrl: "../Scripts/app/pr…
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/42453935
score: 0
has title: Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.3.2/$injector/modulerr?p0=productManagement
has comment: http://stackoverflow.com/comment/42454674
has comment: http://stackoverflow.com/comment/42454637
answer count: 0
tagged with: angularjs

http://stackoverflow.com/comment/42419859
comment on: http://stackoverflow.com/q/26937329
score: 0
type: Comment
type: QuestionComment
has text: One thing that is definitely a problem is the line `navigationMenu.prototype.reset.call(me, subMenu, (3 - colorIndex), colors);` in menu.js. That is calling the `reset` function with `navigationMenu.prototype` as `this`. You need to do var me=this as the first statement in `reset()` and change that line to `me.reset(subMenu(3-colorIndex), colors)`. It doesn't fix the problem, but it's definitely wrong.

http://stackoverflow.com/a/26914776
has body: Start with a clean project and start playing with it. I recommend you to use the yeoman generator. https://www.npmjs.org/package/generator-protractor
answers question: http://stackoverflow.com/q/26894468
type: Answer
downvote count: 1
upvote count: 0
has comment: http://stackoverflow.com/comment/42492962
score: -1

http://stackoverflow.com/comment/42479361
score: 0
has text: click do not do any with that plnkr
comment on: http://stackoverflow.com/q/26968909
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26912829
has comment: http://stackoverflow.com/comment/42375165
linked to: http://stackoverflow.com/q/9524458
has answer: http://stackoverflow.com/a/26913033
upvote count: 2
tagged with: innerhtml
score: 2
type: AnsweredQuestion
has title: return image as HTML
has comment: http://stackoverflow.com/comment/42375061
tagged with: image
has comment: http://stackoverflow.com/comment/42377050
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/42375083
has comment: http://stackoverflow.com/comment/42375092
linked to: http://stackoverflow.com/q/11266104
has answer: http://stackoverflow.com/a/26912890
downvote count: 0
accepted answer: http://stackoverflow.com/a/26912890
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/26913033
has body: trying to add an image to my innerHTML. Looked at a few prvious Q's Why does my image not show up when I use Javascript innerHTML to call it? Javascripts innerHTML not working for images, but works with text? I cant get it working, in google dev tools throws the error: Uncaught TypeError: Cannot set property 'innerHTML' of null with this line: var newImage = document.getElementById('img').innerHTML = "&lt;img src='images/bg-main.png&gt;&lt;/img&gt;"; my code looks like: function showImage() { var img = document.createElement('image'); //var newImage = document.getElementById('img').innerHTML = "&lt;a href='#'&gt;&lt;img src='http://mintywhite.com/wp-content/uploads/2012/10/fond-ecran-wallpaper-image-arriere-plan-hd-29-HD.jpg' border=0/&gt;&lt;/a&gt;"; var newImage = document.getElementById('img').innerHTML = "&lt;img src='images/bg-main.png&gt;&lt;/img&gt;"; var div5 = document.createElement('div'); div5.appendChild(newImage); return div5.innerHTML; } I know there are many other methods to display an image, but for the purpose of this exercise I want to return the image as an innerHTML

http://stackoverflow.com/comment/42423793
has text: Why do you need `textNodes` at all?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26939785

http://stackoverflow.com/q/26983661
tagged with: javascript
tagged with: jquery
score: -1
tagged with: ajax
has title: $.get doesn't seem to do anything
answer count: 1
has body: It tried to run the following code: $.get({ url: '/proxy/playing', success: function(data) { console.log('Data received: ' + data); }, error: function(e) { console.log('Error occured!'); } }); It never reaches success or error. I tried everything, using $.ajax or XmlHttpRequest. In all scenario's no success or error callbacks are being called. I just don't see what I'm doing wrong here. These article's I based my code on: Docs $.get Docs $.ajax Docs XmlHttpRequest
favorite count: 0
has answer: http://stackoverflow.com/a/26983684
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42501328
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/42501356
upvote count: 0
has comment: http://stackoverflow.com/comment/42501394
accepted answer: http://stackoverflow.com/a/26983684

http://stackoverflow.com/a/26864512
answers question: http://stackoverflow.com/q/26864412
has body: &lt;? and ?&gt; are shorthand for PHP tags. Why do you want them in an HTML string? Try to wrap them in quotes.
score: 0
has comment: http://stackoverflow.com/comment/42288582
type: Answer

http://stackoverflow.com/comment/42343427
comment on: http://stackoverflow.com/q/26894542
has text: @royhowie what do you mean exactly?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42416667
type: Comment
has text: Comments are not for extended discussion; this conversation has been [moved to chat](http://chat.stackoverflow.com/rooms/64961/discussion-on-answer-by-ariel-556-the-tty-js-shell-does-not-render-when-i-make-i).
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26935390

http://stackoverflow.com/comment/42407731
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26931274
score: 0
has text: You could try with jQuery dot dot dot. http://dotdotdot.frebsite.nl/

http://stackoverflow.com/a/26867257
has body: If you're making a request through ajax to login, I believe your api might need to return a reponse that lets your front end app know to redirect, and then redirect in javascript. Using angular on success you should be able to change location using $location
score: 1
has comment: http://stackoverflow.com/comment/42293784
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42293999
type: Answer
has comment: http://stackoverflow.com/comment/42297803
accepted answer of: http://stackoverflow.com/q/26867156
answers question: http://stackoverflow.com/q/26867156
upvote count: 1

http://stackoverflow.com/comment/42498129
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26981838
type: Comment
has text: @Mathletics honestly, you probably enjoyed that downvote more than I did answering this question. I'm done answering questions here. Deleting my account in a few days.

http://stackoverflow.com/comment/42287986
comment on: http://stackoverflow.com/q/26864084
type: Comment
has text: put the code on fiddle to test
score: 0
type: QuestionComment

http://stackoverflow.com/q/26876497
tagged with: regex
has comment: http://stackoverflow.com/comment/42340507
has answer: http://stackoverflow.com/a/26897789
upvote count: 3
answer count: 1
tagged with: recursion
has comment: http://stackoverflow.com/comment/42312941
accepted answer: http://stackoverflow.com/a/26897789
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
has body: I am trying to convert an OData filter string into an object that represents the filter. Below is an example of a complex (non-realistic) OData filter that I'd like to convert. substringof('v', p1) or (p2 gt 5 and p3 eq 'v v' and (p4 eq false or startswith(p5.expand, 'v'))) or (p6 eq 6 and p7 eq 7) Using the regex and function below, I have broken this into two parts: an array of filter parts and a string with each filter part replaced by the index in the array. var conditionMatcher = new RegExp("(substringof\\(.+?\\)|startswith\\(.+?\\)|endswith\\(.+?\\)|[\\w\\.]+?\\s(?:eq|ne|gt|ge|lt|le)\\s(?:\\w+|\\'.+?\\'))", "g"); var filters = predicateString.match(conditionMatcher); var i = 0; var simpleString = predicateString.replace(conditionMatcher, function () { return i++; }); // simpleString = 0 or (1 and 2 and (3 or 4)) or (5 and 6) The goal is to convert the string to something like this: { op: "or", filters: [ 0, { op: "and", filters: [ 1, 2, { op: "or", filters: [ 3, 4 ] } ] }, { op: "and", filters: [ 5, 6 ] } ] } I'm just not sure how to get here. If anyone has ideas, it would be much appreciated while I continue to work through a solution.
tagged with: odata
favorite count: 0
type: Question
score: 3
has title: JS Parse OData $filter string into Object Structure

http://stackoverflow.com/a/26917984
score: 0
type: Answer
has body: Something like this iterating through each idea: add &lt;div id="someID"&gt;&lt;/div&gt; Then instead of hard coding 3 use list.length and list[i].length then do: var list = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; var temp = ""; for (i = 0; i &lt; list.length; i++) { for (j = 0; j &lt; list[i].length; j++) { temp+=list[i][j] + " "; } temp+="&lt;br&gt;"; } document.getElementById("someID").innerHTML = temp; Working JSFiddle: http://jsfiddle.net/0k1tf5wh/ Hope this helps!!
answers question: http://stackoverflow.com/q/26917909

http://stackoverflow.com/comment/42359225
type: Comment
has text: You need to clarify your question. Show some code. Then I can help you in a more personalized way. This answer was firefox extension related just a by the way.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26895911

http://stackoverflow.com/q/26918853
type: Question
has body: I am trying to check the result from a function and determine where on my page it should go by using the Session Variable "alernativeRD". It goes to the correct element on the first try, but after that it keeps going only to the first element regardless of whether its right or not. After some testing I've found that "alernativeRD" does get changed every time in the PHP function, but it doesn't change in the Javascript part. PHP PART function firstSignInDefault(){ global $con; $clubUsername= $_SESSION['clubUsername']; $_SESSION['alternativeRD']='false'; //sets it back to false to avoid having alternativeRD be true for next user $lastName= mysqli_real_escape_string($con, $_POST['lastNameF']); $firstName= mysqli_real_escape_string($con, $_POST['firstNameF']); $memberID= mysqli_real_escape_string($con, $_POST['idNumberF']); if(!(is_numeric($memberID))){ die(" Student ID must be a number "); } $getMemberRow= mysqli_query($con, "SELECT * FROM memberstable WHERE MemberMadeID='$memberID' AND Club='$clubUsername'"); if(mysqli_num_rows($getMemberRow)==0){ $sql="INSERT INTO memberstable (MemberMadeID,FirstName,LastName,Club) VALUES ('$memberID','$firstName','$lastName', '$clubUsername')"; $test=false; //checks to make sure sql statement runs fine if(mysqli_query($con,$sql)) $test=true; else { echo " Error running sql "; } $date=date("Y-m-d h:i:sa"); $getMemberRow= mysqli_query($con, "SELECT * FROM memberstable WHERE MemberMadeID='$memberID' AND Club='$clubUsername'"); $memberRowArray=mysqli_fetch_array($getMemberRow); $memberPanID=$memberRowArray['UniquePanDBID']; $sql2="INSERT INTO signinstable (TimeOfSignIn, UniquePanDBID, ClubUsername, FirstName, LastName) VALUES ('$date','$memberPanID','$clubUsername', '$firstName', '$lastName')"; //THE FOCUS OF THIS QUESTION IS BELOW THIS COMMENT if(mysqli_query($con, $sql2) && $test==true){ $_SESSION['alternativeRD']='true'; echo " ".$date. " ".$firstName ." ". $lastName ." "; } } else { echo " ID Number already in use "; } } JAVASCRIPT/…
score: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26918931
tagged with: php
has title: Session variable not being updated after being used
has comment: http://stackoverflow.com/comment/42385989
upvote count: 1
has comment: http://stackoverflow.com/comment/42385960
downvote count: 1

code-generation
tag name: code-generation
tags question: http://stackoverflow.com/q/26854950
type: Tag

http://stackoverflow.com/comment/42354335
type: AnswerComment
comment on: http://stackoverflow.com/a/26877671
has text: Hi, thanks for replying immediately. :) I checked it and tried creating a function.
type: Comment
score: 0

http://stackoverflow.com/comment/42235383
type: Comment
has text: Are you sure all the code is inlined? Take a look at the position (line number, column number) of where `a` is not defined.
score: 1
comment on: http://stackoverflow.com/q/26834648
type: QuestionComment

http://stackoverflow.com/comment/42346030
comment on: http://stackoverflow.com/a/26896239
type: AnswerComment
score: 0
has text: You might want to look at the MVC pattern.
type: Comment

http://stackoverflow.com/comment/42384444
comment on: http://stackoverflow.com/a/26916163
score: 0
type: Comment
has text: The thing is that i need to show only one item at the time, so would be better just to store index, and use it somehow, not need for array actually. and what do you think about putting ng-controller="myCtrl" together with ng-repeat, that would make scope working.... but i do not know what the consequeces are;)
type: AnswerComment

http://stackoverflow.com/q/26947583
type: Question
answer count: 1
tagged with: javascript
has body: I tried to make a search-bar for my current project. Here is the current HTML: &lt;input type="text" id="searchbar"/&gt; The CSS is for now not important... I made it possible to find files/folders from server: If you hit enter, JavaScript sends a $.post() Here is my Javascript: $.post( "files/openFolder.php",{folder : $searchtext}, function() { }) .success(function(data) { if(data != "") { if(data.indexOf("folder:") &gt; -1){ //contains folders..! foundedFolders = data; myfolders = foundedFolders.split(/[folder:&amp;]/); myfolders = cleanArray(myfolders); generateFolderBoxes(myfolders); folderBoxSettings(); }else if(data.indexOf("file:") &gt; -1){ // contains files..! foundedFiles = data; myfiles = foundedFiles.split(/[file:&amp;]/); myfiles = cleanArray(myfiles); //cleans the Array from empty Strings. generateFileBoxes(myfiles); fileBoxSettings(); } } }) .fail(function() { alert("Sorry doesn't worked, try later again."); }); My problem is here: myfolders = foundedFolders.split(/[folder:&amp;]/); and myfiles = foundedFiles.split(/[file:&amp;]/); PHP-Output: "folder:****&amp;file:*****&amp;file:*****&amp;" I read this stackoverflow, to get the foldernames, or file: Get Substring between two characters using javascript The Reg-Expression outputs: ["such", " - Kop", ".txt", "such", ".txt", "t", "st - Kop", ".txt", "t", "st.txt"] But normaly it should be: ["suche - Kopie.txt","suche.txt","test - Kopie.txt","test.txt"] These "filenames" are needed to display them.. Thanks for helping :D
tagged with: string
score: 0
has answer: http://stackoverflow.com/a/26949664
tagged with: regex
accepted answer: http://stackoverflow.com/a/26949664
has title: Get EVERY String between two words
tagged with: php
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/14867835
tagged with: substring

admob
tags question: http://stackoverflow.com/q/26948134
tags question: http://stackoverflow.com/q/26975091
type: Tag
tag name: admob

http://stackoverflow.com/comment/42246322
type: AnswerComment
comment on: http://stackoverflow.com/a/26840500
has text: The first argument should be a file descriptor, that is, the result of `fs.open(filename, "w", callback)`. `fs.write` does support passing a string as the first argument.
type: Comment
score: 1

http://stackoverflow.com/comment/42416589
type: AnswerComment
comment on: http://stackoverflow.com/a/26933452
has text: do you mean like when i click rotate, another canvas with the picture rotate 90 appear at the bottom of it.?? Do the original picture rotate or stay still?
type: Comment
score: 0

http://stackoverflow.com/comment/82522379
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/47780199
has text: I would expand on why this approach works and what advantages it has to other approaches.
score: 0

http://stackoverflow.com/comment/42380937
has text: Your problem is that the `$_GET['q']` is always set and not empty when it should be. If you use the same variables for your different research as i suggested and do the right request based on the type of reseach you will avoid your problem.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26913945
score: 0

http://stackoverflow.com/comment/42456202
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26958451
score: 0
has text: The following answer may be helpful to you: http://stackoverflow.com/questions/16063394/prototypical-inheritance-writing-up/16063711#16063711

http://stackoverflow.com/q/26960344
favorite count: 0
has body: I am new to Javascript and have a question about using inheritance with it This article has been helpful so far (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model#More_flexible_constructors), but the behaviour I am observing in Chrome's debugger does not seem to be matching what I'd expect to see. I have two cases: Base = function () { this.value = 0; }; Base.prototype.constructor = Base; Derived = function () { Base.call(this); }; Derived.prototype = new Base(); Derived.prototype.constructor = Derived; In the debugger I see this: After stepping over the assignment, I see this The value in the instance has changed but the value in the prototype has not. Is this to be expected? The second approach I do not quite understand is this (referenced here again - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model#More_flexible_constructors (see the code snipped at the bottom of section 'Property Inheritance Revisited') Base = function () { }; Base.prototype.constructor = Base; Base.prototype.value = 0; // Derived as before... and after the assignment Value has been added as a new property. Shouldn't this have changed the value in the prototype? Or do I explicitly need to access the value by going through the prototype - e.g. derived.value.prototype.value = 5 Any information on this would be greatly appreciated! Thanks! UPDATE: Thank you to everyone who responded, it turns out it was to do with my not using Object.create at the appropriate time. I updated my code to this: and in the debugger I got what I expected: This looks right! :) Thank you to @sixfingeredman and @Bergi for your help!
answer count: 2
linked to: http://stackoverflow.com/q/16063394
upvote count: 1
tagged with: google-chrome
possible better answer: http://stackoverflow.com/a/26960634
has answer: http://stackoverflow.com/a/26960634
has comment: http://stackoverflow.com/comment/42464671
has title: Is this the behaviour I should expect to see using Javascript prototype inheritance?
has answer: http://stackoverflow.com/a/26960573
downvote count: 0
tagged with: javascript
score: 1
tagged with: inheritance
linked to: http://stackoverflow.com/q/12592913
type: Question
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/26380966
accepted answer: http://stackoverflow.com/a/26960573
has comment: http://stackoverflow.com/comment/42459428

http://stackoverflow.com/a/26862043
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/42284319
has body: .hide() sets styling to display:none. You need to call .show(), instead of .css({visibility:'visible'});
type: Answer
answers question: http://stackoverflow.com/q/26861990
upvote count: 2

http://stackoverflow.com/comment/42487677
type: AnswerComment
has text: Just tried that makes absolutely no difference even when moving the ending up so it just wraps the input
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26976165

http://stackoverflow.com/a/26946264
has body: This is what events are for. HTMLInputElementObject.addEventListener('input', function (evt) { something(this.value); });
has comment: http://stackoverflow.com/comment/138618846
accepted answer of: http://stackoverflow.com/q/26946235
has comment: http://stackoverflow.com/comment/118982405
has comment: http://stackoverflow.com/comment/130562717
type: Answer
downvote count: 3
has comment: http://stackoverflow.com/comment/126728350
answers question: http://stackoverflow.com/q/26946235
has comment: http://stackoverflow.com/comment/75333469
upvote count: 268
has comment: http://stackoverflow.com/comment/120075204
score: 265
has comment: http://stackoverflow.com/comment/103961282
type: AcceptedAnswer

http://stackoverflow.com/a/26899679
has body: in your php: //specify header.. header("content-type:application/json"); //create variables for your values $row['values']; //create oo array arrayResult = array( array("variable-name" =&gt; $variable,"imageURL" =&gt; $imageURL) ); In your html.. //get data using JSON &lt;script type="text/javascript"&gt; $j.getJSON( "cellJson.php", function( json ) { $j.each(json, function(i, item) { //example var imageURL = item.imageURL; //then in your script items_set = [ { src : ''+imageURL+'', url : ''+URL+'', category: ''+DetailCategory+'', title : ''+Name+'' } ]; jQuery('#list').portfolio_addon({ load_count : 1, items : items_set }); }); &lt;/script&gt;
score: 0
answers question: http://stackoverflow.com/q/26899515
type: Answer

http://stackoverflow.com/comment/42368192
type: Comment
comment on: http://stackoverflow.com/a/26908586
score: 0
type: AnswerComment
has text: Please suggest what to use then?

http://stackoverflow.com/q/26940028
has body: This is mostly code written for my by the teacher. I've tried messing about with the first alert to make it work but I can't get it running. I was wonder, in this alert, it is asking for a, b, c etc - where are they coming from? I'm supposed to be able to type in a length in each box to see if that mnakes a right-angled triangle. Area of triangle Enter number 1: Enter number 2: Enter number 3:
has answer: http://stackoverflow.com/a/26940196
score: 0
has answer: http://stackoverflow.com/a/26940220
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42424356
has comment: http://stackoverflow.com/comment/42424394
has title: N00B help - script to check if inputs can make a right-angled triangle. Messed up my alert and don't know if i have variables?
type: Question
answer count: 2
tagged with: javascript

http://stackoverflow.com/comment/42506622
type: QuestionComment
score: 1
has text: In your code What's `key`?
comment on: http://stackoverflow.com/q/26986810
type: Comment

http://stackoverflow.com/comment/42306851
comment on: http://stackoverflow.com/q/26874420
has text: Look at the actual definition of algorithm. Your morning routine could be described as algorithmic.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42330640
score: 0
type: Comment
has text: @myfunkyside Hey thank you soooo much ! Looks like **echo ' ';** did the trick !! :) :) :) It is working ! :) You should post this as an answer ! :)
type: QuestionComment
comment on: http://stackoverflow.com/q/26879501

http://stackoverflow.com/q/26935796
accepted answer: http://stackoverflow.com/a/26936771
answer count: 1
downvote count: 0
tagged with: zingchart
has body: I'm trying to use the transform:date from zingcharts scale objects http://www.zingchart.com/docs/json-attributes-syntax/scale-objects/transform/ to display an epoch date in the x-scale. Some of the epoch dates I'm using are: 1402444800,1402531200,1402617600. Using their Epoch Converter link the results I should be seeing are: 11 Jun 2014, 12 Jun 2014,13 Jun 2014. Instead I get: 17 Jan 1970,17 Jan 1970,17 Jan 1970. Working code is http://jsfiddle.net/Rodmunera/j1ddL5k6/5/ "scale-x": { "transform": { "item": { "visible": false }, "guide": { "visible": false }, "all": " %d %M %Y", "type": "date" }, "decimals": 0, "format": "%v", "mirrored": 0, "text": "Shows", "values": [ 1402444800, 1402531200, 1402617600 ] }, I'm pretty sure I'm implementing this feature properly, can anybody tell me what I'm doing wrong? or if feature
favorite count: 0
type: AnsweredQuestion
score: 1
upvote count: 1
has title: Zing Charts transform epoch dates to human readable
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/26936771

http://stackoverflow.com/comment/42361718
type: Comment
has text: @T.J.Crowder Convenience looks like a good reason, thank you for that explanation. I will drop a mail for sure, always a big fan of your's :)
comment on: http://stackoverflow.com/a/26903975
type: AnswerComment
score: 0

http://stackoverflow.com/comment/42395882
comment on: http://stackoverflow.com/q/26924350
type: Comment
type: QuestionComment
has text: http://stackoverflow.com/questions/3585887/simple-small-pure-javascript-lightbox-dialog-overlay
score: 0

http://stackoverflow.com/q/26841763
linked to: http://stackoverflow.com/q/1760250
linked to: http://stackoverflow.com/q/1060008
has comment: http://stackoverflow.com/comment/42247468
score: 0
has body: I need to detect my current browser tab is changed to another tab or the window is minimized. Simply the operation is to show desktop notification like gmail so that when only i changed the tab or minimized the window the notification of new mail and chat comes. I need to check it through javascript.Is there any method to do this? Thanks in advance.
tagged with: javascript
has comment: http://stackoverflow.com/comment/42247484
linked to: http://stackoverflow.com/q/10328665
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/1038643
tagged with: cross-browser
answer count: 0
has title: How to detect a current browser tab is changes to another tab or the browser window is minimized
type: Question
linked to: http://stackoverflow.com/q/11687142

http://stackoverflow.com/q/26889383
has comment: http://stackoverflow.com/comment/42333431
has comment: http://stackoverflow.com/comment/42333269
tagged with: redis
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42333834
tagged with: node-redis
tagged with: node.js
has body: I have a node application that uses node_redis. Upon application start, a redis client is created, the correct database is selected once, and then this client is used for every request: this.redis = redis.createClient(port, host); this.redis.on('error', function(err) { console.log('Redis error: ' + err); }); this.redis.send_command('SELECT', [database]); Now the problem is: when the connection goes away (for example when redis is manually restarted), node_redis automatically re-connects, but it's on the wrong database, since the SELECTwas not run after re-connecting. I cannot find how to detect this, since the error event also doesn't fire in this case. What should I do?
answer count: 0
type: Question
has title: select correct redis database on reconnect
tagged with: javascript
has comment: http://stackoverflow.com/comment/42334336
score: 0

http://stackoverflow.com/comment/42312275
has text: I think that is correct. We only provide one js file and there are several provided by Shopify so I am pretty sure that's what's happening. I found a solution (see below).
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26877485
score: 1

http://stackoverflow.com/a/26932167
has comment: http://stackoverflow.com/comment/42409369
has body: Just put everything inside a keyup function and submit all the fields, on the next page check which one has input and do whatever you want $('.myinput').keyup(function(){ //eg: var name = $('#name').val(); var email = $('#email').val(); //^variable ^gets value (val()) of field with this id $.ajax({ .... //eg. type : "POST", data : {name : name, email : email} .... }); You have to give your inputfields class="myinput" and, in my example the input for name should have id="name". The keyup function reacts on every keyup event on a formfield with the class "myinput" and will send an ajax request. This line selects $('.myinput').keyup(function(){ //^class ^event
answers question: http://stackoverflow.com/q/26932082
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/42409237

http://stackoverflow.com/comment/42245450
has text: try with this code - http://archive.conductiva.com/en/blog/post/76/Improvement-in-the-Masked-Input-Plugin-for-jQuery
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26840000

http://stackoverflow.com/comment/42413077
has text: You would need to preserve what's already there then. document.getElementById("tableCell").innerHTML = document.getElementById("tableCell").innerHTML + result;
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26933842
type: AnswerComment

http://stackoverflow.com/q/26956411
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42452200
accepted answer: http://stackoverflow.com/a/26956631
has comment: http://stackoverflow.com/comment/42452194
downvote count: 3
has comment: http://stackoverflow.com/comment/42452387
has body: I know this code is already small, but I need help optimizing it as I feel I don't jquery enough to make this code more efficient. So the idea is when you hover over #desno, #loginbox pops out and when you hover over it, it continues to be shown. It gets hidden when your mouse leaves both #desno and #loginbox &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready( function () { $("#desno").mouseover(function () { $("#loginbox").fadeIn("fast"); }); $("#desno").mouseout(function () { $("#loginbox").hide(); }); $("#loginbox").mouseover(function () { $("#loginbox").show(); }); $("#loginbox").mouseout(function () { $("#loginbox").hide(); }); }); &lt;/script&gt; Yeah, any help would be appreciated. I would also love it if you'd explain what and how you did it and what was the thought process behind it.
has comment: http://stackoverflow.com/comment/42452523
has comment: http://stackoverflow.com/comment/42452347
tagged with: javascript
score: -3
has comment: http://stackoverflow.com/comment/42452197
has comment: http://stackoverflow.com/comment/42452335
possible better answer: http://stackoverflow.com/a/26956438
has answer: http://stackoverflow.com/a/26956438
has comment: http://stackoverflow.com/comment/42452427
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26956631
upvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/42452322
favorite count: 0
type: Question
has title: Optimizing the hiding and showing of html elements
answer count: 2

http://stackoverflow.com/q/26982881
has comment: http://stackoverflow.com/comment/42499880
tagged with: javascript
has answer: http://stackoverflow.com/a/26982925
has title: Why NaN is greater than any number in JavaScript?
favorite count: 0
has answer: http://stackoverflow.com/a/26982909
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42499962
downvote count: 1
linked to: http://stackoverflow.com/q/1565164
score: 3
has comment: http://stackoverflow.com/comment/42499891
duplicate of: http://stackoverflow.com/q/1565164
has body: Here is an example: parseInt(50) &gt; parseInt('a'); When executing this on a console, it will return false. My original code looks somewhat like this: variableB = parseInt(jQuery('some-element').html()); if(parseInt(variableA) &gt; variableB) // do something else // do something else Sometimes the some-element will not be filled and thus return NaN. When this happens, I do want the else block to be executed. I am actually getting what I expect, but I just want to make sure that it indeed is intended to work this way.
type: Question
upvote count: 4
answer count: 2
has comment: http://stackoverflow.com/comment/42499887

http://stackoverflow.com/comment/42331829
type: Comment
has text: *"Google open extend links"* I have no clue what that means
comment on: http://stackoverflow.com/q/26888680
score: 0
type: QuestionComment

http://stackoverflow.com/a/26971919
score: 0
has comment: http://stackoverflow.com/comment/42479960
type: Answer
answers question: http://stackoverflow.com/q/26971845
has comment: http://stackoverflow.com/comment/42483274
has body: You need to stop a little. You can use onSubmit, but it's best to delete your input submit and put a button. Then on button click you can do what you want and eventually submit the form Form: Submit JS: $( document ).on( "click", "#submitMailForm", function(e) { //My control Here //If all ok $("#mailForm").submit(); });

http://stackoverflow.com/a/37212926
upvote count: 1
type: Answer
has body: I use this solution var $btn = $("#my_btn"); $btn.popover({ content: '&lt;img src="' + $btn.attr('href') + '"&gt;', html: true, trigger: 'hover', placement: 'left', container: 'body' }) .on("show.bs.popover", function(e){ $(e.target).data("bs.popover").tip().css({"max-width": $btn.data('width') + 50 + "px"}); });
score: 1
answers question: http://stackoverflow.com/q/26904762
downvote count: 0

http://stackoverflow.com/comment/42273526
comment on: http://stackoverflow.com/a/26835201
type: Comment
has text: Although I generally recommend against w3schools.com (they're prolific, but the quality is poor), that page does have a section explaining the difference between objects and arrays, and explaining when to use one versus the other.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42385736
has text: why not just change the label text depending on what is selected? It doesn't appear that you would need 3 separate text boxes, just one textbox and just change the label depending on data you need from the end user.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26916736
type: Comment

http://stackoverflow.com/comment/77144999
type: Comment
score: 6
has text: @Salvador Dali - Do you know what is proper way of allowing cross origin if I am rendering a template instead of just a json object? i.e. last line of code in `yourMethod` is: `return render_template('template.html',some_var = response)`
comment on: http://stackoverflow.com/a/33091782
type: AnswerComment

http://stackoverflow.com/comment/42405900
type: Comment
type: QuestionComment
has text: The removal of the form tags only solved the problem of getting the vars in the URL bar. Still there is no activity registering. Its like the php script is not invoked...
score: 0
comment on: http://stackoverflow.com/q/26927907

http://stackoverflow.com/a/26974685
has comment: http://stackoverflow.com/comment/42485248
has comment: http://stackoverflow.com/comment/42484407
type: Answer
upvote count: 0
has body: The title should be changed in "JavaScript DOM insertBefore isn't used properly". That's because, even if you didn't put in your DOM, the browser automatically creates a element that wraps the rows of the table. So, it happens that #formtable is not the parent of #submitrow, and that's why you get an error. Try this: formtable.tBodies[0].insertBefore(new_tr, submitrow); Or, more generally: submitrow.parentNode.insertBefore(new_tr, submitrow); (In browsers that support it, there's even this one: submitrow.insertAdjacentElement("beforeBegin", new_tr); Internet Explorer, Chrome, Safari and Opera support it, Firefox doesn't but it can be easily shimmed. I don't recommend using this stuff, anyway.) And, as a general advice, always use the tag when writing down tables: Number : And, of course, and when you need them.
score: -2
downvote count: 2
answers question: http://stackoverflow.com/q/26974466

http://stackoverflow.com/q/26981806
has answer: http://stackoverflow.com/a/26981966
has title: Calling PHP function nl2br in html doc
tagged with: php
type: AnsweredQuestion
has body: I am working on a site in which I have a user entry field that I would like to insert line breaks after every new line in the user input without making an entirely new php page. Here's my code (js): var newstreamSummary = document.getElementById("addNewstreamSummaryBox").value; if(newstreamSummary !== ""){ document.getElementById("previewNewstreamSummary").innerHTML = newstreamSummary; /* newstreamSummary = &lt;?php echo nl2br(newstreamSummary);?&gt; */ } That block lives in a js function called showPreview(), when running it says the showPreview() is not defined. It also does not work when I put the php call in a separate &lt;script&gt; tag. I would like to call this function without having a new page as this is the only time in the project where I'm using php currently. Or if there's a js function that does the same thing. Thanks all for any advice.
accepted answer: http://stackoverflow.com/a/26981966
type: Question
answer count: 1
tagged with: javascript
score: 0

http://stackoverflow.com/comment/42445253
comment on: http://stackoverflow.com/a/26952328
has text: @plalx I have removed that.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/42321665
score: 0
type: AnswerComment
has text: Remove the `width` and `height` attributes from your SVG file (ie the `width="595.28px" height="841.89px"`). Now the SVG will scale to fit its parent element. However unfortunately the div-on-path elements will no longer stay on the path. You will either have to adjust their positions on resize events, or add the "divs" as SVG elements to the SVG file - rather than have non-SVG divs.
type: Comment
comment on: http://stackoverflow.com/a/26859777

http://stackoverflow.com/q/26838195
tagged with: jquery
has answer: http://stackoverflow.com/a/26838557
has title: Issue in showing error to the particular spans
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/42241433
has body: The data is the json that i get from another page It would look similar to data : {"BusNo":["The bus no field is required."],"CompID":["The comp id field is required."],"TotalSeats":["The total seats field is required."]} Here is my Script : $(document).ready(function() { $("#driver").click(function(event) { var BusNo = $("#BusNo").val(); var CompID = $("#CompID").val(); var TotalSeats = $("#TotalSeats").val(); var _token = $("#_token").val(); $.post("managebus_register", { _token: _token, BusNo: BusNo, CompID: CompID, TotalSeats: TotalSeats }, function(data) { if (data != '') { var obj = JSON.parse(data); $.each(obj, function(entry) { var targetSelector = ''; if (entry == "BusNo") { targetSelector = "#BusNo"; console.log('error in bus field'); } if (entry == "CompID") { targetSelector = "#CompID"; console.log('error in comp id'); } if (entry == "TotalSeats") { targetSelector = "#TotalSeats"; console.log('error in total seats'); } if (targetSelector) $(targetSelector).next("span.error").html(obj[entry]); else { $(targetSelector).next("span.error").text(' '); } }); } else { console.log('pass'); } }); }); }); The condition goes inside if the if(data != '') and checks for targetSelector = "#BusNo"; My problem is once the script is run it will throw the error to particular spans i.e., BusNo, CompID etc., And once it is filled it keeps on showing the error messages That is, the given script if (targetSelector) $(targetSelector).next("span.error").html(obj[entry]); else { $(targetSelector).next("span.error").text(' '); } Here the else part $(targetSelector).next("span.error").text(' '); is not working, What is the mistake i am doing and how can i fix this. Update : I got to know $("span.error").empty(); Will do this But i need to highlight the input text box with error and the error should be shown only in hover of the particular text and not in the &lt;input type="text" id="BusNo" name="BusNo"/&gt;&lt;span class="error"&gt;&lt;/span&gt; &lt;input type="text" id="CompID" …
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/42241566
has comment: http://stackoverflow.com/comment/42241552
type: Question
has comment: http://stackoverflow.com/comment/42241510
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/a/26899778
type: Answer
has body: You can either: 1) Assume that the code works, and handle the cases where it doesn't: try{ // ... }catch(e){ // an error occurred } Or 2) check if the function it relies on exists, and then use it: if(window.yourfunction){ // The function is present in the global scope }else{ // Not available, try alternatives? }
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/26899762
accepted answer of: http://stackoverflow.com/q/26899762
type: AcceptedAnswer
downvote count: 0

junit
type: Tag
tag name: junit
tags question: http://stackoverflow.com/q/26864944

http://stackoverflow.com/a/26951832
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42452706
has comment: http://stackoverflow.com/comment/42464084
type: Answer
has comment: http://stackoverflow.com/comment/42448889
score: 2
upvote count: 3
downvote count: 1
has body: entityData is not an object. It's a number. Since a number is a primitive, it can't have properties. Consequently, when you access (read/write) one of its properties, a temporary, auto-boxed Number object is created, and it's thrown away immediately (after the expression is evaluated). Thus, you are not accessing the same object, rather different temporary objects, when operating on your entityData. The solution: make it into a proper non-primitive object instead: var entityData = {}; If you want to be elegant as well, you can initialize it with default properties, since object literals permit that too: var entityData = { flyType: random(1, 4), rocketers: [], magical: [ random(1, 10) ] };
accepted answer of: http://stackoverflow.com/q/26951774
has comment: http://stackoverflow.com/comment/42444738
has comment: http://stackoverflow.com/comment/42452020
answers question: http://stackoverflow.com/q/26951774

http://stackoverflow.com/q/26919296
upvote count: 2
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/26919346
has body: I am an experienced developer, but I just ran into an issue that took me a while to figure out and am looking for an explanation. I was relying on short circuiting and spent more time than I care to admit debugging this. If this belongs on another Stack&nbsp;Exchange site, please advise. I expect the following to evaluate to false, but it passes: (false &amp;&amp; true || true) =&gt; true It is as though it's being interpreted as this: ((false &amp;&amp; true) || true) =&gt; true ... but the solution is this: (false &amp;&amp; (true || true)) =&gt; false Why doesn't false short circuit the operation in the first example? Is there some sort of lookahead I don't know about? Solution summary: For those who (like me) never knew conditional operators have a similar precedence as mathematical operators - the same concept of implied parenthesis applies: 3 * 2 + 1 =&gt; (3 * 2) + 1 =&gt; 7 false &amp;&amp; true || true =&gt; (false &amp;&amp; true) || true =&gt; true
has title: JavaScript conditional not short circuiting like I would expect
type: Question
tagged with: short-circuiting
tagged with: conditional-statements
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26919346
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/q/26891211
score: -1
type: Question
has body: Code in question: function setAllMap(map) { console.debug(3); for (var i = 0; i &lt; markers.length; i++) { markers[i].setMap(map); } resetZoomOnMapEvents(markers); } function resetZoomOnMapEvents(nuLoc) { console.debug(1); var marks = typeof nuLoc == 'undefined' ? nuLoc : markers; var bounds = new google.maps.LatLngBounds(); for (var i in marks) { bounds.extend(marks[i].position); } map.setCenter(bounds.getCenter()); map.fitBounds(bounds); } The map works correctly on return of search results. It will sometimes center to the center of the map markers but other times it will center on Spain/Africa. Direct question: why is the behavior not consistent?
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/42339009
tagged with: google-maps-api-3
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/26893528
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26892034
has title: Google maps api: map not consistently executing fitBounds
has comment: http://stackoverflow.com/comment/42337788
has comment: http://stackoverflow.com/comment/42337858
upvote count: 0

http://stackoverflow.com/comment/42283839
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26861795
has text: see this:http://stackoverflow.com/questions/26184530/datatables-reload-on-change-event
score: 0

http://stackoverflow.com/comment/42415919
type: AnswerComment
has text: @ariel_556, this code is part of https://github.com/chjj/tty.js/blob/master/lib/tty.js
comment on: http://stackoverflow.com/a/26935390
type: Comment
score: 0

http://stackoverflow.com/comment/42259297
type: Comment
has text: @BayuSanjaya Thanks, but well, I suppose not :) It's an overkill so I'd advise you to use Aakil's answer ;)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26848078

http://stackoverflow.com/comment/42467932
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26965111
score: 0
has text: @Ghost like this. From the dynamic rows : http://stackoverflow.com/questions/26955139/jquery-autocomplete-remote-datasource-and-dynamic-rows

http://stackoverflow.com/q/26920006
has comment: http://stackoverflow.com/comment/42388306
type: Question
tagged with: firefox
has comment: http://stackoverflow.com/comment/42388623
has comment: http://stackoverflow.com/comment/42388349
tagged with: javascript
tagged with: jquery
score: 0
has body: I am using 5 jquery plugins for my website. When I view the site on latest browsers, it runs smoothly but when I use Firefox, most of my scripts and even CSS transitions doesn't work anymore.I checked Firefox dev tool, FF received 304 code. Could it be that having too many jquerys causes this? Would the script be running even if the status code for that script is 304? 304 has something to do with the cache, right? I am confused now. EDIT: I am importing my JS files using Wordpress' wp_enqueue_scripts. I didn't post this question on wordpress.stack since I was suspecting the way FF handled javascript. This is the whole function on my wordpress functions. function initScripts(){ wp_enqueue_style('normalize',get_template_directory_uri().'/public/css/normalize.css'); wp_enqueue_style('p-scrollbar','//cdnjs.cloudflare.com/ajax/libs/jquery.perfect-scrollbar/0.5.7/perfect-scrollbar.min.css'); wp_enqueue_style('typicons',get_template_directory_uri().'/public/css/typicons.min.css'); wp_enqueue_style('fancybox-css',get_template_directory_uri().'/public/css/jquery.fancybox.css'); wp_enqueue_style('dynamic',get_template_directory_uri().'/public/css/dynamic.css'); wp_enqueue_style('main-required',get_stylesheet_uri()); wp_enqueue_script('perfect-scrollbar','//cdnjs.cloudflare.com/ajax/libs/jquery.perfect-scrollbar/0.5.7/perfect-scrollbar.min.js',array('jquery')); wp_enqueue_script('jquery.mousewheel.min',get_template_directory_uri().'/public/js/jquery.mousewheel.min.js',array('jquery')); wp_enqueue_script('jquery.scroll.animate',get_template_directory_uri().'/public/js/jquery.scroll.animate.js',array('jquery')); wp_enqueue_script('jquery-scrollto',get_template_directory_uri().'/public/js/jquery-scrollto.js',array('jquery')); wp_enqueue_script('jquery-ui',get_template_directory_uri().'/public/js/jquery-ui.min.js',array('jquery')); wp_enqueue_script('fancybox',get_template_directory_uri().'/public/js/jquery.fancybox.js',array('jquery')); wp_enqueue_script('main-required-js',get_te…
type: UnansweredQuestion
tagged with: css
has title: 304 Code on Scripts when viewed using Firefox
answer count: 0

http://stackoverflow.com/comment/42323863
has text: Sorry, not sure what you mean. You want to have another button, and once it's clicked, it will disable the popover? disabling here means hiding the popover right?
comment on: http://stackoverflow.com/a/26884064
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/42512214
has text: But let's say i want the current infowindow, which is on the marker, to have the information that comes out of the jQuery. How do i do this?
score: 0
comment on: http://stackoverflow.com/q/26990079
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26835284
has answer: http://stackoverflow.com/a/26835355
has answer: http://stackoverflow.com/a/26835415
score: -2
tagged with: javascript
has title: how to split content on one page while first one displays first and other is hidden?
type: Question
answer count: 2
upvote count: 0
favorite count: 0
has body: I'm trying to display content on one page there are two parts of it so first content will display in full page while the other one is hidden the first content will time out after like 2 minutes and after 2 minutes the other part of the content will display below are sample of my code any help will be appreciated. *video will play in full screen on full page using javascript it will time out after 2 mininutes and it will hide the video and just show the the "Bottom" text * *after 2 mins the text content will display on full page css body { width: 100% ; height: 100% ; margin: 0px ;}
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: UnansweredQuestion
downvote count: 2

http://stackoverflow.com/comment/42478435
comment on: http://stackoverflow.com/a/26969687
type: Comment
has text: the actual initial problem could also simply be solved with array.reverse()
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42257925
comment on: http://stackoverflow.com/q/26846958
score: 0
has text: Let say $scope.X =5, What is the diffrent?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42544829
comment on: http://stackoverflow.com/a/26954545
has text: Heeey, I just got fifteen somehow. :)
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42325622
has text: @IshanDemon Can you give an example?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26885031
type: AnswerComment

http://stackoverflow.com/comment/42450217
type: AnswerComment
comment on: http://stackoverflow.com/a/26921644
type: Comment
has text: @user2645904 Above solution work correctly, you are getting this issue because of the date assignment issue. Please check the modified fiddle, (check at the date assignment) http://jsfiddle.net/o8ckohxx/2/
score: 0

http://stackoverflow.com/comment/42239597
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26837061
score: 0
has text: There really isn't a question here. Can you explain what it is you would like to achieve?

http://stackoverflow.com/a/26938474
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
score: 1
has body: your loop is using the wrong iterator. function displayName(){ var str = prompt("enter your name:"); var len = str.length; var chara = 0; while(chara < len){ document.write(" the letter " + str.charAt(chara) + " is number " + (chara + 1)); chara++; } document.write(" the name entered is: " + str + " " + "the length is " + len); }
accepted answer of: http://stackoverflow.com/q/26938413
answers question: http://stackoverflow.com/q/26938413

http://stackoverflow.com/comment/42334485
comment on: http://stackoverflow.com/a/26890243
type: AnswerComment
type: Comment
has text: The only thing `contents` does differently is return text nodes that are outside elements (as well as all elements). As the search is for an ID, using `contents()` should be pointless :)
score: 0

http://stackoverflow.com/q/26938450
type: Question
answer count: 2
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/26952802
has answer: http://stackoverflow.com/a/26938875
has body: I'm trying to observe the "ended" media event from a video playback. My plan is to trigger an action when video.ended == true. Here is the template code: &lt;div id="container"&gt; &lt;video id="video" width="{{width}}" autoplay&gt; &lt;source src="shamman.mp4" type='video/mp4;codecs="avc1.42E01E, mp4a.40.2"' /&gt; &lt;/video&gt; &lt;/div&gt; &lt;content&gt;&lt;/content&gt; And here is the Javascript: Polymer({ author: '', ready: function() { console.log(this.$.video.ended); var observer = new PathObserver(this.$, 'video.ended'); observer.open(function(newValue, oldValue) { console.log(newValue); console.log(oldValue); }); } }); The first console.log returns the initial value of ended, which is "false". The second and third console.log are never executed.
has title: Observing "ended" media event on Polymer
type: UnansweredQuestion
tagged with: polymer

http://stackoverflow.com/comment/61443661
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26907669
has text: @den see my answer below. Consider updating the accepted answer for the sake of new visitors.
score: 0

http://stackoverflow.com/a/26923304
type: Answer
accepted answer of: http://stackoverflow.com/q/26922814
upvote count: 1
answers question: http://stackoverflow.com/q/26922814
type: AcceptedAnswer
downvote count: 0
score: 1
has body: I think the key point is to understand that res is an EventEmitter (IncomingMessage to be more accurate), so what does the function named callback (only once on the response event of the httpClientRequest object you create when calling http.get()) is to attach an event listener to the data event of res. Without going into details, to optimise data flow, when you receive some data bytes from the network a buffer is filled and when is full the event 'data' is triggered so you can process the incoming chunk. Hence the callback you have set to the data event is executed on every chunk of data coming from the network

http://stackoverflow.com/a/26985897
has body: Use .split to split a string by a delimiter (a comma in your case) and then get the tokens and use parseInt to convert it to a number and add it to the array. var arr = ["2014,11,6","2014,12,6"]; var result = []; var tokens = null; for (var i = 0; i &lt; arr.length; i++) { tokens = arr[i].split(','); result.push(parseInt(tokens[0], 10)); //first word result.push(parseInt(tokens[1], 10) - 1); //2nd result.push(parseInt(tokens[2], 10)); //3rd } alert(result.join(' '));
has comment: http://stackoverflow.com/comment/42505309
downvote count: 0
answers question: http://stackoverflow.com/q/26985873
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/42505262
upvote count: 2

http://stackoverflow.com/a/26932724
answers question: http://stackoverflow.com/q/26880881
upvote count: 1
has body: need not find the class, if there is not and will not do anything wrong $('button').on('touchend', function (e){ /*no function whatsoever*/ console.log($("body").find('.active').first().html()); console.log($("body").find('.active').html()); /*only here*/ console.log($("body").html()); /*just do it this way*/ $('body').removeClass('active'); $('body').addClass('hidden'); flag = true; return; });
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/42476684
type: Comment
type: QuestionComment
has text: @zerkms agreed with Frédéric Hamidi on !0 and !1. So still doesnt make much sense. Also angularjs and jquery doesnt have this kind of enhancements. And jquery has !0 and !1 in min version.
comment on: http://stackoverflow.com/q/26968943
score: 0

http://stackoverflow.com/comment/42384481
type: QuestionComment
has text: I am even not sure if you are good enogh in php :)
score: 0
comment on: http://stackoverflow.com/q/26916065
type: Comment

http://stackoverflow.com/q/26943051
has title: How to bind asp data table into string array in asp.net c#?
type: Question
tagged with: c#
linked to: http://stackoverflow.com/q/10762490
has body: I have a java script, i want to bind data table in variable available ? &lt;script&gt; $(function () { *var available* = [ ]; $("#tags").autocomplete({ source: availableTags }); }); &lt;/script&gt; I have a data table which is as follows:- ds = du.returnDataSet("proc", "SHOW_REFINE_SEARCH", Parameters, DbTypes, ParameterTypes, values, Lengths); DataTable dt = new DataTable(); dt = ds.Tables[0]; the data table value comes in the form which are as follows:- Zone_ID Zone_Name Company_ID 1 Rajasthan 1 2 Madhya Pradesh 1 3 Maharashtra 1 4 Uttar Pradesh 1 5 Jammu and Kashmir 1 6 Gujarat 1 I want to bind zone_name in javascript string variable...
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/26943157
tagged with: asp.net
has answer: http://stackoverflow.com/a/26943149
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/11680792
score: 0

http://stackoverflow.com/q/26935029
tagged with: tic-tac-toe
has answer: http://stackoverflow.com/a/26937610
accepted answer: http://stackoverflow.com/a/26937610
type: AnsweredQuestion
type: Question
answer count: 1
tagged with: javascript
has body: i have made a tic-tac-toe game.For which i have to make a character selection module for each player.Players have to choose between x and o.If first one selects 'o' ,other player can not select that.he has to choose 'x'.But including html lines ,the code i have written is almost 50 lines and very fragile, i can't find any other way to shorten this code.selection option is a basic thing in games.Any expert solution on this matter would be appreciated function Player(name,val){ this.name=name; this.val=val; } var ps=document.getElementById('ps'); ps.addEventListener('click',function(e){ player1=prompt('input player1'); char1=prompt('input char between x/o'); if((char1 != 'x') &amp;&amp; (char1 != 'o')){ for(;;){ alert('select between x an o please'); char1=prompt('between x/o'); if((char1 === 'x')|| (char1 === 'o')){ break; } } } player2 = prompt('input player2'); char2 = prompt('input your char O/X'); if((char2 === char1) || ((char2 != 'x') &amp;&amp; (char2 != 'o'))){ for(;;){ alert('you can not have this char'); char2=prompt('try again'); if(((char2 === 'o') || (char2 === 'x')) &amp;&amp; (char2 != char1)){ break; } } } p1=new Player(player1,char1); p2=new Player(player2,char2); document.body.innerHTML+='\n'+p1.name+' : '+p1.val+'\n'+p2.name+' : '+p2.val; }); &lt;input type='button' value='Player Setup' id='ps'&gt;
score: 0
has title: character selction option for the players in tic-tac-toe

http://stackoverflow.com/comment/42487548
type: AnswerComment
type: Comment
has text: +1 Good spot. I use [mongoose](https://code.google.com/p/mongoose/) when working locally - helps to avoid things like this whilst developing.
comment on: http://stackoverflow.com/a/26976378
score: 0

http://stackoverflow.com/comment/42462882
type: AnswerComment
comment on: http://stackoverflow.com/a/26961802
score: 0
type: Comment
has text: upvoted for the only solution that doesn't wait until all the requests are complete in order to display the list items.

http://stackoverflow.com/comment/42324540
comment on: http://stackoverflow.com/a/26883480
has text: it really depends on what errors you want to handle. you mentioned a specific one, and that´s not something you need to handle, that´s just a setting.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/26914726
has body: I've been working on a single page site in which data from a single json file is rendered variously in different sections - nothing displayed on load, but only upon click event. I learned a little about callbacks getting that wired up, but as I almost completed it I realized how flawed the concept was, so now I'm back to the drawing board. My idea now is to make the ajax call onload, set the json result as a variable available to several functions. I thought it would go something like this: window.onload = function() { var myJsonData = function() { var request = new XMLHttpRequest(); request.open("GET", "/json/someJsonData.json", true); request.setRequestHeader("content-type", "application/json"); request.send(null); request.onreadystatechange = function() { if (request.readyState === 4) { if (request.status === 200) { var myJsonString = JSON.parse(request.responseText); var myJsonArray = myJsonString["Projects"]; return myJsonArray; } } } // onreadystatechange } // var myJsonData myJsonData(); // * console.log("myJsonArray: " + myJsonArray); // undefined Or: window.onload = function() { myJsonData(); } function myJsonData() { var request = new XMLHttpRequest(); request.open("GET", "/json/someJsonData.json", true); request.setRequestHeader("content-type", "application/json"); request.send(null); request.onreadystatechange = function() { if (request.readyState === 4) { if (request.status === 200) { var myJsonString = JSON.parse(request.responseText); var myJsonArray = myJsonString["Projects"]; alert("you are here (myJsonArray defined)"); alert("myJsonArray: " + myJsonArray); console.log("myJsonArray: " + myJsonArray); return myJsonArray; } } } // onreadystatechange } // var myJsonData console.log("myJsonArray: " + myJsonArray); // undefined Or: window.onload = myJsonData; // etc. Of course myJsonArray is undefined either way. I'm obviously missing something fundamental about how to do this (or is this even a bad idea altogether?). Is there some way to pass a result a…
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26915511
score: 0
has title: Accessing data returned by ajax request on load
type: Question
has answer: http://stackoverflow.com/a/58379386
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has comment: http://stackoverflow.com/comment/42379386
answer count: 3
has comment: http://stackoverflow.com/comment/42384797
has answer: http://stackoverflow.com/a/26915307
has comment: http://stackoverflow.com/comment/42378520
tagged with: ajax
has comment: http://stackoverflow.com/comment/42410793

http://stackoverflow.com/comment/42358110
comment on: http://stackoverflow.com/q/26888831
has text: you're right. the data seems to be formatted incorrectly, because when I create a list of arrays of strings from my list of objects and return that, it's working, but I've verified the serialized list and it seems to be good JSON format. Updated the question to show data.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42692720
type: Comment
type: QuestionComment
has text: Hello and thank you for answering. The SDK I have is InMobi_Android_SDK_4.5.1.
score: 0
comment on: http://stackoverflow.com/q/26973625

http://stackoverflow.com/q/26944435
tagged with: filtering
tagged with: sqldatasource
has body: How can i make this (Filter GridView with DropDownList using FilterExpression in SqlDataSource) work without reloading the page using JavaScript ? &lt;asp:DropDownList ID="ddlCountries" runat="server" AutoPostBack="True" DataSourceID="DropDownDataSource" DataTextField="SC" DataValueField="SC" AppendDataBoundItems="True"&gt; &lt;asp:ListItem Text="All " Value="" /&gt; &lt;/asp:DropDownList&gt; &lt;asp:SqlDataSource ID="DropDownDataSource" runat="server" ConnectionString="&lt;%$ ConnectionStrings:CountConnectionString %&gt;" SelectCommand="SELECT [SC] FROM [CountTable]"&gt;&lt;/asp:SqlDataSource&gt; &lt;asp:GridView ID="GridView1" HeaderStyle-BackColor="#3AC0F2" HeaderStyle-ForeColor="White" runat="server" AutoGenerateColumns="False" DataSourceID="GridDataSource" DataKeyNames="ID"&gt; &lt;Columns&gt; &lt;asp:BoundField DataField="ID" HeaderText="ID" ItemStyle-Width="150" InsertVisible="False" ReadOnly="True" SortExpression="ID" /&gt; &lt;asp:BoundField DataField="SC" HeaderText="SC" ItemStyle-Width="150" SortExpression="SC" /&gt; &lt;asp:BoundField DataField="Traffic" HeaderText="Traffic" SortExpression="Traffic" /&gt; &lt;/Columns&gt; &lt;HeaderStyle BackColor="#3AC0F2" ForeColor="White"&gt;&lt;/HeaderStyle&gt; &lt;/asp:GridView&gt; &lt;asp:SqlDataSource ID="GridDataSource" runat="server" ConnectionString="&lt;%$ ConnectionStrings:CountConnectionString %&gt;" SelectCommand="SELECT * FROM [CountTable]" FilterExpression="SC = '{0}'"&gt; &lt;FilterParameters&gt; &lt;asp:ControlParameter Name="SC" ControlID="ddlCountries" PropertyName="SelectedValue" /&gt; &lt;/FilterParameters&gt; &lt;/asp:SqlDataSource&gt;
tagged with: javascript
downvote count: 0
tagged with: asp.net
favorite count: 0
type: UnansweredQuestion
tagged with: gridview
answer count: 0
has title: make (GridView with DropDownList using FilterExpression in SqlDataSource) work without reloading the page using JavaScript
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/a/26914919
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/42399298
score: 2
has comment: http://stackoverflow.com/comment/42403641
accepted answer of: http://stackoverflow.com/q/26913513
answers question: http://stackoverflow.com/q/26913513
has comment: http://stackoverflow.com/comment/42403690
has body: Is this the sort of thing you are looking for? var http = require("http"); var fs = require("fs"); var path = require("path"); var server = http.createServer(function(request, response) { //typically what will happen here is that you will see //see the request for the page (index.html?) first and //then the browser's subsequent requests for js, css etc files var url = request.url; var file = //do something clever to extract the file name from the url ( url.split("/")?) var html = fs.readFileSync(file,"utf-8"); //probably want to check the file extension here to determine the Content-Type response.writeHeader(200, {"Content-Type": "text/html"}); response.write(html); response.end(); }); server.listen(8081); console.log("Server is listening"); A bit agricultural, and you would probably run in to all sort of problems with routing - but its the idea.
downvote count: 0
has comment: http://stackoverflow.com/comment/42383442
type: AcceptedAnswer

http://stackoverflow.com/a/26921043
type: Answer
accepted answer of: http://stackoverflow.com/q/26919860
answers question: http://stackoverflow.com/q/26919860
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
has body: The usual way to check that the page is loaded before running your scripts (no matter where they are included on the page) is to wrap your javascript jQuery .ready() callback: $(document).ready(function(){ var canvas, ctx, w, h, world, boxBody, planeBody; init(); animate(); function init(){ // Init canvas canvas = document.getElementById("testLine"); } }); Now you can load your scripts anywhere on the page and it won't be called until the page is loaded

http://stackoverflow.com/comment/115998272
type: AnswerComment
has text: Do you happen to know why wouldn't changes to `contents.css` take effect? I'm trying to change the line height too—and a few other things—but even if I change this rule in the file, the page actually loads kind of an old version of it, which I don't know where it gets it from. I'm using `django-ckeditor`
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26931053

http://stackoverflow.com/comment/42428342
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26942405
has text: [try {} catch (ex) {}](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch) or img `onerror` handler
score: 0

http://stackoverflow.com/q/26928237
score: -1
linked to: http://stackoverflow.com/q/7887735
type: Question
answer count: 2
has body: Jquery Import statement in parent page <jsp:include page="DynamicHelpContent"/> Here in dynamichelp content page (child page) i have imported below scripts Due to import in dynamic help content I cant see the functionality of my child page because of jquery-1.11.1.min.js import statement. Can you please provide me the way so that I can allow mulitple Jquery scripts ..
accepted answer: http://stackoverflow.com/a/26928362
downvote count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42402320
favorite count: 0
has answer: http://stackoverflow.com/a/26928362
has comment: http://stackoverflow.com/comment/42402329
upvote count: 0
possible better answer: http://stackoverflow.com/a/26928344
type: AnsweredQuestion
has title: Allow multiple jquery import statement
has answer: http://stackoverflow.com/a/26928344

http://stackoverflow.com/comment/42503135
score: 0
has text: I really don't think that you can show an alert box when the user opens a page in a new tab. At least not in JS or jQuery.
type: Comment
comment on: http://stackoverflow.com/a/26984575
type: AnswerComment

http://stackoverflow.com/comment/42436561
type: QuestionComment
score: 0
has text: Your solution is to use a proper connection pool, specifically pgbouncer or pgpool-II.
comment on: http://stackoverflow.com/q/26946339
type: Comment

grunt-contrib-copy
type: Tag
tags question: http://stackoverflow.com/q/26915493
tag name: grunt-contrib-copy

http://stackoverflow.com/comment/42472177
comment on: http://stackoverflow.com/a/26967519
type: AnswerComment
score: 0
has text: ...I am able to iterate the loop through my code.I can access each and every element also.My doubt is how can I use nested for loop so that I can get corresponding key along with values. I am able to retrieve all the values and keys.But I want to know where should I write the code to retrieve keys so that I get corresponding values for a particular key
type: Comment

http://stackoverflow.com/a/27025894
type: Answer
answers question: http://stackoverflow.com/q/26917801
has comment: http://stackoverflow.com/comment/42719543
score: 2
has comment: http://stackoverflow.com/comment/42692940
has comment: http://stackoverflow.com/comment/42692915
upvote count: 2
downvote count: 0
has body: Sometimes you have to work around the limitations of the framework. In this case, there is actually a potentially simpler solution. In the JavaScript, why not set the status as a string instead of an integer? $scope.execute = function() { $http.get(playerRelatedUrl) .then( function(res) { // NOTICE THE STATUS IS A STRING HERE vvvvvvvvv $scope.items[$scope.currentTeamIndex].players[$scope.currentPlayerIndex].profileStatus= "Updated"; }, function(err) { $scope.items[$scope.currentTeamIndex].players[$scope.currentPlayerIndex].profileStatus = "Unable to update"; } ) } Then eliminate the switch from the HTML entirely. The code becomes much easier to read. Execute {{team.name}} {{player.profileStatus}} {{player.name}} If you really, really need to have an integer state variable for some reason, then write a little function and just do both: function updatePlayerStatus( newValue ) { var statusUpdateStrings = [ "Not checking", "Checking", ... etc. ]; var player = $scope.items[$scope.currentTeamIndex].players[$scope.currentPlayerIndex]; player.profileUpdated = newValue; player.profileStatus= statusUpdateStrings[ player.profileUpdated ]; } $scope.execute = function() { $http.get(playerRelatedUrl) .then( function(res) { updatePlayerStatus(3); }, function(err) { updatePlayerStatus(2); } ) }

http://stackoverflow.com/q/26892836
has comment: http://stackoverflow.com/comment/42339621
has comment: http://stackoverflow.com/comment/42339923
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26893008
tagged with: php
type: Question
has body: I guys, I need yo help for this. I have this code, wich shows me the products I have in my shopping cart: for($i=0;$i<count($_SESSION['productos']);$i++) { $id = $_SESSION['productos'][$i]; $prods = mysql_query('SELECT * from productos where idprod='.$id.''); $row = mysql_fetch_array($prods); echo " "; echo " " . $row['nombre']; echo " "; if($_GET[action]=="suma") { $_SESSION['unidades'][$i] = $_SESSION['unidades'][$i] + 1; } elseif($_GET[action]=="resta") { $_SESSION['unidades'][$i] = $_SESSION['unidades'][$i] - 1; } echo " "; echo " "; echo " "; echo " " . $row['precio']; echo " "; echo " " . $row['precio'] * $_SESSION['unidades'][$i]; echo " "; echo " "; } I need to sum 1 unity or rest 1 unity to $_SESSION['unidades'][$i] just to the selected product, when I click the two images respectively. The thing is that when I click, it adds me 1 to all the products. Any easy way of doing this without using $_GET vars? I dont have high knowledge about JavasScript. Thanks!!
tagged with: session
has comment: http://stackoverflow.com/comment/42339710
has comment: http://stackoverflow.com/comment/42339497
score: 0
has title: Sum 1 to a value by clicking an image - PHP
has comment: http://stackoverflow.com/comment/42339552
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/26893008
tagged with: get

http://stackoverflow.com/comment/42307405
type: Comment
comment on: http://stackoverflow.com/a/26874540
score: 1
type: AnswerComment
has text: It does work when I trim it first like @squint suggested above, thanks a lot!

http://stackoverflow.com/a/26896918
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/26896737
score: 1
has comment: http://stackoverflow.com/comment/42347220
has body: The jQuery function name is appendTo with "To" capitalized, and Javascript is case-sensitive - you need to change your line of code to: }).appendTo("#hidfielddiv");
upvote count: 1

http://stackoverflow.com/comment/42272696
comment on: http://stackoverflow.com/q/26854979
has text: Could you change the `table` to `div` ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42397569
type: Comment
comment on: http://stackoverflow.com/a/26924576
type: AnswerComment
has text: @prog during add can i add index to child node?
score: 0

http://stackoverflow.com/a/26961817
has body: The element that you are giving a z-index cannot have a position static. So give it a position relative and the z-index fix should work. From CSS-tricks (http://css-tricks.com/almanac/properties/z/z-index/) As in, which one appears as if it is physically closer to you. z-index only effects elements that have a position value other than static (the default).
type: Answer
accepted answer of: http://stackoverflow.com/q/26961532
has comment: http://stackoverflow.com/comment/42537602
score: 0
answers question: http://stackoverflow.com/q/26961532
type: AcceptedAnswer

http://stackoverflow.com/comment/42393511
score: 0
type: Comment
type: QuestionComment
has text: what not an extension like http://extensions.joomla.org/extensions/access-a-security/site-access/authentication-cloud-based/22865 there is also more paid and free extension for facebook login
comment on: http://stackoverflow.com/q/26923087

http://stackoverflow.com/q/26879383
favorite count: 0
tagged with: tabs
has body: I am using cbpFWTabs (http://tympanus.net/Development/TabStylesInspiration/) but want to open a specific tab upon page load. I have tried to emulate the show method like this in the page but it doesn't recognize the tabs or items arrays: &lt;script type="text/javascript"&gt; // tabs elems this.tabs = [].slice.call( this.el.querySelectorAll( 'nav &gt; ul &gt; li' ) ); // content items this.items = [].slice.call( this.el.querySelectorAll( '.content-wrap &gt; section' ) ); if( this.current &gt;= 0 ) { this.tabs[ this.current ].className = this.items[ this.current ].className = ''; } // change current this.current = idx != undefined ? idx : this.options.start &gt;= 0 &amp;&amp; this.options.start &lt; this.items.length ? this.options.start : 0; this.tabs[ this.current ].className = 'tab-current'; this.items[ this.current ].className = 'content-current'; }; tabIndex = 1; showTab(tabIndex); &lt;/script&gt; The tab source code is here: https://github.com/codrops/FullWidthTabs/blob/master/js/cbpFWTabs.js I am sure there must be an easier way?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/41590098
upvote count: 1
answer count: 4
score: 1
has title: Open a specific tab with cbpFWTabs
has answer: http://stackoverflow.com/a/29592668
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26902789
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has answer: http://stackoverflow.com/a/41633372

http://stackoverflow.com/comment/42296319
comment on: http://stackoverflow.com/a/26834747
type: Comment
score: 0
has text: Awesome! Can you guess why the htmlunitdriver version doesn't work? ChromeDriver() ==> HtmlUnitDriver(true)
type: AnswerComment

http://stackoverflow.com/comment/42306418
type: QuestionComment
comment on: http://stackoverflow.com/q/26873162
has text: @GauravMantri - Post that as an answer and I'll give you credit. The issue was the URL encoding in the SAS. It looks like it was double-encoding the string. I fixed it so it did not double-encode the string and it now works like a charm (again).
score: 0
type: Comment

http://stackoverflow.com/q/26895251
answer count: 2
tagged with: php
has title: Jquery Ajax Inserting data into a database
has answer: http://stackoverflow.com/a/26895357
tagged with: mysql
has answer: http://stackoverflow.com/a/26895404
upvote count: 1
has comment: http://stackoverflow.com/comment/42344112
has body: I have a page with three forms, and on these forms are seperate variables. The page allows the user to enter details and they will be inserted into a MySQLdatabase for viewing. I have the script: Edit: I also know mySql_ is deprecated but for the sake of the example it's working fine. Edit 2: i know you can inject but that's pretty irrelevant at the moment, i think it's a problem with using a text area instead of a simple input. Edit 3: It's just a typo. $("#finishButton").click(function(e) { // store final value and execute script to insert into DB. On success, switch to success page var commentsValid = $('#commentsDetailsForm').valid(); if (commentsValid) { comments = document.getElementById('commentsInput').value; e.preventDefault(); $.ajax({ type: "POST", url: 'insert.php', data: 'forenameInput=' + forename + '&surnameInput=' + surname + '&emailInput=' + email + '&telephoneInput=' + telephone + '&genderInput=' + gender + '&dobInput=' + dob + '&commentInput=' + comments, success: function (data) { if (data == "Error") { $("#error").show(); $("#processing").hide(); } else { window.location.href = "success.php"; } } }); } else { } }); That is meant to store all the details into the database. However as things stand, it stores all the details in the database except the comments (final variable). Am i finishing the data statement wrong is there something else fundamentally wrong? PHP Script: <?php // Connection Details $servername = "localhost"; $username = "root"; $password = "user10"; $dbname = "test"; // Create connection $conn = mysql_connect($servername, $username, $password); // Check connection if (!$conn) { die("Connection failed: " . mysql_connect_error()); } // Select database mysql_select_db($dbname,$conn); // Store posted data in variables $forename = $_POST['forenameInput']; $surname = $_POST['surnameInput']; $email= $_POST['emailInput']; $telephone = $_POST['telephoneInput']; $dob = $_POST['dobInput']; $gender = $_POST['genderInput']; $comments = $_POST…
possible better answer: http://stackoverflow.com/a/26895357
tagged with: javascript
tagged with: jquery
tagged with: ajax
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26895404
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/42343992
type: Question

http://stackoverflow.com/a/61633902
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/26948400
upvote count: 3
has body: A very hacky solution would be to loop through the class you want to inherit from adding the functions one by one to the new parent class class ChildA { public static x = 5 } class ChildB { public static y = 6 } class Parent {} for (const property in ChildA) { Parent[property] = ChildA[property] } for (const property in ChildB) { Parent[property] = ChildB[property] } Parent.x // 5 Parent.y // 6 All properties of ChildA and ChildB can now be accessed from the Parent class, however they will not be recognised meaning that you will receive warnings such as Property 'x' does not exist on 'typeof Parent'
score: 3

http://stackoverflow.com/comment/42305015
type: Comment
type: QuestionComment
has text: If you are not a programmer and are asked to code you will naturally struggle to find solutions. Your best bet it to go to one of the free sites online and start learning. Here are a few you might try: Code School, Code Academy, Udemy, Coursera.
comment on: http://stackoverflow.com/q/26873361
score: 0

http://stackoverflow.com/comment/42462561
score: 1
type: AnswerComment
has text: It's worth noting that Array comprehensions [have been removed from the ES6 proposal in August](http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#august_24_2014_draft_rev_27) and are now apparently planned to be included in ES7.
type: Comment
comment on: http://stackoverflow.com/a/26921568

http://stackoverflow.com/a/26920740
type: Answer
downvote count: 0
score: 1
has body: It is a conversion of full time in seconds or something that as an X-data passed to your chart and since you change the min and max value of time it has been out of range value, so you have not any presentation of your data. I suggest you to write your own data conversion. In this case if you want to have daily values use something like this in X axis. xAxis: { min: 0, max: 86400, reversed: false, title: { enabled: true, text: 'Time' }, labels: { formatter: function () { return Math.floor(this.value/3600) + ":" + Math.floor((this.value%3600)/60); } } } And you need to pass data elements in format of [time_in_seconds, value] in each series.
upvote count: 1
answers question: http://stackoverflow.com/q/26920533

http://stackoverflow.com/comment/42504144
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26984488
has text: @TheMuffinMan I have already know these. But I don't want to use like that. I can understand my command and when there is problem, I usually fix them. Thank you for helping.

http://stackoverflow.com/comment/42479814
score: 0
comment on: http://stackoverflow.com/q/26972121
type: Comment
type: QuestionComment
has text: I have it link this.. `code` `code`

http://stackoverflow.com/comment/42349537
type: QuestionComment
comment on: http://stackoverflow.com/q/26897873
score: 0
type: Comment
has text: This looks fine to me so I'll ask the easy questions first to get them out of the way: Is the jQuery library included on this page? If so, does your console in developer tools say "$ is not a function"?

http://stackoverflow.com/a/26972302
downvote count: 0
type: Answer
score: 2
upvote count: 2
has body: I would highly encourage you to just send all of the data to the JS layer, and then having the execution delays handled by the UI side, but if you're interested in knowing why your sleep is not quite working - the explanation is here: What is output buffering? http://php.net/manual/en/function.ob-flush.php By default, most PHP configurations will store the entire page in a buffer, only sending it to the browser when the PHP script is completely finished. You can usually circumvent this behavior by forcing the output buffer to "flush" to the client whenever you want to send data to it immediately with ob_flush.
answers question: http://stackoverflow.com/q/26970628

http://stackoverflow.com/q/26900504
possible better answer: http://stackoverflow.com/a/26900530
type: Question
has answer: http://stackoverflow.com/a/26900530
tagged with: http://stackoverflow.com/tag/html
has title: Random image generation in Javascript
has body: I have a problem that I have been trying to figure out and I can't seem to find it online. I am new to Javascript and I really want to get the hang of it. Here is my problem. I want to be able to have an image on the screen. And when the program starts a random image is chosen from a set of images. For example. Lets say I have a green button, a blue button, and a red button. When the browser loads I want the button to be displayed at random from that set of images. Here is what I have so far, bear with me here I am still learning. Now from what I understand I have the image already there. And I am using document.getElementById to get the element of the tag right? I also have the random method to pick a number between 1 and 3. Now I just have to figure out how to make it pick between the other 2 images (blue button, and green button) Thanks for your time. EDIT: I'd like to be able to do this without the use of arrays or objects. &lt;body&gt; &lt;img src="red.jpg" id="numberOne"&gt; &lt;/body&gt; &lt;script&gt; var randomNumberOne = Math.ceil(Math.random() * 3); var numberOne = document.getElementById("numberOne"); &lt;/script &gt;
score: 0
has answer: http://stackoverflow.com/a/26900649
answer count: 3
has answer: http://stackoverflow.com/a/26900552
accepted answer: http://stackoverflow.com/a/26900649
type: AnsweredQuestion
tagged with: javascript

http://stackoverflow.com/comment/42430048
type: QuestionComment
score: 0
has text: There is benefit if your Model (data entities) is considerably different than how you want your ViewModel to be. This layer can do the conversion.
type: Comment
comment on: http://stackoverflow.com/q/26943342

http://stackoverflow.com/a/26908166
has body: I tested it here: http://jsfiddle.net/en50c13z/ : var u1 = 'http://www.anywebsite.com/this_is_my_text?some&amp;parameters and segment = "this_is_my_text"'; var u2 = 'http://www.anywebsite.com/this_is_my_textand segment = "this_is_my_text"'; if(u2.indexOf('segment') !== -1) { return alert('found'); } I just added '' in the if statement around 'segment' and it is working in both cases now, before this edit both were not working
type: Answer
has comment: http://stackoverflow.com/comment/42367302
score: 0
answers question: http://stackoverflow.com/q/26907965

http://stackoverflow.com/q/26871106
tagged with: javascript
has answer: http://stackoverflow.com/a/26871298
has answer: http://stackoverflow.com/a/26871181
favorite count: 0
has title: Check if all elements in array are strings
accepted answer: http://stackoverflow.com/a/26871200
has comment: http://stackoverflow.com/comment/42300860
answer count: 4
score: 30
linked to: http://stackoverflow.com/q/4059147
has comment: http://stackoverflow.com/comment/42300790
has answer: http://stackoverflow.com/a/26871200
has comment: http://stackoverflow.com/comment/42300833
upvote count: 30
possible better answer: http://stackoverflow.com/a/26871181
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42300779
downvote count: 0
has body: Is there a good way to check if all indexes in an array are strings? check(["asd", 123]); // false check(["asd", "dsa", "qwe"]); // true
has answer: http://stackoverflow.com/a/26871188
type: Question
duplicate of: http://stackoverflow.com/q/4059147
tagged with: arrays

http://stackoverflow.com/a/26969263
type: Answer
score: 2
has body: Code = 1 means "aborted" (MediaError.MEDIA_ERR_ABORTED = 1) see https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md#constants-1 So this usually means that there is something wrong with the path. Is song.mp3 in the same folder as your index.html? Maybe this helps: Playing local sound in phonegap You will need file://... only if you wanna play from the local filesystem.
downvote count: 0
answers question: http://stackoverflow.com/q/26951793
upvote count: 2

http://stackoverflow.com/a/26984347
answers question: http://stackoverflow.com/q/26983125
has body: Is there a reason for using iframes? Your "viewer" is larger than your content so it won't scroll if I understand your terminology correctly. Suggest you swap you heights around. Also, your content (img, text, etc) needs to be inside of a parent wrapper. If they are on the same DOM level there is relationship between the two and as such no scrolling. Example HTML &lt;div class="viewer"&gt; &lt;div class="content"&gt;&lt;/div&gt; &lt;/div&gt; CSS div.viewer { width: 2000px; height: 500px; overflow-x: scroll; } div.content { width: 2000px; height: 1000px; }
type: Answer
score: 0

http://stackoverflow.com/comment/42646951
score: 0
type: Comment
has text: What does the iframe look like when the port is closed?
type: QuestionComment
comment on: http://stackoverflow.com/q/26978472

http://stackoverflow.com/q/26941738
score: 0
accepted answer: http://stackoverflow.com/a/26980771
answer count: 1
has body: I am using Facebook's Object API to create my own custom open graph object. The object created itself just fine, with code like follows: FB.api( "https://graph.facebook.com/app/objects/article?access_token=token|secret", "POST", { "object": { "og:url": url, "og:title": title, "og:image": image } }, function(response) { // handle response } ); I then prompt a share dialog to open, like so: FB.ui({ method: 'share_open_graph', action_type: 'news.reads', action_properties: JSON.stringify({ article: 'https://graph.facebook.com/app/website/my_object_id' }) }, function(response) { // handle response }); The dialog opens, but it gives this error: "Object at URL https://graph.facebook.com/app/website/my_object_id has og:type of 'website'. The property 'article' requires an object of og:type 'article'." But didn't I just specify when creating that I was creating an article? Any ideas on where I'm going wrong? I'm just trying to create opengraph objects dynamically instead of using meta tags on an html page -- I have a list of items on the page that I want to allow the user to share as opengraph objects.
has comment: http://stackoverflow.com/comment/42492045
has title: Facebook Object API -- created as article, thinks it's website
type: AnsweredQuestion
tagged with: javascript
tagged with: facebook-graph-api
has answer: http://stackoverflow.com/a/26980771
type: Question
has comment: http://stackoverflow.com/comment/42437013
tagged with: facebook

http://stackoverflow.com/q/26971845
linked to: http://stackoverflow.com/q/1357118
has answer: http://stackoverflow.com/a/26971942
score: 0
type: Question
has answer: http://stackoverflow.com/a/26971951
has body: Here is my code : as expected, the form when submitted should call the submitform function, and if the name field is blank, it should return false and give an alert. But, it just goes through. Any explainations?
tagged with: javascript
has answer: http://stackoverflow.com/a/26972431
has answer: http://stackoverflow.com/a/26972177
has title: JavaScript custom validation not working
has answer: http://stackoverflow.com/a/26971919
has answer: http://stackoverflow.com/a/26971883
answer count: 7
has answer: http://stackoverflow.com/a/26972415
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/26909477
has comment: http://stackoverflow.com/comment/42369532
has comment: http://stackoverflow.com/comment/42369466
linked to: http://stackoverflow.com/q/12186366
has comment: http://stackoverflow.com/comment/42382515
answer count: 0
has comment: http://stackoverflow.com/comment/42369615
tagged with: d3.js
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/42369065
has comment: http://stackoverflow.com/comment/42394761
score: 1
tagged with: javascript
has title: D3.js time scale: nicely-spaced ticks at month intervals?
type: Question
has body: I'm using D3.js to create some simple bar graphs, and was using the d3.time.scale() for the x-axis. But, I stumbled upon one irregularity (or so it seems to me, although of course, I'm wrong :P) When I generate the scale with ticks at monthly intervals, the difference between the ticks is not equal. scaleX = d3.time.scale() .range([0, 1000]) .domain([new Date('2014-01'), new Date('2014-12')]) scaleX(new Date("2014-01")) // 0 scaleX(new Date("2014-02")) // 9.28... (diff ~ 9.3) scaleX(new Date("2014-03")) // 17.66... (diff ~ 8.4) scaleX(new Date("2014-04")) // 26.94... (diff ~ 9.3) This causes the bars in the graph to be unevenly spaced, leading to ugly graphs... What's the correct way to evenly space out the bars with months as ticks? I realize that there is the possibility to use an ordinal scale to do this, but it doesn't feel right, also the ordinal scale would not draw ticks for months for which I don't have any data. Edit: a little clarification on the question: Since SO is for programmers, I only asked the "correct way" to make the ticks evenly spaced out. But what I really want to ask is this: Is is acceptable to display time-charts with ticks of unequal length?
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/42369627

http://stackoverflow.com/a/28829494
has comment: http://stackoverflow.com/comment/55858844
downvote count: 0
type: Answer
has body: I solved it this way by editing the Javascript: onContentLoaded: function() { var imgh = $(".ekko-lightbox-container").find("img").height(); var winh = $(window).height(); if ((imgh+200)>winh) { $(".ekko-lightbox-container").find("img").css("height",winh-150).css("width","auto").css("margin","0 auto"); } }
upvote count: 1
answers question: http://stackoverflow.com/q/26875231
score: 1

http://stackoverflow.com/q/26975647
has comment: http://stackoverflow.com/comment/49110039
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/46208637
answer count: 1
has answer: http://stackoverflow.com/a/33294490
has body: I need to auto refresh the page when I'm on my custom view. But I don't seem to find a solution for that. First I tried to use auto_refresh attribute in action, but it seems it only works on GTK client (old GUI used in OpenERP version 6 and older) and does not on web. Like this: My action model.name tree,form [('state','=','open')] { 'search_default_not_printed': 1, } As I said, this one does not do anything. Then I tried to add javascript inside tree view, but I just get error, that you can't use script. Script I tried: Does anyone know how can I add such or similar script on tree view, so it would refresh the page after x seconds? Or if there is better way to do that, I'm open to suggestions of course.
tagged with: openerp-7
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/xml
has comment: http://stackoverflow.com/comment/49109966
type: Question
has title: Odoo - auto refreshing page when on specific view
has comment: http://stackoverflow.com/comment/74557523
tagged with: odoo

http://stackoverflow.com/comment/42393133
has text: Well this solution is kind of risky if the loop get out of control
comment on: http://stackoverflow.com/a/26918090
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/26915542
accepted answer: http://stackoverflow.com/a/26916238
tagged with: node.js
possible better answer: http://stackoverflow.com/a/26916110
has title: Why does Async.parallel callback return unexpected result?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26916110
type: Question
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/26916238
score: 0
tagged with: asynchronous
has body: the following function is an abstracted version of a little bit more complex function im working on. Can someone tell me why the callback of async.parallel returns a different value for the allitems array than waterfallfunction2 which return the array i expected? var async = require('async'); async.waterfall([ //Waterfallfunction 1 function(callback) { var allitems = []; async.parallel([ //Parallel 1 function(callback) { console.log("Waterfall 1 -&gt; parallel 1"); async.each([1, 2, 3, 4, 5, 6], function(item, callback) { allitems.push(item * 3); callback(null); }, callback(null)); }, //Parallel 2 function(callback) { console.log("Waterfall 1 -&gt; parallel 2"); async.each([1, 2, 3], function(item, callback) { allitems.push(item * 3 * 9); callback(null); }, callback(null)); }, //Parallel 3 function(callback) { console.log("Waterfall 1 -&gt; parallel 3"); async.each([1, 2, 3, 4, 5, 6, 7, 8, 9], function(item, callback) { allitems.push(item * 2); callback(null); }, callback(null)); } ], //Callback parallel completed function(err, results) { if (err) { callback(err); } console.log("Waterfall 1 parallel completed"); //I expect all item to be //[ 3, 6, 9, 12, 15, 18, 27, 54, 81, 2, 4, 6, 8, 10, 12, 14, 16, 18 ] console.log(allitems); // but it logs // [ 3, 6, 9, 12, 15, 18, 27, 54, 81 ] //pass allitems to the next function in waterfall callback(null, allitems); }); }, // Waterfallfunction2 //calculate items length function(allitems, callback) { var itemlength = allitems.length; //pass itemlength to next function callback(null, itemlength); }, //Waterfallfunction3 //Log Message function(itemlength, callback) { console.log("The array is " + itemlength + " long"); callback(null); } ], //Callbackfunction on Waterfall completed function(err, result) { if (err) { console.log(err); } console.log("operations completed!"); });

http://stackoverflow.com/q/26871936
has title: Frontend image slider is broken
type: UnansweredQuestion
type: Question
tagged with: magento
tagged with: javascript
tagged with: jquery
score: 0
has body: got to work on a site as a rookie, usualy im working in dreamweaver and do also hardcoding in html and css thats why i tryed to do so in magento i went to the cms / static block section to do a change, but since then my slider on the frontside is just not working anymore. i guess the js script is broken down. heres the script in the cms / static block any sugestion why it doesnt work seen on www.ungezogen-angezogen.ch thanks for your help
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/26871966
tagged with: css

http://stackoverflow.com/q/26895551
score: 1
tagged with: class
has answer: http://stackoverflow.com/a/26908314
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: backbone.js
has body: It can be difficult to find these kinds of questions since they can be phrased so many different ways, so please forgive me if this is a duplicate. I'd like to define class variables on a backbone model in such a way that they are still available on instances. This could be done like so: var foo_base = { foo: bar }, FooModel = Backbone.Model.extend(foo_base, foo_base); But this is quite ugly as it involves feeding the same object as both the instance and class prototype. Is there a simpler way to do this that involves only one use of foo_base or foo?
has title: python-style class variables in javascript
type: UnansweredQuestion
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/42344775

http://stackoverflow.com/a/26943673
answers question: http://stackoverflow.com/q/26943500
type: Answer
score: 0
has body: There are some subtleties in different hosts. Try to call a session variable in that file without declaring it just for the transition without AJAX. If it was produced then everything should work, if not then ask your hosting provider if you do not need to specify the path to session in php.ini. Further check encoding the files themselves that they are UTF-8 without BOM. Since you run the files on one server session variable does not necessarily send POST means it should be easily retrieved using the session_start () at the beginning of the file ...

http://stackoverflow.com/a/26909954
downvote count: 0
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/42369567
score: 1
has body: At the moment you are not accessing j as a variable, it's just being written as a piece of the string. You need to break the string and reconnect it.. replace buff += " "; with buff += " "; or change it to buff += ' ';
accepted answer of: http://stackoverflow.com/q/26909585
answers question: http://stackoverflow.com/q/26909585
type: AcceptedAnswer

http://stackoverflow.com/q/26842039
has answer: http://stackoverflow.com/a/26842217
answer count: 4
has comment: http://stackoverflow.com/comment/42247898
has comment: http://stackoverflow.com/comment/42248062
has answer: http://stackoverflow.com/a/26842109
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26842157
type: Question
has body: The two method below are not working for me; I need the button click event to fire with the document onready event. (#usrpost is a button element.) $(function() { $("#usrpost").trigger("click"); $("#usrpost").live("click",function() { //do something. }); }); I've also tried the following: $(function() { $("#usrpost")[0].click(); $("#usrpost").live("click",function() { //do something. }); });
has title: How to simulate a click event when document onready?
tagged with: javascript
has comment: http://stackoverflow.com/comment/42247855
tagged with: jquery
accepted answer: http://stackoverflow.com/a/26842109
score: 0
possible better answer: http://stackoverflow.com/a/26842112
has answer: http://stackoverflow.com/a/26842112

http://stackoverflow.com/comment/42325088
has text: @Gregory Ch: "I tried comparing but the way that I did it was wrong" --- we obviously cannot help you with code that you haven't provided.
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/26884797

http://stackoverflow.com/comment/42519956
comment on: http://stackoverflow.com/q/26991679
has text: Possible near duplicate: [How much percent the string match the regex](http://stackoverflow.com/questions/23398552/how-much-percent-the-string-match-the-regex)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26888692
answers question: http://stackoverflow.com/q/26886976
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/42407437
accepted answer of: http://stackoverflow.com/q/26886976
upvote count: 1
has body: Okay, so I have given this a good old try. Basically I have hidden the scroll bar, made it sit inside of the navigation and used some JQuery to scroll the items in the navigation with hovering and still be responsive. You may need to tinker to get it exactly to how you want. JSFiddle CSS .sf-navbar &gt; li &gt; ul { /* removed min width that was here */ overflow:hidden; } /*altered*/ .sf-navbar li ul{ width: 100%; overflow-x: hidden; } .sf-navbar &gt; li &gt; ul &gt; li { display: inline-block; } /*added*/ .sf-navbar li ul:hover { overflow-x:hidden } JS $.fn.scrollList = function (delay) { delay = delay || 2000; var animateList = function ($list) { //get first child var $first = $list.children('li:first'); var width = $first.outerWidth(true); //animate first two off the screen $first.animate({ 'margin-left': $list.width() * -1 }, // on animation complete function () { //reset and move to the end of the list $(this).css('margin-left', 0).add($(this).next()).appendTo($list); //start again after delay setTimeout(function () { animateList($list) }, delay); }); }; return this.each(function () { var $that = $(this) setTimeout(function () { animateList($that); }, delay); }); }; $('.sf-menu ul').scrollList();
score: 1

http://stackoverflow.com/comment/42376799
type: QuestionComment
comment on: http://stackoverflow.com/q/26913573
score: 0
has text: @JamesThorpe where is the whitespace? Please show.
type: Comment

http://stackoverflow.com/q/26937021
upvote count: 0
answer count: 1
tagged with: jquery
tagged with: parallax
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/42418665
has body: Im trying to make responsive parallax effect on my website. I have this structure: aSs lorem ipsum dolor sit amet Ogólnie znana teza głosi, iż użytkownika moze rozpraszać zrozumiała zawartośc strony, kiedy ten chce zobaczyć sam jej wygląd. Zobacz naszych pracowników > CSS: #first{ background: url(../images/tlo1.jpg) no-repeat; width: 100%; background-size: cover; background-position: 50%; height: 699px; text-align: center; position: relative; white-space: nowrap; } .fixed{ position:fixed; top: 300px; left: 0; } .static{ position: absolute; left:0; bottom: 0; } .text{ display: inline-block; vertical-align: middle; white-space: normal; background: #fff; padding: 30px 0; width: 100%; color: #7B7878; font-size: 16px; font-weight: 300; } Js: pozycjaBlueBox = $("#first").offset().top + $('#first').height(); $(document).scroll(function(){ if($(window).width() <=1024){ pozycjaScrolla = $(window).scrollTop() + $("#first .text").offset().top+$("#first .text").height(); }else{ pozycjaScrolla = $(window).scrollTop() + $("#first .text").offset().top-60; } if($(window).width() > 768){ if(pozycjaScrolla >= pozycjaBlueBox){ $("#first .text").removeClass('fixed').addClass('static'); }else{ $("#first .text").removeClass('static').addClass('fixed'); } } }); I want to have fixed text class until the bottom of this class doesn't comes into contact with the top of #second. It works well on large desktops but when I resize to lower resolution it's mess.
has comment: http://stackoverflow.com/comment/42418594
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/42418796
has answer: http://stackoverflow.com/a/26938434
score: -4
has title: How to make parallax effect
has comment: http://stackoverflow.com/comment/42418276
downvote count: 4

onclicklistener
tag name: onclicklistener
tags question: http://stackoverflow.com/q/26856902
type: Tag

http://stackoverflow.com/comment/42439793
comment on: http://stackoverflow.com/q/26947904
has text: How do you construct `Validations` object?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26913439
has body: I think somewhere in your scope, x is being clobbered. You use it in pretty much every function and the scope chain will silently punish you for it once you make a mistake. I can guarantee that changing those x references to meaningful names will solve this. The problem is unlikely to be in the code block since it works most times. Something is clobbering it. It's similar to a problem I had not too long ago: https://twitter.com/akamaozu/status/525494000288284672 That is to say ... x is being overwritten somewhere. I don't know where since it'll take a much deeper look at your code to identify where the real problem is, but change those x variables to something that actually makes sense. This will do two things: make your code worlds more readable prevent x from being hoisted
upvote count: 1
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/26912927
has comment: http://stackoverflow.com/comment/42399009
has comment: http://stackoverflow.com/comment/42376514

http://stackoverflow.com/q/26924989
has body: I want to use SVG Progress as loading in my product. I found this below SVG Progress in Code pen. It working fine when it's radius value is 90. if i change the radius value, It will not working. Something wrong calculation in javascript. Thanks. $('#percent').on('change', function(){ var val = parseInt($(this).val()); var $circle = $('#svg #bar'); if (isNaN(val)) { val = r; } else{ var r = $circle.attr('r'); var c = Math.PI*(r*2); if (val < 0) { val = 0;} if (val > 100) { val = 100;} var pct = ((100-val)/100)*c; $circle.css({ strokeDashoffset: pct}); $('#cont').attr('data-pct',val); } }); #svg circle { stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; stroke: #666; stroke-width: 5px; } #svg #bar { stroke: #FF9F1E; } #cont { display: block; height: 200px; width: 200px; margin: 2em auto; border-radius: 100%; position: relative; } #cont:after { position: absolute; display: block; height: 160px; width: 160px; left: 50%; top: 50%; content: attr(data-pct)"%"; margin-top: -80px; margin-left: -80px; border-radius: 100%; line-height: 160px; font-size: 2em; text-shadow: 0 0 0.5em black; } input { color: #000; } /* Make things perty */ html { height: 100%;} body { font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif; background: url(http://www.jmchristensendesign.com/wp-content/themes/jmcdsn/images/intro_default-background.jpg); color: #fff; height: 100%; padding-top: 2em; text-align: center;} h1, h2{ margin: 0; text-transform: uppercase;text-shadow: 0 0 0.5em black;} h2 { font-weight: 300} input { border: 1px solid #666; background: #333; color: #fff; padding: 0.5em; box-shadow: none; outline: none !important; margin: 1em auto; text-align: center;} Type a percent!
has answer: http://stackoverflow.com/a/26926206
linked to: http://stackoverflow.com/q/26781576
has comment: http://stackoverflow.com/comment/42398063
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 1
favorite count: 0
duplicate of: http://stackoverflow.com/q/26781576
has title: SVG progress not working when change the radius value. how to use this progress in different sizes?
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/26926206
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42396693
tagged with: http://stackoverflow.com/tag/svg
upvote count: 1
type: Question

http://stackoverflow.com/comment/42319526
score: 0
type: QuestionComment
type: Comment
has text: You can use a cookie to store the selected option. The cookie will be triggered on clicking the Check button.
comment on: http://stackoverflow.com/q/26881751

http://stackoverflow.com/a/26913959
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/42377106
score: 3
answers question: http://stackoverflow.com/q/26913846
has body: It seems like you're checking against the value and not the key; maybe something like this? var key = undefined; for(var i in matches) { if (matches[i] === option) {key = i; break; } } if (key !== undefined) delete matches[key];
downvote count: 0

http://stackoverflow.com/a/26925041
type: Answer
has comment: http://stackoverflow.com/comment/42399346
has comment: http://stackoverflow.com/comment/42397200
has comment: http://stackoverflow.com/comment/42397018
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/42398859
has comment: http://stackoverflow.com/comment/42399171
has comment: http://stackoverflow.com/comment/42398941
has comment: http://stackoverflow.com/comment/42399705
has body: Looks like you're not closing &lt;select, I think you need echo &lt;/select&gt; as well. For the handler try ac(document).on("click", "#RegionName" You also have a var RegionName=ab("#RegionName").val(); which should be var RegionName=ac("#RegionName").val(); update: line should be RegionName=ac(this).val(); Update2 Change echo "&lt;option value=".$value."&gt;".$value."&lt;/option&gt;"; to echo "&lt;option value='".$value."'&gt;".$value."&lt;/option&gt;";
has comment: http://stackoverflow.com/comment/42398682
has comment: http://stackoverflow.com/comment/42399556
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42400177
answers question: http://stackoverflow.com/q/26924939
has comment: http://stackoverflow.com/comment/42399072
accepted answer of: http://stackoverflow.com/q/26924939

http://stackoverflow.com/q/26917064
has comment: http://stackoverflow.com/comment/42382695
tagged with: google-chrome
has title: chrome detect when computer wakes up from idle state
type: AnsweredQuestion
tagged with: javascript
possible better answer: http://stackoverflow.com/a/62383822
type: Question
has comment: http://stackoverflow.com/comment/42383759
has answer: http://stackoverflow.com/a/62383822
answer count: 2
has body: I'm making a Chrome extension that receives Chrome Google Cloud Messages. I want to detect when computer wakes up from sleep/reconnects to internet, so that my application can start receiving messages again. For my specific case, I don't want GCM to throttle the pushes, so I set the ttl to 0, which is deliver now or never. (user device will never receive message while idle.) In javascript, how do I detect when Chrome browser recovers from idle state? More specifically, how could I do it in Chrome extension using chrome. api calls?
upvote count: 6
favorite count: 0
accepted answer: http://stackoverflow.com/a/26935596
tagged with: google-chrome-extension
has answer: http://stackoverflow.com/a/26935596
downvote count: 0
has comment: http://stackoverflow.com/comment/42383049
score: 6

http://stackoverflow.com/q/26960041
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/26962667
type: Question
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/26962667
tagged with: data-visualization
tagged with: http://stackoverflow.com/tag/html
tagged with: d3.js
has title: Cannot read property of undefined - D3 hive plot
has body: I've been trying to create a hive plot for a protein interaction data. When I run this code (Work in Progress), there's no hive plot; Also, the web inspector shows an error: "cannot read property 'type' of undefined." *When I change the code to nodes.type, nodes.position, links.SourceNode.type in the draw links portion, it throws a weird error, along with the previous error: Error: Invalid value for attribute d="MNaN,NaNCNaN,NaN NaN,NaN NaN,NaN" samplehiveplot.html:1 Uncaught TypeError: Cannot read property 'type' of undefined * &lt;!DOCTYPE html&gt; &lt;meta charset="utf-8"&gt; &lt;style&gt; .axis { stroke: #000; stroke-width:1.5px; } .node { stroke:#000; } .link { fill: none; stroke-width: 1.5px; stroke-opacity: 0.8; } .link.turnedOn { stroke-width: 3px; } .link.turnedOff { stroke-opacity: 0.3; stroke-width: 1px; } .node.turnedOn { stroke: red; stroke-width: 3px; } &lt;/style&gt; &lt;body&gt; &lt;script src="http://d3js.org/d3.v3.min.js"&gt;&lt;/script&gt; &lt;script src="http://d3js.org/d3.hive.v0.min.js"&gt;&lt;/script&gt; &lt;script&gt; var width = 1000, height = 1000, innerRadius = 20, outerRadius = 240; var angle = d3.scale.ordinal() .domain(d3.range(4)) .rangePoints([0, 2 * Math.PI]), radius = d3.scale.linear() .range([innerRadius, outerRadius]), color = d3.scale.category10() .domain(d3.range(20)); var nodes = [{"number":1,"type":0,"position":0.1,"name":"TFC3","group":"yal001c"}, {"number":2,"type":2,"position":0.1003,"name":"SSA1","group":"yal005c"}, {"number":3,"type":2,"position":0.1006,"name":"TPD3","group":"yal016w"}, {"number":4,"type":2,"position":0.1009,"name":"CCR4","group":"yal021c"}, {"number":5,"type":2,"position":0.1012,"name":"PMT2","group":"yal023c"}, {"number":6,"type":2,"position":0.1015,"name":"LTE1","group":"yal024c"}, {"number":7,"type":2,"position":0.1018,"name":"YAL028W","group":"yal028w"}, {"number":8,"type":2,"position":0.1021,"name":"MYO4","group":"yal029c"}, {"number":9,"type":2,"position":0.1024,"name":"SNC1","group":"yal030w"}, {"…
type: AnsweredQuestion

http://stackoverflow.com/comment/42311287
score: 1
comment on: http://stackoverflow.com/a/26877056
type: AnswerComment
has text: This is correct^: *"Inside the function, write an if statement where if the **number of hours** of sleep is greater than or equal to 8"*... But really... This is a problem of not following instructions, not coding.
type: Comment

http://stackoverflow.com/q/26900391
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26900880
has title: Issue on Getting Selected Row Values From Table with Checkbox
has body: Demo Can you please take a look at above demo and let me know why I am not able to get the values of selected (checked) rows from the table? I have a code like this: $("#btn").on("click", function () { var checkedRows = []; $("#tbody tr").each(function () { if ($(this).find("input").is(":checked")) { checkedRows.push($(this).find("td:eq(1)").html()); } // console.log(checkedRows); }); var result = []; $.each($("td:eq()"), function (idx, item) { if (checkedRows.indexOf(idx> -1)){ result.push(item);} }); if (result.length < 2) { alert("Please Select 2 to 4 Models"); } if (result.length > 4) { alert("Please Select 2 to 4 Models"); } else { console.log(result); } }); and HTML as: Row 1, cell 2 Row 2, cell 3 Row 2, cell 2 Row 2, cell 3 Row 3, cell 2 Row 3, cell 3 Row 4, cell 2 Row 4, cell 3 Row 4, cell 2 Row 4, cell 3 Thanks, Update result = [ [' Row 1, cell 2 ' , ' Row 2, cell 3 '], [' Row 2, cell 2 ' , ' Row 2, cell 3 '], [' Row 1, cell 2 ' , ' Row 2, cell 3 '] ]
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42354686
score: 0
has answer: http://stackoverflow.com/a/26900458
has comment: http://stackoverflow.com/comment/42354465
has comment: http://stackoverflow.com/comment/42354707
has answer: http://stackoverflow.com/a/26900880
has comment: http://stackoverflow.com/comment/42354105
possible better answer: http://stackoverflow.com/a/26900458
type: Question

http://stackoverflow.com/comment/42297626
type: Comment
comment on: http://stackoverflow.com/a/26868913
score: 1
type: AnswerComment
has text: @John : `function convert_accented_characters(str){ var conversions = new Object(); conversions['-'] = ' ';// add this `

http://stackoverflow.com/a/26909615
downvote count: 0
has body: You don't need $.when for synchronous function calls, just call them $.get(url, function (result, status, xhr) { var myresult = result; requestTwo(); // DO something here, it's synchronous and single threaded, // so the function will be finished });
type: Answer
score: 1
answers question: http://stackoverflow.com/q/26909562
upvote count: 1

http://stackoverflow.com/q/26949529
tagged with: javascript
tagged with: aptana
has answer: http://stackoverflow.com/a/26998738
has title: Dojo syntax for Eclipse Aptana plugin
tagged with: dojo
accepted answer: http://stackoverflow.com/a/26998738
type: AnsweredQuestion
has body: Using Aptana plugin for Eclipse version 3.7. Working on Dojo-powered project. Aptana would mark every line that has Dojo tags (e.g. data-dojo-type) as incorrect syntax. What is the workaround to stop Eclipse from marking those tags as syntax errors? Is there any way to at least add Dojo-tags as exceptions?
has comment: http://stackoverflow.com/comment/42444861
tagged with: eclipse
type: Question
score: 0
has comment: http://stackoverflow.com/comment/42527790
answer count: 1

http://stackoverflow.com/a/26871547
has body: I would try to measure memory consumption in the JavaScript execution environment you use. E.g.for the chrome browser, you can use this memory profiling guide. Your mentioning of data files suggests that your code runs on the server, probably node.js. I would have a look at this.
upvote count: 1
answers question: http://stackoverflow.com/q/26862132
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/26915600
accepted answer: http://stackoverflow.com/a/26917158
has title: Using EventEmitter instead of callback?
answer count: 1
has comment: http://stackoverflow.com/comment/42380296
tagged with: javascript
favorite count: 0
score: 0
linked to: http://stackoverflow.com/q/4296505
has comment: http://stackoverflow.com/comment/42379979
tagged with: events
tagged with: node.js
linked to: http://stackoverflow.com/q/18095107
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26917158
upvote count: 2
has comment: http://stackoverflow.com/comment/42379899
downvote count: 2
has body: I have a code which makes an ajax call, which has a callback. Is there a way i can replace the callback with an event emitter. Below is my code. var _getPoll = function(params){ var url = "http://localhost/poll" console.log(url); request({ headers: { accept: 'application/json' }, uri: url, method: 'GET' }, function(err, response, body){ body = JSON.parse(body); console.log(body); }) } Is it possible to replace the callback with an EventEmitter like below. function(err, response, body){ body = JSON.parse(body); console.log(body); } Replace this.emit('jsonResponse', err, response, body);
type: Question
linked to: http://stackoverflow.com/q/22539815
has comment: http://stackoverflow.com/comment/42380346
has comment: http://stackoverflow.com/comment/42380501

http://stackoverflow.com/q/26906879
has comment: http://stackoverflow.com/comment/42364796
has answer: http://stackoverflow.com/a/26907994
accepted answer: http://stackoverflow.com/a/26907994
type: Question
possible better answer: http://stackoverflow.com/a/26907359
answer count: 2
has comment: http://stackoverflow.com/comment/42364226
has answer: http://stackoverflow.com/a/26907359
has comment: http://stackoverflow.com/comment/42364446
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/42364657
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has comment: http://stackoverflow.com/comment/42364397
favorite count: 0
upvote count: 0
tagged with: angularjs
tagged with: model-view-controller
type: AnsweredQuestion
has title: Angular js:How to append the data into the HTML
has body: Hi I am implementing a website in angularjs. I am facing a problem. I have a widget which shows 10 records at a time, when i click on view more button it fetches next 10 records based on page number. I have implemented a button ` click here for Recs Now on click of the button I am calling the controller and getting the data like so:- $scope.loadRated = function(flag){ if(flag==true) { $rootScope.TopPge +=1; } // call api var $ratedSpinner = $('.rated-spin'); loading('show',{element: $ratedSpinner}); userAPI.topRated({userid: $rootScope.getUser().userid, pageno:$rootScope.TopPge}, function(r){ var loading = $filter('loading'); loading('hide', { element: $('#loadIndicator2') }); $scope.ratedLoaded = true; loading('hide',{element: $ratedSpinner}); $scope.programs.rated = r.gettopratedhomepage.topratedprogrammelist; var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-398742-8']); _gaq.push(['_trackEvent','WOITopRated','TopRated','Load']); for(i=0; i<$scope.programs.rated.length; i++){ //abbreviates the month $scope.programs.rated[i].timestring = abbrMonth($scope.programs.rated[i].timestring) ; } // called with timeout for dom creation setTimeout(function(){ if(openTabIndex === 3) { showTab(openTabIndex); } showMoreOnTab(3); }, 5); }); }; ` I am getting the data via api call. Th Html code is as follows:- No Results for Rated. click here for Rated Now the problem I am facing is The data which is fetched replaces the older content in the target div. I want to append it.

http://stackoverflow.com/comment/42322782
score: 0
type: Comment
type: QuestionComment
has text: Upvoted. This is actually a good question for beginners. (But where is bootstrap?)
comment on: http://stackoverflow.com/q/26882280

http://stackoverflow.com/comment/42316801
score: 0
type: QuestionComment
type: Comment
has text: What exactly is your goal? I tried to answer your question below, but I'm not entirely sure what you're trying to do. Could you elaborate?
comment on: http://stackoverflow.com/q/26880198

http://stackoverflow.com/a/27021464
upvote count: 2
type: AcceptedAnswer
type: Answer
has body: JstMixedType seems to accumulate multiple types and concatenates their names. In your case it contains itself (or a proxy around itself, exactly spoken). This should not happen. This seems to be a bug in the VJET core and should be reported. Possibly you can work around the bug by adapting your configuration/code. Do you have any mixed types which contain themselves? Is this intended? (it probably is) If no, change them.
answers question: http://stackoverflow.com/q/26911263
accepted answer of: http://stackoverflow.com/q/26911263
score: 2
downvote count: 0

http://stackoverflow.com/a/26908617
type: Answer
accepted answer of: http://stackoverflow.com/q/26908440
has body: Spelling is off here - the ProductResource-factory is defined as .factory("productResource") with lowercase p: (function () { "use strict"; angular .module("productManagement") .controller("ProductListCtrl", ["ProductResource", ProductListCtrl]); function ProductListCtrl(productResource) { var vm = this; productResource.query(function (data) { vm.products = data; }); vm.showImage = false; vm.toggleImage = function () { vm.showImage = !vm.showImage; } } }());
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26908440

http://stackoverflow.com/comment/46935256
comment on: http://stackoverflow.com/q/26928924
has text: I can write you an example later. But in your case, have the Service returns a promise rather than actual data. Once it's resolved, retrieve the data in your MyController, that means your Service must have a method or property that returns a cached data. I hope that helps.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/80867346
comment on: http://stackoverflow.com/q/26891083
type: Comment
has text: Any idea why I am not seeing second local storage entry for stackauth.com in my chrome debugger tools? Is this changed?
type: QuestionComment
score: 1

http://stackoverflow.com/comment/42442848
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26950853
has text: When you say `Direction`, how do you plan on describing this? For example - you could you an angle (θ) relative to the x axis. The method of describing this is important to your answer. javascript is really irrelevant as the implementation would be the same regardless of the language.

http://stackoverflow.com/q/26988562
has comment: http://stackoverflow.com/comment/42509742
tagged with: sms
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42516988
upvote count: 1
has comment: http://stackoverflow.com/comment/42509328
has comment: http://stackoverflow.com/comment/42510089
type: Question
has comment: http://stackoverflow.com/comment/42510455
has comment: http://stackoverflow.com/comment/42509648
has comment: http://stackoverflow.com/comment/42509256
has body: I have a problem. I wanted to get data from webview pass to native application in IOS. I had searched on the internet but I tried manay solution they didn't work for me. My objective is I wanted click on a button in Webview it will remote open the SMS in Native app and set data to body of SMS from Webview. Please help me. Thanks for in advance.
downvote count: 0
tagged with: ios
answer count: 1
tagged with: javascript
score: 1
tagged with: uiwebview
favorite count: 0
has answer: http://stackoverflow.com/a/26989267
has title: How to get data from UIWebView pass to Native app in Objective-c IOS
has comment: http://stackoverflow.com/comment/42509545

http://stackoverflow.com/q/26887621
downvote count: 0
tagged with: javascript
has title: What are good choices for keyboard shortcuts that work in all browsers, on all platforms?
score: 1
tagged with: cross-browser
favorite count: 0
has comment: http://stackoverflow.com/comment/42332109
type: UnansweredQuestion
has body: For a website project, I've gotten a customer request to build in a keyboard shortcut for a specific action (show total budget). I thought about what would be the best choice for a shortcut to work on all platforms/browsers and initially chose Alt+Shift+B, but noticed after a while that that combination seems to be a shortcut to open a menu action in Firefox (on Windows). So the question is, is there a list of keyboard shortcuts which are likely to work on all platforms, not interfere with system or browser shortcuts, and don't generate output (i.e. in &lt;input&gt; tags)? Note: Of course I can't avoid all failure cases, like other applications globally registering and "catching" the shortcut I want to use; this is intended to work on the average system (Mac/Windows/Linux &amp; Chrome/Firefox/IE/Safari/Opera).
has comment: http://stackoverflow.com/comment/42332152
answer count: 0
tagged with: cross-platform
upvote count: 1
type: Question
tagged with: browser

http://stackoverflow.com/a/26912174
has body: Yeah, that's definitely doable! You can hide all but the first two columns like this: table.collapsed th:not(:nth-child(1)):not(:nth-child(2)), table.collapsed td:not(:nth-child(1)):not(:nth-child(2)) { visibility: hidden; } And then just rig up some javascript to remove the collapes class from the table when you click the arrow. Here is a very, very rough prototype based on the jsfiddle you provided: http://jsfiddle.net/TweNm/2341/
accepted answer of: http://stackoverflow.com/q/26910275
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26910275
has comment: http://stackoverflow.com/comment/42375645
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/a/26907572
has comment: http://stackoverflow.com/comment/42365688
has comment: http://stackoverflow.com/comment/42365389
type: Answer
answers question: http://stackoverflow.com/q/26907454
has body: You can use this code : &lt;script&gt; var d = new Date();//date you want to convert to timestamp alert(d.getTime());//this is how you can convert any date to timestamp &lt;/script&gt; in your case you can simple write: &lt;script&gt; var formattedDays = intervalStart.split(" ")[0].split("-"); var epoch = new Date(formattedDays[2], formattedDays[1] - 1, formattedDays[0]).getSeconds; var timestamp = intervalStart.getTime(); &lt;/script&gt; for more info, please check this question. How do you get a timestamp in JavaScript?
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/42365505
score: -1

http://stackoverflow.com/comment/42453499
comment on: http://stackoverflow.com/q/26956877
type: Comment
type: QuestionComment
score: 0
has text: that's why I asked if it is CORS enabled. Google the error

http://stackoverflow.com/comment/42390357
has text: @MaxBumaye it's a jQM error `.ui-mobile body { height: 99.9%; }` it should be `.ui-mobile .ui-mobile-viewport` because `body` isn't always pagecontainer. https://github.com/jquery/jquery-mobile/pull/7841
type: AnswerComment
comment on: http://stackoverflow.com/a/26920806
type: Comment
score: 1

http://stackoverflow.com/comment/42493465
type: Comment
has text: ...and `car["sts"]` is not defined ;-)
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/26979466

android
tags question: http://stackoverflow.com/q/26928993
tags question: http://stackoverflow.com/q/26981524
tags question: http://stackoverflow.com/q/26892572
tags question: http://stackoverflow.com/q/26906859
tags question: http://stackoverflow.com/q/26990829
tags question: http://stackoverflow.com/q/26951793
tags question: http://stackoverflow.com/q/26920132
tags question: http://stackoverflow.com/q/26958766
tags question: http://stackoverflow.com/q/26907211
tags question: http://stackoverflow.com/q/26906127
tags question: http://stackoverflow.com/q/26955469
tags question: http://stackoverflow.com/q/26886161
tags question: http://stackoverflow.com/q/26952224
tags question: http://stackoverflow.com/q/26991714
tags question: http://stackoverflow.com/q/26974481
tags question: http://stackoverflow.com/q/26973625
tags question: http://stackoverflow.com/q/26955419
tags question: http://stackoverflow.com/q/26962464
tags question: http://stackoverflow.com/q/26972639
tags question: http://stackoverflow.com/q/26963435
tags question: http://stackoverflow.com/q/26942137
tags question: http://stackoverflow.com/q/26858670
tags question: http://stackoverflow.com/q/26910122
tags question: http://stackoverflow.com/q/26852391
tags question: http://stackoverflow.com/q/26944312
tags question: http://stackoverflow.com/q/26879386
tags question: http://stackoverflow.com/q/26900815
tags question: http://stackoverflow.com/q/26925637
tags question: http://stackoverflow.com/q/26880437
tags question: http://stackoverflow.com/q/26842354
tags question: http://stackoverflow.com/q/26883312
tags question: http://stackoverflow.com/q/26847878
tags question: http://stackoverflow.com/q/26893911
tags question: http://stackoverflow.com/q/26859554
tags question: http://stackoverflow.com/q/26971021
tags question: http://stackoverflow.com/q/26832578
tags question: http://stackoverflow.com/q/26893517
tags question: http://stackoverflow.com/q/26901712
tags question: http://stackoverflow.com/q/26836652
tags question: http://stackoverflow.com/q/26877159
tags question: http://stackoverflow.com/q/26870013
tags question: http://stackoverflow.com/q/26863397
tags question: http://stackoverflow.com/q/26947611
tags question: http://stackoverflow.com/q/26960901
tags question: http://stackoverflow.com/q/26840322
tags question: http://stackoverflow.com/q/26922097
tags question: http://stackoverflow.com/q/26969519
tag name: android
tags question: http://stackoverflow.com/q/26983484
tags question: http://stackoverflow.com/q/26849670
type: Tag
tags question: http://stackoverflow.com/q/26906479
tags question: http://stackoverflow.com/q/26907932

http://stackoverflow.com/q/26913498
possible better answer: http://stackoverflow.com/a/26914503
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42376551
has comment: http://stackoverflow.com/comment/42376370
accepted answer: http://stackoverflow.com/a/26914071
type: Question
has title: How to get my script working in wordpress
answer count: 2
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/42376661
has answer: http://stackoverflow.com/a/26914071
has body: I've got a fairly complicated script which uses Google Geolocation API and Timezone API and I want to integrate it into my wordpress page. The script includes showing a Google map. Where to start? I tried just pasting the code into the wordpress page code editor but that doesn't work.
has answer: http://stackoverflow.com/a/26914503
tagged with: google-api
tagged with: wordpress

http://stackoverflow.com/q/26949320
score: 0
tagged with: knockout.js
has comment: http://stackoverflow.com/comment/42448928
tagged with: http://stackoverflow.com/tag/json
has body: I am new to knockout.js. What I want to do is for teachers to create questions and save these to a json file which will be later user in another app to display questions at randon. The last part works. If I have a json file with data, the app loads the data. I would like several questions to be added to the json file. So, I really do not quite understand how to use knockout. Here is the code I used and of course it does not work. The html is: Enter question text here: Enter answer 1 or distractor here: Enter answer 2 or distractor here: Enter answer 3 or distractor here: Enter answer 4 or distractor here: Enter correct answer number here: Enter the image name: Enter feedback info here: Submit ` And the code is: function viewModel(){ var self = this; self.question = ko.observable(); self.answer1 = ko.observable(); self.answer2 = ko.observable(); self.answer3 = ko.observable(); self.answer4 = ko.observable(); self.correctAnswer = ko.observable(); self.image = ko.observable(); self.feedbackInfo = ko.observable(); // send data for json file self.save = function(){ $.ajax('libs/data', { data: ko.toJSON({ question: self.question, answer1: self.answer1, answer2: self.answer2, answer3: self.answer3, answer4: self.answer4, correctAnswer: self.correctAnswer, image: self.image, feedbackInfo: self.feedbackInfo }), type:POST, contentType:"application/json", success: function(result){alert(result)} }); }; }; ko.applyBindings(viewModel);
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42462693
has comment: http://stackoverflow.com/comment/42528358
has comment: http://stackoverflow.com/comment/42441826
answer count: 0
tagged with: javascript
type: Question
has title: save data to json with knockout

http://stackoverflow.com/q/26964513
has title: Change class of li element using Jquery
type: Question
possible better answer: http://stackoverflow.com/a/26964629
has comment: http://stackoverflow.com/comment/42466801
has body: I have a navigation which highlights the currently selected navigation point by using the class active. When a user visits a new navigation point, i want to toggle of the "old" selected navigation point and toggle the class of the li element of the new navigation point to "active". I have problems with the jquery part, which only should change toggle of the li class of the old element and adds the class to the clicked li element. Probably a standard situation, but I don't know a good and easy solution for this. Example (before click): Dashboard Dashboard2 Result (after click on "Dashboard2"): Dashboard Dashboard2 My try $(".x-navigation li").on("click", "a", function(){ event.preventDefault(); //alert("test"); ($this).parent().removeClass("active"); ($this).addClass("active"); //alert($this.child().href); }); Error description: Uncaught ReferenceError: $this is not defined at this row: "($this).parent().removeClass("active"); Shouldn't be $this the li element which got clicked ? I hope you guys can help me with such a standard problem.
tagged with: javascript
tagged with: jquery
score: 4
answer count: 2
accepted answer: http://stackoverflow.com/a/26964536
upvote count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/26964629
has answer: http://stackoverflow.com/a/26964536
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/q/26949444
upvote count: 1
has title: Show a subset of context-menu items based on the content of the selected text (firefox addon)
answer count: 1
type: AnsweredQuestion
tagged with: firefox
downvote count: 0
tagged with: javascript
score: 1
has answer: http://stackoverflow.com/a/26950895
favorite count: 0
type: Question
tagged with: firefox-addon
has body: I have a firefox context menu with a selectionContext and three items on that menu. In the menu I have a content script which listens for an onclick event and it gets the item that was clicked and the selected text. That all works fine. Menu item1 item2 item3 I am trying to only show a subset of the menu items based on the content of the selected text as not all of them will apply in all cases. In addition to the above I have tried to add a selectionContext and another content script to each item which listens for on context. Using this method I can get the selected text but the item never shows in the menu because it is cancelled out by the item's content script which listens for an oncontext event. The Menu's onclick content script is then never applied to the item. I know I can add and remove Items with menu.addItem() and menu.removeItem(). If I use the onclick content script the items will not be updated until after they are clicked by which point it is too late but I must keep the onclick so the user can click the items. If I add an oncontext content script to the items or the menu then the items or menu do not show because the oncontext beats the onclick. I would be grateful if anyone could advise me on how to show a subset of menu items that can use an on click content script based on the content of the text.
tagged with: firefox-addon-sdk
tagged with: contextmenu
accepted answer: http://stackoverflow.com/a/26950895

http://stackoverflow.com/a/26850013
type: Answer
upvote count: 3
score: 3
accepted answer of: http://stackoverflow.com/q/26849959
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26849959
has body: Simply narrow your initial selector, so you are only selecting .accordions inside #firstDivContainer: $("#firstDivContainer .accordion").wrapAll(" "); $("#firstDivContainer .accordion").wrapAll(" "); #accordionBox{ background: #FCC; } stuff stuff stuff stuff stuff stuff stuff stuff stuff

http://stackoverflow.com/comment/42333964
type: AnswerComment
score: 0
type: Comment
has text: JS code for that would be something like `str = str.replace(/!([^_]+)_([^]+)/g, ' ')`
comment on: http://stackoverflow.com/a/26889927

http://stackoverflow.com/a/26933012
accepted answer of: http://stackoverflow.com/q/26932979
answers question: http://stackoverflow.com/q/26932979
has comment: http://stackoverflow.com/comment/42410799
type: AcceptedAnswer
downvote count: 0
has body: On line 14, internals.implementation is not actually being called. Rather, a reference to the function is being passed to plugins.auth.scheme(), presumably to be invoked later by the auth plugin (where actual parameters will be passed). For example, here's a simplified version: function sampleImplementation(message) { alert(message); } function useImplementation(implementation, message) { implementation.apply(this, [message]); // invoke the function with args } useImplementation(sampleImplementation, "hey there!"); // should alert "hey there!"
type: Answer
has comment: http://stackoverflow.com/comment/42411379
upvote count: 2
score: 2

apache
tag name: apache
tags question: http://stackoverflow.com/q/26848297
type: Tag

http://stackoverflow.com/comment/42408597
comment on: http://stackoverflow.com/q/26931798
score: 1
type: Comment
has text: Have you considered breaking this up into two fields? It will be easier to process and likely lead to fewer user input errors.
type: QuestionComment

http://stackoverflow.com/q/26978139
has comment: http://stackoverflow.com/comment/42491957
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: inheritance
score: 4
has comment: http://stackoverflow.com/comment/42490997
accepted answer: http://stackoverflow.com/a/26978527
has title: For inheritance with JavaScript, is it better to reference or copy the parent's prototype?
favorite count: 0
linked to: http://stackoverflow.com/q/17392857
has comment: http://stackoverflow.com/comment/42491014
linked to: http://stackoverflow.com/q/16063394
has comment: http://stackoverflow.com/comment/42490999
has comment: http://stackoverflow.com/comment/42501773
linked to: http://stackoverflow.com/q/11088365
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42491814
has answer: http://stackoverflow.com/a/26978527
tagged with: prototype
has body: Currently I implement inheritance in my JavaScript libraries as follows: parent = function() { }; parent.prototype.hello = function() { alert('parent'); }; child = function() { }; child.prototype = parent.prototype; However, I've noticed when I override a function in a child "class's" prototype, it undesirably overrides the parent's prototype as well: child.prototype.hello = function() { alert('child'); } (new parent()).hello(); // alerts "child" --&gt; undesirable (new child()).hello(); // alerts "child" --&gt; desirable And if I delete something from the child's prototype delete child.prototype.hello; then the parent's prototype is undesirably affected. So, maybe child.prototype = parent.prototype; is not the best way of implementing inheritance? Instead of making child "classes" reference the parent prototype, perhaps it would make more sense to copy the parent prototype to the child prototype? _.extend(child.prototype, parent.prototype);
upvote count: 4

http://stackoverflow.com/a/26900456
downvote count: 0
score: 4
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42354117
has comment: http://stackoverflow.com/comment/42354074
has comment: http://stackoverflow.com/comment/42353744
accepted answer of: http://stackoverflow.com/q/26900435
type: Answer
answers question: http://stackoverflow.com/q/26900435
has body: Not in your case. Javascript is run in a single threaded environment. One of your timeouts will execute completly before the other is able to execute, meaning that when the other executes, it will see that globalVar is true. The only concurrency issues that can happen is if you wait for IO, a timeout, or something like that. At that point, other javascript is allowed to execute. No code will ever interrupt other code in order to execute. For example: setTimeout(function () { alert('hi!'); }, 1000); while(true) {} You will never see the alert since the while loop will busy wait, chomping up the javascript thread for the other code and never giving the timeout an opportunity to execute.
upvote count: 4
has comment: http://stackoverflow.com/comment/42353858

http://stackoverflow.com/q/26965955
has comment: http://stackoverflow.com/comment/42469311
tagged with: javascript
type: Question
type: AnsweredQuestion
has title: Is there any way to call JavaScript API call as we can have PHP curl call?
tagged with: curl
has answer: http://stackoverflow.com/a/26966146
tagged with: php
answer count: 1
tagged with: call
has body: I need data from different website with using of RESTapi call. I have one PHP file which is using curl and giving me data with RESTapi call. But here I wanted solution is that, I don't want to use any PHP file or Curl call, just wanted to RESTapi call with using JavaScript or Ajax Or jQuery. Is there any way to call like this?
score: 0
has comment: http://stackoverflow.com/comment/42469234
accepted answer: http://stackoverflow.com/a/26966146

http://stackoverflow.com/a/26918368
answers question: http://stackoverflow.com/q/26918061
type: Answer
accepted answer of: http://stackoverflow.com/q/26918061
score: 1
has comment: http://stackoverflow.com/comment/42385066
has body: Paths defined in routing modules are relative to the path that got them there. When you try to access the /profile endpoint, express is finding the module you created, and then looking for a '/' endpoint within that module. It isn't finding one since your handler is mapped to '/profile', so it continues down the chain in app.js until it hits your 404 handler. TL;DR: The changes you made that were working are how routing works in express. Fix the endpoint inside of your module to '/', or try navigating to /profile/profile.
upvote count: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/26969416
accepted answer of: http://stackoverflow.com/q/26839150
type: Answer
has body: I flashed to 2.2 from 2.1, and the problem. . .just went away.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26839150
score: 0

http://stackoverflow.com/a/26857682
answers question: http://stackoverflow.com/q/26857399
type: Answer
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26857399
has body: You need a break statement at the end of each case or processing will "fall through" to the next case all the way to the end. The print in case 8 will always execute.

http://stackoverflow.com/comment/42489563
type: Comment
type: QuestionComment
has text: You could try using the correct MIME type for SVG: image/svg+xml - it's not saving the SVG on the local filesystem, this opens the SVG in it's own page. Using html5 download attribute does not suit me to structure my project.
comment on: http://stackoverflow.com/q/26866830
score: 0

http://stackoverflow.com/q/26907269
has comment: http://stackoverflow.com/comment/42365916
score: 0
has body: I am searching a radial progress bar. recently found in stackoverflow using canvas. but the circle not smooth edges. how to fix this blurry image. JSFIDDLE : http://jsfiddle.net/fd3k7prh/ Image:
answer count: 1
type: UnansweredQuestion
tagged with: canvas
has answer: http://stackoverflow.com/a/26907387
tagged with: javascript
has comment: http://stackoverflow.com/comment/42364893
type: Question
has comment: http://stackoverflow.com/comment/42364908
tagged with: http://stackoverflow.com/tag/html
has title: Canvas line edges not smooth. How to fix this?
has comment: http://stackoverflow.com/comment/42365070
tagged with: css

ember.js
tags question: http://stackoverflow.com/q/26911826
tags question: http://stackoverflow.com/q/26914013
tags question: http://stackoverflow.com/q/26896550
tags question: http://stackoverflow.com/q/26940363
tags question: http://stackoverflow.com/q/26860430
tags question: http://stackoverflow.com/q/26878306
type: Tag
tags question: http://stackoverflow.com/q/26876077
tags question: http://stackoverflow.com/q/26900478
tag name: ember.js
tags question: http://stackoverflow.com/q/26882141
tags question: http://stackoverflow.com/q/26984844
tags question: http://stackoverflow.com/q/26959118
tags question: http://stackoverflow.com/q/26974879
tags question: http://stackoverflow.com/q/26930347
tags question: http://stackoverflow.com/q/26896027
tags question: http://stackoverflow.com/q/26889165
tags question: http://stackoverflow.com/q/26963121
tags question: http://stackoverflow.com/q/26852620
tags question: http://stackoverflow.com/q/26971999
tags question: http://stackoverflow.com/q/26927502
tags question: http://stackoverflow.com/q/26942715
tags question: http://stackoverflow.com/q/26973079
tags question: http://stackoverflow.com/q/26900039
tags question: http://stackoverflow.com/q/26937641
tags question: http://stackoverflow.com/q/26893058
tags question: http://stackoverflow.com/q/26877103
tags question: http://stackoverflow.com/q/26920613
tags question: http://stackoverflow.com/q/26976625
tags question: http://stackoverflow.com/q/26878348
tags question: http://stackoverflow.com/q/26935940
tags question: http://stackoverflow.com/q/26846658
tags question: http://stackoverflow.com/q/26871152
tags question: http://stackoverflow.com/q/26874256
tags question: http://stackoverflow.com/q/26940327
tags question: http://stackoverflow.com/q/26896047
tags question: http://stackoverflow.com/q/26847217

http://stackoverflow.com/q/26929168
has body: I need to create an object from an array. For example, I have a array like var arr = ['a', 'b', 'c']; it should be converted to, { a:{ b:{ c:{ } } } } I tried the below code but not able to create a deep tree, var arr = ['a', 'b', 'c']; var obj = {}, temp = 'asd'; for(var i=0; i&lt;arr.length; i++){ if($.isEmptyObject(obj)){ obj[arr[i]] = {}; } else { console.log(Object.keys(obj)); obj[Object.keys(obj)][arr[i]] = {}; } } console.log(obj, temp); Fiddle Can someone help me? Thanks in advance.
tagged with: arrays
answer count: 1
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/22562754
favorite count: 0
has answer: http://stackoverflow.com/a/26929211
accepted answer: http://stackoverflow.com/a/26929211
has title: Javascript - Create deep object from an array
type: AnsweredQuestion
tagged with: javascript-objects
upvote count: 1
type: Question
duplicate of: http://stackoverflow.com/q/22562754
score: 1

http://stackoverflow.com/comment/42428197
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26942132
has text: Thank you for your help and answer. That is the result that I wanted.
type: AnswerComment

http://stackoverflow.com/comment/42384656
score: 0
type: Comment
type: QuestionComment
has text: @Bergi Can you please edit the question. I am using new properly, I guess.
comment on: http://stackoverflow.com/q/26917436

http://stackoverflow.com/q/26914223
answer count: 1
has comment: http://stackoverflow.com/comment/42505078
favorite count: 0
has comment: http://stackoverflow.com/comment/42383964
has answer: http://stackoverflow.com/a/26919277
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/42383379
accepted answer: http://stackoverflow.com/a/26919277
type: AnsweredQuestion
score: 1
type: Question
downvote count: 0
tagged with: javascript
has title: changing php variable on "scroll"
tagged with: ajax
has comment: http://stackoverflow.com/comment/42383353
has body: I have a php variable $start1, and I need to increase this variable by a value of '10' everytime the user reaches the bottom of the page. I read something about ajax but I don't know how to implement it. $(window).scroll(function() { if($(window).scrollTop() + $(window).height() == $(document).height()) { // increase $start1 by '10' I tried storing the php-variable in a js-variable but somehow it did not work out. Would appreciate some help! Thanks.
has comment: http://stackoverflow.com/comment/42381503

http://stackoverflow.com/a/26902908
type: Answer
score: 0
has body: FOUND! Drawing image should be done after image loading , img.onload=function(e){ ctx.drawImage(img,0,0,w,h); // بقية الكود هنا } See this example :
answers question: http://stackoverflow.com/q/26902736
has comment: http://stackoverflow.com/comment/42359271

http://stackoverflow.com/a/26872636
type: Answer
has comment: http://stackoverflow.com/comment/42315448
has comment: http://stackoverflow.com/comment/42319392
score: 1
has comment: http://stackoverflow.com/comment/42317654
upvote count: 1
has comment: http://stackoverflow.com/comment/42316249
has body: IE issues a warning about &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;, because such a string is not a valid doctype according to HTML5. The warning as such has no impact on anything. It’s just part of HTML5 evangelism. After you changed it to &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;, the issue was removed. But you probably saw the results of using some cached copy that has a wrong doctype. Testing with a fresh file (with a new name) should fix this issue. Of course, the code as such does not validate, since the ASP tags are taken literally and interpreted as body content, but that’s a different issue. The practical move is to use &lt;!DOCTYPE html&gt; as suggested. If you wish to still validate against the XHTML 1.0 specification for example, you can do this using the validator’s user interface to override the doctype. But it’s not a big issue; you can just as well simply ignore the warning. If you have some functional errors, they are caused by something else and should be asked separately, with sufficient data provided.
has comment: http://stackoverflow.com/comment/42317835
has comment: http://stackoverflow.com/comment/42316280
downvote count: 0
has comment: http://stackoverflow.com/comment/42314476
answers question: http://stackoverflow.com/q/26871413

http://stackoverflow.com/q/26932435
has comment: http://stackoverflow.com/comment/42409899
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/42409644
has comment: http://stackoverflow.com/comment/42409843
favorite count: 0
has answer: http://stackoverflow.com/a/26932527
score: 2
has title: Why window.setTimeout throws an exception in IE9?
upvote count: 2
accepted answer: http://stackoverflow.com/a/26932527
type: AnsweredQuestion
tagged with: settimeout
tagged with: internet-explorer-9
has body: Here's my code: save: function(){ window.setTimeout(recipeControlsViewModel.saveWOTimeOut(),500); }, Here's the error I get only in IE9 when the "Display a notification about every script error" option is checked in Internet Options in IE9. This doesn't happen in FireFox, Chrome or IE10 &amp; IE11. SCRIPT87: Invalid argument Does anybody know why this happens and how to fix this?
type: Question

http://stackoverflow.com/comment/42336324
type: Comment
score: 1
type: AnswerComment
has text: Updating the jquery didn't solve the problem. Thank you for your answer anyway.
comment on: http://stackoverflow.com/a/26867901

http://stackoverflow.com/comment/42239592
type: Comment
has text: @Bergi Could you re-title my question appropriately? From these answers I see that it isn't short-hand, but I'm unsure how to best title it for others looking for it to find the answer.
type: QuestionComment
comment on: http://stackoverflow.com/q/26836921
score: 0

http://stackoverflow.com/a/26918044
answers question: http://stackoverflow.com/q/26917909
score: 1
downvote count: 0
has body: If it doesn't have to be for loops, you can also use map: var list = [[1, 2, 3], [4, 5, 6], [7, 8, 9]], someId = document.getElementById( 'someID' ); someId.innerHTML = '&lt;pre&gt;' + list.map(function (row) { return row.join(' '); }).join('&lt;br&gt;') + '&lt;/pre&gt;'; &lt;div id="someID"&gt;&lt;/div&gt;
type: Answer
upvote count: 1

http://stackoverflow.com/a/26915350
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/42379864
upvote count: 1
has body: If the outer scope is the global scope, you can do window.foo(); // assuming you're in a browser If not, then you're out of luck. Give the local variable another name. An example of when you're out of luck: window.onload = function() { function foo() { console.log('foo'); } function bar() { var foo = 5; foo(); // (*) } } The scope of the anonymous "load" handler function has no name, or any other handle by which the code in function "bar" could indicate that it wanted a reference to that "foo" instead of the local one. Note that Coffeescript explicitly disallows this; it won't allow a local symbol to hide a more global one. (That's a controversial feature of the language, before you jump on the Coffeescript train.)
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26915284
type: Answer
accepted answer of: http://stackoverflow.com/q/26915284

http://stackoverflow.com/comment/42482714
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26973643
has text: 'Invalid Date'. Look at the topic again, pls

http://stackoverflow.com/a/26893512
answers question: http://stackoverflow.com/q/26888278
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/42368569
upvote count: 2
has comment: http://stackoverflow.com/comment/42360033
type: AcceptedAnswer
has body: What you are trying to do cannot be done. The documentation for GoToUrl (which is get for Java and Python and probably other languages that Selenium supports) explicitly says that it blocks "until the load is complete". You can test it. Take the following HTML: &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8"/&gt; &lt;script&gt; window.addEventListener("load", function () { window.loaded_inline = true; }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;/body&gt; &lt;/html&gt; And run the following Selenium script. Sorry, I don't do C# so this is Python. It should not be too hard to understand: from selenium import webdriver driver = webdriver.Chrome() driver.get("file:///tmp/t2/index.html") # This gets the page above. # This checks whether the load handler in the page was called. print "Inline:", driver.execute_script("return window.loaded_inline") driver.set_script_timeout(2) # This is an asynchronous script. It will end when the load event is # emitted by the browser. Or timeout if the event does not happen. driver.execute_async_script(""" var done = arguments[0]; window.addEventListener('load', done, false); """) driver.quit() When I execute this, I get Inline: True and then a timeout. You can increase the timeout as long as you want, it will never change the result. What this indicates is that the load event happens before get returns, and by then it is too late to add any more listeners to load. What About Making the Page Load Return Immediately? It does not work either. First, it seems to me that the fact that you have to set webdriver.load.strategy to the value unstable ought to be a clue that maybe that's not something, you know, stable. That setting is marked "beta" in the documentation. The doc also says: This may cause immediate find's [sic] to break, so please be sure to use an implicit or explicit wait too. The use-case they are talking about there is load the page immediately and the…
type: Answer
accepted answer of: http://stackoverflow.com/q/26888278

http://stackoverflow.com/a/26968079
accepted answer of: http://stackoverflow.com/q/26967966
answers question: http://stackoverflow.com/q/26967966
type: Answer
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer
has body: Change to this instead, this should only toggle sub-elements to the clicked element.

http://stackoverflow.com/comment/42468125
comment on: http://stackoverflow.com/q/26965154
score: 0
has text: I've tried modifying the .js file for Images-Rotation by adding $this.fadeIn("slow"); (or similar things) in several spots hoping that at the moment in time that it loads the image it would do so in addition to fading it in, which it hasn't so far. I should add I am very new to Javascript.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26965571
downvote count: 0
has body: This is a protection against the so-called JSON hijacking exploit. The client strips off the leading junk before interpreting it. In the JSON hijacking exploit, a user is logged onto an application in one tab, meaning the browser is holding his authentication token in a cookie, for example. The hacker then arranges for the user to open a malicious app in another tab. The HTML in that tab contains a script tag with its src set to the URL for some JSON API of the first app. Since it is a script tag, there is no same-origin check. Since the browser includes valid credentials in the request, the first app goes ahead and returns the JSON, perhaps containing confidential information. Since JSON is valid JavaScript, the browser executes it, which in itself causes nothing to happen, but the hacker can then retrieve the JSON by examining the content of the script tag. By putting junk in front of the JSON, it cannot be parsed as valid JS. Therefore, the browser errors out and does not load the content into the script tag of the malicious app, which therefore has no way to examine it. There are various "flavors" of junk used by different vendors; Google's is one. These days there are several built-in countermeasures to JSON hijacking and it no longer remains a threat except on older browsers without properly set headers.
type: Answer
has comment: http://stackoverflow.com/comment/139240864
score: 19
upvote count: 19
has comment: http://stackoverflow.com/comment/42471519
accepted answer of: http://stackoverflow.com/q/26955167
answers question: http://stackoverflow.com/q/26955167
type: AcceptedAnswer

triggers
tags question: http://stackoverflow.com/q/26840578
tag name: triggers
type: Tag
tags question: http://stackoverflow.com/q/26982840

http://stackoverflow.com/q/26832539
accepted answer: http://stackoverflow.com/a/26832575
possible better answer: http://stackoverflow.com/a/26832610
favorite count: 0
tagged with: html-select
has answer: http://stackoverflow.com/a/26832610
has body: I have selection menu: Value A Value B Value C and I need Javascript (no jquery!) to get option by value and change it's text (innerHtml) for example when I run the function I need to get option with the value "valueB" from class "selector" and change it's text to Value Whatever.
type: AnsweredQuestion
upvote count: 14
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/26832575
tagged with: javascript
score: 13
has title: Get select option by value using javascript
answer count: 2

http://stackoverflow.com/q/26872826
tagged with: forms
accepted answer: http://stackoverflow.com/a/26873585
score: 2
tagged with: validation
downvote count: 0
answer count: 1
has title: Attaching Parsley.js Validation Library to Form Takes Very Long
tagged with: javascript
favorite count: 0
has body: I'm trying out the Parsley.js validation library, however, when attaching it to my form (which has several thousand input fields ... it has multiple lists with checkboxes) the Parsley JavaScript runs for almost a minute as it goes through all the fields (even though I've excluded the checkboxes): &lt;form id="form" data-parsley-validate data-parsley-excluded="input[type=checkbox]"&gt; Is there any setting I could use to fix this problem since excluding the checkboxes doesn't seem to help. Could I just attach the validation to individual fields and not the whole form? If I do that though then I'd have to oversee the form submission, etc. and manually trigger validation, correct? What's the best approach to take in my situation?
has answer: http://stackoverflow.com/a/26873585
upvote count: 2
type: Question
tagged with: parsley.js
type: AnsweredQuestion

http://stackoverflow.com/q/26882686
has comment: http://stackoverflow.com/comment/42342344
has body: i have a bit of js code i am trying to get it so when cat2 occurs it activates a modal so i have tried if (cat2) { $('#myModal').modal('show') }; but that isnt working for me i have had a look around but havent found a answer yet this is where i found the code http://www.hungrypiranha.org/make-a-website/html-quiz $(document).ready(function() { $("#results").click(function() { if (!$("input[@name=q1]:checked").val() ) { alert("You're not done yet!"); } else { var cat1name = "1"; var cat2name = "none"; var cat1 = ($("input[@name=q1]:checked").val() != "a"); var cat2 = (!cat1); var categories = []; if (cat1) { categories.push(cat1name) }; if (cat2) { categories.push(cat2name) }; var catStr = 'You answered the following questions incorrectly: ' + categories.join(', ') + ''; $("#categorylist").text(catStr); $("#categorylist").show("slow"); if (cat1) { $("#category1").show("slow"); }; if (cat2) { $("#category2").show("slow"); }; { $("#closing").show("slow"); }; } });});
has title: if statement to call bootstrap modal
tagged with: twitter-bootstrap
type: UnansweredQuestion
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/26882758
score: 0
tagged with: modal-dialog
answer count: 1

http://stackoverflow.com/comment/42496066
has text: Sorry, I just now added the link to the example.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/26980948
type: Comment

http://stackoverflow.com/comment/52150115
type: Comment
has text: If you still don't get this delegate function called, remember to try the other two: `runJavaScriptConfirmPanelWithMessage` and `runJavaScriptTextInputPanelWithPrompt`. The event depends on the type of the alert.
comment on: http://stackoverflow.com/a/27067168
score: 6
type: AnswerComment

http://stackoverflow.com/a/26855777
score: 0
type: Answer
has body: I was able to also achieve it through noncapturing groups. Output from chrome console: var regex = /(?:\w+(\[\w+\]\[\d+\])+)(\[\w+\])/; undefined regex /(?:\w+(\[\w+\]\[\d+\])+)(\[\w+\])/ str = "profile[foreclosure_defenses_attributes][0][properties_attributes][0][other_stuff]"; "profile[foreclosure_defenses_attributes][0][properties_attributes][0][other_stuff]" match = regex.exec(str); ["profile[foreclosure_defenses_attributes][0][properties_attributes][0][other_stuff]", "[properties_attributes][0]", "[other_stuff]"]
answers question: http://stackoverflow.com/q/26853381

http://stackoverflow.com/comment/75723755
comment on: http://stackoverflow.com/q/26961369
score: 1
has text: @Pointy Expressions in Angular template `{{ }}` blocks are just plain old JS expressions (with certain restrictions). The way to access an object property, whether with dot notation or bracket notation, is exactly the same as in JS.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42304631
score: 0
type: AnswerComment
type: Comment
has text: Thanks Nicholas Young your code is useful to me I will experiment with this!
comment on: http://stackoverflow.com/a/26873223

http://stackoverflow.com/a/26882922
accepted answer of: http://stackoverflow.com/q/26881969
has body: What is returned from the .stream() method from the Cursor object returned from .find() is an implementation of the node transform stream interface. Specifically this is a "readable" stream. As such, it's "data" event is emitted whenever there is new data received and available in the stream to be read. There are other methods such as .pause() and .resume() which can be used to control the flow of these events. Typically you would call these "inside" a "data" event callback, where you wanted to make sure the code in that callback was executed before the "next" data event was processed: stream.on("data", function(data) { // pause before processing stream.pause(); // do some work, possibly with a callback something(function(err,result) { // Then resume when done stream.resume(); }); }); But of course this is just a matter of "scoping". So as long as the "stream" variable is defined in a scope where another piece of code can access it, then you can call either method at any time. Again, by the same token of scoping, you can just "undefine" the "stream" object at any point in the code, making the "event processing" redundant. // Just overwrite the object scope = undefined; So worth knowing. In fact the newer "version 2.x" of the node driver wraps a "stream interface" directly into the standard Cursor object without the need to call .stream() to convert. Node streams are very useful and powerful things that it would be well worth while coming to terms with their usage.
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/42328677
has comment: http://stackoverflow.com/comment/42329123
score: 3
has comment: http://stackoverflow.com/comment/42328422
answers question: http://stackoverflow.com/q/26881969
has comment: http://stackoverflow.com/comment/42331364
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/42437807
has text: I've wrapped my original JS in a document ready wrapper and I'm still receiving the same result. I've updated my question with your suggestion in the #head JS section.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26947922

http://stackoverflow.com/comment/72397318
type: AnswerComment
has text: I'll keep that in mind for future problems, thanks for the suggestion
type: Comment
comment on: http://stackoverflow.com/a/42634514
score: 0

http://stackoverflow.com/comment/42350738
has text: Unfortunately neither of these work? I had tried the high priority number after reading the codex but not the PHP, but tried that too and nothing?
comment on: http://stackoverflow.com/a/26898816
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42382536
score: 0
has text: what is your browser? check what the request to `childfilm.php` return
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26916476

http://stackoverflow.com/comment/42298613
type: QuestionComment
comment on: http://stackoverflow.com/q/26869913
score: 1
has text: `vTag` is a DOM element? You should be able to use `vTag.outerHTML` to get its content
type: Comment

http://stackoverflow.com/comment/42327558
score: 0
type: Comment
type: QuestionComment
has text: Oh yeah right, it is a copy paste mistake! I copied it directly from the php echo and pasted it over here. You are right, I thought you were taking about the php echo part...yes I will edit the question and yeah it is executed as when it is executed. Any other issue that could cause the problem? @myfunkyside
comment on: http://stackoverflow.com/q/26879501

http://stackoverflow.com/q/26895004
has answer: http://stackoverflow.com/a/26902398
type: Question
tagged with: javascript
has title: How to fix event handler on static button in dynamic asp.net page
score: 0
answer count: 1
tagged with: jquery
tagged with: asp.net
type: UnansweredQuestion
has body: I have a user control that is not firing button click events properly. The button is static on the page, but the majority of the content on the page is managed dynamically with javascript and VB. When the button is clicked, none of the event handler's code is executed. I've tested it with break points in visual studio. The button click does cause page_load to execute, but the handler is never executed. This is the definition of the button &lt;asp:Button ID="btnUpdateVariables" runat="server" Text="Update Table" /&gt; This is my page_load function Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostBack Then ` ... ` Add / edit controls ` ... AddHandler btnUpdateVariables.Click, AddressOf updateVariables ` ... ` Add / edit controls ` ... End If End Sub updateVariables' declaration looks like this Private Sub updateVariables(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdateVariables.Click `... End Sub Any help fixing this would be appreciated.
tagged with: vb.net

http://stackoverflow.com/comment/42379978
type: QuestionComment
has text: Sorry Diego, No I don't. It's really the same as the copy source. http://jsfiddle.net/4LFnK/ except my html header code is . Part of a bigger responsive code set. My .row-bkg CSS is a little tweaked.
score: 0
comment on: http://stackoverflow.com/q/26896527
type: Comment

http://stackoverflow.com/a/26919407
has body: You are getting into to many recursions which makes the call stack grow to high. Try chaning your recursive function into a loop. This should not give you any problems.
downvote count: 0
score: 1
type: Answer
answers question: http://stackoverflow.com/q/26919384
has comment: http://stackoverflow.com/comment/42387040
upvote count: 1

http://stackoverflow.com/q/26876514
has body: I am filtering a fairly small dataset but there is still some performance issues (UI thread freezing when filter is not concise). &lt;input type="text" ng-model="vm.user" /&gt; &lt;table class="tbl" ng-show="vm.user.length &gt; 2"&gt; &lt;tbody ng-repeat="p in vm.permissions | filter: {UserName: vm.user}:false"&gt; the issue is only when there are a lot of records, so I've attempted to improve performance by hiding the whole thing when there are less than 3 characters entered in search. unfortunately, even when the data-set is hidden it appears that angular is manipulating the dom (UI freezing as I type into the filter). Is there a way to make it not do anything when there are less characters, and/or improve performance in other ways?
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
score: 2
tagged with: performance
has answer: http://stackoverflow.com/a/26877438
accepted answer: http://stackoverflow.com/a/26877438
tagged with: dom
type: Question
has comment: http://stackoverflow.com/comment/42310531
tagged with: javascript
upvote count: 2
has title: optimize angular filter performance
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/42378158

http://stackoverflow.com/a/26884664
has body: this is not a good idea at all to set timeouts. Considering you are using the latest CasperJS release, it's better to use the waitFor utility method: http://casperjs.readthedocs.org/en/latest/modules/casper.html?highlight=waitfor#waitfor. Also, you may emulate the behavior to "type" into your text input by using the sendKeys method: http://casperjs.readthedocs.org/en/latest/modules/casper.html?highlight=waitfor#sendkeys. Regards,
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/42326544
has comment: http://stackoverflow.com/comment/42327486
has comment: http://stackoverflow.com/comment/42333841
answers question: http://stackoverflow.com/q/26877403

http://stackoverflow.com/q/26962464
has comment: http://stackoverflow.com/comment/42484938
has comment: http://stackoverflow.com/comment/42507899
tagged with: android
tagged with: php
has comment: http://stackoverflow.com/comment/42508189
tagged with: cordova
has title: Phonegap upload image with caption and retrieve them
score: 1
has comment: http://stackoverflow.com/comment/42474695
upvote count: 1
accepted answer: http://stackoverflow.com/a/26988105
type: AnsweredQuestion
has body: i need to upload image from android or iphone with a little bit of description or caption to remote server using phone gap file api but am not familiar with php can any one help me to solve this problem give ma bit of code because i need it badly
has comment: http://stackoverflow.com/comment/42507982
tagged with: javascript
type: Question
has comment: http://stackoverflow.com/comment/42475657
has comment: http://stackoverflow.com/comment/42504449
answer count: 1
downvote count: 0
tagged with: ios
linked to: http://stackoverflow.com/q/24139295
favorite count: 0
has answer: http://stackoverflow.com/a/26988105
has comment: http://stackoverflow.com/comment/42475741
has comment: http://stackoverflow.com/comment/42486225
has comment: http://stackoverflow.com/comment/42482153

http://stackoverflow.com/comment/42263644
type: Comment
comment on: http://stackoverflow.com/a/26850467
score: 0
type: AnswerComment
has text: Is there any way where i can avoid this? It will be better if it is possible.

http://stackoverflow.com/q/26918317
has answer: http://stackoverflow.com/a/26918351
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26918351
has body: I tought that I really understand use of this in jQuery/JS, but this showes me that I'm wrong. I wanted to add class on DOM element and I used this: $("#content").on("click",function(){ this.addClass("bonus"); }); But nothing happened, so I changed second line of code to and it worked: $("#content").addClass("bonus"); Shouldn't this in first example refer to $("#content") already?
has answer: http://stackoverflow.com/a/26918354
tagged with: dom
type: Question
has title: jQuery this inside event
possible better answer: http://stackoverflow.com/a/26918354
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2

http://stackoverflow.com/a/32550996
upvote count: 6
has comment: http://stackoverflow.com/comment/69382609
downvote count: 1
answers question: http://stackoverflow.com/q/26835411
has body: We have published a new package planifica:encryption that let's you do client-side encryption of your mongo collections with ease! If follows the same principles as Mylar does (in fact it is based on the paper that Mylar is based on), but currently does not support all of Mylars features like server-side search. On the other hand it uses far more advanced and performant encryption techniques for key generation and encryption that are more suitable for browsers. Also it does not replace or modify the meteor core, but instead is a normal package that uses hooks for all the automatic en-/decryption. There is also a blog post to get you started here.
has comment: http://stackoverflow.com/comment/52958110
has comment: http://stackoverflow.com/comment/52958034
type: Answer
score: 5

http://stackoverflow.com/comment/42387110
type: QuestionComment
type: Comment
has text: You're recursively calling `traverse()` on the same element (instead of its children), infinitely.
comment on: http://stackoverflow.com/q/26919384
score: 1

http://stackoverflow.com/comment/42341031
type: Comment
has text: yeah, please read the $watch documentation https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$watch the listener would have to be a function not a string or element
type: QuestionComment
comment on: http://stackoverflow.com/q/26893572
score: 0

http://stackoverflow.com/a/26850108
upvote count: 1
has body: &lt;?php $name = "jack"; echo "&lt;input type='text' id='name' value='{$name}'&gt;"; ?&gt;
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/26850025
has comment: http://stackoverflow.com/comment/42262862

http://stackoverflow.com/comment/42340156
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/26893197
has text: ***sigh*** What line is the error reported on?
type: Comment

http://stackoverflow.com/comment/42506895
type: Comment
has text: Then try debugging, add `print_r($_POST);` in the PHP file, and a success handler to see what is returned
comment on: http://stackoverflow.com/a/26986859
score: 0
type: AnswerComment

http://stackoverflow.com/a/26996765
score: 4
type: Answer
accepted answer of: http://stackoverflow.com/q/26939956
upvote count: 4
answers question: http://stackoverflow.com/q/26939956
has body: Iron Router works fine. this.subscribe is like Meteor.subscribe and Iron-Router doesn't wait for this. waitOn is the function that will wait until each of your returned subscriptions are ready that is why this.ready() is true in onBeforeAction There are several ways of doing what you want You could do it like CodeChimp said by using templates with create/destroyed You could split your route in different routes so that you redirect when it's needed you could use .wait() from the new API of iron router here.
downvote count: 0
has comment: http://stackoverflow.com/comment/42536139
has comment: http://stackoverflow.com/comment/42537107
type: AcceptedAnswer

http://stackoverflow.com/q/26858783
score: -2
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/42278713
favorite count: 0
has comment: http://stackoverflow.com/comment/42278795
has title: how to login multiple website by one account?
has comment: http://stackoverflow.com/comment/42279058
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/42278787
type: AnsweredQuestion
downvote count: 3
has answer: http://stackoverflow.com/a/26858941
type: Question
has body: I got a question about my project.What they want me to do is: 1)Our school has 3 login panel like one of them is for library, other one is for student info and more something like that. 2)So basically, my user information which are id and password is same for all of them.( All the login panel that school has) 3)And they want me to do is to code a script to create one login panel in order to log in all of them. Is it possible to do? And i do not know where to start? Thank you!
accepted answer: http://stackoverflow.com/a/26858941

http://stackoverflow.com/comment/42250562
score: 0
type: Comment
comment on: http://stackoverflow.com/q/26843566
type: QuestionComment
has text: do you really have added `jQuery` outside the ` `?

http://stackoverflow.com/a/26974016
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/26973798
score: 1
has body: It's a normal behavior. Once something it's drawn on the canvas, it's there forever. You have to think like if you were painting something: what has been done cannot be undone. Luckily, you still have solutions: 1) redraw another circle on top of the first one with the background color. It's really not the recommend way, but it still can be useful 2) use clearRect method (see How to clear the canvas for redrawing)
upvote count: 1

http://stackoverflow.com/a/26943135
accepted answer of: http://stackoverflow.com/q/26943124
answers question: http://stackoverflow.com/q/26943124
score: 5
upvote count: 5
type: AcceptedAnswer
downvote count: 0
has body: You'd have to iterate with each to create a scope where this really does reference each element $('.DateTextBox').each(function() { $(this).datepicker({ dateFormat : $(this).data('dateformat'), showButtonPanel : true, changeMonth : true, changeYear : true, defaultDate : new Date(), changeMonth : true, changeYear : true }); }); FIDDLE
type: Answer

http://stackoverflow.com/comment/42448825
type: Comment
has text: I see. Then just add a php foreach look around the function name above then, echoing out the different $ids/$postypes. Without seeing more of your code, it will be hard to give a complete example.
score: 1
comment on: http://stackoverflow.com/a/26954363
type: AnswerComment

http://stackoverflow.com/a/26966049
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26966030
has comment: http://stackoverflow.com/comment/42469384
answers question: http://stackoverflow.com/q/26966030
type: Answer
score: 2
downvote count: 0
has body: You can use below code to clear input field - $('#inputId').val(''); I have used id selector, you can use class or any other selector for selecting input (as per your requirement) and set empty string in .val('') to clear its value.

http://stackoverflow.com/a/26900894
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/42392644
has comment: http://stackoverflow.com/comment/42412197
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26900095
answers question: http://stackoverflow.com/q/26900095
type: Answer
has body: From the code you have, you can use '+' operator to concatenate strings. When you need to use single quote inside string defined with single quote, you can use backslash (\) as escape character before it. Also, you need to hide the div with class "moreinfo" initially. As for new line, if you want each attribute in new line in moreinfo class, it can be achieved by using HTML "pre" tag or "br" tag or some other way. So code would be: var moreinfo = " source = " + source + "\r\n doffset = " + doffset + "\r\n type = " + type + "\r\n length = " + length + "\r\n scale = " + scale + "\r\n noffset = " + noffset + "\r\n units = " + units +" "; document.getElementById("j1979").innerHTML += ' \r\n' + PID + " "; document.getElementById("j1979").innerHTML += moreinfo; or var moreinfo = " source = " + source + " doffset = " + doffset + " type = " + type + " length = " + length + " scale = " + scale + " noffset = " + noffset + " units = " + units +" "; document.getElementById("j1979").innerHTML += ' \r\n' + PID + " "; document.getElementById("j1979").innerHTML += moreinfo; If you want to toggle display on click, you can use ternary operator to give condition in onclick function: var moreinfo = " source = " + source + " doffset = " + doffset + " type = " + type + " length = " + length + " scale = " + scale + " noffset = " + noffset + " units = " + units +" "; document.getElementById("j1979").innerHTML += ' \r\n' + PID + " "; document.getElementById("j1979").innerHTML += moreinfo;

http://stackoverflow.com/q/26940432
has body: I am using the google maps API to show the last position a form was submitted to my site. So I am pulling the lon and lat values from a php file as variables but I need the script to refresh every 5 seconds so that the maps marker updates without page reload. Here is the google api script: &lt;script&gt; function initialize() { var myLatlng = new google.maps.LatLng&lt;?php require($DOCUMENT_ROOT . "php_includes/mobile_loc.php"); ?&gt;; var mapOptions = { zoom: 15, center: myLatlng } var map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions); var marker = new google.maps.Marker({ position: myLatlng, map: map, title: 'Last Scan' }); } google.maps.event.addDomListener(window, 'load', initialize); &lt;/script&gt; And here is the php file: &lt;?php include_once("php_includes/db_conx.php"); $sql = "SELECT * FROM patdub ORDER BY STR_TO_DATE(Timestamp, '%d/%m/%Y %H:%i:%s') DESC LIMIT 1"; $query = mysqli_query($db_conx, $sql); $row = mysqli_fetch_array($query); $lon = $row['Lon']; $lat = $row['Lat']; echo "($lat, $lon)"; ?&gt; Any ideas? I've tried different AJAX methods but just can't seem to figure it out! Edit: The line of code below is basically the bit I need to refresh every 5 seconds but without any div tags or anything because that interferes with the google api script.. &lt;?php require($DOCUMENT_ROOT . "php_includes/mobile_loc.php"); ?&gt;;
tagged with: php
type: Question
accepted answer: http://stackoverflow.com/a/26940494
has comment: http://stackoverflow.com/comment/42425032
tagged with: google-maps
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has title: Refresh PHP that grabs Co-Ords for google maps API
has answer: http://stackoverflow.com/a/26940494
type: AnsweredQuestion

http://stackoverflow.com/a/26910385
has body: This should work: myopj = myopj.filter(function(o){return o.Name}); Struictly speaking this creates a new array and assigns it to your myopj variable, rather than deleting items from the old one, but is probably the simplest way to achieve what you need. If your array is very large and you really do want to delete items you will need to use a for loop and use splice to chop out the ones you don't need, but I think using filter is nicer.
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42370464
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/26910346
downvote count: 0
answers question: http://stackoverflow.com/q/26910346

http://stackoverflow.com/a/26941792
has body: I think that what you are trying to achieve is called partial function application, which is basically creating a derived function from an exisiting one, but that will be called with predefined parameters. this.setMedium = setBoxDimensions.bind(this, 16,14,6); this.setLarge = setBoxDimensions.bind(this, 24,14,6);
upvote count: 1
answers question: http://stackoverflow.com/q/26941646
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/42427360

http://stackoverflow.com/comment/42315706
type: Comment
comment on: http://stackoverflow.com/a/26879405
score: 0
type: AnswerComment
has text: You can surely do it.

http://stackoverflow.com/q/26833500
favorite count: 0
has body: I'm using ng-repeat to print all the images from desired folder, and those images are in &lt;a&gt; because I'm using fancyBox. Here's an example of controller: var ParentCtrl = function ($scope) { $scope.getTimes=function(n){ // for the ng-repeat return new Array(n); }; }; app.controller('projectController', ['$scope','$injector', function($scope, $injector) { $injector.invoke(ParentCtrl, this, {$scope: $scope}); $scope.title = 'project'; $scope.image_url = 'img/project/'; $scope.image_num = 14; //image count -&gt; [0.jpg, 1.jpg, 2.jpg, ..., 13.jpg] }]); And the template: &lt;a href="" class="fancybox" rel="project-gallery" data-ng-repeat="t in getTimes(image_num) track by $index" data-ng-href="{{image_url+($index)+'.jpg'}}"&gt; &lt;img src="{{image_url+($index)+'.jpg'}}"&gt; &lt;/a&gt; And this code works fine, it shows all the 14 images. However, I'm getting this error in the console: GET http://localhost/projects/project-name/%7B%7Bimage_url+($index)+'.jpg'%7D%7D 404 (Not Found) How to fix that error?
tagged with: angularjs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26833541
has comment: http://stackoverflow.com/comment/42233396
type: Question
upvote count: 15
has title: Angular img src console error
answer count: 2
accepted answer: http://stackoverflow.com/a/26833541
downvote count: 0
tagged with: javascript
score: 15
has answer: http://stackoverflow.com/a/26833544
possible better answer: http://stackoverflow.com/a/26833544

http://stackoverflow.com/q/26851116
has answer: http://stackoverflow.com/a/33209673
upvote count: 2
tagged with: cordova-chrome-app
answer count: 2
has body: I can access a Chrome App Webview HTML with: webview.executeScript( {code: 'document.documentElement.innerHTML'}, function(results) { // results[0] would have the webview's innerHTML. }); But I would like to get the value of global variables in the Guest like so: webview.executeScript( {code: 'window.globalVar'}, function(results) { // results[0] should have the webview's value of "globalVar". }); How can I do this?
linked to: http://stackoverflow.com/q/9515704
tagged with: webview
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/42271939
has answer: http://stackoverflow.com/a/26854867
type: UnansweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/42268675
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/42271311
linked to: http://stackoverflow.com/q/30367455
favorite count: 0
has title: "Chrome Apps" webview.executeScript access guest global varibles
has comment: http://stackoverflow.com/comment/42271903
tagged with: google-chrome-app
linked to: http://stackoverflow.com/q/26739774
has comment: http://stackoverflow.com/comment/42266352
type: Question

http://stackoverflow.com/q/26910396
type: Question
has body: I need to toggle on a css class after a component (or even the page) is completely rendered, so that relevant properties are animated on page load. How do I go about doing this, preferably without jQuery? If I toggle a component's class in componentDidMount, the animation doesn't actually happen.
tagged with: javascript
has comment: http://stackoverflow.com/comment/42370779
linked to: http://stackoverflow.com/q/195951
tagged with: reactjs
answer count: 2
has comment: http://stackoverflow.com/comment/42370604
favorite count: 0
upvote count: 8
has title: ReactJS: Toggle class for css transition
possible better answer: http://stackoverflow.com/a/42468625
has comment: http://stackoverflow.com/comment/42371389
has comment: http://stackoverflow.com/comment/42381623
has answer: http://stackoverflow.com/a/42468625
tagged with: css
has answer: http://stackoverflow.com/a/26914240
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42371100
score: 7
accepted answer: http://stackoverflow.com/a/26914240
downvote count: 1

http://stackoverflow.com/a/26909173
has body: Here's how to filter the elements based on wether or not they are visible in the viewport $(window).on('scroll resize', function() { var top = $(this).scrollTop(), height = $(this).height(); var visible = $('#alarmTable tr').filter(function() { var elTop = $(this).offset().top, elHeight = $(this).height(); return (elTop &gt; top) &amp;&amp; ((elTop + elHeight) &lt; (top + height)); }); }); FIDDLE
answers question: http://stackoverflow.com/q/26908857
score: 3
upvote count: 3
type: Answer
downvote count: 0

http://stackoverflow.com/q/26886709
has answer: http://stackoverflow.com/a/29481973
type: UnansweredQuestion
score: 6
downvote count: 0
has title: R: How do you initialise datatables FixedColumns javascript in Shiny?
has answer: http://stackoverflow.com/a/62401634
type: Question
has body: I am trying to build a shiny app that uses the datatable FixedColumns plugin: https://datatables.net/extensions/fixedcolumns/ The datasest I am using will have around 100 columns and I want to fix the first five columns and allow the user to scroll through the rest. From the examples it looks like I'd need to use this javascript: https://datatables.net/release-datatables/extensions/FixedColumns/examples/two_columns.html $(document).ready(function() { var table = $('#example').DataTable( { scrollY: "300px", scrollX: true, scrollCollapse: true, paging: false } ); new $.fn.dataTable.FixedColumns( table, { leftColumns: 2 } ); } ); I don't know javascript but in the past I have been able to use I() to insert javascript options. This time though it looks like I need to do something else. I've tried the code below and get the message: "ERROR: 'options' must be a named list'. library(shiny) library(ggplot2) data(diamonds) hw &lt;- diamonds runApp( list(ui=( fluidPage( tabsetPanel( id = 'dataset', tabPanel('hw', dataTableOutput('mytable1')) ))), server = (function(input, output, session) { output$mytable1 &lt;- renderDataTable( head(hw, 50), options = list(scrollY = '300px', scrollX = TRUE, scrollCollapse = TRUE, paging = FALSE, I("new $.fn.dataTable.FixedColumns( table, { leftColumns: 5 } );") )) }) ))
upvote count: 6
tagged with: javascript
tagged with: http://stackoverflow.com/tag/r
answer count: 2
tagged with: shiny
tagged with: datatables
favorite count: 0
has comment: http://stackoverflow.com/comment/45603799

http://stackoverflow.com/a/26882488
has body: you can try this $('#gotvalue').html('');
score: 1
has comment: http://stackoverflow.com/comment/42320663
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/42320602
answers question: http://stackoverflow.com/q/26882432
type: Answer

http://stackoverflow.com/comment/42781859
score: 0
has text: @dandavis I wrote a proof of concept where I put an iframe from whatever.google.com in the app.example.com's site. The iframe was able to communicate via postMessage with the host window. I then had the iframe open a popup window in whatever.google.com's domain. Although this worked in Chrome, IE blocks the pop-up window as it treats the postMessage as asynchronous. Chrome treats it as synchronous for the purposes of not blocking pop-ups. The Google and Facebook SDKs each work in IE though, so they must pop the window from the host window?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26984251

http://stackoverflow.com/comment/42396422
score: 0
type: Comment
comment on: http://stackoverflow.com/q/26924000
type: QuestionComment
has text: tika's answer is right, but there is a big assumption. He's assuming that you're using jQuery. If you're using jQuery, everything gets so much easier because you can find the state of the checkbox easily, and ajax is a breeze. If you **can** use it, there are plenty of examples about for this sort of thing. Try here: http://stackoverflow.com/questions/6017558/checkbox-checked-or-unchecked-with-jquery-and-mysql

http://stackoverflow.com/comment/42411069
comment on: http://stackoverflow.com/q/26933041
score: 1
has text: Well, you could change the event listener to `.blur` (or `.change`)... And i don't think speed is a problem here to be honest! If it does matter, just cache your elements.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26948657
answer count: 2
downvote count: 2
has body: I have some JavaScript code to get a map from Google Maps, but it does not show the current location of client when they access it. initialize: function(options) { _.bindAll(this, 'setCenter'); var view = this; if ($('#map-top-wrapper').length == 0) return; view.options = _.extend(this, options); view.center = new google.maps.LatLng(this.options.latitude, this.options.longitude); view.map_options = { 'zoom': parseInt(ae_globals.map_zoom), 'center': view.center, 'mapTypeId': google.maps.MapTypeId.ROADMAP, // 'scrollwheel': false 'scrollwheel': true, 'zoomControl': true }; Please help me set the geolocation; when the user accesses my website, the map should show their curent location. Thanks!
has answer: http://stackoverflow.com/a/26954529
favorite count: 0
has answer: http://stackoverflow.com/a/26968236
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42440168
has comment: http://stackoverflow.com/comment/42441028
has title: Geolocation Map JS
upvote count: 0
type: Question
tagged with: google-maps
score: -2
tagged with: javascript

http://stackoverflow.com/a/26916729
has comment: http://stackoverflow.com/comment/42383048
has body: Why don't you link a controller to the header and use ng-show in the top div of the header? Like this: blabla
has comment: http://stackoverflow.com/comment/42388366
has comment: http://stackoverflow.com/comment/42382062
has comment: http://stackoverflow.com/comment/42388438
has comment: http://stackoverflow.com/comment/42383014
score: 0
answers question: http://stackoverflow.com/q/26915971
has comment: http://stackoverflow.com/comment/42384293
has comment: http://stackoverflow.com/comment/42382487
has comment: http://stackoverflow.com/comment/42383077
type: Answer
has comment: http://stackoverflow.com/comment/42382223
has comment: http://stackoverflow.com/comment/42383262

http://stackoverflow.com/a/26907197
answers question: http://stackoverflow.com/q/26905431
type: Answer
score: 0
has body: I try this &lt;p(?: [^&gt;]+)?&gt;((?:(?!&lt;\/?p[ &gt;]).)*)&lt;\/p&gt; change the style as right for para. This only possible in regex. SEE DEMO: http://regex101.com/r/dJ5nB1/1

http://stackoverflow.com/q/26896077
tagged with: javascript
has comment: http://stackoverflow.com/comment/42345519
tagged with: jquery
has body: I'm trying to change the color of the text and it is not working. This is what I have: function LinesForKeyword($container, word) { var word = word.trim(); // wrap each word in a span and add it to a tmp var tmp = ''; //$.each(word, function (i, word) { for (var i = 0; i < reservedKeyWords.length; i++) { if (word == reservedKeyWords[i]) { word=word.replace(word, '['+word+']'); } } When I step through the code in debug mode, it says that the font color is changed, by that I mean this is when i hover over word in debug mode this is what it displays: "[string]" Then once it's done it never actually updates the color, it just stays black :(
favorite count: 0
tagged with: css
has title: Text Not changing color
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42345607
accepted answer: http://stackoverflow.com/a/26896457
score: -4
type: Question
downvote count: 4
upvote count: 0
has answer: http://stackoverflow.com/a/26896457
answer count: 1

size
type: Tag
tags question: http://stackoverflow.com/q/26931449
tag name: size

http://stackoverflow.com/comment/42412509
type: Comment
comment on: http://stackoverflow.com/a/26923233
has text: @user3870905: You would need to parse the regex if you want to modify it. Even so, it won't help you get the correct starting index of a repeated capturing group.
type: AnswerComment
score: 0

http://stackoverflow.com/a/26916812
type: Answer
has comment: http://stackoverflow.com/comment/42383929
has comment: http://stackoverflow.com/comment/42386931
has comment: http://stackoverflow.com/comment/42382507
answers question: http://stackoverflow.com/q/26915871
has comment: http://stackoverflow.com/comment/42384257
upvote count: 1
has comment: http://stackoverflow.com/comment/42382412
has body: I could be wrong, but I believe the Rails asset pipeline needs to have some sort of //= require_self or something like that to ensure the code in the current file is included. It looks to me like the loading snippet in that file isn't being run or is being run in the wrong order. It's probably easier and simpler to just save it into a separate file so you can ensure the order is correct. // File: /public/javascript/embed-api-snippet.js (function(w,d,s,g,js,fs){ g=w.gapi||(w.gapi={});g.analytics={q:[],ready:function(f){this.q.push(f);}}; js=d.createElement(s);fs=d.getElementsByTagName(s)[0]; js.src='https://apis.google.com/js/platform.js'; fs.parentNode.insertBefore(js,fs);js.onload=function(){g.load('analytics');}; }(window,document,'script')); Then put the rest of your code in a setup file like so: // File: /public/javascript/embed-api-setup.js gapi.analytics.ready(function() { gapi.analytics.auth.authorize({ container: 'embed-api-auth-container', clientid: 'REPLACE WITH YOUR CLIENT ID', }); // the rest of the setup code... }); Now your manifest should look like this: //= require /public/javascript/embed-api-snippet.js //= require /public/javascript/Chart.min.js //= require /public/javascript/moment.min.js //= require /public/javascript/embed-api/date-range-selector.js //= require /public/javascript/embed-api/active-users.js //= require /public/javascript/embed-api-setup.js Also, you said: This is talking about the gapi.analytics.auth.authorize section which I believe is part of the embed-api/active-user.js Actually, the gapi.analytics.auth.authorize part is not in the ActiveUsers component, the auth part is something you have to write yourself (because the client ID needs to be specific to you), and it should go in the embed-api-setup.js file as I've described above. The setup code for the example you're referencing can be found here.
has comment: http://stackoverflow.com/comment/42383842
has comment: http://stackoverflow.com/comment/42387145
score: 1
has comment: http://stackoverflow.com/comment/42383525
has comment: http://stackoverflow.com/comment/42382183
downvote count: 0

http://stackoverflow.com/a/26856329
answers question: http://stackoverflow.com/q/26837141
type: Answer
has body: @Aravind, you were right except the gameUI Betting reference needed its syntax tweaked. function GameUI(){ //var betObj = new Betting(); this.betObj = new Betting(); // it should be this instead this.registerDomElements(); this.registerWagerEvents(); this.registerDealButtonEvent(); this.registerHitButtonEvent(); this.registerStayButtonEvent(); betObj.renderStartingTotalCash(); }
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26837141
has comment: http://stackoverflow.com/comment/42316924

http://stackoverflow.com/q/26920273
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42388895
has comment: http://stackoverflow.com/comment/42388841
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/42388858
has comment: http://stackoverflow.com/comment/42388867
has answer: http://stackoverflow.com/a/26920582
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42389071
has comment: http://stackoverflow.com/comment/42388876
favorite count: 0
possible better answer: http://stackoverflow.com/a/26920582
has comment: http://stackoverflow.com/comment/42388904
linked to: http://stackoverflow.com/q/4197591
has answer: http://stackoverflow.com/a/26920411
upvote count: 1
has body: Is it possible to alter the url of a webpage so that it will activate specific click-activated features on the webpage without the user having to do the clicking? To better illustrate my question I made this fiddle. The page loads with a red box with information in it. The user can click the box once to see new information. They can click it again to see a third piece of information. I would like to have urls that load the page with specific information showing. For example, if the main url for my page is http://www.mypage.com, then I would like to have urls http://www.mypage.com/#info2 and http://www.mypage.com/#info3 so that when the user enters the info2 (respectively, info3) url, the page loads with the second (respectively, third) piece of information showing. Remarks: I have searched some other questions about activating scripts with hashtags, but have not found something I can understand or implement into what I want to do. In particular, I need my hashtag urls to be able to implement a sequence of several actions (e.g. two clicks to get info3 in the above example). Remark 2: I am open to other solutions too. I just need someone to explain how to accomplish what I am trying to do.
downvote count: 1
type: AnsweredQuestion
has title: Can a URL activate several scripts?
has comment: http://stackoverflow.com/comment/42405272
has comment: http://stackoverflow.com/comment/42389130
has comment: http://stackoverflow.com/comment/42389001
has comment: http://stackoverflow.com/comment/42389064
type: Question
has comment: http://stackoverflow.com/comment/42388817
has comment: http://stackoverflow.com/comment/42405448
has answer: http://stackoverflow.com/a/26921061
has comment: http://stackoverflow.com/comment/42415400
has comment: http://stackoverflow.com/comment/42438952
accepted answer: http://stackoverflow.com/a/26920411

http://stackoverflow.com/comment/42471836
type: AnswerComment
comment on: http://stackoverflow.com/a/26967351
has text: I need to replace my site logo with product image and also change title of post. i also i don't need post user comment below like link
type: Comment
score: 0

http://stackoverflow.com/q/26891590
score: 0
has body: I have a form I use to upload images: &lt;form action="uploadImage.php" method="post" enctype="multipart/form-data" id="UploadForm"&gt; &lt;input type="file" id="fileInput" name="ImageFile" help_token="upload_token" size=20 /&gt; &lt;input type="submit" id="SubmitButton" help_token="upload_token" value="Upload" /&gt; &lt;img id="loadGif" src="images/ajax-loader.gif" alt="load gif" /&gt; &lt;/form&gt; I prepare the form with ajaxform: var statustxt = $('#statustxt'); var submitbutton = $("#SubmitButton"); var myform = $("#UploadForm"); var galleryStatus2$ = $("#galleryStatus2"); var error_code; $(myform).ajaxForm({ // called when the code loads data : {dstDir : g.currentGal}, // pass in some $_POST parameters resetForm : true, beforeSend: function() { //before submitting the form galleryStatus2$.empty(); // clear status from last upload submitbutton.attr('disabled', ''); // disable upload button $('img#loadGif').fadeIn(200); // start spinner }, complete: function(response) { // upload complete console.log("&lt;br /&gt;upload complete. g.currentGal = " + g.currentGal); galleryStatus2$.html(response.responseText); //upload status submitbutton.removeAttr('disabled'); //enable submit button again $('img#loadGif').fadeOut(200); // kill spinner The problem I'm having is that I want to be able to tell the action script, uploadImage.php, which directory to upload to. I attempt to do this with the "data : {dstDir : g.gurrentGal}" line. g.currentGal holds the last folder double-clicked, i.e., the last folder opened and so now the target for any uploads. But the ajaxform code runs when the code loads initially, not when the form is submitted. So g.currentGal is whatever the variable was initialized to when the JavaScript first loads and never the last folder opened. How can I get the value of g.currrentGal at the time the form is submitted to be passed to uploadImage.php in the $_POST array? Thanks
answer count: 1
accepted answer: http://stackoverflow.com/a/26891714
tagged with: javascript
tagged with: jquery
has title: Passing current data with ajaxform
tagged with: php
has answer: http://stackoverflow.com/a/26891714
type: AnsweredQuestion
tagged with: ajaxform
tagged with: forms
type: Question

http://stackoverflow.com/a/26865089
accepted answer of: http://stackoverflow.com/q/26857407
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26857407
type: Answer
has body: You are looking for couchdb's changes feed. Every time a document is updated in the db, to which you have subscribed to, a notification is sent. You can simply listen on that notification and execute your code. You can also subscribe to particular document id's. See the request options in the POST request. Also since you are using node js I suggest you take a look at the follow library. It makes what you want to do a lot easier. Example:- var follow = require('follow'); follow({db: "&lt;database name here&gt;", include_docs:true}, function(error, change) { if(!error) { console.log(change.doc) // updated doc console.log("Got change number " + change.seq + ": " + change.id); } });
has comment: http://stackoverflow.com/comment/42312946
has comment: http://stackoverflow.com/comment/42329985

http://stackoverflow.com/comment/42454682
comment on: http://stackoverflow.com/a/26957615
type: AnswerComment
score: 0
has text: Oh. Hmm... and If I'm not mistaken, there is not a way to fix an issue with browsers in js, is there?
type: Comment

http://stackoverflow.com/comment/42449396
score: 0
has text: Why would you attempt to click the button on page load. Rather, run the code that will be fired on button click.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26954685

http://stackoverflow.com/comment/42453663
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/26957104
has text: Hello Isabel, it doesn't work for my page at all. May be i should set some other parameters for the button. I tried to call js function from c# method, but the pic appears on the page after processing...

http://stackoverflow.com/q/26922957
has comment: http://stackoverflow.com/comment/42393307
has answer: http://stackoverflow.com/a/26923258
tagged with: underscore.js
downvote count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/26923846
has body: I have the following object: var input = { "document": { "people":[ {"name":"Harry Potter","age":"18","gender":"Male"}, {"name":"hermione granger","age":"18","gender":"Female"} ] } } I do like this : _.each(result.document[people], function(item){ console.log(item); //What should I do here ? or I come wrong way ? }); And in item I get : {name : 'Harry Potter', age : '18':, gender:'Male'} {name : 'hermione grange', age : '18':, gender:'Female'} I would like to get [name,age,gender]. What should I do?
has comment: http://stackoverflow.com/comment/42393619
has answer: http://stackoverflow.com/a/26923151
has title: How to get these key in JavaScript object
has answer: http://stackoverflow.com/a/26923397
linked to: http://stackoverflow.com/q/26908285
answer count: 5
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42399728
has comment: http://stackoverflow.com/comment/42393309
has comment: http://stackoverflow.com/comment/42393631
has answer: http://stackoverflow.com/a/26923340
has comment: http://stackoverflow.com/comment/42393325
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/42429632
tagged with: lodash
has comment: http://stackoverflow.com/comment/42393385
linked to: http://stackoverflow.com/q/26901971
score: -1

http://stackoverflow.com/comment/42385540
score: 0
type: Comment
has text: Depending on different options that are chosen it needs to pick from the drop down and the correct corresponding textbox I am trying to combine the function I wrote and put at the top of the fiddle with yours
type: AnswerComment
comment on: http://stackoverflow.com/a/26916736

http://stackoverflow.com/q/26947904
has title: Javascript OOP inherits create GLOBAL object
linked to: http://stackoverflow.com/q/16063394
answer count: 1
has body: Look that. // @alias ActiveRecord.extend ... extend: function extend(destination, source){ for (var property in source){ destination[property] = source[property]; } return destination; } ... I have this class: function Exception(){} Exception.prototype = { messages: {}, add: function(k, v){ if(!Array.isArray(this.messages[k])) this.messages[k] = new Array this.messages[k].push(v) } } And, i have this class. And it's call in method this.errors a new Exception. function Validations(){ this.errors = new Exception } And, i create this Model, the model have validations, the validations have errors, fine. ActiveSupport.extend(Model.prototype, Validations.prototype) function Model(){}; But... When I create a new instance a model and add errors to this instance, the Class Exception appears as a global object. LOOK... a = new Model a.errors.add('a', 1); console.log(a.errors.messages) // return {a: [1]} b = new Model b.errors.add('a', 2); console.log(b.errors.messages) // return {a: [1,2]} How can I solve this? How do I make the Array of messages of class Exception is not GLOBAL?
tagged with: extend
has comment: http://stackoverflow.com/comment/42439793
tagged with: oop
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42447635
has comment: http://stackoverflow.com/comment/42438356
tagged with: javascript
type: Question
tagged with: global
score: 0
has answer: http://stackoverflow.com/a/26948743

http://stackoverflow.com/comment/42381120
comment on: http://stackoverflow.com/q/26916169
score: 0
type: QuestionComment
has text: Have you debug it in browser?
type: Comment

http://stackoverflow.com/comment/42324359
has text: @AntP: When I asked the question, the tags were `javascript` and `c#`. But yeah, the code sample *is* VB.Net. :-)
comment on: http://stackoverflow.com/q/26883621
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26976831
tagged with: facebook
downvote count: 1
accepted answer: http://stackoverflow.com/a/26977266
type: AnsweredQuestion
score: -1
has body: I have an error when I click on li link who contain javascript. The script JavaScript disappear and the text doesn't. Can you help me to resolve my problem, i don't find what is the problem. Here is my AJAX script : $(document).ready(function(){ $("#menu-game a").click(function() { page=$(this).attr("href"); $.ajax({ url: "./views/ContentAjax/"+page, cache:false, success:function(html){ afficher(html); }, error:function(XMLHttpRequest,textStatus, errorThrown){ afficher("erreur lors du chagement de la page"); } }) return false; }); }); function afficher(data) { $("#contenu").fadeOut(500,function() { $("#contenu").empty(); $("#contenu").append(data); $("#contenu").fadeIn(1000); }) } Here is the content I want to show when i click on the li link // The facebook API who disappear The text I'm sorry for my bad english, thank you for your help !
type: Question
upvote count: 0
tagged with: javascript
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/26977266
has title: Facebook API disappear when I use AJAX script
answer count: 1

http://stackoverflow.com/comment/42420805
comment on: http://stackoverflow.com/a/26921168
type: AnswerComment
score: 0
type: Comment
has text: Using ng-repeat and data-ng-repeat did not make any difference. However, when put in the code you suggested above, it indeed displayed "List is empty!". However, when I look at the $scope.parts in the controller, it is not empty. So how do I test that "add-part.html" is bound to "PartsController.js"?

http://stackoverflow.com/comment/42394697
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26902012
score: 1
has text: Thanks for sharing man I didn't know this! If you enable all the developer preferences though it should put out a long string in error console which shows what line it came from.

http://stackoverflow.com/comment/42390408
comment on: http://stackoverflow.com/a/26921186
type: Comment
has text: If you look at my code, i am only setting `_wattageTotal` to `0` if there is only one available trafo left in the array. While you are correct that this is actually a problem and shouldn't be done, it is not the solution to the problem per sé (whish it was). In my tests the results come out just the same if i remove that line, actually.
score: 0
type: AnswerComment

http://stackoverflow.com/q/26896209
type: Question
has comment: http://stackoverflow.com/comment/42346007
tagged with: arrays
has body: In php I return this from a function: return json_encode(array($array1, $array2, $array3, $array4)); Each array contains single elements, loaded lke this: while ($obj = $DB-&gt;next($res)) { $array1[] = $obj-&gt;the_data; } Now in JavaScript, I alert data[0], it shows me "[" Of course the entire data looks similar to this: [["element1", "element2", "element3"],["element1", "element2", "element2" ... etc Am I loading the array's incorrectly in php? or am I parsing them incorrectly in JavaScript? this is being returned in a jQuery Ajax .post call. I also am using this question as a reference
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/26896239
has comment: http://stackoverflow.com/comment/42346059
tagged with: php
has title: Return Multiples Array in JavaScript from PHP
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/1962790
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/26896239

http://stackoverflow.com/comment/48769010
score: 0
comment on: http://stackoverflow.com/a/26858155
type: Comment
type: AnswerComment
has text: Is your resolve function using the minification protection technique? Mine was and prevent jasmine.any(Function) from working

http://stackoverflow.com/comment/42312201
type: AnswerComment
comment on: http://stackoverflow.com/a/26877235
has text: Travis, Thank You! This is definitely the functionality I'm seeking. Only I'm trying to create 7 buttons and 14 divs that do what your 1 button and 2 divs do.
score: 0
type: Comment

task
type: Tag
tag name: task
tags question: http://stackoverflow.com/q/26877527

http://stackoverflow.com/a/36285566
has comment: http://stackoverflow.com/comment/79037785
answers question: http://stackoverflow.com/q/26881824
score: 10
has comment: http://stackoverflow.com/comment/88711000
upvote count: 10
downvote count: 0
has comment: http://stackoverflow.com/comment/130157040
type: Answer
has body: It worked for me after installing the Visual Studio Advanced Javascript Outlining extension. You can find the extension here After installing the extension just restart your Visual Studio and you can use it like this //#region MyRegion Code Here //#endregion
has comment: http://stackoverflow.com/comment/76071273

http://stackoverflow.com/q/26909768
has comment: http://stackoverflow.com/comment/42371012
has comment: http://stackoverflow.com/comment/42382433
favorite count: 0
downvote count: 1
type: AnsweredQuestion
has title: jslint should watch only global variables
score: 1
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/42375655
answer count: 1
tagged with: jslint
tagged with: javascript
has body: I'm trying to use online lint from http://www.jslint.com/. I also tried using webstorm. I want to get only the global variables. however, my code is very long (about 30000 lines) and it scans only 1% of it. Is there any way to use lint, or another tool to find only the global variables (the rest is not important for me). My goal is to get all global variables attached to the window object.
tagged with: webstorm
has answer: http://stackoverflow.com/a/26916968
accepted answer: http://stackoverflow.com/a/26916968

http://stackoverflow.com/a/26934704
upvote count: 1
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/26934527
score: 1
has body: This will match two matching tags and extract the middle. \[([^\]]+)\]([^\[]+)\[\1\] $1 backreference will get your tag ("tag1" in your example), and $2 will pull out the inner text.

http://stackoverflow.com/comment/42292328
comment on: http://stackoverflow.com/a/26863660
type: Comment
has text: So based on the code in the question you linked to, my 4KB JSON file, seems to become a 3748 byte object. Weird coincidence. Thanks for the explanation. But can you explain what you mean by taking the size of the keys into account ? Do you mean that I should because th e other code sample does not ?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42328505
comment on: http://stackoverflow.com/q/26884140
has text: For example this: http://stackoverflow.com/questions/4145012/avoid-chrome-popup-extension-to-close this http://stackoverflow.com/questions/8935475/prevent-popup-html-of-chrome-from-being-closed-by-iframe-action
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26965284
accepted answer: http://stackoverflow.com/a/26965408
type: AnsweredQuestion
has title: How to simplify repetitive jQuery code with different selectors
type: Question
has body: So I have hundreds of lists and they are categorized into more than 30 categories. What I do is I make the lists display:none, for each category has a click.slideToggle() function, and also slideUp other lists except the list clicked, the problem is I have to write repititive very long codes for each list. I need someone to suggest me a better way to write these javascript lines, so here are the codes for clearer picture. &lt;span id='categoryA'&gt; &lt;div id='listA' class='list'&gt; &lt;span id='categoryB'&gt; &lt;div id='listB' class='list'&gt; &lt;span id='categoryC'&gt; &lt;div id='listC' class='list'&gt; &lt;span id='categoryD'&gt; &lt;div id='listD' class='list'&gt; &lt;!-- there are around 25 more of similar lists --&gt; CSS: .list { display: none; } JavaScript: $(document).ready(function() { $("#categoryA").click(function() { $("#listA").slideToggle(function() { $("#listB,#listC,#listD").slideUp(); }); }); $("#categoryB").click(function() { $("#listB").slideToggle(function() { $("#listA,#listC,#listD").slideUp(); }); }); $("#categoryC").click(function() { $("#listC").slideToggle(function() { $("#listA,#listB,#listD").slideUp(); }); }); $("#categoryD").click(function() { $("#listD").slideToggle(function() { $("#listA,#listB,#listC").slideUp(); }); }); }); The point is I want that every time #categoryA is clicked, it slideToggle #listA, and if I click #categoryB, it slideToggle #listB and slideUp any other list that is currently slideDown. I have more than 30 categories. How do I make the code simpler and more efficient? Does anyone have a smarter way to do this?
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/42471055
has answer: http://stackoverflow.com/a/26965414
has answer: http://stackoverflow.com/a/26965492
possible better answer: http://stackoverflow.com/a/26966515
tagged with: jquery
has answer: http://stackoverflow.com/a/26965408
has answer: http://stackoverflow.com/a/26966515
has answer: http://stackoverflow.com/a/26965367
has comment: http://stackoverflow.com/comment/42468062
answer count: 5

http://stackoverflow.com/a/26877235
answers question: http://stackoverflow.com/q/26876906
score: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26876906
has comment: http://stackoverflow.com/comment/42312201
has body: jsFiddle Demo Well, there are some refactorizations I would suggest here. In addition, the reason your exact demo does not work is that it resets the values of my_array each time the function is called, so that needs to be reworked. //Nothing wrong here, so lets just do it first Array.prototype.randsplice = function () { var ri = Math.floor(Math.random() * this.length); return this.splice(ri, 1);//removed extra variable }; //Use an eventlistener to wait for the DOM to load //so that we can depend on DOM elements being available window.addEventListener("load",function(){ //locate the button element and save it in a variable var button = document.getElementById("myButton"); //do the same for the divs var myDiv = document.getElementById("myDiv"); var myDiv1 = document.getElementById("myDiv1"); //setup the array we will use for this example var my_array = ['a', 'b', 'c', 'd', 'e', 'f', 'g']; //show the original array values myDiv1.innerHTML = my_array; //attach a click event handler to our button button.onclick = function(){ //modify my_array and display result myDiv.innerHTML = my_array.randsplice(); myDiv1.innerHTML = my_array; //check if the array is empty and if so, perhaps display a message if(my_array.length == 0) alert("Empty!"); }; }); Click
type: Answer
upvote count: 2

http://stackoverflow.com/a/26843573
has body: use like this &lt;form id="co_com_form" name="co_com_form" method="get" action="" onsubmit="return Validate(this);"&gt; &lt;div class="addmore-fields"&gt; &lt;div class="field"&gt; &lt;button id='removeButton' class="button btn btn-primary btn-medium" style="float:right"&gt;remove&lt;/button&gt;&amp;nbsp;&amp;nbsp; &lt;button id='addButton' class="button btn btn-primary btn-medium" style="float:right"&gt;add&lt;/button &gt; &lt;div id='TextBoxesGroup'&gt; &lt;br&gt; &lt;div id="TextBoxDiv1"&gt; &lt;input type="text" name='co_com1' required placeholder="Co Company 1" style="float:left;width:250px;margin-bottom:10px"&gt;&lt;br&gt;&lt;br&gt; &lt;input type="file" name='logo1' placeholder="CoCompany logo" style="float:left;width:250px;margin-bottom:20px"&gt; &lt;/div&gt; &lt;br&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- /field --&gt; &lt;div style="float:left; clear:both; margin-left:50px" &gt; &lt;br&gt; &lt;button class="button btn btn-primary btn-medium" name="submit_co_com" type="submit" onclick="return validatecom();"&gt;Submit&lt;/button&gt; &lt;a href="javascript:void(0);" class="button btn btn-primary btn-medium" onClick="PopUp_com('hide','com_popup');"&gt; Cancel &lt;/a&gt; &lt;/div&gt; &lt;/form&gt; &lt;script src="//code.jquery.com/jquery-1.10.2.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function(){ //---------------add--------------------- var counter=1; $("#addButton").click(function () { if(counter&gt;10){ alert("Only 10 textboxes allow"); return false; } if(counter==1){counter++;} //document.getElementById('removeButton').removeAttribute('style'); var newTextBoxDiv = $(document.createElement('div')) .attr("id", 'TextBoxDiv' + counter); newTextBoxDiv.after().html( '&lt;br&gt;'+'&lt;input type="text" name="co_com' + counter + '" id="textbox' + counter + '" value="" required placeholder="Co Company '+ counter +'" style="width:250px;margin-bottom:10px" &gt;'+'&lt;br&gt;'+'&lt;input type="file" name="logo' + counter + '" id="filebox' + counter + '" pla…
score: 2
downvote count: 0
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/26843490

http://stackoverflow.com/q/26959738
type: AnsweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/26960936
type: Question
score: 1
has comment: http://stackoverflow.com/comment/42458207
has title: Create new Mongodb Documents vs Pushing to a Document's Array
has body: A temperature logger records the temperature every 1 second, and using Meteor.js a real time chart shows the temperature averaged over the last 5 seconds. Is it best practice to save each individual temperature reading as a new Mongodb document? Or push the new reading to an array in a document corresponding to a particular temperature logger? For the second case, will the Meteor.js client drawing the chart receive the entire document when using cursor.observeChanges? If so, wont this can be a huge document with months of temperature data that the client downloads every second?
tagged with: mongodb
accepted answer: http://stackoverflow.com/a/26960936
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: meteor
favorite count: 0
tagged with: node.js

http://stackoverflow.com/comment/42486262
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26975510
has text: Why you hide completelly your button with CSS?
score: 0

http://stackoverflow.com/comment/57934054
type: Comment
has text: no, it's not a "page", she is just starting out and we want to use her personal FB profile for marketing. When she gets to be a female Tony Robbins, we will create a page for her. I am amazed on how little info is available on creating and using FB public user feed and about ready to hire somebody to program that for me!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26870834

http://stackoverflow.com/comment/42439561
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26948721
has text: @Godisgood you're welcome. Best place is google but you could try bing ;-) Maybe those links will help to guide you.. `1.` http://www.quirksmode.org/js/this.html `2.` https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this `3.` https://developer.mozilla.org/en-US/docs/Web/JavaScript

http://stackoverflow.com/a/26878397
has comment: http://stackoverflow.com/comment/42380269
score: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26874769
downvote count: 0
has body: You should be able to use node.currentStyle to access specific style properties which is much more reliable than cssText. http://msdn.microsoft.com/en-us/library/ie/ms535231%28v=vs.85%29.aspx Notice in this example cssText doesn't provide the background color. I'm not sure when runtimeStyle is supposed to work but it doesn't seem to work pre or post javascript manipulation. These are likely bugs in IE. Note: The getComputedCSSText function is a quick hack for demonstration purposes and likely needs some modifications for use in a production environment. Test FooBar! Test
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26874769

http://stackoverflow.com/comment/42518497
comment on: http://stackoverflow.com/a/26991671
has text: Pleased to help. Thanks for sharing your solution. I'm going to implemet in mine too.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42494706
type: QuestionComment
comment on: http://stackoverflow.com/q/26973750
type: Comment
score: 1
has text: I ended up changing encoding to UTF-8 and Mozilla started working.

http://stackoverflow.com/q/26953510
has comment: http://stackoverflow.com/comment/42447296
accepted answer: http://stackoverflow.com/a/26953534
tagged with: javascript
has comment: http://stackoverflow.com/comment/42447324
score: 0
has body: I'm currently doing this: var 1 = "http://www"; var 2 = ".google."; var 3 = "com/"; then concatenating them together like this var link = 1+2+3; Is there an easier and more proficient way of doing this?
upvote count: 1
has answer: http://stackoverflow.com/a/26953534
has comment: http://stackoverflow.com/comment/42447580
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/42447557
has comment: http://stackoverflow.com/comment/42447700
favorite count: 0
linked to: http://stackoverflow.com/q/25815382
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42447543
has title: Is there an easier method to concatenate variables using JavaScript?
has comment: http://stackoverflow.com/comment/42447295
type: Question

http://stackoverflow.com/q/26913232
favorite count: 0
has answer: http://stackoverflow.com/a/26913519
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I'm creating a jQuery application where a user can draw on a canvas. I need to add the functionality to dynamically enable a hyperlink when a certain percentage of the canvas has been drawn. My program can detect what percentage of the canvas has been drawn on. Now, all I need is a way to create/enable a hyperlink on the canvas so that when the user clicks on it, he is redirected to the hyperlink URL. I googled a way to do this, but couldn't find a good solution/explanation on how to go about doing this. Any ideas or suggestions?
downvote count: 1
type: Question
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/42375825
tagged with: canvas
upvote count: 0
answer count: 1
has title: Create a listener for a hyperlink
tagged with: jquery

http://stackoverflow.com/comment/42329945
has text: Do you have an error like this. "10 $digest() iterations reached. aborting" ?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26887791
score: 0

http://stackoverflow.com/q/26986136
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has title: fullpage.js will only scrollOverflow after window resize
has answer: http://stackoverflow.com/a/26997904
tagged with: fullpage.js
has body: I have a fullpage.js site setup here. The first section has no scrollOverflow, but the second section is a grid (generated using gridify), which requires (on certain screen sizes), for it to be a scrollable section. The problem is it refuses to scroll. However, if I resize the window (even by a single pixel in any direction), then the fullpage.js scrollbar will appear for that section. Does anyone have any idea why fullpage.js is acting this way? And how can I get the scrollbar to appear in that section without having the resize the window manually? It's worth noting, I've been able to get the same thing working using the fullpage.js example page for scrollOverflow. That is setup right here. However, I haven't been able to figure out why it works there, but not in my original page!
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
accepted answer: http://stackoverflow.com/a/26997904
tagged with: javascript

http://stackoverflow.com/comment/42376777
comment on: http://stackoverflow.com/q/26913583
score: 0
type: Comment
type: QuestionComment
has text: Please indent the code properly. You have missing tags and ending semi-colon.

http://stackoverflow.com/comment/42482079
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26973444
score: 2
has text: What's the *real* goal ?

http://stackoverflow.com/comment/42492621
type: AnswerComment
comment on: http://stackoverflow.com/a/26979122
type: Comment
has text: What are you trying to do here?
score: 1

http://stackoverflow.com/q/26902480
has answer: http://stackoverflow.com/a/26902566
has body: How to validate input form using Javascript to stretch user don't insert any value into input form element. Object: 1, I want user input any number value only if have some character or special character it will show errors 2, and if user let input element value as empty it also alert to user below is my javascript code And here is Html form <?php echo form_input('quantity','',' class="quantity form-control"')?> <?php echo form_input('unitprice','',' class="unitprice form-control"')?> $
type: AnsweredQuestion
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26902566
has title: How to use javascript for html form validation to valid number only?
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/42356806

http://stackoverflow.com/comment/42495496
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26971329
type: AnswerComment
has text: @HMR it is not *accidentally* works here. It is the only option for older browsers (IE8-). Besides `Object.create` with only 1 argument is equivalent to `new`.

http://stackoverflow.com/comment/42456667
type: Comment
comment on: http://stackoverflow.com/q/26958022
type: QuestionComment
has text: if you want help it's on you to build the demo with data similar to yours. jsfiddle.net or plnkr.co
score: 0

http://stackoverflow.com/a/26860431
score: 0
type: Answer
has body: Questions like this pop up a lot on S.O. but before the question gets closed, I'll walk you through the async behavior, since you're new to it. Let's run cas_login. It has three statements: Declare obj, initialize to undefined. Call validate. This runs asynchronously, meaning the execution will be queued up to run when the scheduler says it can. But it cannot run now, because cas_login is not done yet. if (obj) return obj. Well here obj is undefined, which is falsy, so the if statement is skipped. This means the function ends without ever hitting a return statement. And in JS, this means the function returns undefined. What you need to do is make cas_login async. You tried to make it sync. Define it to take a callback of its own, one which processes the value obj. Along these lines (untested): module.exports = { cas_login: function(ticket, callback) { cas.validate(ticket, function(err, status, username) { if (err) { callback({status: false, username: null}); } else { callback({status: status, username: username}); } }); } };
answers question: http://stackoverflow.com/q/26860189
accepted answer of: http://stackoverflow.com/q/26860189
type: AcceptedAnswer

http://stackoverflow.com/q/26864339
has comment: http://stackoverflow.com/comment/42288299
accepted answer: http://stackoverflow.com/a/26865088
type: AnsweredQuestion
tagged with: c#
tagged with: asp.net-mvc
has answer: http://stackoverflow.com/a/26864422
type: Question
has comment: http://stackoverflow.com/comment/42288648
has answer: http://stackoverflow.com/a/26865088
answer count: 2
tagged with: javascript
tagged with: jquery
has title: Bundling javascript files in MVC 4.0
score: 0
possible better answer: http://stackoverflow.com/a/26864422
has body: I'm trying to bundle javascript files in my web application to increase performance. I'm trying to load a minified version of jQuery as an example but when I run the web application jQuery is not loaded. Bundle config: public class BundleConfig { public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/jquery").IncludeDirectory("~/Scripts/","jquery-1.8.2.min.js")); //Also tried this: //bundles.Add(new ScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-1.8.2.min.js")); bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css")); } } Master page: @using System.Configuration @ViewBag.Title @Styles.Render("~/Content/css") @RenderBody() @Scripts.Render("~/bundles/jquery") @RenderSection("scripts", required: false)
has comment: http://stackoverflow.com/comment/42288404
tagged with: asp.net-mvc-4

http://stackoverflow.com/a/26892034
has comment: http://stackoverflow.com/comment/42338609
has comment: http://stackoverflow.com/comment/42340166
has comment: http://stackoverflow.com/comment/42340105
has body: Perhaps by sharing my script(s) it will help trigger something? I have a loop, that for each position, I call a method called "renderMarker". That method assembles the marker. I then call the "centerMap" method. var GoogleMaps = { 'map': {}, 'marker': {}, 'markerArray': [], 'markerlatlngArray': [], /** * Renders marker(s) to the map. * Creates infowindow for the given marker. * * @param {object} myobj| data for the given marker. * @returns {void} * */ renderMarker: function (myobj) { var markerlatlng = new google.maps.LatLng(myobj.lat, myobj.lng); GoogleMaps.marker = new google.maps.Marker({ 'position': markerlatlng, 'map': GoogleMaps.map, 'title': my_title, 'icon': 'my-icon.png', 'animation': google.maps.Animation.DROP, 'data': ' ' ' Whatever you want goes here. ' + ' ' }); GoogleMaps.marker.set('propertyA', myobj.propertyA); GoogleMaps.marker.set('propertyB', myobj.propertyB); GoogleMaps.marker.set('propertyC', myobj.propertyC); GoogleMaps.markerlatlngArray.push(markerlatlng); GoogleMaps.markerArray.push(GoogleMaps.marker); GoogleMaps.centerMap(); GoogleMaps.infowindow = new google.maps.InfoWindow(); google.maps.event.addListener(GoogleMaps.marker, 'click', function () { GoogleMaps.infowindow.close(); GoogleMaps.infowindow.setContent(this.data); GoogleMaps.infowindow.open(GoogleMaps.map, this); }); } /** * Centers the map around the given markers. * * @returns {void} * */ centerMap: function () { var latlngbounds = new google.maps.LatLngBounds(); $.each(GoogleMaps.markerlatlngArray, function (i, marker) { latlngbounds.extend(marker); }); GoogleMaps.map.setCenter(latlngbounds.getCenter()); GoogleMaps.map.fitBounds(latlngbounds); } }
answers question: http://stackoverflow.com/q/26891211
score: 0
type: Answer

http://stackoverflow.com/comment/42473704
score: 0
type: Comment
has text: If it helps you with the "counter-intuitive" bit, Ruby's `Set` and Java's `TreeSet` use the exactly same method (having a composed `Hash` and `TreeMap`, respectively) ;)
comment on: http://stackoverflow.com/a/26968427
type: AnswerComment

http://stackoverflow.com/a/26851408
answers question: http://stackoverflow.com/q/26849704
downvote count: 0
has comment: http://stackoverflow.com/comment/42280489
type: Answer
upvote count: 1
has body: Anatoly is right: Primefaces' <p:remoteCommand> is perfectly fine for this. Declare the remoteCommand anywhere inside your xhtml page, for example: <p:remoteCommand name="SetMyStrings" actionListener="#{myBean.setMyStrings}" /> from within your Javascript you can now invoke the remoteCommand, using SetMyStrings([{ name: "string1", value: "Hello"}, {name="string2", value: "World"}]); (or ofc. obtain the string values from your javascript variables rather than hardcoding them) Finally, all you need to do inside the backing bean is collect the values from the RequestParameter Map: public void setMyStrings(){ Map<String, String> requestParamMap = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap(); String string1 = requestParamMap.get("string1"); //Hello String string2 = requestParamMap.get("string2"); //World }
score: 1

http://stackoverflow.com/comment/42681269
type: Comment
has text: its not working when i click after div size is reduced sub menu opens
comment on: http://stackoverflow.com/a/26967961
type: AnswerComment
score: 0

http://stackoverflow.com/a/36593719
has body: This same issue has been logged on the ng-sortable site right here There also is a longTouch / longTouchActive(old versions &lt;= 1.3.2) option which you can set to true; setting to true will cause the drag and drop functionality to get activated upon long-touch aka touch-and-hold on touch devices. Let me know if this helps on ipads, android chrome etc.
answers question: http://stackoverflow.com/q/26889663
score: 0
type: Answer

http://stackoverflow.com/comment/44546420
comment on: http://stackoverflow.com/a/26987393
score: 0
type: AnswerComment
has text: Hi @SébastienVassaux please consider to upvote my answer if you find it useful
type: Comment

http://stackoverflow.com/q/26984834
downvote count: 0
has comment: http://stackoverflow.com/comment/42503555
tagged with: jquery
has comment: http://stackoverflow.com/comment/42503416
linked to: http://stackoverflow.com/q/4994046
favorite count: 0
has body: For a certain image I have a list containing the pixel coordinates of all the points in a polygon segmenting all the objects it contains (look at the image below). For instance, for the person I have a list l1 = [x0,y0,x1,y1,...,xn,yn], for the cat a list l2 = [x0',y0',x1',y1',...,xk',yk'], and similarly for all the objects. I have 2 questions: What is the best javascript library to use to draw on top of an image? Given the raw image I would like to obtain the result seen below. I would like each segmentation to be visualized only when the mouse hovers on top of it. For this I believe I should bind this drawing function to the mouse position. I'm thinking at something with the structure below but don't know how to fill the gaps, could you please give me some indication? $(.container).hover( function(e) { //get coordinates of mouse //if mouse is over one object //draw on top of image the segmentation for that object }); container is the class of the div containing the image so I should be able to get the coordinates of the mouse since the image starts at the top left corner of the container div.
has answer: http://stackoverflow.com/a/26987342
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Draw on top of an image using javascript
upvote count: 3
type: Question
has comment: http://stackoverflow.com/comment/43903691
score: 3
tagged with: javascript
tagged with: image
has comment: http://stackoverflow.com/comment/42503367
has answer: http://stackoverflow.com/a/26987177
has comment: http://stackoverflow.com/comment/42505346
answer count: 2
tagged with: canvas

http://stackoverflow.com/comment/42406079
score: 2
has text: Add the language tag.
comment on: http://stackoverflow.com/q/26930464
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42462819
type: QuestionComment
has text: @zerkms, they both *seem* to be asking. (Of course, that is my opinion about a *perception*, so it's hard to prove myself right or wrong.)
comment on: http://stackoverflow.com/q/26962278
score: 0
type: Comment

http://stackoverflow.com/comment/42538660
has text: Retsam, how do I make it modifiy the original array so that the UI updates?
score: 0
comment on: http://stackoverflow.com/q/26977949
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26956554
type: Answer
score: 7
upvote count: 7
accepted answer of: http://stackoverflow.com/q/26956449
has comment: http://stackoverflow.com/comment/42452618
answers question: http://stackoverflow.com/q/26956449
type: AcceptedAnswer
downvote count: 0
has body: Disabled elements do not fire events. You can place a element over top of the element and listen to the event fired on that element.

http://stackoverflow.com/comment/42337780
type: AnswerComment
type: Comment
has text: jQuery is the most popular JavaScript framework to help you develop web applications. It has many functions to help you manipulate the DOM, make XHR/ajax requests, etc. There are plenty of tutorials around the web.
comment on: http://stackoverflow.com/a/26879659
score: 0

http://stackoverflow.com/comment/42334083
comment on: http://stackoverflow.com/q/26888991
score: 0
has text: But what you do think `self.filter()` will do? **Why** did you write this line - why are you trying to call a function on something you know is a String? What were you trying to achieve?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26880744
score: 0
answers question: http://stackoverflow.com/q/26879529
has body: &lt;script type="text/javascript" &gt; function doClick(){ alert("Hai"); } &lt;/script&gt; &lt;script type="text/javascript" src="js/jquery-1.4.2.min.js"/&gt; &lt;script type="text/javascript"&gt; function doClicks(){ alert("Hai"); } &lt;/script&gt; &lt;link rel="stylesheet" type="text/css" href="css/style.css" /&gt; &lt;link rel="stylesheet" type="text/css" href="../css/style.css" /&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;%@taglib prefix="s" uri="/struts-tags"%&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Home page&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;center&gt; &lt;input type="button" onclick="doClick()" value="Click sp"/&gt; &lt;input type="button" onclick="doClicks()" value="Click js"/&gt; &lt;table width="921" height="529" border="0"&gt; &lt;tr&gt; &lt;td height="143" colspan="2" id="header"&gt;&amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="37" colspan="2" id="link"&gt; &lt;center&gt; &lt;div&gt; &lt;a href="admin"&gt;Home&lt;/a&gt; &lt;/div&gt; &lt;div&gt; &lt;a href="admin_page1"&gt;Service1&lt;/a&gt; &lt;/div&gt; &lt;div&gt; &lt;a href="admin_page2"&gt;Service2&lt;/a&gt; &lt;/div&gt; &lt;div&gt; &lt;a href="out"&gt;Logout&lt;/a&gt; &lt;/div&gt; &lt;/center&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="313" height="298" class="body"&gt;&lt;/td&gt; &lt;td width="693" class="body"&gt;Service1&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="33" colspan="2"&gt;&lt;div align="center"&gt;copyright@2013&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/center&gt; &lt;/body&gt; &lt;/html&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;%@taglib prefix="s" uri="/struts-tags"%&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;…
type: Answer

http://stackoverflow.com/a/31363934
answers question: http://stackoverflow.com/q/26982040
has comment: http://stackoverflow.com/comment/123760808
has body: If you found this Q&amp;A by search engine, you may also find it helpful to visit the more thoroughly discussed topic at Google Calendar API v3 Access Not Configured I had to manage my project, first by visiting https://console.developers.google.com/project. I clicked the Edit allowed referrers button and added these to the list: localhost localhost/* *.localhost/* *.localhost 127.0.0.1/* At the time of writing, this was all done under APIs &amp; auth > Credentials. This is necessary even for publicly available calendars.
accepted answer of: http://stackoverflow.com/q/26982040
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/123758317
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/42490392
comment on: http://stackoverflow.com/a/26977890
type: AnswerComment
has text: I am using jQuery, sorry, I should have been more clear. Thank you for the quick answer! But, er... I'm not very experienced with this. Could you show me how to work that into what I already have there? Do I just wrap that around my existing code?
score: 0
type: Comment

http://stackoverflow.com/q/26919660
has comment: http://stackoverflow.com/comment/42388160
score: 0
has comment: http://stackoverflow.com/comment/42387769
has comment: http://stackoverflow.com/comment/42387733
tagged with: http://stackoverflow.com/tag/html
has title: PHP file not loading when launched from file within #DIV
has comment: http://stackoverflow.com/comment/42388704
answer count: 0
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/42387988
has comment: http://stackoverflow.com/comment/42388291
linked to: http://stackoverflow.com/q/1309452
has comment: http://stackoverflow.com/comment/42387632
has comment: http://stackoverflow.com/comment/42388052
has body: This is driving me crazy. I have three pages in this equation: nightmare.php, semi.php, and update.php. Pieces of Code nightmare.php Select Business Unit IMES SEMI showPage() function function showPage(str) { console.log(str); if (str !==".PM") { if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } } if (str!=="/metrics.php") { $("#txtHint").load(str, function () { }); }} The user begins by loading nightmare.php, which consists of a header bar with a dropdown (shown above). When they select SEMI, semi.php is called into the #txtHint div (also shown above) semi.php semi.php consists mostly of an HTML table populated with PHP and SQL. There are fields that the user can update. There is a submit button. When the user presses this submit button, those changes should be sent to the server and the user's view should be refreshed with the updated info. The important piece is this line: Problem If load semi.php into the address bar, the table is displayed and I type in comments and hit the "update" button. Update.php launches and echos out the correct SQL code. If I load nightmare.php instead, then select semi from the dropdown and populate semi.php into the DIV on nightmare.php, then click the update button, it loads update.php but update.php is blank and no code is executed to the server. I have looked through other projects I've written where I've done this same exact process and I can't see any discernible difference in the code that would allow me to understand why this doesn't work. I'm very confused! Let me know if you need to see any other snippets of code to help me make sense of this. Update 11/14/2014 Here is semi.php, with a few changes for brevity: <?php session_start(); ?> <?php include('./nightmaredb.php'); $sqlQuery = "SELECT * FROM report"; $result = mysqli_query($con, $sqlQuery); ?> Nightmare <input class="button" class="btn btn-default btn-lg" name="update"<?= $lineID ?>" type="submit" id="update" value="UPDATE"> SOLI Branch *... a fe…
tagged with: mysql
has comment: http://stackoverflow.com/comment/42387807
type: Question
has comment: http://stackoverflow.com/comment/42389331
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42411118

http://stackoverflow.com/comment/42423214
type: Comment
comment on: http://stackoverflow.com/a/26939368
has text: try document.getElementById(yellowIDs[i]).style.background = "#ffff00";
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42352358
has text: Might be that something does not work, but there is no exception.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/26899775
score: 0

http://stackoverflow.com/comment/42443583
score: 1
comment on: http://stackoverflow.com/a/26951111
type: AnswerComment
type: Comment
has text: @DomingoSL By the way, here is an example of real overlay: http://jsfiddle.net/c89Ls0av/5/

http://stackoverflow.com/comment/42279764
type: Comment
type: QuestionComment
has text: well, you can see that it is two lines rearranging in such a way as to create a cross, so to do this, you will need css3 animations, there are tons of tutorials on this, try something and report back :)
comment on: http://stackoverflow.com/q/26859302
score: 0

http://stackoverflow.com/a/26859977
has body: &lt;script&gt; (function ( $ ) { $.fn.messager = function(message, effect, speed, gothru) { if (!$(this).data('message')) { $(this).data('message', Array()); } $(this).data('message').push({messageContent: message, messageEffect: effect, messageSpeed: speed}); if ($(this).data('message').length &gt; 1 &amp;&amp; gothru != true) { return; } $(this).fadeOut(speed).delay(speed).text(message).fadeIn(speed, function(){ $(this).data("message").shift(); if ($(this).data('message').length &gt; 0) { var arrMessage = $(this).data('message'); var messageContent = arrMessage[0].messageContent; var messageEffect= arrMessage[0].messageEffect; var messageSpeed= arrMessage[0].messageSpeed; $(this).data("message").shift(); $(this).messager(messageContent , messageEffect, messageSpeed, true); } }); return this; }; }( jQuery )); &lt;/script&gt; It's good now.
score: 0
has comment: http://stackoverflow.com/comment/42280789
answers question: http://stackoverflow.com/q/26859275
type: Answer
has comment: http://stackoverflow.com/comment/42280849
has comment: http://stackoverflow.com/comment/42280941
has comment: http://stackoverflow.com/comment/42280895

vb.net
tags question: http://stackoverflow.com/q/26895004
tags question: http://stackoverflow.com/q/26990601
tags question: http://stackoverflow.com/q/26976402
tags question: http://stackoverflow.com/q/26836402
type: Tag
tags question: http://stackoverflow.com/q/26925967
tags question: http://stackoverflow.com/q/26893298
tags question: http://stackoverflow.com/q/26883621
tags question: http://stackoverflow.com/q/26878932
tags question: http://stackoverflow.com/q/26934180
tags question: http://stackoverflow.com/q/26841312
tag name: vb.net
tags question: http://stackoverflow.com/q/26990932
tags question: http://stackoverflow.com/q/26904052

atomic
type: Tag
tags question: http://stackoverflow.com/q/26900435
tag name: atomic

http://stackoverflow.com/a/44992439
type: Answer
answers question: http://stackoverflow.com/q/26920459
has body: I have the same question.(using jsftp to upload files results in files of zero size on vsftpd server) make sure use console.error to print the error. Ftp.put(buffer, remote, function(err) { if (err) { console.error(err); callback(err); } else { alert(file + " - uploaded successfuly"); callback(); } }); the error like that { [Error: connect ETIMEDOUT **192.168.0.4:64953**] code: 'ETIMEDOUT', errno: 'ETIMEDOUT', syscall: 'connect', address: '192.168.0.4', port: 64953 } because of my vsftpd using the PASV model,so when it return the port .jsftp modified the ip .I resolve this problem : modify jsftp.js (jsftp/lib/jsftp.js) var fixhost; var Ftp = module.exports = function(cfg) { ... this.useList = cfg.useList || false; fixhost=this.host;//add } Ftp.prototype.getPasvSocket = function(callback) { ... options.host=fixhost;//add var socket = self._pasvSocket = Net.createConnection(options); }
score: 0

http://stackoverflow.com/q/26891970
tagged with: javascript
score: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/42337814
has answer: http://stackoverflow.com/a/26892051
linked to: http://stackoverflow.com/q/9158238
tagged with: onclick
type: UnansweredQuestion
has title: Uncaught TypeError: object is not a function onclick
duplicate of: http://stackoverflow.com/q/9158238
has comment: http://stackoverflow.com/comment/42337808
tagged with: object
type: Question
upvote count: 4
has body: I receive the error "Uncaught TypeError: object is not a function" when clicking on a button in my webpage. The button code is: &lt;button id="addUser" name="addUser" onclick="addUser()"&gt; Add User &lt;/button&gt; The code for function addUser is function addUser() { userValue = document.getElementById("userForAdmin"); passValue = document.getElementById("passForAdmin"); console.log(userValue.value); console.log(passValue.value); } Can anyone point out my error? My guess is its likely a basic mistake.
tagged with: function
answer count: 1
downvote count: 0

http://stackoverflow.com/q/26977887
has body: I want to know how to convert/extend a pre-existing object instance of a given type (say, type 'Widget') to a new type (say, 'WidgetPlus'), so that the instance inherits all methods and variables of the original and the new. So, if I have widget_1, widget_2 and widget_3, all of which were instantiated as new Widget(), what is the best way to extend these instances to my new WidgetPlus class? Thanks in advance, Andy
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/26978476
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42491622
score: 2
tagged with: oop
has comment: http://stackoverflow.com/comment/42490450
upvote count: 2
has title: How to change type of an object instance after-the-fact
type: Question
tagged with: object
tagged with: javascript
has comment: http://stackoverflow.com/comment/42491727

http://stackoverflow.com/comment/42292021
has text: No problem! Javascript 'constructors' are notoriously unintuitive.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/26866100
type: AnswerComment

http://stackoverflow.com/comment/42333713
comment on: http://stackoverflow.com/q/26889447
score: 0
has text: I stated before the code that I used `preventDefault` but I should have included it in my code instead. My mistake sorry.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26900997
type: Answer
has body: Your action on your &lt;form&gt; isn't correct. It should be (assuming server is your Express app and not a mounted router): action="/constitution"
has comment: http://stackoverflow.com/comment/42368495
has comment: http://stackoverflow.com/comment/42369212
has comment: http://stackoverflow.com/comment/42354990
score: 0
answers question: http://stackoverflow.com/q/26900956

http://stackoverflow.com/q/26900154
favorite count: 0
has answer: http://stackoverflow.com/a/26921454
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42370702
has comment: http://stackoverflow.com/comment/42354551
type: Question
score: 2
has comment: http://stackoverflow.com/comment/42354184
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I am building a site using the Fotorama (www.fotorama.io) Jquery plugin. I have been using this code to generate custom thumbnails (jsfiddle): $('.thumbs').each(function () { $('a', this).each(function () { var $a = $(this); // set ids, will use them later $a.attr({id: $a.attr('href').replace(/[\/\.-]/g, '')}); }); var $thumbs = $(this), $fotorama = $thumbs.clone(); $fotorama .on('fotorama:show', function (e, fotorama) { // pick the active thumb by id $('#' + fotorama.activeFrame.id) .addClass('active') .siblings() .removeClass('active'); }) .addClass('fotorama') .removeClass('thumbs') .insertAfter(this) .fotorama({nav: false, width: '100%', maxHeight: 400, ratio: 3/2}); // get access to the API var fotorama = $fotorama.data('fotorama'); $thumbs.on('click', 'a', function (e) { e.preventDefault(); // show frame by id fotorama.show(this.id); }); }); This code works very well but I also need custom captions. I found the following code (jsfiddle) but I am struggling with putting the two bits of code together. I'm just learning Javascript and JQuery and could do with a hand combining the script to work as one. Everything I have tried so far has failed. $('.fotorama') .on('fotorama:show', function (e, fotorama) { fotorama.$caption = fotorama.$caption || $(this).next('.fotorama-caption'); var activeFrame = fotorama.activeFrame; fotorama.$caption.html( '&lt;strong&gt;' + activeFrame.title + '&lt;/strong&gt;&lt;br&gt;' + activeFrame.author ); }) .fotorama();
tagged with: fotorama
has title: Using Fotorama api for custom thumbnails and captions
has comment: http://stackoverflow.com/comment/42353949
answer count: 1

http://stackoverflow.com/q/26966317
tagged with: http://stackoverflow.com/tag/html
tagged with: cookies
has comment: http://stackoverflow.com/comment/42469871
has comment: http://stackoverflow.com/comment/42469971
has answer: http://stackoverflow.com/a/26966820
type: Question
has body: Hi guys how do we do this? for example i have a list of dropdown OPT 1 OPT 2 OPT 3 and then i have 3 different a hrefs SHOWS OPT 1 SHOWS OPT 2 SHOWS OPT 3 now how can we set the cookie for this using javascript? when the user selects a href SHOWS OPT 1 it will select the OPT 1 in the select dropdown list, then it will get the cookies stored in the OPT 1
tagged with: javascript
has title: Javascript set Cookie to get value in a dropdown
score: 0
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/q/26970004
has body: I have a form on my site which is used to upload images. The form works, but the Javascript isn't acting how I expect it to. What I want it to do, is when I select an image using the "Browse" button, to update the neighbouring input field with the filename. Can anyone see why this wouldn't be working? Here's the HTML: &lt;div class="input-group"&gt; &lt;span class="input-group-btn"&gt; &lt;span class="btn btn-danger btn-file"&gt; Browse… &lt;input type="file" name="Image" multiple=""&gt; &lt;/span&gt; &lt;/span&gt; &lt;input type="text" class="form-control filename" readonly=""&gt; &lt;/div&gt; And here's the Javascript: &lt;script type="text/javascript"&gt; $(document).on('change', '.btn-file :file', function() { var input = $('.filename'), numFiles = input.get(0).files ? input.get(0).files.length : 1, label = input.val().replace(/\\/g, '/').replace(/.*\//, ''); input.trigger('fileselect', [numFiles, label]); }); &lt;/script&gt;
tagged with: forms
possible better answer: http://stackoverflow.com/a/26970226
type: Question
has answer: http://stackoverflow.com/a/26970202
answer count: 2
accepted answer: http://stackoverflow.com/a/26970202
upvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
score: 0
has title: Update form field in JavaScript
has answer: http://stackoverflow.com/a/26970226
has comment: http://stackoverflow.com/comment/42476380
downvote count: 1
has comment: http://stackoverflow.com/comment/42476190
tagged with: c#
type: AnsweredQuestion

http://stackoverflow.com/comment/42463576
type: AnswerComment
type: Comment
has text: Technically you can change the parameter to 1000000 but it's going to be a bit slow. Javascript is not good with this sort of thing.
comment on: http://stackoverflow.com/a/26961853
score: 0

http://stackoverflow.com/a/26984217
downvote count: 0
upvote count: 3
type: Answer
answers question: http://stackoverflow.com/q/26984028
has comment: http://stackoverflow.com/comment/42525946
score: 3
has comment: http://stackoverflow.com/comment/42503028
has body: A far easier way to do this would be to generate a new reverb impulse response (an exponential falloff of noise works as a cheap version), and crossfade between convolver nodes when you change the impulse response (you can't directly change the IR used for a single node without it glitching).
has comment: http://stackoverflow.com/comment/42531888

http://stackoverflow.com/comment/42483136
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26973957
has text: Try eliminating parts of that example, one part at a time, until you get working output- then add the last thing you removed, and you'll have a better idea of where to start looking.

http://stackoverflow.com/q/26850747
tagged with: two.js
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27029741
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: How do I create circular hotspots with two.js?
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27029741
has body: I am trying to make a solar system model. I made it all so far using two.js. I want to make it so when the mouse is over a planet's orbit path, it'll highlight that planet's orbit, and be a link to information about that planet. I'm having trouble finding a way to do this, though. If you don't have it, here's Two.js. My file structure looks like this: css main.css js main.js two.js index.html PS. This will not render with the "Run code snippet" feature. If you wish to see it, you must save this code and put it in the same file structure I have. //This work was created by the minds of Sam Steele and Devin Fowler of Cryptocosm Developers. //Cryptocosm ©2014 //cryptocosm.x10.bz //Initiate the render context var elem = document.getElementById('canvas'); var two = new Two({ fullscreen: true }).appendTo(elem); //Define our planets and their colors var sun = two.makeCircle(0, 0, 70); var mercury = two.makeCircle(95, 0, 7); var venus = two.makeCircle(125, 0, 8.5); var earth = two.makeCircle(160, 0, 11.4); var mars = two.makeCircle(200, 0, 9.5); var jupiter = two.makeCircle(260, 0, 28); // For Saturn we're going to do something special in order to get the rings var saturnBody = two.makeCircle(320, 0, 24); var saturnRings = two.makeCurve(296, 0, 290, 10, 322, 10, 350, -8, 342, -10, true); saturnRings.rotation = 4.5; var saturn = two.makeGroup(saturnBody, saturnRings); var uranus = two.makeCircle(460, 0, 18); var neptune = two.makeCircle(540, 0, 16); var asteroid = two.makeCircle(0, 320, 3); //Try to make some stars var width = window.innerWidth; var height = window.innerHeight; var star; for (i = 0; i < 200; i++) { var randX = Math.round(Math.random() * width); var randY = Math.round(Math.random() * height); star = two.makeCircle(randX, randY, 2); } //Set the color of the planets sun.fill = '#F7CA18'; mercury.fill = '#9E9E9E'; venus.fill = '#795548'; earth.fill = '#2196F3'; mars.fill = '#FF7043'; jupiter.fill = '#E67E22'; saturnBody.fill = '#A1887F'; saturnRings.stroke = "#F5…
type: Question

http://stackoverflow.com/comment/42420799
score: 0
has text: Is it possible for you to use angular ui router? If so, you can have a look here: https://github.com/angular-ui/ui-router/wiki/URL-Routing#url-Parameters
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26937105

http://stackoverflow.com/comment/42397375
comment on: http://stackoverflow.com/a/26924958
score: 0
type: AnswerComment
type: Comment
has text: thanks again for the additional assistance. I've been playing around too locally with the codes you shared. It may have worked but I'm not too sure yet. Just one question, if cookies has this clear history on browsers to reset saved data, what's the localStorage way of clearing such saved data?

http://stackoverflow.com/comment/42935504
has text: Hello, there is no spree_frontend.js file in app/assets/javascripts/store/ directory. Please is there some other place i can put this
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27000162

scroll
tags question: http://stackoverflow.com/q/26882418
tags question: http://stackoverflow.com/q/26971418
tags question: http://stackoverflow.com/q/26893524
tags question: http://stackoverflow.com/q/26921536
tags question: http://stackoverflow.com/q/26890245
tags question: http://stackoverflow.com/q/26838636
type: Tag
tags question: http://stackoverflow.com/q/26929794
tags question: http://stackoverflow.com/q/26980357
tags question: http://stackoverflow.com/q/26904972
tags question: http://stackoverflow.com/q/26899844
tag name: scroll
tags question: http://stackoverflow.com/q/26978739
tags question: http://stackoverflow.com/q/26858914
tags question: http://stackoverflow.com/q/26907430
tags question: http://stackoverflow.com/q/26847372

http://stackoverflow.com/comment/42673169
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26969271
has text: @torazaburo At least we have to *structure JavaScript code in separate files*, so I don't see how "do nothing" can satisfy that.

http://stackoverflow.com/q/26915432
answer count: 4
has body: Using the latest analytics.js code (as of today) is there a way through their JS API I can get the session id?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/133599392
downvote count: 0
has answer: http://stackoverflow.com/a/26916594
type: Question
has comment: http://stackoverflow.com/comment/132531712
tagged with: google-analytics
score: 7
tagged with: javascript
has title: How to reliably get session id generated by Google Analytics?
has answer: http://stackoverflow.com/a/51640180
possible better answer: http://stackoverflow.com/a/75733279
has comment: http://stackoverflow.com/comment/133602041
upvote count: 7
has answer: http://stackoverflow.com/a/75733279
favorite count: 0
linked to: http://stackoverflow.com/q/7060707
has answer: http://stackoverflow.com/a/26916974
accepted answer: http://stackoverflow.com/a/26916974
tagged with: google-analytics-api

http://stackoverflow.com/q/26847070
tagged with: javascript
has answer: http://stackoverflow.com/a/26847244
score: 4
answer count: 3
has title: Why do we prepend global variables with `window.`?
has comment: http://stackoverflow.com/comment/42257335
has comment: http://stackoverflow.com/comment/42257759
favorite count: 0
has answer: http://stackoverflow.com/a/26847138
accepted answer: http://stackoverflow.com/a/26847244
has comment: http://stackoverflow.com/comment/42257481
has comment: http://stackoverflow.com/comment/42257314
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42257149
possible better answer: http://stackoverflow.com/a/26847303
tagged with: global-variables
downvote count: 1
has answer: http://stackoverflow.com/a/26847303
type: Question
has body: In a lot of code examples I see around the internet, global variables such as innerWidth, onresize, navigator, etc., are written as window.innerWidth, window.onresize, window.navigator, respectively. Why are some of these globals prepended with window. and others, such as document and console typically not prepended? Edit: I know how OOP works and that I am accessing various properties of the window object. I'm no novice to JavaScript. I'm sorry if my question may have been unclear. I have been programming in JS for years but have never questioned this convention, hence my question. In essence, I am asking why we don't put window. before document, but we put it before innerWidth. Is it simply a matter of clarity? In theory, shouldn't I be able to reference any of the globals without the window. prefix and have no problem?
upvote count: 5

remote-debugging
tag name: remote-debugging
type: Tag
tags question: http://stackoverflow.com/q/26887553

http://stackoverflow.com/q/26963130
answer count: 2
accepted answer: http://stackoverflow.com/a/26963220
has body: I am working on a basic HTML5 / JavaScript page. I am stuck at getting the line "var textInput = dataEntry.value;" to pull data from the form. As it sits right now whenever I attempt to input a character it will take any character and I get the message "TypeError: Cannot read property 'value' of undefined" can anyone explain to me why I am getting this error? The code I have now is as follows: < script type = "text/javascript" > /* */ function validateLetter(dataEntry) { try { var textInput = dataEntry.value; var replacedInput = /[^A-Za-z]/g; if (replacedInput.test(textInput) == false) throw "You can only enter letters into this field."; } catch (textInputError) { window.alert(textInputError) return false; } finally { dataEntry.value = form.toLowerCase() } return true; } /* ]] */ < /script> Enter your mother's maiden name: Enter the city you were born in: Enter the street you grew up on: Enter your phone number: Enter the year you were born: Enter the number of siblings you have: Reset Form
has title: JavaScript pull data from a form and make sure inputs are true
score: 0
has comment: http://stackoverflow.com/comment/42464187
possible better answer: http://stackoverflow.com/a/26963179
has answer: http://stackoverflow.com/a/26963179
tagged with: javascript
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26963220
type: Question

http://stackoverflow.com/q/26952691
has title: Aggregation of code metrics over multiple files
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26979502
score: 1
upvote count: 1
type: Question
tagged with: javascript
has body: I am currently trying to compare the TodoMVC Examples of Angular, Ember, Backbone and Knockout with the help of code metrics. After some research, I found jsmeter.info and jscomplexity.org which both cover the metrics i would like to compare. (Lines of Code, Cyclomatic Complexity, Halstead Metrics, Maintainability Index) My problem here is that I have to analyze every file on it's own and I couldn't manage to find out how I can aggregate the outputs of the different files, that there is just one result at the end for every implementation of TodoMVC. So for Lines of Code it's easy, I just have to add them, but I'm pretty sure that this is not applicable for the other metrics. Do I have to take the average or is there a better way to find a meaningful result? Thank you in advance.
tagged with: code-metrics
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/26979502

http://stackoverflow.com/comment/42348772
type: Comment
has text: The problem with this is that, the button still goes onto the next event. For this instance, I am using a modal and once it's clicked it'll alert me but it still goes on to the next modal. onclick="$('.md-modal').removeClass('md-show');"
type: AnswerComment
comment on: http://stackoverflow.com/a/26897723
score: 0

amd
tags question: http://stackoverflow.com/q/26875048
type: Tag
tags question: http://stackoverflow.com/q/26969271
tag name: amd

http://stackoverflow.com/q/26953617
has comment: http://stackoverflow.com/comment/49386628
type: Question
tagged with: javascript
tagged with: express
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/26953638
has answer: http://stackoverflow.com/a/26953639
type: UnansweredQuestion
has title: How to have multiple routes use the same route function in express.js
tagged with: node.js
has body: I can use app.get('/:someVar/xxxxx', function(req, res) { /* etc */ }); to get someVar by req.params.someVar. However, I want both www.example.com/12345/xxxxx and www.example.com/xxxxx to go into the same app.get How should I approach this problem?

http://stackoverflow.com/a/67440004
score: 2
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/26961258
type: Answer
has body: In case anyone else sees this in the future, make SURE the style you are trying to apply is valid. I was trying to set a element's "text-anchor" style to "right", and it just wouldn't go! Turns out it's "end", not "right".

http://stackoverflow.com/comment/78734314
type: Comment
comment on: http://stackoverflow.com/a/26922739
score: 0
type: AnswerComment
has text: In Chrome and Firefox you can use this:[code] for (var pair of frmData.entries()) { console.log(pair[0]+ ', ' + pair[1]); }[/code]

http://stackoverflow.com/q/26883244
has title: My javascript function (url) doesnt go to the php page
has comment: http://stackoverflow.com/comment/42322240
tagged with: jquery
has comment: http://stackoverflow.com/comment/42322067
tagged with: ajax
tagged with: php
has comment: http://stackoverflow.com/comment/42322721
has comment: http://stackoverflow.com/comment/42322850
tagged with: include
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42323141
has comment: http://stackoverflow.com/comment/42322462
type: Question
has comment: http://stackoverflow.com/comment/42322324
tagged with: javascript
has body: I have a question which is probably easy to solve but due to my lack of javascripting skills I find it rather hard. I am using a function to auto-complete database info in a search bar. For that I'm using this javascript function: &lt;script type="text/javascript"&gt; $(function(){ $(".search").keyup(function(){ var inputSearch = $(this).val(); var dataString = 'searchword='+ inputSearch; if(inputSearch!=''){ $.ajax({ type: "POST", url: "http://marceldepender.nl:2222/CMD_FILE_MANAGER/domains/marceldepender.nl/public_html/Recap/wp-content/themes/radiate/templates/search.php", data: dataString, cache: false, success: function(html){ $("#divResult").html(html).show(); } }); } return false; }); jQuery("#divResult").live("click",function(e){ var $clicked = $(e.target); var $name = $clicked.find('.name').html(); var decoded = $("&lt;div/&gt;").html($name).text(); $('#inputSearch').val(decoded); }); jQuery(document).live("click", function(e) { var $clicked = $(e.target); if (! $clicked.hasClass("search")){ jQuery("#divResult").fadeOut(); } }); $('#inputSearch').click(function(){ jQuery("#divResult").fadeIn(); }); }); &lt;/script&gt; As you can see in the first part of the function, there is a value called url: this url includes (at least I think that is what it does) a certain php page when the if statement is true. This php page (search.php) does a query and gives output related to the search terms. Though for some reason, the javascript function doesn't go to that search.php page. I have done / tested several things: IN the original document the url was just plan: url: "search.php", - I changed it to the entire link where the search.php is on though since the previous url didn't work (the new one doesn't either though). I changed the search.php to some easy echo code just so I know the page is being included / redirected to. For some reason (and I think it is because the search.php isn't being included) the code doesn't work.. The page where the javascript function is on…
has comment: http://stackoverflow.com/comment/42322292
score: 0

http://stackoverflow.com/q/26900764
type: Question
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/42354323
tagged with: javascript
has comment: http://stackoverflow.com/comment/42354515
tagged with: angularjs
has body: I am using nodeJS so the server will send the following json object to controller by doing: data = { "question": "theQuestion", "answer": "theAnswer" }; res.json(data); Then in the controller, I want to manipulate the variable like: data = QA.get(); $scope.q = data[question] + "Some additional info here"; QA is the service defined as: angular.module('questionServices', ['ngResource']) .factory('QA', function ($resource) { return $resource('/qa'); }); However, the error message always tells me that data[question] is undefined. What is the right way to access the value? I have tried data.question. It doesn't work either. I know I can simply show the json values by using ng-repeat in html but I want to be more flexible managing the values.
possible better answer: http://stackoverflow.com/a/26900824
has title: How can I access value in json in AngularJS
has answer: http://stackoverflow.com/a/26900824
tagged with: node.js
has answer: http://stackoverflow.com/a/26901168
has comment: http://stackoverflow.com/comment/42354469
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/26901168

http://stackoverflow.com/comment/42373481
score: 0
has text: The element is found, it shows exactly the content from the HTML I posted. I created a fiddle http://jsfiddle.net/chgv41Lr/ but somehow the popovers are being activated inside the iframe, which is the behavior I wanted to do
comment on: http://stackoverflow.com/q/26910870
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42364429
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26906771
has text: yeah, reusing that function makes sence :) but sometimes it saves time just typing it down - especially with this specialcase behaviour .. hoped it helped you anyway

http://stackoverflow.com/q/26921048
score: -1
has body: I want to know if this is possible to do via jquery since I CAN'T add it in the markup: I want to add download.php?file= to a url like this (links will change so I can't just replace the whole href): DOWNLOAD So I could get the link like this: DOWNLOAD Any ideas?
has answer: http://stackoverflow.com/a/26921129
linked to: http://stackoverflow.com/q/2805742
type: Question
has answer: http://stackoverflow.com/a/26921101
answer count: 2
accepted answer: http://stackoverflow.com/a/26921101
downvote count: 2
upvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Add text to downloads link via jquery
has comment: http://stackoverflow.com/comment/42390614
duplicate of: http://stackoverflow.com/q/2805742
possible better answer: http://stackoverflow.com/a/26921129
type: AnsweredQuestion

http://stackoverflow.com/a/26919232
type: Answer
score: 3
downvote count: 0
has body: Those are two different synatxes. The first one calls a method of myNumber - a function (toString()) that is run on the object. The second one calls a function (Number) with myNumber as a parameter - that goes in the parentheses. To learn more about function and method calls, i recommend reading some tutorials. ;) Here's one by MDN. It's somewhat advanced, but pretty good.
upvote count: 3
answers question: http://stackoverflow.com/q/26919202

http://stackoverflow.com/comment/42253607
score: 0
has text: Yes obviously , you can detect the visitors IP and detect the location. Thier are many APIS for this, all are not 100% accurate. https://www.maxmind.com/en/home
comment on: http://stackoverflow.com/q/26845287
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42369425
type: QuestionComment
comment on: http://stackoverflow.com/q/26909862
has text: Could you please shorten your code to the relevant code lines?
score: 2
type: Comment

http://stackoverflow.com/comment/42421063
has text: This is brilliant, exactly what I needed! Thank you so much! It may not be working as well in the fiddle since I am using a plug in: list.js, but it is working locally perfectly!
comment on: http://stackoverflow.com/a/26938367
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/42437132
score: 0
has text: Thanks then i done it without pictures no one understand my problem :)
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26947568

http://stackoverflow.com/q/26840497
score: 3
upvote count: 3
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/41221722
has body: I am new to interactjs and I am trying to make the star drop on top of the tree (see jsfiddle) if it is snapped inside the dropzone. How would I do this? Javascript: interact('.draggable') .draggable({ onmove: function (event) { var target = event.target, x = (parseFloat(target.getAttribute('data-x')) || 0) + event.dx, y = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy; target.style.webkitTransform = target.style.transform = 'translate(' + x + 'px, ' + y + 'px)'; target.setAttribute('data-x', x); target.setAttribute('data-y', y); }, onend: function (event) { var textEl = event.target.querySelector('p'); textEl &amp;&amp; (textEl.textContent = 'moved a distance of ' + (Math.sqrt(event.dx * event.dx + event.dy * event.dy)|0) + 'px'); } }) .inertia(true) .restrict({ drag: "parent", endOnly: true, elementRect: { top: 0, left: 0, bottom: 1, right: 1 } }); // enable draggables to be dropped into this interact('.tree').dropzone({ // only accept elements matching this CSS selector accept: '#star', // Require a 75% element overlap for a drop to be possible overlap: 0.75, // listen for drop related events: ondropactivate: function (event) { // add active dropzone feedback event.target.classList.add('drop-active'); }, ondragenter: function (event) { var draggableElement = event.relatedTarget, dropzoneElement = event.target; // feedback the possibility of a drop dropzoneElement.classList.add('drop-target'); draggableElement.classList.add('can-drop'); $('.tree:not(.drop-target)').find('img').animate({ opacity: .5, height: "160px" }); }, ondragleave: function (event) { var draggableElement = event.relatedTarget, dropzoneElement = event.target; // remove the drop feedback style event.target.classList.remove('drop-target'); event.relatedTarget.classList.remove('can-drop'); $('.tree:not(.drop-target)').find('img').animate({ opacity: 1, height: "186px" }); }, ondrop: function (event) { //Dropped event }, ondropdeactivate: function (event) { // remove active dropzone feed…
has answer: http://stackoverflow.com/a/26845290
favorite count: 0
type: UnansweredQuestion
tagged with: css
has title: Snapping into a Dropzone with Interact.js

http://stackoverflow.com/comment/42332925
type: Comment
has text: Tried what before? Daniel's comment was that filter **is** a String - so you can't invoke it as if it were a function. What do you expect the `self.filter()` call to do? What are you trying to achieve with it?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/26888991

http://stackoverflow.com/comment/42340826
has text: Unfortunately, I am not able to post the code right now. I can, however, give you the website I'm working on atm. www.digitalcreation.nl/oamkb
type: QuestionComment
comment on: http://stackoverflow.com/q/26893524
score: 0
type: Comment

http://stackoverflow.com/q/26925187
score: 0
answer count: 2
has title: Convert C# DateTime to Javascript object
type: UnansweredQuestion
tagged with: datetime
has answer: http://stackoverflow.com/a/26925256
has body: I have a c# DateTime passed to the client as: 1980-01-20T00:00:00 How do i convert it to javascript DateTime? I tried doing var date = new Date(1980-01-20T00:00:00) but this gives me an error
has answer: http://stackoverflow.com/a/26925222
type: Question
tagged with: c#
tagged with: javascript

http://stackoverflow.com/comment/42679336
has text: Your code you've presented won't work with string literals that have `,` in them. ;)
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26935471

http://stackoverflow.com/comment/42376162
comment on: http://stackoverflow.com/q/26913266
has text: possible duplicate of [AngularJS ng-click stopPropagation](http://stackoverflow.com/questions/20300866/angularjs-ng-click-stoppropagation)
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/42434049
type: AnswerComment
has text: Thank you for answer. Unfortunately, this does not resolve the issue. The problem is not WHEN to submit. The problem is HOW to MODIFY input file.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26945784

http://stackoverflow.com/q/26868129
has comment: http://stackoverflow.com/comment/42295929
has comment: http://stackoverflow.com/comment/42295400
has comment: http://stackoverflow.com/comment/42295607
favorite count: 0
tagged with: angularjs
upvote count: 1
accepted answer: http://stackoverflow.com/a/26871342
has title: Angular setPristine doesnt work
type: AnsweredQuestion
score: 1
type: Question
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/26871342
has body: I want to do simple thing, to clean the $scope.user fields and not get the errors because of this. if ($scope.contactForm.$valid) { $scope.user = {}; $scope.contactForm.$setPristine(); } } But i still see the validations errors like required, and if i dont have any errors he show me all of them. here is plunker: http://plnkr.co/edit/skCdwwTuMVY1fVBNpuQd?p=preview
answer count: 1
has comment: http://stackoverflow.com/comment/42295534

http://stackoverflow.com/comment/42242853
type: AnswerComment
comment on: http://stackoverflow.com/a/26838726
score: 0
type: Comment
has text: I have tried a few methods. Here is my JSFiddle: http://jsfiddle.net/fqu3g45g/ The heights don't change when the address bar shows/hides. It remains constant which means it is not picking up the address bar/nav bar heights.

http://stackoverflow.com/a/28375984
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/26929174
has body: I'm late, but here goes. You should probably swap rows, and columns. That is make it like: var rows = []; column = [x,x,x,x,x,x,x,x]; rows.push(column); Instead of: var columns = []; var row = [x,x,x,x,x,x,x,x]; columns.push(row); This way a drop is just an array operation on columns. You can then do things like splice out a block, splice in a block, unshift, shift, and so on. Do the array operations before animations, but not before you get the column, and row information from the grid. You can even name the methods that do it by array methods. shift drops the bottom block, splice(start, stop, [optional]new block). Like that. @Markai did swap the columns, and rows in their answer, but I thought I'd add some clarity.
downvote count: 0

http://stackoverflow.com/a/26951210
has body: These extensions::[name] files are part of the extension platform's implementation, and bundled with Chrome. Extension developers don't need to know about their existence. You can view their source at https://chromium.googlesource.com/chromium/src/+/master/extensions/renderer/resources.
downvote count: 0
score: 3
upvote count: 3
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26950982
type: Answer
accepted answer of: http://stackoverflow.com/q/26950982

http://stackoverflow.com/a/26941099
type: Answer
score: 3
downvote count: 0
upvote count: 3
type: AcceptedAnswer
has body: You are misunderstanding where java and javascript run. You use &lt;% and %> as if that sends values to the server, which it does not. those tags are used only inside the jsp to start snippets of java code. This only works while you are generating the page. Once your html is at your browser, these tags will not do anything. Highlighting important keywords, this is not intended as sarcarsm When you request a jsp page with your browser, the browser opens a network connection to the server. Think of these 2 (browser, server) as living in 2 completely different places. The server then runs the java code. When it executes, it generates an html page. This html page is sent back across the network connection to the client (your browser) Your browser will receive this fully formed html page and use it to create it's view. On this page you can run javascript but the javascript will only run on the client (browser) To get any variable back to the server again, you will need to either: get or post a form (using a submit inside a form tage, or use JavaScript post request like a form submit) , do an ajax call (http://www.javascriptkit.com/dhtmltutors/ajaxgetpost.shtml) or have the user click a link (a href="...your page"). The easiest way is to do: &lt;form method="POST" action="your/page/url"&gt; &lt;input type="hidden" name="someName" value="someValue" /&gt; &lt;input type="submit" /&gt; &lt;/form&gt; read some of the links and make sure you keep in mind, your browser and the server are separated, so running javascript in your browser will not reach the server.
accepted answer of: http://stackoverflow.com/q/26940739
answers question: http://stackoverflow.com/q/26940739

http://stackoverflow.com/a/26979678
accepted answer of: http://stackoverflow.com/q/26979466
type: Answer
has comment: http://stackoverflow.com/comment/42494820
score: 0
type: AcceptedAnswer
has body: By using dot notation, you indicate to the interpreter that there is a property of car that you know is named "sts". It doesn't attempt to resolve it. If you were to have an object var car = { seats: "cloth", sts : "foo", engine: "V-6" }; Your dot notation code would work, but return the string "foo". Alternatively, by using the bracketed notation the interpreter expects a string, so any variable it receives will be resolved to a string. Now that you know that, consider this. How would you expect either of these calls to behave? car."sts" car["sts"] The first call errors out, and the second one returns "foo". Hopefully this illustrates the differences between these two methods of variable reference.
answers question: http://stackoverflow.com/q/26979466

http://stackoverflow.com/q/26908173
has comment: http://stackoverflow.com/comment/42366314
has comment: http://stackoverflow.com/comment/42366429
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42366438
type: Question
has comment: http://stackoverflow.com/comment/42366417
linked to: http://stackoverflow.com/q/26243785
tagged with: javascript
has answer: http://stackoverflow.com/a/26908279
has title: Javascript while loop explanations
duplicate of: http://stackoverflow.com/q/26243785
score: 0
has comment: http://stackoverflow.com/comment/42366392
tagged with: while-loop
has body: This is my first post here so pls be kind to my noob question. I have a simple while statement in javascript and i can't understand the result. The code: var a = 0; while (a &lt; 10) { console.log(a); a++; } The result is: 0 1 2 3 4 5 6 7 8 9 9 So my question is: why is the number 9 printed two times?
answer count: 1

http://stackoverflow.com/a/26985602
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/26984262
accepted answer of: http://stackoverflow.com/q/26984262
has body: I figured it out... browserify -i superagent --standalone iceberg source.js &gt; output.js then in the browser just reference the standalone parameter: &lt;script&gt; iceberg.lettuce.eat(); &lt;/script&gt; http://www.forbeslindesay.co.uk/post/46324645400/standalone-browserify-builds
type: AcceptedAnswer

http://stackoverflow.com/comment/42401600
type: QuestionComment
comment on: http://stackoverflow.com/q/26927726
has text: I think somewhere along the line a htmlentities() is performed over the resulting page... I am not familiar enough with twig to know where and how exactly...
score: 0
type: Comment

http://stackoverflow.com/a/26894332
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/42344200
has body: In the following code: toMove.children([imageNumber]).width() You are passing imageNumber to the children function. The children function accepts an optional selector, not an indexer. In your case this will probably return a jQuery object containing all the li and the call to width() will return the width of the first. Instead pass the indexer to what the children function returns and go from there (dividing for clarity): var children = toMove.children() var width = $(children[imageNumber]).width(); console.log(width); Or: var width = toMove.children().eq(imageNumber).width(); console.log(width);
has comment: http://stackoverflow.com/comment/42344110
accepted answer of: http://stackoverflow.com/q/26893772
upvote count: 2
answers question: http://stackoverflow.com/q/26893772

http://stackoverflow.com/a/26958996
answers question: http://stackoverflow.com/q/26958935
upvote count: 1
type: Answer
downvote count: 0
score: 1
has body: $('.country').click(function () { $('.' + $(this).attr('id')).toggleClass('hide'); // or $('.' + this.name).toggleClass('hide'); }); http://jsbin.com/sisawe/3/

http://stackoverflow.com/q/26941911
has comment: http://stackoverflow.com/comment/42428211
upvote count: 2
answer count: 2
tagged with: single-threaded
downvote count: 1
has comment: http://stackoverflow.com/comment/42428392
has comment: http://stackoverflow.com/comment/42428309
favorite count: 0
has comment: http://stackoverflow.com/comment/42427844
linked to: http://stackoverflow.com/q/5200821
has comment: http://stackoverflow.com/comment/42427739
has comment: http://stackoverflow.com/comment/42428416
has comment: http://stackoverflow.com/comment/42427755
has comment: http://stackoverflow.com/comment/42428438
has comment: http://stackoverflow.com/comment/42427709
has comment: http://stackoverflow.com/comment/42428200
has answer: http://stackoverflow.com/a/26942326
tagged with: node.js
has comment: http://stackoverflow.com/comment/42428327
has comment: http://stackoverflow.com/comment/42428386
type: UnansweredQuestion
score: 1
has answer: http://stackoverflow.com/a/26942417
has comment: http://stackoverflow.com/comment/42428471
type: Question
has comment: http://stackoverflow.com/comment/42427632
has comment: http://stackoverflow.com/comment/42428348
has comment: http://stackoverflow.com/comment/42427531
linked to: http://stackoverflow.com/q/19324442
has comment: http://stackoverflow.com/comment/42427641
has comment: http://stackoverflow.com/comment/42427691
has comment: http://stackoverflow.com/comment/42428485
has comment: http://stackoverflow.com/comment/42428376
has title: How does JavaScript's Single Threaded Model handle time consuming tasks?
tagged with: javascript
has body: This question is regarding the sinlge threaded model of JavaScript. I understand that javascript is non-block in nature cause of its ability to add a callbacks to the async event queue. But if the callback function does infact take a long time to complete, won't JavaScript then be blocking everything else during that time as it is single threaded? How does nodejs handle such a problem? And is this an unavoidable problem for developers on the front end? I'm asking this question cause I have read that its generally good practice to keep function tasks as small as possible. Is it really because long tasks in javascript will actually block other tasks?
linked to: http://stackoverflow.com/q/22644328
has comment: http://stackoverflow.com/comment/42427669
has comment: http://stackoverflow.com/comment/42427683

http://stackoverflow.com/comment/42396766
comment on: http://stackoverflow.com/q/26919737
type: QuestionComment
type: Comment
has text: I've added 5 logs, in order to track the placement of the link from the button creation to the moment it is received in the product.js: `Ti.API.log(positionInArray + " = the link received from array");` `Ti.API.log(productButtons[i].link + " = the link placed in view");` `Ti.API.log(e.source.link + " = the link of the source");` `Ti.API.log(productLocation.link + " = the link received in eventListener");` `Ti.API.log(receivedProduct + " = the link received in product.js");` Sometimes all logs are correct and sometimes all are undefined...
score: 0

http://stackoverflow.com/q/26989779
has comment: http://stackoverflow.com/comment/42525228
score: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28345129
tagged with: magento
has comment: http://stackoverflow.com/comment/42512846
has body: I am getting following error on the browser console when I am on checkout page. ReferenceError: payment is not defined When I click on the credit card payment option no Form is opened to enter card details and above mentioned error is thrown. For the Credit card authorize.net option in Magento admin is being used.I am also using the paypal express checkout I have following code in the template\checkout\onepage\payment\methods.phtml file <?php $methods = $this->getMethods(); $oneMethod = count($methods) <= 1; ?> <?php echo $this->getfieldshtml(1); ?> <?php foreach ($methods as $_method): $_code = $_method->getCode(); ?> <?php if(!$oneMethod): ?> <input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" title="<?php echo $this->htmlEscape($_method->getTitle()) ?>" onclick="payment.switchMethod('<?php echo $_code ?>')"<?php if($this->getSelectedMethodCode()==$_code): ?> checked="checked"<?php endif; ?> class="radio" /> <?php else: ?> <input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" checked="checked" class="radio" /> <?php $oneMethod = $_code; ?> <?php endif; ?> <label for="p_method_<?php echo $_code ?>"><?php echo $this->getMethodTitle($_method) ?> <?php echo $this->getMethodLabelAfterHtml($_method) ?> <?php if ($html = $this->getPaymentMethodFormHtml($_method)): ?> <?php echo $html; ?> <?php endif; ?> <?php endforeach; ?> <?php echo $this->getfieldshtml(2); ?> <?php echo $this->getfieldshtml(3); ?> <?php echo $this->getChildChildHtml('additional'); ?> I replaced the code with following because this is there in Magento default code file also But still no luck
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27956524
has comment: http://stackoverflow.com/comment/42511140
has title: ReferenceError: payment is not defined on checkout page
tagged with: javascript

http://stackoverflow.com/q/26841415
type: Question
type: AnsweredQuestion
has title: activate radio button and calculate textbox value
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26843451
has body: I've the below code. &lt;!doctype html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;Untitled Document&lt;/title&gt; &lt;link rel="stylesheet" href="style.css"/&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"/&gt; &lt;script type="text/javascript"&gt; function isNumberKey(as) { var dd = as.value; if (isNaN(dd)) { dd = dd.substring(0, (dd.length - 1)); as.value = dd; } } function activate(){ document.getElementById('rate').readOnly=false; } function deactivate(){ document.getElementById('rate').readOnly=true; var int = document.calc.loan.value; if(int &gt; 50000 &amp;&amp; int &lt; 100000){ document.calc.rate.value=10; } if(int &gt; 100000 &amp;&amp; int &lt; 150000){ document.calc.rate.value=12; } } function showpay() { var a = document.calc.loan.value; var b = document.calc.rate.value; var c = document.calc.months.value; var n = c ; var r = b / (12 * 100); var p = (a * r * Math.pow((1 + r), n)) / (Math.pow((1 + r), n) - 1); var prin = Math.round(p * 100) / 100; document.calc.pay.value = Math.round(prin); // document.calc.totInt.value = round((prin * c) - a); // document.calc.totpay.value = round((prin * c) - a); document.calc.totInt.value = Math.round((prin * c) - a); document.calc.totpay.value = Math.round(prin * c); } &lt;/script&gt; &lt;/head&gt; &lt;body class="body"&gt; &lt;header class="mainheader"&gt; &lt;img src="img/logo.gif" alt=""/&gt; &lt;nav&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="Index.html"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="about.html"&gt;About us&lt;/a&gt;&lt;/li&gt; &lt;li class="active"&gt;&lt;a href="calculators.html"&gt;Calculators&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="contactuS.html"&gt;Contact Us&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/nav&gt; &lt;/header&gt;&lt;br&gt; &lt;div class="maincontent"&gt; &lt;div class="content" style="width:100%"&gt; &lt;article class="topcontent"&gt; &lt;header&gt;&lt;h2 style="align:center" title="firstpost"&gt;&lt;p align="center"…
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/42247933
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26843451
possible better answer: http://stackoverflow.com/a/26842752
has answer: http://stackoverflow.com/a/26842752

http://stackoverflow.com/comment/42300295
has text: Thanks for the downvote, but please in the future let me know why you're downvoting the question, otherwise I can only make assumptions about how to fix my question.
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/26868882

http://stackoverflow.com/comment/42375019
score: 0
type: AnswerComment
has text: float:left is allowing to display 4 tables horizontally, i want to display 3 tables horizontally - @Obscure Geek.
type: Comment
comment on: http://stackoverflow.com/a/26912789

http://stackoverflow.com/comment/42383830
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/26917671
type: Comment
has text: That is very clever. And even requires only `"activeTab"` permission. Well done!

http://stackoverflow.com/a/40434346
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/26847168
has body: The document.createEvent('event') is being deprecated. The new method doesn't work because the DragEvent constructor is not meant for actual use. Check dataTransfer is null when creating drag event programmatically for a similar question .
answers question: http://stackoverflow.com/q/26847168
score: 2
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/26893228
answers question: http://stackoverflow.com/q/26890681
type: Answer
has body: Sorry, it is not possible to use JavaScript to determine whether the PDF has loaded. With Flash, you can determine whether a SWF loaded because Flash Player provides an API that include the PercentLoaded property. This enables developers to query the load status of the SWF. PDFs do not have a unified 'player', they are typically loaded either by the browser's default PDF rendering engine (usually proprietary), Adobe Reader, or an Adobe competitor like FoxIt Reader. These PDF rendering systems all have completely different capabilities. They have not standardized on any particular feature set or JavaScript API, therefore there is no standard way to check whether the PDF has loaded. PDFObject was designed to provide fallbacks in case the browser doesn't support PDF embedding. However it cannot verify whether a PDF URL is legitimate or not -- all PDFObject does is create an &lt;object&gt; in your markup, with a src pointing to your URL. It cannot verify whether the URL points to a PDF or any other file type. If you invoke PDFObject and the browser support PDF embedding, you will get an &lt;object&gt; whether your URL is legitimate or not.
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/42363626
downvote count: 0

http://stackoverflow.com/comment/42332903
comment on: http://stackoverflow.com/a/26889257
has text: Yeah annoying little typo, thanks for spotting mate.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/42270000
type: Comment
comment on: http://stackoverflow.com/a/26853608
score: 0
type: AnswerComment
has text: `JSON.stringify` was incorrect, you shouldn't have added that. So, if you're seeing the variables now, that means it should be working. Remove the `echo json_encode($_POST);`, and see if your code works.

http://stackoverflow.com/comment/42447346
type: AnswerComment
score: 0
type: Comment
has text: Yes you should, and if so, you do the redirect, otherwise, you display the page as normal.
comment on: http://stackoverflow.com/a/26919628

http://stackoverflow.com/a/26917082
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42384202
has body: null is an object in Javascript, but your initial value is actually undefined. This behavior of treating undefined as matching null is likely browser-specific. Try the simpler !LobbyMenuGames as either initial state (null or undefined) is falsey: var LobbyMenuGames; // Global Variable $(document).ready(function () { if (!LobbyMenuGames) LobbyMenuGames = $("#LobbyMenuGames"); } Or better yet ensure it is always a jQuery object using an empty jQuery object: var LobbyMenuGames = $(); // Global Variable is an empty jQuery collection $(document).ready(function () { LobbyMenuGames = $("#LobbyMenuGames"); } This second method is handy for avoiding falsey checks on jQuery objects.
type: Answer
has comment: http://stackoverflow.com/comment/42384249
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26916823
has comment: http://stackoverflow.com/comment/42383736
answers question: http://stackoverflow.com/q/26916823

http://stackoverflow.com/comment/42445817
comment on: http://stackoverflow.com/q/26949523
score: 0
has text: @AmeliaBR that seems to have done the trick. If you want to post it as an answer I'll mark it as correct. I started trying to create the layout myself, but the calculations I would have to do were a little painful.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26896082
score: 0
type: Answer
has body: i got the same issue, use height: 100vh; i hope works for you!
has comment: http://stackoverflow.com/comment/42346444
answers question: http://stackoverflow.com/q/26895615

http://stackoverflow.com/comment/42255099
type: Comment
has text: That's how I would also do that. Only the question with [appending new rows](http://stackoverflow.com/questions/26845803/how-to-add-rows-and-table-on-a-button-click-in-angularjs#comment42254967_26845803) still exists.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26846040

http://stackoverflow.com/q/26926016
downvote count: 0
type: UnansweredQuestion
score: 1
has body: my question is quite straight forward: I have a select containing multiple options, all I'd like to do is have the inner text of these (a.k.a. the displayed text in the dropdown) be completely uppercase. Currently I looks like this (compiled html): Ag Ar Ai Be ... And my Ruby on Rails Code (Rails 4 using Simple Form Gem) is: f.input :region, collection: Home::Region::REGIONS.map { |region| [ t(region, scope: 'regions'), region] }, label: 'Region' The 'Home::Regions::REGIONS' being mapped above is simple an Array filled with the regions (sam format as is in the value tag of the corresponding html option). It doesn't matter to me how it's made uppercase, css, jquery, ruby, anything that works is fine :) Thanks for the help in advance!
type: Question
has answer: http://stackoverflow.com/a/26926262
has answer: http://stackoverflow.com/a/26926314
answer count: 3
tagged with: ruby-on-rails-4
upvote count: 1
has comment: http://stackoverflow.com/comment/42398476
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/26926390
tagged with: http://stackoverflow.com/tag/html
tagged with: simple-form
has title: How do I make the inner text of a select option uppercase?

http://stackoverflow.com/comment/42462833
type: QuestionComment
comment on: http://stackoverflow.com/q/26962278
score: 0
has text: @Paul Draper: that's the difference between natural and programming languages. When in doubts - one must check specification, not expect and assume based on their feelings.
type: Comment

http://stackoverflow.com/q/26847826
has body: can anyone explain me why filter(String) also return number? var arr = [1, "a", '7'], numArr = arr.filter(Number), // return 1, 7 (It's Ok) strArr = arr.filter(String); // Why return 1, a, 7 alert("numArr = " + numArr + "\n" + "strArr = " + strArr); alert("typeof arr[0] = " + typeof arr[0]); In the example above, typeof arr[0] is number; but why it's not filtered instrArr? Thanks.
upvote count: 1
tagged with: javascript
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26848096
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/26847996
favorite count: 0
has comment: http://stackoverflow.com/comment/42258519
type: Question
possible better answer: http://stackoverflow.com/a/26848096
answer count: 2
has comment: http://stackoverflow.com/comment/42258548
has comment: http://stackoverflow.com/comment/42260222
has title: filter(String) also return number
accepted answer: http://stackoverflow.com/a/26847996

http://stackoverflow.com/a/26952590
has comment: http://stackoverflow.com/comment/42446467
answers question: http://stackoverflow.com/q/26952552
type: Answer
score: 2
upvote count: 2
type: AcceptedAnswer
has body: Needs to look like this .controller('MainCtrl', ['$scope', 'UsersService', function ($scope, UsersService) { You are injecting both $scope and your service. You need to mention both by name, and then inject them in the same order in the function. In your example, your $scope variable is actually your UsersService.
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26952552

http://stackoverflow.com/comment/42492032
has text: :)) you're funny... so it can be done but I am not able to do it. why?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26978731

http://stackoverflow.com/q/26930414
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26930581
score: 0
tagged with: php
answer count: 1
tagged with: laravel
type: UnansweredQuestion
has body: I already having image upload code which is working good, It has only one image upload option in it. Here image is sent to the function in which it will upload and return the image src code and image path, once returned it will be filled at the $('#image').html(data); It works good when i have single option, while i have two upload it fails, The error i faced is it works on the first &lt;input type="file" id="image" name="image" class="upload-img" style="opacity:0"&gt; and while i tried the second &lt;input type="file" id="imagetwo" name="imagetwo" class="upload-img" style="opacity:0"&gt; It replaces the image in the first input type, I have the $('#image').html(data); in first function and $('#imagetwo').html(data); in the second function I am using $("form#data").submit(function(){} Here is the HTML : &lt;input type="file" id="image" name="image" class="upload-img" style="opacity:0"&gt; &lt;input type="hidden" class="imagetextbox" name="imagetextbox"/&gt; Here is the Script : &lt;script&gt; $(document).ready(function() { $("form#data").submit(function(){ var formData = new FormData($(this)[0]); $.ajax({ url: 'globalimageupload', type: 'POST', data: formData, async: true, success: function (data) { $('#image').html(data); console.log(data); }, cache: false, contentType: false, processData: false }); return false; }); $("input[type='file']").on("change", function() { $("form#data").submit(); }); }); &lt;/script&gt; Here is the Image Handle Function : public function globalimageupload() { $file = Input::file('image'); if (Input::file('image')) { $valid_exts = array('jpeg', 'jpg', 'png', 'gif'); // valid extensions $max_size = 2000 * 1024; // max file size (200kb) $ext = $file-&gt;guessClientExtension(); $size = $file-&gt;getClientSize(); if (in_array($ext, $valid_exts) AND $size &lt; $max_size) { $image=Input::file('image'); $destinationPath = public_path()."/assets/uploads/companylogo/"; $num_unique = md5(uniqid() . time()); $fileName=$num_unique.'.'.$ext; Input::fi…
has title: Having Image upload two times using Jquery
tagged with: javascript
tagged with: jquery
type: Question

http://stackoverflow.com/q/26901873
tagged with: http://stackoverflow.com/tag/html
type: Question
tagged with: object
has body: I am trying to make a list where the user can select what information they want to view below. The user selects this from a check list. So if the user just checks obj1 they will see obj1 title 1 obj1 title 2 etc. I have tried a few things (see commented out code below) but in this codepen I just have it hard coded so on check it shows obj1 and obj2. How can I get it to show what the user checks and multiple items in concact, or is there a better way to approach this? Checkboxes Checkboxes {{ item.name }} {{ item.title }}
tagged with: arrays
tagged with: javascript
score: 0
has title: Concat multiple arrays with Angular
answer count: 1
has answer: http://stackoverflow.com/a/26902169
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/a/26943298
has body: You need to add those variables to a high level scope. You can make those vars as globals (I don't recommend that) or you can wrap your code in a self executable function that is a better practice. Take a look: (function(){ var selVal1 = '', selVal2 = ''; function getvalyear(ctrl1){ var sel = ctrl1.selectedIndex; selVal1 = ctrl1.options[sel].value; } function getvaltrimester(ctrl2){ var sel = ctrl2.selectedIndex; selVal2 = ctrl2.options[sel].value; } function getVal(){ console.log(selVal1); console.log(selVal2); } })(); Here is a codepen with the code updates. (Attaching events using jQuery)
answers question: http://stackoverflow.com/q/26943272
has comment: http://stackoverflow.com/comment/42429973
has comment: http://stackoverflow.com/comment/42430188
has comment: http://stackoverflow.com/comment/42429815
has comment: http://stackoverflow.com/comment/42430325
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/42429857
has comment: http://stackoverflow.com/comment/42429923
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/42430170

http://stackoverflow.com/comment/128359600
comment on: http://stackoverflow.com/q/26874586
has text: found a similar website but they don't seems be using PHP - https://sketchmypic.com
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26964434
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
favorite count: 0
has body: I am trying to make a page scale or mobile compatible I think is the term. The problem with my page right now is that it looks good at a certain size but when I drag the browser, the background picture of my page covers the "Services" Title the portion. Here is the jsFiddle: http://jsfiddle.net/eg18dfy0/4/ Not sure how useful this would be as local files are not included in here. Normal: Dragging: Here is my code: HTML snippet the matters: Welcome! BE GOOFY, TAKE A PICTURE! TELL ME MORE Services What we'll do for you CSS: .background_image { background-image: image-url("header-bg.jpg"); background-size: contain; background-repeat: no-repeat; width: 100%; height: 0; padding-top: 66.64%; position: absolute; /* (img-height / img-width * width) */ /* (853 / 1280 * 100) */ } /* Services */ #services { padding-top: 110px; margin-top: 75px; } .service-title { text-align: center; font-size: 55px; font-weight: 700; } .service-caption { text-align: center; font-size: 20px; }
has comment: http://stackoverflow.com/comment/42466884
upvote count: 2
has comment: http://stackoverflow.com/comment/42466949
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42466662
tagged with: css
has comment: http://stackoverflow.com/comment/42466799
score: 2
has title: Dragging browser causes background image to overlap next section
has comment: http://stackoverflow.com/comment/42466649
type: Question
has answer: http://stackoverflow.com/a/26964592

http://stackoverflow.com/comment/42484776
comment on: http://stackoverflow.com/a/26966831
has text: Let me know if you need help. I have code examples on github if you need for reference.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/26853711
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: if statement gets stuck at else
type: Question
has comment: http://stackoverflow.com/comment/42270009
score: 0
answer count: 2
has body: I'm trying to get a menu appear and disappear by clicking on the same word. I just started learning these languages. But I think I'm making some progress. After reading a lot on here and other sources online I figured out this: var main = function() { if($('.menu').css('top') == '-65px') { $('.icon-menu').click(function() { $('.menu').animate({top: '10px'}, 400); $('.content').animate({top: '10px'}, 400); }); } else { $('.icon-menu').click(function() { $('.menu').animate({top: '-65px'}, 400); $('.content').animate({top: '-65px'}, 400); }); } }; $(document).ready(main); So far I'm able to make the menu appear but not disappear. Who can help me?
has answer: http://stackoverflow.com/a/26853776
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26853761
type: UnansweredQuestion

http://stackoverflow.com/comment/42387474
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/26895044
score: 0
has text: Whoops, typo. Editing my post @Ross

http://stackoverflow.com/a/28604746
type: Answer
has body: just add "debug: function(){}" on options object at connect var c = new NNTP(); c.on('ready', function() { var msg = { from: { name: 'Node User', email: 'user@example.com' }, groups: 'alt.test', subject: 'Just testing, do not mind me', body: 'node.js rules!' }; c.post(msg, function(err) { if (err) throw err; }); }); c.on('error', function(err) { console.log('Error: ' + err); }); c.on('close', function(had_err) { console.log('Connection closed'); }); c.connect({ host: 'example.org', user: 'foo', password: 'bar', debug: function(){} });
score: 0
answers question: http://stackoverflow.com/q/26867483

http://stackoverflow.com/comment/42324301
comment on: http://stackoverflow.com/q/26864197
type: QuestionComment
type: Comment
has text: Perhaps (no idea if it'll help) you can try to buffer incoming data, until the buffer is say, 1mb or 4mb and then do `process.stdout.write`. Or, if the other executables in your chain are written in node, embed them in your main app and use node's pipes (`someReadableStream.pipe(someWritableStream)`, instead of using Windows pipes.
score: 0

http://stackoverflow.com/comment/42457060
has text: OP code is working [fiddle](http://jsfiddle.net/8twsdooe/1/). I think he means when he clicks the link doesn't keep the style..
comment on: http://stackoverflow.com/q/26959219
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26854274
answers question: http://stackoverflow.com/q/26853809
has body: You have two ways of doing this. One method is to add an id to the table and use document.getElementById(id).style.property=new style The other method is to use document.getElementsByTagName(tagName).style.property=new style method one document.getElementById("tableId").style.borderWidth = choice method two document.getElementsByTagName("table").style.borderWidth = choice
score: 0
type: Answer

http://stackoverflow.com/q/26961739
has title: Generate and sort Javascript Random Numbers
has body: I started to print 1000 random numbers between 1 to 100 and then sort all 1000 numbers. Here something wrong happen . How use Math.random() for it ? 100 random number between 1 and 100 Click me to start generating numbers. When the numbers appear, click OK to generate another set, or Cancel to stop.
score: 0
tagged with: javascript
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26961853
has comment: http://stackoverflow.com/comment/42461693
type: Question
accepted answer: http://stackoverflow.com/a/26961853
answer count: 1

http://stackoverflow.com/comment/42339931
score: 0
comment on: http://stackoverflow.com/q/26893025
type: Comment
type: QuestionComment
has text: Is `eatser.gif` the correct filename?

http://stackoverflow.com/comment/42325067
type: Comment
has text: Why do you need jquery here?
comment on: http://stackoverflow.com/a/26885031
type: AnswerComment
score: 0

http://stackoverflow.com/q/26965069
upvote count: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
possible better answer: http://stackoverflow.com/a/26965106
has comment: http://stackoverflow.com/comment/42467719
has answer: http://stackoverflow.com/a/26965106
duplicate of: http://stackoverflow.com/q/4450825
has body: I am loading data into &lt;div id="content_8"&gt; &lt;/div&gt; using the following function: ... var number = 8; //i.e. $.ajax ({ url: "load.inc.php", dataTypeString:"html", data: "var="+number, success: function(html) { $('#content_'+number).html(html); } }); This works well, but: the html contains different IDs and the loaded html looks like for example &lt;tr id="someid_8_1234"&gt;...&lt;/tr&gt; &lt;tr id="someid_8_7294"&gt;...&lt;/tr&gt; &lt;tr id="someid_8_9999"&gt;...&lt;/tr&gt; Since they are not yet registered in the DOM, I can't use this code $('[id^=someid_]').click(function(){ $(this).toggle(); }); I am getting crazy, all hints I found so far point me to delegate() or live() which I don't understand and they mostly point to single examples but not to hundreds of IDs, is there a way to attach the whole HTML-Block in the DOM? Thanks in advance!
type: AnsweredQuestion
downvote count: 0
score: 1
has title: JQuery - access elements loaded with .ajax
tagged with: dom
type: Question
linked to: http://stackoverflow.com/q/4450825
tagged with: javascript
has answer: http://stackoverflow.com/a/26965096
accepted answer: http://stackoverflow.com/a/26965096
answer count: 2

http://stackoverflow.com/q/26860189
type: Question
has body: So I currently am trying to get the following to simply return the variable obj. It is located in "auth.js" module.exports = { cas_login: function(ticket) { var obj; cas.validate(ticket, function(err, status, username) { if (err) { // Handle the error obj={status: false, username: null}; } else { // Log the user in obj={status: status, username: username}; } }); if(obj){ return obj; } } }; This is then being called (as a test) by "console.log(auth.cas_login(ticket));" I know that everything is properly linked as auth.cas_login will work when is simply have it return {hello : ticket}, however for some reason the cas.validate is causing issues. I am new to asynchronous language and assume it likely has something to do with that.
tagged with: javascript
has comment: http://stackoverflow.com/comment/42281114
has title: Node 'Undefined' Issue
accepted answer: http://stackoverflow.com/a/26860431
score: 0
has comment: http://stackoverflow.com/comment/42281078
answer count: 1
tagged with: undefined
tagged with: asynchronous
has answer: http://stackoverflow.com/a/26860431
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/q/26950238
has answer: http://stackoverflow.com/a/26950260
answer count: 2
downvote count: 2
has comment: http://stackoverflow.com/comment/42464575
tagged with: arrays
has answer: http://stackoverflow.com/a/26950366
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42447551
has title: Javascript array insertion
upvote count: 0
favorite count: 0
has body: I have an array in javascript which looks like this: var arr = [ { // first id : '45' name : 'dsada' }, { id : '45' name : 'dsada' }, /* ... */ ]; I want to add more data to the first index of it, e.g. country:'Egypt'. Which function should I use? Or how to push values to specific index in array? I have used push and splice methods but I can't figure it out.
type: Question
has comment: http://stackoverflow.com/comment/42457156
score: -2
tagged with: javascript

http://stackoverflow.com/comment/101610566
type: Comment
comment on: http://stackoverflow.com/a/43634169
has text: Is it possible to pass the value that is being added to the ```localStorage``` as you dispatch the event then get it from the listener?
score: 0
type: AnswerComment

http://stackoverflow.com/a/46009173
has comment: http://stackoverflow.com/comment/111099359
downvote count: 5
has comment: http://stackoverflow.com/comment/78981412
has body: I use Object.keys which is built into JavaScript Object, it will return an array of keys from given object MDN Reference const person = { name: "Jeeva", age: "22", gender: "Male" } console.log(Object.keys(person))
type: Answer
score: 93
answers question: http://stackoverflow.com/q/26901971
upvote count: 98
has comment: http://stackoverflow.com/comment/78980686

http://stackoverflow.com/a/26908056
has body: You're really close, getSeconds is a method, not a property so: var formattedDays = intervalStart.split(" ")[0].split("-"); var epoch = new Date(formattedDays[2], formattedDays[1] - 1, formattedDays[0]).getSeconds(); note the () after getSeconds. But seconds returns just the seconds part of the date, not seconds since epoch. For that you need ...getTime() / 1000 since getTime returns milliseconds since epoch. You can do it more simply using: var b = intervalStart.split(/\D+/); var epoch = new Date(b[2], --b[1], b[0], b[3], b[4], b[5]) / 1000; you can even do: var after = new Date(b[2], --b[1], b[0], b[3], b[4], b[5]) / 1000 &gt; 1415876254; // false or var after = new Date(b[2], --b[1], b[0], b[3], b[4], b[5]) &gt; (1415876254 * 1000); You're right to manually parse the string. Giving that format string to the Date constructor will not necessarily be consistently parsed by all browsers, and it will not be parsed at all by some.
accepted answer of: http://stackoverflow.com/q/26907454
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/26907454
score: 1
upvote count: 1

http://stackoverflow.com/comment/42681160
has text: Everything works fine i need to disable the entire div ,Hover effect and click ,,??
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26967961
type: AnswerComment

http://stackoverflow.com/comment/42276207
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26837626
type: AnswerComment
has text: Thanks for the note. The only relevant part in the RFC I linked to was in the abstract. It didn't mention specifically *where* there is a spec saying ISO-8891-1 characters were allowed in headers. I didn't mean to imply that RFC5987 was the standard itself. In any case, I ended up posting this problem on the GitHub issue tracker for Node.js: https://github.com/joyent/node/issues/8699#issuecomment-62342294 It was confirmed there that the problem was a limitation with V8 used in Node.js v0.10, and that it is fixed in v0.11 and beyond.

http://stackoverflow.com/q/26970309
has answer: http://stackoverflow.com/a/26970543
has comment: http://stackoverflow.com/comment/42476659
type: AnsweredQuestion
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/42477173
has title: force property as is always undefined
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26970367
accepted answer: http://stackoverflow.com/a/26970543
has body: I want a property that would always be undefined: var foo = {bar:undefined} If someone later try to change property bar then also it should results in undefined. foo.bar = 'someValue'// foo.bar//this time this should result in undefined. I mean how to set a property that is unchangeable.
has answer: http://stackoverflow.com/a/26970367
answer count: 2
downvote count: 0
score: 1
favorite count: 0

http://stackoverflow.com/a/26940881
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/26940782
has body: You can encapsulate that code in something like this: window.setInterval(function(){ // stuff I want to run every 5 seconds }, 5000); Then every 5000 milliseconds (i.e. 5 seconds), it'll fetch new JSON and replace the current address with the new address.
score: 2
has comment: http://stackoverflow.com/comment/42447800
has comment: http://stackoverflow.com/comment/42446950
downvote count: 0
has comment: http://stackoverflow.com/comment/42460282
has comment: http://stackoverflow.com/comment/42455757
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26940782
has comment: http://stackoverflow.com/comment/42427220

http://stackoverflow.com/a/26968836
upvote count: 1
has comment: http://stackoverflow.com/comment/42474422
has comment: http://stackoverflow.com/comment/42474141
has comment: http://stackoverflow.com/comment/42474411
downvote count: 0
answers question: http://stackoverflow.com/q/26968717
has body: You may code this where ever you needed, in this case on submit JavaScript: function selectNext(){ document.getElementById("mySelect").selectedIndex = document.getElementById("mySelect").selectedIndex + 1; } HTML: Next Pure javascript code.
score: 1
type: Answer

http://stackoverflow.com/q/26967851
has answer: http://stackoverflow.com/a/26968030
has title: Clearing a form inputs except some controls
has comment: http://stackoverflow.com/comment/42473164
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42472541
has answer: http://stackoverflow.com/a/26967990
has body: I have a panel named pBody and I can clear its controls by using these codes. clear all textboxes, uncheck radio buttons and checkboxes: $('#pBody input').val(''); clear only textboxes: $("#pBody").find("input[type=text]").val(''); or $("#pBody").find("input:text").val(''); But after clicking clear button I want make some radio buttons checked, for example first radio buttons in the group. Thanks in advance.
tagged with: javascript
type: Question
score: 0
answer count: 2
tagged with: jquery
has comment: http://stackoverflow.com/comment/42473545

http://stackoverflow.com/q/26930464
upvote count: 0
has comment: http://stackoverflow.com/comment/42406079
tagged with: arrays
has title: Create array with javascript from text string and manipulate the data to suit your needs
has answer: http://stackoverflow.com/a/26932042
tagged with: javascript
has comment: http://stackoverflow.com/comment/42407115
type: AnsweredQuestion
has body: I have text string patern (_code: value, _code: value, _code: value, _code: value, ) It can be like this _cvgx12: volvo, _ccc325: hello my name is andrius, _asc789: sport, _code: This is example of text string, I need create array from this string. In array i want only include value. myarray=["value","value","value","value","value",] value can be anything example myarray=["volvo","hello my name is andrius","sport","value","Sackoverflow",] Im trying approach like this Split ext to array myarray= mytext.split(' '); // I dot think this value is right Also im removing code part like this: filtered = myarray.filter(function(el, index) { return index % 2 === 1; }); Im geting array but i cant use spaces between words
favorite count: 0
has answer: http://stackoverflow.com/a/26931064
score: -1
type: Question
accepted answer: http://stackoverflow.com/a/26932042
has answer: http://stackoverflow.com/a/26931190
has comment: http://stackoverflow.com/comment/42406662
possible better answer: http://stackoverflow.com/a/26931064
downvote count: 1
answer count: 3

http://stackoverflow.com/a/27274753
score: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26933772
downvote count: 0
has body: Check your server network activity using Wireshark https://www.wireshark.org I've had the problem where the server was trying to connect to the client using netbios and ICMP to resolve the clients details and that was timing out. Disable the Netbios over TCP on the server and check then to see if it's a networking issue and not actually a programming issue. Go to control panel and select Network Connections. Right-click the local area connection that you want to be statically configured, and then click Properties. Click Internet Protocol (TCP/IP), click Properties, click Advanced, and then click the WINS tab. Click Disable NetBIOS over TCP/IP.
answers question: http://stackoverflow.com/q/26933772
type: Answer
upvote count: 1

http://stackoverflow.com/comment/42459481
has text: Please do not use `for... in` loops to iterate arrays.
type: Comment
comment on: http://stackoverflow.com/a/26949447
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42427002
comment on: http://stackoverflow.com/a/26919628
has text: It is the same page but you haven't given me enough to go on. My JS skills are pretty limited to say the least.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/26954796
has answer: http://stackoverflow.com/a/26954845
downvote count: 3
has comment: http://stackoverflow.com/comment/42449392
type: Question
has comment: http://stackoverflow.com/comment/42449411
tagged with: javascript
score: -3
has body: i have created a Content management system. Admin got a new task to fulfill in admin panel. admin panel has 10+ buttons in main menu. Default color of menu is black and hover effect is light grey i want that whenever admin got a new task, button color should change to red or something else and hover effect should be same. how can i do this ?
upvote count: 0
answer count: 1
tagged with: jquery
has title: how to change menu button color when admin got a new task in admin panel
favorite count: 0
type: UnansweredQuestion
tagged with: php
tagged with: css

http://stackoverflow.com/comment/42468718
has text: One problem. The phone number and so on is coming up undefined. Funny thing I was looking at a post about that. Found this: http://stackoverflow.com/questions/9520808/google-places-api-places-detail-request-undefined . Trying to implement the code.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26965656
type: AnswerComment

http://stackoverflow.com/comment/42421612
has text: This is a [webkit bug](https://bugs.webkit.org/show_bug.cgi?id=83438). Assign an ID or class to select by instead.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26938614
score: 2

http://stackoverflow.com/q/26970947
tagged with: load
has answer: http://stackoverflow.com/a/26971561
favorite count: 0
has title: Load jquery and google map
has comment: http://stackoverflow.com/comment/42478183
upvote count: 2
type: UnansweredQuestion
tagged with: php
has answer: http://stackoverflow.com/a/26972258
score: 2
has body: Hello im using load jquery to refresh my page each second the problem came when i added a google map in this page the map is appear and disappear in each second is there anyway to correct this issue $(document).ready(function(){ &lt;?php if(isset($_GET['id'])){ $id = '&amp;id='.$_GET['id']; } if(isset($_GET['id']) &amp;&amp; isset($_GET['c']) || isset($_GET['c'])){ $id = '&amp;id='.$_GET['id'].'&amp;c='.$_GET['c']; }*/ ?&gt; $("#pub").load("./ajax.php?act=pharmacie&lt;?php echo $id; ?&gt;"); setInterval(function(){ $("#pub").load("./ajax.php?act=pharmacie&lt;?php echo $id; ?&gt;"); },1000); }); this the div which i load my script &lt;div id="pub"&gt;&lt;/div&gt; and the last one is my main script "ajax.php" contains the code of google map &lt;div id="pharma-title"&gt; &lt;table width="100%" id="tableNom"&gt; &lt;td width="40%" id="hero"&gt; &lt;iframe src="https://www.google.com/maps/embed?" width="400" height="300" frameborder="0" style="border:0"&gt;
type: Question
answer count: 2
tagged with: google-maps
tagged with: javascript
tagged with: jquery
downvote count: 0

http://stackoverflow.com/comment/42494057
comment on: http://stackoverflow.com/q/26976396
type: QuestionComment
has text: what i would do is create an additional svg element to contain the g, and use css to set its position to fixed. obviously you could track the user's scroll position and use js to change the positions of the svg elements themselves but that seems overly complicated
type: Comment
score: 0

http://stackoverflow.com/q/26990663
tagged with: javascript
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/27062267
tagged with: http://stackoverflow.com/tag/csv
has body: I need to generate a csv and then propose to download it. It works on all browser except IE var csvContent = "data:text/csv;charset=utf-8,"; dataString = "name1,firstname1,addr1"; csvContent += dataString; var encodedUri = 'data:application/csv;charset=utf-8,' +encodeURI(dataString); window.open(encodedUri);
has answer: http://stackoverflow.com/a/27062267
type: AnsweredQuestion
has title: Export a csv in js compatible IE
type: Question
tagged with: export-to-csv

http://stackoverflow.com/q/26906064
has title: jQuery preventDefault doesn't always work
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/42377631
has comment: http://stackoverflow.com/comment/42377921
has body: I have a function called showBasket, which shows you a list of items added to a shoppingBasket. This happens everytime the user clicks a link; and everytime you click outside the menu, this hides itself again. My problem is that in this menu, I have a list of links related to each item which allows you to delete the selected item. This link works fine sometime and also works diferently depending what web browser I use. What I want is to delete the item without refreshing all the web page, so I think I have to do a preventDefault to the link, but also when I debug my code, I see that its repeated many times, so something is wrong, specially when I see that I don't get the result I want sometimes. As you can see, I use two ajax functions, one to delete the item which I think it works fine, and the other function is used to refresh the datas. If anybody could help me would be fantastic. I am stuck with this. /* SHOWS AND HIDE A BASKET MENU, EVERYTIME YOU CLICK IN THE SELECTED LINK THIS MENU SHOWS A LIST OF ARTICLES ADDED TO A SHOPPING BASKET, AND EACH ITEM OF THE LIST HAS A LINK THAT ALLOWS YOU TO DELETE THE SELECTED ITEM. */ function showBasket(){ var $basket=$('#basket'); var nstyle=$basket.css("display"); $basket.on('click','a[title="delete article"]',function(e){ e.preventDefault(); del($(this)); updateBasket($(this)); function del(m){ var n=m.attr("href"); n=n.split("="); var l=n[1]; $.ajax({ type:"GET", data:{productoRemoveId:l}, }); return false; } function updateBasket(m){ $.ajax({ url:'updateBasket.php', success: function(response){ $cesta.html(response); } }); return false; } return false; }); if (nstyle=='none'){ $basket.fadeIn(false,function(){//showing the basket $('html').bind("click",function(){ $basket.fadeOut();//hidding the basket $("html").unbind("click"); }); }); } } This is the HTML code, relative to the above script: Mi cesta 3 articulos añadidos) lechuga 9.25 Eliminar Articulo Lejia 8.23 Eliminar Articulo limones 8.25 Eliminar Articulo Subtotal: …
linked to: http://stackoverflow.com/q/1000597
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/42363281
downvote count: 0
has comment: http://stackoverflow.com/comment/42376922
has comment: http://stackoverflow.com/comment/42378274
accepted answer: http://stackoverflow.com/a/26906701
tagged with: preventdefault
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/42362871
has comment: http://stackoverflow.com/comment/42377395
tagged with: javascript
has answer: http://stackoverflow.com/a/26906701
tagged with: jquery
has comment: http://stackoverflow.com/comment/42378037
has comment: http://stackoverflow.com/comment/42363354
has comment: http://stackoverflow.com/comment/42376982
tagged with: ajax

http://stackoverflow.com/a/26984575
type: Answer
has comment: http://stackoverflow.com/comment/42503135
has comment: http://stackoverflow.com/comment/42502961
score: 0
has body: Just an idea, and I'm not sure exactly what you are trying to do, but I would try calling the function on a set delay, like this: Right-Click Me, then wait for 3 seconds. The only downside is that once the alert() is called, the context menu is hidden. Hope this helps!
answers question: http://stackoverflow.com/q/26984344

eclipse
tag name: eclipse
tags question: http://stackoverflow.com/q/26945246
tags question: http://stackoverflow.com/q/26846930
tags question: http://stackoverflow.com/q/26942137
tags question: http://stackoverflow.com/q/26911263
tags question: http://stackoverflow.com/q/26934114
tags question: http://stackoverflow.com/q/26949529
type: Tag

http://stackoverflow.com/q/26917716
answer count: 1
has body: I am getting following json from php {"status":{"message":"success","undeleted":[],"code":200}} {"status":{"message":"success","undeleted":[{"id":7844118,"error":"This Document already Published"}],"code":200}} I just want to check 'undeleted' is empty or not in jquery.If not empty,I need to take every ids and its error message from 'undeleted'.I am not getting an idea how to do this .I will get only one at a time. Thinking about something like this var result = jQuery.parseJSON(data); $.each(result.data, function(index, value) { }); I have done something like this but not getting desired answer var result = jQuery.parseJSON(data); $.each(result.status, function(index, value) { alert(value); });
has answer: http://stackoverflow.com/a/26918299
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/26918299
tagged with: javascript
tagged with: jquery
has title: parse value from a php jsonstring in jquery
score: 0

http://stackoverflow.com/comment/42402034
has text: Glad to hear the code works for you, please consider [accepting the answer](http://meta.stackexchange.com/q/5234/179419) by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself. There is no obligation to do this.
comment on: http://stackoverflow.com/a/26927640
score: 0
type: AnswerComment
type: Comment

communication
tag name: communication
tags question: http://stackoverflow.com/q/26966501
type: Tag

http://stackoverflow.com/comment/42272441
type: QuestionComment
has text: Ah..... Yes there are. Let me monkey with it for a bit.
comment on: http://stackoverflow.com/q/26854803
score: 0
type: Comment

animation
tags question: http://stackoverflow.com/q/26985152
tags question: http://stackoverflow.com/q/26932833
type: Tag
tags question: http://stackoverflow.com/q/26854202
tags question: http://stackoverflow.com/q/26930663
tags question: http://stackoverflow.com/q/26939524
tags question: http://stackoverflow.com/q/26879347
tag name: animation
tags question: http://stackoverflow.com/q/26840885
tags question: http://stackoverflow.com/q/26918228
tags question: http://stackoverflow.com/q/26833596
tags question: http://stackoverflow.com/q/26858914
tags question: http://stackoverflow.com/q/26952442
tags question: http://stackoverflow.com/q/26881428
tags question: http://stackoverflow.com/q/26845305
tags question: http://stackoverflow.com/q/26922374
tags question: http://stackoverflow.com/q/26936638
tags question: http://stackoverflow.com/q/26961532

http://stackoverflow.com/q/26947840
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/26948227
has body: Thanks for looking at my problem. What I need is a calendar, in which you can insert a certain value (like a birthday, vacation, dentist appointment etc.) to a certain date. I made this simple table changed the appearance of the weekend. I thought I'd use an array system to add the values but I don't know how to get every single date bound to a separate array. It also needs a search function with which you can search a date, and it will focus on it, and I don't even know how to get that started. On start up it has to focus on the current date, and it needs multiple months, but I think I can get that done. My biggest problem is a working array system (or another method ) and a search function. And again, thanks a lot for looking into my problem. January 2014 Ma Di Wo Do Vr Za Zo 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42437527
type: Question
has title: insert values in calendar and date-search function
tagged with: javascript

http://stackoverflow.com/q/26877604
has answer: http://stackoverflow.com/a/26877767
possible better answer: http://stackoverflow.com/a/26879620
has answer: http://stackoverflow.com/a/26879620
tagged with: javascript
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26877767
has body: I am trying to "scarpe" a web to get a javascript array in it. var paradas = [["name1", 12,....], ["namen", 24,..]]; Here it is the source code's page http://pastebin.com/SZhtL404. The same regExp work in another languages, like PHP or even awk, but I can't get it to work in javascript. html = html.replace(/\n/g,''); //I delete the \n -&gt; it works var re = /(var\s*paradas\s*=\s*)(\[(.*?)\];)/g; var result = re.exec(html); -&gt; it returns null. What is it wrong with that reg expression?
type: Question
answer count: 2
tagged with: regex
has title: RegExp in Javascript- (.*) doesn't behave as expected
score: 0

http://stackoverflow.com/comment/42496485
has text: Save this.params._id as a Session variable
score: 0
comment on: http://stackoverflow.com/q/26981172
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26884972
upvote count: 4
answers question: http://stackoverflow.com/q/26882176
downvote count: 0
score: 4
has body: As you can see here, fullCalendar only allow change some properties after initialization. You don't need to reload the page, but destroy and init is required. So: var calendarOptions = { defaultView: 'month', editable: true, slotDuration: '00:45:00', (...) } $('#calendar').fullCalendar(calendarOptions); //Init //And when you need to update any property calendarOptions.slotDuration = '00:15:00'; $('#calendar').fullCalendar('destroy'); $('#calendar').fullCalendar(calendarOptions);
type: Answer

http://stackoverflow.com/q/26963347
has answer: http://stackoverflow.com/a/26963739
type: AnsweredQuestion
upvote count: 1
type: Question
tagged with: angularjs-directive
accepted answer: http://stackoverflow.com/a/26963739
tagged with: javascript
has title: Angular Directive with ngScope using controllerAs
tagged with: angularjs-scope
has body: I'm trying to make a simple directive that is a combo of an editor and selector for objects. In the trimmed down example a user should be able to edit a person within the directive, and ultimately select a person, which is bound to ng-model so they have a reference to person they selected. My issue is I'm not sure the best way to get the ng-model passed in bound to the selected person on my controller. I have created a plunker for this here : http://plnkr.co/edit/usWpu82VXHIE3R2vgHgv?p=preview Here is what my directive looks like angular .module('pe') .directive('personEditor', PersonEditorDirective); function PersonEditorDirective() { var directive = { restrict: 'E', templateUrl: 'personEditor.html', controller: PersonEditorCtrl, controllerAs: 'vm', scope: { ngModel: '=' } }; PersonEditorCtrl.$inject = ['$scope', 'dataservice']; return directive; function PersonEditorCtrl($scope, dataservice) { var vm = this; $scope.vm = vm; vm.people = dataservice.getPeople(); //set selected to the first vm.person = vm.people[0]; } } In my directive controller, vm.people is an array of all the people. vm.person is the currently selected person, which i would like to be bound to whatever the consumer passes as ng-model. Using the directive would be something like this The currently selected person is {{vm.selectedPerson.name}} Within my controller I know that $scope.ngModel is the object that they have passed in, and I can change that or whatever, but what is the best/easiest way to get that bound to my controller's vm.person? The only way i've got this working how I want is to watch for when the select element changes it's selection, and then manual set $scope.ngModel = vm.person, which feels like the wrong way to do it. Can I get some methods for achieving what I want?
answer count: 1
downvote count: 0
score: 1
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/q/26922131
has answer: http://stackoverflow.com/a/26922168
has body: I need to sort an array of values. var arr = [0.3, 0.76, 0.98, 1.12, 1.36, 1.9]; by which value is closest to 1, which would (in the above example) result in: [0.98, 1.12, 0.76, 1.36, 0.3, 1.9]; I know that by using a custom sort function. arr.sort(function(a, b){ return b - a; }); i can take control of how sort() works, however, i do not understand how i would design that custom function so that it would work in the desired way. Perhaps someone can enlighten me.
answer count: 3
has title: Sorting an array by which value is closest to 1
tagged with: arrays
downvote count: 0
tagged with: javascript
tagged with: sorting
favorite count: 0
accepted answer: http://stackoverflow.com/a/26922168
score: 7
has answer: http://stackoverflow.com/a/26923032
has answer: http://stackoverflow.com/a/56219677
possible better answer: http://stackoverflow.com/a/26923032
upvote count: 7
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/42277853
score: 0
comment on: http://stackoverflow.com/q/26857647
has text: I guess you people are not clear with the question.. In simple words I need to show a dropdown of list of fonts based on the browser support dynamically.. Help me find out how to do that??
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42270781
type: QuestionComment
type: Comment
has text: If you think a “double the value” functionality is useful, consider using a simple text input field with JavaScript-driven buttons for doubling the value and JavaScript checks for the value being one of the accepted values (in case the user just types in something).
comment on: http://stackoverflow.com/q/26852827
score: 0

http://stackoverflow.com/a/26990138
has body: You need to add jquery script link to your tag.
downvote count: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26990079
score: 1
answers question: http://stackoverflow.com/q/26990079
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/42512232

http://stackoverflow.com/comment/42299487
type: QuestionComment
score: 0
has text: I'm afraid `resize` its a `window` event.
type: Comment
comment on: http://stackoverflow.com/q/26870366

http://stackoverflow.com/comment/42274785
score: 0
type: Comment
type: QuestionComment
has text: Try adding `__RequestVerificationToken: $('input[name="__RequestVerificationToken"]').val(),` to the `data:` parameter (assuming you have included `@Html.AntiForgeryToken()` in your form)
comment on: http://stackoverflow.com/q/26856279

http://stackoverflow.com/comment/42382512
comment on: http://stackoverflow.com/a/26916616
score: 0
type: AnswerComment
type: Comment
has text: Your solution obviously works, and the only real difference between yours and mine is that I'm targeting the specific class to remove whereas your call to `.removeClass` with no classname specified removes all classes from the element, which may be detrimental in other ways. Overall, I am questioning the need for targeting classes when you could just grab the element using the `.index`, or the `.eq` methods. Also, which `li` do you need to process (the one being moved)? When does it need to be done?

http://stackoverflow.com/q/26876703
has comment: http://stackoverflow.com/comment/42311224
has title: Darts game - checking problems in AngularJS
type: Question
has comment: http://stackoverflow.com/comment/42320447
has body: There is the content of my AngularJS (JavaScript ) file: // define new Angular module var myApp = angular.module('myApp',[]); myApp.controller('MyAppController',function($scope){ $scope.player = ''; $scope.players = []; $scope.totalPoints = []; $scope.flag = 1; $scope.myNumberRegex = /[0-9]/; $scope.last = {}; $scope.score = {}; $scope.winner = 0; $scope.nextPlayer = ''; $scope.nextRound = false; var actualPlayer = 0; var pointsValue,round = 0; var internalRoundCounter = 1; var shootsString = ''; $scope.$watch('roundCount',function(value){ console.log('new value',value); }); $scope.add = function(){ $scope.players.push({name: $scope.player, totalPoints: 0, fields:[]}); $scope.player = ''; }; $scope.checkForm = function() { var valid = true; if ($scope.players.length == 0) { alert('There is no player added!'); valid = false; } if ($scope.roundCount &lt; 3 || $scope.roundCount &gt; 10) { alert('Incorrect round count!'); valid = false; } if ($scope.players.length == 1) { console.log('Tömb hossza: ', $scope.players.length); alert('One player is not enough!'); valid = false; } if (valid) { $scope.flag = 2; var startingPlayer = $scope.players[actualPlayer].name; $scope.nextPlayer = startingPlayer; } }; function showResults(){ $scope.flag = 3; } // watching changed value $scope.$watch('last.id',function(newValue){ console.log('last.id changed',newValue); pointsValue = 0; //----------------------------------------------------------- // checking target to calculate earned points //----------------------------------------------------------- if (newValue == "Bull") { pointsValue += 50; console.log(pointsValue); } else if (newValue == "Outer") { pointsValue += 25; console.log(pointsValue); } else if (['s','d','t'].indexOf(newValue[0]) != -1) { var multiplier = 1; if (newValue[0] == 'd') multiplier = 2; else if (newValue[0] == 't') multiplier = 3; var tmp = newValue.split("").splice(1,2).join(""); pointsValue += (tmp * multiplier); } //-------------------------------------------…
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/42311404
favorite count: 0
has comment: http://stackoverflow.com/comment/42311007
has comment: http://stackoverflow.com/comment/42328362
tagged with: http://stackoverflow.com/tag/svg
tagged with: angularjs
has comment: http://stackoverflow.com/comment/42311286
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42324782
upvote count: 1
has comment: http://stackoverflow.com/comment/42310945
has comment: http://stackoverflow.com/comment/42311139
score: 1

http://stackoverflow.com/a/26835199
has body: I believe this should work as you intended: var person = new Array(); for (var i = 0; i &lt; 5000; ++i) { person[i] = {firstName:"First"+i, lastName:"Last"+i, middleName:"Middle"+i}; } alert(person[1]["firstName"]); alert(person[6]["lastName"]); As pointed out by others, the person array is filled with objects, not arrays. You can use either property or associative array syntax with them.
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/26835173
type: Answer

http://stackoverflow.com/q/26850269
possible better answer: http://stackoverflow.com/a/26850528
has answer: http://stackoverflow.com/a/26850528
has comment: http://stackoverflow.com/comment/42262985
has comment: http://stackoverflow.com/comment/42263257
has comment: http://stackoverflow.com/comment/42263094
favorite count: 0
upvote count: 2
has title: How to get first value of row in table on click?
has answer: http://stackoverflow.com/a/26850467
has answer: http://stackoverflow.com/a/26850575
answer count: 4
type: AnsweredQuestion
score: 2
accepted answer: http://stackoverflow.com/a/26850467
has comment: http://stackoverflow.com/comment/42263235
type: Question
has body: I have one table with first numeric column: 3 row12 row13 12 row22 row23 15 row32 row33 22 row42 row43 23 row52 row53 55 row62 row63 How can I get first value/column of row on clicking row. I found following example doing the same. http://www.vbforums.com/showthread.php?522104-HTML-table-on-click-event But I don't want to add event to each row manually as my table is having billions of records. Please help me. How can I get the row value (first column) on clicking row?
has answer: http://stackoverflow.com/a/26850536
tagged with: html-table
linked to: http://stackoverflow.com/q/1687296
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/42268255
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26842356
score: 0
has text: This is working for me in Chrome dev tools emulation: http://stackoverflow.com/a/18729108/3632159

http://stackoverflow.com/comment/42296586
type: Comment
score: 3
comment on: http://stackoverflow.com/a/26868746
type: AnswerComment
has text: a simple `return false` does both `preventDefault` *and* `stopPropagation.`

http://stackoverflow.com/a/26970898
upvote count: 3
answers question: http://stackoverflow.com/q/26970562
has body: This line in the script: header = document.querySelector('.cbp-af-header') @ MDN for document.querySelector() it says that, the first element in the document with the class is returned. So may be you are looking for .querySelectorAll("selector/s"): document.querySelectorAll(".cbp-af-header"); @ MDN for document.querySelectorAll() returns a list of all elements (div in case) supplied within the document.
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/54815116
type: Answer

http://stackoverflow.com/comment/42501472
has text: @David Thomas, when I used JS Hint, it said "Confusing use of '!'." And also, your condescending tone came across clearly. Thanks!
score: 0
comment on: http://stackoverflow.com/q/26983318
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26930062
has body: to use Ext.getStore() you have to register the store I think. plz read
type: Answer
score: 0
answers question: http://stackoverflow.com/q/26923850
has comment: http://stackoverflow.com/comment/42467949

http://stackoverflow.com/comment/42426275
comment on: http://stackoverflow.com/q/26941009
score: 0
has text: @Mathletics, "`ninja.yell` can be updated independently without affecting `samurai.yell`" [nope, you're wrong about that one](http://jsfiddle.net/tnbs0z11/).
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42462587
type: Comment
comment on: http://stackoverflow.com/a/26960935
has text: @Karl-JohanSjögren - SO? he can feed it into a headless browser, like phantomJS) and get back the result. that is the easy part. he only didn't know how to actually get the HTML. a quick google shows a lot of good results, such as this - http://nrabinowitz.github.io/pjscrape/
type: AnswerComment
score: 0

http://stackoverflow.com/q/26960809
type: Question
score: 0
answer count: 1
tagged with: java
tagged with: servlets
has body: I am developing some web application, with java scripts and servlets. On the web application, a thread works at the background and a page should be refreshed automatically until the threads returns some results. I would like to know how to stop the auto refresh after receiving some results. Please see my codes. if (result == null) { \\ while result equals null, the auto refresh should work } else { \\ after receiving some result, the auto refresh should be stopped }
has answer: http://stackoverflow.com/a/26960871
has title: How to stop the auto refresh function with java scripts after receiving some results from a thread
tagged with: javascript
type: UnansweredQuestion
tagged with: ajax

http://stackoverflow.com/comment/42352033
score: 0
comment on: http://stackoverflow.com/q/26899339
has text: I like the idea @PHPglue. But would it possible to bind an event in the opened window so that when click send message in that, the message should be sent to the iframe.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26925191
upvote count: 16
has comment: http://stackoverflow.com/comment/51193563
accepted answer of: http://stackoverflow.com/q/26925096
answers question: http://stackoverflow.com/q/26925096
has comment: http://stackoverflow.com/comment/51210048
type: Answer
has comment: http://stackoverflow.com/comment/55915323
downvote count: 0
score: 16
has body: Use the new Template.autorun function, which automatically cleans itself up after the template is destroyed. To use it inside of a rendered callback, just replace Tracker.autorun with this.autorun.
has comment: http://stackoverflow.com/comment/55896105
has comment: http://stackoverflow.com/comment/42397048
type: AcceptedAnswer

http://stackoverflow.com/q/26847587
upvote count: 1
type: Question
score: 1
tagged with: sqlite
answer count: 1
has body: I have an Apache Cordova application that caches data that cannot be sent to a server when no communications are available, such as no 3G coverage etc. I have some code that runs when the device comes back online. The idea of this code is to recursively ripple through that cached data and send it to the server in the background. Once sent, each row should then be deleted to prevent it from being sent again. A cut-down and anonymised version of the code follows... var app = { name: 'myApp', displayName: 'my application', db: null, initialize: function () { document.addEventListener("deviceready", app.onDeviceReady, false); document.addEventListener("online", app.onDeviceOnline, false); }, onDeviceOnline: function () { app.db.transaction( function (tx) { app.uploadCachedData(tx); }, function (error) { console.error("'" + error.message + "' creating database transaction."); }, function () { } ); }, onDeviceReady: function () { app.db = window.openDatabase(app.name, "2.2", app.displayName, 1 * 1024 * 1024); }, uploadCachedData: function (tx) { tx.executeSql('select * from [data]', [], function (tx, results) { console.log("uploadCachedData, rows.length=" + results.rows.length); if (results.rows.length &gt; 0) { var item = results.rows.item(0); var cachedDataId = item.id; console.log("Uploading cached data, id=" + cachedDataId) app.ws.uploadImage(item.f1, item.f2, item.f3, item.f4, item.f5, function (data) { console.log("'Data' (id=" + cachedDataId + ") uploaded from cache."); tx.executeSql('delete from [data] where [id] = ?', [cachedDataId], function (tx, resultSet) { console.log("'[data] where [id]=" + cachedDataId + "' deleted."); app.uploadCachedData(tx); }, function (error) { console.log("'" + error.message + "' deleting [data] where [id]=" + cachedDataId + "'."); }); }, function (response, textStatus, errorThrown) { console.log("'" + error.message + "' uploading Data (id=" + cachedDataId + ") from cache."); }); } }, function (error) { console.error("'" + error.messa…
downvote count: 0
has comment: http://stackoverflow.com/comment/42285775
has answer: http://stackoverflow.com/a/26865435
tagged with: javascript
favorite count: 0
has title: Apache Cordova, SQLite, Delete from [table] where id=? does not return
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42260620
has comment: http://stackoverflow.com/comment/42262689
tagged with: cordova
has comment: http://stackoverflow.com/comment/42260906

http://stackoverflow.com/comment/42310448
has text: The behavior would be exhibited regardless of how the `video` element is created.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26876296

http://stackoverflow.com/comment/42350232
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26898431
has text: It is not only the Javascript that uses the JSON. I wonder how can people create this kind of errors when every platform has functions to encode and decode JSON...
score: 1

http://stackoverflow.com/comment/42462655
type: QuestionComment
has text: Using apache cordova.
score: 1
comment on: http://stackoverflow.com/q/26962205
type: Comment

http://stackoverflow.com/comment/42271651
type: QuestionComment
comment on: http://stackoverflow.com/q/26854654
score: 1
has text: you don't get data out of callbacks, you use the data in the callback
type: Comment

http://stackoverflow.com/comment/42412337
comment on: http://stackoverflow.com/a/26933238
type: AnswerComment
type: Comment
has text: I tried ´var form = $("#wizard").show();´, still no content however
score: 0

http://stackoverflow.com/comment/42319154
comment on: http://stackoverflow.com/q/26880624
score: 0
type: QuestionComment
type: Comment
has text: So you get the described error with your fiddle? What version of chrome are you using?

http://stackoverflow.com/comment/42237279
type: QuestionComment
comment on: http://stackoverflow.com/q/26833922
has text: Did you consider Web Workers? https://developer.mozilla.org/en-US/docs/Web/Guide/Performance/Using_web_workers
score: 2
type: Comment

http://stackoverflow.com/a/26882625
upvote count: 1
has body: It looks to me like this line: console.log(util.format("Reverse geocode: %s, %s", preciseLoc.latitude, preciseLoc.longitude) is missing a closing bracket and should probably be changed to: console.log(util.format("Reverse geocode: %s, %s", preciseLoc.latitude, preciseLoc.longitude));
score: 1
has comment: http://stackoverflow.com/comment/42321158
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26882511
accepted answer of: http://stackoverflow.com/q/26882511
type: Answer

http://stackoverflow.com/comment/42376284
score: 0
type: QuestionComment
type: Comment
has text: Please edit the code: the if-else part seems to do the same as the if part.
comment on: http://stackoverflow.com/q/26912096

http://stackoverflow.com/comment/42405002
type: AnswerComment
type: Comment
has text: @user3138436 Is it still there in the for loop?
comment on: http://stackoverflow.com/a/26929647
score: 0

http://stackoverflow.com/comment/42448021
type: QuestionComment
comment on: http://stackoverflow.com/q/26953731
has text: He can do it with the code that he has already.
score: 0
type: Comment

http://stackoverflow.com/q/26880913
tagged with: php
has comment: http://stackoverflow.com/comment/42317950
has body: when i open website in iphone or ipad then its checkboxes not check through button. this is my code html: Privatperson js: $(document).on('click', '#btnpvtperson', function() { if($("#checkpvtperson").prop("checked") == false) { $("#checkpvtperson").attr('checked', true); $("#btnpvtperson").removeClass("btn-u-dark-blue"); $("#btnpvtperson").addClass("btn-u-dark-light"); } else { $("#checkpvtperson").attr('checked', false); $("#btnpvtperson").removeClass("btn-u-dark-light"); $("#btnpvtperson").addClass("btn-u-dark-blue"); } });
type: Question
has comment: http://stackoverflow.com/comment/42318111
linked to: http://stackoverflow.com/q/3705937
tagged with: ios
tagged with: javascript
score: 0
answer count: 1
has title: checkboxes not check through button with js/jquery in Apple devices
has answer: http://stackoverflow.com/a/26880969
tagged with: jquery
tagged with: ipad
type: UnansweredQuestion

http://stackoverflow.com/q/26925812
has comment: http://stackoverflow.com/comment/42398229
downvote count: 1
has comment: http://stackoverflow.com/comment/42398071
type: Question
has comment: http://stackoverflow.com/comment/42399010
score: 3
has comment: http://stackoverflow.com/comment/42398252
has answer: http://stackoverflow.com/a/26926766
has comment: http://stackoverflow.com/comment/42398173
tagged with: javascript
linked to: http://stackoverflow.com/q/3799238
has comment: http://stackoverflow.com/comment/42398974
has comment: http://stackoverflow.com/comment/42398970
upvote count: 4
has comment: http://stackoverflow.com/comment/42398891
tagged with: functional-programming
tagged with: function
answer count: 1
has comment: http://stackoverflow.com/comment/42398329
has body: function setStyle(x) { with (x.style) { padding = '10px' marginBottom = '10px' width = '100%' } return setStyle } setStyle(account)(password)(login) I often use the above pattern, but when I need to talk about it, I have no idea what is it called? How to refer to this kind of approach in the conversation? UPDATE: Someone closed this question as duplicate, but I cannot see why is that a duplicate. Other question is about some framework, the poster is trying to understand the code. I do not try to understand the code, I am asking about an English term for a known pattern. Even though the discussed concept is the same, the question is different. It is like saying that "Who was the youngest in Jasckson's Five" and "Whose album is Thriller" both are the same question, only because it happens to be about the same person. But those are different questions, not the same.
favorite count: 0
has comment: http://stackoverflow.com/comment/42398061
has comment: http://stackoverflow.com/comment/42398175
accepted answer: http://stackoverflow.com/a/26926766
has comment: http://stackoverflow.com/comment/42400419
has title: What is this pattern f(a)(b)(c) called?
has comment: http://stackoverflow.com/comment/42398114
has comment: http://stackoverflow.com/comment/42398217
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42398126
has comment: http://stackoverflow.com/comment/42398267

http://stackoverflow.com/a/26873079
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26872718
type: Answer
has body: One way: var time = "02:00:00".split(":"), h = +time[0], p; if (h &gt; 12) { h -= 12; p = "pm"; } else { h = h || 12; p = "am"; } var t = h + ":" + time[1] + p;
answers question: http://stackoverflow.com/q/26872718
upvote count: 3
score: 3
type: AcceptedAnswer

http://stackoverflow.com/comment/132208090
type: Comment
comment on: http://stackoverflow.com/q/26965171
has text: the fastest is this one: https://stackoverflow.com/a/74916422/236062
score: 0
type: QuestionComment

http://stackoverflow.com/a/26857454
has comment: http://stackoverflow.com/comment/42297872
has body: You're confusing Arrays and Objects in your code: For an object use: &lt;!-- repeat attr --&gt; ng-repeat="(key, value) in items" // add an item items[key] = value; // remove an item delete items[key]; For an array: &lt;!-- repeat attr --&gt; ng-repeat="item in items" // add an item items.push(item); // remove an item items.slice(items.indexOf(item), 1);
has comment: http://stackoverflow.com/comment/42298484
has comment: http://stackoverflow.com/comment/42298252
answers question: http://stackoverflow.com/q/26854840
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26854840
score: 0
type: Answer

http://stackoverflow.com/comment/42339926
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/26893043
type: Comment
has text: And why would you need to put a jQuery object inside an array, there's generally no reason to do so ?

http://stackoverflow.com/q/26923015
has answer: http://stackoverflow.com/a/26934158
score: 0
accepted answer: http://stackoverflow.com/a/26934158
tagged with: regex
tagged with: string
has answer: http://stackoverflow.com/a/26923233
has title: Javascript and Regex: Get index of a captured string
tagged with: indexing
type: AnsweredQuestion
has body: Here's is my problem: I have a regular expression, this expression contains one, and only one capture group, This regular expression cannot be changed, I have a string, that will be matched this regular expression, The regex will match the complete string, it's not a look-up, if the regex cannot be matched to the string, the function will fail prior reaching this step. => I want to get the captured sub-string position in the string, and it's length. Example; If my regex is ^.*?\/F?L?(\d+)$ my string is "( 413) 250/FL250" I want to get 14, and 3. In those conditions, search would return 1. This is a simple example, but we can have extremely complex regex, however the principle is always the same: one and only one capture group, and find the position of the captured string in the main one. Thanks a lot for your help, I'm stucked. EDITION: So I made something with ant (our base work environnement is ant) which consist of getting the leftContext of the capture group, then determine it's size. To get the leftContext, I simply move the parenthesis of the capture groupe at the left part. Ex: \d(\s) becomes (\d)\s. So there I have a question about it: &lt;macrodef name="Get_CaptureGroup_Position" &gt; &lt;attribute name="text" /&gt; &lt;attribute name="mask" /&gt; &lt;attribute name="start" /&gt; &lt;attribute name="end" /&gt; &lt;sequential&gt; &lt;var name="_GMLCS_modified_regex" unset="true"/&gt; &lt;var name="_GMLCS_leftContext" unset="true"/&gt; &lt;var name="_GMLCS_leftContext_len" unset="true"/&gt; &lt;var name="_GMLCS_CapturedGroup" unset="true"/&gt; &lt;var name="_GMLCS_CapturedGroup_len" unset="true"/&gt; &lt;propertyregex property="_GMLCS_modified_regex" override="yes" input="@{mask}" regexp="(.*[^\\])\)([^?].*)" replace="\1\2" /&gt; &lt;propertyregex property="_GMLCS_modified_regex" override="yes" input="${_GMLCS_modified_regex}" regexp="(.*[^\\])\(([^?].*)" replace="\1)\2" /&gt; &lt;var name="_GMLCS_modified_regex" value="(${_GMLCS_modified_regex}" /&gt; &lt;pr…
possible better answer: http://stackoverflow.com/a/26923233
tagged with: substring
type: Question
answer count: 2
tagged with: javascript

http://stackoverflow.com/q/26960126
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26960200
type: Question
has body: Im new the Marionette.js. Im currently implementing routes and controllers. In my App.js, I have: App.appRouter = new Router({ controller:new AppController() }); I want AppController to initialise other controllers. So I have a GenericController which looks after everything when the hash change is "generic", NewsController which looks after everything when hash changes to "news" etc. I don't want to have all the route functions in one giant controller file. So my AppController looks like: define(['App', 'backbone', 'marionette', "app/models/generic", "app/views/GenericList", 'app/utils/useful_func', 'app/utils/pageslider', 'constants', 'app/controllers/GenericController' ], function (App, Backbone, Marionette, model, GenericList, Useful, PageSlider, constants, GenericController) { return Backbone.Marionette.Controller.extend({ initialize:function (options) { genericController = new GenericController(); }, }); }); GenericController looks like: define(['App', 'backbone', 'marionette'], function (App, Backbone, Marionette) { return Backbone.Marionette.Controller.extend({ initialize:function (options) { }, getGeneric: function(){ console.log('in getGeneric'); }, }); }); The Router looks like: appRoutes: { "generic": "getGeneric", ... However, I end up with the error: Method 'getGenericItem' was not found on the controller Because its just looking in AppController and not GenericController for the router functions. If i move getGenericItem() to the main AppController, it works fine. How can I get it to look in GenericController for router functions?
accepted answer: http://stackoverflow.com/a/26960200
answer count: 1
tagged with: javascript
has title: Routes and controllers in Marionette.js
tagged with: backbone.js
score: 0
tagged with: marionette

http://stackoverflow.com/q/26979494
has comment: http://stackoverflow.com/comment/42493364
has answer: http://stackoverflow.com/a/26979578
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42493565
tagged with: twitter-bootstrap
score: -3
has comment: http://stackoverflow.com/comment/42494245
has body: I am using Javascript to display a div when text in the texbox is changed. This is using bootstrap framework. But I cant seem to get it to work. function myFunction() { var ele = document.getElementById("auto"); if (this.value==" " || this.value=="") { ele.style.display = "none"; } else { ele.innerHTML = "chuckbeyor101@hotmail.com josh@computersbyjd.com"; ele.style.display = "block"; } } Customer Information Email: Test Div
type: Question
has answer: http://stackoverflow.com/a/26979865
possible better answer: http://stackoverflow.com/a/26979578
downvote count: 4
has answer: http://stackoverflow.com/a/26979594
upvote count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/42493783
has answer: http://stackoverflow.com/a/26979729
accepted answer: http://stackoverflow.com/a/26979729
has title: Javascript Not Working
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/42365295
score: 0
has text: Perhaps some other element is being activated after this code fragment runs?
comment on: http://stackoverflow.com/q/26907449
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42417365
comment on: http://stackoverflow.com/q/26936144
type: Comment
type: QuestionComment
has text: Thank you for looking into this. I see the issue now: The problem is that I have multiple dt and dd elements on this page so the span id (#cpl) isn't unique anymore. Thats why it isn't working for me. I tried to solve this by using find('span') or toggle.children('span') but it doesn't work for me. Any ideas how I can address the span in the dt element without using #id? Thank you!
score: 0

http://stackoverflow.com/comment/42278651
score: 0
comment on: http://stackoverflow.com/a/26858642
type: Comment
has text: I used your code. If existing data is not found then it's showing confirm message. It's should be show confirm message when `existing data is found and yes button is clicked`
type: AnswerComment

http://stackoverflow.com/comment/42482481
has text: i am sending it with http /POST
comment on: http://stackoverflow.com/q/26973444
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/42336614
score: 0
has text: The reason why I asked if you can change your server-side code is precisely because the behavior you described is badly represented in your JSON, and the one I used instead reflects your data model better.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26882141

http://stackoverflow.com/a/26975220
downvote count: 0
score: 1
type: Answer
answers question: http://stackoverflow.com/q/26974993
upvote count: 1
has body: Your "str" variable most probably doesn't contain what you expected. Write instead: var str = '\\\\nvga032.bmwgroup.net\\QXE7868\\Daten\\IE\\3_bookmarks.zzz' var n = str.lastIndexOf("\\");

http://stackoverflow.com/q/26959249
score: 1
accepted answer: http://stackoverflow.com/a/26960825
type: Question
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/26959358
has body: I browsed all the afternoon trying to find a good solution, but with no luck. This is the problem: I have an old html website. I have to change every link built in this way: &lt;a href="javascript: OpenImage('/dir1/dir2/Image321.jpg',' Image description ');void(0);"&gt; with a standard a href: &lt;a href="/dir1/dir2/Image321.jpg" title="Image description"&gt; I think I have have to look for href beginning with "avascript:" $("a[href^='javascript:']") and change it using regular expression.. But after thousands test I can't solve it.. Any idea? thanks
tagged with: javascript
has answer: http://stackoverflow.com/a/26960825
has comment: http://stackoverflow.com/comment/42464514
downvote count: 1
tagged with: regex
has comment: http://stackoverflow.com/comment/42457090
favorite count: 0
has comment: http://stackoverflow.com/comment/42464490
possible better answer: http://stackoverflow.com/a/26959358
has title: URL rewrite using JQUERY and REGULAR EXPRESSIONS
has comment: http://stackoverflow.com/comment/42458459
type: AnsweredQuestion

http://stackoverflow.com/a/68490917
score: 1
answers question: http://stackoverflow.com/q/26961325
upvote count: 1
has body: You can simply destroy the editor while closing the modal box $('#YOUR_MODAL_ID').on('hidden.bs.modal', function(e) { //EDITOR_ID will be without # tinyMCE.get("EDITOR_ID").remove(); }); And Initialize the editor once you open the Modal Box again.
type: Answer
downvote count: 0

http://stackoverflow.com/a/26884135
answers question: http://stackoverflow.com/q/26883760
has body: no need of parsing it because you have already mentioned it as json you can simply do like this: success: function(result) { console.log(result.od); console.log(result.od[0].percentageCompleted); console.log(od); $.each(result, function(idx, obj) { console.log(obj[0].dateProcessed); }); }
score: 0
type: Answer

http://stackoverflow.com/q/26947776
type: Question
has answer: http://stackoverflow.com/a/26948744
has body: I need some help. Navigate to this website: http://www.webeffectual.com/ You can see the three white lines on the top left corner of the website. When you hover those lines, there are three boxes that are sliding out from the left. And when you hover those boxes a text appears. That is what I don't know how to accomplish. Here is my code so far: Untitled Document The code is just a empty html. :( And my css is also empty If you know how to do this, please write a comment or send a link to a website that explains how to to this. It would be highly appreciated. Srry if im explaining it so bad. I am from sweden and i dont know so much english:3
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42439248
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has title: Menu sliding out from left
tagged with: css
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/26948744
has answer: http://stackoverflow.com/a/26948936
accepted answer: http://stackoverflow.com/a/26948936

http://stackoverflow.com/comment/42293334
score: 0
has text: Sorry if I misinterpreted the question but let me explain the object. The object as Heroes such as, "Axe", "Bane". These heroes in turn have heroes that can counters them. Thus the all the strings that belong to "counters"
comment on: http://stackoverflow.com/q/26866863
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26967695
type: Answer
answers question: http://stackoverflow.com/q/26967614
has body: First of all..yoyu need not to remove $(document).ready(function(){...}); from your script...also do not remove script tag otherwise your script will stop work...In case of load...Please check wethet the path you given is correct... e.g. $( "#display" ).load( "ajax/test.php");
score: 0

http://stackoverflow.com/comment/42489078
score: 0
has text: will add the css anything to do with tz-radiobutton in my first post
comment on: http://stackoverflow.com/a/26976165
type: AnswerComment
type: Comment

http://stackoverflow.com/q/26833729
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
has title: Angular Material buttons height
score: 1
tagged with: material-design
has comment: http://stackoverflow.com/comment/42553814
downvote count: 1
type: Question
has body: html: &lt;body id="app"&gt; &lt;md-button&gt; Yo &lt;/md-button&gt; &lt;/body&gt; Looks: Why button with 100% height? But at materials docs they looks like inline element. And material directives without replace option: But at materials docs all directives replaced with templates. What is wrong?
answer count: 1
has answer: http://stackoverflow.com/a/27007508
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/42537931

http://stackoverflow.com/comment/77577414
has text: Note that Kendo chooses the property `navigatable` which is not a word, and the properly spelled `navigable` will not work.
type: Comment
comment on: http://stackoverflow.com/a/26875467
score: 1
type: AnswerComment

http://stackoverflow.com/comment/42345174
comment on: http://stackoverflow.com/q/26895730
has text: to be clear: JS itself provides no way of doing async anything (afaik), you have to use something provided by the host environment, like setTimeout or ajax.
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42298616
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26869753
has text: Perfect, thank you very much. I had the idea it was something in that direction but didn't know about the each() function.
type: AnswerComment

http://stackoverflow.com/a/40544857
answers question: http://stackoverflow.com/q/26888276
score: 0
has body: How about this : editor.addButton('yourButton', { title: 'One can Enable/disable TinyMCE', text: "Disable", onclick: function (ee) { editor.setMode('readonly'); if($(ee.target).text() == "Disable"){ var theEle = $(ee.target).toggle(); var edit = editor; var newBut = "&lt;input type='button' style='opacity:1;color:white; background-color:orange;' value='Enable'/&gt;"; $(newBut).prependTo($(theEle).closest("div")).click(function(e){ edit.setMode('design'); $(e.target).remove(); $(theEle).toggle(); }); } } });
type: Answer

http://stackoverflow.com/comment/42394581
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26923762
type: Comment
has text: Thanks Bryce, I'm giving it a shot right now! I'll let you know how it goes :)

http://stackoverflow.com/a/26961827
type: Answer
answers question: http://stackoverflow.com/q/26961778
downvote count: 0
has body: Sure thing. Here's a fork of your fiddle, iterating over the associative array keys and not using the separate array: http://jsfiddle.net/65nb1cmo/1/ Since you're using jQuery, we can use their nice each iterator. Our strategy is simply to look at each key/value pair in the associative array (where the key is stored in i each iteration as before). We find the nearest i to the provided x, and then return it. var color = {50:"red",100:"yellow",200:"Golden",400:"Black",600:"beige",1000:"pink",1500:"green"}; var getClosestValues = function(a, x) { var lo, hi; $.each(a, function(i, name) { if (i &lt;= x &amp;&amp; (lo === undefined || lo &lt; i)) lo = i; if (i &gt;= x &amp;&amp; (hi === undefined || hi &gt; i)) hi = i; }); var text = ''+x+'/'+hi+','+color[hi]+''; return text; } var print = getClosestValues(color,1411); print = print.split(','); $('.area').html('&lt;div style="background:'+print[1]+'"&gt;'+print[0]+'&lt;/div&gt;');
score: 1
upvote count: 1

http://stackoverflow.com/q/26930387
has comment: http://stackoverflow.com/comment/42430910
has comment: http://stackoverflow.com/comment/42432860
has title: Parse nested json in javascript
type: UnansweredQuestion
downvote count: 2
linked to: http://stackoverflow.com/q/14379274
has body: This is my json response in javascript. {"1": {"11": "51","12": "52","13": "53","14": "54","15": "55"},"2": {"11": "51","12": "52","13": "53","14":"54","15": "55"},"4": {"11": "51","12": "52","13": "53","14": "54","15": "55"}} I am parsing this json but it is not giving proper output. for(var i=0; i&lt;Object.keys(obj).length; i++) { // here how should i parse the json and get all the key and values into the array. } Thanks
has answer: http://stackoverflow.com/a/26930640
score: -2
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/42407878
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/8312459

http://stackoverflow.com/comment/42381790
has text: Possible duplicate (assuming JavaScript): http://stackoverflow.com/questions/442404/retrieve-the-position-x-y-of-an-html-element
comment on: http://stackoverflow.com/q/26916582
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42425954
comment on: http://stackoverflow.com/q/26941009
type: QuestionComment
type: Comment
has text: @adeneo, that's not quite correct, `ninja.yell` and `samurai.yell` will share a reference to the same function object, the problem is that `ninja` is being overwritten with a new object completely.
score: 5

http://stackoverflow.com/q/26928178
answer count: 1
has comment: http://stackoverflow.com/comment/42402603
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42402196
has comment: http://stackoverflow.com/comment/42403555
favorite count: 0
has comment: http://stackoverflow.com/comment/42403985
has comment: http://stackoverflow.com/comment/42403505
has comment: http://stackoverflow.com/comment/42403455
has comment: http://stackoverflow.com/comment/42402242
has comment: http://stackoverflow.com/comment/42403515
score: -1
has title: Regarding differentiating html tag from xml tag in javascript or jQuery
type: UnansweredQuestion
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/42402158
has answer: http://stackoverflow.com/a/26929880
has comment: http://stackoverflow.com/comment/42403411
has body: I need a validation to allow if it is xml tag and stop if it is html tag. Searched through the internet , couldn't find the answer . So i am posting this question. The validation can be done using javascript or jquery. Thanks in advance.
upvote count: 0

http://stackoverflow.com/q/26922488
has answer: http://stackoverflow.com/a/26922627
type: Question
has answer: http://stackoverflow.com/a/26923086
tagged with: javascript
has comment: http://stackoverflow.com/comment/42392525
has body: Just as I said in subject, when I try to find index of certain element that is in array created of elements with common class name with code: document.getELementsByClassName("blabla"). var a, b, pe; a=document.getElementById("a"); b=document.getElementById("b"); pe=document.getElementsByClassName("o"); var k=pe.indexOf(b); alert(k); &lt;p class="o" id="a"&gt;&lt;/p&gt; &lt;p class="o" id="b"&gt;&lt;/p&gt;
has answer: http://stackoverflow.com/a/26924405
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/42393215
possible better answer: http://stackoverflow.com/a/26923086
linked to: http://stackoverflow.com/q/16063394
accepted answer: http://stackoverflow.com/a/26922627
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/9568969
has comment: http://stackoverflow.com/comment/42392541
has title: Access to index of element in array of elements with common classname

http://stackoverflow.com/q/26909862
score: 0
answer count: 2
has title: Adding a Counter to a Text Sequence
favorite count: 0
accepted answer: http://stackoverflow.com/a/26910228
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has body: Currently I am developing a game I am using JavaScript for the Gameplay One of the functions allows the user to see the sequence they must enter (It prints out the color they must click) But The problem is sometimes they must hit the same circle twice etc and that is not that clear for the user. So I was wondering if it is possible to add a counter to the sequence that displays something simple like 1.Red 2.Red 3.Blue So They can see that It wants a second red etc Here is a jsfiddle so you can see what I mean http://jsfiddle.net/uusL7hch/17/ The JavaScript File cut down to only the part where the code for displaying the name of the color is $.each(this.genSequence, function (index, val) { //iterate over each value in the generated array timerCount = index; setTimeout(function () { that.flash($(that.shape + val), 1, 300, val); if ($("#text").is(":checked")) {//Check Box Function $(".TextBox").children(":first").html('&lt;b&gt;' + that.colors[val - 1] + '&lt;/b&gt;'); } }, 500 * index * that.difficulty); // multiply timeout by how many items in the array so that they play sequentially and multiply by the difficulty modifier }); // Wait to start timer until full sequence is displayed setTimeout(function () { that.timerInterval = setInterval(function () { that.countDown() }, 100) setTimeout(function () { $(".TextBox").children(":first").html(''); }, 500); }, 500 * timerCount * that.difficulty); }, Any help would be great
possible better answer: http://stackoverflow.com/a/26909970
upvote count: 1
has answer: http://stackoverflow.com/a/26909970
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/26910228
tagged with: counter
tagged with: javascript
has comment: http://stackoverflow.com/comment/42369591
has comment: http://stackoverflow.com/comment/42369425

http://stackoverflow.com/q/26862643
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26862764
downvote count: 1
has comment: http://stackoverflow.com/comment/42285287
has comment: http://stackoverflow.com/comment/42285409
has body: We have requirement, to search for different fields using a single text box. For example, the search has to be based on three fields; Product, Brand and Place. Initially the user will be given the below text in the textbox which cannot be modified: Product:-Brand:-Place When user wants to search for Product, Brand and Place, he will just add values: Product:"TV"-Brand:"Samsung"-Place:"London" When user wants to search for just Product: Product:"TV"-Brand:-Place Can some body help me, how can be done that in jQuery or angular js?
type: Question
upvote count: 0
has comment: http://stackoverflow.com/comment/42285350
answer count: 1
tagged with: javascript
tagged with: jquery
score: -1
has title: search in textbox for different fields help is required
has comment: http://stackoverflow.com/comment/42285369
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/comment/42338341
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/26892204
has text: Something like `d3.html(d3.html() + foobar)`?
type: Comment

http://stackoverflow.com/q/26908633
linked to: http://stackoverflow.com/q/26907794
has body: I have a gem installed : http://toopay.github.io/bootstrap-markdown/ This library is supposedd to turn a textarea element into a stylized mardown editor. To do this I used the following code: &lt;div class="well col-md-10 col-md-offset-1"&gt; &lt;%= form_for(:post, :url =&gt; {:action =&gt; 'create'}) do |f| %&gt; &lt;%= f.text_field(:title, class: 'form-control')%&gt; &lt;%= f.text_field(:description, class: 'form-control')%&gt; &lt;%= f.text_area(:content, rows: 15, "data-provide" =&gt; "markdown")%&gt; &lt;%= f.button "Submit", type: 'submit', class: 'btn col-md-4 col-md-offset-4 btn-large btn-success'%&gt; &lt;% end %&gt; &lt;/div&gt; Initially I put this code on my root page and it worked perfectly. I then created a new controller and moved it to a different view. I was accessing that view by manually typing the url in the browser: localhost:3000/controller/view and the page loaded perfectly. Result here: However, when I access the page through a link on a different page, the form was not stylized. Result: The odd thing is that if I reload the page it applies all the changes. I made a temporary ugly hack that reloads the page one on every access: $(document).ready(function(){ //Check if the current URL contains '#' if(document.URL.indexOf("#")==-1){ // Set the URL to whatever it was plus "#". url = document.URL+"#"; location = "#"; //Reload the page location.reload(true); } }); But there must be a decent explanation for what is going on. I went through the library itself and added some console.log statements. It seems that the library is loaded and initialisez on the home page but when I click the link it does not run anything anymore. I am trying really hard to understand if this is a rails problem or a library one.
answer count: 1
has answer: http://stackoverflow.com/a/26908788
tagged with: rails-routing
has title: How and when does rails load a gem library?
tagged with: ruby-on-rails
type: AnsweredQuestion
tagged with: rubygems
accepted answer: http://stackoverflow.com/a/26908788
has comment: http://stackoverflow.com/comment/42367314
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/42367368
score: 0

http://stackoverflow.com/comment/42460450
has text: You have to create helper for {{thumbs}} that looks thumbs: function(){ return thumbs[0]};
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26961049
score: 0

http://stackoverflow.com/comment/42482299
comment on: http://stackoverflow.com/q/26973521
has text: r u getting any errors in your console?
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/42437802
has text: It is impossible to say. The value of `this` depends on how the function is called and you don't show us how you call `o[m]`. The statement *in a function 'this' should refer to the global object (non-strict mode)* is only true sometimes (since the value depends on how it is called, and it may or may not be called in the context of the global object).
score: 0
comment on: http://stackoverflow.com/q/26947973
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26880189
has answer: http://stackoverflow.com/a/26881037
has comment: http://stackoverflow.com/comment/42316859
type: Question
tagged with: jquery-ui
has body: I'm not even sure how to search this question. But effectively I'm trying to figure out how this website is achieving this fixed opacity/size changing effect on their table: http://sqlzoo.net/wiki/SELECT_within_SELECT_Tutorial . If you scroll down you'll see the effect on the table. When you hover over it it pops out having the data more visible. The only thing I can think of is using a fixed div that when scrolled past a certain point triggers a jquery UI event that shrinks while decreasing opacity and then an on hover event that reverses this effect. Achieving this animation in the way I described above seems inefficient and I'm not sure if more (or all) can be done with CSS3. So basically can you achieve the effect shown on the page provided completely or almost completely in CSS3. Also i looked at the source of the page and couldn't fish it out of the css and scripts they include. Here's a fiddle of what I have so far. Haven't started on scrolling yet: HTML Blahblah CSS div { width:250px; height:250px; border:2px solid #a1a1a1; } JavaScript $( "#stuff" ).click(function() { $( "#stuff" ).animate({ width: "20%", height:"20px", opacity: 0.4 }, 1500 ); }); http://jsfiddle.net/thed0ctor/1kx5jg1e/
has title: Can you fix a div and make it change opacity, size and position as you scroll with CSS3
answer count: 2
has comment: http://stackoverflow.com/comment/42340775
accepted answer: http://stackoverflow.com/a/26881037
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/26880768
tagged with: http://stackoverflow.com/tag/html
tagged with: css
possible better answer: http://stackoverflow.com/a/26880768
type: AnsweredQuestion

http://stackoverflow.com/q/26955908
tagged with: javascript
tagged with: ajax
score: 0
has body: I've a simple MVC model. I'm doing an Ajax request where I send some data to be processed by PHP and retrieve database records as JSON. As this object could be quite large, is there some way I could compress/encrypt it on the PHP (server side) and decrypt it on the Javascript side (client) $.ajax({ url: "/php/function/link/", dataType: 'json', data: { "date": date, }, type: "POST", success: function(_data){ // load encrypted data here and decrypt it. }, error: function() { alert("Some error fetching!"); } I tried using the following methods, but they didn't seem to work (I was getting error while decompressing them on the javascript end): JSONC https://stackoverflow.com/a/11901649/1443702 Are there any other better ways? I simply need to : compress data on javascript to be passed from client->send it to server (PHP) -> decompress it and compute database queries -> compress it -> pass it to javascript(client side) -> decompress it
has answer: http://stackoverflow.com/a/27655600
linked to: http://stackoverflow.com/q/6127818
has title: Compress JSON responce in PHP
type: UnansweredQuestion
tagged with: php
tagged with: http://stackoverflow.com/tag/json
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/26955931

http://stackoverflow.com/q/26906341
has answer: http://stackoverflow.com/a/26906700
upvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/26906538
downvote count: 0
has title: remove slashes jquery from json
has answer: http://stackoverflow.com/a/26906735
has body: I send data via ajax so: $res = array(); foreach($series as $i){ //print_r($i); array_push($res, $i); } //print_r ($res); print (json_encode($res, JSON_UNESCAPED_SLASHES)); Get data: success: function(json){ alert(JSON.stringify(json)); json = json.replace("\\", " "); alert(JSON.stringify(json)); It is alerting same datas, why? How can I remove slashes from json? Thanks
has answer: http://stackoverflow.com/a/26906538
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
type: Question
possible better answer: http://stackoverflow.com/a/26906700

http://stackoverflow.com/a/26933418
type: Answer
has body: A thing you could do is using jQuery $.post and using JavaScript. Each time you enter a new value in the input box, you could make the jQuery do a $.post with the new value to a .php file that change "the value of VARS".
has comment: http://stackoverflow.com/comment/42411965
answers question: http://stackoverflow.com/q/26933231
accepted answer of: http://stackoverflow.com/q/26933231
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/42483477
has text: @SimeriaIonut: Start by handling click on `li`. Then go on to use event delegation on `ul`.
comment on: http://stackoverflow.com/q/26974054
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/42269691
type: QuestionComment
comment on: http://stackoverflow.com/q/26850144
has text: @CurtisMattoon "LOG" is being outputed by itself on the console. "time: no info" if what I wrote on my code. I updated my description above and facing new problem. thanks
score: 0
type: Comment

http://stackoverflow.com/q/26857846
tagged with: owin
answer count: 0
score: 1
upvote count: 1
tagged with: signalr
type: Question
has title: Can SignalR Client 1.x connect to SignalR Server 2.x?
tagged with: javascript
downvote count: 0
has comment: http://stackoverflow.com/comment/42307326
has body: I have a project using SignalR v1.x with IIS hosted server. Now i want to upgrade server side to 2.x with self hosted by windows service. But i want to keep client side in SignalR version 1.x. Can i?
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47151249

http://stackoverflow.com/comment/42369209
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26909500
has text: Sorry Paul.. Now its showing.. I was playing with it earlier.

http://stackoverflow.com/comment/42451789
type: Comment
comment on: http://stackoverflow.com/a/26956183
score: 0
type: AnswerComment
has text: i tought about top to bottom, but it doesn't fit for my theme because there are many posts on a single page..

http://stackoverflow.com/comment/42262068
comment on: http://stackoverflow.com/q/26849748
score: 0
has text: First it is not secure, second you are reading the values on page load and not when the user clicks the button.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42288746
type: QuestionComment
has text: Still issue i changed it any one can check it www.kreativestudio.ca
comment on: http://stackoverflow.com/q/26864066
score: 0
type: Comment

http://stackoverflow.com/q/26932031
has body: hi i have this code used for my map contact and i want to add 2 more places on it can you help me please: /* --- Google Map --- */ var mapOptions = { center: new google.maps.LatLng(49.5564021,5.8628159), zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map-canvas"),mapOptions); var image = "img/marker.png"; var marker = new google.maps.Marker({ position: mapOptions.center, map: map, icon: image });
type: Question
tagged with: google-maps
has title: Gmap with multiple marker
tagged with: javascript
has answer: http://stackoverflow.com/a/26932227
tagged with: google-maps-api-3
score: 0
answer count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26932269

http://stackoverflow.com/q/26988071
has answer: http://stackoverflow.com/a/77263976
tagged with: node.js
has comment: http://stackoverflow.com/comment/42531546
has answer: http://stackoverflow.com/a/44896334
has comment: http://stackoverflow.com/comment/100894617
has comment: http://stackoverflow.com/comment/42539537
has comment: http://stackoverflow.com/comment/42547142
has answer: http://stackoverflow.com/a/77942115
has comment: http://stackoverflow.com/comment/80702658
downvote count: 1
answer count: 7
has comment: http://stackoverflow.com/comment/42548729
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/70898822
has answer: http://stackoverflow.com/a/63378642
has answer: http://stackoverflow.com/a/26988819
upvote count: 47
tagged with: cors
has body: How do I allow multiple domains for CORS in express in a simplified way. I have cors: { origin: "www.one.com"; } app.all('*', function(req, res, next) { res.header("Access-Control-Allow-Origin", cors.origin); res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); next(); }); This works when there is only one domain mentioned in origin But if I want to have origin as an array of domains and I want to allow CORS for all the domains in the origin array, I would have something like this - cors: { origin: ["www.one.com","www.two.com","www.three.com"]; } But then the problem is this below code would not work - app.all('*', function(req, res, next) { res.header("Access-Control-Allow-Origin", cors.origin); res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); next(); }); How do I make res.header take an array of domains via cors.origin ?
tagged with: javascript
has title: Allow multiple CORS domain in express js
has comment: http://stackoverflow.com/comment/42509948
tagged with: express
favorite count: 0
has answer: http://stackoverflow.com/a/65756317
score: 46
type: Question
linked to: http://stackoverflow.com/q/36393256

http://stackoverflow.com/q/26839399
type: Question
has body: I'm using Knockout to bind an MVC view. This works fine the first time but for subsequent refreshes Knockout throws the error: Error: You cannot apply bindings multiple times to the same element. This is my binding code (inside Document.Ready), note that I am using setTimeout to run every 25 seconds, this is where the error occurs: function viewModel() { Loading = ko.observable(true), CurrentUser = ko.observable(), Environments = ko.observableArray(), CurrentFormattedDate = ko.observable() } function doPoll() { $.get("/home/getindex") .done(function (data) { $(data).each(function (index, element) { viewModel = data; viewModel.Loading = false; viewModel.CurrentFormattedDate = moment().format('MMMM YYYY'); }); ko.applyBindings(viewModel); }) .always(function () { setTimeout(doPoll, 25000); }) .error(function (ex) { alert("Error"); }); }; doPoll(); How do I avoid the error when DoPoll is called multiple times?
tagged with: javascript
downvote count: 0
answer count: 1
favorite count: 0
upvote count: 2
has title: Knockout: Error: You cannot apply bindings multiple times to the same element when refreshing page
has answer: http://stackoverflow.com/a/26839497
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26839497
has comment: http://stackoverflow.com/comment/42244695
tagged with: knockout.js
has comment: http://stackoverflow.com/comment/42243808

http://stackoverflow.com/q/26902621
type: Question
tagged with: arrays
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/26902733
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/26902733
has body: I've sorted this but now it's came back on... I've tried changing the for loops but it still seems to generate duplicate French words. It's suppose to not show the french word twice in the application run. My jsFiddle is an exact replica: http://jsfiddle.net/jamesw1/w8p7b6p3/17/ Javascript: //James Wainwright's Mobile Apps Assignment //Arrays of french and english words. var RanNumbers = new Array(6), foreignWords = ['un', 'deux', 'trois', 'quatre', 'cinq', 'six', 'sept', 'huit', 'neuf', 'dix', 'onze', 'douze', 'treize', 'quatorze', 'quinze', 'seize', 'dix-sept', 'dix-huit', 'dix-neuf', 'vingt', 'vingt et un', 'vingt-deux', 'vingt-trois', 'vingt-quatre', 'vingt-cinq', 'vingt-six', 'vingt-sept', 'vingt-huit', 'vingt-neuf', 'trente'], translate = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen', 'twenty', 'twenty-one', 'twenty-two', 'twenty-three', 'twenty-four', 'twenty-five', 'twenty-six', 'twenty-seven', 'twenty-eight', 'twenty-nine', 'thirty'], number = Math.floor((Math.random() * 30)), output = '', correctAns = translate[number]; //Generate random numbers and make sure they aren't the same as each other. function wordGen() { for (var h = 0; h < RanNumbers.length; h++) { var temp = 0; do { temp = Math.floor(Math.random() * 30); while(temp==correctAns){ temp = Math.floor(Math.random() * 30); } } while (RanNumbers.indexOf(temp) > -1); RanNumbers[h] = temp; } } //Call the previous function wordGen(); //Create dynamic select menu using for loop. This loop runs once (on document load) document.getElementById('generatedWord').textContent = foreignWords[number]; var correctAnswerIndex = Math.floor(Math.random() * 6); //If it's 0...Change it. if(correctAnswerIndex == 0) { correctAnswerIndex++; } //Create a select menu of the options...Add the correct answer randomly into the menu. var guess = " "; for (var i = 1; i < RanNumbers.length; i++) …
type: AnsweredQuestion
has title: My generated french word duplicates? When it shouldn't be

http://stackoverflow.com/a/26955096
answers question: http://stackoverflow.com/q/26860126
downvote count: 0
type: AcceptedAnswer
has body: If you need to transform the date format inline, dispense with the regex method and use the following: Javascript: .substr() and .charAt() Here is a working example: // convert the date format from yyyy-mm to mm.yyyy document.getElementById("id_of_element").value = ($("#id_of_element").val().substr(5,7) + $("#id_of_element").val().charAt(4) + $("#id_of_element").val().substr(0,4)).replace("-", "."); if you do not need to change the date separator, simply remove the .replace("-", ".") from the above code.
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26860126

http://stackoverflow.com/comment/42508766
has text: Check the fiddle - there in the data-now attribute is the new value at the end (1239)
score: 0
comment on: http://stackoverflow.com/q/26988123
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26918763
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/42386701
tagged with: jquery
tagged with: window.open
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/42385922
tagged with: javascript
has answer: http://stackoverflow.com/a/26918815
has title: Make Javascript Line break when window.open()
has body: var popupWindow = window.open('','null','location=no,toolbar=no,menubar=0,scrollbars=0'); var previewMsg = 'ID: ' + data.template.MsgID + '\n' + 'Message Body: ' + data.template.MsgContents + '\n'; popupWindow.document.write(previewMsg); I am trying to add a line break as you can see by the '\n'. I've tried '\n\n', '\r'. Does not seem to stick when the pop up opens.

http://stackoverflow.com/a/26943304
answers question: http://stackoverflow.com/q/26942423
has comment: http://stackoverflow.com/comment/42492826
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/42490878
has comment: http://stackoverflow.com/comment/42467594
has body: You're not assigning your value to the observable correctly. You're doing: self.currentBug = ko.observable(); self.currentBug = obj; The first line creates an observable, but the second line throws it away and replacing it with the bug object. You want to assign to the observable, not throw it away, like: self.currentBug = ko.observable(); self.setModalBug = function (obj, event) { self.currentBug(obj); //&lt;-- Assign the current bug the currentBug observable alert(self.currentBug().Id()); //note the additional () to read the value of the observable alert(self.currentBug().BugName()); }
upvote count: 2
has comment: http://stackoverflow.com/comment/42430790

http://stackoverflow.com/a/26950260
downvote count: 0
has body: arr[0].country = 'Egypt' Set the country property.
upvote count: 2
has comment: http://stackoverflow.com/comment/42441974
has comment: http://stackoverflow.com/comment/42441992
type: Answer
answers question: http://stackoverflow.com/q/26950238
score: 2

http://stackoverflow.com/comment/42267659
type: Comment
has text: You are the man! Will accept it as answer when 15mins are up. Just to make sure I understand... $http promise is returned to originating service through this.query right? The .then in advsolr will run when the data is ready, but where does that return go? Is the .then in the outer module running on the same promise?
type: AnswerComment
comment on: http://stackoverflow.com/a/26852462
score: 0

http://stackoverflow.com/comment/42499962
score: 0
type: Comment
comment on: http://stackoverflow.com/q/26982881
type: QuestionComment
has text: I hadn't tested the reverse David, thanks for pointing that out.

http://stackoverflow.com/q/26919874
has comment: http://stackoverflow.com/comment/42412376
downvote count: 0
has body: Stumbled across a weird bug, wondering if anyone has seen this or understands why it happens? I have an ng-table with dynamic headers and dynamic rows of data that loads on a query. Before the data loads, the headers can be filtered by a checkbox that toggles the column.visible attribute, dictated by ng-show. When I set column.visible to false, the correct header properly disappears, as expected. Once I run a query, though, and data loads, the headers no longer filter EVEN THOUGH the columns of data DO filter and the ng-show variable for both is set to the exact same attribute (column.visible) using the same object (columns). Check it out: {{column.title}} {{dataEntry[column.field]}} {{ dataEntry.giftCardUrl }} Here is the columns object: $scope.columns = [ { title: 'Account Merchant Name', field: 'name', visible: true}, { title: 'GiftCard Url', field: 'giftCardUrl', visible: true }, { title: 'Account Id', field: 'accountId', visible: true }, { title: 'Egift Id', field: 'egiftId', visible: true }, { title: 'Account Number', field: 'accountNumber', visible: true }, { title: 'Product Id', field: 'productId', visible: true }, { title: 'Hidden', field: 'hidden', visible: true } ]; The headers have an ng-class attribute on them, and the data does not. Once I remove the ng-class from the div, the whole thing works, no problem AND the column sorting still works. Any ideas why ng-class would disable the first ng-show? Thanks!
score: 1
favorite count: 0
tagged with: angularjs
type: Question
tagged with: angularjs-ng-show
tagged with: ngtable
upvote count: 1
has answer: http://stackoverflow.com/a/26934120
answer count: 1
tagged with: ng-class
has title: ng-class disables ng-show for ng-table headers?
has comment: http://stackoverflow.com/comment/42398331
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/q/26956489
has answer: http://stackoverflow.com/a/26958177
has body: I am using following code to save items in sharepoint. $().SPServices({ operation: "UpdateListItems", async: false, batchCmd: "New", listName: "Share Point List", valuepairs: [["Title", fnameVal], ["LastName", lnameVal], ["Gender0", genderVal], ["DateOfBirth", birthDateVal], ["Email0", emailVal], ["City", cityVal], ["Country", countryVal]], completefunc: function (xData, Status) { alert("Data Saved! and Please check your List"); } }); It works perfectly when data is saved but when it don't save for some validation I still get the alert message. How can I check if validation failed and for which fields validation failed?
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: sharepoint
tagged with: spservices
answer count: 1
favorite count: 0
type: UnansweredQuestion
has title: How to check if validation fails while saving data in sharepoint spservice
score: 1
upvote count: 1

http://stackoverflow.com/comment/42364446
has text: Offtopic. Wow, I wonder how come you having such a well structured framework like angular ended up with a spaghetti code like this.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/26906879
type: Comment

http://stackoverflow.com/q/26834738
downvote count: 0
tagged with: ios
answer count: 1
tagged with: javascript
favorite count: 0
upvote count: 6
tagged with: cordova
score: 6
has title: Handle iOS Memory Warning with PhoneGap
has answer: http://stackoverflow.com/a/26834875
type: AnsweredQuestion
tagged with: memory
accepted answer: http://stackoverflow.com/a/26834875
type: Question
has body: I am really surprised no one has asked this yet: how do I handle iOS memory warnings with PhoneGap? Specifically, how do I call one of my JS functions when the iOS native application receives a memory warning? Thanks!

http://stackoverflow.com/a/26923235
has body: Try This :- $('.cbFee').click(function () { if ($(this).is(':checked')) { $('.grpAnnualFee').hide(); } else { $('.grpAnnualFee').show(); } }); OR $('.cbFee').click(function () { if (this.checked) { $('.grpAnnualFee').hide(); } else { $('.grpAnnualFee').show(); } }); and while dealing with checkboxes it is better to use .change() instead of .click().
type: Answer
accepted answer of: http://stackoverflow.com/q/26923228
score: 1
answers question: http://stackoverflow.com/q/26923228
upvote count: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/26899621
score: 0
has comment: http://stackoverflow.com/comment/42351981
answer count: 1
has comment: http://stackoverflow.com/comment/42352255
favorite count: 0
has body: I have seen some questions but non of the answers apply to me. I have two scripts &lt;script src="js/bootstrap.min.js"&gt;&lt;script&gt; &lt;script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"&gt;&lt;/script&gt; Depending on which order I place them the code for the other breaks. When I look at the source code I see its because the function names conflict. I need to load both. Can I somehow make the entire second library load into a separate namespace? How do I go about making all the functions load from both scripts :/ What I'm trying to do I need to call prettyPrint() from run_prettify.js what prettyPrint() does is insert &lt;ol&gt;'s and &lt;li&gt;'s and &lt;span&gt;'s and into my tag which contains a chunk of code. Then once those tags are inserting my custom css can style the chunk of code.
accepted answer: http://stackoverflow.com/a/26899757
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/42352712
tagged with: namespaces
has comment: http://stackoverflow.com/comment/42352207
has answer: http://stackoverflow.com/a/26899757
has comment: http://stackoverflow.com/comment/42352119
has title: Conflicting javascript libraries
type: AnsweredQuestion
tagged with: javascript
type: Question

http://stackoverflow.com/a/27008959
type: Answer
answers question: http://stackoverflow.com/q/26866592
has body: var obj = {}; var str = "passengerDetails[0].photo"; obj[str] = "xx"; //it should work console.log(obj); //Outputs --> Object { passengerDetails[0].photo="xx"} //Thanks a lot to CodingAnt and this answer working like a boss
score: 0

http://stackoverflow.com/q/26964332
has answer: http://stackoverflow.com/a/26964481
tagged with: javascript
score: 0
possible better answer: http://stackoverflow.com/a/26964481
has answer: http://stackoverflow.com/a/26964362
tagged with: http-redirect
tagged with: wordpress
has title: How to redirect to default/thanks with Javascript
type: AnsweredQuestion
has body: I am using contact form 7 on Wordpress on two pages (same form, two different pages) and would like to redirect to the respective .../thanks on each. Using the following javascript: on_sent_ok: "location.replace('/thanks');" It redirects to domain.com/thanks, where I would like it to go to domain.com/page1/thanks or domain.com/page2/thanks when they fill out the for on page1 or page2. How do I change the javascript to do that without having to implement two different forms?
tagged with: forms
accepted answer: http://stackoverflow.com/a/26964362
type: Question
answer count: 2

http://stackoverflow.com/comment/42485900
comment on: http://stackoverflow.com/q/26974903
score: 0
type: Comment
has text: he page at 'https://example.com/' was loaded over HTTPS, but ran insecure content from 'http://example2.com/scripts/track.js': this content should also be loaded over HTTPS.
type: QuestionComment

http://stackoverflow.com/comment/42296351
score: 5
comment on: http://stackoverflow.com/q/26868618
type: Comment
has text: I don't quite understand the problem.
type: QuestionComment

http://stackoverflow.com/comment/42309119
type: QuestionComment
comment on: http://stackoverflow.com/q/26857162
type: Comment
score: 0
has text: my series is composed of x = datetime utc,y = speed and id = sequential.I can get the maximum and minimum value of x = utc datetime but i can´t get the variable id assigned by my.i need get the id variable from the serie

http://stackoverflow.com/a/26900079
type: AcceptedAnswer
downvote count: 0
score: 4
has body: You can use addEventSource() like so: .fullCalendar( 'addEventSource', events ) Source may be an Array/URL/Function just as in the events option. Events will be immediately fetched from this source and placed on the calendar
type: Answer
accepted answer of: http://stackoverflow.com/q/26899995
answers question: http://stackoverflow.com/q/26899995
upvote count: 4

http://stackoverflow.com/q/26921674
has title: Ajax loaded comment not working
type: UnansweredQuestion
tagged with: php
has body: My php file loops out each blog post in my database and also creates the comments section. The blogs post great. When I comment on the most recent blog post, the comment does not appear but it seems to add a line as the space expands, just does not include the comment. When I comment on the first post, it works great and exactly as expected. I can't figure out how to correct it. I thought it was a matter of add a .closest to the comment-block selector but that didn't seem to do the trick. I appreciate any help or feedback! PHP/HTML <?php // retrive post include('php/config.php'); include ('php/function.php'); dbConnect(); $blog_query = mysql_query( 'SELECT * FROM Blog ORDER BY DATE DESC'); $date = date_create($row['DATE']); while($row = mysql_fetch_array($blog_query)): ?> <?php echo $row['TITLE']?> <?php echo date_format($date, 'l, F j, Y')?> <?php echo $row['CONTENT']?> Comments..... <?php // retrieve comments with post id $comment_query = mysql_query( "SELECT * FROM Comments WHERE BID = {$row['ID']} ORDER BY CID DESC LIMIT 15") or die(mysql_error()); while($comment = mysql_fetch_array($comment_query)):?> <?php echo $comment['UNAME'] ?> said.... <?php echo $comment['COMMENT']?> <?php endwhile?> Submit new comment <input type="hidden" name="BID" value="<?php echo $row['ID']?>"> Display Name: * Comment: * <?php endwhile?> Jquery/Ajax: var form = $('form'); var submit = $('#submit'); form.on('submit', function(e) { // prevent default action e.preventDefault(); // send ajax request $.ajax({ url: 'php/ajaxcomment.php', type: 'POST', cache: false, data: form.serialize(), //form serizlize data beforeSend: function(){ // change submit button value text and disabled it submit.val('Submitting...').attr('disabled', 'disabled'); }, success: function(data){ // Append with fadeIn see http://stackoverflow.com/a/978731 var item = $(data).hide().fadeIn(800); $('.comment-block').append(item); // reset form and button form.trigger('reset'); submit.val('Submit Comment').removeAttr('di…
linked to: http://stackoverflow.com/q/978708
score: 1
tagged with: forms
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26921895
linked to: http://stackoverflow.com/q/5874652
answer count: 1
favorite count: 0
tagged with: ajax

http://stackoverflow.com/comment/42454531
type: QuestionComment
has text: There may be more than one instance of external event that is dropped, so I cannot use original object. I have to make copies of it. Does it makes any difference?
comment on: http://stackoverflow.com/q/26957310
score: 0
type: Comment

http://stackoverflow.com/a/26862272
score: 6
has comment: http://stackoverflow.com/comment/116006858
has comment: http://stackoverflow.com/comment/42285568
type: Answer
upvote count: 6
has comment: http://stackoverflow.com/comment/42285678
has comment: http://stackoverflow.com/comment/42285639
has body: You can use combination of mousedown and mouseup events: $('#scrollup').on({ 'mousedown touchstart': function () { $(".sidebar-menu").animate({scrollTop: 0}, 2000); }, 'mouseup touchend': function () { $(".sidebar-menu").stop(true); } }); $('#scrolldown').on({ 'mousedown touchstart': function () { $(".sidebar-menu").animate({ scrollTop: $(".sidebar-menu")[0].scrollHeight }, 2000); }, 'mouseup touchend': function () { $(".sidebar-menu").stop(true); } }); Also added touch events. Demo: http://liveweave.com/j73xMq
accepted answer of: http://stackoverflow.com/q/26862005
has comment: http://stackoverflow.com/comment/42284988
has comment: http://stackoverflow.com/comment/42285698
answers question: http://stackoverflow.com/q/26862005
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42285764

http://stackoverflow.com/comment/42394886
score: 0
type: Comment
type: QuestionComment
has text: `unique_array.length>0` is redundant in the *else* branch since you won't get there unless `length != 0`, and it can't be negative, so at that point it must be `> 0`.
comment on: http://stackoverflow.com/q/26923655

http://stackoverflow.com/a/26876482
upvote count: 1
score: 1
downvote count: 0
has body: One extra side question, what happens if I scheduled something (based on math rather than a literal) that resulted in no delay. Would that execute in place or would it be in immediately executed async, or is that implementation defined Still asynchronous. It's just that the timer will be processed immediately once the function returns and the JavaScript engine can process events on the event loop.
type: Answer
answers question: http://stackoverflow.com/q/26876401

http://stackoverflow.com/comment/42378104
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26913589
type: Comment
has text: i have given you a stripped down version... sorry will fix it

http://stackoverflow.com/comment/42439312
comment on: http://stackoverflow.com/q/26948806
score: 0
has text: From [the documentation](http://nodejs.org/api/http.html#http_http_createserver_requestlistener): "Begin accepting connections on the specified port and hostname. If the hostname is omitted, the server will accept connections directed to **any** IPv4 address (INADDR_ANY)."
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/42260509
comment on: http://stackoverflow.com/a/26848056
score: 0
type: AnswerComment
has text: Thanks for replying. Well, this solution works if I am already on the target page (in my example the "info" page. But I would like to open the info page from another page with either href or window.open and have it simulate the click as it loads.
type: Comment

http://stackoverflow.com/a/26986665
type: Answer
score: 1
answers question: http://stackoverflow.com/q/26981558
upvote count: 1
has body: If in the view you are always deal with the function, so make sure the property you deal with is always function whether it TRUE or FALSE I've notice you was initialize Show property as/with a boolean: if(this.app.get('Wait').length === 0){ model.Show = false; // HERE IS INCORRECT }else{ model.Show = ko.observable(JSON.parse(this.model.get('Show'))); } So try to early define your Show property as a observable, then update the observable value by something like this: model.Show = ko.observable(false); // Define with default value wheter TRUE or FALSE if(this.app.get('Wait').length === 0) { model.Show(false); } else { model.Show(JSON.parse(this.model.get('Show'))); } Then, in the view you can always use it like this: // Check whether value is FALSE &lt;div data-bind="style: { float: ! Show() ? 'right' : 'none' }"&gt; // Check whether value is TRUE &lt;div data-bind="style: { float: Show() ? 'right' : 'none' }"&gt;
has comment: http://stackoverflow.com/comment/42506487
downvote count: 0

http://stackoverflow.com/comment/42301373
type: QuestionComment
comment on: http://stackoverflow.com/q/26871382
has text: using indexOf( object ) compares by reference (or by pointers) that's why it's failing.
score: 0
type: Comment

http://stackoverflow.com/comment/42535548
score: 0
type: AnswerComment
has text: @Scimonster: And if it didn't.
type: Comment
comment on: http://stackoverflow.com/a/26991020

http://stackoverflow.com/comment/42338011
type: QuestionComment
comment on: http://stackoverflow.com/q/26891821
has text: If your codepen is working then the code on your site is the issue not the .length property. No way to know without looking at your code but if it is returning 0 then you are likely targeting a parent element that has 0 span child elements. Double check element you're targeting.
score: 0
type: Comment

http://stackoverflow.com/comment/42416531
score: 0
type: Comment
comment on: http://stackoverflow.com/q/26935884
type: QuestionComment
has text: There are no client-side errors. The page is getting returned to the ajax call, as if the web method is not appended to the URL.

http://stackoverflow.com/comment/42256316
type: Comment
has text: Where is this documented with the `data-placement` attribute? I cannot find it anywhere on http://api.jqueryui.com/tooltip/
comment on: http://stackoverflow.com/a/26845272
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42367359
score: 0
type: AnswerComment
type: Comment
has text: Ty so much. This works perfectly once I adapted it to my web and my real classes. I Really apreciate it
comment on: http://stackoverflow.com/a/26908619

http://stackoverflow.com/q/26911415
has answer: http://stackoverflow.com/a/26914617
tagged with: node.js
score: 0
answer count: 1
tagged with: javascript
type: UnansweredQuestion
has body: I'm new to nodeJS javascript and I have a simple problem here. I have a Binary Search Tree (BST) in javascript. Each Node has a value, and a count. We're inserting words into the BST such that each Node represents a word. Upon insertion, if the word is already in the BST, we want to increase the count of that word, where count is a property on the Node. My problem comes when I want to display the Nodes and their counts. Displaying the counts is not working correctly. That is, the BST.prototype.showWords = function (node) is not correct. Thank you for your help and insight!!! files: bstnode.js - the 'node class' BST.js - the Binary Search Tree Class wordCount.js - reads in a text file, splits on spaces to get words, and creates nodes. I want each node to represent a word, and if that word appears multiple times, count++ on that node each time. // wordCount.js var BST = require('./bst.js'); var fs = require('fs'); var countNodes = require('./countNodes.js'); // THIS RIGHT HERE DOES NOT WORK CORRECTLY. BST.prototype.showWords = function (node) { if (node !== null) { this.inOrder(node.left); console.log(node.showCount()); this.inOrder(node.right); } }; // get the file, and get it into an array of string-words var filePath = './simpleTest.txt'; var contents = fs.readFileSync(filePath).toString(); var stringArr = contents.split(' '); var myBST = new BST(); for (var i=0; i&lt;stringArr.length; i++){ var word = stringArr[i].trim(); var aNode = myBST.find(word); console.log(aNode); if ( aNode !== null ) { // then word exists in BST already, aNode.count++; // node count ++ on that one } else { // then word dne in BST, so add it now! myBST.insert(word); } } myBST.showWords(myBST.root); // bstnode.js 'use strict'; var Node = function (data, left, right) { this.data = data; this.count = 1; this.left = left; this.right = right; }; Node.prototype.show = function () { return this.data; }; Node.prototype.show2 = function () { return (this.data + ' ' + this.count); }; module.exports …
has comment: http://stackoverflow.com/comment/42372608
has title: accessing a property of a node, javascript binary search tree
tagged with: binary-tree
tagged with: binary-search-tree
type: Question

http://stackoverflow.com/comment/42470334
type: Comment
type: QuestionComment
has text: show relevant html as well
score: 5
comment on: http://stackoverflow.com/q/26966655

http://stackoverflow.com/a/26836709
has comment: http://stackoverflow.com/comment/42239682
has body: This is one of the quirks carried over from older generations of javascript engines to not break backwards compatibility, you may "use strict"; to avoid such things as well as many others. If you have a "grown" codebase you may want to apply "use strict" only in a specific function scope to avoid breaking your application, though the better way would be to update all your code to be strict mode compatible. For a complete list of quirky behaviors disabled by the "use strict" statement see the list of changes in strict mode. (function () { "use strict"; function fn(a) { a = "changed"; console.log(arguments[0]);//initial } fn("initial"); })();
has comment: http://stackoverflow.com/comment/42239144
score: 0
has comment: http://stackoverflow.com/comment/42271641
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42239148
accepted answer of: http://stackoverflow.com/q/26836653
answers question: http://stackoverflow.com/q/26836653
type: Answer

http://stackoverflow.com/comment/42507000
type: Comment
has text: Working !! Just a little change. Instead of var objReg = GetObject(stdRegPro); I did var objReg = new ActiveXObject("WbemScripting.SWbemLocator"); Because it was throwing error "JavaScript runtime error: 'GetObject' is undefined"
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26957929

http://stackoverflow.com/comment/42293261
has text: I initially ran it default (asynchronously) and had issues with it not loading all the variables before the second call, that's why I'm now running it synchronously (sorry think I screwed up the order of that above). It works now, but takes a long time to load and has the usual hangups of not permitting click events, etc.
type: AnswerComment
comment on: http://stackoverflow.com/a/26853596
score: 0
type: Comment

http://stackoverflow.com/comment/42326509
has text: I edited my question and added some code
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26885876

http://stackoverflow.com/comment/42477192
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26945383
has text: closing curly brace removed. Thanks
type: Comment

http://stackoverflow.com/q/26940363
has comment: http://stackoverflow.com/comment/43841657
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43843222
score: 3
has comment: http://stackoverflow.com/comment/43763914
upvote count: 3
tagged with: rsvp-promise
type: Question
tagged with: ember-data
accepted answer: http://stackoverflow.com/a/26965129
downvote count: 0
tagged with: javascript
answer count: 1
favorite count: 0
has body: Edit 11/16/14: Version Information DEBUG: Ember : 1.7.0 ember-1.7.0.js:14463 DEBUG: Ember Data : 1.0.0-beta.10+canary.30d6bf849b ember-1.7.0.js:14463 DEBUG: Handlebars : 1.1.2 ember-1.7.0.js:14463 DEBUG: jQuery : 1.10.2 I'm beating my head against a wall trying to do something that I think should be fairly straightforward with ember and ember-data, but I haven't had any luck so far. Essentially, I want to use server data to populate a &lt;select&gt; dropdown menu. When the form is submitted, a model should be created based on the data the user chooses to select. The model is then saved with ember data and forwarded to the server with the following format: { "File": { "fileName":"the_name.txt", "filePath":"/the/path", "typeId": 13, "versionId": 2 } } The problem is, the typeId and versionId are left out when the model relationship is defined as async like so: App.File = DS.Model.extend({ type: DS.belongsTo('type', {async: true}), version: DS.belongsTo('version', {async: true}), fileName: DS.attr('string'), filePath: DS.attr('string') }); The part that is confusing me, and probably where my mistakes lie, is the controller: App.FilesNewController = Ember.ObjectController.extend({ needs: ['files'], uploadError: false, // These properties will be given by the binding in the view to the //&lt;select&gt; inputs. selectedType: null, selectedVersion: null, files: Ember.computed.alias('controllers.files'), actions: { createFile: function() { this.createFileHelper(); } }, createFileHelper: function() { var selectedType = this.get('selectedType'); var selectedVersion = this.get('selectedVersion'); var file = this.store.createRecord('file', { fileName: 'the_name.txt', filePath: '/the/path' }); var gotDependencies = function(values) { ////////////////////////////////////// // This only works when async: false file.set('type', values[0]) .set('version', values[1]); ////////////////////////////////////// var onSuccess = function() { this.transitionToRoute('files'); }.bind(this); va…
tagged with: ember.js
has title: Ember Data belongsTo async relationship omitted from createRecord() save() serialization
has answer: http://stackoverflow.com/a/26965129

http://stackoverflow.com/a/26935285
type: Answer
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/42416192
has comment: http://stackoverflow.com/comment/42415625
has comment: http://stackoverflow.com/comment/42416100
has comment: http://stackoverflow.com/comment/42415964
has body: There are two problems: The first is that you're overwriting the onclick on addGuest on every loop, so only the last assignment survives. So if we fix the second problem (below), you'll still only show the last set of fields. Probably, we want the handler assigned once, and have it reveal the "next" set of fields. The second problem is that the function you're assigning to onclick has an enduring reference to the guest variable, not a copy of it as of when the function was created. So later, when the function gets called, it sees the value guest has after the end of the for loop. Your main choices for solving that are a builder function, and Function#bind as described under this question. But since we don't need or want the loop, it doesn't matter. Instead, I'd suggest a variable telling you what the next set of fields to reveal is, and then simply one function that uses it: var extraGuests = [guestThree, guestFour, guestFive, guestSix]; var nextGuest = 0; addGuest.onclick = function() { var guest = extraGuests[nextGuest]; if (guest) { ++nextGuest; guest.showFields(); } };
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42416166
accepted answer of: http://stackoverflow.com/q/26935167
answers question: http://stackoverflow.com/q/26935167

http://stackoverflow.com/q/26860449
type: Question
tagged with: jquery-ui
has answer: http://stackoverflow.com/a/26863263
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26896059
has answer: http://stackoverflow.com/a/26896059
has comment: http://stackoverflow.com/comment/42282269
answer count: 2
has title: Fading classes into each other by multiple using of switchClass
downvote count: 0
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/26863263
has comment: http://stackoverflow.com/comment/42283084
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42283575
score: 1
upvote count: 1
tagged with: fade
has body: I want a result like this: Fade border-color of #mydiv from .color1 to .color2, .color2 to .color3, .color3 to .color4 and then .color4 to .color1. Why shouldn't the following code work? $( "#mydiv" ).switchClass( "color1", "color2", 1000 ).switchClass( "color2", "color3", 1000 ).switchClass( "color3", "color4", 1000 ).switchClass( "color4", "color1", 1000 ); Dear guys, also let me know if that's easier to get it done using CSS transition.

http://stackoverflow.com/a/26898499
has body: Nope. According to the railroad diagram for numbers at JSON.org, numbers with fractional values must have digits before the decimal point:
downvote count: 0
has comment: http://stackoverflow.com/comment/42358136
answers question: http://stackoverflow.com/q/26898431
has comment: http://stackoverflow.com/comment/42390529
has comment: http://stackoverflow.com/comment/76257237
type: Answer
score: 14
has comment: http://stackoverflow.com/comment/42390004
upvote count: 14
has comment: http://stackoverflow.com/comment/92813155

http://stackoverflow.com/a/27117438
has comment: http://stackoverflow.com/comment/42849802
type: Answer
has comment: http://stackoverflow.com/comment/42875930
answers question: http://stackoverflow.com/q/26957080
has comment: http://stackoverflow.com/comment/42851414
score: 0
has body: Working Fiddle The issue with timer, you should clear-time-interval before move. Your global variable TimerWalk with clearInterval(TimerWalk); should be useful. Here is the code block $('#ios-left').mousedown(function () { clearInterval(TimerWalk); TimerWalk = setInterval(function () { processWalk('left'); }, 100); }).mouseup(function () { $div.stop(); clearInterval(TimerWalk); }).mouse2touch(); $('#ios-right').mousedown(function () { clearInterval(TimerWalk); TimerWalk = setInterval(function () { processWalk('right'); }, 100); }).mouseup(function () { $div.stop(); clearInterval(TimerWalk); }).mouse2touch(); This is only fix for proper movement, you may need to address other issues.
has comment: http://stackoverflow.com/comment/42840655

http://stackoverflow.com/q/26876376
tagged with: jquery
tagged with: ajax
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: OUTLINE: I have a products page with a working jQuery filtering system based on products class names. I have provided a basic example of my code below: // PRODUCTS PAGE FUNCTIONS function filterAll() { $('.download').show("slow"); $('.ourprod').show("slow"); $('.accessories').show("slow"); $('.club').show("slow"); } function filterClubs() { $('.download').hide("slow"); $('.ourprod').hide("slow"); $('.accessories').hide("slow"); $('.club').show("slow"); } function filterProds() { $('.download').hide("slow"); $('.club').hide("slow"); $('.accessories').hide("slow"); $('.ourprod').show("slow"); } function filterAccess() { $('.download').hide("slow"); $('.club').hide("slow"); $('.ourprod').hide("slow"); $('.accessories').show("slow"); } function filterVideos() { $('.accessories').hide("slow"); $('.club').hide("slow"); $('.ourprod').hide("slow"); $('.download').show("slow"); } //HOMEPAGE FUNCTION function loadProductsPage() { window.location = 'products.php'; } // PRODUCTS PAGE EVENTS $('#filterall').click(function() { filterAll(); }); $('#filterclubs').click(function() { filterClubs(); }); $('#filterprods').click(function() { filterProds(); }); $('#filteraccessories').click(function() { filterAccess(); }); $('#filtervideos').click(function() { filterVideos(); }); .box { background: red; width: 100px; height: 100px float: left; } .filter a { cursor: pointer; } All Clubs Our Products Accessories Videos CLUB - $89.99 PRODUCT - $39.99 Download - $9.95 Accessories - $XX.XX PROBLEM: On the homepage I have links that I would like to direct to the products page BUT with the corresponding filter applied after the page loads. Here is the homepage HTML, which is linked to the above scripts: Training Clubs Training Videos Accessories I am new to jQuery/Javascript so any other advice to clean up my scripts would be appreciated!
has answer: http://stackoverflow.com/a/26876464
type: Question
tagged with: javascript
has title: Executing a JS function on page load, based on user input from previous page
score: 0
answer count: 1

http://stackoverflow.com/comment/42344963
type: Comment
has text: How can I do so that the footer was after the content? Like position:relative, only when page is not full footer should be at the end..
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26895742

http://stackoverflow.com/q/26956704
has title: How to keep Bootstrap tooltip after changing element?
type: AnsweredQuestion
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/42452841
type: Question
accepted answer: http://stackoverflow.com/a/26956937
tagged with: javascript
has body: I have this part of my JavaScript (jQuery code) instance.on(dragLinks, "click", function(e) { var s = instance.toggleDraggable(this.getAttribute("rel")); this.innerHTML = (s ? ' ' : ' '); jsPlumbUtil.consume(e); }); Line that starts with 'this.innerHTML' make changes on elements (icons) after clicking on them. As you can see, it is bootstrap 3.0 glyphicons. I have tooltip on them $(".glyphicon-remove-sign").tooltip({ placement: 'bottom', }); $(".glyphicon-ok-sign").tooltip({ placement: 'bottom', }); After loading of application the glyphicon-remove-sign icon is first shown. The Bootstrap 3.0 tooltip is also shown correctly. But, the problem is that after clicking on them, there is no more Bootstrap 3.0 tooltip effect, only poor HTML tooltip. How to resolve this?
has comment: http://stackoverflow.com/comment/42452675
score: 0
has answer: http://stackoverflow.com/a/26956937
answer count: 1
tagged with: jquery

sequelize.js
type: Tag
tag name: sequelize.js
tags question: http://stackoverflow.com/q/26888457

http://stackoverflow.com/comment/42420999
comment on: http://stackoverflow.com/a/26934815
type: Comment
has text: Thanks again. I realize HTTP_REFERER is not really reliable but we have control over any referring pages/domains/etc at this point since this is just for some testing. Marc B's answer worked, thanks for the help and patience.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42314476
comment on: http://stackoverflow.com/a/26872636
type: AnswerComment
type: Comment
score: 0
has text: Hi Jukka, I already clear cache, delete history, but still get the same error. In my page source, I still can see my `DOCTYPE` already change to `Strict`. However, I am still getting the same error when I `OnClick` (in master page(site.master)). Whole page will bank when hit this error. Is this anything wrong with the `ContentPlaceHolder` ? My html code in my question is on master page, whish is `Site.master`, but the error I get in on my `home.aspx` page, which is as follow : HTML1527: DOCTYPE expected. The shortest valid doctype is " ". Home.aspx, line 1 character 1

http://stackoverflow.com/q/26883312
tagged with: angularjs
has answer: http://stackoverflow.com/a/32504211
type: AnsweredQuestion
has title: How to force mobile browsers to pull out numeric keyboard for input type="text"?
has answer: http://stackoverflow.com/a/26883553
has body: In my angularjs app, i have two input fields with type="text", pls see the plunkr here. The problem is that the currency formatting is not possible for input type="number". So it it possible to bring up Numeric keyborad for mobile devices when the focus move to input type="text"? Please help
type: Question
score: 8
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26883430
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/26883430
accepted answer: http://stackoverflow.com/a/26883553
upvote count: 8
answer count: 3
tagged with: android
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/26937000
has body: I have PHP form where user can insert a movie name in the textbox, then by clicking a button "search", a new window is opened showing list of movies contain the word that user has inserted in the textbox. For example the image below shows list of movies contain the word "froz": Now, if user click on any of movie names in the new window (for example "Frozen"), this page will be shown: As can be seen in the image, the window does not have the back in the browser. My question is how can I enable user to return to the previous page (the page which shows list of movies)? This is the code when user click on "search" button which opens a new window (showing list of movies): $('#btnSearch').on('click', function (e) { window.textbox = $('#q').val(); window.searchType = $('input:radio[name=source]:checked').val(); popupCenter("movielist.php","_blank","400","400"); }); and this is the code where I defined the url for when user click on movie name. &lt;td&gt;&lt;a href="http://www.imdb.com/title/&lt;?php echo urlencode($row['ImdbId']); ?&gt;"&gt;&lt;?php echo $row['movieName']; ?&gt;&lt;/a&gt;&lt;/td&gt; All ideas are highly appreciated,
accepted answer: http://stackoverflow.com/a/26937104
linked to: http://stackoverflow.com/q/10990494
answer count: 1
has comment: http://stackoverflow.com/comment/42418259
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has title: enable user to return previous page in new window
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26937104
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/42418228
has comment: http://stackoverflow.com/comment/42475586
score: 0

http://stackoverflow.com/comment/42457967
type: AnswerComment
score: 0
type: Comment
has text: Thanks! This worked. Although, this was not a part of my question as I didn't mention this but now when I experience that, I see when I hover on the sub menu it hides again, how can I fix that? I mean I want to click on the sub menu items which show after hover, but they hide again when I hover on themselves.
comment on: http://stackoverflow.com/a/26959395

http://stackoverflow.com/comment/42412248
has text: Thanks for your feedback, greatly appreciated. Unfortunately not the answer :-( Still got the same issue but I have amended the code above to reflect my latest attempts.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26933559
type: Comment

http://stackoverflow.com/comment/45634079
score: 0
has text: @kindasimple thanks for your answer. problem is that when i navigate (with the code snippet) to the last page, it is not the cached version. `PUSH.id` and `PUSH.previousId` are also the same (when i `console.log` them). for example, i navigate from _page A_ to _page B_. on _page B_ i change the background color with jquery and a button, then i navigate back to _page A_ and back to _page B_ (with your code snippet), but the background of _page B_ is not changed anymore...
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26832590

http://stackoverflow.com/comment/118671785
comment on: http://stackoverflow.com/a/67136959
score: 0
type: AnswerComment
has text: Please add some context to your answer. It will help other users to understand your approach easily.
type: Comment

http://stackoverflow.com/comment/42371756
score: 1
has text: id's are just strings, you are free to use any word you want.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26911082

http://stackoverflow.com/comment/42303293
type: QuestionComment
score: 0
has text: @mdml why does it not work if i use "div.first.div.content" instead ?
type: Comment
comment on: http://stackoverflow.com/q/26870638

http://stackoverflow.com/a/26892689
answers question: http://stackoverflow.com/q/26891821
type: Answer
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26891821
has body: And this is why I hate Javascript. Wrapping it in a doc ready function fixed everything. $(document).ready(function(){ var getSpans = []; $('#canvas #head #hero span').parent() .each(function(){ getSpans.push({ parent: this, spanCount: $(this).children('span').length }); }); console.log(getSpans.length); });

3d
tags question: http://stackoverflow.com/q/26913970
tags question: http://stackoverflow.com/q/26859793
tags question: http://stackoverflow.com/q/26935288
type: Tag
tags question: http://stackoverflow.com/q/26869963
tag name: 3d
tags question: http://stackoverflow.com/q/26848459
tags question: http://stackoverflow.com/q/26907686
tags question: http://stackoverflow.com/q/26900901
tags question: http://stackoverflow.com/q/26846031

http://stackoverflow.com/comment/53080592
type: AnswerComment
type: Comment
has text: function myHandler1(eventArgs) {//E1b eventArgs.binding.getDataAsync({ coerciontype: "matrix" }, function (asyncResult) { //NOW DO OUTPUT OR ERROR if (asyncResult.status === "failed") { writeToPage('Error E1b myHandler1: Event tracker ' + asyncResult.error.message, 3); } else { writeToPage('Event tracker, bound data: ' + asyncResult.value, 1); } }); }
comment on: http://stackoverflow.com/a/32118147
score: 0

selectors-api
tag name: selectors-api
type: Tag
tags question: http://stackoverflow.com/q/26982915

http://stackoverflow.com/q/26981774
has comment: http://stackoverflow.com/comment/53080617
has title: Integrating Dropzone.js into a html form with other form fields
has answer: http://stackoverflow.com/a/34904641
tagged with: file
linked to: http://stackoverflow.com/q/555928
has body: I would like to add dropzonejs to a form with other elements. I found this sample and followed the instructions, unfortunately the whole from becomes a dropzonejs drop zone: https://github.com/enyo/dropzone/wiki/Combine-normal-form-with-Dropzone Here is my code: Address Line One I have also followed the follwoing post and the whole from still remains a drop zone: Integrating dropzone.js into existing html form with other fields Do i have to have a from with in a form? Thanks
type: Question
tagged with: javascript
score: 4
upvote count: 4
linked to: http://stackoverflow.com/q/17872417
has comment: http://stackoverflow.com/comment/45750412
answer count: 2
tagged with: upload
downvote count: 0
has answer: http://stackoverflow.com/a/27081105
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/26946054
tagged with: django
tagged with: python
accepted answer: http://stackoverflow.com/a/27033240
type: AnsweredQuestion
upvote count: 3
has comment: http://stackoverflow.com/comment/42434499
has comment: http://stackoverflow.com/comment/42435787
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: Please help me, I try to create graphs (in django) using jQuery. There is example : http://jsfiddle.net/eM2Mg/ But when I try to send the values with variable, jQuery was crashed, please explain me. There is my code : &lt;script&gt; var values = "{{ values }}"; var values2 = values.replace(/enter_key/g, '\\n') values = values2.replace(/&amp;quot;/g, '"') g = new Dygraph(document.getElementById("graph"), values, { legend: 'always', animatedZooms: true, title: 'dygraphs chart template' }); &lt;/script&gt; Values was my string, when I alert(values) I see the same format for graph: http://www.ex.ua/615449293535 Help me! thanks
has answer: http://stackoverflow.com/a/27033240
score: 3
has comment: http://stackoverflow.com/comment/42434553
answer count: 1
favorite count: 0
has title: Problems with using jQuery and variable

http://stackoverflow.com/comment/42403146
score: 0
type: QuestionComment
type: Comment
has text: you need to `json_decode()` your post-variable in order you send a json-string to your php-file
comment on: http://stackoverflow.com/q/26928713

http://stackoverflow.com/comment/42424356
comment on: http://stackoverflow.com/q/26940028
has text: you might try this example: http://jsfiddle.net/RRgSW/
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42327068
comment on: http://stackoverflow.com/q/26886228
type: Comment
type: QuestionComment
has text: possible duplicate of [Prevent form to repost on refresh](http://stackoverflow.com/questions/3013914/prevent-form-to-repost-on-refresh)
score: 2

http://stackoverflow.com/comment/42431280
has text: You probably actually need to fix this server-side. Based on a comment below, I guess you're using Joomla? You should update your question (and tags) to reflect this if so, as it will hopefully attract the right sort of attention
comment on: http://stackoverflow.com/q/26944105
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/26894747
type: Question
score: 0
has body: My overall goal is to select all elements in my document EXCLUDING elements in a specified class. Here's my code so far: var x = document.querySelectorAll(":not(.myParameter)"); I want myParameter to be passed into a function so that I could select every element NOT in a ".cars" class for instance or whatever the user defines as myParameter. I think I'm very close, but might have my quotes wrong. Any ideas? Any help is greatly appreciated!
accepted answer: http://stackoverflow.com/a/26894778
answer count: 1
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26894778
type: AnsweredQuestion
has title: Using a function parameter inside :not()

http://stackoverflow.com/comment/42445781
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26952574
has text: That came off as a little rude dude. I'm not trying to say the angular team is dumb, I'm just trying to understand why this is a good place to put something on the global namespace
score: 0

http://stackoverflow.com/comment/42380696
type: Comment
type: QuestionComment
has text: __ID must be unique__.
comment on: http://stackoverflow.com/q/26916036
score: 2

http://stackoverflow.com/comment/42539628
type: QuestionComment
has text: Ah, very nice, thanks for sharing =)
type: Comment
comment on: http://stackoverflow.com/q/26930305
score: 0

http://stackoverflow.com/a/26865780
upvote count: 1
has body: You can use a full sized div with a transparent grey background and a z-index higher than the rest of your site: #cover { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(200, 200, 200, 0.8); z-index: 1; } and then on the zone you want to be fully visible you set an even higher z-index: #other_content{ z-index: 2; position: absolute; top: 50px; left: 100px; border: red medium solid; } like in this fiddle
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/26865667
score: 1

http://stackoverflow.com/q/26855798
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/8771690
tagged with: google-maps
tagged with: google-maps-markers
upvote count: 1
has answer: http://stackoverflow.com/a/26856538
accepted answer: http://stackoverflow.com/a/26856538
answer count: 1
tagged with: jquery
favorite count: 0
has body: I am using opencart to develop http://www.goskitz.com.au/index.php?route=information/dealers In the dealers.php file there is a function called query() which will search postcodes from the database to get the store locations results and I outputted to XML format. For example, if I typed 3000 and select Melbourne, the xml output would be: function query(): public function query(){ // the query coding part is removed // Output to XML $dom = new DOMDocument("1.0"); $node = $dom-&gt;createElement("markers"); $parnode = $dom-&gt;appendChild($node); header("Content-type: text/xml"); // Iterate through the rows, adding XML nodes for each foreach($result as $key =&gt; $li){ // ADD TO XML DOCUMENT NODE $node = $dom-&gt;createElement("marker"); $newnode = $parnode-&gt;appendChild($node); $newnode-&gt;setAttribute("name",$li['name']); $newnode-&gt;setAttribute("address", $li['address']); $newnode-&gt;setAttribute("lat", $li['lat']); $newnode-&gt;setAttribute("lng", $li['lng']); $newnode-&gt;setAttribute("distance", $li['distance']); } echo $dom-&gt;saveXML(); } } Output &lt;markers&gt;&lt;marker name="Harvey Norman BIG BUYS" address="Shop 9&amp;amp;11 Ground Level Springvale Homemaker Centre 917 Princes Highway Springval VIC 3171" lat="-37.927456" lng="145.143845" distance="19.74128375361586"&gt;&lt;/marker&gt;....blahblah... &lt;markers&gt; Then I found the downloadurl function is not working, no matter what url I put, nothing happens. Why would that happen? Any idea would be grateful. I have paste the javascript in http://pastebin.com/yu0bX3vz
tagged with: php
has title: downloadUrl function not working for creating google map locator with opencart
type: AnsweredQuestion
downvote count: 0
score: 1

http://stackoverflow.com/q/26876712
tagged with: javascript
has body: I currently have a JavaScript function that uses getElementsByClassName("apples") to find everything in the class apples. My problem is that I can't seem to find a way to fetch every element not in the class apples. Is there any helper functions in JavaScript that might allow me to do this? Thanks for the help!
downvote count: 0
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/26876729
has title: Get all elements except ones from a certain class?
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/26876729
score: 1

http://stackoverflow.com/comment/42413592
type: Comment
type: QuestionComment
has text: Any special reason you can't keep all your variables and math within the event handler?
comment on: http://stackoverflow.com/q/26934508
score: 0

http://stackoverflow.com/comment/42355914
type: AnswerComment
has text: This is not what the OP wants. I imagine his request is for tracking purposes.
type: Comment
comment on: http://stackoverflow.com/a/26901989
score: 1

http://stackoverflow.com/a/26946878
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/42437899
has body: Nesting two sets of must queries inside a should query will meet your requirements, see bool for more information: curl -XGET 'http://localhost:9200/people/person/_search?pretty' -d '{ "query": { "bool": { "should": [ {"bool": { "must": [ {"match": { "sex" : "male" }}, {"match": { "dob" : "2000-11-14" }}, {"match": { "phone" : "1234 67889" }} ] } }, {"bool": { "must": [ {"match": { "fname" : "bob" }}, {"match": { "dob" : "2000-11-14" }}, {"match": { "lname" : "smith" }} ] } } ] } } }' Also I need to query or filter case-insensitive. the standard analyzer will index the data in lowercase - the match query will apply the same analyzer to your search term. Also - it would be a good idea to store you DOB as a date.
has comment: http://stackoverflow.com/comment/42439013
answers question: http://stackoverflow.com/q/26942721
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26942721
type: Answer

http://stackoverflow.com/q/26985630
type: UnansweredQuestion
score: 6
tagged with: v8
has title: how to create REAL global object in v8?
tagged with: google-chrome
type: Question
has body: I used v8 engine to create a program , it can run JS codes like : alert('test'); // alert function is created in C++ and set global to v8 context. so it can be run. window.name = 'aa'; // window object is exported from C++ to v8 enviroment. But, if I set property to window object like : window.name ='aa'; then, I visit it : alert(name); // --------> this caused error that name is undefined... In Chrome , we can set property , anything string for the window property name . it runs fine. So how can I implement that ? it seems that the window is real global in JS context. My code : Isolate* isolate = Isolate::GetCurrent(); Isolate::Scope isolate_scope(isolate); HandleScope handle_scope(isolate); Handle<ObjectTemplate> global = ObjectTemplate::New(isolate); v8::Handle<v8::FunctionTemplate> log_ft = v8::FunctionTemplate::New(isolate, log_Callback); log_ft->InstanceTemplate()->SetInternalFieldCount(1); global->Set(isolate, "alert", log_ft); Handle<Context> context = Context::New(isolate, NULL, global); Context::Scope context_scope(context); // set global objects and functions Local<Object> obj( Object::New(isolate)); context->Global()->Set( String::NewFromUtf8(isolate, "window"), obj ); runJSCode(context, (char*)"window.name =33; alert(name);"); std::cout << "********* v8 executed finished !! ********** \n"; return 0;
tagged with: javascript
has answer: http://stackoverflow.com/a/34464295
has answer: http://stackoverflow.com/a/32473577
answer count: 2
tagged with: window
downvote count: 0
favorite count: 0
tagged with: scope
upvote count: 6

http://stackoverflow.com/comment/42452070
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26947835
has text: no, system considers 'tab close' and 'browser close' differently. i want two different types of event handler in javascript.
score: 0

http://stackoverflow.com/comment/42430074
score: 1
has text: you need to define session_start() in your DbManipulate1.php.
comment on: http://stackoverflow.com/q/26943500
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42269810
type: QuestionComment
has text: Just a note, you can't do `return response;` in your `processIT` function. AJAX is *asynchronous*, which means it runs in the background and calls its callback whenever it's ready. You can't *return* from an AJAX call. Also, why do you have `$(function () {` inside `processIT`?
score: 1
comment on: http://stackoverflow.com/q/26853385
type: Comment

http://stackoverflow.com/q/26942780
has answer: http://stackoverflow.com/a/26942813
score: 1
upvote count: 1
type: Question
answer count: 2
tagged with: javascript
downvote count: 0
has title: Make a div become visible after scrolling past an anchor point in another div?
tagged with: dom-events
favorite count: 0
has body: Is it possible to make a div become visible after scrolling past an anchor (after the anchor overflows or can no longer be seen in the scrollable div) using JavaScript? This is a fully illustrated website. There is an image (in a div) that I want to become visible in the navigation bar to highlight the active link if the user chooses to scroll to a section of text versus use the anchor tag to jump there. Once they scroll to a section, that part is highlighted (image becomes visible) in the navigation bar. "hideaway" and "hideaway2" are the divs that become visible when "#part1" and "#part2" are clicked in the nav bar. The one that is no longer active displays none (display='none'). I want to be able to scroll past the "#part2" anchor ("part2") and have div id "hideaway2" become visible. I am not much of an expert on JavaScript. Here is my html code for this part:
has answer: http://stackoverflow.com/a/26943229
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/26942813
accepted answer: http://stackoverflow.com/a/26943229
type: AnsweredQuestion

http://stackoverflow.com/q/26986218
accepted answer: http://stackoverflow.com/a/26986346
type: AnsweredQuestion
tagged with: asp.net-mvc
has title: accessing ajax.actionlink "text to display"
type: Question
has body: if I have an ajax.actionlink @Ajax.ActionLink("Add Last Name", // &lt;-- Text to display "AddTimeSeriesData", // &lt;-- Action Method Name etc.... @id = "link") how can I access the "text to display" (the link text) in javascript? I tried $('#link').innerHTML but that didn't work and doesn't seem right... I just tried console.log($('#link')); and under innerHTML and innerText I got the same value I'm looking for (the link text) but when I try to do console.log($('#link').innerHTML); //or innerText I get "undefined"
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/26986346

http://stackoverflow.com/a/26920912
score: 0
answers question: http://stackoverflow.com/q/26918387
type: Answer
has body: Gulp Shell passes files not the output of the commands it runs. A quick and dirty solution — that is not windows friendly nor gulp based — would be to simply pass the output of the shell command to a file within the command itself: return gulp.src('.') .pipe(shell([ 'composer install --prefer-source &gt; composer-log.txt' ])); This is obviously only suitable for *nix environments, and doesn't scale well for capturing the output of multiple commands (although you could just append the output from all those commands to the same file).

http://stackoverflow.com/q/26869270
downvote count: 4
has comment: http://stackoverflow.com/comment/42297829
has body: I'm trying to create a web site using bootsrap and mvc4 but unfortunatly not only bootstrap files but any js file or css file i include in the layout file doesnt act properly. I dont know whats going on can some on suggest me what to do? i have created a bundle bundles.Add(new ScriptBundle("~/bundles/new").Include("~/Content/bootstrap.js")); bundles.Add(new StyleBundle("~/Content/css1").Include("~/Content/bootstrap.css")); and i have added them to the lay out @Scripts.Render("~/bundles/new") @Styles.Render("~/Content/css1") I,m trying to add navigation bar and and a carousel there are not working properly
favorite count: 0
has comment: http://stackoverflow.com/comment/42297679
has answer: http://stackoverflow.com/a/26870041
score: -4
tagged with: css
has comment: http://stackoverflow.com/comment/42298485
tagged with: asp.net-mvc-4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42298327
has comment: http://stackoverflow.com/comment/42297685
has comment: http://stackoverflow.com/comment/42299327
accepted answer: http://stackoverflow.com/a/26870041
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: visual-studio-2012
has comment: http://stackoverflow.com/comment/42298882
has title: Why arent javascript , jquery and css files working properly in MVC4?
has comment: http://stackoverflow.com/comment/42298209
has comment: http://stackoverflow.com/comment/42298039

http://stackoverflow.com/comment/42525228
has text: I have fixed this using custom jQuery code
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26989779

http://stackoverflow.com/q/26903231
answer count: 2
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
has body: i have a selection drop down in my popup.when we add more list of items it goes out side the popup while showing list of items here is the code i have used Subject Select Subject
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26903301
has comment: http://stackoverflow.com/comment/42358244
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/42357976
has title: how to enable scroll inside the drop down
has answer: http://stackoverflow.com/a/26903274
has comment: http://stackoverflow.com/comment/42357945

http://stackoverflow.com/comment/42305791
type: AnswerComment
has text: Ohhhh i seee what you're doing. You're getting xul elements returned. Your scope is wrong. Access the tab content by doing `window.gBrowser.contentWindow.document.getElementsByBlassName`
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26857634

http://stackoverflow.com/q/26876281
tagged with: meteor
has answer: http://stackoverflow.com/a/26882042
tagged with: calendar
type: AnsweredQuestion
has body: I'm trying to implement a simple POST call in meteor.js to the Google Calendar API, and I'm stuck. My request looks like this: var id = Meteor.http.post("https://www.googleapis.com/calendar/v3/calendars/", { 'headers' : { 'Authorization': auth, // auth = "Bearer " + Meteor.user().services.google.accessToken 'Content-Type': 'application/json' }, 'parameters': {}, 'body' : { 'title': "Calendar Title", } }); and I get the following error: Error: failed [400] { "error": { "errors": [{ "domain": "global", "reason": "required", "message": "Missing title." }], "code": 400, "message": "Missing title." } } Any ideas?
has title: Google Calendar REST API errors
accepted answer: http://stackoverflow.com/a/26882042
type: Question
tagged with: api
answer count: 1
tagged with: javascript
score: 0
tagged with: rest

http://stackoverflow.com/comment/42497664
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/26981680
type: Comment
has text: I am using the rasterize.js example and replacing the zoom option with my own. phantomjs rasterize.js http://mywebsite.com c:\foo.pdf "letter" false

http://stackoverflow.com/q/26856868
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/26856908
possible better answer: http://stackoverflow.com/a/26856918
has answer: http://stackoverflow.com/a/26856918
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has body: this is kind of a weird question to put into words so apologies. I am making a website with a timeline that has multiple data points. On click, each datapoint will open a unique popout window with content corresponding to the datapoint. If I were to name each datapoint numerically, like ".datapoint-1" ".datapoint-2" and so-fourth, could I write a jQuery loop that would replace just making an individual click function for each datapoint and the corresponding popout window? Right now I'm just showing and hiding divs (I know a lightbox would be an alternative method but I'm doing this for prototyping/learning experience) Here's an example of the code for just the first popout window: $('.datapoint').click(function(){ $(".popout").toggle(); }); Thanks in advance!
favorite count: 0
upvote count: 2
has title: jQuery: Loop to repeat a toggle show/hide for multiple classes named numerically
tagged with: css
has answer: http://stackoverflow.com/a/26856908
type: AnsweredQuestion
score: 2
type: Question
downvote count: 0

http://stackoverflow.com/a/26877601
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/26877541
has comment: http://stackoverflow.com/comment/42641431
upvote count: 1
has body: Your looking for the require option to browserify: This option will include the module or file as part of the bundle even if it isn't referenced in the entry app. It should also expose the said module to your HTML page via a global require() function. From the docs: b.require(file, opts) Make file available from outside the bundle with require(file). The file param is anything that can be resolved by require.resolve(). file can also be a stream, but you should also use opts.basedir so that relative requires will be resolvable. If file is an array, each item in file will be required. In file array form, you can use a string or object for each item. Object items should have a file property and the rest of the parameters will be used for the opts. Use the expose property of opts to specify a custom dependency name. require('./vendor/angular/angular.js', {expose: 'angular'}) enables require('angular')
has comment: http://stackoverflow.com/comment/42674323
score: 1
accepted answer of: http://stackoverflow.com/q/26877541
has comment: http://stackoverflow.com/comment/42674215

http://stackoverflow.com/comment/42331956
comment on: http://stackoverflow.com/a/26888220
type: AnswerComment
score: 0
type: Comment
has text: Yeah that should work too, default it by display:none and upon ready show it.

http://stackoverflow.com/comment/42270852
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/26853999
has text: As an aside: you shouldn't edit your question with code changes. It makes your question and the answers useless to anyone else.

http://stackoverflow.com/a/26937711
accepted answer of: http://stackoverflow.com/q/26937329
answers question: http://stackoverflow.com/q/26937329
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/42420201
has comment: http://stackoverflow.com/comment/42419879
downvote count: 0
has body: When you first call navigationMenu.prototype.reset, I'm guessing ulElement is a DOM element, but when you call it recursively, you are passing it subMenu, which is a jQuery object. That will be a problem for the following line: var listItems = $(ulElement.children); Try changing the following line of code: navigationMenu.prototype.reset(subMenu, (3 - colorIndex), colors); To: navigationMenu.prototype.reset(subMenu[0], (3 - colorIndex), colors); I prefer to always prefix variables that refer to jQuery objects with "$" to keep them straight. You could also use this inside the functions given to .each(). So instead of: children.each(function(index) { var tag = $(children[index]).prop('tagName'); You could have: children.each(function() { var $child = $(this), tag = $child.prop('tagName'); You could also consider using the jQuery .children() method, instead of the children DOM element property
score: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/42256057
type: QuestionComment
has text: Don't know the answer but it was fun to play with for a couple of minutes. Noticed the numbers don't always add to 100 though - as you move along the bottom it goes from 4/86/10 to 4/86/12 then to 4/84/12
comment on: http://stackoverflow.com/q/26843740
score: 0
type: Comment

http://stackoverflow.com/comment/42505813
type: Comment
type: QuestionComment
has text: I want to take out the responseJson out from setKsonSer() to an outside JavaScript Function name Load().
comment on: http://stackoverflow.com/q/26969352
score: 0

http://stackoverflow.com/a/26982382
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: I would just use a simple path and change its size and position with transforms: var svg = d3.select('body').append('svg').attr({width: 400, height: 400}); var dropPath = 'M 243.44676,222.01677 C 243.44676,288.9638 189.17548,343.23508 122.22845,343.23508 C 55.281426,343.23508 1.0101458,288.9638 1.0101458,222.01677 C 1.0101458,155.06975 40.150976,142.95572 122.22845,0.79337431 C 203.60619,141.74374 243.44676,155.06975 243.44676,222.01677 z'; var data = d3.range(300).map(function(){ return Math.random()/3; }); svg.selectAll('g.drop').data(data) .enter().append('g') .attr({ 'class': 'drop', transform: function(d, i){ return 'translate('+[Math.random()*300, Math.random()*300]+') scale('+d+')'; } }) .append('path').attr({d: dropPath}) svg g.drop path{ stroke: blue; stroke-width': 3px; fill: skyblue; fill-opacity: 0.3; } &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js"&gt;&lt;/script&gt;
accepted answer of: http://stackoverflow.com/q/26981020
answers question: http://stackoverflow.com/q/26981020
score: 4
upvote count: 4
has comment: http://stackoverflow.com/comment/42499278

http://stackoverflow.com/q/26909500
has comment: http://stackoverflow.com/comment/42378150
tagged with: telerik
has comment: http://stackoverflow.com/comment/42368763
has title: Kendo UI - Draw a circle inside Gauge instead of Slidebar
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42369209
has comment: http://stackoverflow.com/comment/42369461
has comment: http://stackoverflow.com/comment/42369888
has comment: http://stackoverflow.com/comment/42368684
has comment: http://stackoverflow.com/comment/42368939
tagged with: javascript
type: Question
score: 0
has body: Hi I am looking into the demo where the Gauge is with a slide Bar inside it. Here is a demo from Telerik site. http://dojo.telerik.com/oDoqE How can I have a circle filled with a specific colour instead of that slidebar? Is that something achievable?
tagged with: kendo-ui

http://stackoverflow.com/comment/42303392
has text: No. JS arrays are index by number only. Non-numeric indices are for objects, and are unordered. Period.
score: 1
comment on: http://stackoverflow.com/q/26872182
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42404828
comment on: http://stackoverflow.com/q/26929693
has text: You have to comment this rule `#main-menu { display: none; float: none; }`.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42302027
type: QuestionComment
type: Comment
has text: @KULKING, I could, but would that even be helpful? JSFiddle won't have my enviroment in rails.
comment on: http://stackoverflow.com/q/26867415
score: 0

http://stackoverflow.com/a/26856175
has body: Sounds basically like you want a "text search". Text indexes can span over multiple fields so terms entered would be searched from all indexed fields: db.collection.ensureIndex({ "firstName": "text", "lastName": "text" }) db.collection.find({ "$text": { "$search": "Peter Robert" } }) That is one way to handle this. Will return other matches as well but exact matches have the highest score so you can rank them. Alternately, if you know you are always getting a string like "Peter Robert" in that order then you can always "split" and tokenize the input: var input = "Peter Robert"; var parts = input.split(/ /); // splits on space db.collection.find({ "firstName": parts[0], "lastName" parts[1] ]) Which is all pretty basic. Or even apply the $regex and $or operators in the mix: var input = "Peter Robert"; var regexStr = input.split(/ /).join("|"); // make it like "Peter|Robert" db.collection.find({ "$or": [ { "firstName": { "$regex": regexStr } }, { "lastName": { "$regex": regexStr }} ] }) Honestly, you can even do this with the $where operator and JavaScript. Not the best though since the condition would evaluate for every document: db.collection.find(function(){ return ( this.firstName + " " + this.lastName ) == "Peter Robert"; }) Probably plays bit better with the aggregation framework though: db.collection.aggregate([ // Borrow something from above to get "might" match documents { "$match": { "$or": [ { "firstName": { "$regex": regexStr } }, { "lastName": { "$regex": regexStr }} ] }}, // Then project a "fullName" { "$project": { "firstName": 1, "lastName": 1, "fullName": { "$concat": [ "$firstName", " ", "$lastName" ] } }}, // Match on the fullName value { "$match": { "fullName": input } } ]) Many ways to do this. You are not restricted by frameworks ( such as those that "emulate" Mongo functions on a client ) since there are both multiple ways to process this and server side operations like "text search" and aggregation and "JavaScript queries" can all be done in ser…
upvote count: 7
answers question: http://stackoverflow.com/q/26856009
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26856009
type: Answer
score: 7

http://stackoverflow.com/comment/42469447
score: 0
type: Comment
type: QuestionComment
has text: No. It's not enough. SO users can correct errors rather than implementing like freelancers
comment on: http://stackoverflow.com/q/26966084

http://stackoverflow.com/comment/42499267
type: QuestionComment
comment on: http://stackoverflow.com/q/26982334
score: 0
has text: what should on click do ?
type: Comment

http://stackoverflow.com/q/26937106
answer count: 2
tagged with: javascript
type: UnansweredQuestion
has body: http://sideshowcoder.github.io/canned/ - requires me to have nodejs version 0.10.3 I have Linux Mint 17 which runs 0.10.25. Is the latest version of nodejs not available on Linux Mint?
score: 2
tagged with: version
downvote count: 0
has title: Nodejs latest version on Linux Mint
favorite count: 0
tagged with: linux
type: Question
tagged with: linux-mint
has answer: http://stackoverflow.com/a/26937804
has answer: http://stackoverflow.com/a/41199897
upvote count: 2

http://stackoverflow.com/q/26898916
tagged with: javascript
possible better answer: http://stackoverflow.com/a/26899117
has body: Basically I have an app that you guess what the english word for the french word is! For some reason my select menu is showing undefined and not a english word? I can't figure out why!! Here is my jsFiddle, A exact replica of the application. The first time you run it, undefined won't show but on the second iteration it shows 2 undefined options?? http://jsfiddle.net/jamesw1/w8p7b6p3/16/ Javascript: //James Wainwright's Mobile Apps Assignment //Arrays of french and english words. var RanNumbers = new Array(6), foreignWords = ['un', 'deux', 'trois', 'quatre', 'cinq', 'six', 'sept', 'huit', 'neuf', 'dix', 'onze', 'douze', 'treize', 'quatorze', 'quinze', 'seize', 'dix-sept', 'dix-huit', 'dix-neuf', 'vingt', 'vingt et un', 'vingt-deux', 'vingt-trois', 'vingt-quatre', 'vingt-cinq', 'vingt-six', 'vingt-sept', 'vingt-huit', 'vingt-neuf', 'trente'], translate = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen', 'twenty', 'twenty-one', 'twenty-two', 'twenty-three', 'twenty-four', 'twenty-five', 'twenty-six', 'twenty-seven', 'twenty-eight', 'twenty-nine', 'thirty'], number = Math.floor((Math.random() * 30)), output = '', correctAns = translate[number]; //Generate random numbers and make sure they aren't the same as each other. function wordGen() { for (var h = 0; h < RanNumbers.length; h++) { var temp = 0; do { temp = Math.floor(Math.random() * 30); while(temp==correctAns){ temp = Math.floor(Math.random() * 30); } } while (RanNumbers.indexOf(temp) > -1); RanNumbers[h] = temp; } } //Call the previous function wordGen(); //Create dynamic select menu using for loop. This loop runs once (on document load) document.getElementById('generatedWord').textContent = foreignWords[number]; var guess = " "; for (var i = 0; i < RanNumbers.length; i++) { guess += " " + translate[RanNumbers[i]] + " "; } guess += ' ' + correctAns + ' '; guess += " "; //Output the …
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
accepted answer: http://stackoverflow.com/a/26899164
favorite count: 0
has title: select menu showing undefined not a generated word from array?
upvote count: 2
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26899164
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/26899117
tagged with: arrays

http://stackoverflow.com/q/26929948
has comment: http://stackoverflow.com/comment/42405230
upvote count: 1
tagged with: addclass
tagged with: javascript
has answer: http://stackoverflow.com/a/26930039
type: AnsweredQuestion
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/26930039
favorite count: 0
possible better answer: http://stackoverflow.com/a/26930261
type: Question
has answer: http://stackoverflow.com/a/26930261
answer count: 2
has body: I am using this javascript where I can change a class onClick (other class). $(window).load(function(){ $(".changefontA").click(function () { $("body").removeClass("a").addClass("b"); $(this).hide(); $(".changefontB").fadeIn(); }); $(".changefontB").click(function () { $("body").removeClass("b").addClass("a"); $(this).hide(); $(".changefontA").fadeIn(); }); }); Because it's a huge change in the font I want to store it in a cookie so when the visitor goes to another page, the website will remember the change and don't switch back to the original font. I'm completely new to cookies so I hope someone can help me or give me a head start.
has title: change class with javascript and store with cookie
tagged with: cookies
has comment: http://stackoverflow.com/comment/42405232

http://stackoverflow.com/a/26864547
upvote count: 1
type: Answer
has body: Use innerText or textContent instead of innerHTML, since it's not HTML.
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/26864412

http://stackoverflow.com/comment/42240677
has text: Did you mean that its not going to myAction?
comment on: http://stackoverflow.com/a/26836480
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/26982420
type: Question
has answer: http://stackoverflow.com/a/26982680
linked to: http://stackoverflow.com/q/1787939
tagged with: javascript
has comment: http://stackoverflow.com/comment/42530317
has comment: http://stackoverflow.com/comment/42513205
has answer: http://stackoverflow.com/a/26982804
has body: Friends, I would like to calculate difference between two times. For example I have var workedHours = '05:00:00'; var defaultWorkDay = '08:00:00'; So I'm needing to calc workedHours - defaultWorkDay and expect a '-03:00:00' result. I've tried moment.js but with no success. Do you have some suggestion?
possible better answer: http://stackoverflow.com/a/26982680
score: 0
has comment: http://stackoverflow.com/comment/42498984
answer count: 3
has answer: http://stackoverflow.com/a/26982672
has comment: http://stackoverflow.com/comment/42498908
has comment: http://stackoverflow.com/comment/42499021
favorite count: 0
has comment: http://stackoverflow.com/comment/42499105
tagged with: datetime
type: AnsweredQuestion
has title: how to calculate "time 1" - "time 2" in JavaScript?
accepted answer: http://stackoverflow.com/a/26982672
has comment: http://stackoverflow.com/comment/42498901
tagged with: datediff
upvote count: 1
downvote count: 1

http://stackoverflow.com/comment/42253740
type: Comment
has text: @torazaburo Idk his project, i answered as he asked :P
comment on: http://stackoverflow.com/a/26845356
type: AnswerComment
score: 0

http://stackoverflow.com/a/27067168
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26898941
has comment: http://stackoverflow.com/comment/74800951
has body: To solve this you need a WKUIDelegate for your web view. It is the duty of the delegate to decide if an alert should be displayed, and in what way. You need to implement this for alert, confirm and text input (prompt). Here is sample code without any validation of the page url or security features: - (void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler { UIAlertController *alertController = [UIAlertController alertControllerWithTitle:message message:nil preferredStyle:UIAlertControllerStyleAlert]; [alertController addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { completionHandler(); }]]; [self presentViewController:alertController animated:YES completion:^{}]; } More in the Official Documentation
upvote count: 96
type: Answer
has comment: http://stackoverflow.com/comment/52150115
score: 95
has comment: http://stackoverflow.com/comment/67599916
accepted answer of: http://stackoverflow.com/q/26898941
downvote count: 1

jsonp
tags question: http://stackoverflow.com/q/26947667
tags question: http://stackoverflow.com/q/26876026
type: Tag
tags question: http://stackoverflow.com/q/26991125
tags question: http://stackoverflow.com/q/26942968
tags question: http://stackoverflow.com/q/26955378
tags question: http://stackoverflow.com/q/26957401
tag name: jsonp

http://stackoverflow.com/comment/42304657
has text: @MikeWillis Drag and drop aren't really our focus here; we need the content editable because this is for content authoring so I don't think that will solve the resize issue here. Thanks though!
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/26868882

math
tags question: http://stackoverflow.com/q/26951725
tags question: http://stackoverflow.com/q/26935120
type: Tag
tags question: http://stackoverflow.com/q/26856020
tags question: http://stackoverflow.com/q/26843740
tags question: http://stackoverflow.com/q/26866468
tags question: http://stackoverflow.com/q/26920930
tags question: http://stackoverflow.com/q/26947477
tag name: math

http://stackoverflow.com/q/26985800
has answer: http://stackoverflow.com/a/26985834
possible better answer: http://stackoverflow.com/a/26986242
downvote count: 1
type: AnsweredQuestion
tagged with: jsfiddle
has title: What is the difference between onLoad, onDomready, No wrap - in , and No wrap - in ?
linked to: http://stackoverflow.com/q/19203922
linked to: http://stackoverflow.com/q/5431351
has body: I use JSFiddle for editing my code. However, in certain codes when I'm running JavaScript or jQuery, it doesn't work unless I select "No wrap - &lt;head&gt;" or "No wrap - &lt;body&gt;". JSFIDDLE HERE In the fiddle above, you will notice that clicking the &lt;button&gt; element will not alert() you unless you've selected either the extension "No wrap - &lt;head&gt;" or "No wrap - &lt;body&gt;". I'm a curious person who likes to understand how things work. What exactly does that option change, and why would you change it?
has answer: http://stackoverflow.com/a/48053218
type: Question
score: 12
tagged with: javascript
has answer: http://stackoverflow.com/a/26986242
favorite count: 0
has answer: http://stackoverflow.com/a/26986283
has comment: http://stackoverflow.com/comment/42505241
accepted answer: http://stackoverflow.com/a/26986283
answer count: 5
has comment: http://stackoverflow.com/comment/42505088
has answer: http://stackoverflow.com/a/37828748
upvote count: 13

http://stackoverflow.com/comment/42467971
comment on: http://stackoverflow.com/a/26964856
type: AnswerComment
has text: Great work mate, much appreciated :) I am working on my solution as well, ones I figure this out will post it here.
score: 0
type: Comment

http://stackoverflow.com/comment/42379595
has text: something like this: `'12345123456712345678'.replace(/^(.{5})(.{7})(.)/g, '$1-$2-$3')` ?
comment on: http://stackoverflow.com/q/26915354
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/26940801
has body: If by "default value" you're referring to "initial value", then it must be: document.getElementById("startDate").value = AmCharts.formatDate(startDate, "DD/MM/YYYY"); Replace that line with: document.getElementById("startDate").value = "01/01/2007"; And you will see.
score: 0
answers question: http://stackoverflow.com/q/26940718
type: Answer

http://stackoverflow.com/q/26972725
has title: to test Angularjs Alerts with protractor
tagged with: http://stackoverflow.com/tag/html
tagged with: angularjs
has body: i am new to protractor, i want to test alerts this is my controller: testapp.controller('SampleCtl', ['$scope', function($scope) { $scope.age = 10; $scope.sub = function(a, b) { if(a&gt;b){ return a - b; } else{ alert("please enter as first number is graterthan second number "); } }; }]); this is my html code: &lt;form onsubmit=""sub(a,b)&gt; &lt;input type="number" name="a" id="a"&gt; &lt;input type="number" name="b" id="b"&gt; &lt;input type=""submit&gt; &lt;/form&gt; if we enter 8,7 success. if we enter 7,8 failure end gives an alert. how can we end to end test that alert with protractor. any one please help me. thanks in advance.
type: UnansweredQuestion
upvote count: 1
type: Question
tagged with: protractor
score: 1
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/26972937

http://stackoverflow.com/q/26846658
possible better answer: http://stackoverflow.com/a/26851629
has answer: http://stackoverflow.com/a/26851629
tagged with: ember.js
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/26846686
score: 1
accepted answer: http://stackoverflow.com/a/26846686
has title: Please explain the use of Ember.$?
type: Question
has body: Please could someone explain why I see examples of people using Ember.$ for jQuery rather than $.
tagged with: javascript
tagged with: jquery
answer count: 2
upvote count: 1
favorite count: 0

http://stackoverflow.com/comment/42356537
comment on: http://stackoverflow.com/a/26902118
score: 3
has text: Could you please explain what does this code do? While it may solve the problem, code-only answer is not encouraged as it may confuse OP and future readers.
type: AnswerComment
type: Comment

adobe
tags question: http://stackoverflow.com/q/26850666
tags question: http://stackoverflow.com/q/26853549
tags question: http://stackoverflow.com/q/26873215
type: Tag
tag name: adobe

http://stackoverflow.com/a/26943226
has body: I would suggest you to track the ajax request through the Network tab of developer tools. Also add the following to track the errors. ... error: function ( error ) { console.log(JSON.parse(error)); } ... Most probably, the request will be failing because of some server side issue. If that's the case success will never get called, however complete (which is called whenever an ajax request completes no matter with error or without error) always gets called.
answers question: http://stackoverflow.com/q/26943198
score: 0
type: Answer

http://stackoverflow.com/a/26875636
answers question: http://stackoverflow.com/q/26859776
accepted answer of: http://stackoverflow.com/q/26859776
score: 0
type: AcceptedAnswer
has body: Figured it out! Was able to create a work around by using $(data).find('#container').parent().html()
type: Answer

http://stackoverflow.com/q/26890215
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/26890273
downvote count: 0
tagged with: javascript
has title: $scope.$watch not being fired in directive
answer count: 1
has body: I have a directive angular.module('eventsApp') .directive('calendar', function(){ return { restrict: 'E', template: '&lt;div id="eventCal"&gt;&lt;/div&gt;', scope: { events: '=' }, link: function(scope, elem, attrs){ var eventCal = $('#eventCal'); eventCal.fullCalendar({ handleWindowResize: true, events: scope.events.list }); scope.$watch('events', function(newModel, oldModel){ console.log(newModel); console.log(newModel.list); eventCal.fullCalendar('removeEvents'); eventCal.fullCalendar('addEventSource', newModel.list); }); } } }); with mark up &lt;calendar events="events"&gt;&lt;/calendar&gt; and with controller angular.module('eventsApp') .controller('EventsCtrl', ['$scope', 'calendarService', function ($scope, calendarService) { $scope.events = { list: [] }; $scope.$on('configLoaded', function(event, settings){ calendarService.init(settings); calendarService.getEvents($scope.view); }); $scope.$on('eventsLoaded', function(event, events){ angular.forEach(events, function(value, key){ $scope.events.list.push(value); $scope.$broadcast('eventsReady', $scope.events); }); }); }]); The scope.$watch method doesn't seem to be working. The console.logs fire once and show newModel as being empty when fired (accessing its property list returns undefined) but the object is correctly being referenced because console.log(newModel) displays the populated model (i.e. the object is apparently being populated after the watch has already been run). If the object is changing why isn't the watch being called again? Is there another way to check for changes on the scope?

http://stackoverflow.com/a/44086673
upvote count: 2
score: 2
answers question: http://stackoverflow.com/q/26961325
downvote count: 0
has body: you can try this // Prevent Bootstrap dialog from blocking focusin $(document).on('focusin', function(e) { if ($(e.target).closest(".mce-window").length) { e.stopImmediatePropagation(); } }); https://www.tinymce.com/docs/integrations/bootstrap/
type: Answer
has comment: http://stackoverflow.com/comment/82130931

http://stackoverflow.com/comment/42283869
score: 0
type: Comment
has text: the main SO question: what did you try? gruntfile describes dependencies, so it is just a matter of changing them. you didn't provide any details so I can give you only generic advice: remove sytax-checking task from the list of dependencies of "serve" task
type: QuestionComment
comment on: http://stackoverflow.com/q/26861291

http://stackoverflow.com/comment/42282093
type: AnswerComment
has text: Not only that, when I did a plnker I took out the `BoardsController as bc` and it worked.... maybe something there was wrong
type: Comment
comment on: http://stackoverflow.com/a/26860782
score: 0

http://stackoverflow.com/comment/42461274
comment on: http://stackoverflow.com/a/26959775
type: AnswerComment
score: 0
type: Comment
has text: I wouldn't say it's significantly worse, but it's certainly not better. The other answer has slightly more detail, and suggests a library to make working with dates easier. I wouldn't call it advertising, rather a suggestion.

http://stackoverflow.com/comment/42446917
score: 0
type: Comment
type: QuestionComment
has text: What version of jQuery are you using? The toggle event no longer exists in current versions of jQuery.
comment on: http://stackoverflow.com/q/26953267

http://stackoverflow.com/a/26917411
has comment: http://stackoverflow.com/comment/42402423
accepted answer of: http://stackoverflow.com/q/26913198
type: Answer
score: 7
upvote count: 7
has comment: http://stackoverflow.com/comment/42402851
has comment: http://stackoverflow.com/comment/42402654
has comment: http://stackoverflow.com/comment/42403380
downvote count: 0
answers question: http://stackoverflow.com/q/26913198
type: AcceptedAnswer
has body: When you do a find meteor registers a dependency for that template helper on the collection you did a find on. Because of that dependency meteor will call the template helper for every modification to the collection. If you haven't subscribed yet there is no data loaded in the client side copy of your mongo collection. Only when you call subscribe will meteor start pulling in the data from the server. So the method is called multiple times because the subscribe keeps inserting new documents into your local copy of the mongo collection, triggering new calls to the template helper. Best pattern to counter any problems this may give is by subscribing in the helper and using the ready method on the subscribe documentation. Ready is also reactive so when all data is pulled in ready will be changed to true and the helper will be called again. Template.Panel.helpers({ items: function() { var ready = Meteor.subscribe('tweets').ready(); var days_tweets = Tweets.find(); return { data: days_tweets, ready: ready }; }); } Template itself: {{#with items}} {{#if ready}} {{#each data}} item {{/each}} {{else}} Show a spinner or whatever {{/if}} {{/with}}

http://stackoverflow.com/comment/42418559
comment on: http://stackoverflow.com/a/26920397
type: Comment
has text: @VinceBrown - Yes. The function given to `$(window).scroll()` is a closure with the independent variables `elementPos` and `$element`. The closure remembers the values of those variables when it is created, and for each iteration of the `.each()` function, those variables have different values. That is, for each element, an event handler is registered for the window scroll event, with the event callback referring to that element.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42432239
type: Comment
has text: That didn't work, maybe it's because the "li" aren't static. I create a "li" for each field of a .json file. I edited the post to add this info.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26938540

http://stackoverflow.com/comment/42508238
score: 1
has text: the typo were made while i was shortening the code down/translating for transparency's sake, however i have embedded the following related to jQuery earlier in the code: i have also tried without luck
type: AnswerComment
comment on: http://stackoverflow.com/a/26987757
type: Comment

http://stackoverflow.com/a/26882116
has body: Install web essentials Use the same name in end region //#region AutoComplete JS $("#&lt;%=txtBirim.ClientID %&gt;").autocomplete({ source: function(request, response) { $.ajax({ url: '&lt;%=ResolveUrl("~/Classlar/TextboxOtomatik.asmx/BirimGetir") %&gt;', data: "{ 'prefix': '" + request.term + "'}", dataType: "json", type: "POST", contentType: "application/json; charset=utf-8", success: function(data) { response($.map(data.d, function(item) { return { label: item.split('-')[0], val: item.split('-')[1] } })) }, Code.... //#endregion AutoComplete JS
type: Answer
accepted answer of: http://stackoverflow.com/q/26881824
answers question: http://stackoverflow.com/q/26881824
has comment: http://stackoverflow.com/comment/94808331
downvote count: 1
upvote count: 46
has comment: http://stackoverflow.com/comment/94804422
has comment: http://stackoverflow.com/comment/94810090
score: 45
has comment: http://stackoverflow.com/comment/94813047
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/50769614
has comment: http://stackoverflow.com/comment/94810016

http://stackoverflow.com/comment/42440345
comment on: http://stackoverflow.com/a/26943643
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/26873132
tagged with: http
has answer: http://stackoverflow.com/a/26873419
type: AnsweredQuestion
tagged with: asyncfileupload
score: 1
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26873419
has comment: http://stackoverflow.com/comment/42304350
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/42304586
has title: How do old (prior html5) ajax file uploading frameworks work?
tagged with: http://stackoverflow.com/tag/html
has body: Standard html has input element with file type. Components exist which allow asynchronous file upload with progress reporting. As far as I understand this can be done by splitting file in chunks and sending multiple requests within 'file upload' session. For this to work JavaScript must have access to file's contents, however I do not know how to do it without FileAPI appeared as part of HTML5.
has comment: http://stackoverflow.com/comment/42304477
upvote count: 1

http://stackoverflow.com/comment/42340406
has text: Recursive algorithms [solve everything](https://www.youtube.com/watch?v=0zRjU038vl0)!
type: Comment
comment on: http://stackoverflow.com/a/26890322
score: 1
type: AnswerComment

http://stackoverflow.com/comment/42362000
has text: Thanks mate! I think this works the best for me. It is not so sensitive when reaching the bottom and toggles hide/show/hide/show etc. Thank you again!
comment on: http://stackoverflow.com/a/26905294
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/26916561
has body: So I have found I can use .index() to find the updated sort order. Then I can set the class of each li to it's index. $("#sortable").sortable({ update: function(event, ui) { $("#sortable li").each(function() { $(this).removeClass(); var $index = $(this).index(); $(this).prop("class", $index); }); } }); See this Fiddle: http://jsfiddle.net/2f9vkhxj/8/
type: Answer
answers question: http://stackoverflow.com/q/26915915
score: 0

http://stackoverflow.com/q/26845305
type: UnansweredQuestion
tagged with: animation
has body: I know there are several questions connected with raphael and js animating, but I couldn't find any help there. I'm completly new to js and I would appreciate your help. I want to animate some words (drawing them with paths) with raphael. I want to draw a word, remove it and draw another word, etc. So f.e. I want to draw (animate) word "CAT", clear it, then animate word "MAN", clear it, animate word "DOG", clear it and animate CAT again and then MAN and so on. I have two codes that are doing the things that I want to do, but I cannot combine them. I would appreciate if you told me how to use them together or maybe there is some other way to do the task I want to do. This one draws a letter using animate and specyfing the lines This one animates a line and reapeats it
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/42254169
type: Question
tagged with: javascript
has title: How to animate drawing polyline repeatedly with raphael.js
tagged with: raphael
has answer: http://stackoverflow.com/a/26858870
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/42253835
favorite count: 0

http://stackoverflow.com/q/26921756
has body: I want to edit an html button that will tell the user if they have read the page that the button is on. The button is at the bottom of the page, and starts off being red. After the user presses the button, a cookie is generated and the changeButton() function checks to see if the cookie has been created, and then changes the button to green. Even after the user closes and reopens the browser, the button should stay green until the cookie has been deleted. My browser just shows the button as being green on page loadup, before I even hit the button. Any help would be greatly appreciated. &lt;head&gt; &lt;script type="text/javascript"&gt; function changeButton() { var name = 'user_read_the_page' + '='; var ca = document.cookie.split(';'); for(var i=0; i&lt;ca.length; i++) { var c = ca[i]; while(c.charAt(0)==' ') { c = c.substring(1); } if(c.indexOf(name) != -1) { var output = c.substring(name.length,c.length); } } document.getElementById("test").innerText = output; if(output == 1) { cookie_exists = 1; } else { cookie_exists = 0; } if(cookie_exists == 1) { document.getElementById("read_button").style.backgroundColor = "green"; document.getElementById("read_button").style.color = "white"; document.getElementById("read_button").style.fontWeight = "bold"; document.getElementById("read_button").innerText = "\u2714 You Have Read This Page"; } else { document.getElementById("read_button").style.backgroundColor = "red"; document.getElementById("read_button").style.color = "white"; document.getElementById("read_button").style.fontWeight = "bold"; document.getElementById("read_button").innerText = "\u2718 Please Read This Page"; } return ""; } &lt;/script&gt; &lt;/head&gt; ... &lt;button id="read_button" onclick="createCookie('user_read_the_page', 30)"&gt;&lt;/button&gt; &lt;script language="javascript"&gt; function createCookie(name, days) { var expire = new Date (); expire.setTime (expire.getTime() + (24 * 60 * 60 * 1000) * days); document.cookie = name + "=1; expires=" + expi…
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/42392442
answer count: 0
type: UnansweredQuestion
type: Question
tagged with: conditional-statements
has title: Change HTML Button Based On Cookie Existance
tagged with: cookies
score: 0
has comment: http://stackoverflow.com/comment/42393067
tagged with: javascript
has comment: http://stackoverflow.com/comment/42392780
has comment: http://stackoverflow.com/comment/42392612
has comment: http://stackoverflow.com/comment/42392832

http://stackoverflow.com/a/26943883
score: 3
accepted answer of: http://stackoverflow.com/q/26943820
upvote count: 3
answers question: http://stackoverflow.com/q/26943820
type: AcceptedAnswer
downvote count: 0
has body: Colors.called = {}; Colors.random = function () { var keys = Object.keys(this.names), max = keys.length, called = Object.keys(this.called), color = keys[Math.floor(Math.random() * (max - 0)) + 0]; if (Colors.called[color]) { if (max === called.length) { Colors.called = {}; } return Colors.random(); } Colors.called[color] = true; return { name: color, rgb: this.names[color] }; }; DEMO: http://jsfiddle.net/8ysuw/75/
type: Answer

http://stackoverflow.com/q/26867436
has comment: http://stackoverflow.com/comment/42308377
has body: I'm posting text from a form to an area on the same page but the text area that has the content still retains the content after submit. Submit button Textarea Where I have content showing up on same page If I remove onclick="showInput();" Then the content does not show up on the page where I want it, so that's not a viable option. Any thoughts?
type: UnansweredQuestion
tagged with: php
has answer: http://stackoverflow.com/a/26867619
tagged with: forms
has title: Post to same page but clear textarea
type: Question
has comment: http://stackoverflow.com/comment/42294045
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/26865294
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/48643278
upvote count: 1
answer count: 1
favorite count: 0
tagged with: sms
has comment: http://stackoverflow.com/comment/45701408
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: sms uri scheme not working with android hangout
downvote count: 0
score: 1
has body: in android the body of the sms not populating with hangout app. i have tried the codes below Send SMS Send SMS Send SMS
has answer: http://stackoverflow.com/a/28261821

cryptography
tag name: cryptography
type: Tag
tags question: http://stackoverflow.com/q/26937850
tags question: http://stackoverflow.com/q/26861912

http://stackoverflow.com/q/26866741
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/26867066
score: 1
tagged with: jquery-validate
answer count: 1
downvote count: 0
has title: Jquery Validation Resets page
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/26867066
favorite count: 0
type: AnsweredQuestion
has body: i'm new to using javascript plugins to validate data in forms and therefore am having problems. Currently, the first validation works fine and executes the correct jquery, however the second validation for the second section of the form resets the page when valid data is entered. Here's a jsfiddle to demonstrate the problem: http://jsfiddle.net/epn63vk3/2/ You can also check out the version with the css fully working at : http://178.62.85.190/index.html Javascript: $(document).ready(function () { $("#buttonToSecondaryDetailsSection").click(function (e) { $('#primaryDetailsForm').validate({ // initialize the plugin rules: { forenameInput: { required: true, minlength: 2 }, surnameInput: { required: true, minlength: 2 }, emailInput: { required: true, email: true } } }); var primaryValid = $('#primaryDetailsForm').valid(); if (primaryValid) { e.preventDefault(); $("#primaryDetailsForm").slideUp("slow"); $("#secondaryDetailsForm").slideDown("slow"); } else { } }); $("#buttonToCommentsSection").click(function (f) { $('#secondaryDetailsForm').validate({ // initialize the plugin rules: { telephoneInput: { required: true, minlength: 11, maxlength: 11 }, genderInput: { required: true, }, dobInput: { required: true, dateFormat: true } } }); var secondaryValid = $('#secondaryDetailsForm').valid(); if (secondaryValid) { f.preventDefault(); $("#secondaryDetailsForm").slideUp("slow"); $("#commentsDetailsForm").slideDown("slow"); } else { } }); }); Forms : Step 1: Your primary details First Name Surname Email Address: next > Step 2: Additional details Telephone Number Gender Male Female Date Of Birth next >

http://stackoverflow.com/comment/42295398
has text: that mean both "a" inside function and outside function referring the same variable rite ?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26868082

http://stackoverflow.com/comment/42348003
has text: Hi @tomanow, doesn't seem to work. I've tried copying and pasting in your code but no success. The code seems to be fine, not sure why it's not firing, Firebug is showing no errors.
comment on: http://stackoverflow.com/a/26890369
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/80330673
score: 0
type: QuestionComment
type: Comment
has text: I've been using a Microsoft stack for a long time. I'm interested in finding out best practices for bundling, minification, and cache busting now that I'm working with a Java, Spring, and Tomcat stack. I understand this is an old post, but can you share your findings? Thanks! -V
comment on: http://stackoverflow.com/q/26869191

http://stackoverflow.com/comment/42426165
type: AnswerComment
type: Comment
score: 2
has text: I think it's worth noting that `samurai.yell` refers to the _function assigned to `ninja.yell`_, not to `ninja.yell` itself. You can change the value of `ninja.yell` directly (not just blowing away the `ninja` object) without affecting `samurai.yell`
comment on: http://stackoverflow.com/a/26941138

http://stackoverflow.com/q/26924560
favorite count: 0
has body: i am able to draw rectangle over video in canvas.But it is hiding behind video but i m able to see it through side.Pls suggest what should i do for drawing it over video same as i can draw over image.Code i'm using : Video to use: Canvas (the code draws the current frame of the video every 20 millisecond): Your browser does not support the HTML5 canvas tag. > Check my jsfiddle at: http://jsfiddle.net/mummydaddy/LjqbuLne/
accepted answer: http://stackoverflow.com/a/26924875
possible better answer: http://stackoverflow.com/a/26924815
type: AnsweredQuestion
has title: Drawing rectangle in Canvas
type: Question
upvote count: 4
tagged with: canvas
tagged with: javascript
score: 4
answer count: 2
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26924875
downvote count: 0
has answer: http://stackoverflow.com/a/26924815

http://stackoverflow.com/comment/42261680
has text: @juvian, they are. I am always order things in ascending and I will be the only one with the code :)
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26849489
type: Comment

http://stackoverflow.com/q/26966096
answer count: 1
favorite count: 0
score: 8
upvote count: 8
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/26966110
type: AnsweredQuestion
has title: Is wrapping code into a closure a good habit?
has body: I a new to Angular and I just completed a tutorial from Code School for beginners in Angular. Now in the second video the instructor of the course says that we are going to wrap our whole application code into a closure. The link to the video is below. He says this somewhere at 00:30. Now why is it a good practice to wrap our code into a closure? Link to the video
type: Question
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/26966110

http://stackoverflow.com/q/26948272
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26949072
type: Question
has answer: http://stackoverflow.com/a/26949028
answer count: 2
has comment: http://stackoverflow.com/comment/42438468
tagged with: javascript
tagged with: jquery
has body: Can anyone help me with a script that will open up a click image in a new page, not a new window? I have a single dedicated HTML page that will be used for various images to be opened up in when the image link is clicked. Any idea's or direction would be greatly appreciated, you guys are the Best! Sorry about that. I'll try to explain it better. I have an html page called "Detailed Photo". I would like any image on my entire website when clicked to open up in this web page called "Detailed Photo". Sorry to ask this, but could the person that just posted an answer regarding it being a vanilla .js please re-post that answer. My browser closed that window and I lost that answer.... It is what I needed. OK GUYS,,,, You did GREAT!!! You gave me the tools to get done what I needed and it worked fantastic... THANK YOU! all for your help. I only hope the best for all of you,,,, and yes, God is Good!! Thanks, Mike
score: 0
has title: Open image in new dedicated page
has comment: http://stackoverflow.com/comment/42440063
has comment: http://stackoverflow.com/comment/42438684

http://stackoverflow.com/q/26864287
score: 1
has title: How can I execute "onfocus" function to window in Firefox?
linked to: http://stackoverflow.com/q/2533305
type: Question
has comment: http://stackoverflow.com/comment/42289341
has comment: http://stackoverflow.com/comment/42288212
has body: I'm trying to create function that execute event when user click inside iframe with different domain. Call to event from child to parent on every click. So because there's cross domain between the iframe and the parent i created 2 function. The first function is to identify when the window get focusout and the iframe is get focus: $(window).bind('focusout', function () { //iframe focused DoSomething(); }); And the second is "DoSomething()". I can execute the event I wanted but I can't count the number of clicks inside the iframe because the cross-domain, so in every call to DoSomething() i return to window the focus. function DoSomething(){ $('#countOfClicks').append('Wow! Another click inside iframe!'); $(window).focus(); } This is the solution to detect the count of clicks inside iframe with different domain. It works good in IE, Chrome, Safari...but it's not working in Firefox because "$(window).focus();" is not do anything in Firefox. Anyone? How can i return the focus to window again? Thank you all!
tagged with: firefox
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
answer count: 0
type: UnansweredQuestion
tagged with: iframe
upvote count: 1
has comment: http://stackoverflow.com/comment/42291147

http://stackoverflow.com/q/26926537
has answer: http://stackoverflow.com/a/26931435
has answer: http://stackoverflow.com/a/26970227
score: 0
answer count: 2
has body: As IE url limit is 2083 characters (see here). I have problems creating a csv file to download: My script fails in this line: link.href = uri; where var uri = 'data:text/csv;charset=utf-8,' + escape(CSV); and CSV is actually a string with the content of the file. So, how could I resolve this issue without limiting the file content to 2083 characters? Many thanks
tagged with: href
tagged with: internet-explorer
tagged with: javascript
type: UnansweredQuestion
has title: IE url limitation, How to overcome when creating files to download?
tagged with: uri
type: Question
tagged with: http://stackoverflow.com/tag/csv

http://stackoverflow.com/comment/42415093
has text: Weel, with better completion, something like that would be my aproach. Hope helps you.. good luck
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26934758
type: Comment

http://stackoverflow.com/q/26878188
has body: My index.html is here: <t t-if="duration != undefine"> <t t-esc="duration.split(':')[0] + 'h ' + (duration.split(':')[1] and duration.split(':')[1] + 'min' or '')"></t> </t> For first tr tag the onclick action is: this.$el.find(".activity_row").on("click", this.on_row_click); on_row_click: function(event) { var activity_id = $(event.currentTarget).data("activity_id"); if(activity_id) { var activity = this.project_timesheet_db.get_activity_by_id(activity_id); this.project_timesheet_widget.screen_selector.set_current_screen("add_activity", activity); } }, Here i am getting activity_id successfully. But Inside this row there is internal div which includes span as mentioned on top containing pt_duration_line class. And for this, onclick action is : this.$el.find(".pt_duration_line").on("click", this.on_url_click); on_url_click: function(event) { var act_id = $(event.currentTarget).data("act_id"); if(act_id) { var activity = this.project_timesheet_db.get_activity_by_id(act_id); for this internal div I am not getting value of 'act_id' which I am getting for 'activity_id' for parent element row. In brief: What to do if i want to get activity_id for the div resided in that row. Thanks in advance
tagged with: jquery
has comment: http://stackoverflow.com/comment/42313445
type: AnsweredQuestion
has title: jQuery load .data to a child element
type: Question
tagged with: javascript
tagged with: parent-child
score: 0
has comment: http://stackoverflow.com/comment/42313440
has answer: http://stackoverflow.com/a/26878220
accepted answer: http://stackoverflow.com/a/26878220
answer count: 1

http://stackoverflow.com/a/26862352
answers question: http://stackoverflow.com/q/26861502
type: Answer
upvote count: 1
has body: I've put together this JSFiddle to elaborate somewhat more on my previous comment. It uses the translate property: transform:translateX(200px); To ensure that it works in as many browsers as possible and is also future-proof, use the vendor prefixes: -webkit-transform:translateX(200px); // chrome and safari -moz-transform:translateX(200px); // mozilla firefox -ms-transform:translateX(200px); // internet explorer -o-transform:translateX(200px); // opera transform:translateX(200px); // regular
score: 1
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26861502
type: AcceptedAnswer

http://stackoverflow.com/a/26941151
has body: Dry-run the execution the way that a JavaScript interpreter would: Create a new, anonymous, empty object (identified as obj1). Create a new, anonymous, function called func1 which does return n &gt; 0 ? .... Add a new property to this object obj1 called yell which is an alias for the function func1. Assign a reference to this object to a new root property called ninja (variables can be thought of as field properties). At this point, the "heap" looks like this: func1 = n =&gt; return n &gt; 0 ? yell(n-1) + "a" : "hiy" obj1 = { yell: func1 } ninja = obj1 Create a new, anonymous, empty object (identified as obj2). Add a new property to this object obj2 called yell which is an alias for the function func1 - not an alias for ninja.yell - a reference to the "function value" itself is copied into obj2.yell rather than a reference-to-a-reference-to-a-function. Assign obj2 to samurai. Create a new, anonymous, empty object (identified as obj3). Assign a reference to this object to ninja. At this point, the "heap" looks like this: func1 = n =&gt; return n &gt; 0 ? yell(n-1) + "a" : "hiy" obj1 = { yell: func1 } // this no-longer has any references and will be GC'd at some point obj2 = { yell: func1 } obj3 = {} samurai = obj2 ninja = obj3 Call samurai.yell which will dereference obj2 and then func1 to successfully make the call.
type: Answer
answers question: http://stackoverflow.com/q/26941009
score: 0

http://stackoverflow.com/comment/42376145
comment on: http://stackoverflow.com/a/26913088
type: AnswerComment
score: 0
type: Comment
has text: tnx a lot* you really help

http://stackoverflow.com/comment/42380298
type: AnswerComment
score: 0
type: Comment
has text: How can I say now that small or big letters are both ok to write into the box?
comment on: http://stackoverflow.com/a/26894233

http://stackoverflow.com/comment/42393756
comment on: http://stackoverflow.com/q/26923087
type: Comment
has text: contact to their support to fix else you need more effort to make fb login for joomla have good knowledge of joomla code and login process
score: 0
type: QuestionComment

http://stackoverflow.com/comment/42441736
type: Comment
type: QuestionComment
has text: do you have an error? What is it? What means are you transmitting it? What does your javascript code look like? ..etc
comment on: http://stackoverflow.com/q/26950233
score: 0

http://stackoverflow.com/comment/42343121
type: Comment
has text: If you want to use a `DOM` element you would have to stick to `DOM` methods and properties: `document.getElementById(....).value`. You can do `$(domElement).val()` but not `domElement.val()`
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/26886939

http://stackoverflow.com/comment/42359953
type: Comment
comment on: http://stackoverflow.com/a/26901058
has text: Can you post a plunker ?? also, i suggest you to check your variable used in ng-if of infinite scroll. Also, increase the distance in ng-infinite scroll to 10 or more ..
score: 0
type: AnswerComment

http://stackoverflow.com/a/69014709
score: 0
answers question: http://stackoverflow.com/q/26903153
type: Answer
has body: my_toggle_var = 0; // your global variable which u can use to play function saveValues() { if (my_toggle_var == 0) { my_toggle_var = 1; // You can move it up down based on your need.... ic.do.something(); } } something : function(){ //some code //these code lead to run some jar file // data insertion into DB(using mysql) }

http://stackoverflow.com/a/26976780
downvote count: 0
has body: I found an easy solution to cope with my problem: $('body').tooltip({ items: ":not(.ui-dialog-titlebar-close)" }); This will exclude the close-buttons from the dialog from the tooltip-functionality, without affecting the autofocus. Now there is no tooltip for the close-button, but the rest is not affected. This can be extended easily and work with ajax-generated content.
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/26973188
answers question: http://stackoverflow.com/q/26973188
type: AcceptedAnswer

http://stackoverflow.com/a/26946043
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26945950
answers question: http://stackoverflow.com/q/26945950
score: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: Try this as you have jquery tagged. $(function() { var videos = $(".video"); videos.on("click", function(){ var elm = $(this), conts = elm.contents(), le = conts.length, ifr = null; for(var i = 0; i&lt;le; i++){ if(conts[i].nodeType == 8) ifr = conts[i].textContent; } elm.addClass("player").html(ifr); elm.off("click"); }); }); .video { position: relative; padding-bottom: 56.25%; /* 16:9 */ height: 0; } .video img { position: absolute; display: block; top: 0; left: 0; width: 100%; height: 100%; z-index: 20; cursor: pointer; } .video:after { content: ""; position: absolute; display: block; background: url(play-button.png) no-repeat 0 0; top: 45%; left: 45%; width: 46px; height: 36px; z-index: 30; cursor: pointer; } .video iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } /* image poster clicked, player class added using js */ .video.player img { display: none; } .video.player:after { display: none; } &lt;div class="video"&gt; &lt;img src="poster.jpg"&gt; &lt;iframe width="940" height="529" src="http://www.youtube.com/embed/rRoy6I4gKWU?autoplay=1" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt; &lt;/div&gt;

http://stackoverflow.com/q/26879720
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/26879775
has title: Overide Javascript Alert Box
type: AnsweredQuestion
tagged with: alert
type: Question
score: 0
has answer: http://stackoverflow.com/a/26879775
has body: I have a add to cart button that can be clicked on my site. When that button is clicked a few actions could happen. The default action is to add the item to the cart then show an alert box stating [#] item(s) added to your cart. But there are other situations where if a person doesn't choose an option it will also alert them. What I would like to do is override these alerts and show my own alerts. I have to base what alert to show depending on what text is shown in the alert. For instance if a person wants to buy an item and they click Add to Cart. The following will be shown: [#] item(s) added to your cart. In this care the alert had the item(s) added to your cart then I would want to run a certain JS function. How do I do this? I found the following code: (function() { var proxied = window.alert; window.alert = function() { // do something here return proxied.apply(this, arguments); }; })(); This will let me run a function when an alert box is open but it 1) doesn't prevent the original alert box from showing and 2) I need to run a specific function based on the text of the alert. Any guidance and assistance in the correct direction is helpful. Examples are welcome as well. Note: I am using jQuery 2.1.1.

http://stackoverflow.com/comment/42409920
score: 0
type: Comment
has text: It's not do anything, same result.
comment on: http://stackoverflow.com/a/26931564
type: AnswerComment

http://stackoverflow.com/comment/42408073
score: 2
has text: Yeah, you might want to be more careful with your ``-wrapping though: [a not-unrealistic demo](http://jsfiddle.net/davidThomas/81d6Lzxe/).
type: AnswerComment
comment on: http://stackoverflow.com/a/26931506
type: Comment

http://stackoverflow.com/comment/42387434
has text: How is "you're doing it wrong" going to help future answer-seekers? Either the question is "Off Topic" and should be corrected, or your answer is not specific enough to be helpful. Does that make sense? The intent of the site isn't for the benefit of the asker, but for the understanding of everyone trying to accomplish similar tasks.
comment on: http://stackoverflow.com/a/26913363
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42374943
type: Comment
has text: It will work because of the included Stackoverflow libraries. If you create a HTML in your local and test, it will not.
type: QuestionComment
comment on: http://stackoverflow.com/q/26912559
score: 0

google-chrome-extension
tags question: http://stackoverflow.com/q/26980446
tags question: http://stackoverflow.com/q/26970538
tag name: google-chrome-extension
tags question: http://stackoverflow.com/q/26892267
tags question: http://stackoverflow.com/q/26952287
tags question: http://stackoverflow.com/q/26934511
tags question: http://stackoverflow.com/q/26988053
tags question: http://stackoverflow.com/q/26960718
tags question: http://stackoverflow.com/q/26978241
tags question: http://stackoverflow.com/q/26986849
tags question: http://stackoverflow.com/q/26932022
tags question: http://stackoverflow.com/q/26903978
tags question: http://stackoverflow.com/q/26919378
tags question: http://stackoverflow.com/q/26878808
type: Tag
tags question: http://stackoverflow.com/q/26964963
tags question: http://stackoverflow.com/q/26908170
tags question: http://stackoverflow.com/q/26906456
tags question: http://stackoverflow.com/q/26963435
tags question: http://stackoverflow.com/q/26900312
tags question: http://stackoverflow.com/q/26949943
tags question: http://stackoverflow.com/q/26942503
tags question: http://stackoverflow.com/q/26917064
tags question: http://stackoverflow.com/q/26867709
tags question: http://stackoverflow.com/q/26883915
tags question: http://stackoverflow.com/q/26877066
tags question: http://stackoverflow.com/q/26985561
tags question: http://stackoverflow.com/q/26935147
tags question: http://stackoverflow.com/q/26962453
tags question: http://stackoverflow.com/q/26950982
tags question: http://stackoverflow.com/q/26834232
tags question: http://stackoverflow.com/q/26964846
tags question: http://stackoverflow.com/q/26889002
tags question: http://stackoverflow.com/q/26884140
tags question: http://stackoverflow.com/q/26910846

http://stackoverflow.com/q/26911276
answer count: 1
has comment: http://stackoverflow.com/comment/62287230
tagged with: angularjs
has body: I'm trying to add skype button to my project using AngularJS. Here's the code: HTML: AngularJs: app.directive("skypeUi", function () { return { restrict: "E", template: " ", replace: true, scope: { participants: "=" }, link: function (scope, element, attrs) { Skype.ui({ "name": "chat", "element": attrs.id, "participants": scope.participants, "imageSize": 32 }); } }; }); But when i click on that it opens skype window and in the same time shows an error message: "Please install Skype application in order to make this call or send a message." Thogh I aleady have skype installed on my system. Can you please tell me why does it shows like that?
type: UnansweredQuestion
tagged with: skype
has title: skype uri button in angularjs issue
score: 0
has answer: http://stackoverflow.com/a/30052423
type: Question
tagged with: javascript
tagged with: skype-uri.js

http://stackoverflow.com/a/26968303
answers question: http://stackoverflow.com/q/26968174
score: 0
has body: var aArr = [{ 'a': 111 }, { 'b': 222 }, { 'c': 333 }] var bArr = [{ 'x': 0 }, { 'y': 0 }] // I'm not sure it's length for (var i = 0; i &lt; bArr.length; i++) { if (i &gt; aArr.length) break; aArr[i] = bArr[i]; } //show the results document.write(JSON.stringify(aArr)); The result should be: &lt;br&gt; &lt;code&gt; [{'x': 0}, {'y': 0}, {'c':333}] &lt;/code&gt; &lt;br&gt;And it is: &lt;br&gt;
type: Answer

http://stackoverflow.com/comment/42390611
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26921090
has text: If you're using Chrome, try out [Batarang](https://chrome.google.com/webstore/detail/angularjs-batarang/ighdmehidhipcmcojjgiloacoafjmpfk?hl=en), it will let you inspect your scopes really easily!
score: 0

http://stackoverflow.com/a/26896697
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/26844368
answers question: http://stackoverflow.com/q/26844368
has body: Solved it by adding $("#search-results").scroll(function(){ $("img.lazy").show().lazyload() }); at the end of my load() function. So, if lazy load missbehaves when used in a container that is not part of the page (aka a absolute or fixed positioned container that has a scroll of its own and doesn't trigger the lazy loading on images on scroll), you can manually trigger it by initilalising the lazy load plugin inside the container's scroll function. $("#your-container").scroll(function(){ $("img.lazy").show().lazyload() });
score: 0

http://stackoverflow.com/comment/42446309
comment on: http://stackoverflow.com/a/26952661
score: 0
type: AnswerComment
type: Comment
has text: By looking at the code at the search form, I noticed a behavior that explains the data loss. This should work for you if you are searching for Class Nbr 83998. Copy and paste it as a single line into your code (no need to split it up). I simply execute the same JavaScript code that is in the onChange after setting the value. `javascript: obj = document.getElementById('SSR_CLSRCH_WRK_CLASS_NBR$8'); obj.value = '83998'; addchg_win0(obj); doEdits_win0(obj,'S(5.0)','N','N','N','N','N','N',/^ *[0-9\,]*(\.[0-9\,]*)? *$/); document.getElementById('CLASS_SRCH_WRK2_SSR_PB_CLASS_SRCH').click(); void(0)`

http://stackoverflow.com/comment/42399442
comment on: http://stackoverflow.com/a/26926552
type: Comment
score: 0
type: AnswerComment
has text: change the first parameter of .fadeOut() function.Increase the value to slower switching. In this case change it to higher value like 3000.

http://stackoverflow.com/a/26889219
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/26889172
has body: The issue is because append() is returning the form element, so you're moving the entire form to before the button. Instead, use insertBefore on the new checkbox. Try this: $('&lt;input type="checkbox" id="checking" name="checking" class="required" /&gt;').insertBefore('.clickSubmit');
upvote count: 1

http://stackoverflow.com/q/26903562
type: AnsweredQuestion
has body: I'm doing backbone project with underscore.js and require.js. And I've got stuck with showing a loading image using http://heartcode.robertpataki.com/canvasloader/ before everything in my view is completely rendered. I found a solution, using $(window).load() , but It did not work for me. Here is my view : render: function(options){ var _banner = _.template(BannerTem); $(window).load(function() { this.loadingStuff(); }); $(this.el).html(_banner({type : this.options.type})); return this; } loadingStuff() is called after the backbone view rendered. But what I am trying to do here is to call loadingStuff() method before a view is rendered completely. Any ideas would be appreciated.
tagged with: backbone.js
has answer: http://stackoverflow.com/a/26905069
type: Question
has comment: http://stackoverflow.com/comment/42359213
answer count: 1
has comment: http://stackoverflow.com/comment/42358911
has comment: http://stackoverflow.com/comment/42358783
score: 0
has comment: http://stackoverflow.com/comment/42358922
has comment: http://stackoverflow.com/comment/42359061
has title: Show loading canvas before Backbone view completely rendered
accepted answer: http://stackoverflow.com/a/26905069
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42358774

recaptcha
tag name: recaptcha
tags question: http://stackoverflow.com/q/26852610
type: Tag

graph
tags question: http://stackoverflow.com/q/26955234
tag name: graph
tags question: http://stackoverflow.com/q/26942192
tags question: http://stackoverflow.com/q/26834114
type: Tag
tags question: http://stackoverflow.com/q/26972175

http://stackoverflow.com/comment/42460706
type: Comment
has text: Thank you. It seems that my question wasn't very clear. Please see question update. I clarified at the bottom.
type: AnswerComment
comment on: http://stackoverflow.com/a/26960996
score: 0

http://stackoverflow.com/a/26833806
accepted answer of: http://stackoverflow.com/q/26833526
answers question: http://stackoverflow.com/q/26833526
has body: &lt;div class="cycle-slideshow" http://jsfiddle.net/ska2hjr0/ According to documentation: cycle-slideshow is a special classname which tells Cycle2 to auto-initialize the slideshow when the page is loaded. http://jquery.malsup.com/cycle2/demo/basic.php Another method, add jquery code to page: $( '.slideshow' ).cycle(); But auto initialization is even better.
has comment: http://stackoverflow.com/comment/42234131
has comment: http://stackoverflow.com/comment/42234053
has comment: http://stackoverflow.com/comment/42234194
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/42233963
type: Answer
has comment: http://stackoverflow.com/comment/42234160

http://stackoverflow.com/q/26883663
tagged with: protractor
has answer: http://stackoverflow.com/a/27587303
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27587303
answer count: 2
downvote count: 0
favorite count: 0
tagged with: angularjs
has body: I'm trying to generate reports using html screen shot in protractor, have followed all the steps, but am getting an error. Please help. My conf.js // An example configuration file. var HtmlReporter = require('protractor-html-screenshot-reporter'); var reporter=new HtmlReporter({ baseDirectory: './protractor-result', // a location to store screen shots. docTitle: 'Protractor Demo Reporter', docName: 'protractor-demo-tests-report.html' }); exports.config = { directConnect: true, // Capabilities to be passed to the webdriver instance. capabilities: { 'browserName': 'chrome' }, // Spec patterns are relative to the current working directly when // protractor is called. specs: ['example_spec.js'], // Options to be passed to Jasmine-node. jasmineNodeOpts: { showColors: true, defaultTimeoutInterval: 30000 } onPrepare: function() { jasmine.getEnv().addReporter(reporter), }; }; Error I'm getting: Unexpected Error. SyntaxError: Unexpected identifier at Module._compile (module.js:439:25) 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 Module.require (module.js:364:17) at require (module.js:380:17) at ConfigParser.addFileConfig (C:\Users\jeevan.s\AppData\Roaming\npm\node_modules\protractor\lib\configParser.js:183:20) at Object.init (C:\Users\jeevan.s\AppData\Roaming\npm\node_modules\protractor\lib\launcher.js:35:18) at Object.&lt;anonymous&gt; (C:\Users\jeevan.s\AppData\Roaming\npm\node_modules\protractor\lib\cli.js:129:23) at Module._compile (module.js:456:26)
possible better answer: http://stackoverflow.com/a/38480211
tagged with: node.js
has answer: http://stackoverflow.com/a/38480211
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42356819
has title: Unable to generate report using html screen shot in protractor
upvote count: 3
type: Question
tagged with: testing
score: 3

http://stackoverflow.com/q/26884751
duplicate of: http://stackoverflow.com/q/20865241
possible better answer: http://stackoverflow.com/a/26884872
has answer: http://stackoverflow.com/a/26884848
has answer: http://stackoverflow.com/a/26884872
has body: my code is working in jsfiddle but not working in the browser i dont know what i missed here could you please check it and tell me the solution. i google it but i am not getting correct solution please help me this is jsfiddle link http://jsfiddle.net/pLTrJ/9/
downvote count: 1
linked to: http://stackoverflow.com/q/441412
has title: javascript code working in jsfiddle but not working in the browser
type: Question
has comment: http://stackoverflow.com/comment/42324558
score: -1
answer count: 2
accepted answer: http://stackoverflow.com/a/26884848
upvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/42324618
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/20865241
has comment: http://stackoverflow.com/comment/42324819
type: AnsweredQuestion

http://stackoverflow.com/comment/42304349
has text: My suggestion is up in [my comment on the question](http://stackoverflow.com/questions/26861006/how-to-call-a-backbone-view-function-from-another-view-in-separate-files/26861177#comment42300685_26861006), I don't have time to flesh it out right now.
comment on: http://stackoverflow.com/a/26861177
type: AnswerComment
score: 0
type: Comment

required
tag name: required
tags question: http://stackoverflow.com/q/26843578
type: Tag

http://stackoverflow.com/comment/42333444
comment on: http://stackoverflow.com/a/26889424
has text: I'm not sure y u need it when menu is open. But in that case u can then try using other api's `focus( event, ui )`. The doc says that `ui` is empty for `òpen` callback
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/26981524
type: Question
has title: Reading pdf files using mozilla pdf.js from remote internet source on an android app
has answer: http://stackoverflow.com/a/27078637
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/pdf
answer count: 1
linked to: http://stackoverflow.com/q/25278813
tagged with: android
type: AnsweredQuestion
has body: I have been looking for some solutions for this, i got one here - Show PDF file in Android WebView using mozilla pdf.js Android API Level below 19 but then here he tries to open a local file, is there a way I can open files placed on my server.
accepted answer: http://stackoverflow.com/a/27078637

http://stackoverflow.com/q/26845826
tagged with: maps
linked to: http://stackoverflow.com/q/26638432
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26846298
tagged with: leaflet
accepted answer: http://stackoverflow.com/a/26846298
type: Question
has body: As I can see Marker contains no methods to change clickable property (true/false). And I need to change this property many times after the all markers was creating (I understand that I can create a new marker based on the old one, but this is really overhead and I'd like to avoid it) By this time I tried this method to handle onclick event on my custom button: function makeMarkersClickable() { for (var id in myMarkers) { var marker = myMarkers[id]; marker.options.clickable = true; marker.clickable = true; } } Obviously it didn't work. Seems that there should be a method to update the whole map or something like that to resolve the issue.
tagged with: javascript
tagged with: jquery
score: 0
has title: How do I toggle clickable marker property using custom control in Leaflet?
answer count: 1

http://stackoverflow.com/comment/42295573
has text: ok html posted above
comment on: http://stackoverflow.com/q/26867244
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42513416
comment on: http://stackoverflow.com/q/26990812
score: 0
has text: @Avisho: Here http://jsfiddle.net/byhLn37b/1/
type: Comment
type: QuestionComment

http://stackoverflow.com/a/50576705
type: Answer
score: 0
answers question: http://stackoverflow.com/q/26964659
has body: Try converting timestamp to date and then sort using orderBy() in angularjs.

http://stackoverflow.com/comment/42462276
type: Comment
type: QuestionComment
has text: If `email_feedback` is a `textarea`, you should be using `.val(result)` instead of `.html(result)`, and then `document.getElementById('email_feedback').value;` instead of `.innerHTML`.
comment on: http://stackoverflow.com/q/26961835
score: 0

http://stackoverflow.com/comment/42502498
type: QuestionComment
comment on: http://stackoverflow.com/q/26984335
score: 2
has text: You can create an array of nodes (points) of path and draw a line to each node in array, if that's what you were asking. I really don't know what do you mean by accessing the variable with dot notation? And to rotate a path you should rotate each point and re-draw the path. Simple way to do so is by using [rotation matrix](http://en.wikipedia.org/wiki/Rotation_matrix).
type: Comment

http://stackoverflow.com/comment/42400828
comment on: http://stackoverflow.com/q/26927347
type: Comment
has text: https://github.com/employ/employ.github.io/blob/master/js/script.js
score: 0
type: QuestionComment

http://stackoverflow.com/comment/42375716
score: 0
has text: Correct, but hide() should undo those calculations (I've ever done this kind of 'brachial' things ^^).
type: AnswerComment
comment on: http://stackoverflow.com/a/26905495
type: Comment

http://stackoverflow.com/q/26952443
tagged with: javascript
has title: Jquery duo checkbox, yes no, no yes, no no, how to deselect again?
has answer: http://stackoverflow.com/a/26952484
score: 0
answer count: 3
duplicate of: http://stackoverflow.com/q/26949700
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/26952648
has comment: http://stackoverflow.com/comment/42445734
has body: How to return checkbox back to unselected on click? The two checkbox options should be, "yes, no" "no, yes" or "no, no" but once checkbox has been selected, i can flip between buy and sell (correct), but how to deselect the one selected again upon clicking, back to both unselected? $('input.checkboxClass').on('click', function() { $(this).parent().parent().find('.checkboxClass').prop('checked', false); $(this).prop('checked', true) }); DEMO
tagged with: checkbox
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42445955
downvote count: 2
has answer: http://stackoverflow.com/a/26952612
type: Question
has comment: http://stackoverflow.com/comment/42445519
has comment: http://stackoverflow.com/comment/42445649

http://stackoverflow.com/q/26833609
tagged with: http://stackoverflow.com/tag/html
has body: I have a sliding footer ('footerSlideContent') which slides up and down (opens and closes) by clicking on a button ('footerSlideButton'). (The first .js code below shows how it works right now) jQuery(function($) { var open = false; $('#footerSlideButton, .footer_wrapper').click(function () { if(open === false) { $('#footerSlideContent').animate({ height: '37px' }); $(this).css('backgroundPosition', 'bottom left'); $("#footerSlideButton").hide(1); open = true; } else { $('#footerSlideContent').animate({ height: '0px' }); $(this).css('backgroundPosition', 'top left'); $("#footerSlideButton").show(1); open = false; } }); }); Now I would like to be able to close the 'footerSlideContent' just by clicking anywhere on the 'document' or body. I tried this (did not work): jQuery(function($) { var open = false; $('#footerSlideButton, .footer_wrapper').click(function () { if(open === false) { $('#footerSlideContent').animate({ height: '37px' }); $(this).css('backgroundPosition', 'bottom left'); $("#footerSlideButton").hide(1); open = true; } }); }); $(document).click.(function () { $('#footerSlideContent').animate({ height: '0px' }); }); I also tried this: (This works exactly once (ergo, I can close it by clicking anywhere on the document once), but then the 'footerSlideButton' (which is used to open the footer again) disappears... $(document).click(function (e) { if ($(e.target).closest('#footerSlideContent').length &gt; 0 || $(e.target).closest('#footerSlideButton').length &gt; 0) return; $('#footerSlideContent').slideUp(400); }); Thanks a lot in advance!
possible better answer: http://stackoverflow.com/a/26833681
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26834065
has title: click anywhere to hide sliding-footer
has answer: http://stackoverflow.com/a/26833681
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/26834065
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/q/26904769
tagged with: jquery
has body: I am trying to implement a scenario where I have a HTML document with 115 links in it. All links do not have a title attribute in it. REK What I want to achieve here is to add a title for all these anchor tags and the value would be as follows: REK This means that the title attribute's value has to be the text of the link. I know how to add a title attribute to all the links using JAVASCRIPT but I'm not able to add the value to it according to the link text. Can anyone please suggest me a way to achieve this? Thanks in advance!
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/26904803
upvote count: 2
type: Question
tagged with: anchor
has title: Script to add title and it's value for all anchor tag in an HTML document
tagged with: javascript
tagged with: title
accepted answer: http://stackoverflow.com/a/26904803
answer count: 1
downvote count: 0

http://stackoverflow.com/a/26923460
answers question: http://stackoverflow.com/q/26923300
type: Answer
has body: This line of code listens for when all your HTML is loaded and calls showLocation as soon as the DOM is ready to be manipulated. window.addEventListener('DOMContentLoaded', showLocation); The answer you accepted does work, but DOMContentLoaded is typically much faster, which gives you a more responsive UI. Supporting proof: Difference between DOMContentLoaded and Load events
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/a/26931233
has comment: http://stackoverflow.com/comment/42424577
has comment: http://stackoverflow.com/comment/42427368
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42425316
accepted answer of: http://stackoverflow.com/q/26920961
has body: The onupgradeneeded callback is only called when you increment the version parameter to indexedDB.open. You will need to increment, save, and then reload each time you want your example code to run. This should cause the RETRIEVING DATA command to be printed. It would be far easier to test if you did not try and insert/read data within the onupgradeneeded callback function. That way you would not need to increment the database version every time you wanted to test/run the code. You need to open a transaction using the database object. Right now you state var transaction = request.transaction('List');. request is an IDBRequest. I don't think there is an IDBRequest.prototype.transaction method. What you want to use is IDBDatabase.prototype.transaction. For example, var transaction = db.transaction('List');. Alternatively to #2, but more complicated, you can use the implicit transaction that is used as part of onupgradeneeded. This is a special VERSION_CHANGE type transaction created automatically by indexedDB that is valid only within the body of the onupgradeneeded callback. VERSION_CHANGE txs support read/write. If you really want to do this, you could use var transaction = event.target.transaction;. I would not recommend this but it is possible. In your cursor onsuccess callback, it looks like you are not advancing the cursor past the first record. You need to add cursor.continue(); within the if block to continue the iteration. A simple example of how to avoid having to upgrade the database each time: function upgradeDatabase(event) { var db = event.target.result; db.createObjectStore('List', { keyPath: "id" }); } function addParsedData(parsedData, callback) { var request = indexedDB.open('List', 1); request.onupgradeneeded = upgradeDatabase; request.onsuccess = function(event) { var db = event.target.result; var tx = db.transaction('List','readwrite'); tx.oncomplete = callback; var list = tx.objectStore('List'); for(var i in parsedData) { list.add(parsedData[i]);…
type: Answer
has comment: http://stackoverflow.com/comment/42427386
score: 1
has comment: http://stackoverflow.com/comment/42417025
upvote count: 1
answers question: http://stackoverflow.com/q/26920961
has comment: http://stackoverflow.com/comment/42425788
has comment: http://stackoverflow.com/comment/42416697

http://stackoverflow.com/a/26922726
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42393324
has body: You need to use .append() nto string concatenation + $(document).ready(function() { var navDiv = $("#menu"); $("#mainnav .leval1").each(function(i) { if (i % 4 == 0) { //fourth iterration do something } var parent = $(this).children('a').html(); var child = $(this).next('.navbox').html(); var menuBlock = " p: " + parent + " " + child + " "; $('#print').html(menuBlock); //also the + operator won't work with jQuery object you need to append them navDiv.append(menuBlock); console.log(menuBlock); }); //navDiv.mmenu(); }); #print { border: 1px solid red; } #menu { border: 1px solid green; } lorem2 lorem2 lorem2 lorem2 lorem2 lorem2 lorem2 lorem2 lorem2 lorem2 lorem2 lorem2 lorem2 lorem2 lorem2 lorem2 lorem2 lorem2 lorem2 lorem2 lorem2 lorem2 lorem2 lorem2 lorem2
has comment: http://stackoverflow.com/comment/42393363
type: Answer
has comment: http://stackoverflow.com/comment/42393495
score: 1
has comment: http://stackoverflow.com/comment/42392958
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26922689
has comment: http://stackoverflow.com/comment/42393376
has comment: http://stackoverflow.com/comment/42393016
answers question: http://stackoverflow.com/q/26922689

http://stackoverflow.com/q/26910573
type: AnsweredQuestion
tagged with: wordpress
has body: I'm working on a project where Google Maps markers open a link when clicked. The problem is that on the last entry in the array opens and not the preceding ones. I just can't see the problem. It populates on a template page in Wordpress, and I have used the wp_enqueue_script in the functions.php file. The header.php file contains the Google Maps API key. Any help would be greatly appreciated. Thank you. function initialize() { var mapOptions = { center: { lat: 32.5851061, lng: -89.8772196}, zoom: 8 }; var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); setMarkers(map, communities); } var communities = [ ['Oxford', 34.360004, -89.5233875, 'http://oxfordcycling.org'], ['Starkville', 33.4562909, -88.8322225, 'http://starkvillecyclingclub.org'], ['Natchez', 31.544537, -91.3862539, 'http://crookedlettercycling.com/communities/natchez'], ['Ridgeland', 32.42941, -90.1454013, 'http://ridgelandms.com'] ]; function setMarkers(map, locations) { for (var i = 0; i &lt; locations.length; i++) { var community = locations[i]; var myLatLng = new google.maps.LatLng(community[1], community[2]); var marker = new google.maps.Marker({ position: myLatLng, map: map, title: community[0], url: community[3], }); } google.maps.event.addListener(marker, 'click', function() { window.open(this.url, '_blank'); }); } google.maps.event.addDomListener(window, 'load', initialize);
type: Question
has title: Custom Google Maps to open Marker Links
tagged with: google-maps
has comment: http://stackoverflow.com/comment/42370980
tagged with: javascript
has answer: http://stackoverflow.com/a/26910817
tagged with: google-maps-api-3
accepted answer: http://stackoverflow.com/a/26910817
score: 0
answer count: 1
tagged with: wordpress-theming

http://stackoverflow.com/q/26847265
has body: I have a user configurable background colour for my element which means the text over it isn't always visible. My first thoughts were to invert the foreground colour based on the background colour, but sometimes this can result in some pretty ghastly colours. Is there an easy way I would be able to simply switch between black and white foreground colours depending on the background colour?
upvote count: 1
has comment: http://stackoverflow.com/comment/42257517
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26847909
downvote count: 0
score: 1
has title: Text always visible over background
favorite count: 0
has comment: http://stackoverflow.com/comment/42257499
type: Question
has comment: http://stackoverflow.com/comment/42258719
answer count: 1

http://stackoverflow.com/comment/42381076
score: 0
type: Comment
comment on: http://stackoverflow.com/q/26916185
type: QuestionComment
has text: Please include the relevant HTML and CSS in your question, along with a mockup on jsfiddle or bootply if you could.

http://stackoverflow.com/q/26989544
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26989594
score: 0
has answer: http://stackoverflow.com/a/26989591
has comment: http://stackoverflow.com/comment/42510861
has answer: http://stackoverflow.com/a/26989601
type: Question
has body: I am debugging my javascript code on Google Chrome, and when it stops on the breakpoint I want to learn the current class name of the div with id "loadingElement". With the javascript code I try to change its class as loaded/loading. But I am not sure if it changes. What should I write down to the console to see its current state? This is what div looks like: &lt;div id="loadingElement" class="loaded"&gt;
tagged with: javascript
has answer: http://stackoverflow.com/a/26989635
has answer: http://stackoverflow.com/a/26989622
has comment: http://stackoverflow.com/comment/42510833
has title: How to learn current class of div element on debug
accepted answer: http://stackoverflow.com/a/26989591
has comment: http://stackoverflow.com/comment/42510837
answer count: 5
possible better answer: http://stackoverflow.com/a/26989594

http://stackoverflow.com/a/26862379
type: Answer
has comment: http://stackoverflow.com/comment/42285013
has comment: http://stackoverflow.com/comment/42284998
answers question: http://stackoverflow.com/q/26862175
score: 0
has body: Using Array.reduce(), i was able to get it down to an object containing only Temp and Temp2 with their dates: var obj = array.reduce(function(base,cur){ if (base[cur.Name]) { if (base[cur.Name].Date &lt; cur.Date) { base[cur.Name].Date = cur.Date; } else { return base; } } else { base[cur.Name] = cur; return base; } },{}); From there, you can just get the object's values with Object.keys().map(): array = Object.keys(obj).map(function(k){ return obj[k]; });

http://stackoverflow.com/q/26991797
possible better answer: http://stackoverflow.com/a/27098374
has body: I'm trying to implement a scroll function which moves elements based on where the user scrolls, this code works so far and it does move elements. The thing is I want to have a list of different functions which moves specific elements whenever you scroll past a certain div based on it's id or class. I thought if I changed $("#pagelight2").scrollTop() it would work but that did not help Any guidance would be appreciated Thanks Updated code works but it is really glitchy whenever I scroll up the animation stops moving - anybody know more efficient way to get this to work? var $scrollingDiv = $(".Page3-PeopleWalkingDown"); var p = $("#pagedark3"); var offset = p.offset(); var top = offset.top; $(window).scroll(function() { var scrollval = $(window).scrollTop() - top; if ($(window).scrollTop() &gt; 1400) { $scrollingDiv .stop() .animate({ "left": "-" + (scrollval) + "px" }); } else { $scrollingDiv .stop() .animate({ "left": +(0) + "px" }); }
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/26992882
type: Question
has comment: http://stackoverflow.com/comment/42630456
has answer: http://stackoverflow.com/a/27145265
tagged with: javascript
answer count: 6
tagged with: jquery
has answer: http://stackoverflow.com/a/26992882
score: 4
has answer: http://stackoverflow.com/a/27037643
has answer: http://stackoverflow.com/a/27098374
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/27112826
has title: How to change CSS when user scrolls past a certain div
has answer: http://stackoverflow.com/a/27037914
upvote count: 4
tagged with: css

http://stackoverflow.com/comment/42450899
type: Comment
has text: So, are you saying that first `{value: array[i], rest: list}` object is created and the previous list is put in the rest property? And only then a new _list_ variable that points to the object is created?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26955393

http://stackoverflow.com/q/26950978
type: UnansweredQuestion
tagged with: stackexchange-api
has body: https://stackoverflow.com/tags/synonyms?page=1&amp;tab=newest&amp;filter=allgetbootstrap.com This is returning me html page, so how can I convert the tags into json array which can be populated into my autocomplete search box. https://i.sstatic.net/j9Wvy.jpg "tags_image_return_html"
has answer: http://stackoverflow.com/a/26951277
tagged with: http://stackoverflow.com/tag/json
type: Question
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
has title: how to get json responses for all the tags used by stackexchange API

http://stackoverflow.com/q/26941670
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42427140
downvote count: 3
has answer: http://stackoverflow.com/a/26941693
type: Question
has comment: http://stackoverflow.com/comment/42427607
has title: Switch/Comparison Statement Issue
possible better answer: http://stackoverflow.com/a/26941694
has answer: http://stackoverflow.com/a/26941694
has comment: http://stackoverflow.com/comment/42427428
tagged with: javascript
answer count: 2
upvote count: 0
accepted answer: http://stackoverflow.com/a/26941693
favorite count: 0
has body: For some reason I can't get my switch statement, I'm new to Javascript and I've got the feeling my issue is more to do with the 'cat==="string"' part rather than the switch. For the sake of this Example assume the value of 'data.cat' is Starters. function (data) { data = JSON.parse(data); if (!data.success) { // An error was thrown in the controller alert(data.message); } else { switch (cat = data.cat) { //data.cat is Starters case 0: cat === "Starters"; console.log("Test a= " + cat); break; case 1: cat === "Mains"; console.log("Test b= " + cat); break; case 2: cat === "Deserts"; console.log("Test c= " + cat); break; default: console.log("Shit.." + data.cat); break; } } }); http://jsfiddle.net/76fe9kk7/3/ As you can see from the fiddle, the log reports the Default. Why is this?
score: -3

http://stackoverflow.com/comment/42495350
has text: you do not need a genius here. Just about 2:45 minutes of your precious time to learn how to [measure your site objectives](https://support.google.com/analytics/answer/1012040?hl=en).
comment on: http://stackoverflow.com/q/26980534
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26982692
answers question: http://stackoverflow.com/q/26982478
downvote count: 0
has comment: http://stackoverflow.com/comment/42500913
type: Answer
has body: NOTE: I'm not at all affiliated with NewRelic. To answer your question: yes -- NewRelic can do the things you mentioned above, but it's probably not the best tool for the job. If you want to have really good exception alerts, etc., you'll probably be better off using a tool like Sentry (https://getsentry.com/welcome/). What NewRelic really excels at, however, is helping you debug issues while you're building your application -- and then, helping you fix performance problems when your application is in production. I've been using NewRelic for nearly 4 years now, and it's been a super awesome part of my toolset. Here's why I like it: It's ridiculously easy to install. Usually a single line of code. It collects all sorts of metrics from your application as it's running: how many requests you're doing, what each request is doing, etc. It shows you at a granular level exactly what is happening on each request: how much time you spent connecting to the database, making a query, processing some function, etc. VERY USEFUL for fixing performance problems. It provides really great alerting for performance issues -- you can get alerts if your overall performance drops below a percentage, of if you've suddenly started generating a lot of 500 responses. It's UI is killer -- really easy to work with, and filled with stats / useful data. Over the past few years it's been the only tool I use in every single project I start.
score: 7
upvote count: 7

http://stackoverflow.com/q/26897141
tagged with: asp.net
upvote count: 2
tagged with: twitter-bootstrap
possible better answer: http://stackoverflow.com/a/26897691
has answer: http://stackoverflow.com/a/26897691
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26897783
type: Question
answer count: 2
has title: Weird Bootstrap input group behavior
downvote count: 0
tagged with: javascript
favorite count: 0
has body: The above image shows my attempt at creating my own "light-weight" Bootstrap-looking ComboBox control with ASP.NET textbox. The input group shown above which consists of a texbox and button (with black arrow) looks funny. Has anyone experienced this before? Any ideas as to why it looks that way? Any recommendations to fix this? I am not doing anything fancy here. The mechanism that "appends" a button to a textbox is supported by Bootstrap. ASPX Page: Timesheet Date <asp:TextBox runat="server" ID="TimesheetBox" CssClass="form-control"> </asp:TextBox> 11/22/2013 11/15/2013 11/08/2013 CSS: .scrollable-menu { height: auto; max-height: 300px; overflow-x: hidden; }
has answer: http://stackoverflow.com/a/26897783
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/a/26898951
answers question: http://stackoverflow.com/q/26898855
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/26898855
has body: You need a callback when the script is loaded, it's asynchronous: addjquery.addEventListener('load', function (e) { alert('jQuery Loaded'); console.log(e); runStuff(); }, false); Fiddle

http://stackoverflow.com/comment/42294721
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26864234
has text: Sorry, i have made an error. Like you said it doesn't work. However I have another method which does work with the 'this' keyword. I'll update the question. Can you elaborate on why 'this' doesn't work?

http://stackoverflow.com/comment/42462616
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26962286
score: 1
has text: `.length` checks the length of the string, not the actual value of the input.

http://stackoverflow.com/comment/42260956
score: 0
type: Comment
has text: @C-linkNepal — It's the id of the form.
comment on: http://stackoverflow.com/a/26849149
type: AnswerComment

http://stackoverflow.com/comment/42493364
has text: The PHP is irrelevant here, and why the jQuery tag? Post the rendered HTML. Also, have you tried debugging the code? What errors do you get in the browser's console?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26979494
score: 1

http://stackoverflow.com/comment/42249622
has text: The json parses just fine for me, also you're storing both the id and the name as an individual array, try to store it as 'id' => $id and 'name' => $professor in ajax.php
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26841447

http://stackoverflow.com/comment/42447704
score: 0
has text: When I run the command I get an undefined error. It also creates a span in the button with a spinner class.
comment on: http://stackoverflow.com/a/26947922
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42411629
comment on: http://stackoverflow.com/q/26893835
score: 0
type: Comment
type: QuestionComment
has text: I tried `grid.refresh()` and I get a message in my firebug console that says `grid.refresh()` is not defined.

http://stackoverflow.com/comment/42452266
type: Comment
comment on: http://stackoverflow.com/a/26956211
has text: OK it's clear. Sorry I did not read the documentation correctly. Thanks
type: AnswerComment
score: 0

http://stackoverflow.com/a/26904413
accepted answer of: http://stackoverflow.com/q/26902068
type: AcceptedAnswer
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26902068
has body: I think you can not do it setting properties of the calendar. But reviewing the source code you can see, inside function in charge of draw the html for every slot at line 5798 of version 2.1.1: ((!slotNormal || !minutes) ? // if irregular slot duration, or on the hour, then display the time So, if you change that line to display only when the minutes are 0 (o'clock!) ((!minutes) ? Then you are done.

http://stackoverflow.com/a/26905962
accepted answer of: http://stackoverflow.com/q/26905918
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42362660
type: Answer
score: 3
has body: Edit function toggleDiv(elementId, button, textOn, textOff) { var style = document.getElementById(elementId).style; if( style.display == "none" ) { style.display = "block"; button.innerHTML = textOn; } else { style.display = "none"; button.innerHTML = textOff; } } Show Contact Information bla Original Answer function toggleDiv() { if( document.getElementById('element').style.display == "none" ) { document.getElementById('element').style.display = "block"; } else { document.getElementById('element').style.display = "none"; } }
upvote count: 3
has comment: http://stackoverflow.com/comment/42362898
answers question: http://stackoverflow.com/q/26905918

http://stackoverflow.com/a/26911470
accepted answer of: http://stackoverflow.com/q/26911111
score: 1
has comment: http://stackoverflow.com/comment/42373773
answers question: http://stackoverflow.com/q/26911111
type: AcceptedAnswer
upvote count: 1
type: Answer
has body: You are trying to solve very strange problem, however it's still possible to make it work. Technically you want to invoke only those callbacks that has Foo.bar invocation inside anywhere. In this case you can get function sourse code with toString() method and simple check it with regular expression. Something like this: (function () { function hasOwnFunction(callback) { return /\.bar\(/.test(callback.toString()); } this.foo = function () { // Here are Private Functions within this Object return { bar: function (callback) { if (typeof callback === "function" &amp;&amp; hasOwnFunction(callback)) callback(); } } } }(this)); var Foo = new foo(); Foo.bar(function () { alert('I should be called 1'); Foo.bar(function () { alert('I should be called 2') Foo.bar(function () { alert('Should not be called'); }) }); }); Also note that the only way for callback to be an instance of Foo is situation Foo.bar(Foo.bar). only then it makes sense to compare callback === this.bar. However this is not what you want of course, because it will lead to infinite recursion.
downvote count: 0

http://stackoverflow.com/a/26986191
has comment: http://stackoverflow.com/comment/42505593
answers question: http://stackoverflow.com/q/26986156
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26986156
has body: JAVA check this.. import java.net.InetAddress; public class GetIPAddress { public static void main(String[] args) { try { InetAddress thisIp = InetAddress.getLocalHost(); System.out.println("IP:" + thisIp.getHostAddress()); } catch (Exception e) { e.printStackTrace(); } } } Another JAVA sample Code InetAddress Address = InetAddress.getLocalHost(); System.out.println(Address); Address = InetAddress.getByName("google.com"); System.out.println(Address); For JS Try this javaScript code it might help you. Superuser http://jsfiddle.net/
type: Answer
has comment: http://stackoverflow.com/comment/42506465
has comment: http://stackoverflow.com/comment/42506045
has comment: http://stackoverflow.com/comment/42511205
has comment: http://stackoverflow.com/comment/42505857

http://stackoverflow.com/comment/42345994
comment on: http://stackoverflow.com/q/26896256
score: 0
type: Comment
type: QuestionComment
has text: I do, but from what I understand it functions similar to the slice function? I'm new to this. But since it's a text entered by a user, I never know how long the text will be and therefor don't know the parameters of where to slice out the text.

http://stackoverflow.com/comment/42330330
score: 0
comment on: http://stackoverflow.com/q/26887640
type: Comment
type: QuestionComment
has text: That would make things easier for sure. I might have a hacky solution for you though: You can overlay a container over each page so it loads blank, when the page is ready you just fade that container away ;).

http://stackoverflow.com/q/26915134
score: 0
has comment: http://stackoverflow.com/comment/42379158
has body: In my page when creating a product successfully with a form, which uses a modal box, the modal goes away with an effect and then the page with the list of products should be "refreshed" with the new added item. However, the going away effect the modal does kind of destroys the flow of the animation because the list of items is loaded too soon. I don't want to throw a random number delay. I want to execute the function that loads the items right after the animation is finished. How can I do this? $(document).on('click', '#create-battery', function(event) { event.preventDefault(); $.post('/battery', $('#create-battery-form').serialize(), function(data) { if (data['status'] == true) { $('#errors').addClass('hidden'); $('#success').removeClass('hidden'); $('#success').html(data['message']); $('#add-new-battery').modal('hide'); // here is the hide effect renderBatteries(); // here is where all the products are loaded again in the list } else { $('#success').addClass('hidden'); $('#errors').removeClass('hidden'); $('#errors').html(data['errors']); $('#errors').addClass('top-buffer'); } }); }); EDIT Now when my renderBatteries() function is called the items are rendered. But the way this function is made it makes my notice messages go away: function renderBatteries(url, notice) { if (url === undefined || url === null) url = '/battery/all'; $.get(url, function(data) { $('#content').empty(); $('#content').append(data['view']); if (data['empty']) { $('#batteries-list').empty(); $('#content').append(' No batteries found in the database. '); } }); } I tried fixing it adding this last line: if (notice) { $('#success').html(notice); } However the notice appears for a short instant and then goes away. Why is this happening, if I am doing this after emptying the content? Here's how it looks like: function renderBatteries(url, notice) { if (url === undefined || url === null) url = '/battery/all'; $.get(url, function(data) { $('#content').empty(); $('#content').append(data['view']); …
answer count: 1
has title: Delay execution of JavaScript function after the one before is finished
has answer: http://stackoverflow.com/a/26915199
tagged with: twitter-bootstrap
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26915199
type: Question
has comment: http://stackoverflow.com/comment/42379143
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/26935884
has comment: http://stackoverflow.com/comment/42416462
has comment: http://stackoverflow.com/comment/42416109
has comment: http://stackoverflow.com/comment/42416406
tagged with: asp.net
has comment: http://stackoverflow.com/comment/42416887
favorite count: 0
has comment: http://stackoverflow.com/comment/42416357
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42416132
upvote count: 1
has answer: http://stackoverflow.com/a/26942830
has comment: http://stackoverflow.com/comment/42433487
has body: I'm Trying to call a function in the code behind an aspx page and getting nowhere with it. I've always used generic handlers (ashx files) but wanted to put some web methods in a page itself instead. I've gone right back to basics and created a new application with 1 page and simply added a button, a script reference (jQuery) and a script. There's 1 web method that simply returns a string. Here's the code... aspx <%@ Page Language="C#" AutoEventWireup="true" CodeFile="WebMethod.aspx.cs" Inherits="temp_WebMethod" %> Say Hello code behind using System; using System.Collections.Generic; using System.Web; using System.Web.Services; using System.Web.Script.Services; using System.Web.UI; using System.Web.UI.WebControls; public partial class temp_WebMethod : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } [WebMethod()] [ScriptMethod(UseHttpGet=false)] public static string Hello() { return "{\"response\":\"Hello world\"}"; } } As you can see, it's pretty basic and I just want to get the concept working before I start trying to use it. At the moment, I get the page returned to the ajax call, as if there's no method name at the end of the url. Also, if I put a breakpoint in the Hello() method then it's never triggered. I have looked at LOTS of websites (and plenty of questions here) and none of them have helped in the slightest. I'm properly at a loss as to why I can't get such a simple thing to work and would appreciate any help.
downvote count: 3
type: Question
has answer: http://stackoverflow.com/a/26940596
tagged with: c#
has comment: http://stackoverflow.com/comment/42416531
answer count: 2
score: -2
tagged with: javascript
tagged with: jquery
has title: Cannot trigger WebMethod (.Net 2.0 aspx)

http://stackoverflow.com/q/26875048
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
type: Question
has body: How can I call requireJS require(['app'], function() {}); only once at the beginning for the whole application so that any subsequent require(["..."], function(...){}); don't need to be wrapped within require(['app']? This is my set up: 1) Load require.js &lt;script data-main="js/app.js" src="requirejs/require.min.js"&gt;&lt;/script&gt; 2) Have app.js shims and basUrl configured properly. requirejs.config({ baseUrl: "scripts/js", paths: { "jquery": "../bower_components/jquery/dist/jquery.min", "modernizr": "../bower_components/modernizr/modernizr", . . . }, shim: { "jquery.migrate": ['jquery'], . . . } }); 3) Dynamically load JS on different pages: // Home Page require(['app'], function() { require(["jquery", "foundation", "foundation.reveal"], function ($, foundation, reveal){ $(document).foundation(); }); }); // Catalog Page require(['app'], function() { require(["jquery", "lnav/LeftNavCtrl","controllers/ProductCtrl", "controllers/TabsCtrl"], function ($, NavCtrl, ProductCtrl, TabsCtrl){ $(function() { NavCtrl.initLeftNav(); }); }); }); Unless I wrap with require(['app'], function()) each time I call require("...") to load external JS or AMD modules, the app is not initialized and I get JavaScript errors. The above code works but it's not very efficient. Is there a way to start my requireJS app before I try loading scripts? I tried calling at the very beginning right after I load require.min.js: require(["app"], function (app) { app.run(); }); but it didn't work.
tagged with: requirejs
has answer: http://stackoverflow.com/a/26876099
has title: Calling require(['app']) Only Once
has comment: http://stackoverflow.com/comment/42309055
tagged with: amd
upvote count: 1
answer count: 1
linked to: http://stackoverflow.com/q/15563348
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26876099

http://stackoverflow.com/q/26907752
has body: I have another question for you guys. I build a weather-app and I´m trying to show the times of the forecast in the x-axis which is working ok, but what´s strange is that the last value of the array is missing. Code for the axis looks like this: var axisscale = d3.scale.ordinal() .domain(arraytime) .rangeRoundBands([0, width]); console.log(arraytime); var xscale = d3.scale.linear() .domain([0, 100]) .range([0, width]); var xAxis = d3.svg.axis() .scale(axisscale) .tickValues(arraytime) .tickSize(6, 0) .orient("top"); And you can see my array called "arraytime" in the console.log in my deployed app: http://kidsvis.herokuapp.com/weather Best wishes, Karolin
has title: Using array of strings for axis but last one is missing
linked to: http://stackoverflow.com/q/12148188
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/26908461
tagged with: d3.js
upvote count: 1
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/42366644
accepted answer: http://stackoverflow.com/a/26908461
type: Question
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/26977874
upvote count: 3
score: 3
accepted answer of: http://stackoverflow.com/q/26939801
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42496031
has body: The markup in the CommentList component has incorrect closing tag syntax: Since that component has an opening tag, it should be closed with . In context: BROKEN: {comment.text} Fixed: {comment.text} # <--- / backslash was displaced
answers question: http://stackoverflow.com/q/26939801
has comment: http://stackoverflow.com/comment/42495384
type: Answer
has comment: http://stackoverflow.com/comment/42495085

http://stackoverflow.com/q/26898941
has answer: http://stackoverflow.com/a/74679374
has answer: http://stackoverflow.com/a/52464795
has answer: http://stackoverflow.com/a/35912177
has body: I am having some trouble getting a WKWebView in iOS 8 to display an alert dialog that is called from Javascript. After creating a standard WKWebView and loading an HTML file, I have a button on the page that creates a simple alert with some text. This works in UIWebView and in Google Chrome/Safari, but does not appear to be working in WKWebView. Any help is appreciated. My setup is as follows: WKWebViewConfiguration *config = [[WKWebViewConfiguration alloc] init]; config.allowsInlineMediaPlayback = YES; config.mediaPlaybackRequiresUserAction = false; _wkViewWeb = [[WKWebView alloc] initWithFrame:_viewWeb.frame config]; _wkViewWeb.scrollView.scrollEnabled = NO; NSString *fullURL = @"file://.../TestSlide.html"; NSURL *url = [NSURL URLWithString:fullURL]; NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:10]; [_wkViewWeb loadRequest:request]; The html has the following function: And a button: Test Alerts: This setup works in UIWebView and in regular browsers, but does not work in WKWebView. Am I missing something in the configuration? Should I be using one of the WK delegates to control the alert/confirm dialog behavior? Thank you.
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/40316507
score: 83
has comment: http://stackoverflow.com/comment/42388504
has answer: http://stackoverflow.com/a/33531327
has comment: http://stackoverflow.com/comment/42381970
upvote count: 83
accepted answer: http://stackoverflow.com/a/27067168
type: Question
downvote count: 0
tagged with: ios
tagged with: javascript
linked to: http://stackoverflow.com/q/43600624
tagged with: wkwebview
has answer: http://stackoverflow.com/a/27067168
has answer: http://stackoverflow.com/a/40316507
answer count: 7
favorite count: 0
has title: iOS WKWebView not showing javascript alert() dialog
has answer: http://stackoverflow.com/a/57745011

http://stackoverflow.com/q/26871249
type: Question
has comment: http://stackoverflow.com/comment/42303093
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/42301274
has body: I have the following html : You Tube video here... some text here Here, I have a slide which takes 70% of the width, while the other one (which includes You Tube video) takes 30% of the width. Under the YouTube video content I am having some text. I want to set height to this div which has text in such a way that the total height of right side content (you tube & text) will be equal to the height of left side content(slider). To do this I wrote JavaScript under "window.onload" and $(document).ready() but it is not calculating the height of the DIVs properly. I assume that JavaScript is running before EVERYTHING is loaded thereby giving wrong figures for the height at the initial load of the page. However window resize is working, but at the initial time, its not doing the calculation properly. This is my JS: Please let me know how to make it work in such a way that when the page loads FIRST TIME, I WANT TO SET THE HEIGHT TO THE TEXT DIV. Thanks a bunch,
type: UnansweredQuestion
has title: Calculate the height of a DIV based on other DIVs after loading the page including YouTube iframe
answer count: 0

http://stackoverflow.com/comment/88881484
type: Comment
comment on: http://stackoverflow.com/a/26941731
type: AnswerComment
has text: @amenadiel I have a query about feasibility of a feature. Can we click on row data of google map, lets say gray block which represents a building? I would like to click on it and change the block colour. Your suggestions and thoughts are welcomed.
score: 0

http://stackoverflow.com/a/26870756
answers question: http://stackoverflow.com/q/26870375
upvote count: 1
has comment: http://stackoverflow.com/comment/42306240
has comment: http://stackoverflow.com/comment/42304114
has body: Ah, without knowing the extent of the errors, I do see: objHammer1.on('panleft panright', fSwipe1(ev)); Here, you are rendering the function automatically, but what you actually want is to use a closure so that the function does not get rendered until the event gets hit. I'm not sure what ev represents, but if it is the event object, then this should work: objHammer1.on('panleft panright', fSwipe1); Where all you are doing is passing in the function that you want to be the callback and the even will automatically call this function and pass the event object as the first parameter. A few other things that I notice: make sure that you include the javascript library for Hammer Make sure that gSceneActual is defined before it is evaluated at gSceneActual===2 Make sure that jQuery library is included
has comment: http://stackoverflow.com/comment/42303985
downvote count: 0
score: 1
type: Answer

razor
tags question: http://stackoverflow.com/q/26978087
tags question: http://stackoverflow.com/q/26845505
type: Tag
tags question: http://stackoverflow.com/q/26888290
tag name: razor
tags question: http://stackoverflow.com/q/26970713

http://stackoverflow.com/q/26848479
score: 0
has comment: http://stackoverflow.com/comment/42264516
tagged with: javascript
has body: There is the following code (posts.js) : 'use strict' angular.module('myBlog.posts', [ 'myBlog.posts.controllers', 'myBlog.posts.directives', 'myBlog.posts.services', 'myBlog.posts.filters', 'ui.router' ]).config(['$stateProvider', '$locationProvider', function(stateProvider, locationProvider) { stateProvider.state('allPosts', { url: '/posts', templateUrl: 'modules/posts/views/posts.html', controller: 'PostController' }); stateProvider.state('singlePost', { url: '/posts/:id/:permalink', templateUrl: 'modules/posts/views/singlePost.html', controller: 'PostDetailsController' }); }]); and main code (app.js): 'use strict'; // Declare app level module which depends on filters, and services angular.module('myBlog', [ 'myBlog.posts', 'myBlog.controllers', 'myBlog.directives', 'myBlog.filters', 'myBlog.services' ]).run(['$state', function(state) { state.go('allPosts'); }]); I got no errors, but this code didn't work (i.e. after module loading I was not got to the 'posts' state. What's wrong?
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42265974
answer count: 0
has title: Angular UI Router - state.go after module running
type: Question

http://stackoverflow.com/comment/42239305
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26836795
has text: Added code @Jhecht thanks for suggesting.

http://stackoverflow.com/comment/42388893
score: 0
type: Comment
type: QuestionComment
has text: @explunit : Sir, after putting the value in dataset and after the whole code got run then a new code generated in the background of the html. That is the real code which shows the real visualization. So i want to store that new generated code in my database. Plz help me and if still you do not understand then plz tell me I will try again to make you clear.....
comment on: http://stackoverflow.com/q/26886117

http://stackoverflow.com/comment/42252991
comment on: http://stackoverflow.com/a/26844612
has text: Use `.getAttribute("data-" + key)` instead of `.data(key)`. Less expensive, and doesn't unnecessarily import the data into `jQuery.cache`.
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/comment/42445630
type: Comment
has text: @RuneJeppesen jquery isnt working properly
type: QuestionComment
comment on: http://stackoverflow.com/q/26951262
score: 0

http://stackoverflow.com/comment/42431232
score: 0
type: Comment
type: AnswerComment
has text: We have over hundreds of terms that needs to be replaced, although your suggestion might make sense and I will investigate if this would be a better approach!
comment on: http://stackoverflow.com/a/26933670

http://stackoverflow.com/comment/42455963
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26958582
score: 0
has text: Once you assign something like `MyConstructor.prototype.setAValue`, there's no need to do the assignment again via the NS property reference, because you're just updating the exact same prototype object.

http://stackoverflow.com/a/26986442
has comment: http://stackoverflow.com/comment/42539881
type: Answer
answers question: http://stackoverflow.com/q/26986348
score: 0
has body: Here's what you're trying to do: http://jsfiddle.net/1qkL4kuk/1/ You're close with your approach, but you'll want to add a key listening function like this: window.onkeyup = function(e) { var x = e.keyCode ? e.keyCode : e.which; if (x == 66 || x == 98) { fill = 'blue'; } else if (x == 82 || x == 114) { fill = 'red'; } else if (x == 71 || x == 103) { fill = 'green'; } else if (x == 89 || x == 121) { fill = 'yellow'; } else if (x == 80 || x == 112) { fill = 'purple'; } } and within your draw function, you'll just need to have: context.fillStyle = fill;
accepted answer of: http://stackoverflow.com/q/26986348
type: AcceptedAnswer

http://stackoverflow.com/comment/42493035
type: QuestionComment
comment on: http://stackoverflow.com/q/26978637
score: 0
has text: Indeed, I should have been more clear. Backbone is the most relevant one, I edited my post now.
type: Comment

http://stackoverflow.com/q/26916065
answer count: 1
downvote count: 0
tagged with: javascript
has title: Break the quantity (number) in a record and set them as array for option selection
has body: For example, There has been customer who has bought 4 of Product-One. And it has been insert to the table. Product Table: ---------------------------------- Product quantity ---------------------------------- Product-One 4 When customer bought that, they had not decided that they want to get the product at that time. They just want to save it with us. Next day, when the costumer need the product, they ask us to deliver the product. Since they had bought 4 of PRoduct-One, they can choose how many product they want us to deliver it to them. And now I don't know how to break the number of quantity, for example in product-One who has 4 quantity become 1,2,3,4 in dropdown selection. 1 2 3 4 Anybody help me,please. It is getting complicated for me. :/ Here is my blur php code: Product Quantity Pick <?php $resultsTicket = $mysqli->query("SELECT * FROM order_history WHERE member_name = '$member_name' ORDER BY id ASC"); if ($resultsTicket > 0) { while($obj = $resultsTicket->fetch_object()) { echo' $obj->product_name $obj->quantity Choose Quantity //IT SHOULD BE LOOPING AUTOMATICALLY HERE// '.{$Quantity_1}.' '.{$Quantity_2}.' '.{$Quantity_3}.' '.{$Quantity_4}.' '; } } ?> [UPDATE HERE] <?php $resultsTicket = $mysqli->query("SELECT * FROM orders_history WHERE customer_name = '$member_name' ORDER BY id ASC"); if ($resultsTicket > 0) { while($obj = $resultsTicket->fetch_object()) { echo' '.$obj->items.' '.$obj->quantity.' Choose Quantity for ($q = 1; $q <= $obj->quantity; $q++) { '.$q.' } '; } }
has comment: http://stackoverflow.com/comment/42380768
has comment: http://stackoverflow.com/comment/42380847
has comment: http://stackoverflow.com/comment/42383449
has comment: http://stackoverflow.com/comment/42380871
favorite count: 0
has answer: http://stackoverflow.com/a/26916121
upvote count: 2
has comment: http://stackoverflow.com/comment/42383681
has comment: http://stackoverflow.com/comment/42384417
has comment: http://stackoverflow.com/comment/42388278
has comment: http://stackoverflow.com/comment/42380850
tagged with: php
has comment: http://stackoverflow.com/comment/42384073
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42383545
has comment: http://stackoverflow.com/comment/42383771
has comment: http://stackoverflow.com/comment/42384481
has comment: http://stackoverflow.com/comment/42384514
has comment: http://stackoverflow.com/comment/42383640
accepted answer: http://stackoverflow.com/a/26916121
type: Question
score: 2
tagged with: sql

http://stackoverflow.com/q/26984134
tagged with: jqwidget
has title: How to add array to JQWidget pie chart?
type: AnsweredQuestion
type: Question
tagged with: charts
accepted answer: http://stackoverflow.com/a/27781685
tagged with: javascript
has body: I am trying to use a JQWidget pie chart. The initial example is in a text file, but I would like to use my own values in the chart. I have 4 sections (A,B,C,Unknown) that will add up to 100 to create the pie chart. Category A has a value of APercent Category B has a value of BPercent Category C has a value of CPercent Category Unknown has a value of UKPercent I am stuck trying to add all of the values to the pie chart. Currently my chart loads the four legends but without names and loads only one of the categories. var bigPie = []; bigPie.push({ A: APercent }); bigPie.push({ B: BPercent }); bigPie.push({ C: CPercent }); bigPie.push({ Unknown: UKPercent }); $(document).ready(function () { // prepare chart data as an array // prepare jqxChart settings var settings = { title: "Information", description: "Legs", enableAnimations: true, showLegend: true, showBorderLine: true, legendLayout: { left: 700, top: 160, width: 300, height: 200, flow: 'vertical' }, padding: { left: 5, top: 5, right: 5, bottom: 5 }, titlePadding: { left: 0, top: 0, right: 0, bottom: 10 }, source: bigPie, colorScheme: 'scheme03', seriesGroups: [ { type: 'pie', showLabels: true, series: [ { dataField: ‘A', displayText: ‘%', labelRadius: 170, initialAngle: 15, radius: 145, centerOffset: 0, formatFunction: function (value) { if (isNaN(value)) return value; return parseFloat(value) + '%'; }, } ] } ] }; Any help or suggestions would be appreciated. Thank you in advance. If I am not clear or too vague about something, then please let me know. Thank you again!
score: 0
tagged with: pie-chart
has answer: http://stackoverflow.com/a/27781685
answer count: 1
tagged with: jquery

http://stackoverflow.com/comment/42262814
has text: Thanks alot!This cleared some things i did not quite understand!
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26850115
type: Comment

http://stackoverflow.com/a/26885459
answers question: http://stackoverflow.com/q/26885135
has body: Here is the working demo: http://jsfiddle.net/silpa/3xkuybrf/6/ Replace the following lines: if ($('#listdata li').hasClass('bounce')) { $(this).removeClass( "bounce" ); } else { $(this).addClass( "bounce" ); } with the below line: $('#p'+index).addClass('bounce').siblings().removeClass('bounce'); The above line of code adds the class when you click on the div and the below code adds the class to the related div when you clcik on the marker: google.maps.event.addListener(marker, 'click', function() { $('#p'+index).addClass('bounce').siblings().removeClass('bounce'); infowindow.open( map, marker ); });
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/26885135

http://stackoverflow.com/q/26867872
has comment: http://stackoverflow.com/comment/42295006
upvote count: 1
has answer: http://stackoverflow.com/a/26867966
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42295017
score: -1
has comment: http://stackoverflow.com/comment/42294854
has title: select based on a value
has comment: http://stackoverflow.com/comment/42322075
possible better answer: http://stackoverflow.com/a/26867944
type: Question
has answer: http://stackoverflow.com/a/26867944
has body: I have the following html structure select blue red orange green blue red orange green I want when user clicks the , appropriate from should get selected automatically,
accepted answer: http://stackoverflow.com/a/26867966
tagged with: javascript
has comment: http://stackoverflow.com/comment/42294968
tagged with: jquery
favorite count: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/26868090
downvote count: 2

http://stackoverflow.com/comment/42299040
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26870089
score: 0
has text: A square bordered div with half-width border radius produces a circle...

http://stackoverflow.com/comment/42311374
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26876906
has text: I want to repeatedly (and randomly) call the randsplice() until the array is empty.
score: 0

http://stackoverflow.com/comment/54577659
type: Comment
comment on: http://stackoverflow.com/a/26837604
has text: Well, it shouldn't. And as you say, the nav buttons are _overlayed_, hence the window.innerHeight is still respected properly.
score: 0
type: AnswerComment

http://stackoverflow.com/a/29389750
answers question: http://stackoverflow.com/q/26928924
type: Answer
upvote count: 1
has body: 'data' from route resolve will not be available for injection to a controller activated other than route provider. it will be available only to the view configured in the route provider. if you want the data to the controller activated directly other than routeprovider activation, you need to put a hack for it. see if this link helps for it: http://www.johnpapa.net/route-resolve-and-controller-activate-in-angularjs/
downvote count: 0
score: 1

http://stackoverflow.com/comment/42321451
has text: You are declaring the module twice: angular.module('app1','[ngRoute]'). The furthers calls should be angular.module('app1')
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26882510
score: 0

http://stackoverflow.com/q/26979466
tagged with: javascript
has title: Use a property name stored in a var, dot and bracket notation
has answer: http://stackoverflow.com/a/26980729
score: 0
has comment: http://stackoverflow.com/comment/42493399
answer count: 2
has comment: http://stackoverflow.com/comment/42493465
has body: I'm on the bracket and dot notation challenge in JS, I understand (more or less) how it works, but I can't with a little point: Why I can't use Dot Notation whwn a property name is stored in a variable? This is undefined: var car = { seats: "cloth", engine: "V-6" }; var s = "seats"; function show_seat_type(sts) { window.alert(car.sts); // undefined } show_seat_type(s); This is OK var car = { seats: "cloth", engine: "V-6" }; var s = "seats"; function show_seat_type(sts) { window.alert(car[sts]); // works } show_seat_type(s); But why? Thanks guys.
tagged with: variables
tagged with: properties
possible better answer: http://stackoverflow.com/a/26980729
type: AnsweredQuestion
tagged with: notation
type: Question
has answer: http://stackoverflow.com/a/26979678
accepted answer: http://stackoverflow.com/a/26979678

http://stackoverflow.com/a/26875135
score: 0
has body: Yes you can either make the bucket itself publicly accessible: or grant permissions to everyone on a specific subfolder/object of your s3 Bucket by adding the following bucket policy: { "Version": "2012-10-17", "Id": "123", "Statement": [ { "Sid": "", "Effect": "Allow", "Principal": "*", "Action": "s3:**", "Resource": "arn:aws:s3:::mybucket/public/*" } ] }
type: Answer
answers question: http://stackoverflow.com/q/26857584

http://stackoverflow.com/q/26833350
score: 0
has comment: http://stackoverflow.com/comment/42233973
has title: need help understanding google endpoint javascript
answer count: 1
tagged with: javascript
tagged with: google-cloud-endpoints
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/26833378
accepted answer: http://stackoverflow.com/a/26833378
has body: How the object defined in the script element is referenced in other scripts? If somebody understands what's going on here, please explain.

http://stackoverflow.com/a/26930010
has body: var jsonObj = '{ "total_rows":7, "offset":0, "rows":[ { "id":"637184110f5faea091fdbdcf618a353a", "key":"637184110f5faea091fdbdcf618a353a", "value":{ "rev":"1-f59c856e98e1c5f11578562778d8cf3b" } }, { "id":"637184110f5faea091fdbdcf618b85d2", "key":"637184110f5faea091fdbdcf618b85d2", "value":{ "rev":"1-17731aef6d1d52e0d2ad03e2772d1a0a" } } ] }'; First you can even do this without using jQuery. Without jQuery:- for(i=0; i&lt; string.rows.length; i++){ alert(string.rows[i].id); alert(string.rows[i].key); alert((string.rows[i].value.rev)); } With jQuery $.each(jsonObj, function(key, value){ console.log(key, value); })
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26928705

http://stackoverflow.com/comment/42460400
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26960496
has text: The optimal solution depends on the design of your app. You can store min/max values somewhere. You can add extra check into template: `{{#each gridrow in grid}}{{#if gridrow}}{{#each spot in gridrow}}{{#if spot}}some_stuff{{/if}}{{/each}}{{/if}}{{/each}}`. But these if helpers won't work if the corresponding item equals 0. So, you can turn your array items into objects: `{value: 0}`.

http://stackoverflow.com/a/26963005
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/42464027
has body: You refer to reducRate in some places and reduceRate in others. Change all the references of reducRate to reduceRate. Also, your if statments are incorrect for getting the rate. You should use else if conditions to fix this: function getRate(amountPurchased) { if (amountPurchased &lt;= 500) { return 0.02; } else if (amountPurchased &lt;=9000) { return 0.04; } else if (amountPurchased &lt;= 15000) { return 0.05; } else { // amountPurchased &gt; 15000 return 0.09; } } console.log(getRate(0) == 0.02); console.log(getRate(500) == 0.02); console.log(getRate(501) == 0.04); console.log(getRate(9000) == 0.04); console.log(getRate(9001) == 0.05); console.log(getRate(15000) == 0.05); console.log(getRate(15001) == 0.09); And you should parse amountPurchased as a float. Right now it's a string: amountPurchased = parseFloat(prompt("Valued customer, please enter the amount of cement you would like to purchase." )); By the way, two of your conditions will return true for 15000: if (amountPurchased &lt;= 15000) if (amountPurchased &gt;= 15000)
answers question: http://stackoverflow.com/q/26962855
upvote count: 2
has comment: http://stackoverflow.com/comment/42464122
score: 2

http://stackoverflow.com/comment/115777237
type: Comment
comment on: http://stackoverflow.com/a/65194913
has text: I can observed your insistence on "not to tell someone to repeat a code" without stating the implications which will certainly convince me to stop as you want. But not only your series of "don't". Or what else do even mean please. Thanks for your anticipated cooperation.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42249538
type: QuestionComment
has text: Best !== most efficient. Any > none.
score: 0
comment on: http://stackoverflow.com/q/26842858
type: Comment

http://stackoverflow.com/q/26850592
tagged with: javascript
tagged with: jquery
score: 4
favorite count: 0
tagged with: jquery-select2
answer count: 5
has answer: http://stackoverflow.com/a/42221361
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/32379121
type: Question
has answer: http://stackoverflow.com/a/26851093
has answer: http://stackoverflow.com/a/46281704
has body: I'm using the jquery-select2 plugin, and I have the following field that is being autopopulated by AJAX: &lt;input type="hidden" id="player2" class="form-control select2"&gt; Here is the javascript: $('#player2').select2({ placeholder: "Select an opponent", allowClear: false, ajax: { dataType: "json", url: "getUsers.php", data: function (term) { return { q: term, // search term }; }, results: function (data) { console.log(data); return {results: data}; }, } }); console.log($("#player2").select2("val")); The data, as shwon in the console.log within the results function, is structured like this: [{"id":"someone@gmail.com", "text":"someone"}] After the choice is selected, trying to console.log($("#player2").select2("val")) gives me the ID, but I can't seem to get the text. None of the following works to get the text value of "someone" in this case and I don't see where I'm going wrong. $("#player2 option:selected").text() $("#player2 option:selected").select2().text() $("#player2").text()
tagged with: jquery-select2-3
has answer: http://stackoverflow.com/a/43913218
has title: jquery-select2 obtaining ID and text from a select box?
upvote count: 4
downvote count: 0

http://stackoverflow.com/comment/42867240
type: QuestionComment
has text: what happens when you click? is the animate method called? is the index correct?
comment on: http://stackoverflow.com/q/26987706
score: 0
type: Comment

http://stackoverflow.com/q/26869913
type: Question
tagged with: javascript
has title: javascript returning object htmlelement
has comment: http://stackoverflow.com/comment/42298879
score: 0
has comment: http://stackoverflow.com/comment/42298665
linked to: http://stackoverflow.com/q/16126960
answer count: 1
has answer: http://stackoverflow.com/a/26870571
accepted answer: http://stackoverflow.com/a/26870571
has comment: http://stackoverflow.com/comment/42298609
has comment: http://stackoverflow.com/comment/42298613
type: AnsweredQuestion
has body: I'm working on a calculator application. I created the following function to push the the current function to a div to display itself. function addtoScreen(vTag){ var screen = document.getElementById("screen"); if(currentFunction.length == 1){ var newCalc = document.createElement("p"); newCalc.setAttribute("class", "calc"); var opInt = "&lt;span&gt;"+vTag+"&lt;/span&gt;"; newCalc.innerHTML = opInt; screen.innerHTML = newCalc; }else{ var opInt = "&lt;span&gt;"+vTag+"&lt;/span&gt;"; newCalc = document.getElementById("screen").lastElementChild; newCalc.innerHTML = opInt; } } The if portion keeps returning [object HTMLParagraphElement] what am I doing wrong? I have tried to use .value but that just returns a null because the object is a entire element that does not have a value attribute. Edit: I didn't mention that vTag is just a string being passed through from a function that pushs to a array.
tagged with: dom

http://stackoverflow.com/comment/42331906
type: Comment
type: QuestionComment
score: 0
has text: I'm sorry for the mistakes, I'm a beginner ate programming. The comments on the code is what I'm trying to do
comment on: http://stackoverflow.com/q/26888585

http://stackoverflow.com/q/26882418
has title: V-Scrollable content with fixed header, both h-scrolling + fixed sidebars?
tagged with: chrome-for-android
downvote count: 0
favorite count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: css
score: 2
answer count: 0
has body: I'm trying to find a suitable layout for Snap.js: http://jakiestfu.github.io/Snap.js/demo/apps/default.html The issues with the recommended HTML / CSS are: Header (navigation bar) is not sticky Address bar does not hide in Chrome for Android as you scroll the main content down Fixed sidebars don't move in sync with address bar In my below fiddle, the main content is v-scrollable a little (?!) while it's moving to the right I would like to have the header fixed, but it still needs to scroll vertically along with the content area. CSS doesn't seem to support this, so I tried a scripted solution: animate(); function animate() { requestAnimFrame(animate); draw(); } function draw(){ var pos = content.offset(); nav.css('transform', 'translateX('+ pos.left +'px)'); } http://jsfiddle.net/HFjU6/2533/ Please tell me other options if there are any, I'm afraid of a broken UI if JS is disabled. To make the address bar go away (a.k.a. "full-screen mode"), I had to make the content position: static;. Downside: the v-scrollbar shows at the right window border, not at the right side of the content area. Is there another way? The sidebars with position: fixed are independently scrollable from the main content if they contain overly tall content. The problem: they don't move together with the address bar, but are re-positioned once the address bar is fully gone (standard behavior in Chrome for Android is to move the content in sync with the address bar, which sticks to the swipe input for a nice transition). It works for position: absolute;, but that will make my sidebars scroll with the main content and you will see body background below 100% of the original height. I can scroll the main content area slightly to the left while it is translated to the right and breaks the layout (may only apply to touch devices, but possibly to desktops too if you use the middle mouse button for panning). Why is this happening?
tagged with: scroll
type: Question
tagged with: javascript

http://stackoverflow.com/q/26974888
has answer: http://stackoverflow.com/a/26984622
type: Question
has comment: http://stackoverflow.com/comment/42488023
has title: Fastest way to retrieve user input in meteor
tagged with: javascript
score: 0
answer count: 1
tagged with: meteor
has body: I was wondering what is the best ( fatest (and?) safest way to retrieve user input in meteor. It is Javascript, I know that there is jQuery so I came with two solutions personaly : FIRST ONE : In the HTML, with only the input : &lt;input id='input1' type='text' /&gt; that I retrieve with : Template{( 'event #input1' : function(){ // event like change or keyup var data = $('#input1').val()... ... etc... or SECOND : In the HTML, with only the input : &lt;form&gt; &lt;input name='input1' id='input1' type='text' /&gt; &lt;/form&gt; that I retrieve with : Template{( 'submit form' : function(e){ e.prenventDefault(); //avoid page refresh var data = $(e.target).find('[name=input1]').val()... //Is this faster because it only search the data in the form and not in the whole page ? ... So what do you use ? And why ? Is the form element still usefull ? Only for handling several inputs, safer, faster ?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42490795

http://stackoverflow.com/comment/42488357
type: Comment
type: QuestionComment
has text: You got the A, B,C inheritance all wrong. A Dog is an Animal but an Animal is not necessarily a Dog so setting one prototype to equal another is wrong. You can use Object.create instead. The following answer may help: http://stackoverflow.com/questions/16063394/prototypical-inheritance-writing-up/16063711#16063711
comment on: http://stackoverflow.com/q/26971262
score: 0

http://stackoverflow.com/a/26834891
accepted answer of: http://stackoverflow.com/q/26834795
has body: You can just do: var object = { access: [{ actionName: "Defending", action: function(unit) { } }, { actionName: "Mining", action: function(unit) { object.promises.push($interval(function() { // Here I need to access the variable promise from the above scope // do something }, 1000)); } }, { actionName: "Cutting wood", action: function(unit) { object.promises.push($interval(function() { // Same here // do something }, 1000)); } }], promises: [] };
answers question: http://stackoverflow.com/q/26834795
score: 3
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 3

http://stackoverflow.com/comment/42447933
has text: That is the best answer so far, but it has the bad side of then having the functions not handled as source code in most IDEs if not all
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26854238

http://stackoverflow.com/q/26881621
favorite count: 0
has title: Restrict container/parent for Sortable
type: Question
tagged with: css
has comment: http://stackoverflow.com/comment/42322976
has comment: http://stackoverflow.com/comment/42323733
upvote count: 3
has body: OK, so here I am again, playing with @RubaXa's Sortable plugin (and hopefully he is somewhere around here, as this one is simply rather complicated...) A few discoveries (it took me some time to fully understand the mechanism, but I think I'm quite right) Case 1 if we set one div with same-type contents, it's instantly sortable. E.g.: HTML Item 1 Item 2 JavaScript new Sortable(document.getElementById("myContainer")); Demo: http://jsfiddle.net/b02wfe4o/ Case 2 if we set one div with different-type contents (e.g. h2s and h3s, we also have to specify the draggable class. E.g.: HTML Item 1 Item 2 JavaScript new Sortable(document.getElementById("myContainer"), { draggable: '.myDraggable' }); Demo: http://jsfiddle.net/qemz00eq/1/ Case 3 if we set 2 (or more) divs, side-by-side, it works pretty much the same way. E.g.: HTML Item 1.1 Item 1.2 Item 2.1 Item 2.2 JavaScript new Sortable(document.getElementById("myContainer1"), { draggable: '.myDraggable' }); new Sortable(document.getElementById("myContainer2"), { draggable: '.myDraggable' }); Demo: http://jsfiddle.net/qeyxxj4y/ THE ISSUE Now, what if sortable A is a child of sortable B? HTML Item 1.1 Item 1.2 Item 2.1 Item 2.2 JavaScript new Sortable(document.getElementById("myContainer1"), { draggable: '.myDraggable' }); new Sortable(document.getElementById("myContainer2"), { draggable: '.myDraggable' }); Demo: http://jsfiddle.net/j7fesLkp/8/ Well, now this does not work as expected: myContainer2 items can be moved/sorted perfectly within their container. Which is fine. myContainer1 items though can be moved in myContainer2 as well, I mean take element 1.1 and put it inside myContainer2 works - which wasn't happening when the two containers were side-by-side. So, how can we disable that behaviour? I mean: each container's items must move ONLY within that container and not within its children. How can that be done?
answer count: 1
has answer: http://stackoverflow.com/a/26884916
tagged with: javascript
tagged with: jquery
tagged with: rubaxa-sortable
accepted answer: http://stackoverflow.com/a/26884916
type: AnsweredQuestion
score: 3
tagged with: http://stackoverflow.com/tag/html
downvote count: 0

http://stackoverflow.com/q/26956208
upvote count: 1
has body: I want to get the value of the background attribute (background.jpg) inside square bracket like BBCode editor's and I tried this regexp \[(\w+)[^\]]*](.*?)\[\/\1]/g but it didn't work. [code background="background.jpg"] Here some text [/code]
tagged with: regex
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/26956269
score: 1
has answer: http://stackoverflow.com/a/26956269
accepted answer: http://stackoverflow.com/a/26956235
type: Question
tagged with: javascript
answer count: 2
has title: How to get attribute inside square brackets with JavaScript
downvote count: 0
tagged with: bbcode
has comment: http://stackoverflow.com/comment/42451866
favorite count: 0
has answer: http://stackoverflow.com/a/26956235

http://stackoverflow.com/q/26895366
has comment: http://stackoverflow.com/comment/42344192
upvote count: 0
type: UnansweredQuestion
score: -3
has body: Please see my code H1 text H1 text H1 text P2 P2 P2 How is it that when my page is loaded I see in paragraph P2 the same text? Why don't I see "undefined" or "null" written in it?
has answer: http://stackoverflow.com/a/26895712
tagged with: dom
has title: DOM Navigation - unexpected value
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/42347159
tagged with: javascript
has comment: http://stackoverflow.com/comment/42346533
favorite count: 0
downvote count: 3
has answer: http://stackoverflow.com/a/26897164

http://stackoverflow.com/q/26877066
tagged with: javascript
has answer: http://stackoverflow.com/a/26877138
has body: I have a chrome extension that, when clicked, needs to display a modal to the user. For convenience we would like to pull all the necessary code for the modal from a server and then execute the JavaScript in the context of the extension, before displaying anything to the user. (running a Node.js server) Is there a way to do this? If not, any suggestions on alternative routes we could take? cheers!
score: 0
tagged with: google-chrome-extension
answer count: 1
type: UnansweredQuestion
tagged with: node.js
tagged with: google-chrome
type: Question
has title: Receive then implement .js files from server in a chrome extension

http://stackoverflow.com/comment/42255737
type: QuestionComment
has text: ...preferably all of the above
score: 1
comment on: http://stackoverflow.com/q/26846302
type: Comment

http://stackoverflow.com/comment/42575535
type: Comment
comment on: http://stackoverflow.com/a/26994983
type: AnswerComment
has text: @PandaYang Correction: JS regex is weak compared to PCRE regex. I would suggest to use different regexes in this case.
score: 0

http://stackoverflow.com/comment/42443953
has text: https://github.com/inexorabletash/polyfill
type: Comment
comment on: http://stackoverflow.com/q/26951575
score: 0
type: QuestionComment

http://stackoverflow.com/comment/42373231
comment on: http://stackoverflow.com/a/26911797
type: AnswerComment
score: 0
type: Comment
has text: Welcome to SO and thanks for answering! I suggest you try to edit this answer with some additional info. And you should remove the last sentence as it doesn't help answer the question. Thanks! (You risk having this answer deleted if it's not improved).

angularjs-scope
tags question: http://stackoverflow.com/q/26925995
tags question: http://stackoverflow.com/q/26898132
tags question: http://stackoverflow.com/q/26973551
tags question: http://stackoverflow.com/q/26874595
tags question: http://stackoverflow.com/q/26836682
tags question: http://stackoverflow.com/q/26954389
tags question: http://stackoverflow.com/q/26963460
tags question: http://stackoverflow.com/q/26966232
tags question: http://stackoverflow.com/q/26839773
tags question: http://stackoverflow.com/q/26965043
tags question: http://stackoverflow.com/q/26850993
tags question: http://stackoverflow.com/q/26895567
tags question: http://stackoverflow.com/q/26940118
tags question: http://stackoverflow.com/q/26921090
tags question: http://stackoverflow.com/q/26841462
tags question: http://stackoverflow.com/q/26961573
tags question: http://stackoverflow.com/q/26884510
tag name: angularjs-scope
tags question: http://stackoverflow.com/q/26851657
tags question: http://stackoverflow.com/q/26860780
tags question: http://stackoverflow.com/q/26907428
tags question: http://stackoverflow.com/q/26895344
tags question: http://stackoverflow.com/q/26985797
tags question: http://stackoverflow.com/q/26893952
tags question: http://stackoverflow.com/q/26963347
tags question: http://stackoverflow.com/q/26930558
tags question: http://stackoverflow.com/q/26915136
type: Tag

http://stackoverflow.com/a/26981813
downvote count: 0
score: 1
has body: You need to use a .filter(): array.filter(function(v){return v.val==1}).length
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/26981766

http://stackoverflow.com/a/26966466
score: 1
upvote count: 1
has body: Try to modify 'focus' method like this : $('textarea.expand').focus(function () { if($(this).val()==="" || $(this).height() &lt; 100) { $(this).animate({ height: "100px" }, 300); } }); May it will help you.
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26966398
accepted answer of: http://stackoverflow.com/q/26966398
type: Answer

http://stackoverflow.com/comment/42317265
has text: Not sure what all you want to do once you find said words, but a regexp should handle it quickly and easily. Example below.
comment on: http://stackoverflow.com/q/26880198
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/26902760
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
has comment: http://stackoverflow.com/comment/42357376
has answer: http://stackoverflow.com/a/26902831
answer count: 1
downvote count: 0
tagged with: javascript
has body: I have a global array like: var myArray = []; And it has various elements in it. I need to create a new array with the same contents and then reverse it like this: newArray = myArray; newArray = newArray.reverse(); However when I do this, it reverses both the myArray and newArray. What am I doing wrong? Thanks!
favorite count: 0
has title: New array overwriting global array
accepted answer: http://stackoverflow.com/a/26902831
has comment: http://stackoverflow.com/comment/42357387

jqbootstrapvalidation
type: Tag
tag name: jqbootstrapvalidation
tags question: http://stackoverflow.com/q/26847110

http://stackoverflow.com/q/26928792
has comment: http://stackoverflow.com/comment/42406425
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: ckeditor
favorite count: 0
has comment: http://stackoverflow.com/comment/42461285
upvote count: 3
has body: How can the default line-height be reduced on the ck-editor. It's little too high at the moment, since I have upgraded it to the version 4.4.5 Is there any property available to do this?
has answer: http://stackoverflow.com/a/26931053
has title: How to decrease the line height in ckeditor 4.4.5?
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/42976692
accepted answer: http://stackoverflow.com/a/42976692
possible better answer: http://stackoverflow.com/a/26931053
has comment: http://stackoverflow.com/comment/42403349
type: Question

http://stackoverflow.com/comment/42483723
comment on: http://stackoverflow.com/q/26937871
score: 0
type: Comment
type: QuestionComment
has text: Just when I thought I had it working IE has to go and throw a kink in my plans lol I may have to completely re-write this functionality unless anyone else knows of a likewise way to export to excel from IE. I appreciate the help. If anyone has any other ideas please feel free to let me know as it would help out tremendously.

http://stackoverflow.com/a/26946935
has body: Maybe you can replace the material.map with： map: THREE.ImageUtils.loadTexture('images/crate.jpg')
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26944839

http://stackoverflow.com/a/26907147
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42367818
downvote count: 0
answers question: http://stackoverflow.com/q/26906961
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26906961
has body: document.getElementById(three) returns no match (thus the undefined). You're passing an element to your function multiply as parameter three, and you're later using it as a string representing the ID of it. If three is verified to be an element, don't call document.getElementById(three).value in first place, but directly three.value.

http://stackoverflow.com/comment/42489174
comment on: http://stackoverflow.com/q/26977008
has text: I think I'd have issues again with obtaining the correct box size, and not have the right effects on the image (drop shadow)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26976212
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42823175
tagged with: angularjs-directive
has body: Trying to add an asyncvalidator to my custom username validator. However it outputs the error: TypeError: Cannot set property 'username' of undefined. How to I make asyncvalidator defined? I thought i would have been automatically by the NgModel controller? &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"&gt;&lt;/script&gt; angular.module('myApp.commonDirectives', ['myApp.services']).directive('username', ['UsernameService',function(UsernameService){ return { restrict: 'A', require: "ngModel", scope: { hasFocus: "=username" }, link: function(scope, element, attrs, ctrl) { scope.$watch('hasFocus', function(hasFocus) { if(angular.isDefined(hasFocus)) { // on blur if(!hasFocus) { ctrl.$validated=false; ctrl.$asyncValidators.username = function(value){ UsernameService.validate(value) .then(function(resolvedData) { if(resolvedData) { ctrl.$validated=true; ctrl.$setValidity('checking', true); // ctrl.$setValidity('username', true); } else { ctrl.$validated=true; ctrl.$setValidity('checking', false); // ctrl.$setValidity('username', false); } } ); } } // on focus else { ctrl.$setValidity('username', true); ctrl.$setValidity('checking', true); } } }); } } }])
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27189337
has title: Angular JS custom validation $asyncvalidator is undefined
tagged with: javascript
tagged with: angularjs-validation
score: 0
has comment: http://stackoverflow.com/comment/51409728
has answer: http://stackoverflow.com/a/26976422
tagged with: angularjs

http://stackoverflow.com/q/26838319
tagged with: node.js
tagged with: mustache
type: AnsweredQuestion
has body: Environment: Node, Express, Mu2Express, mongoose What I want to do is get an array from mongoose and have the template render each value as its own radio button. Can't find an example. What I currently have: The route in app.js: app.get('/mutest',function(req, res){ var data = [1,2,3,4]; res.render('muTest',{ 'locals': { data: data }}); }); The template (muTest.mustache) &lt;form name="test" action="muTest" method="post"&gt; {{#data}} &lt;input type="radio" name="choice" value={{data}}&gt;{{data}}&lt;br/&gt; {{/data}} &lt;input type="submit" value="Submit"&gt; &lt;/form&gt; The result: 1,2,3,4 1,2,3,4 1,2,3,4 1,2,3,4 and, of course, choosing any of the buttons submits the value of "1,2,3,4". What I want: is for the page to be rendered like this: 1 2 3 4 with a single value (e.g. the string "3") submitted. TIA for any suggestions!
has title: Node Mustache: How to get each value of an Array on a separate Radio Button?
type: Question
tagged with: javascript
tagged with: express
score: 0
answer count: 1
tagged with: mongoose
has answer: http://stackoverflow.com/a/26872680
accepted answer: http://stackoverflow.com/a/26872680

http://stackoverflow.com/a/26868998
has comment: http://stackoverflow.com/comment/42297483
score: 0
has comment: http://stackoverflow.com/comment/42297050
has body: You can add this little function in your click handler: event.stopPropagation()
has comment: http://stackoverflow.com/comment/42297000
type: Answer
answers question: http://stackoverflow.com/q/26868949
has comment: http://stackoverflow.com/comment/42297069

http://stackoverflow.com/comment/42465334
score: 0
comment on: http://stackoverflow.com/q/26961605
type: QuestionComment
type: Comment
has text: Ok got that - thought earlier that you targeted one of those touch-emulated virtual gamepad stick like widgets.

http://stackoverflow.com/comment/42482505
score: 0
type: Comment
has text: yes...if a user search for a particular lat and long ...using auto complete it will mark on the maps with border rectangular with blink ..i.e.border blinking
type: AnswerComment
comment on: http://stackoverflow.com/a/26971964

http://stackoverflow.com/a/26890638
answers question: http://stackoverflow.com/q/26889988
type: Answer
has comment: http://stackoverflow.com/comment/42335415
downvote count: 1
upvote count: 0
has body: $("img").draggable({ containment: "parent" }); and remove .active
score: -1

http://stackoverflow.com/comment/42376263
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26876638
type: Comment
has text: Related: http://crypto.stackexchange.com/q/20183/1172 . **Do read the part about OFB!**

http://stackoverflow.com/comment/42366994
comment on: http://stackoverflow.com/q/26908215
type: QuestionComment
type: Comment
has text: See my answer. You have no `$query` if there are no `$_GET["p"]`, so you can not fetch that object, since, it's not exists.
score: 0

http://stackoverflow.com/a/26945976
answers question: http://stackoverflow.com/q/26861006
score: 8
upvote count: 8
has body: Your current approach of calling the formatAccountName method works. The following jsfiddle shows this: http://jsfiddle.net/v4h11qac/ The problem is likely caused by another error that has not been handled correctly, resulting in the code not being run. You should fix the existing errors and the method call should work as expected. Orignal Answer: You could call the method directly on the prototype object: LandingView.prototype.formatAccountName(); If you need to pass through a new context you can use the call or apply method as below: LandingView.prototype.formatAccountName.call(context); A better approach might involve creating a helper module that can be shared by both views. var viewHelpers = { formatAccountName: function(account) { // ... } }; var ViewOne = Backbone.View.extend({ render: function() { var formattedName = viewHelpers.formatAccountName(this.model); // ... } }; var ViewTwo = Backbone.View.extend({ render: function() { var formattedName = viewHelpers.formatAccountName(this.model); // ... } }; You could also use a system bus, however that may be a little too heavy for such a use case. If you want to take a look at that path, then Backbone.Radio provides a request/response pattern which could be used to fulfill this requirement.
accepted answer of: http://stackoverflow.com/q/26861006
type: Answer
has comment: http://stackoverflow.com/comment/42508864
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42651229

http://stackoverflow.com/comment/42413094
type: Comment
comment on: http://stackoverflow.com/a/26897777
score: 0
type: AnswerComment
has text: Yeah that is the general idea, you will have to have a form submit method in your button handler, because you are removing the standard submit input type.

http://stackoverflow.com/q/26978288
has body: There are plenty of ways to monitor ajax request latency, render/paint times, etc., but I can't figure out how to record the same metrics for websocket performance. Is there an easy way to hook into a request and measure it's performance with javascript?
answer count: 0
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/42495532
tagged with: google-chrome-devtools
tagged with: websocket
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/42724626
has title: Can websocket latency be monitored/recorded with javascript?

http://stackoverflow.com/a/26905691
upvote count: 3
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/26905573
accepted answer of: http://stackoverflow.com/q/26905573
has body: The jqobj param is an array of DOM elements so you can use jqobj[0] but test the size of the array if it is not empty like jqobj.length &gt; 0
score: 3

http://stackoverflow.com/comment/42234449
comment on: http://stackoverflow.com/a/26833482
has text: Interesting. I did not know that about `console.log` that is definitely what is going on then. I'm modifying the value in a directive so it must not just be propagating up yet. Thanks for the pointers and info!
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/a/26845598
score: 5
downvote count: 0
has body: So it looks like you want the flippanel class items to hide themselves when you click "flip it"? I would then recommend you instead put these inside of a div so that when you click on it, the whole div collapses. That way you can do something like: $(".flip").click(function(){ $(this).children().toggle(); }); If you think this is the code for you, but don't like that everything inside of the div is clickable, you can add the following code Additionally, if you think this is the solution for you, you could add the following code which will make it such that only the "Flip it!" part is clickable. I've updated my fiddle below to include this code. $(".flippanel").click(function( event ) { event.stopPropagation(); }); I've made a JSFiddle for you if you click this line to look.
type: Answer
has comment: http://stackoverflow.com/comment/42255094
has comment: http://stackoverflow.com/comment/42254753
upvote count: 5
has comment: http://stackoverflow.com/comment/42257700
has comment: http://stackoverflow.com/comment/42257502
answers question: http://stackoverflow.com/q/26845465

conflict
tag name: conflict
type: Tag
tags question: http://stackoverflow.com/q/26945426

http://stackoverflow.com/a/26868521
type: Answer
accepted answer of: http://stackoverflow.com/q/26867832
answers question: http://stackoverflow.com/q/26867832
has body: You need to call your fadeIn action after your fadeOut action is complete. I'm not able to test the code, but this should work. Change: currentSlide.fadeOut(600).removeClass('active-slide'); nextSlide.fadeIn(600).addClass('active-slide'); To this: currentSlide.fadeOut(600, function(){ $('.active-slide').removeClass('active-slide'); nextSlide.fadeIn(600).addClass('active-slide'); });
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/26911790
type: Question
accepted answer: http://stackoverflow.com/a/26918620
has body: I have a JavaScript function running in Google Drive folder of many spreadsheets that is currently logging dates into the log; function convertDates(){ var ui = SpreadsheetApp.getUi(); SpreadsheetApp.getActiveSpreadsheet().toast('Conversion Started With First Row Date Cells','Conversion', 5); Logger.log('Date Conversion Started'); var activeCell = SpreadsheetApp.getActiveSpreadsheet().getActiveCell(); var cell = activeCell.getValue(); Logger.log(cell); } How would one convert the output of 'cell' which currently looks like: May 03, 2014 at 05:19PM Into a Unix Time stamp within Javascript? I am inclined to believe that this can involve the Date() function but am unsure. Thank's in Advance.
tagged with: google-sheets
tagged with: javascript
has answer: http://stackoverflow.com/a/26912025
has answer: http://stackoverflow.com/a/26918620
tagged with: google-apps-script
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/26946149
has title: Conversion of Date to UNIX Timestamp
has comment: http://stackoverflow.com/comment/42375378
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26946149

http://stackoverflow.com/comment/42359457
type: QuestionComment
type: Comment
has text: @NitsanBaleli the function gives weather data . I want that data in bootstrap popever , whnever i click on that button, it should popover with data in it.
score: 0
comment on: http://stackoverflow.com/q/26904010

http://stackoverflow.com/a/26934359
has body: Probably because HTML doesn't render new lines the way you're expecting. Try &lt;br&gt; instead.
has comment: http://stackoverflow.com/comment/42414011
accepted answer of: http://stackoverflow.com/q/26934180
answers question: http://stackoverflow.com/q/26934180
has comment: http://stackoverflow.com/comment/42413556
has comment: http://stackoverflow.com/comment/42414209
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/26938661
has comment: http://stackoverflow.com/comment/42421717
accepted answer of: http://stackoverflow.com/q/26938524
type: Answer
score: 4
upvote count: 4
has body: Three possibilities I can see here: Your script has a colon instead of double quote If the (1) is just a copy/paste error - your double quotes over "script.js" are wrong type (if you have copied/pasted this code from somewhere - just type them manually) JavaScript is disabled in your browser(some browsers such as Internet Explorer will not load the JavaScript unless it served from a webserver such as apache or IIS for example). To test if it is a browser issue place the javascript in a &lt;script&gt;&lt;/script&gt; tag right before the closing &lt;/body&gt; tag. If it works using the following code then it an issue with your browser. Example: &lt;script&gt; alert("hello world"); &lt;/script&gt; &lt;/body&gt;&lt;!--above script should be placed before this tag --&gt;
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26938524

http://stackoverflow.com/a/26857969
has comment: http://stackoverflow.com/comment/42277856
has comment: http://stackoverflow.com/comment/42277720
accepted answer of: http://stackoverflow.com/q/26857915
type: Answer
has body: Try This :- $('#result').on('mouseenter', '*' , function(){ var arr = ['ping', 'pong', 'pingpong']; $.each(arr, function(i, elem) { $('.'+elem).addClass('bg-highlight'); }); });
has comment: http://stackoverflow.com/comment/42278356
has comment: http://stackoverflow.com/comment/42277737
has comment: http://stackoverflow.com/comment/42278331
answers question: http://stackoverflow.com/q/26857915
has comment: http://stackoverflow.com/comment/42277465
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/42422142
comment on: http://stackoverflow.com/q/26935468
has text: Than I have to implement the positions and so on like in the force layout, right?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26845185
has body: Use BeforeEach to put some initial common code of each spec, for instance, you could put those lines: deferred = $q.defer() spyOn(mockRestangular.one().one(), 'get').and.returnValue(deferred.promise) spyOn(channel::, 'init').and.stub() new_channel = new channel(channel_id) in a BeforeEach, associated to the concerned describe. beforeEach(function() { deferred = $q.defer(); spyOn(mockRestangular.one().one(), 'get').and.returnValue(deferred.promise); spyOn(channel::, 'init').and.stub(); new_channel = new channel(channel_id); }); Other alternative: create some basic javascript function to gather common code. The advantage would be that you could name those portions of code: function mockDBGet() { deferred = $q.defer(); spyOn(mockRestangular.one().one(), 'get').and.returnValue(deferred.promise); } function initChannel() { spyOn(channel::, 'init').and.stub(); new_channel = new channel(channel_id); } //....... it('myCurrentSpec', function(){ mockDBGet(); initChannel(); far more clean than your previous version });
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42253881
has comment: http://stackoverflow.com/comment/42254190
accepted answer of: http://stackoverflow.com/q/26845108
type: Answer
answers question: http://stackoverflow.com/q/26845108
has comment: http://stackoverflow.com/comment/42254489
has comment: http://stackoverflow.com/comment/42254143
has comment: http://stackoverflow.com/comment/42254370
score: 1
has comment: http://stackoverflow.com/comment/42253583
upvote count: 1
has comment: http://stackoverflow.com/comment/42253999
has comment: http://stackoverflow.com/comment/42254557
has comment: http://stackoverflow.com/comment/42253720

http://stackoverflow.com/q/26911285
has title: Using Handlebars for templating other than HTML?
score: 3
has answer: http://stackoverflow.com/a/26913474
has body: I like how simple Handlebars is and how its design encourages the user to not put logic into the view. I have used it to template things other than HTML, but I am noticing the Handlebars.js website only discusses HTML examples. Is Handlebars only for templating HTML? My IDE IntelliJ also only syntax checks/highlights my Handlebars files as HTML. I was hoping renaming my handlebars files with the intended extension as secondary (like Question.xml.hbs) would clue IntelliJ into my intentions, but it continued processing like I was editing HTML. There do not appear to be any pragmas in Handlebars for me to indicate what my target format or MIME type should be. Architecturally, is it bad form to use Handlebars for purposes other than HTML templating? What if I restrict myself to HTML-like languages, like XML?
type: Question
tagged with: intellij-idea
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: templates
upvote count: 3
type: UnansweredQuestion
tagged with: handlebars.js

http://stackoverflow.com/comment/42375755
score: 0
type: Comment
has text: @HariniSridhar You are very welcome. `text` overrides the current textContent of the element. You could use the `join` method: http://jsfiddle.net/kwrcxf2g/
type: AnswerComment
comment on: http://stackoverflow.com/a/26898272

http://stackoverflow.com/comment/42314903
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26879012
score: 0
has text: mind creating a fiddle?

http://stackoverflow.com/comment/42440363
comment on: http://stackoverflow.com/q/26949425
type: Comment
type: QuestionComment
has text: The thing that you say you've tried, is in fact what you need to do. Why don't you post the code where you tried that -- a minimal example that allows us to reproduce your problem -- and we can help you find where it's going wrong?
score: 1

http://stackoverflow.com/a/26948279
type: Answer
has body: According to this https://github.com/stevenschobert/instafeed.js/issues/21 the image parameter in the filter function has attribute likes. So you should be able to do something like filter: function(image) { return image.likes.count &gt;= minAmount; }
accepted answer of: http://stackoverflow.com/q/26947655
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/26947655
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/26866863
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: matching a key from my input field to my json object
has answer: http://stackoverflow.com/a/26867286
linked to: http://stackoverflow.com/q/7241878
favorite count: 0
type: AnsweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/42293167
accepted answer: http://stackoverflow.com/a/26867286
type: Question
has body: $ (function() { var heroes = { "Abaddon":{ "counters": "Undying" + "Anti-Mage" + "Outworld Devourer" + "Shadow Demon" + "Techies" + "Ancient Apparition" + "Meepo" + "Riki" }, "Alchemist":{ "counters": "Riki" + "Ursa" + "Drow" + "Phantom Assassin" + "Troll Warlord" + "Bounty Hunter" + "Slark" + "Lifestealer" }, "Ancient Apparition":{ "counters": "Anti-Mage" + "Clinkz" + "Riki" + "Juggernaut" + "Zeus" + "Techies" + "Phantom Assassin" + "Spectre" }, "Axe":{ "counters": "Timbersaw" + "Venomancer" + "Silencer" + "Necrophos" + "Zeus" + "Phoenix" + "Lich" + "Ancient Apparition" }, "Bane":{ "counters": "Phantom Lancer" + "Chaos Knight" + "Meepo" + "Tidehunter" + "Sand King" + "Razor" + "Naga Siren" + "Undying" }, "Batrider":{ "counters": "Huskar" + "Viper" + "Juggernaut" + "Sniper" + "Venomancer" + "Undying" + "Weaver" + "Drow Ranger" }, "Beastmaster":{ "counters": "Axe" + "Bristleback" + "Lich" + "Timbersaw" + "Zeus" + "Meepo" + "Centaur Warrunner" + "Tidehunter" }, "Bloodseeker":{ "counters": "Wraith King" + "Techies" + "Tiny" + "Troll Warlod" + "Lifestealer" + "Dragon Knight" + "Legion Commander" + "Chaos Knight" }, "Bounty Hunter":{ "counters": "Phantom Lancer" + "Slardar" + "Meepo" + "Naga Siren" + "Bloodseeker" + "Chaos Knight" + "Huskar" + "Techies" }, "Brewmaster":{ "counters": "Undying" + "Omniknight" + "Death Prophet" + "Timbersaw" + "Weaver" + "Techies" + "Queen of Pain" + "Anti-Mage" }, "Bristleback":{ "counters": "Necrophos" + "Venomancer" + "Viper" + "Ancient Apparition" + "Razor" + "Death Prophet" + "Clockwerk" + "Omniknight" }, }; var keys = []; for(var k in heroes) keys.push(k); $("#searchBar").autocomplete({ source: keys }); $( "#searchBar" ).autocomplete({ minLength: 2 }); var minLength = $( "#searchBar" ).autocomplete( "option", "minLength" ); $( "#searchBar" ).autocomplete( "option", "minLength", 2 ); $( "#searchBar" ).autocomplete({ autoFocus: true }); $( "#searchBar" ).autocomplete({response: function( event, ui ) {} }); $("#searchBar").bind("keypress…
score: 1
has comment: http://stackoverflow.com/comment/42293106
has comment: http://stackoverflow.com/comment/42293212
has comment: http://stackoverflow.com/comment/42293334

http://stackoverflow.com/q/26939025
has answer: http://stackoverflow.com/a/30323198
upvote count: 5
accepted answer: http://stackoverflow.com/a/28833504
tagged with: javascript
tagged with: jquery
answer count: 2
has comment: http://stackoverflow.com/comment/45887928
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/42422334
has answer: http://stackoverflow.com/a/28833504
type: AnsweredQuestion
tagged with: amcharts
has title: Can't scroll over amcharts chart on mobile
has body: So I have a chart that spans 100% when on mobile but when trying to scroll the screen by touching the graph and swiping it simply triggers an event instead of scrolling. For instance if I try to scroll over a pie chart it will bring up the bubble of the pie slice. Is there an event I could disable to alleviate this issue?
type: Question
has comment: http://stackoverflow.com/comment/45936515
possible better answer: http://stackoverflow.com/a/30323198
score: 5

http://stackoverflow.com/comment/42595584
type: AnswerComment
comment on: http://stackoverflow.com/a/27037643
score: 0
type: Comment
has text: Interesting I'll try this code now and get back to you. Thanks

http://stackoverflow.com/comment/42442666
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/26950661
has text: `inputs is not defined`. Why you didnt declare them?
score: 0

http://stackoverflow.com/q/26952643
favorite count: 0
has title: How to obtain a cookie from a remote domain using Greasemonkey?
has answer: http://stackoverflow.com/a/26953814
accepted answer: http://stackoverflow.com/a/26953814
linked to: http://stackoverflow.com/q/65749907
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: cookies
has comment: http://stackoverflow.com/comment/123917331
type: Question
tagged with: gm-xmlhttprequest
linked to: http://stackoverflow.com/q/11486256
has body: I'm writing a Greasemonkey (v2.3) script that basically screen-scrapes the contents served by lema.rae.es/drae/srv/search, for lack of an API of any sort. The thing is, I want to query that URL from Google Translate, a different domain. For that, I can use GM_xmlhttpRequest without problems, but a GET request to a specific URL (for instance lema.rae.es/drae/srv/search?val=test) yields an HTML page with a hidden form that gets POSTed after calling the challenge() javascript function -- which calculates some sort of token which gets passed along in the POST request. Obviously, this happens asynchronously and Greasemonkey sees nothing of it. Via trial and error I have come to realise that if my browser (Iceweasel 31.2.0) has a cookie for lema.drae.es, then the GET request issued using GM_xmlhttpRequest actually returns what I want, which is the HTML of the definition of the word passed as a the parameter "val" in the URL. However, if I delete all cookies for lema.drae.es, the GET request returns the aforementioned hidden form. In short, I need a way to receive the response of that POST request from within Greasemonkey, and I believe that if it were possible to receive the cookie from the server and store it then I could include it as a request header in a further request and it should work as I expect. Or it should simply be stored in the browser and therefore would get sent as a header when I trigger GM_xmlhttpRequest. I tried a different solution to my problem, namely using a hidden iframe, but the creation of such iframe was blocked by the browser on the grounds of the Same Origin policy, even after configuring the userscript to run on both domains. Hopefully I've made clear what I want to achieve, and I hope somebody can point me in the right direction. On a side note: if someone could explain what the challenge() function calculates, I would really appreciate it. My hypotheses would be that the token it generates gets sent to the server which in turn uses it to pr…
tagged with: javascript
upvote count: 2
tagged with: greasemonkey
answer count: 1

http://stackoverflow.com/a/26925249
accepted answer of: http://stackoverflow.com/q/26925100
type: Answer
downvote count: 0
score: 1
has body: So do you want to know how to share global variables across contollers? That you can do with the $rootScope: https://docs.angularjs.org/api/ng/service/$rootScope So you just work with $rootScope.yourArrayOfObjs = .... Also have a look at what the different scopes are in ng https://docs.angularjs.org/guide/scope UPDATE: You can of course also do this with a service but not if the sole purpose of the service is to provide the global variables. See angular FAQ last question: https://docs.angularjs.org/misc/faq
has comment: http://stackoverflow.com/comment/42397389
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26925100

http://stackoverflow.com/comment/42448928
type: Comment
type: QuestionComment
has text: You are missing URL in $.ajax.
score: 1
comment on: http://stackoverflow.com/q/26949320

http://stackoverflow.com/q/26870887
has comment: http://stackoverflow.com/comment/42300867
tagged with: angularjs
type: UnansweredQuestion
has body: I have a single-page app that updates divs on the page by calling the server via ajax. I am using angular as the framework. I am trying to handle page navigation through angular but I'm struggling a bit to understand it. I've been looking at the $route functionality, and in the examples I've seen, you specify a template to be loaded. But I don't want to do that. What I would like to happen is this: when the location url changes, eg from /#page1 to /#page2, a function in my controller gets called that can make the ajax call and update the appropriate div. I would also like this to happen if the user manually changes the url in the browser address bar, and I would also like the app to load the correct page if a user comes straight to /#page1 or /#page2 eg from an outside link. Is that the kind of thing I could use angular routes to do and is it the best tool for the job? Many thanks for your help!
has comment: http://stackoverflow.com/comment/42300802
answer count: 0
type: Question
score: 0
has title: How to use angular to handle page navigation in single-page application?
has comment: http://stackoverflow.com/comment/42300457
tagged with: javascript

http://stackoverflow.com/q/26934872
upvote count: 1
type: Question
tagged with: c#
tagged with: javascript
has answer: http://stackoverflow.com/a/26934956
has body: I've to do some stuff when a changed occure in a TextBox in a GridView.. So I've: $(function () { $('.mGrid').on('change', 'input[id*="txtValore"]', function () { alert('CHANGE!!'); (...) }); }); The situation is: <asp:UpdatePanel ID="FlussiPagamento" runat="server" UpdateMode="Conditional"> (...) <asp:Panel ID="pnlHome" runat="server"> (...) <asp:GridView ID="gridPrincipale" CssClass="mGrid"> (...) <asp:TemplateField> <asp:TextBox ID="txtValore" Text='<%# string.Format("{0:N}", Eval("Valore"))%>' runat="server" /> </asp:TemplateField> (...) </asp:GridView> (...) </asp:Panel> <asp:Panel ID="pnlDettaglio" Visible="false" runat="server"> (...) <asp:GridView ID="grid" CssClass="mGrid"> (...) <asp:TemplateField> <asp:TextBox ID="txtValore" Width="90%" Text='<%# string.Format("{0:N}", Eval("Valore"))%>' runat="server" /> </asp:TemplateField> (...) </asp:GridView> (...) </asp:Panel> (...) </asp:UpdatePanel> Rendered like this: (...) (...) (...) (This part when Visible=true) (...) (...) (...) (...) -1.524,10 (...) (...) (...) (...) In the first GridView I've also an ImageButton that does second griview databound and switch the panels visibility..In the second Panel I've another ImageButton, outside the GridView, that does the opposite.. I think both of it does a postback, because I can see the entire page is reloaded.. Now the behaviour is, when the first time the page is loaded if I change the first grid TextBox text I can see the alert. After I click the ImageButton and switch to second panel, the event is not fired when change text on second grid and if I come back to first panel, it don't work anymore not even with the first one.. What could be the problem?
answer count: 1
downvote count: 0
tagged with: jquery
tagged with: asp.net
favorite count: 0
accepted answer: http://stackoverflow.com/a/26934956
type: AnsweredQuestion
tagged with: gridview
score: 1
has title: losing jquery Delegated Event Handler

http://stackoverflow.com/comment/42466392
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26964171
score: 0
has text: so, i checked the console, it is in fact returning "yes" which is what it should do. i have tried setting it to if(accept == "yes"){}else{} but again to no avail. for whatever reason anything between ){ and }else is ignored or something. checking the console showed no errors

http://stackoverflow.com/comment/42410638
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/26932889
has text: As above. It is obvious due to the SO syntax highlighter. I **highly** recommend using a code editor that does the same. Also, use the JS console in your browser, it would have highlighted the error
type: Comment

http://stackoverflow.com/comment/42354660
comment on: http://stackoverflow.com/a/26901069
has text: Did you seriously just copy my answer?
score: 3
type: AnswerComment
type: Comment

http://stackoverflow.com/q/26930347
type: AnsweredQuestion
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/42412886
downvote count: 0
tagged with: javascript
score: 4
has body: As a newbie to both Ember.js and ember-cli, I'm having trouble making sense of what seems necessary to make my app work. The logical hierarchy of my app is something like this: Projects |___Project |___Details |___Team Members |___Budget |___Planned |___Actual And currently, this is my router.js: this.resource('projects'); this.resource('project', { path: 'projects/:project_id' }, function() { this.route('details'); this.route('team'); this.route('milestones'); this.resource('budget', function(){ this.route('project-budget', { path: 'project'}); this.route('resource-budget', {path: 'team'}); }); }); What I'm having trouble with is where to put my files. Up until the point of the two nested routes under Budget, my folder structure looked like my hierarchy, but since a Resource resets the namespace, now to make it work I have to pull my Budget template, route, and controller back out to the top level (with Projects stuff), which just seems messy and like it will cause headaches when trying to maintain this thing later. Am I doing it wrong?
tagged with: ember.js
answer count: 1
tagged with: ember-cli
has title: Nested Resources in ember-cli, messy app structure
favorite count: 0
has answer: http://stackoverflow.com/a/26934360
accepted answer: http://stackoverflow.com/a/26934360
has comment: http://stackoverflow.com/comment/42407866

http://stackoverflow.com/a/26974592
has comment: http://stackoverflow.com/comment/42497037
has comment: http://stackoverflow.com/comment/42486136
score: 1
answers question: http://stackoverflow.com/q/26973852
downvote count: 0
has body: It looks like the only piece you are missing is the setting and getting of the cookie. Here is a post about setting and getting cookies using both jquery and javascript. This is jquery but it gets the job done. Default Heart Earthly Sunflowers Mountin
has comment: http://stackoverflow.com/comment/42497925
has comment: http://stackoverflow.com/comment/42486114
type: Answer
upvote count: 1

http://stackoverflow.com/a/26897777
type: Answer
has comment: http://stackoverflow.com/comment/42412589
answers question: http://stackoverflow.com/q/26897715
has comment: http://stackoverflow.com/comment/42413094
has body: Since you are submitting via AJAX anyway, you may find it easier to change your input type to button, and bind to click instead of form submit, to avoid the default submit behaviour you are trying to circumvent.
score: 0

http://stackoverflow.com/q/26850666
type: Question
answer count: 1
tagged with: javascript
favorite count: 0
upvote count: 3
has comment: http://stackoverflow.com/comment/42283993
accepted answer: http://stackoverflow.com/a/26927708
has comment: http://stackoverflow.com/comment/42401366
has title: How to simulate a key-press in ExtendScript?
has comment: http://stackoverflow.com/comment/42400198
tagged with: adobe
tagged with: after-effects
has answer: http://stackoverflow.com/a/26927708
tagged with: extendscript
has body: currently I want to write a script for AE, which relieves me of some keyboard inputs. Once the script is running, I want to click with the mouse, and then some key-inputs for example X Y and Z should be simulated. The little GUI and the eventhandler are no problems, but the simulation of key pressing. Please help. var win = new Window ("dialog", "Dummy"); win.aButton = win.add ("button", undefined, "Start"); win.bButton = win.add ("button", undefined, "Stop"); //Start win.aButton.onClick = function (event){ var activeViewer = app.activeViewer; if activeViewer.type == ViewerType.VIEWER_COMPOSITION){ HERE SHOULD THE KEYS x, y AND z PRESSED VIA THE SCRIPT }else return; } //Stop win.bButton.onClick = function (event){ win.close(); return; } win.show();
type: AnsweredQuestion
score: 3
downvote count: 0

http://stackoverflow.com/a/26882507
upvote count: 3
downvote count: 1
has comment: http://stackoverflow.com/comment/42323640
answers question: http://stackoverflow.com/q/26881550
has comment: http://stackoverflow.com/comment/42323151
has comment: http://stackoverflow.com/comment/42322897
has body: use $(window).on("navigate", function (event, data) { var direction = data.state.direction; if (direction == 'back') { // do something } if (direction == 'forward') { // do something else } });
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/42322371

http://stackoverflow.com/a/31365003
score: 5
upvote count: 5
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/26844412
has body: To get this working with the newest version of OL3 (v3.7.0) I had to read the features using the GeoJSON format class. var geoJSONFormat = new ol.format.GeoJSON(); var vectorSource = new ol.source.Vector({ loader: function(extent, resolution, projection) { var url = 'geojson2.php?p=' + extent.join(','); $.ajax({ url: url, success: function(data) { var features = geoJSONFormat.readFeatures(data); vectorSource.addFeatures(features); } }); }, strategy: ol.loadingstrategy.bbox });

http://stackoverflow.com/q/26873579
has comment: http://stackoverflow.com/comment/42305193
upvote count: 1
has body: I have a page with four questions. The user may answer a question simply by clicking yes or no. However, before they are able to open the "Summary" section, I would like to require the user to have selected each of the four answers. Is there a way to validate this with js? A sample of my code follows: &lt;div id="mainContainer"&gt; &lt;div class="question"&gt; &lt;ul class="questions"&gt; &lt;li&gt;&lt;a href="javascript:void(0);" class="answer yes"&gt;&amp;nbsp;Yes&lt;/a&gt;&lt;span class="pointer"&gt;&lt;/span&gt;&lt;/li&gt; li&gt;&lt;a href="javascript:void(0);" class="answer no"&gt;&amp;nbsp;No&lt;/a&gt;&lt;span class="pointer"&gt; &lt;/span&gt;&lt;/li&gt; &lt;/ul&gt; &lt;p class="query"&gt;When answering this question you feel confused.&lt;/p&gt; &lt;div class="result yes feedback"&gt; &lt;a class="close_btn" href="javascript:void(0);"&gt;X&lt;/a&gt; &lt;p class="advice"&gt;&lt;span class="expert"&gt;Incorrect&lt;/span&gt;&lt;p&gt;When answering this question you feel smart.&lt;/p&gt; &lt;/div&gt; &lt;div class="result no feedback"&gt; &lt;a class="close_btn" href="javascript:void(0);"&gt;X&lt;/a&gt; &lt;p class="advice"&gt;&lt;span class="expert"&gt;Correct&lt;/span&gt;&lt;p&gt;When answering this question your brain hurts.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="question summary"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="javascript:void(0);" class="answer yes summary"&gt;&lt;h3&gt;Summary&lt;/h3&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div class="result yes feedback"&gt; &lt;a class="close_btn" href="javascript:void(0);"&gt;X&lt;/a&gt; &lt;p class="advice"&gt;&lt;span class="expert"&gt;Scenario 1 Summary&lt;/span&gt;&lt;p&gt;When answering questions sometimes we feel smart, confused, and have brains that hurt.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="btn"&gt;&lt;a href="#vulnerable" class="subNav"&gt;Next Scenario&lt;/a&gt;&lt;/div&gt; &lt;/div&gt; $('#mainContainer').on('click', '.answer', function () { var $this = $(this), $thisListItem = $t…
has title: Use javascript to validate all options visited before moving on to next link
answer count: 0
score: 1
type: Question
has comment: http://stackoverflow.com/comment/42307588
downvote count: 0
tagged with: javascript
tagged with: validation
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/42383915
type: UnansweredQuestion

http://stackoverflow.com/comment/42267333
type: Comment
comment on: http://stackoverflow.com/q/26852389
type: QuestionComment
has text: It isn't possible for `this.query` to return the data directly, it must return a promise.
score: 0

http://stackoverflow.com/comment/42348540
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/26897711
type: Comment
has text: Which is easier to understand and maintain? That should be your prime directive.

http://stackoverflow.com/comment/42275012
type: QuestionComment
comment on: http://stackoverflow.com/q/26856470
has text: Barmar: I didn't find the same exact question with an answer that worked for me and I looked for at least 20mn.
score: 0
type: Comment

http://stackoverflow.com/a/26843682
answers question: http://stackoverflow.com/q/26843578
has body: try to remove the required attributes your-input.removeAttr( "required" );
score: 0
type: Answer

http://stackoverflow.com/comment/42454614
has text: If you would like to make a window like AdBlock yes you have to create a `blah.xul` and then on click of the button you have to do `Services.wm.getMostRecentWindow('navigator:browser'). openDialog("chrome://browser/content/search/engineManager.xul", "_blank", "chrome,dialog,modal,centerscreen,resizable");`
score: 1
comment on: http://stackoverflow.com/a/26951872
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42341732
type: QuestionComment
has text: @ProllyGeek here is a fiddle link: http://jsfiddle.net/joe847/s5mptqph/ It does not seem to operate as it would on my site (selecting, the dropdowns, etc) Will this do?
comment on: http://stackoverflow.com/q/26877982
score: 0
type: Comment

http://stackoverflow.com/a/26841329
accepted answer of: http://stackoverflow.com/q/26840808
type: AcceptedAnswer
score: 0
type: Answer
has body: Create CSS Class for that and apply it on input button as bellow. &lt;input type="image" id="DemoID" class="closeBut" src="../App_Themes/NewTheme/facebox/GrayClose.png" style="border-width:0px;"&gt; CSS Class as bellow .closeBut{ font-size: 12px; color: #777; position: absolute; display: block; top: -8px; right: -8px; width: 20px; height: 20px; text-indent: -9999em; background: url(../App_Themes/NewTheme/facebox/GrayClose.png) no-repeat; outline: 0; z-index: 1000; }
answers question: http://stackoverflow.com/q/26840808

http://stackoverflow.com/comment/42832115
type: AnswerComment
score: 0
type: Comment
has text: If your arrays is object array then the array elements(objects) are shallow copied. you need to clone that object too.
comment on: http://stackoverflow.com/a/27147628

http://stackoverflow.com/comment/42349610
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26897873
has text: I don't see any problems in your code: http://jsfiddle.net/jgnjy036/1/ It must be in your html or `slideDown` doesn't do what you think it should do. The element must be hidden.

http://stackoverflow.com/comment/42496167
type: AnswerComment
type: Comment
has text: [Since there's a finite number of possibilities here, typically the most optimized way to handle this would be to completely unroll the loop](http://jsperf.com/loop-unrolling/4).
comment on: http://stackoverflow.com/a/26980963
score: 0

http://stackoverflow.com/a/26969121
type: Answer
accepted answer of: http://stackoverflow.com/q/26968768
upvote count: 1
downvote count: 3
has body: Look here: http://code.tutsplus.com/tutorials/how-to-create-an-infinite-scrolling-web-gallery--net-10653 Or look here: http://sandmoose.com/post/24430017265/infinite-scrolling-demo-without-plugins There are plenty of alternatives. If you're looking for smaller sizes then probably pure javasript implementation is the way to go. For instance this may be the solution: https://github.com/alexblack/infinite-scroll
score: -2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26968768

http://stackoverflow.com/a/26838866
answers question: http://stackoverflow.com/q/26838699
upvote count: 2
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
has body: Change your js function as below &lt;script type="text/javascript"&gt; function hideuser() { window.setTimeout(function () { var label = document.getElementById('&lt;%= lblResult.ClientID %&gt;'); if (label != null) { label.style.display = 'none'; } }, 5000); } &lt;/script&gt; Change this line var label = document.getElementById('lblResult'); to var label = document.getElementById('&lt;%= lblResult.ClientID %&gt;');
has comment: http://stackoverflow.com/comment/42278999
accepted answer of: http://stackoverflow.com/q/26838699

http://stackoverflow.com/q/26952397
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/42445459
favorite count: 0
accepted answer: http://stackoverflow.com/a/26952627
has comment: http://stackoverflow.com/comment/42445440
has title: How to read the values in the String
has body: If the user enters the text in the text box I want to display a number of occurences of each 26 letters. Why does this code not work? The Quick Brown Fox Jumped Over the Lazy Dogs <input type="button" value ="Image Chart" onclick="Alphabets()"
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42445578
has comment: http://stackoverflow.com/comment/42445431
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/42445670
tagged with: javascript
has answer: http://stackoverflow.com/a/26952627
has comment: http://stackoverflow.com/comment/42445736

http://stackoverflow.com/q/26850025
has body: Trying to make a count down timer. This is what i have so far. var now = new Date(); var then = now.getHours(); document.getElementById('time').innerHTML = now - then; when i subtract now-then i get a bunch of numbers. How do i make it so when i set the exact date and time(with seconds) it will give me the outcome?
downvote count: 1
has comment: http://stackoverflow.com/comment/42262619
has comment: http://stackoverflow.com/comment/42263990
favorite count: 0
has answer: http://stackoverflow.com/a/26850099
answer count: 5
has answer: http://stackoverflow.com/a/26850154
accepted answer: http://stackoverflow.com/a/26850115
possible better answer: http://stackoverflow.com/a/26850099
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26850080
has answer: http://stackoverflow.com/a/26850108
score: 1
has comment: http://stackoverflow.com/comment/42263491
has answer: http://stackoverflow.com/a/26850115
type: Question
tagged with: javascript
has title: How do i make a countdown with Hours, Minutes and Seconds, set for a certain time.
upvote count: 2

http://stackoverflow.com/comment/42258340
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26847472
score: 0
has text: Updated answer. As I can see you had problems with elements `data` attributes, you can read about them [in this article](http://www.sitepoint.com/use-html5-data-attributes/)

http://stackoverflow.com/a/26835016
type: Answer
score: 7
upvote count: 7
has comment: http://stackoverflow.com/comment/42236093
has body: Custom filter option is written now at the end if you wanted to create more complex filtering. First EDIT: Using Angular-Filter from angular-filter GitHub Working JSBIN as your Request I'm using angular-filter, group-by option, which allows me to do so. you could follow html witch is rather simple understand HTML: &lt;ul ng-repeat="(key, value) in data | groupBy: 'group_header'"&gt; //First extracting key value, from ng-repeat and grouping it by group_header ( External 3rd party filter by angular-filter). Group name: {{ key }} &lt;li ng-repeat="item in value"&gt; // Then extra ng-repeat to iterate each of the objects and presenting the name . Activity : {{ item.name }} &lt;/li&gt; &lt;/ul&gt; JS: All you have to do: Inject angular-filter to your code like so: angular.module('app',['angular.filter']).. So I've written a filter for your purpose which supposed to be tailor made , but it's also, reusable and easy to test as well. Before you jump into COPY &amp; PASTE: It's important for you to understand why to use filters , and how to use them well. In my solution I've written a filter which you can declare a minHour and it will show only the hours that are later than that hour. let's read the code: app.filter('minHour',function(){ // 1 - Explained below. return function(items, minHour){ //2 - Explained below. var filtered = []; for(var i =0 ; i &lt; items.length ; i ++){ var hour = parseInt(items[i].start.slice(0,2)); //3 - Explained below. if(hour === minHour || hour &gt; minHour){ filtered.push(items[i]); } } return filtered; } }) I find most of the code above rather easy to read, but I am writing explanation on the difficault bits: 1) This is how angular defines a new filter. 2) The filter will always return a function with argument, the first argument is ALWAYS the items of the ng-repeat, the second argument is ALWAYS the string that will be used when you call the filter. (This is the most important thing here). 3) This is working BUT warning this is a BAD PRACTIC…
has comment: http://stackoverflow.com/comment/42236269
has comment: http://stackoverflow.com/comment/42236332
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26834667
has comment: http://stackoverflow.com/comment/42236526
has comment: http://stackoverflow.com/comment/42236278
answers question: http://stackoverflow.com/q/26834667
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42236229

http://stackoverflow.com/comment/42384016
comment on: http://stackoverflow.com/q/26833752
has text: Also tried the compzets example html with the 1.9.1 version of jquery that AppBuilder uses... and it worked. So it seems like it's not a jquery version thing.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/26885941
has title: Regex not working in Code behind for Server side validation
score: -1
has answer: http://stackoverflow.com/a/26886535
has comment: http://stackoverflow.com/comment/42327037
accepted answer: http://stackoverflow.com/a/26886535
type: Question
answer count: 1
downvote count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/42326724
has comment: http://stackoverflow.com/comment/42326774
favorite count: 0
has comment: http://stackoverflow.com/comment/42326734
tagged with: regex
tagged with: server-side
has comment: http://stackoverflow.com/comment/42326736
upvote count: 0
has body: I have a js code for validating a textbox. But the problem is that, the same regex is not working in code behind. See the code:- HTML for the same:- &lt;asp:TextBox ID="txtSearch" runat="server" class="txtfld-search" oncopy="return false" oncut="return false" onpaste="return false"&gt;&lt;/asp:TextBox&gt; &lt;asp:CustomValidator ID="CustomValidator1" runat="server" ForeColor="Red" ErrorMessage="Please enter numeric values." OnServerValidate="Validate_Numeric" ControlToValidate="txtSearch"&gt;&lt;/asp:CustomValidator&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { $('#ctl00_topNavigation_txtSearch').keyup(function () { var $th = $(this); $th.val($th.val().replace(/[^.%a-zA-Z0-9 ]/g, function (str) { alert('Special characters not allowed except %'); return ''; })); }); }); I am using like this, but it is not working protected void Validate_Numeric(object sender, ServerValidateEventArgs e) { System.Text.RegularExpressions.Regex r = new System.Text.RegularExpressions.Regex("/[^.%a-zA-Z0-9 ]/g"); e.IsValid = r.IsMatch(txtSearch.Text); } I want this /[^.%a-zA-Z0-9 ]/g, same regex to be used in Code-behind. Please help.
has comment: http://stackoverflow.com/comment/42326619
has comment: http://stackoverflow.com/comment/42327440
has comment: http://stackoverflow.com/comment/42326955
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42326649
has comment: http://stackoverflow.com/comment/42326813

http://stackoverflow.com/a/26890580
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26886086
has body: The easiest way to get around cross domain restrictions is to set up a server-side proxy for the service on your local domain. ajax request to your-domain.com/packagist-proxy?package=doctrine%2Fcache your server makes a request to https://packagist.org/packages/doctrine/cache.json the server forwards the response to the client You could make it even easier on yourself by doing the processing for the latest version on your server, then just sending that to the client instead of the whole response.

http://stackoverflow.com/q/26976629
tagged with: javascript
tagged with: jquery
score: 0
has body: I am learning JQuery by example. Please check this fiddle: http://jsfiddle.net/4tjof34d/2/ I have two problems: 1 : showText() gets called twice when a person hits enter and thus console.log(this.id+ " " +this.value); gets called twice, What do I add so that it only gets called once? 2: I get the id and value of the textbox, but I also want to know what was the old id and value so that I can do a comparison test. How do I do that? eg: var oldValue = ? // How do I do this? var newValue = this.value; Then I can do something like: if(newValue != oldValue) { // Do .ajax() - update DB }
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Fix double call and get before value
accepted answer: http://stackoverflow.com/a/26976757
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/26976757

http://stackoverflow.com/comment/47395152
has text: i have them both :) Visual Studio had a corrupt file, unfortunately had no option but to remove it all and re-install
comment on: http://stackoverflow.com/q/26839472
score: 0
type: Comment
type: QuestionComment

angular-routing
tags question: http://stackoverflow.com/q/26956965
type: Tag
tags question: http://stackoverflow.com/q/26974112
tag name: angular-routing
tags question: http://stackoverflow.com/q/26952836
tags question: http://stackoverflow.com/q/26921090

http://stackoverflow.com/comment/42306721
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26874367
has text: Do you `require("routes/routes.js")` in the `app.js`?
score: 0

http://stackoverflow.com/q/26896183
favorite count: 0
answer count: 0
type: UnansweredQuestion
has title: Drawing polar vectors with HTML5 canvas?
type: Question
tagged with: canvas
has comment: http://stackoverflow.com/comment/42345892
upvote count: 1
has comment: http://stackoverflow.com/comment/42346091
tagged with: javascript
has body: Edit: Solved. Switched Math.asin() for Math.atan2(). I'm trying to draw a polar vector (radius, angle) to a point on a canvas with JavaScript given the X,Y coordinates gotten by a mouse click. This seems simple, but so far I haven't gotten it to work. What I've done: window.onload=init(); var canv, ctx, H, W; var A, th; function clickAction(e) { var pos=getMousePos(e); var x=pos.x; var y=pos.y; var A=Math.sqrt(x*x+y*y); var th=Math.asin(-y/A)*(180/Math.PI); drawVec(x,y); //draws a line to (x,y) from center ctx.beginPath(); ctx.arc(0,0,50,0,th); ctx.stroke(); console.log(x,y, th); } function init() { canv=document.getElementById("canv"); ctx=canv.getContext('2d'); H=canv.height; W=canv.width; ctx.translate(W/2, H/2); drawAxes(); canv.addEventListener('mousedown', clickAction); } The arc should go from the x-axis (angle=0) to wherever you clicked, going counterclockwise (angle=theta). But it's not. And drawAxes(), drawVec(), and getMousePos() are straight-forward and working so I didn't include them. Thanks.
score: 0
has comment: http://stackoverflow.com/comment/42345885
downvote count: 1

http://stackoverflow.com/q/26985152
type: UnansweredQuestion
tagged with: animation
upvote count: 1
score: 1
type: Question
tagged with: algorithm
downvote count: 0
has body: What kind of algorithm is used to create the animated effect of networked nodes on the background of this site? I have found a similar effect in the book "Foundation HTML5 Animation with JavaScript" titled Node Garden Mass (http://lamberta.github.io/html5-animation/examples/ch12/08-node-garden-mass.html), but it is not quite the same.
tagged with: javascript
has answer: http://stackoverflow.com/a/26985176
answer count: 1
has title: What kind of algorithm is used to create this visual effect of "linked network nodes"?
favorite count: 0
has comment: http://stackoverflow.com/comment/42504640

http://stackoverflow.com/q/26956951
has body: Have one more question. I have two pages (one main and one window.open). Window.open have a href link. How make that if someone press the link in the window.open change the main page url and go to that url? Main page ////////////////////////////// htp://main.page.com (change main page url if link pressed in window.open) ///////////////////////////// ////////////////////// window.open a href="#" Link /////////////////////
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/26956999
answer count: 1
favorite count: 0
has title: How can Window.open link change main page url
type: AnsweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/26956999
downvote count: 1
type: Question
tagged with: javascript
tagged with: window.open
score: 0

http://stackoverflow.com/a/26975039
type: Answer
has comment: http://stackoverflow.com/comment/42485779
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/42485738
answers question: http://stackoverflow.com/q/26974964
has comment: http://stackoverflow.com/comment/42485505
has comment: http://stackoverflow.com/comment/42485163
has comment: http://stackoverflow.com/comment/42486446
has comment: http://stackoverflow.com/comment/42485365
has comment: http://stackoverflow.com/comment/42485377
downvote count: 0
has body: Because there is nothing in your , so it is 0px by 0px, hence there is nothing (visible) to click. Also, elements are self-closing, you don't include . Maybe you meant to wrap your around your : Compare Now JSFiddle Or, your around your : Compare Now JSFiddle

http://stackoverflow.com/comment/42391047
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26921489
has text: ...you have a `polyfills` tag, so it would seem you already know what to look for.

cors
type: Tag
tag name: cors
tags question: http://stackoverflow.com/q/26908685
tags question: http://stackoverflow.com/q/26980713
tags question: http://stackoverflow.com/q/26934511
tags question: http://stackoverflow.com/q/26877774
tags question: http://stackoverflow.com/q/26873822
tags question: http://stackoverflow.com/q/26988071
tags question: http://stackoverflow.com/q/26856460
tags question: http://stackoverflow.com/q/26966268

http://stackoverflow.com/a/26890181
answers question: http://stackoverflow.com/q/26889805
upvote count: 1
has body: You can have a hidden div that preloads the image into cache, and then once it's loaded you can add the background. HTML: &lt;img id="img" src="/Content/_activity/ajax-loader.gif" /&gt; CSS: #img { display: none; } jQuery: $("#img").load(function() { $(submitButtonSelector).click(function() { that.submitButtonSelector.css("background-image", "/Content/_activity/ajax-loader.gif"); }); });
score: 1
downvote count: 0
type: Answer

http://stackoverflow.com/comment/42434736
has text: thanks for the answer , but that's not what I mean , should the name of the column underneath the line no , row underneath the name of the column nama and so on .
comment on: http://stackoverflow.com/a/26946117
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/26969969
type: Question
has title: Multiple publications and subscriptions
has answer: http://stackoverflow.com/a/26970748
upvote count: 1
accepted answer: http://stackoverflow.com/a/26970748
has comment: http://stackoverflow.com/comment/42481577
tagged with: javascript
has comment: http://stackoverflow.com/comment/42485607
has comment: http://stackoverflow.com/comment/42477282
answer count: 1
tagged with: meteor
favorite count: 0
has body: i have a problem with my meteor js implementation. The application has one collection named "tasks". I have in multiple places in my application many diffrent filters on this collection. In many cases i load diffrent lists with diffrent find queries in the same screen by using the same tasks collection. I wanted to use the publication-subscription model. Im not sure if im mistaken but is it the case that i cannot have multiple publications and subscriptions against the same mongo collection? Specifically i use Tasks= new Meteor.Collection("tasks"); //server Meteor.publish('Tasks1',function(evalstring){return eval(evalstring);}) Meteor.publish('Tasks1',function(evalstring){return eval(evalstring);}) //client evalstring="Tasks.find({enabled:false}).fetch()"; Meteor.subscribe('Tasks1',evalstring); Would something like that work? If yes do we actually earn something in performance compared to the other way not using publications and running directly the find queries? Thanks
has comment: http://stackoverflow.com/comment/42482039
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/42476335
score: 1
linked to: http://stackoverflow.com/q/19826804

http://stackoverflow.com/q/26851029
type: Question
upvote count: 2
answer count: 1
has comment: http://stackoverflow.com/comment/42265424
has title: How do I create a div and give it an ID based on a changing variable?
has answer: http://stackoverflow.com/a/26851530
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I'm making a quiz. The user decides how many questions he wants to answer. A function then takes this number and runs a loop to make an individual question div for each question. The quiz shows a Chinese character and the user has to pick the correct translation. My code: var fillInQuestion = function() { questionDivIdHTML = 'question' + questionNum; /**************************************** How do I make this Div's ID = to questionDivIdHTML? // Creates question div $('#questionArea').append(" "); //$('#questionArea:last-child').attr("id", questionDivIdHTML); <-- NOT WORKING ***************************************/ // Sets up a choice bank. var choices = []; // choices will be chosen from this. var tempAnswerSet = allChoices.slice(0); //find random item in the database for the question var thisQuestion = allQuestions[Math.floor(Math.random() * allQuestions.length)]; // add that item to choices choices.push(thisQuestion); // remove item from 'database' so it cannot be used in another question allQuestions.splice(allQuestions.indexOf(thisQuestion), 1); // remove item from tempAnswer set so it can only be one choice tempAnswerSet.splice(tempAnswerSet.indexOf(thisQuestion), 1); // add three more items from the database (incorrect items) var i = 3; for (i; i > 0; i--) { var addChoice = tempAnswerSet[Math.floor(Math.random() * tempAnswerSet.length)]; choices.push(addChoice); // remove the one selected each time so they cant be chosen again tempAnswerSet.splice(tempAnswerSet.indexOf(addChoice), 1); //console.log("choices length: " + choices.length); } // shuffle the array choices.shuffle(); // fill in the div with choices. $('#questionDivIdHTML').append("Here is an question prompt:" + thisQuestion.english + " "); $('questionDivIdHTMLwithHash').append(" " + choices[0].hanyu + " "); $('questionDivIdHTMLwithHash').append(" " + choices[1].hanyu + " "); $('questionDivIdHTMLwithHash').append(" " + choices[2].hanyu + " "); $('questionDivIdHTMLwithHash').append(" " + choices[3].ha…
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26851530
favorite count: 0

http://stackoverflow.com/comment/42244854
has text: ok, it's done. Remember to pass the amount to add as a string, in the format 'hh:mm'.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26839860
score: 0

http://stackoverflow.com/comment/42261487
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26849384
has text: If you tell him to remove all the other classes first and then add the correct class, I'll +1 you. Just so he can add only the correct class but leave other classes intact.

http://stackoverflow.com/q/26987407
upvote count: 1
type: Question
downvote count: 0
accepted answer: http://stackoverflow.com/a/26988267
tagged with: javascript
tagged with: express
answer count: 1
tagged with: asynchronous
favorite count: 0
has answer: http://stackoverflow.com/a/26988267
has title: Right place to place db checks in nodejs
tagged with: node.js
tagged with: model-view-controller
type: AnsweredQuestion
score: 1
has body: I'm building an app with NodeJS and ExpressJS. My folder structure looks like this: /app /controllers /models And I'm trying to separate all the logic and db calls in the model and the "usertomodel" actions in the controller. In the controller I have the following code: (in the controller) app.post('/api/nodes/upload/image', processMultipartForm, function(req, res) { if (!req.files.file) { return res.status(400).json({ message: 'INVALID_FILE' }); } ... if (ALLOWED_FORMATS.indexOf(file.mimetype) == -1) { return res.status(400).json({ message: 'INVALID_FILE_FORMAT' }); } ..... NodesModel.createFile({ ... }, {...}, function(){...}); To do the simple checks. But after I finish with all the validation I need to do like 3 asynchronous DB calls (for example to check if the file exists, permissions, etc) and I'm using the waterfall module from async npm package in the model and it looks like this: (in the model) NodesSchema.statics.createFile = function(opts, user, cb) { var _this = this; async.waterfall([ function(callback) { _this.findOne({ _id: opts.location }, function(err, data) { if (err) { console.error(err); return callback('INTERNAL_ERROR'); } if (!data) { return callback('INVALID_LOCATION'); } callback(null, opts.location); }); }, function(location, callback) { _this.findOne({ location: location, owner: user._id, name: opts.name, isFile: false }, function(err, data) { if (err) { console.error(err); return callback('INTERNAL_ERROR'); } if (data) { return callback('FILE_EXISTS'); } callback(null); }); }, My questions are: Am I doing this right? Should I place the "waterfall" in the controller or it should stay in the model? Is there a better way of doing these checks?

http://stackoverflow.com/comment/42284889
has text: I believe this article will help you: http://encosia.com/using-pageload-in-both-master-and-content-pages/
comment on: http://stackoverflow.com/q/26861654
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/q/26954961
favorite count: 0
score: 2
upvote count: 2
has title: Method Inheritance in JavaScript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42450325
has answer: http://stackoverflow.com/a/26956257
has answer: http://stackoverflow.com/a/26955482
tagged with: prototype
type: Question
has body: JavaScript uses a Prototype system, which is fundamentally different than a Class system. This is my first serious encounter with the language. I had fooled around with it previously, but this is the first time I built a system with proper OO, inheritance, polymorphism, etc. From what I read there seems to be a few common methods to do member function inheritance in Javascript. Assuming you have a parent foo as following foo = function(){ this.one = 1; } foo.prototype.func1 = function(){return this.one;} The MDN Introduction to JavaScript Inheritance suggests the naive approach of invoking the parent's method in the context of the child, as shown below. bar = function(){ foo.call(this); } bar.prototype = Object.create(foo.prototype); bar.prototype.func1 = function(){ return this.one + foo.prototype.func1();} This has the advantage of being simple to understand, but can become cumbersome as pointed out in this Salsify Blog post. The blog post outlines an alternate method where a super property is defined in the child prototype, and the name of each member function is attached as a property to the method. This method, however, relies on the caller property of a method, which the article points out will soon be deprecated. Rather than duplicate the entire post, I believe a summary of the important points are these Object.defineProperty(bar.prototype, "super", { get: function get() { ... // methodName is set as a property on each method in an omitted code segment methodName = get.caller.methodName; ... Object.getPrototypeOf(this.prototype)[methodName] } } Which is to say that you find the method with the same name in your prototype's prototype. I was wondering if this can be done in a simpler manner, without having to attach the method name as a parameter and without the Function.caller. foo.prototype.super = function(method) { superMethod = Object.getPrototypeOf(this.constructor.prototype)[method]; return superMethod.call(this, Array.prototype.slice.call(arguments, 1))…
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: polymorphism
tagged with: inheritance

http://stackoverflow.com/comment/42484608
type: QuestionComment
comment on: http://stackoverflow.com/q/26974643
has text: @anpsmn He doesn't add the closing tags for until after he's appended the tags. It shouldn't be affecting anything.
type: Comment
score: 0

http://stackoverflow.com/comment/42443447
comment on: http://stackoverflow.com/q/26951142
score: 0
type: QuestionComment
type: Comment
has text: I guess I'm not trendy!

http://stackoverflow.com/a/26904122
answers question: http://stackoverflow.com/q/26904079
accepted answer of: http://stackoverflow.com/q/26904079
upvote count: 1
type: AcceptedAnswer
type: Answer
has body: Setup a class (or more) in CSS that will contain your custom styles, then use jQuery to add or remove that class to / from the relevant element(s). In jQuery, you can use the toggleClass function for that. CSS: .my-layout { /* do your custom styling */ } JS: $('#swap-layout').click(function() { $('#dropdown').toggleClass('my-layout'); });
downvote count: 0
has comment: http://stackoverflow.com/comment/42360264
score: 1
has comment: http://stackoverflow.com/comment/42360684
has comment: http://stackoverflow.com/comment/42359899

http://stackoverflow.com/q/26888217
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42334970
tagged with: css
has answer: http://stackoverflow.com/a/26889918
type: AnsweredQuestion
tagged with: twitter-bootstrap
type: Question
accepted answer: http://stackoverflow.com/a/26889918
has body: Working on a site mcelroymotors.com. If you look at the carousel on the homepage a caption pops up on the first slide with text. I wish to have this occur on all slides however it seems that it does not appear after the first one.
has title: Bootstrap carousel content fade
has comment: http://stackoverflow.com/comment/42333656
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42330862

http://stackoverflow.com/comment/42416895
comment on: http://stackoverflow.com/a/26936011
type: Comment
has text: Oooooh I see. So, it's a good thing we can add properties to an object after it has been created.
score: 0
type: AnswerComment

http://stackoverflow.com/q/26946167
has title: facebook Like button not showing for jquery version
has comment: http://stackoverflow.com/comment/42563298
answer count: 0
score: 0
has body: I followed the tutorial for integrating facebook in my webapp, using jquery . Then I wanted to add a like button following this tutorial snippet But it is not working. My webapplication and javascript code, is available at www.stretchsketch.com The relevant part in my html page looks like : .... $( document ).ready( function() { is not defined on the page itself but in a separate javascript document, (js/stretchsketch.js) (see here) referred to by the main html document. I see the that #fb-root div gets created, iframes appended etc, but the like button is not visible. Where am i going wrong?
type: Question
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
tagged with: facebook
has comment: http://stackoverflow.com/comment/42486710

http://stackoverflow.com/a/26891982
answers question: http://stackoverflow.com/q/26891701
has comment: http://stackoverflow.com/comment/42361588
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/42339411
has comment: http://stackoverflow.com/comment/42339340
has body: $(window).ready() only applies to the content within the HTML file and you can only use load to attach an onload event handler to a specific image (not a container), something like this might work for you. window.ImageLoadHandled = false; window.ImageLoadCount = 0; function ImageLoadHandler() { // guard against calling this function twice if(window.ImageLoadHandled) return; window.ImageLoadHandled = true; // All images have loaded || timeout expired... } $("#myAjaxedDiv img").load( function() { window.ImageLoadCount++; if( window.ImageLoadCount == $("#myAjaxedDiv img").length ) { // all images in #myAjaxedDiv have loaded ImageLoadHandler(); } }); // if images haven't loaded after 5 seconds, call the code setTimeout( ImageLoadHandler, 5000 ) The only problem with this is that if an image fails to load for whatever reason, the code will never be hit, which is quite risky. To counteract this I'd recommend creating a setTimeout() method to call your code after a few seconds timeout in-case there is a problem loading images (client or server side) and I've also taken @TrueBlueAussie's correction into account in the edit. Your alternative is to preload the images with your HTML page
has comment: http://stackoverflow.com/comment/42338226

http://stackoverflow.com/q/26983490
has comment: http://stackoverflow.com/comment/42501095
has answer: http://stackoverflow.com/a/26983828
downvote count: 1
type: Question
has body: I need to be able to do something like this var date = new Date(); var month = date.getDate(); var strmonth = month.toString(); //This returns [Window Object] I've also tried this variation month = Number(date.getDate()); strmonth = month.toString(); // This also returns [Window Object]
score: -1
tagged with: date
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: string
has comment: http://stackoverflow.com/comment/42501504
favorite count: 0
has comment: http://stackoverflow.com/comment/42501096
has comment: http://stackoverflow.com/comment/42501090
has title: Disassociate value of Date method from the object
type: UnansweredQuestion

http://stackoverflow.com/a/26917671
has comment: http://stackoverflow.com/comment/42383924
downvote count: 0
has comment: http://stackoverflow.com/comment/42383830
type: AcceptedAnswer
has body: Finally I decided for the third option, which was in my opinion, and for my purposes (read content from a file and update a URL) the easiest and fastest to implement. Here what I did: In my popup.js, when the user presses the import button, I call chrome.tabs.executeScript and read a file with the code to be injected into the current tab page: else if(e.target.id=="import") { chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { chrome.tabs.executeScript(tabs[0].id, {file: "src/content_script.js"}); }); } Then I moved all the import logic in the content_script.js file, where I: Create a new input file element using document.createElement. Append this element as child of html &lt;body&gt;. Trigger click event from the element (it is important to remind that the .click event in chrome cannot be triggered on object that are not part of any DOM object). Handle change event for the input file. Here is the code: var fileChooser = document.createElement("input"); fileChooser.type = 'file'; fileChooser.addEventListener('change', function (evt) { var f = evt.target.files[0]; if(f) { var reader = new FileReader(); reader.onload = function(e) { var contents = e.target.result; /* Handle your document contents here */ document.location.href = url_array; // My extension's logic } reader.readAsText(f); } }); document.body.appendChild(fileChooser); fileChooser.click(); It seems that in a content script I cannot access the chrome.tabs object, so in my case I just decided to use the usual document.location.href to change the URL.
score: 22
has comment: http://stackoverflow.com/comment/69996136
type: Answer
upvote count: 22
accepted answer of: http://stackoverflow.com/q/26884140
has comment: http://stackoverflow.com/comment/42384154
answers question: http://stackoverflow.com/q/26884140

http://stackoverflow.com/q/26837334
has answer: http://stackoverflow.com/a/26837408
tagged with: javascript
has answer: http://stackoverflow.com/a/26837712
accepted answer: http://stackoverflow.com/a/26837712
score: 0
answer count: 3
tagged with: chaining
has title: Combining promises and chaining
tagged with: promise
has body: Is there a good design pattern for utilizing promises, while still supporting chaining? For example, let's say that we have something like: function Foobar() { this.foo = function() { console.log('foo'); return this; }; this.bar = function () { console.log('bar'); return this; }; } var foobar = new Foobar(); foobar.foo().bar(); If instead we change the methods to use promises, e.g. function Foobar() { this.foo = function() { var self = this; return new Promise(function (resolve, reject) { console.log('foo'); resolve(self); }); }; ... } Is there a good way to do something like: var foobar = new Foobar(); foobar.foo().bar().then(function () { // do something });
possible better answer: http://stackoverflow.com/a/26837408
has answer: http://stackoverflow.com/a/27117931
type: AnsweredQuestion
tagged with: bluebird
tagged with: method-chaining
type: Question
has comment: http://stackoverflow.com/comment/42240122
has comment: http://stackoverflow.com/comment/42240547

http://stackoverflow.com/comment/42477640
comment on: http://stackoverflow.com/q/26944839
score: 0
type: Comment
type: QuestionComment
has text: @antont I opened the file in Wampserver in chrome and it is working. I guess it was a problem of browser. In my computer, it is not without server in any browser (firefox, chrome and IE). But in another computer, it is working in firefox. Any idea what browser issue could be in my firefox?

http://stackoverflow.com/q/26892510
tagged with: autocomplete
answer count: 1
tagged with: javascript
tagged with: jquery
has title: minLength 3 on autocomplete and a button to manually search with minLength 0
score: 0
has body: I'm trying to create an autocomplete functionality where the search is not triggered when less than 3 characters are typed because of the size of the result set. However there are some names that actually only have 1 or 2 letters in their first and last name. The solution is to allow the user to click the magnifying glass within the input to submit, or 'force through' a query with a 1 or 2 character value. Here's where I'm at: HTML: &lt;input id="mainSearch" class="ui-front" name="mainSearch" type="text" data-role="autocomplete" placeholder="Recognize a UPSer"&gt; &lt;a href="#" class="bgbutton"&gt;&lt;/a&gt; jquery: $('#mainSearch').autocomplete({ appendTo: ".inputWrapper", minLength: 3, source: function (request, response) { var customer = new Array(); $.ajax({ async: false, cache: false, type: "POST", url: "//database//EmployeeDirectory/", data: { "filterText": request.term }, error: function (data) { console.log('Error!'); }, success: function (data) { for (var i = 0; i &lt; data.length ; i++) { customer[i] = { label: data[i].FullName, Id: data[i].UserID }; } } }); response(customer); } }); $('.bgbutton').on('click', function () { $('#mainSearch').autocomplete('option', 'minLength', 0); $('#mainSearch').autocomplete('search', ''); }); The this works upon first try. But once 2 characters are entered clicking the submit button minLength is then set to 0 for all autocomplete functions. And backspacing to one character will make a full query. How can both Autocomplete functions have independent minLengths?
has answer: http://stackoverflow.com/a/26892690
accepted answer: http://stackoverflow.com/a/26892690
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/42536573
score: 0
type: Comment
has text: The ajax_call starts but never finishes.It sounds like the server is not responding correct ? But thats not the case. Node webkit /chromium browser is doing something wrong with those calls. I can run those calls through regular browser.
type: QuestionComment
comment on: http://stackoverflow.com/q/26981110

http://stackoverflow.com/comment/42485868
type: Comment
has text: You'd adjust speed before initialization.
type: QuestionComment
comment on: http://stackoverflow.com/q/26974572
score: 0

http://stackoverflow.com/comment/42365656
type: QuestionComment
comment on: http://stackoverflow.com/q/26907669
type: Comment
has text: IHMO, I think it's mainly because of the form management of Angular : https://docs.angularjs.org/api/ng/directive/form > ngMaxLength is binded to validation / error events (and related CSS classes), when HTML attribute is not.
score: 4

http://stackoverflow.com/q/26966998
has comment: http://stackoverflow.com/comment/42481428
tagged with: loops
type: Question
tagged with: for-loop
has comment: http://stackoverflow.com/comment/42471302
has answer: http://stackoverflow.com/a/26968135
upvote count: 0
tagged with: javascript
has title: Loop though properties of an object in JavaScript?
answer count: 3
has comment: http://stackoverflow.com/comment/42471180
has comment: http://stackoverflow.com/comment/42471142
score: -2
has comment: http://stackoverflow.com/comment/42471614
favorite count: 0
has body: I have the set of data.how would you loop through this data using a for loop in JavaScript? var model = ({ "DettolRadiance": { "Values": [{ "GRPsValue": 66, "MonthOfSale": "Jan" }, { "GRPsValue": 100, "MonthOfSale": "Feb" }, { "GRPsValue": 250, "MonthOfSale": "March" }, { "GRPsValue": 100, "MonthOfSale": "April" }], "Key": "DettolRadiance" }, "DettolSkinCare": { "Values": [{ "GRPsValue": 487, "MonthOfSale": "Jan" }, { "GRPsValue": 450, "MonthOfSale": "Feb" }, { "GRPsValue": 300, "MonthOfSale": "March" }, { "GRPsValue": 400, "MonthOfSale": "April" }], "Key": "DettolSkinCare" }, "DettolToiletSoaps": { "Values": [{ "GRPsValue": 64, "MonthOfSale": "Feb" }, { "GRPsValue": 0, "MonthOfSale": "Jan" }, { "GRPsValue": 70, "MonthOfSale": "March" }, { "GRPsValue": 150, "MonthOfSale": "April" }], "Key": "DettolToiletSoaps" } }); Here is the code which I have tried. var DataSet = []; for (var i = 0; i &lt; model[0].DettolRadiance.Values.length; i++) { DataSet.push({ 'x': model[0].DettolRadiance.Values[i].MonthOfSale, 'y': model[0].DettolRadiance.Values[i].GRPsValue }); } for (var i = 0; i &lt; model[0].DettolSkinCare.Values.length; i++) { DataSet.push({ 'x': model[0].DettolSkinCare.Values[i].MonthOfSale, 'y': model[0].DettolSkinCare.Values[i].GRPsValue }); } for (var i = 0; i &lt; model[0].DettolToiletSoaps.Values.length; i++) { DataSet.push({ 'x': model[0].DettolToiletSoaps.Values[i].MonthOfSale, 'y': model[0].DettolToiletSoaps.Values[i].GRPsValue }); } But I am able to retrieve only Values.I want to retrieve values based on 3 keys.Those are DettolRadiance,DettolSkinCare,DettolToiletSoaps.So Each key should have 4 respective values.I think I need to add another for loop.But I am not getting the exact syntax.Can anyone please help..
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26967487
downvote count: 2
has answer: http://stackoverflow.com/a/26967519

http://stackoverflow.com/comment/42453498
score: 0
type: Comment
has text: @LyingOnTheSky Yes, but that's not JS sees things? `1/3` evaluates to `0.33333...`, AFAIK there is no way to represent a fraction like this in JS without using external libraries.
type: QuestionComment
comment on: http://stackoverflow.com/q/26951407

http://stackoverflow.com/q/26843380
has body: I need the total number of sunday's and saturday's of a month. using moment.js library. Can anyone help me. Thanks
tagged with: date
accepted answer: http://stackoverflow.com/a/26844193
type: Question
score: 5
upvote count: 5
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/20788411
answer count: 1
tagged with: momentjs
favorite count: 0
has comment: http://stackoverflow.com/comment/42250307
has comment: http://stackoverflow.com/comment/42250364
tagged with: node.js
has answer: http://stackoverflow.com/a/26844193
type: AnsweredQuestion
has title: Get the number of Sundays of a month using moment.js

http://stackoverflow.com/a/26968860
answers question: http://stackoverflow.com/q/26968717
downvote count: 0
score: 1
has body: With jQuery (simplified): $("select").find("option:selected").next().prop("selected",true); See fiddle (e.preventDefault() is to show that value changed - to submit remove that line) UPDATE Used :selected instead of [selected] to get currently selected option, and not original selected.. Updated fiddle
has comment: http://stackoverflow.com/comment/42474350
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26968717
type: Answer

http://stackoverflow.com/a/26951111
has comment: http://stackoverflow.com/comment/42443288
has comment: http://stackoverflow.com/comment/42443350
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42443271
accepted answer of: http://stackoverflow.com/q/26951066
has body: Probably the simplest way is to bind click event to body and see if it comes from the element (e.target) which has parent (walk up the tree with closest method) .modal: $(document).click(function(e) { if (!$(e.target).closest('.modal').length) { alert('click outside!'); } }); Demo: http://jsfiddle.net/c89Ls0av/4/ By the way, overlay made with outline is an interesting idea, but it's not real overlay, as it still allows to interact with underlying page elements. Here is an example of the overlay made with div container covering entire page: http://jsfiddle.net/c89Ls0av/5/. This one will prevent page interaction when modal is visible. And here is an example of how open/close functionality can be use together: http://jsfiddle.net/c89Ls0av/7/.
type: Answer
score: 13
answers question: http://stackoverflow.com/q/26951066
upvote count: 13
has comment: http://stackoverflow.com/comment/42443583
has comment: http://stackoverflow.com/comment/42443272
has comment: http://stackoverflow.com/comment/42443253
has comment: http://stackoverflow.com/comment/42443326
has comment: http://stackoverflow.com/comment/42443296
has comment: http://stackoverflow.com/comment/42443302

http://stackoverflow.com/comment/42272384
type: AnswerComment
has text: So i suppose you have used Exploit Scanner (since thats the plugin that scans for base64 encrypted scripts). The only thing you could do right now is to manualy scan (you should do it yourself if you think you could do it) each base64 reported file. If you think you cant do it yourself, post here the log of the exploit scanner report and will see what i can do. For automated resolvation of your problems though you can even use GOTMLS. It has an anti virus integrated that scans for shell scripts and elemeninates them if found. You only need to connect your plugin with the GOTMLS system.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/26853473

http://stackoverflow.com/q/26957693
has comment: http://stackoverflow.com/comment/42458139
answer count: 0
has comment: http://stackoverflow.com/comment/42454586
type: Question
has title: Why does this client-side JS (JQuery, regex) work on some domains but not others?
tagged with: javascript
tagged with: jquery
score: 0
has body: This is really bizarre. I have some purely client-side JS that was working fine on my server, but then stopped working when I moved the site to my client's site. English 한국어 option value="cn">中文 And here's my JS: $('.langset').change(function() { //handle nav between different languages console.log('changed'); window.location.href = document.URL.replace(/\/\w\w\//, "/"+$(this).val()+"/"); }); This allows me to move between corresponding pages like: http://clientname.mysite.net/en/somefolder/somepage.php?somearg=someval http://clientname.mysite.net/kr/somefolder/somepage.php?somearg=someval It works fine on my server. On their server, it works for http://www.clientname.net/en/somefolder/somepage.php?somearg=someval but not for http://clientname.net/en/somefolder/somepage.php?somearg=someval The bizarre thing is that the change event doesn't even fire (I don't get the console log) without the www hostname prepended. Verrrry puzzled. I'm blaming my regex, but it looks fine to me. Any ideas?
type: UnansweredQuestion
tagged with: dns
tagged with: regex

http://stackoverflow.com/comment/42488677
comment on: http://stackoverflow.com/q/26964803
score: 0
type: Comment
has text: *"I am trying to assign a value of 5 if a checkbox is clicked first and a value of 2 for the second checkbox that is selected"* - I'm getting confused. Do you want to set the value to `5` if something is clicked for the first time, and `2` from next time onwards, or do you want to set `5` for the first checkbox and `2` for second checkbox whenever they are selected..?
type: QuestionComment

modal-dialog
tag name: modal-dialog
tags question: http://stackoverflow.com/q/26880359
tags question: http://stackoverflow.com/q/26882686
tags question: http://stackoverflow.com/q/26907100
tags question: http://stackoverflow.com/q/26920653
type: Tag
tags question: http://stackoverflow.com/q/26921784
tags question: http://stackoverflow.com/q/26932432
tags question: http://stackoverflow.com/q/26982666
tags question: http://stackoverflow.com/q/26836795

http://stackoverflow.com/q/26978533
has answer: http://stackoverflow.com/a/36274780
has comment: http://stackoverflow.com/comment/42491661
favorite count: 0
has body: As an angular user, I too shudder at the title of this question, due to the fact that IE8 is evil incarnate and should be put down like a rabid dog. that being said, I was wondering if anyone else has run into the issue of loading Angular 1.3 in IE8, and the page breaking before load and just reporting an error: Object Expected on an if condition that uses the isArray() function. (isArray() is also found in Angular 1.2, so it confuses me that it works there but not in 1.3) So that everyone understands my reasons for this, my company recently took the step of no longer supporting IE8 on new development. But our new UI needs to support IE8 on the initial landing page ONLY, so that users can still access our old software that supports IE8. I was hoping that I could use 1.3, and just write small tweaks for the landing page until it is also out from underneath IE8. Overarching question: is it possible to use Angular 1.3 with IE8 at all, or will I be forced to use 1.2 until we completely remove IE8 support?
tagged with: angularjs
has answer: http://stackoverflow.com/a/26978641
has answer: http://stackoverflow.com/a/30856743
has answer: http://stackoverflow.com/a/31173632
accepted answer: http://stackoverflow.com/a/26978745
type: AnsweredQuestion
tagged with: internet-explorer-8
possible better answer: http://stackoverflow.com/a/26979814
upvote count: 5
has answer: http://stackoverflow.com/a/26979814
has comment: http://stackoverflow.com/comment/42491667
has comment: http://stackoverflow.com/comment/42491758
type: Question
has title: AngularJS 1.3 page won't load in IE8
score: 5
downvote count: 0
tagged with: javascript
answer count: 6
has answer: http://stackoverflow.com/a/26978745

http://stackoverflow.com/a/26952137
downvote count: 0
has body: Using curly brackets to bind a Javascript variable into your HTML view is something very typical of javascript frameworks that provide Data Binding such as AngularJS or EmberJS This might be what you're looking for. There are of course other ways of doing this, such as the new Object.observe() function that's available in Chrome, but it will take a while until its widely supported.
upvote count: 3
answers question: http://stackoverflow.com/q/26951954
type: Answer
score: 3

http://stackoverflow.com/comment/42385930
score: 0
type: Comment
has text: Thanks, as you both gave essentially the same answer, I marked them both :)
comment on: http://stackoverflow.com/a/26918628
type: AnswerComment

http://stackoverflow.com/comment/42437315
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26947491
has text: I'm so confused... How can I do that?
score: 0

http://stackoverflow.com/a/26991908
downvote count: 0
has body: If you have iframe as below :- Amitkumar Gupta Lakshmi Rao M1003423 M1018652 Mahesh Kumar Kothapally Manikyam Pulaparthi Raghavendra S Shibi Then in parent window :- var iframeBody = $("#iFrame").contents().find("body"); var valueFromIframe = iContentBody.find($('#firstSelectms2side__sx option:selected')).text();
answers question: http://stackoverflow.com/q/26990992
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/128553528

http://stackoverflow.com/a/26870390
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/26868343
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42333993
has comment: http://stackoverflow.com/comment/42309474
has body: I'd suggest doing the sum calculation within the controller: var myApp = angular.module('myApp',[]); function MyCtrl($scope) { var carsDict = { 391: [ { arrival: "17.43.49", car: "391", date: "11/11/2014", duration: "00:00:06", time: "17.43.43" } ], 396: { 0: { arrival: "17.20.48", car: "396", date: "11/11/2014", duration: "00:00:11", time: "17.20.37", }, 1: { arrival: "17.21.27", car: "396", date: "11/11/2014", duration: "00:00:17", time: "17.21.10" } } }; for (record in carsDict) { var totalduration = ''; for (item in carsDict[record]) { // get totalduration figured out.. totalduration += carsDict[record][item].duration; // need to account for sum using time format here } for (item in carsDict[record]) { // now add totalduration to each record carsDict[record][item]['totalduration'] = totalduration; // to add a new value to the individual item carsDict[record][item]['newvalue'] = 'anything you want'; // to remove a value (I prefer changing to undefined) carsDict[record][item].arrival = undefined; } }; $scope.test = carsDict; }
type: Answer
has comment: http://stackoverflow.com/comment/42301771
accepted answer of: http://stackoverflow.com/q/26868343

http://stackoverflow.com/q/26887523
has title: How to validate a specific number of text input fields for an entry?
downvote count: 1
has body: number_people_household is a drop down that decides how many input text fields are visible in the next question. My problem arises when I want to validate that specific number of visible fields. For example if there are 3 fields I want to validate the three visible ones for text. If one or more are empty alert("mistake"). If all visible fields are filled carry out the loadNew() function. function checkSeveralFilled() { var e = document.getElementById("number_people_household"); var amount = e.options[e.selectedIndex].text; var inp = document.getElementsByTagName('input'); for(var i in inp; i &lt; amount;){ if(inp[i].type == "text"){ if(inp[i].value != ""){ loadNew(); } else { alert("missing value"); } } } } UPDATE: Added some HTML. For some reason my function is not recognising any input types equaling "text" I assume. &lt;div class="question"&gt; &lt;div class="white_box"&gt; List the ages of people in your household? &lt;/div&gt; &lt;div class="answer"&gt; &lt;div class="rule" id="rules"&gt; Only Numbers Allowed, eg 14, 15, 44, 45 &lt;/div&gt; &lt;input id="person1" class="person1" type="text" placeholder="Person 1" onkeyup="checkInputs(this)"/&gt; &lt;input id="person2" class="person1" type="text" placeholder="Person 2" onkeyup="checkInputs(this)"/&gt; &lt;input id="person3" class="person1" type="text" placeholder="Person 3" onkeyup="checkInputs(this)"/&gt; &lt;input id="person4" class="person1" type="text" placeholder="Person 4" onkeyup="checkInputs(this)"/&gt; &lt;input id="person5" class="person1" type="text" placeholder="Person 5" onkeyup="checkInputs(this)"/&gt; &lt;input id="person6" class="person1" type="text" placeholder="Person 6" onkeyup="checkInputs(this)"/&gt; &lt;input id="person7" class="person1" type="text" placeholder="Person 7" onkeyup="checkInputs(this)"/&gt; &lt;input id="person8" class="person1" type="text" placeholder="Person 8" onkeyup="checkInputs(this)"/&gt; &lt;input id="person9" class="person1" type="text" placeholder="Person 9" onkeyup=…
type: Question
tagged with: javascript
score: 0
tagged with: validation
has comment: http://stackoverflow.com/comment/42330109
has comment: http://stackoverflow.com/comment/42329650
favorite count: 0
answer count: 0
has comment: http://stackoverflow.com/comment/42329524
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/a/26914742
accepted answer of: http://stackoverflow.com/q/26888548
answers question: http://stackoverflow.com/q/26888548
type: AcceptedAnswer
upvote count: 14
type: Answer
has body: This would do it: /** @constructor */ function MyClass() { /** * @property {Number} * @name MyClass#rnd */ Object.defineProperty(this, 'rnd', { get : function () { return Math.random(); } }); } I've used the @property {type} name syntax but never inside of a class. What I typically do is something like: /** @property {object} */ this.foo = {}; And then jsdoc uses this.foo to compute the name (foo) and which entity it belongs to. It appears that using @property {type} name in a class does not work. If you specify the name with @name, then it knows what name to give to it and where it belongs. The # indicates that it is an instance variable (rather than static or inner). See the namepath documentation for details.
downvote count: 0
score: 14

google-pie-chart
tag name: google-pie-chart
type: Tag
tags question: http://stackoverflow.com/q/26941451

http://stackoverflow.com/comment/42432873
comment on: http://stackoverflow.com/q/26944987
has text: One more example: http://jsfiddle.net/7mzzep4m/
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26837626
score: 2
downvote count: 0
has body: Unfortunately there is no official spec that I am aware of that has been widely implemented for transferring non-ACSII data within HTTP headers. The RFC you have linked to is only in the PROPOSED STANDARD state and is from 2010. It looks like Node 0.10 explicitly passed header values through to basically new String(val) so the values are parsed as utf8 values. It looks like in Node 0.11, the string isn't quite so mangled, so var iconv = new Iconv('ISO-8859-1', 'UTF-8'); console.log(iconv.convert(new Buffer(res.headers['icy-name'], 'binary'))); does actually work as you expect in 0.11. I can't say for sure if that is intentional, or just a side-effect of other work though.
has comment: http://stackoverflow.com/comment/42276207
upvote count: 2
answers question: http://stackoverflow.com/q/26834716
type: Answer

http://stackoverflow.com/q/26920550
upvote count: 1
has comment: http://stackoverflow.com/comment/42395156
has body: I am working on creating a page that will be split across the middle. The page has content that is outside the viewing area on both the left and the right hand side. The idea is that when you click on one side of the page (say the left), an animation is triggered via JavaScript that pushes the content on the other side (the right in this case), hiding it. The way I am designing it will be similar to this slider effect on the images on this page: http://www.buzzfeed.com/alexnaidus/california-drought-images The difference is that either side will have embedded within it other elements (divs, images, etc) and the animation is activated by clicking on either side rather than working automatically when scrolling over the area. Now, what would the most semantically correct and easy to manage way of creating those two sections? (which act almost as layers): would you recommend working with divs and a JS or with the &lt;canvas&gt; element? Many thanks!
type: Question
tagged with: canvas
tagged with: html5-canvas
downvote count: 0
tagged with: javascript
score: 1
tagged with: slider
has title: or for splitting a web page into two separate sections which are animated?
favorite count: 0
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/26883916
answer count: 0
type: UnansweredQuestion
tagged with: fullscreen
has comment: http://stackoverflow.com/comment/42324693
has title: Full page web page javascript crashes upon locking iPad
linked to: http://stackoverflow.com/q/26125503
type: Question
score: 0
linked to: http://stackoverflow.com/q/8063126
tagged with: ios
tagged with: javascript
tagged with: ipad
tagged with: ajax
has comment: http://stackoverflow.com/comment/42330225
has body: I have a web page built on AngularJS, that is optimized for full screen mode on iPads, using &lt;meta name="apple-mobile-web-app-capable" content="yes"&gt; Everything works perfectly fine until the iPad gets locked (either due to prolonged inactivity or using the lock button). Once it is unlocked, the javascript behaves weird. Some of it works, but none of the AJAX calls work. I get a network error. I see the same issue raised here: Javascript stops when iPad is locked, but it seemed to have gone unanswered. I don't lock it during any ongoing AJAX calls, but when all the content has been loaded. This seems to be related to the caching that happens with the full screen mode. Does anybody have any method to work around this? It is a show stopper as far as our application is concerned! Update: I use grunt to build my project, so I have used cache-bust to add dynamic strings to the file names for eg. app.056fd53c6f25f5b2.js , but the issue still persists.

http://stackoverflow.com/a/40316507
downvote count: 0
has comment: http://stackoverflow.com/comment/86855091
has comment: http://stackoverflow.com/comment/92699158
upvote count: 61
has comment: http://stackoverflow.com/comment/89701877
has comment: http://stackoverflow.com/comment/79869933
has body: Swift 3 with all 3 optional functions implemented: func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping () -&gt; Void) { let alertController = UIAlertController(title: nil, message: message, preferredStyle: .actionSheet) alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: { (action) in completionHandler() })) present(alertController, animated: true, completion: nil) } func webView(_ webView: WKWebView, runJavaScriptConfirmPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping (Bool) -&gt; Void) { let alertController = UIAlertController(title: nil, message: message, preferredStyle: .actionSheet) alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: { (action) in completionHandler(true) })) alertController.addAction(UIAlertAction(title: "Cancel", style: .default, handler: { (action) in completionHandler(false) })) present(alertController, animated: true, completion: nil) } func webView(_ webView: WKWebView, runJavaScriptTextInputPanelWithPrompt prompt: String, defaultText: String?, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping (String?) -&gt; Void) { let alertController = UIAlertController(title: nil, message: prompt, preferredStyle: .actionSheet) alertController.addTextField { (textField) in textField.text = defaultText } alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: { (action) in if let text = alertController.textFields?.first?.text { completionHandler(text) } else { completionHandler(defaultText) } })) alertController.addAction(UIAlertAction(title: "Cancel", style: .default, handler: { (action) in completionHandler(nil) })) present(alertController, animated: true, completion: nil) }
has comment: http://stackoverflow.com/comment/82518889
type: Answer
score: 61
answers question: http://stackoverflow.com/q/26898941

http://stackoverflow.com/comment/42452523
has text: I understood, took me a while for me to understand that. Thanks to you guys, I formatted the code differently and I wrote a 2 function solution to this, sacrificing the little fadein I had :'(
comment on: http://stackoverflow.com/q/26956411
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26870428
has answer: http://stackoverflow.com/a/26870702
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26870540
has comment: http://stackoverflow.com/comment/42299581
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/42300043
has comment: http://stackoverflow.com/comment/42299707
tagged with: arrays
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Split arrays into unordered list?
tagged with: regex
has answer: http://stackoverflow.com/a/26870540
has body: I'm having a simple issue I can't seem to fix. Below is a simplified version: var data = { Alabama: ['AL 1', 'AL 2', 'AL 3'], Alaska: ['AK 1', 'AK 2', 'AK 3'], } Is being printed using data.Alabama, data.Alaska, etc. The unformatted return is: AL 1,AL 2,AL 3 (comma-separated, no space). The basic issue I'm running into is splitting the array with a line break or something similar. jQuery is acceptable and I've tried some basic methods with regex and slice, but nothing seems to return what I'm looking for. The only restriction is that the call to data.Alabama must remain the same (i.e. data.Alabama[0], data.Alabama[1] is not acceptable). Ultimately my desired output would be an unordered list of the array, like so: AL 1 AL 2 AL 3 but just using line breaks would be acceptable also: AL 1 AL 2 AL 3
possible better answer: http://stackoverflow.com/a/26870702
upvote count: 2

http://stackoverflow.com/q/26882540
tagged with: object
has answer: http://stackoverflow.com/a/26882941
tagged with: for-loop
has body: I am extremly new in javascript so please be patient.:) I have the following object var obj= { x: 0, y: 0 }; I want to create a function that will take x,y from the user and store them to an array. So essensialy i want an array to store "obj" objects. var arr = []; var i; for(i=0; i&lt;10; i++) { arr[i] = new obj(x, y); } I am not even sure if i have started the correct way. So how can i fill my array with objects like this? arr= [obj1, obj2, obj3, obj4]; Thank you..
tagged with: function
tagged with: arrays
downvote count: 0
tagged with: javascript
answer count: 3
has answer: http://stackoverflow.com/a/26882668
has title: Create a javascript object and then fill an array through a for loop
favorite count: 0
upvote count: 2
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/26882827
accepted answer: http://stackoverflow.com/a/26882668
possible better answer: http://stackoverflow.com/a/26882827
type: Question

http://stackoverflow.com/comment/42665392
type: Comment
comment on: http://stackoverflow.com/q/26976537
has text: @NevilleS: I need to format BaseURl for Restangular, I need id and I am not able to get that id, because I can't use routeParams
score: 0
type: QuestionComment

http://stackoverflow.com/q/26978404
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26978445
type: Question
has title: How to unload/block loaded JavaScript
tagged with: asp.net-mvc
tagged with: javascript
tagged with: jquery
score: 0
linked to: http://stackoverflow.com/q/10412651
answer count: 2
accepted answer: http://stackoverflow.com/a/26978445
has body: I have those lines that should be blocked for some of pages. So we don't have to use them. Is it possible to do somehow? I mean I don't have access to the Layout page and core code. Can we do it using JavaScript/jQuery somehow?
possible better answer: http://stackoverflow.com/a/26978552
has answer: http://stackoverflow.com/a/26978552

http://stackoverflow.com/q/26936946
answer count: 1
downvote count: 0
tagged with: stripe-payments
favorite count: 0
tagged with: angularjs
has body: When i process a subscription credit card payment I want to include the users email address before I move on to the next step (setup actual account). I can successfully setup the subscription/charge the card but cannot seem to include an email address. I'm using the angular-payments module. How can I pass the email address to stripe? The form: Subscribe The controller: // Stripe Response Handler $scope.stripeCallback = function (code, result) { if (result.error) { window.alert('it failed! error: ' + result.error.message); } else { $http.post('/charge', result) .success(function(data, status, headers, config) { alert('success'); }) .error(function(data, status, headers, config) { console.log(status); alert('error'); }); } }; The node: // for subscriptions: function subscribeUser(token, res){ // this assumes you've already created a plan (dashboard.stripe.com/plans) named 'test' stripe.customers.create({ card: token, plan: '001' }, function(err, customer) { // you'll probably want to store a reference (customer.id) to the customer if (err) { res.send({ ok: false, message: 'There was a problem processing your card (error: ' + JSON.stringify(err) + ')'}); } else { res.send({ ok: true, message: 'You have been subscribed to a plan!'}); } }); }
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28956088
score: 1
upvote count: 1
type: Question
has title: How can I pass an email address along with stripe token using $http POST and angular-payments?
tagged with: javascript

http://stackoverflow.com/q/26941240
has body: Trying to build an interface similar to Instagram's image cropping/positioning experience. Users are going to be uploading an image, and they need to be able to reposition the image within a defined frame. I'm sort of a noob, but I'm ambitious :) My hope is that someone can point me towards a working demo that I can sort of hack at. The closest thing I've found is: http://matiasgagliano.github.io/guillotine/ But actually the functionality of an embedded google map is really closer to what I'm looking for. Here are the features I'm looking for: Smooth zooming, draggable repositioning, rotating Native to desktop, but works on mobile (or at least would allow me to configure it). Reasonably light Can anyone point me in the right direction?
type: AnsweredQuestion
has title: Trying to find a simple/elegant js/jquery solution to control user image positioning, rotation and scaling
has answer: http://stackoverflow.com/a/26941620
score: 1
favorite count: 0
type: Question
tagged with: draggable
tagged with: css
answer count: 1
accepted answer: http://stackoverflow.com/a/26941620
upvote count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/26998544
score: 4
answers question: http://stackoverflow.com/q/26954569
upvote count: 4
has body: Depending on your browser requirements you can use the async tag and import your script after content loads. This probably accomplishes the same thing as setTimeout(func, 0), but perhaps it's a little less hacky. See http://plnkr.co/edit/7DlNWNHnyX5s6UE8AFiU?p=preview html: ... Hello Plunker! ... script.js: for(var i=0; i<500; ++i) { document.getElementById('main').innerText += new Date(); }
downvote count: 0
has comment: http://stackoverflow.com/comment/42529332
type: Answer

http://stackoverflow.com/a/26991444
has body: You could change your JS like this: $( window ).resize(function() { if ($(window).width() &lt; 769 &amp;&amp; !$('html').hasClass('smallWindow')) { $('html').addClass('smallWindow'); foobar(foo1, bar1); } else if($(window).width() &gt; 769 &amp;&amp; $('html').hasClass('smallWindow')) { $('html').removeClass('smallWindow'); foobar(foo2, bar2); } }); And this brings the advantage, that you can add some stylings for the smaller window etc based on the htmlclass
answers question: http://stackoverflow.com/q/26991116
score: 1
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/comment/42323351
comment on: http://stackoverflow.com/q/26882934
has text: I imagine WebStorm doesn't/can't work out that `this` inside your second module is referencing `Window`
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/42411893
score: 0
type: Comment
has text: I'm assuming Wordpress won't use an absolute url, will it? So if you're on the host `m.domain.com`, all links will direct to `m.domain.com` and not `domain.com`
comment on: http://stackoverflow.com/a/26933500
type: AnswerComment

http://stackoverflow.com/q/26955381
has comment: http://stackoverflow.com/comment/42450453
has answer: http://stackoverflow.com/a/26955458
has comment: http://stackoverflow.com/comment/42450482
downvote count: 2
accepted answer: http://stackoverflow.com/a/26955573
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42450485
answer count: 2
upvote count: 0
score: -2
tagged with: javascript
has body: I have an array which has the follow HTML elements: so how can i stringfy this object? Hint: JSON.Stringfy(myOb); doesn't work .
favorite count: 0
has answer: http://stackoverflow.com/a/26955573
possible better answer: http://stackoverflow.com/a/26955458
has comment: http://stackoverflow.com/comment/42450368
has title: Stringify an array of HTML elements?

http://stackoverflow.com/comment/42583258
comment on: http://stackoverflow.com/a/27027268
type: AnswerComment
has text: Thank you. I will be adapting this script to the proprietary script my ESP uses. I will be handled on the server side.
score: 0
type: Comment

tabs
type: Tag
tags question: http://stackoverflow.com/q/26925074
tags question: http://stackoverflow.com/q/26949943
tags question: http://stackoverflow.com/q/26874929
tag name: tabs
tags question: http://stackoverflow.com/q/26975684
tags question: http://stackoverflow.com/q/26879383

http://stackoverflow.com/q/26959263
has body: I am currently using PhoneGap to make an app. As we know, PhoneGap only allow HTML, CSS and JS to be used. Therefore, PHP cannot be used. I have researched a bit and I found out that I can just put the PHP file in a remote server and use AJAX to call for the PHP file using the URL of the remote server. But I cannot find a way to pass a session variable from the PHP to HTML. Passing session variable from PHP to PHP is easy. However as there will not be PHP to PHP communication allowed in PhoneGap, I have to use PHP to HTML and then to PHP again. Passing the session variable using AJAX back to the HTML might be complicated. This leads me into a dead-end. Any clues on how to solve this problem? If my explanation about my situation is not that comprehensible, please feel free to comment. Thanks.
type: Question
score: -1
favorite count: 0
tagged with: cordova
tagged with: php
answer count: 1
has answer: http://stackoverflow.com/a/26959941
has comment: http://stackoverflow.com/comment/42457621
downvote count: 1
has title: Passing session variable from PHP using AJAX
has comment: http://stackoverflow.com/comment/42457339
upvote count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
tagged with: ajax

http://stackoverflow.com/q/26976812
type: Question
score: 1
linked to: http://stackoverflow.com/q/16722424
has title: Ng-click inside Popover for Angular UI-Bootstrap
upvote count: 1
tagged with: javascript
tagged with: angular-ui-bootstrap
favorite count: 0
tagged with: angularjs
has body: I'm using the fairly excellent UI-Bootstrap, and combined with this question, I'm successfully including HTML inside our popovers. The problem we're having is that we want to compile the HTML inside these Popovers, because it includes a button with an ng-click directive, which hopefully triggers a bootstrap-modal dialog. Is there anything we can do? Or any alternatives to get Bootstrap Popovers with buttons that can trigger modals?
has comment: http://stackoverflow.com/comment/42488690
has comment: http://stackoverflow.com/comment/42515420
tagged with: twitter-bootstrap-3
answer count: 0
downvote count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion

http://stackoverflow.com/q/26957560
has answer: http://stackoverflow.com/a/26960560
type: UnansweredQuestion
upvote count: 1
type: Question
has title: Unbind wheel event in Jquery
score: 1
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I want to design my website using skrollr.js and fullpage.js libraries. But skrollr uses the value of scrollTop to transform elements that we choose and fullpage.js seems to scroll the page but he just change the top value of the viewport, so ScrollTop doesn't change and skrollr.js is not effective. I looking for some informations and i finally do my own fullpage.js (i tried) : $('.frame').css({ 'height':$(window).height() }); var active ="section 1"; $(window).bind('mousewheel', function(event) { event.preventDefault(); event.stopPropagation(); if (event.originalEvent.wheelDelta &gt;= 0) { if(active=="section 2"){ $("html,body").stop().animate({scrollTop: 0}, 1000); active="section 1"; } else if(active=="section 3"){ $("html,body").stop().animate({scrollTop: $(window).height()}, 1000); active="section 2"; } } else { if(active=="section 1"){ $("html,body").stop().animate({scrollTop: $(window).height()}, 1000); active="section 2"; } else if(active=="section 2"){ $("html,body").stop().animate({scrollTop: $(window).height()*2}, 1000); active="section 3"; } } }); I have 3 div .frame But when i'm on the first div and i scroll down, my viewport go to the third because i bind the event more than one time. I want to bind one event, scroll and unbind the event for maybe 1 sec.
favorite count: 0
tagged with: fullpage.js

http://stackoverflow.com/q/26952540
has comment: http://stackoverflow.com/comment/42445733
tagged with: javascript
has title: JavaScript lookbehind until whitespace with capture group
type: Question
score: 0
has comment: http://stackoverflow.com/comment/42468498
has comment: http://stackoverflow.com/comment/42445753
has body: Trying to get a capture group and up to space character. Capture groups should look like [ "NOW", "NOW()","(",undefined,")" ]; //regex of now d.match(/(?&lt;=(.*))?(\()(.*)?(\))/); Here is what I am testing as of right now google NOW(time); Just for practice purposes. Here is my explanation of each capture group that I believe is what it is. Lookbehind (?&lt;=(.*)) Not needed but can happen ? First Parenthesis (\() Inside Parenthesis, but not needed if not exists (.*)? Last Parenthesis (\)) As of right now I am getting a invalid regular expression error. I just need NOW(time); out of google NOW(time); Like above. Any help in getting this regex to work appropriately
tagged with: regex
has comment: http://stackoverflow.com/comment/42446705
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42499004

http://stackoverflow.com/a/26863717
has body: $.extend does exactly what you want. (Update: You've since said you want non-enumerable properties as well, so it doesn't do what you want; see the second part of this answer below, but I'll leave the first bit for others.) The bug isn't saying that the resulting object won't have a title property, it's saying that the resulting object's title property won't be a getter, which is perfect for what you said you wanted. Example with correct getter syntax: // The myRepository object const myRepository = { title: "MyTitle" }; // The object with a getter const myObject = { id: "MyId", get title() { return myRepository.title; } }; // The copy with a plain property const copy = $.extend({}, myObject); // View the copy (although actually, the result would look // the same either way) console.log(JSON.stringify(copy)); // Prove that the copy's `title` really is just a plain property: console.log("Before: copy.title = " + copy.title); copy.title = "foo"; console.log("After: copy.title = " + copy.title); Syntax fixes: Added missing variable declarations, =, and ; Removed duplicate property title Corrected the getter declaration syntax If you want to include non-enumerable properties, you'll need to use Object.getOwnPropertyNames because they won't show up in a for-in loop, Object.keys, or $.extend (whether or not they're "getter" or normal properties): // The myRepository object const myRepository = { title: "MyTitle" }; // The object with a getter const myObject = { id: "MyId", }; Object.defineProperty(myObject, "title", { enumerable: false, // it's the default, this is just for emphasis, get: function () { return myRepository.title; }, }); console.log("$.extend won't visit non-enumerable properties, so we only get id here:"); console.log(JSON.stringify($.extend({}, myObject))); // Copy it const copy = {}; for (const name of Object.getOwnPropertyNames(myObject)) { copy[name] = myObject[name]; } // View the copy (although actually, the result would look // the same either way) …
type: Answer
has comment: http://stackoverflow.com/comment/42290709
accepted answer of: http://stackoverflow.com/q/26863564
has comment: http://stackoverflow.com/comment/42289575
answers question: http://stackoverflow.com/q/26863564
score: 4
upvote count: 4
has comment: http://stackoverflow.com/comment/42290931
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42292451
has comment: http://stackoverflow.com/comment/42292251

http://stackoverflow.com/comment/42365283
has text: $.html() doesn't preserves the input elements values. thats why I am using $.clone().
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26907368
type: Comment

http://stackoverflow.com/a/26875453
score: 5
answers question: http://stackoverflow.com/q/26873640
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26873640
type: Answer
has comment: http://stackoverflow.com/comment/42391692
upvote count: 5
has body: Unfortunately, no. No web browsers have implemented any bridges between beacon detection and JavaScript. I don't think a plugin approach is possible on mobile browsers (either iOS or Android), because neither browser supports asynchronous communication between external apps and JavaScript in Mobile Safari / Mobile Chrome. The best you could do is have a custom app that responds to a beacon, then launches a web page in the browser. But I realize that isn't what you are asking for. If you want to build a native app with JavaScript, you can use Cordova (aka PhoneGap) and use plugins that provide beacon support. My company has one for our ProximityKit beacon framework: https://github.com/RadiusNetworks/proximitykit-plugin-cordova There is also a Cordova plugin that has basic beacon support here: https://github.com/petermetz/cordova-plugin-ibeacon

http://stackoverflow.com/a/26983532
has body: Those three options are pretty much it. For the first option you should put all of the common css in to one css file, and load that on all platforms.
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42512941
accepted answer of: http://stackoverflow.com/q/26971737
type: Answer
answers question: http://stackoverflow.com/q/26971737

http://stackoverflow.com/a/26941920
upvote count: 43
downvote count: 0
has body: They are almost the same thing. In jQuery or JavaScript, I would have to recommend the change() event. The reason you should not use keyup() is because if a user inputs a value using autofill, it will not fire the keyup() event. However, autofill does fire the change() event, and your verification script will run, and the input will be verified. NOTE: Normally, change() is fired when the element loses focus. If you want to check data after every key press, you could combine keyup() and change(), which would allow you to parse the data on both events. This is the best of both worlds in my opinion. Hope this helps!
score: 43
answers question: http://stackoverflow.com/q/26941893
type: Answer

http://stackoverflow.com/a/26958707
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42456372
has comment: http://stackoverflow.com/comment/42456657
has comment: http://stackoverflow.com/comment/42456812
type: Answer
answers question: http://stackoverflow.com/q/26958631
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/26958631
has body: You're nesting event handler assignment, which is usually a bug. You've got: $('#publish_api').click(function(e){ which establishes a handler for the "click" event from an element. Inside that event handler is code that sets up another event handler: $("body").on("api_saved", function(e){ alert("calling lifecycle jag"); // ... The reason that's likely to be a bug is that every call to .on() inside the "click" handler will attach a separate copy of that event handler. After clicking twice, there will be two identical handlers for the "api_saved" event. After clicking 5 times, there'll be 5 handlers, and so on. That happens because a call to .on() does not remove event handlers that are already registered. Probably the right thing to do is move that event handler assignment (the one for "api_saved") out of the "click" handler.
has comment: http://stackoverflow.com/comment/42456489
has comment: http://stackoverflow.com/comment/42456422
has comment: http://stackoverflow.com/comment/42456255
has comment: http://stackoverflow.com/comment/42457915
has comment: http://stackoverflow.com/comment/42456172

http://stackoverflow.com/comment/86531358
comment on: http://stackoverflow.com/q/26920304
type: Comment
type: QuestionComment
has text: Did you ever figure out a solution?
score: 0

http://stackoverflow.com/comment/111954528
score: 0
type: Comment
has text: what's the difference between **vnode.context** and **vnode.componentInstance**
type: AnswerComment
comment on: http://stackoverflow.com/a/49288370

http://stackoverflow.com/q/26848642
has body: I am trying to implement a modal (Overlay over a page) where the Page in the background stays at exactly the actual scrolling position but does not scroll and in the foreground there is a modal, that is scrolling when the window-element scrolls. So the "old" page should be behind of the modal like a fixed background of the body and the modal should scroll like a normal page would. As I am using a reactive web-framework (meteor), it is not clear what is shown at the time, the modal is shown. If it would be possible to avoid a horizontal shift of the middle of the page, when a scrollbar is shown or hidden, it would be cool. my actual html is like: When The modal is shown, .page-content should be fixed in place and scroll position (So when I scroll up, the "viewport" should exactly stay the same, (As well as .modal-background, which is basically that grey plane, while .modal-inner should scroll normally with the page. Ideally the showing/hiding of the modal should be solved with setting display:block or display:none of '.modal-container' and perhaps giving .page-contents an additional class.
tagged with: javascript
has answer: http://stackoverflow.com/a/26851001
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: css
type: UnansweredQuestion
has title: How to build a html modal with fixed backpage and scroll of window instead of a div
type: Question

http://stackoverflow.com/comment/42259880
type: AnswerComment
comment on: http://stackoverflow.com/a/26847642
type: Comment
score: 0
has text: It doesnt break though

http://stackoverflow.com/a/26949687
has comment: http://stackoverflow.com/comment/42440911
has body: As Crockford says: "The rules by which they do that are complicated and unmemorable." The spec defines them all in section 11.9.3 (pointed out by @Oriol in a comment to OP). For the two cases you provided: if ( 42 == true ) // false ( Only 1 is true ) if ( "Hello World" == true ) // false ( false for any string ) In case 1, y is a Boolean, so it gets converted to a number (step 7). The number conversion of true is 1. So now we're evaluating 42 == 1. This is obviously false. In case 2, y is again a Boolean, but this time, x is a string. Per step 7, y is converted to a number, so the comparison is now "Hello World" == 1. Per step 5, x is now converted to a number. The numerical representation of an arbitrary string is NaN. Now NaN == 1 is being compared. As it says in step 1ai, that's false. Again, as Crockford said...
accepted answer of: http://stackoverflow.com/q/26949187
answers question: http://stackoverflow.com/q/26949187
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42987900
type: Answer
upvote count: 6
score: 6

http://stackoverflow.com/comment/42288227
comment on: http://stackoverflow.com/q/26864066
has text: No not even an error u can check my website www.kreativestudio.ca no background at all
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/42356120
type: Comment
type: QuestionComment
has text: Do you want 1 hour slot duration i.e. 8am,9am... Make slotDuration: '01:00:00'
comment on: http://stackoverflow.com/q/26902068
score: 0

http://stackoverflow.com/comment/42284079
type: QuestionComment
comment on: http://stackoverflow.com/q/26861795
has text: @EhsanSajjad: I checked . There is no error.
score: 0
type: Comment

http://stackoverflow.com/q/26975416
tagged with: javascript
has body: I have a users collection with a likes array. I need to update all of the likes for every user. I wrote a script to do that, but it is crazy slow. I need to update tens of millions of users. db.users.find().forEach( function(user) { users.likes.forEach( function(like){ like.stars = 5; }); db.users.save(user); }); Do you know any faster way to achieve this? EDIT: A sample document would look like: { "_id" : ObjectId("4f0f31ab0c20020600012301"), "created_at" : ISODate("2012-01-12T19:16:59.748Z"), "predictions" : null, "likes" : [ { "_id" : ObjectId("4f0f4a3978c7890600020f2b"), "brand_id" : "bcbgmaxazria" } ], "updated_at" : ISODate("2012-12-19T10:09:20.000Z") } I want to add a new stars field with the value 5 to all of the objects in the likes collections.
tagged with: mongodb
score: 0
linked to: http://stackoverflow.com/q/4669178
answer count: 1
accepted answer: http://stackoverflow.com/a/26977462
has comment: http://stackoverflow.com/comment/42485906
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26977462
type: Question
tagged with: performance
has title: How to perform scalable mass update for embedded documents in arrays

http://stackoverflow.com/comment/69382609
score: 0
type: Comment
has text: Mylar is not under maintenance, Planifica:encryption is client side encryption only. Can you suggest a plugin which will be useful for the db side encryption.
type: AnswerComment
comment on: http://stackoverflow.com/a/32550996

checkbox
tag name: checkbox
tags question: http://stackoverflow.com/q/26841268
tags question: http://stackoverflow.com/q/26926672
tags question: http://stackoverflow.com/q/26987827
tags question: http://stackoverflow.com/q/26924000
tags question: http://stackoverflow.com/q/26929249
tags question: http://stackoverflow.com/q/26833761
tags question: http://stackoverflow.com/q/26915576
tags question: http://stackoverflow.com/q/26952443
tags question: http://stackoverflow.com/q/26887435
tags question: http://stackoverflow.com/q/26964803
tags question: http://stackoverflow.com/q/26845218
tags question: http://stackoverflow.com/q/26931656
tags question: http://stackoverflow.com/q/26846306
tags question: http://stackoverflow.com/q/26898441
tags question: http://stackoverflow.com/q/26944615
type: Tag
tags question: http://stackoverflow.com/q/26885551
tags question: http://stackoverflow.com/q/26946275
tags question: http://stackoverflow.com/q/26954244
tags question: http://stackoverflow.com/q/26875131
tags question: http://stackoverflow.com/q/26953149
tags question: http://stackoverflow.com/q/26957091
tags question: http://stackoverflow.com/q/26982962
tags question: http://stackoverflow.com/q/26863598

http://stackoverflow.com/comment/42373788
type: QuestionComment
comment on: http://stackoverflow.com/q/26912115
score: 0
has text: There is no magic solution to modifying dynamically loaded content. You need to run that code on the loaded panel, just after it is loaded. Only CSS styling and events can be handled dynamically by all browsers.
type: Comment

http://stackoverflow.com/comment/42393169
type: Comment
comment on: http://stackoverflow.com/q/26922657
has text: I just ran it and it worked perfectly. Do you have the included file in the same directory? Try running it at the command line (if you aren't already) and tell us what you see. (To run at the command line, you do `php nameofyourfile.php`.)
score: 0
type: QuestionComment

http://stackoverflow.com/comment/42400177
type: Comment
comment on: http://stackoverflow.com/a/26925041
type: AnswerComment
score: 0
has text: Yes, i mean to add multiple select, for sure i will have different id's and bind to it

http://stackoverflow.com/comment/42295750
score: 0
type: Comment
type: QuestionComment
has text: far as I remember, the === operator doesn't carry out a type conversion before the comparison takes place, so if it is coming back as a string, it'll evaluate to false
comment on: http://stackoverflow.com/q/26868164

http://stackoverflow.com/a/26935878
accepted answer of: http://stackoverflow.com/q/26935807
upvote count: 2
answers question: http://stackoverflow.com/q/26935807
type: Answer
has comment: http://stackoverflow.com/comment/42416351
has comment: http://stackoverflow.com/comment/42416214
score: 2
has body: The reason why it doesnt work is because Angular's internal dirty-checking loop is not fired. It's because you use a standard setTimeout. Instead of that, either manually call $scope.$apply() at the end of your setTimeout callback, or better, use the angular wrapper $timeout. Here is your updated jsbin: http://jsbin.com/devuhovaxa/3/edit Additionally here the docs for $timeout: https://docs.angularjs.org/api/ng/service/$timeout
has comment: http://stackoverflow.com/comment/42416260
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/26860178
favorite count: 0
has comment: http://stackoverflow.com/comment/42282164
has comment: http://stackoverflow.com/comment/42281682
has comment: http://stackoverflow.com/comment/42281033
tagged with: php
has comment: http://stackoverflow.com/comment/42281124
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/42281168
upvote count: 1
has title: convert a JS function to PHP (math function) - no client base
has comment: http://stackoverflow.com/comment/42281133
score: -1
has comment: http://stackoverflow.com/comment/42281036
has body: I need to convert some JavaScript calculusion functions to PHP. Please help to write this two loops with PHP JS: for (a = 0; a &lt; 9; a++) z = z.replace(new RegExp('\\' + ",-+@/. ;_".charAt(a), 'g'), "NTj2M10AO".charAt(a)); PHP: $St1 = ",-+@/. ;_"; $St2 = "NTj2M10AO"; for($a=0;$a&lt;9;$a++){ z= preg_replace("\\$St1[$a]" ........ , $St2[$a],$z); } and JS: var l = 128, o = (z.length) / 2, I = ''; for (a = ((k - 1) * l); a &lt; ((k) * l); a++) I += String.fromCharCode(z.slice(a * 2, (a + 1) * 2)); PHP : .... ? Thanks for your helps Pros
type: Question
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/42280948
has comment: http://stackoverflow.com/comment/42283278
has answer: http://stackoverflow.com/a/26862857

http://stackoverflow.com/comment/42531921
comment on: http://stackoverflow.com/a/26991020
has text: @tomsmeding Perhaps `this.au` came from an untrusted source, say, user input.
type: AnswerComment
type: Comment
score: 2

http://stackoverflow.com/comment/42252376
type: AnswerComment
type: Comment
has text: Suppose If want to unselect Can I use .prop("checked", false);
score: 1
comment on: http://stackoverflow.com/a/26844357

http://stackoverflow.com/comment/42435341
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/26946535
has text: How would I go about utilizing the alm object in the state it's in when I do the `console.log(alm)`?

http://stackoverflow.com/q/26986879
has answer: http://stackoverflow.com/a/27120154
tagged with: compilation
tagged with: javascript
tagged with: sprockets
answer count: 1
downvote count: 0
favorite count: 0
has body: I'm using (Ruby-based) Middleman as a front-end site compiler and I want to get build timestamps in my SCSS and JS. I found this solution to add timestamps to SCSS: Add timestamps to compiled sass/scss Is there an equivalent for JavaScript compiled using Sprockets?
tagged with: ruby
accepted answer: http://stackoverflow.com/a/27120154
has title: Add timestamps to compiled javascript
linked to: http://stackoverflow.com/q/13022461
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/comment/45903617
type: AnswerComment
score: 0
type: Comment
has text: The timeout still gets cleared and created every time the event fires, you're not saving resources using this method.
comment on: http://stackoverflow.com/a/26992079

http://stackoverflow.com/a/26892053
has comment: http://stackoverflow.com/comment/42337934
has comment: http://stackoverflow.com/comment/42378349
score: 4
has comment: http://stackoverflow.com/comment/42338215
upvote count: 4
has comment: http://stackoverflow.com/comment/42338735
has body: Here you have a working simple exemple, wich write the counter in a simple txt file (no sql db needed) <?php $counterFile = 'counter.txt' ; // jQuery ajax request is sent here if ( isset($_GET['increase']) ) { if ( ( $counter = @file_get_contents($counterFile) ) === false ) die('Error : file counter does not exist') ; file_put_contents($counterFile,++$counter) ; echo $counter ; return false ; } if ( ! $counter = @file_get_contents($counterFile) ) { if ( ! $myfile = fopen($counterFile,'w') ) die('Unable to create counter file !!') ; chmod($counterFile,0644); file_put_contents($counterFile,0) ; } ?> <?php echo $counter ; ?> Download btn
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42378422
downvote count: 0
answers question: http://stackoverflow.com/q/26891603
has comment: http://stackoverflow.com/comment/42341327
type: Answer
accepted answer of: http://stackoverflow.com/q/26891603
has comment: http://stackoverflow.com/comment/42338158
has comment: http://stackoverflow.com/comment/42341566

http://stackoverflow.com/comment/42366032
comment on: http://stackoverflow.com/a/26905857
type: AnswerComment
score: 0
type: Comment
has text: @GuyT But if you can't? Let's say, you can't change the view itself.

http://stackoverflow.com/comment/42422373
has text: No, I mean the x, y positions (what the force layout is using) in the elements.
comment on: http://stackoverflow.com/q/26935468
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/79037785
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/36285566
type: Comment
has text: The Advanced Javascript Outlining extension is not working with VS 2017 up to this moment. Is there some other way to get the region collapse for VS 2017?

http://stackoverflow.com/a/26850528
has body: example for one row could be 12 row22 row23
answers question: http://stackoverflow.com/q/26850269
type: Answer
has comment: http://stackoverflow.com/comment/42263508
upvote count: 1
downvote count: 1
score: 0

http://stackoverflow.com/comment/42472784
has text: might [help](http://www.w3schools.com/jsref/jsref_push.asp)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26968002

http://stackoverflow.com/q/26877051
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/31308095
tagged with: css
has body: I tried to make a component for resizable cards using paper-dialog, and I tried to use the css property "resize:both;" but I couldnt find a way to update interior elements and components when their container (paper-dialog) increases in size. Is there a way to capture the resize event on an element? When I do, what should i call/do to trigger the css update? Thanks!
has title: Resizable elements in polymer
has answer: http://stackoverflow.com/a/26877375
tagged with: dom
type: Question
tagged with: polymer
has comment: http://stackoverflow.com/comment/46828686
tagged with: javascript
score: 0
answer count: 2

http://stackoverflow.com/comment/42405186
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26929809
has text: As other answers have pointed out, you need to split up the loop into smaller chuncks using setInterval or setTimeout. That way the UI will have a chance to update since each JavScript execution will not take any significant time. Or at least have a delay before the loop so that the UI has had a chance to update the input with the value "1".

http://stackoverflow.com/comment/42481560
type: Comment
has text: Satya, it doesn't work: only `return` breaks the function and the code that comes after isn't run. However, since it's a button of type `submit`, the submit is always done. With the code I had initially, `return false` would break the function and the action too.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26972990

http://stackoverflow.com/a/26882989
upvote count: 2
score: 2
has body: Thanks for your help, I was able to debus the issue with help of chrome developer tools. I changed my Jquery script to use stingify function. $.ajax({ /* type : "POST", */ url : "launchapptest", /* contentType: "application/json; charset=utf-8", */ data : "processDateInput="+processDate, dataType : "json", async: true, success : function(result) { var od = JSON.stringify(result) ; console.log(od); } }); I was able to view the JSON object on console. Thanks for all the help.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26881873
answers question: http://stackoverflow.com/q/26881873
type: Answer

http://stackoverflow.com/a/26964975
has body: This implementation is based largely on the other SO posts on this subject (see references in question). The code assumes Rails 4.x with the asset pipeline, HAML for the views, Bootstrap for styling, and use of the react-rails gem. (update: a slightly longer discussion can be found at my blog). Layout Here's the app/views/layouts/application.html.haml file: !!! %html %head %title Demo = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' =&gt; true = javascript_include_tag 'application', 'data-turbolinks-track' =&gt; true = csrf_meta_tags %body %div.container %div#flash_messages = yield Note that the div has an id of #flash_messages. The placement of this container div determines where the flash message appear. Controller The private routine below simply converts the native array-of-arrays uses to be parseable JSON in the header. class ApplicationController &lt; ActionController::Base protect_from_forgery with: :exception after_filter :flash_to_http_header private def flash_to_http_header return unless request.xhr? return if flash.empty? response.headers['X-FlashMessages'] = flash.to_hash.to_json flash.discard # don't want the flash to appear when you reload page end end Javascript (ReactJS) The following javascript is made up of a React class, a global function to process flash messages out of the response header, and a JQuery handler for completion of AJAX calls. It's put into a single JX file (I used app/assets/javascripts/react/flash_messages.js.jsx) to keep the relevant JS functionality together. I discuss this more below. /** @jsx React.DOM */ var FlashMessages = React.createClass({ getInitialState: function() { return {messages: this.props.messages}; }, messages: function (messageArray) { this.replaceState({messages: messageArray}); }, render: function() { return ( &lt;div className='flash_messages_component'&gt; {this.state.messages.map(function(message, index) { _level = message[0]; _text = message[1]; return ( &lt;div key={index} class…
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26964974
answers question: http://stackoverflow.com/q/26964974
type: Answer
downvote count: 0
score: 6
upvote count: 6

http://stackoverflow.com/comment/42423548
type: Comment
comment on: http://stackoverflow.com/a/26918566
type: AnswerComment
has text: If you look at the li in a dom inspector can you see class='selected'? Also may be worth checking that the css is included correctly - the DOM inspector should also show the style being applied.
score: 0

http://stackoverflow.com/q/26879327
downvote count: 0
has answer: http://stackoverflow.com/a/26881475
tagged with: handlebars.js
has body: I am trying to append a list in an existing handlebar template. The code below allows me to add a comment but in order for the new comment to appear in the list with the existing comments I need to refresh. What I am wondering is how to append the new comment to the existing comment list in the template. I've included the entire template, but the place where I am trying to add the new comment is the ul with id bodyOfComments. thanks for the help. var comment_post = function() { // console.log($(this).attr("data-id")) $.ajax({ url: 'http://localhost:3000/comments', type: 'POST', data: {comment: { body: $('#content').find('input[name="createComment"]').val(), user_id: 1, image_set_id: $(this).attr("data-id")} } }).done(function(response) { console.log(response); var template = Handlebars.compile($('#imageSetTemplate').html()); $('#bodyOfComments').append(template({ comment: response })); }); }; $(document).ready(function () { $('#content').on('click', '#submitComment', comment_post) }); code below is the handlebars template in html file
type: Question
has title: how to append an item to a list in an existing handelbar template?
score: 1
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/26881475
tagged with: templates
type: AnsweredQuestion

http://stackoverflow.com/comment/42382785
has text: You are right, but unfortunately, I have already seen that one. It hasn't helped yet.
score: 0
comment on: http://stackoverflow.com/q/26917002
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42466297
type: Comment
comment on: http://stackoverflow.com/q/26964171
has text: Use `console.log()` [for debugging](http://blogs.msdn.com/b/cdndevs/archive/2011/05/26/console-log-say-goodbye-to-javascript-alerts-for-debugging.aspx), it will give you more information about variables etc. E.g. immediatly after you assign `accept` have `console.log(accept)` to give you info on the accept variable.
type: QuestionComment
score: 0

http://stackoverflow.com/comment/42418784
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26913571
has text: I meant, when you create a new TextPath to also create a Rect and a Group, and add the TextPath and Rect to the group. A group will not fire mouse events without a child that can report hit detection. We would use this Rect to cover the area that the TextPath would take up. Only thing left to do is to calculate width and height for the Rect.

http://stackoverflow.com/q/26881240
tagged with: javascript
has answer: http://stackoverflow.com/a/26881636
has body: How is there an assignment operator in the OR function. What would be the result of each of the two return statements. Refer: http://www.d3noob.org/2014/01/tree-diagrams-in-d3js_11.html var node = svg.selectAll("g.node") .data(nodes, function(d) { return d.id || (d.id = ++i); }); nodeEnter.append("text") .attr("x", function(d) { return d.children || d._children ? -13 : 13; })
linked to: http://stackoverflow.com/q/23212926
has title: Javascript or D3js Notation
type: Question
answer count: 1
tagged with: d3.js
accepted answer: http://stackoverflow.com/a/26881636
score: 0
has comment: http://stackoverflow.com/comment/42318487
type: AnsweredQuestion

http://stackoverflow.com/comment/42357513
type: QuestionComment
comment on: http://stackoverflow.com/q/26902956
score: 0
type: Comment
has text: title and question are very different.

http://stackoverflow.com/comment/42535630
comment on: http://stackoverflow.com/a/26985272
type: AnswerComment
type: Comment
score: 0
has text: Great to hear I could help you. I suggest you close this question and open an new one with details about your problem.

http://stackoverflow.com/q/26982344
favorite count: 0
upvote count: 1
type: AnsweredQuestion
downvote count: 2
has body: I am new to javascript and having problems getting my head around a problem, that I am having. I have a list that I am trying to pass into a javascript file containing a datagrid called Grid.js. How do I put a C# List into the correct format for javascript? Also how do I pass the js array from model to script? controller: Products = (from product context.Products select new project.Models.ProductsList { ProductID = Product.Id, Name = customer.Name, ProductNumber = customer.ProductNumber, }).ToList(); Format of DataSource for Grid(javascript). var products= [{ "ProductID": 1, "Name": "Car", "ProductNumber": "AR-5381"},]; view &lt;table id="grid"&gt;&lt;/table&gt;&lt;br /&gt; &lt;script type="text/javascript" src="../GridScript/ProductGrid.js"&gt; $(document).ready(myFunction()); &lt;/script&gt; Grid.js var products = []; $(myFunction() { $("#grid").igGrid({ autoGenerateColumns: true, width: "80%", height: "600px", showHeaders: true, fixedHeaders: true, defaultColumnWidth: "200px", columns: [ { headerText: "ProductID", key: "ProductID", dataType: "number" }, { headerText: "Name", key: "Name", dataType: "string" }, { headerText: "ProductNumber", key: "ProductNumber", dataType: "string" }, ], dataSource: products, features: [ { name: 'Paging', type: "local", pageSize: 25 } ] }); }
has title: Linq to Javascript Array
type: Question
has answer: http://stackoverflow.com/a/26982634
tagged with: c#
accepted answer: http://stackoverflow.com/a/26982634
tagged with: ignite-ui
tagged with: asp.net-mvc
tagged with: javascript
score: -1
tagged with: iggrid
has comment: http://stackoverflow.com/comment/42499142
answer count: 1
has comment: http://stackoverflow.com/comment/42499522
has comment: http://stackoverflow.com/comment/42499187

http://stackoverflow.com/comment/42416578
has text: So, if I get this straight, you can have to create the recursion later, you can't bound stuff to ```this``` or try to get the recursion from within the definition?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26936011
type: Comment

http://stackoverflow.com/comment/42391555
type: Comment
has text: After restarting the browser (completely) it works... really weird. Thanks for all the help!
comment on: http://stackoverflow.com/a/26918456
score: 0
type: AnswerComment

http://stackoverflow.com/q/26876198
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/42310182
tagged with: javascript
has comment: http://stackoverflow.com/comment/42310046
tagged with: jquery
accepted answer: http://stackoverflow.com/a/26883381
answer count: 3
has comment: http://stackoverflow.com/comment/42310047
has answer: http://stackoverflow.com/a/26883381
linked to: http://stackoverflow.com/q/25559549
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/26876381
has title: Angular, how to set class to the clicked list item and remove from others li items?
has answer: http://stackoverflow.com/a/26876381
has answer: http://stackoverflow.com/a/26876399
score: 2
type: AnsweredQuestion
has body: I have this list where I'm trying to set class to the clicked list item (but class should be set only for clicked item). I tried to do by this way but without luck: {{theme.name}} {{theme.avg_score}} {{theme.count_of_cards}} How can i do it please in the right way? Thanks for any help.
downvote count: 0
tagged with: ng-class

http://stackoverflow.com/comment/42452525
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26954476
type: Comment
has text: I just added an extra line with a comment, to show you how to `extend` the settings. Done the wrong way, you will overwrite the default `settings`.

http://stackoverflow.com/comment/42292548
score: 1
comment on: http://stackoverflow.com/q/26866592
type: Comment
type: QuestionComment
has text: Do you want something like `{"passengerDetails":[{"photo":"xx"}]}`?

http://stackoverflow.com/q/26952181
type: Question
upvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26956211
answer count: 1
has body: During a process with a modal displayed for the loading, another modal could be displayed over the previous one when an error occurs. When I try to test this situation, I have an error message in the log of my browser (Firefox) ERROR too much recursion jquery.min.js Despite this message, everything is working perfectly (the new modal is diplayed over the first one). The error message does not impact the user (it's not visible) but I'm wondering if I should find a way to correct this problem. Do we have the right to display more than one modal at the same time with Bootstrap &amp; Jquery?
favorite count: 0
tagged with: twitter-bootstrap
has title: Bootstrap - Display more than one modal at the same time
score: -1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26956211
downvote count: 1

jquery-events
tag name: jquery-events
tags question: http://stackoverflow.com/q/26907794
tags question: http://stackoverflow.com/q/26914902
tags question: http://stackoverflow.com/q/26856902
tags question: http://stackoverflow.com/q/26922917
tags question: http://stackoverflow.com/q/26948837
tags question: http://stackoverflow.com/q/26934320
type: Tag
tags question: http://stackoverflow.com/q/26889362
tags question: http://stackoverflow.com/q/26963398
tags question: http://stackoverflow.com/q/26909215

http://stackoverflow.com/a/26835679
score: 1
upvote count: 1
has body: I'm not familiar with your use case but Mandrill offers merge tags for dynamic content in the form of *|FNAME|*, *|LNAME|* etc... You can create your own tags following instructions/guide on the Mandrill knowledge base. You can then create html links in the following manner Activate your whatever
answers question: http://stackoverflow.com/q/26835566
downvote count: 0
type: Answer

http://stackoverflow.com/q/26933043
tagged with: javascript
score: 0
answer count: 3
has body: I am rather new to JavaScript. In my experimentation with some sample code, I have created an html file which contains a table. In one of the table data fields I have a text type field. Is there a way to make a button that inserts a pre-defined template for entry that allows for manipulation? aka I press a button "money" that inputs an additional formatted text to "$0.00". so for example function input_button(){ var template = "$0.00" var my_txt = document.getElementById("money"); my_txt.value += Template; On a side note, what if I wanted to use subscript and superscript? I have tried utilizing the .sup() and .sub() methods, but it just inserts the tags and doesn't alter the aesthetics of the text. ( so in the table, it looks like &lt;sub&gt; things to be subscript &lt;/sub&gt; opposed to things to be subscript
has comment: http://stackoverflow.com/comment/42411199
tagged with: http://stackoverflow.com/tag/html
has title: Javascript, creating a template for a textfield with subscript and superscript
has answer: http://stackoverflow.com/a/26933842
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42410866
type: Question
has answer: http://stackoverflow.com/a/26934096
has answer: http://stackoverflow.com/a/26934024

http://stackoverflow.com/a/26876548
downvote count: 2
has comment: http://stackoverflow.com/comment/42310503
score: -2
upvote count: 0
answers question: http://stackoverflow.com/q/26876493
has comment: http://stackoverflow.com/comment/42311004
type: Answer
has body: $(this).find('td span').each(function(i) { this.ctr = this.ctr || 0; // initialize ctr this.ctr++; console.log(ctr); // 1, 2, 3, 4,....... });

http://stackoverflow.com/a/26878787
has comment: http://stackoverflow.com/comment/42342450
downvote count: 0
has comment: http://stackoverflow.com/comment/42342843
has body: JSON String can be treated as a dictionary . What you should do : success: function (jsonStr) { var json_result = JSON.Parse(jsonStr); // To get profile picture &amp; username for( var i=0; i&lt;json_result['data'].length; i++ ) { var username = json_result['data'][i]['username']; var profile_pic = json_result['data'][i]['profile_picture']; $("#result").text( username ); $("#id_of_image_tag").attr( 'src',profile_pic ); } } The variables contain the respective text , using jquery you can add them to any html as you wish. I would also advise to use $('#id').append() rather than text if you are adding text to the same div.
type: Answer
has comment: http://stackoverflow.com/comment/42326006
upvote count: 1
has comment: http://stackoverflow.com/comment/42374622
answers question: http://stackoverflow.com/q/26867252
score: 1

http://stackoverflow.com/comment/42515701
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26992008
has text: May you modify this code to check if the element contains the class "example"? My element (button) contain several class and this code not works... (¡Sorry! I know it's an abuse: but i dont know how i make it works...)
type: AnswerComment

http://stackoverflow.com/a/26955212
downvote count: 0
answers question: http://stackoverflow.com/q/26955170
has body: You need delegation: $("textarea#code").val($('body').html()); $(document).change("textarea#code", function (e) { $('body').html($(e.target).val()); $("textarea#code").val($('body').html()); }); JSFIDDLE What delegation means?
type: Answer
upvote count: 3
score: 3

karma-runner
tags question: http://stackoverflow.com/q/26952574
tags question: http://stackoverflow.com/q/26889165
tags question: http://stackoverflow.com/q/26850684
tags question: http://stackoverflow.com/q/26845108
tag name: karma-runner
tags question: http://stackoverflow.com/q/26845115
tags question: http://stackoverflow.com/q/26836561
type: Tag
tags question: http://stackoverflow.com/q/26984513
tags question: http://stackoverflow.com/q/26936222

http://stackoverflow.com/comment/42249187
comment on: http://stackoverflow.com/a/26842673
score: 0
type: AnswerComment
has text: I did and the page runs normally but I don't see any output from reload.
type: Comment

http://stackoverflow.com/comment/42335021
has text: OK that was a stupid mistake. Changed that, and it's still not working.
type: QuestionComment
comment on: http://stackoverflow.com/q/26868420
score: 0
type: Comment

http://stackoverflow.com/a/26862936
downvote count: 0
answers question: http://stackoverflow.com/q/26856486
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26856486
has body: macro += "TAG POS=1 TYPE=INPUT:FILE ATTR=TYPE:file&amp;&amp;NAME:pic CONTENT=C:\\Users\\PC\\Desktop\\pics\\boys\\1.jpg" + "\n"; It goes like this.
type: AcceptedAnswer

http://stackoverflow.com/comment/42324404
comment on: http://stackoverflow.com/q/26884353
type: Comment
type: QuestionComment
has text: Same problem Jerodev
score: 0

http://stackoverflow.com/comment/42358840
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26898130
has text: To display a list of values I have tried something like this: $('#exampleModal').on('show.bs.modal', function (event) { var button = $('[data-target="#exampleModal"]') var recipient= button.data('whatever') var modal = $(this) for(s : recipient) modal.find('.modal-body input').text(s + '\n') })
score: 0

http://stackoverflow.com/q/26913438
has answer: http://stackoverflow.com/a/26913874
accepted answer: http://stackoverflow.com/a/26913874
has comment: http://stackoverflow.com/comment/42376571
favorite count: 0
has body: I'm having difficulty on some websites I work on with slow executing jQuery $.ajax. I am not talking about the server taking a long time to respond. I am talking about the actual execution of the $.ajax function taking a long time. Normal (fast) example Going to jQuery.org and running the following code takes 3ms: var start = (new Date()).getTime(); $.get("https://jquery.org/projects/") var end = (new Date()).getTime(); console.log("executed in " + (end - start) + "ms") Bad (slow) example However, running very similar code on a demo website I'm working on takes 324ms: var start = (new Date()).getTime(); $.get("http://sauce-demo.myshopify.com/collections/frontpage/products/bronze-sandals") var end = (new Date()).getTime(); console.log("executed in " + (end - start) + "ms") Now obviously the response from $.ajax (and therefore $.get) is going to be async. But what could be causing such a huge increase in execution time? Thanks
has comment: http://stackoverflow.com/comment/42376242
has comment: http://stackoverflow.com/comment/42376172
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/42376274
upvote count: 3
type: Question
has title: jQuery $.ajax execution slow
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/42376276

http://stackoverflow.com/q/26942956
tagged with: javascript
tagged with: jquery
has body: I have four number formats '123 456,78', '123.456,78', '123'456.78', '123,456.78' in my application with dynamic decimal point. Is there any library or method in Javascript to Format number and remove format method?
favorite count: 0
has comment: http://stackoverflow.com/comment/42429176
has answer: http://stackoverflow.com/a/26942973
upvote count: 2
type: UnansweredQuestion
has title: Javascript number format issue
has answer: http://stackoverflow.com/a/26943671
downvote count: 1
type: Question
score: 1
answer count: 2

http://stackoverflow.com/comment/45925852
comment on: http://stackoverflow.com/a/26992079
score: 0
type: Comment
type: AnswerComment
has text: @nothingisnecessary the amount of time is not set in stone, it was just an easy way to explain how I'd go about doing it. This is an easy way (much easier to comprehend) to get a scroll delta. About your answer - I haven;t tested it, but how do you even get a difference if you fire this on every scroll event? Just wondering. Happy to accept a better answer, but guys, you get hung up on the timeout - the timeout isn't actually there to save resources but mostly to be able to get a **delta**.

http://stackoverflow.com/q/26843490
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion
has body: In given code i uses the text box and input type file dynamically using add and remove button. Add button to add textbox and type file . Remove to remove last added textbox and type file element in form.now prob is how to validate the type file to allow .jpg,.png,.bmpo extention files for uploaded file in javascript. &lt;form id="co_com_form" name="co_com_form" method="get" action=""&gt; &lt;div class="addmore-fields"&gt; &lt;div class="field"&gt; &lt;button id='removeButton' class="button btn btn-primary btn-medium" style="float:right"&gt;remove&lt;/button&gt;&amp;nbsp;&amp;nbsp; &lt;button id='addButton' class="button btn btn-primary btn-medium" style="float:right"&gt;add&lt;/button &gt; &lt;div id='TextBoxesGroup'&gt; &lt;br&gt; &lt;div id="TextBoxDiv1"&gt; &lt;input type="text" name='co_com1' required placeholder="Co Company 1" style="float:left;width:250px;margin-bottom:10px"&gt;&lt;br&gt;&lt;br&gt; &lt;input type="file" name='logo1' placeholder="CoCompany logo" style="float:left;width:250px;margin-bottom:20px"&gt; &lt;/div&gt; &lt;br&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- /field --&gt; &lt;div style="float:left; clear:both; margin-left:50px" &gt; &lt;br&gt; &lt;button class="button btn btn-primary btn-medium" name="submit_co_com" type="submit" onclick="return validatecom();"&gt;Submit&lt;/button&gt; &lt;a href="javascript:void(0);" class="button btn btn-primary btn-medium" onClick="PopUp_com('hide','com_popup');"&gt; Cancel &lt;/a&gt; &lt;/div&gt; &lt;/form&gt; &lt;script src="//code.jquery.com/jquery-1.10.2.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function(){ //---------------add--------------------- var counter=1; $("#addButton").click(function () { if(counter&gt;10){ alert("Only 10 textboxes allow"); return false; } if(counter==1){counter++;} //document.getElementById('removeButton').removeAttribute('style'); var newTextBoxDiv = $(document.createElement('div')) .attr("id", 'TextBoxDiv' + counter); newTextBoxDiv.after().html( '&lt;br&gt;'+'&lt;…
upvote count: 1
has title: how to validate dynamicaly added textbox and input type text file for image upload in php
tagged with: php
score: 1
has answer: http://stackoverflow.com/a/26843573
type: Question
downvote count: 0
answer count: 1

http://stackoverflow.com/a/26858105
score: 1
accepted answer of: http://stackoverflow.com/q/26857526
upvote count: 1
has comment: http://stackoverflow.com/comment/42309077
has body: ASP.net &amp; web forms still work with a the basics of HTTP, generally through a form posting back to the server. The only way for information to get passed back to the server is either in an HTML form input element or in the query string. Even though ASP.net exposes serverside elements/controls, for information to be persisted back to the server you need to use a form element. ASP.net leverages &lt;input type="hidden" /&gt; to persist viewstate etc. Use a hidden field to store the information regarding new indexes for your resordered list. Use html5sortables sortuptate event to place said information into a hidden field.
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/26857526

http://stackoverflow.com/comment/42444321
score: 0
type: AnswerComment
type: Comment
has text: You can just as easily do this with any other modern browser, however I would suggest Chrome F12 Developer Tools for ease of use.
comment on: http://stackoverflow.com/a/26951813

http://stackoverflow.com/q/26988121
has answer: http://stackoverflow.com/a/26988401
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/42514146
score: 0
answer count: 3
has title: javascript array to string conversion
has comment: http://stackoverflow.com/comment/42509002
has comment: http://stackoverflow.com/comment/42508878
tagged with: jquery
has answer: http://stackoverflow.com/a/26990504
has answer: http://stackoverflow.com/a/26988192
has body: I have this array in javascript: [div.parts, div.editor, div.inside-1, div.container-2, div.inside-wrapper, div#content, div.whitebgpan, div, div#maindiv, body, html] How can I convert it into string, so that the output will be: div.parts div.editor div.inside-1 div.container-2 div.inside-wrapper div#content div.whitebgpan div div#maindiv body html here is my code: jQuery(document).on('click', function(e){ var ClickedParents = jQuery(e.target).parents(); //Get all parents of clicked element var ClickedParents_array = jQuery.makeArray(ClickedParents); //Make array console.log(ClickedParents_array); //Show output in colsole });
type: UnansweredQuestion

http://stackoverflow.com/q/26854624
has comment: http://stackoverflow.com/comment/42303751
has body: I am wondering if there is any way that I can make ZeroClipBoard working on my popup page's buttons?I have the following code so far which will bring a popup page, the popup page is called from a php file include 2 buttons. code for the first page: test This is the content to get copied to the text area and then to clipboard Copy To Clipboard test button I have tried make the "copy to clipboard" for "testButton" button working on my first page by using ZeroClipboard. my code for second page which will be the content for popup page: <?php session_start(); $userName = "asdfbsadf";//$_SESSION['user_name']; ?> Here will be the content and <?php echo $userName?> that be copied to the clipboard Copy All What Is This? the "launchPopup()" function is called from an open source which called popUp2.0.js, if that js file is needed, I will post that, but that one is a 170 lines code. The comment out codes above are the ones that I tried. I have tried add "var client = new ZeroClipboard( document.getElementById('copyAll') );" for my popup page's copyAll button to the second page, it didn't work; I tried to add that to first page, the button didn't work also. I found that if the code "var client = new ZeroClipboard( document.getElementById('copyAll') );" is called after the button, that will work; but I have tried everything that I know to put it after the button, and when I run the page and click the test button to bring up the popup page, I found the code "var client = new ZeroClipboard( document.getElementById('copyAll') );" is always called before the button when I inspect the element. I'm wondering if I have a function called test123(), is there any way that I can run this function after the button is clicked and the whole popup page is showed, so I can make the Javascript run after the popup page showed, and make the copyAll button working? Or did I think that in a wrong way and my code is too bad? and if there have any way that can make it work I will appreciate as it's fi…
score: -5
has comment: http://stackoverflow.com/comment/42271656
has comment: http://stackoverflow.com/comment/42271650
type: Question
has answer: http://stackoverflow.com/a/26854700
downvote count: 5
tagged with: javascript
upvote count: 0
answer count: 1
tagged with: zeroclipboard
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/42303731
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has title: ZeroClipboard doesn't work on popup page's button

http://stackoverflow.com/comment/42403620
has text: Do you want it inline inside the paragraph?
comment on: http://stackoverflow.com/a/26928787
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42241063
score: 0
has text: @nbrooks sorry, you two are indeed right. I answered the question in a hurry before leaving for lunch. I've updated it now and hopefully this is now relevant.
type: Comment
comment on: http://stackoverflow.com/a/26837413
type: AnswerComment

http://stackoverflow.com/comment/45973901
type: QuestionComment
comment on: http://stackoverflow.com/q/26964263
has text: Did you ever figured this out? I am trying to do the same thing?
score: 1
type: Comment

http://stackoverflow.com/comment/42233232
has text: is it better to use {} or [] in this case? (processor and memory wise)
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26833178

http://stackoverflow.com/comment/42273821
type: QuestionComment
has text: I don't see any z-indexes in your code. That would allow you to stack them like you have in your pictures.
score: 0
comment on: http://stackoverflow.com/q/26855436
type: Comment

http://stackoverflow.com/q/26964714
tagged with: durandal
has answer: http://stackoverflow.com/a/26965012
type: Question
type: AnsweredQuestion
tagged with: knockout.js
answer count: 1
accepted answer: http://stackoverflow.com/a/26965012
tagged with: javascript
score: 0
has title: KnockoutJS access active item created via activator forItems
has body: As per the Master-detail samples, such as this, but with factory pattern for viewmodels: this.activateProduct = activator.create().forItems(this.products); click activates` Debugging outputs the model and it's data. However returns nothing, tried unwrapping, calling as valueAssessor function etc and can't find the observables which ko.toJSON has somehow found. Does this all have to be broken down into separate steps using activateItem while storing the "current item"? Any syntax which will retrieve the observables inside?

http://stackoverflow.com/a/26969174
score: 1
has comment: http://stackoverflow.com/comment/42475712
has comment: http://stackoverflow.com/comment/42475975
downvote count: 0
has comment: http://stackoverflow.com/comment/42476454
has body: $http call is by default asynchronous. So in your first version, when you write like $scope.categories = CategoryFactory.getCategories(); you get empty categories, since by the time you access categories, it may not have been loaded with response data. your app flows like this - you load the controller you call the service service calls $http you try to access categories (but data will not be available until response is returned from server) $http.then loads data to $scope.categories
type: Answer
answers question: http://stackoverflow.com/q/26968959
upvote count: 1

http://stackoverflow.com/a/26906823
answers question: http://stackoverflow.com/q/26903453
has comment: http://stackoverflow.com/comment/42369134
type: Answer
has comment: http://stackoverflow.com/comment/42372758
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has body: Edited As for axes: Right title is simple - move left for 10. Left is harder. You could use the top tick (its x position) and length of label of that tick. As of alignment of the legend you can use translate and get chart's size from variables shown in example below (chart.plotTop + chart.plotHeight - legend.legendHeight) Example: http://jsfiddle.net/0ur3L0pL/8/ $(function () { var primText = 'primary', secoText = 'secondary', hidden = $('&lt;span id="hidden" style="display:none; ont-size:11px; "&gt;&lt;/span&gt;'); $('body').append(hidden); $('#container').highcharts({ chart: { type: 'column', marginTop: 80 }, title: { text: 'Monthly Average Temperature', x: -60 //center }, xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] }, yAxis: [{ title: { text: primText, rotation: 0, align: 'high', y: -25 } }, { title: { text: secoText, rotation: 0, align: 'high', y: -25 }, opposite: true }], tooltip: { valueSuffix: '°C' }, legend: { layout: 'vertical', align: 'right', verticalAlign: 'bottom', borderWidth: 0 }, series: [{ name: 'Tokyo', data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5], pointWidth: 10 }, { name: 'New York', data: [0.8, 5.7, 11.3, 17.0, 220.0, 24.8, 24.1, 20.1], pointWidth: 5, yAxis: 1 }] }, function (chart) { var legend = chart.legend, group = legend.group, x = group.translateX; group.translate(x, chart.plotTop + chart.plotHeight - legend.legendHeight); var ticks = chart.yAxis[0].ticks, pos = chart.yAxis[0].tickPositions, top = pos[pos.length - 1].toString(), topX = ticks[top].label.xy.x, topString = ticks[top].label.element.innerHTML; hidden.text(topString); chart.yAxis[0].update({ title: { x: topX - hidden.width() - 8 } }); chart.yAxis[1].update({ title: { x: -10 } }); }); });
accepted answer of: http://stackoverflow.com/q/26903453

http://stackoverflow.com/q/26844196
has comment: http://stackoverflow.com/comment/42251762
score: 0
has comment: http://stackoverflow.com/comment/42251644
tagged with: http://stackoverflow.com/tag/html
tagged with: getelementbyid
has comment: http://stackoverflow.com/comment/42251561
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42252704
has comment: http://stackoverflow.com/comment/42251578
has comment: http://stackoverflow.com/comment/42251568
answer count: 0
has title: jQuery and getElementById cannot access loaded DOM element (div)
has comment: http://stackoverflow.com/comment/42251526
tagged with: dom
type: Question
has body: neither jQuery commands nor getElementById seem to be able to get hold of my DOM items. part of my script looks like this: var box_size = $("#testbox").height(); var c = document.getElementById("s1"); console.log(c); // returns null console.log(box_size); // returns null console.log($(window).height()); // returns the correct number c.width = box_size + $(window).height(); // cannot set width of null the excerpt of my DOM tree basically looks like this I wrapped my main JS code like this: $(function() { // my entire js code is wrapped in this }); I think the DOM tree should be loaded by the time my JS gets executed. The elements are hidden using .hide(), but I never deleted them from the DOM tree or similar. The boxes have a set width and height which I can see graphically, as I set their background to red. The size is approximately 80 x 80 px. I checked my HTML code via W3CSchools and there is no error. Do you have any idea of how the error could have come about? TypeError: null is not an object (evaluating 'c.width = box_size + $(window).height() * 0.04') EDIT: console.log(document.readyState); // returns "complete" I used it directly before the declaration of box_size
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/26918987
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42386244
has title: handle a list of checkboxs and select tag
has comment: http://stackoverflow.com/comment/42386321
upvote count: 1
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/26919049
type: UnansweredQuestion
tagged with: php
downvote count: 0
score: 1
has body: I would like to show a list of items that these items is taken from database.(using a while in the php). after click on a button, I would like to get where any checkboxs is selected and the value of it. example : I want to get: item-1 => no item-3 => yes yes no item-1 yes no item-3 yes no item-3
type: Question

http://stackoverflow.com/q/26849430
linked to: http://stackoverflow.com/q/569565
tagged with: javascript
score: -1
has body: I have been pounding my head on this issue for several days and could use some help, maybe a fresh set of eyes would help. I have Windows Server 2012, IIS 8.0 and ASP.NET 4.5. I am new to both IIS and ASP.NET so please be patient with me. The website I am trying to build allows the user to upload files which will first be checked to make sure they are valid and then will be placed on a folder on the web server. I tried having the Javascript validate the inputs first before submitting the form to the server. However, nothing is uploaded so I decided to do one step at a time and just do a simple upload (without Javascript validation, for now). Here is currently how the files stand: upload_page.aspx &lt;html&gt; ... &lt;script language="Javascript"&gt; function validate() { var filter = &lt;allowed file extensions&gt;; var file1 = document.getElementById("uploadfile1").value; //do the checks if(filter.test(file1)) { returnval = true; } else { returnval = false; } return returnval; } &lt;/script&gt; ... &lt;body&gt; &lt;form method="post" runat="server" name="upload" enctype="multipart/form-data"&gt; &lt;asp:FileUpload ID="uploadfile1" runat="server" /&gt; &lt;asp:Button ID="btnUpload" runat="server" Text="Upload" onClientClick="btnUpload_Click" /&gt; &lt;asp:Button ID="btnReset" runat="server" Text="Reset" /&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; upload_page.aspx.cs protected void btnUpload_Click(object sender, EventArgs e) { if(this.uploadfile1.HasFile) { this.uploadfile1.SaveAs("C:\\inetpub\\wwwroot\\uploaded_files\\" + this.uploadfile1.FileName); } } If anyone can tell me what I'm doing wrong it would be greatly appreciated! Thanks.
accepted answer: http://stackoverflow.com/a/26850123
upvote count: 0
answer count: 1
linked to: http://stackoverflow.com/q/3167240
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/42261507
has comment: http://stackoverflow.com/comment/42261745
tagged with: asp.net-mvc-4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26850123
has title: Upload file to folder with javascript verification check - ASP.NET
downvote count: 1
type: Question
tagged with: iis-8
has comment: http://stackoverflow.com/comment/42261486

http://stackoverflow.com/q/26869485
has comment: http://stackoverflow.com/comment/42304145
answer count: 0
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/42301951
tagged with: responsive-slides
type: Question
has comment: http://stackoverflow.com/comment/42298332
tagged with: javascript
upvote count: 2
has title: Camera slider issue
downvote count: 1
favorite count: 0
has body: I have a website with OpenCart. The slider is called 'camera by pixedelic.com' and I've tried to make that responsive. I saw in a javascript file an option to do that: *mobileEasing : 'yes', //leave empty if you want to display the same easing on mobile devices and on desktop etc.* This does not work. I've pasted the code for camera.css here - http://pastebin.com/a7QpQhur and the camera.js here - pastebin.com/mBFuYj2F. The images show up as larger than expected with width and height set in style=".." and simple width=".." and height="..". And here is the HTML Structure - http://pastebin.com/YU9k4Rri Can anyone help me with this? Thank you

http://stackoverflow.com/a/26870646
downvote count: 0
has comment: http://stackoverflow.com/comment/42316544
type: Answer
accepted answer of: http://stackoverflow.com/q/26861002
answers question: http://stackoverflow.com/q/26861002
score: 1
has body: I think this is not working because when you append htmls to the example-wrapper, iScroll has already generated its inner scroll elements. So try this: $(document).on('pagebeforeshow', '#index', function(){ var htmls = ' '; for(i = 0; i < 30; i++) { htmls +=' Some link '; } htmls +=' '; $(".example-wrapper .iscroll-content").append(htmls); $("ul", $('#index')).listview(); $(".example-wrapper").iscrollview("refresh"); }); I forked your Fiddle here
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/26850391
accepted answer: http://stackoverflow.com/a/26850495
type: Question
has comment: http://stackoverflow.com/comment/42263455
tagged with: javascript
tagged with: jquery
has body: I'm generating and appending several spans to divs on page load. HTML structure like: &lt;div id="holder"&gt; &lt;div id="grid"&gt;&lt;/div&gt; &lt;/div&gt; Then loop through and append spans to the nested div: $span = $('&lt;span /&gt;').attr('class', 'colorSquare'); $("#grid").append($span); Then, I want to click a button and reset (delete the originally appended spans, because I don't want to reappend spans) what's inside the div's with: $("#holder &gt; div").html(""); On initial page load / initial generation of spans inside the div, the click event handler is registered to the div's spans on document.ready , and the following works: $("#grid span").click(function () { console.log("working"); }); However, after resetting with $("#holder &gt; div").html("");, the click handler doesn't work. I'm assuming this is because the handler is only assigned on initial document ready, but I wasn't expecting all handlers to be removed once you reset the div's content. How do I prevent assigned handlers from being removed?
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/26850495
linked to: http://stackoverflow.com/q/1359018
type: AnsweredQuestion
has title: Prevent handlers assigned on document ready from being removed

http://stackoverflow.com/q/26900478
has answer: http://stackoverflow.com/a/26901021
tagged with: ember.js
tagged with: events
has title: How do I use Ember.sendEvent to send an event to every instantiated controller
has comment: http://stackoverflow.com/comment/42353553
type: Question
accepted answer: http://stackoverflow.com/a/26901021
type: AnsweredQuestion
has body: I have an action in my application route that causes a global change to occur. This global change involves some asynchronous processing (promises), which, when settled requires me to send an event to my instantiated controllers. Controllers listening for the event will need to refresh some views. More specifically, I'm downloading some fonts and any controller with a canvas view needs be repainted. I know which controllers have a canvas. Using controllerFor will instantiate the controller if it does not already exist, which is bad. Likewise, __container__.lookup does the same. If this design is crap let me know. But otherwise, how do I get the instantiated controllers? Also, the fonts can not be pre-loaded because they are humongous (5MB each). Instead, we are using a service that sends fonts containing only the characters we request. If the user types additional characters, we have to request a new font.
tagged with: routes
has comment: http://stackoverflow.com/comment/42354083
answer count: 1
tagged with: javascript
tagged with: controller
score: 0

http://stackoverflow.com/comment/42313125
type: Comment
has text: I changed the JQuery to createpatient($(this).attr('id')); and also directly to createpatient("form1"); but neither had any different result.
comment on: http://stackoverflow.com/a/26877991
type: AnswerComment
score: 0

http://stackoverflow.com/comment/42522856
score: 0
comment on: http://stackoverflow.com/a/26983139
type: Comment
has text: Thanks, I applied your suggestion to include the template filter |safe and the code works perfectly! Thanks
type: AnswerComment

http://stackoverflow.com/comment/42493687
score: 0
has text: Require.js is throwing me the error: Uncaught Error: Mismatched anonymous define() module: function (sApp){ var SearchApp = new sApp(); }
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/26978838

http://stackoverflow.com/comment/42274175
comment on: http://stackoverflow.com/q/26855938
score: 0
type: Comment
type: QuestionComment
has text: please reread the question. the user's steps would be as follows: 1) paste url into an input tag, 2) click on upload button, 3) wait for image to upload to server. There's nothing that i can use like localstorage or anything else?

http://stackoverflow.com/comment/42376177
type: Comment
comment on: http://stackoverflow.com/q/26912758
type: QuestionComment
has text: How do you propose to do that?
score: 0

http://stackoverflow.com/a/27707496
answers question: http://stackoverflow.com/q/26862840
score: 0
type: Answer
has body: You can use function onComplete then update height of your modal $(".fancybox").click(function () { var url = $(this).attr('url'); $.fancybox.open({ href: url, type: 'iframe', padding: 1, autoDimensions: true, autoScale: false, onComplete: function(){ $('#fancybox-frame').bind('load',function(obj){ $('#fancybox-content').height(this.contentWindow.document.body.scrollHeight) // detect height of our frame and set it to modal $.fancybox.resize();//auto resize }); } }); }); This is a DEMO

http://stackoverflow.com/comment/42410573
comment on: http://stackoverflow.com/q/26932862
has text: because you have no any elements in your form ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42373875
score: 1
has text: Your logic seems fine, console.log the variables you are using to make sure they are coming in correctly
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26912129

http://stackoverflow.com/comment/42339860
comment on: http://stackoverflow.com/q/26893061
has text: you cannot do anything in html/javascript to force a tab instead of a window. that's purely browser-controlled behavior.
type: Comment
score: 1
type: QuestionComment

http://stackoverflow.com/q/26883314
has title: How to disable browser feature
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/42322182
has comment: http://stackoverflow.com/comment/42322534
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/42322215
type: Question
downvote count: 0
tagged with: javascript
has body: I am developing a project where user gets a conformation page. I want user not to click back or close tab or reload. Now either I need to disable the browser features or get back button,tab close event, or reload event to java script so that I could take the needed steps to prevent my data to get lost. I have used this: window.onbeforeunload = function() { return "Try This"; }; But this get called even when I click a button that redirects the page.
has comment: http://stackoverflow.com/comment/42322242
has answer: http://stackoverflow.com/a/26883367
has comment: http://stackoverflow.com/comment/42322500
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/26883367

http://stackoverflow.com/q/26971950
has body: Is there any possible solution to move or drag and drop multiple row data between two JQGrid table. The below function, i used it to select multiple rows using check box and move them down.Is there any properties in jqgrid to select multiple rows? function downfn() { Rowid = $('#grid-table').getGridParam('selrow'); //alert(Rowid); if(Rowid!=null) { RowList=$('#grid-table').jqGrid('getDataIDs'); var dselected=$('#grid-table').jqGrid('getRowData', Rowid ); var list=RowList.length; for(var i=0;i&lt;list;i++) { if(Rowid&gt;=RowList[i]) { // alert(Rowid); } else { var selected=dselected; var temp = $('#grid-table').jqGrid('getRowData', RowList[i] ); $('#grid-table').jqGrid('delRowData',RowList[i] ); $('#grid-table').jqGrid('delRowData',Rowid ); $('#grid-table').jqGrid('addRowData', Rowid , temp ); $('#grid-table').jqGrid('addRowData', RowList[i] , selected ); var Rowid=RowList[i]; } } } }
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/8123825
has comment: http://stackoverflow.com/comment/42512219
has comment: http://stackoverflow.com/comment/42509845
has comment: http://stackoverflow.com/comment/42510226
has comment: http://stackoverflow.com/comment/42511738
answer count: 0
downvote count: 0
has comment: http://stackoverflow.com/comment/42511972
type: Question
has comment: http://stackoverflow.com/comment/42481965
score: 1
tagged with: jqgrid
has title: move multiple raws in JQgrid
upvote count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42522582
favorite count: 0

http://stackoverflow.com/q/26891802
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/42337420
tagged with: ajax
has comment: http://stackoverflow.com/comment/42338045
score: 0
has comment: http://stackoverflow.com/comment/42351320
answer count: 0
type: UnansweredQuestion
has title: Create new element by jQuery each time ajax is triggered
has body: I am struggling with the idea of, adding elements to DOM for each time I triggered an AJAX call by jQuery. I just want to ask if this is a possible solution or I should not do it through AJAX if I want elements each time I triggered an event. The code below refresh the text everytime I triggered the AJAX call, I want it to add whole new element instead of refreshing. BTW here is the code I have written. function successAJAX(response){ response = $.parseJSON(response); var priceHTML = document.createElement('p'); priceHTML.innerText= "foo"; $("#priceContainer").append(priceHTML); }
tagged with: mysql

http://stackoverflow.com/q/26983589
type: Question
has title: Difference between "trampoline" methods
answer count: 2
tagged with: trampolines
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/26983813
favorite count: 0
has comment: http://stackoverflow.com/comment/45955169
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42503037
has body: I've started learning JS recently, and this is my first dive into functional language territory. Was doing the "trampoline" exercise in the functional-javascript-workshop npm module, and came across an interesting difference between my own solution and the official solution. Both work perfectly fine, but I'm at a loss as to what exactly is the practical difference between them. I understand my own solution pretty well, but don't exactly understand why the other one works too. My Solution function repeat(op, num) { var _repeat = function() { if (num &lt;= 0) return; op(); return repeat(op, --num); }; return _repeat; } function trampoline(f) { while (f instanceof Function) { f = f(); } return f; } module.exports = function(op, num) { return trampoline(repeat(op, num)); }; Official Solution function repeat(operation, num) { return function() { if (num &lt;= 0) return operation() return repeat(operation, --num) } } function trampoline(fn) { while(fn &amp;&amp; typeof fn === 'function') { fn = fn() } } module.exports = function(operation, num) { trampoline(function() { return repeat(operation, num) }) } Specifically, I'm curious about the last part - why does the official solution create an annonymous function instead of just passing repeat?
has answer: http://stackoverflow.com/a/26984182
tagged with: node.js
score: 3
upvote count: 3

http://stackoverflow.com/q/26886507
downvote count: 6
has comment: http://stackoverflow.com/comment/42330819
has body: I want this javascript code to push text into the &lt;td class='One'&gt;. But for some reason it just doesn't work. Can anyone give me a hand here please? &lt;table&gt; &lt;td class="One"&gt;&lt;/td&gt; &lt;/table&gt; &lt;script&gt; var freq =[2014,8,11]; //Incidents &amp; Injuries Frequency Rate window.tdOne = document.getElementsByClassName('One'); tdOne.innerHTML = countUp(freq[0],freq[1],freq[2]); &lt;/script&gt;
has comment: http://stackoverflow.com/comment/42329316
type: Question
has title: Javascript code won't work
tagged with: javascript
has comment: http://stackoverflow.com/comment/42327505
has answer: http://stackoverflow.com/a/26886543
has comment: http://stackoverflow.com/comment/42332171
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/42328183
favorite count: 0
upvote count: 2
type: UnansweredQuestion
score: -4
has comment: http://stackoverflow.com/comment/42329237
has comment: http://stackoverflow.com/comment/42327814

http://stackoverflow.com/a/26902514
answers question: http://stackoverflow.com/q/26901558
type: Answer
score: 1
has body: What version of bootstrap are you using? New version 3.3.1 works just fine, here is working fiddle http://jsfiddle.net/52VtD/9050/ Sort by First Name Last Name Nickname
upvote count: 1
downvote count: 0

http://stackoverflow.com/comment/42444254
comment on: http://stackoverflow.com/a/26951694
score: 0
type: AnswerComment
type: Comment
has text: I don't know what the actual service does so I'm not questioning if he should be using a service or not since he didn't ask for that.

http://stackoverflow.com/comment/42452197
score: 0
type: QuestionComment
has text: @GytisŠk Perhaps jQuery's `hover` function may be useful, but I like my CSS answer =3
type: Comment
comment on: http://stackoverflow.com/q/26956411

http://stackoverflow.com/a/26927640
has comment: http://stackoverflow.com/comment/42402034
has body: Try the following parsedDate = Ext.Date.parse(r, "Y-m-d"); cartHeaderRDD.setValue(parsedDate); Ext.Date.parse takes a String as first input and the format as the secound. The Result is a Date object if parsing was successfull or null if not. Change the format according to your format in r. For more informations see http://docs.sencha.com/extjs/5.0.1/#!/api/Ext.Date-method-parse .
accepted answer of: http://stackoverflow.com/q/26917478
answers question: http://stackoverflow.com/q/26917478
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/a/30869566
downvote count: 0
has body: To reduce the used processing power by adding a timer to a Jquery scroll method is probably not a great idea. The visual effect is indeed quite bad. The whole web browsing experience could be made much better by hiding the scrolling element just when the scroll begins and making it slide in (at the right position) some time after. The scrolling even can be checked with a delay too. This solution works great. $(document).ready(function() { var element = $('.movable_div'), originalY = element.offset().top; element.css('position', 'relative'); $(window).on('scroll', function(event) { var scrollTop = $(window).scrollTop(); element.hide(); element.stop(false, false).animate({ top: scrollTop &lt; originalY ? 0 : scrollTop - originalY + 35 }, 2000,function(){element.slideDown(500,"swing");}); }); }); Live demo here
answers question: http://stackoverflow.com/q/26990986
score: 1
upvote count: 1
type: Answer

http://stackoverflow.com/a/27005423
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26984071
upvote count: 8
has comment: http://stackoverflow.com/comment/42542815
type: Answer
answers question: http://stackoverflow.com/q/26984071
has body: Since you're providing your own logic in the select handler, you need to prevent the default action, which is to place ui.item.value in the input. Right now, your code is running, and then jQueryUI is immediately trying to place ui.item.value in the input, which explains the empty value. So really all you need to do is call event.preventDefault(); or return false; from the select handler: select: function(event, ui) { $('#promoitem').val(ui.item.promodesc); $('#promocost').val(ui.item.promocost); $('#promoqty').val(ui.item.qty); $('#hidden_promo_item_id').val(ui.item.id); event.preventDefault(); // &lt;--- }
score: 8

http://stackoverflow.com/comment/42418001
type: Comment
has text: It might just be a copy-paste error but I noticed your code is missing the close on the AJAX method call $.ajax({ ... }); //<- this is missing
type: QuestionComment
comment on: http://stackoverflow.com/q/26917730
score: 0

http://stackoverflow.com/comment/42458139
has text: How could this be a regex issue if you already know that your event isn't being fired?
score: 0
comment on: http://stackoverflow.com/q/26957693
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42283790
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26861732
score: 0
has text: Are the `addons` characters only allowed at the end? Or in any position?

http://stackoverflow.com/a/26909576
type: Answer
score: 4
has comment: http://stackoverflow.com/comment/53154438
has body: Like cfv1000 said, you should look into draggable &amp; droppable in jQuery UI. Here's a head start I made for you. It's not near complete. With your identifiers for your element(s), just call draggable() like this: $("#GKRedTeam").draggable(); $("#GKBlueTeam").draggable(); ..and amongst many upcoming additions - set up proper HTML &amp; CSS properties for it. JsFiddle demo
has comment: http://stackoverflow.com/comment/42370242
has comment: http://stackoverflow.com/comment/42369487
has comment: http://stackoverflow.com/comment/42370314
has comment: http://stackoverflow.com/comment/42368956
accepted answer of: http://stackoverflow.com/q/26909046
upvote count: 4
answers question: http://stackoverflow.com/q/26909046
has comment: http://stackoverflow.com/comment/53221086
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/42414618
comment on: http://stackoverflow.com/a/26934528
type: AnswerComment
score: 0
type: Comment
has text: Yes, same question from me :-). Although it has an extra character compared to Paul Roub's answer, I "like" more the use of the negative lookahead.

http://stackoverflow.com/a/26959951
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
has body: There is no direct option in Selenium/Webdriver to set the value in "div" tag. You need to Set the attribute innerHTML using JavascriptExecutor as below: this.WaitForElement(DesignerLocators.EmailTemplateEditorTemplateName); WebElement tempname = driver.findElement(DesignerLocators.EmailTemplateEditorTemplateName); JavascriptExecutor rightexecutor = (JavascriptExecutor)driver; rightexecutor.executeScript("arguments[0].setAttribute('innerHTML','yahoo')", tempname);
answers question: http://stackoverflow.com/q/26958449
type: Answer
accepted answer of: http://stackoverflow.com/q/26958449

http://stackoverflow.com/comment/42671234
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26969271
score: 1
has text: Have you considered the possibility that "do nothing" satisfies all your requirements?

http://stackoverflow.com/q/26902084
tagged with: javascript
score: 15
upvote count: 15
has title: HTML5 Canvas - How to draw rectangle over image in canvas
answer count: 2
has body: Actually, I am able to do it using img.onload function. Something I got from 'HTML5 Canvas - How to Draw a line over an image background?'. But I need to draw image without using img from onload function which is like this: var imagePaper = new Image(); imagePaper.onload = function(){ context.drawImage(imagePaper,100, 20, 500,500); }; imagePaper.src = "images/main_timerand3papers.png"; } But I want to able draw rectangle over canvas simply attaching img src above canvas, just as: Canvas: Your browser does not support the HTML5 canvas tag. But I'm unable to draw line over img in canvas, either img is drawing or shape is hiding behind. This is my full code: Playing YouTube video on HTML5 canvas Canvas: Your browser does not support the HTML5 canvas tag.
has answer: http://stackoverflow.com/a/26902303
tagged with: canvas
downvote count: 0
tagged with: jquery
possible better answer: http://stackoverflow.com/a/62478351
favorite count: 0
has answer: http://stackoverflow.com/a/62478351
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42356766
accepted answer: http://stackoverflow.com/a/26902303
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42356401
type: Question
linked to: http://stackoverflow.com/q/10623678

http://stackoverflow.com/q/26923096
favorite count: 0
tagged with: angularjs
type: Question
upvote count: 1
answer count: 1
has title: Obtain access to a controller from a child directive in AngularJS
tagged with: angularjs-directive
tagged with: javascript
has answer: http://stackoverflow.com/a/26923236
type: AnsweredQuestion
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/26923236
has body: I have a small angular application that needs to list a list of entities (endpoints in my case). The entities are saved in an array. For the purpose of this example, let's say they're on the controller. To better separate the logic, I created two directives: endpointList and endpoint, like this: the directives are declared like this: myApp.directive('endpointList', function () { return { restrict:'EA', controller:'EndpointCtrl', controllerAs:'epCtrl', transclude: true, replace: true, templateUrl: 'endpoint-list.html' }; }) .directive('endpoint', function ($compile, $log) { return { scope: { scope:'=ngModel', func:'&', index:'@' }, restrict:'EA', replace:true, templateUrl: 'endpoint.html', require:'?^endpointList', compile: function(tElem, tAtt) { return function(scope, el, attr, ctrl) { // ctrl.addResource(scope); } } }; }); the template for endpoint-list.html ... Label Last updated Status Sync ... the template for endpoint.html: ... CALL ME ... and I use them like this: <endpoint ng-repeat="ep in endpoints" scope="ep" ng-model="ep" func="selectEp(scope)" index="{{$index}}"></end-point> My problem is that in the endpoint.html I have a link that, when clicked, I want it to call the function sync() on the controller: $scope.sync = function(endpoint) { console.log('syncing:'); console.log(endpoint); }; How can I do that? Any tips are greatly appreciated. Here's the plunkr: http://plnkr.co/edit/js7syyZ8u0i9KoOIgwdQ

http://stackoverflow.com/comment/42281286
score: 0
comment on: http://stackoverflow.com/q/26859296
has text: Have a loot at this [fiddle](http://jsfiddle.net/238qcqh1/)
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42415549
type: Comment
comment on: http://stackoverflow.com/q/26935445
type: QuestionComment
has text: Regular expressions?
score: 0

http://stackoverflow.com/comment/42334615
type: QuestionComment
comment on: http://stackoverflow.com/q/26890285
score: 0
has text: According to your HTML, your form does not have an id attribute
type: Comment

http://stackoverflow.com/comment/111718013
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/63173305
type: Comment
has text: Thank you for mentioning this, i have updated the resource! @DimaKozhevin

sinon
tags question: http://stackoverflow.com/q/26925277
tags question: http://stackoverflow.com/q/26881173
tags question: http://stackoverflow.com/q/26962233
tags question: http://stackoverflow.com/q/26933257
tags question: http://stackoverflow.com/q/26939466
tags question: http://stackoverflow.com/q/26967153
tag name: sinon
type: Tag

http://stackoverflow.com/comment/42524155
has text: Welcome! @Rica. Can you please post the link for your site/jsfiddle. So that i can easily fix the problem.
score: 0
comment on: http://stackoverflow.com/a/26977341
type: AnswerComment
type: Comment

http://stackoverflow.com/a/26900300
score: 2
answers question: http://stackoverflow.com/q/26871754
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/67292985
accepted answer of: http://stackoverflow.com/q/26871754
has comment: http://stackoverflow.com/comment/42405714
type: Answer
has body: That REST call will upload a file for storage in Parse. It won't let you import it into the database. Because you want to run this programmatically from another website, you'll have to use the REST APIs. You'll need to run through each object you want to insert, and make a REST API call to insert it in the database. You can save API hits by batching them together, in blocks of up to 50. There is also a manual solution, which might be simpler if it's a once-off setup of some initial data. You can do this by opening you web browser, log into your Parse.com account, choose the app you want to import data for, click on Core in the header, and then in the Data section on the left, you'll see an "Import" button. You can upload your CSV or JSON file there. NOTE: this is only valid for importing data into a new class - you can't add data to an existing class (bar the User and Installation I think). If you have an empty class, just delete it and use the file import to create it. Parse do have some documentation on importing data, available at their website.
upvote count: 2
has comment: http://stackoverflow.com/comment/50869179

http://stackoverflow.com/q/26983005
has body: I have a Python Flask web app that I want to pass a dictionary data set from to javascript, I am trying to JSON I can pass numbers fine but it seems to throw an error when using strings. Here is the code snippet of the python generating the JSON string: view.py def dumpdata(): DB_name={"name":"aaragh"} strng=json.dumps(DB_name) return render_template('dumpdata.html',result = strng) Here is the receiving HTML file dumpdata.html <p >{{ result }} Here is the error message and the console output: consolelog SyntaxError: invalid property id dumpdata:4 <p >{"name": "aaragh"} I dont think it's relevant but I get the same error on both ubuntu chrome and win IE. Any ideas? I think I am missing something obvious but I have banged my head against this for days and I still haven't been able to find a solution... Thanks
score: 6
possible better answer: http://stackoverflow.com/a/51874905
accepted answer: http://stackoverflow.com/a/26983139
type: Question
has answer: http://stackoverflow.com/a/51874905
tagged with: http://stackoverflow.com/tag/json
answer count: 3
has answer: http://stackoverflow.com/a/66582808
downvote count: 0
tagged with: javascript
tagged with: flask
has title: Importing Python Flask JSON dictionary into javascript error
favorite count: 0
has answer: http://stackoverflow.com/a/26983139
tagged with: python
upvote count: 6
type: AnsweredQuestion

http://stackoverflow.com/comment/42411869
type: Comment
type: QuestionComment
has text: Yikes, sorry, not sure what you mean @epascarello I think I am just calling it once.
comment on: http://stackoverflow.com/q/26933546
score: 0

http://stackoverflow.com/comment/44235229
score: 0
type: Comment
has text: just two months later I finally managed to look at your solution and it works (except you need to write ```controlFlow()```). Thx a lot :)
comment on: http://stackoverflow.com/a/27028884
type: AnswerComment

oauth-2.0
tag name: oauth-2.0
tags question: http://stackoverflow.com/q/26967171
type: Tag
tags question: http://stackoverflow.com/q/26974375
tags question: http://stackoverflow.com/q/26861912

http://stackoverflow.com/comment/42464084
type: Comment
comment on: http://stackoverflow.com/a/26951832
score: 1
type: AnswerComment
has text: @TheParamagneticCroissant—get used to it. There are drive-by down voters who are too lazy to bother saying why they voted as they did. An up–vote gives you 5x the reputation anyway. ;-)

http://stackoverflow.com/q/26953267
has answer: http://stackoverflow.com/a/26953321
type: Question
has comment: http://stackoverflow.com/comment/42446982
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/2432003
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/26953321
favorite count: 0
possible better answer: http://stackoverflow.com/a/26953322
has answer: http://stackoverflow.com/a/26953339
has answer: http://stackoverflow.com/a/26953322
has body: I am looking for the best way to simplify this code: Combine hover and toggle functions ? I tried this: Combine hover and click functions (jQuery)? $(document).ready(function(){ $('#cart-target, #shoppingBag').hover(function() { $('#shoppingBag, .overlay').css('visibility', 'visible'); $('#shoppingBag, .overlay').css('opacity', '1'); $('.icon-cart').css('color', '#cc181e'); $('.toggle__shoppingbag').css('background-color', '#131418'); $('.toolbar').css('background-color', '#0a0a0c'); }, function() { // on mouseout, reset the background colour $('#shoppingBag, .overlay').css('visibility', 'hidden'); $('#shoppingBag, .overlay').css('opacity', '0'); $('.icon-cart').css('color', '#fff'); $('.toggle__shoppingbag').css('background-color', 'transparent'); $('.toolbar').css('background-color', '#131418'); }); $('#cart-target').toggle(function () { $('#shoppingBag, .overlay').css('visibility', 'visible'); $('#shoppingBag, .overlay').css('opacity', '1'); $('.icon-cart').css('color', '#cc181e'); $('.toggle__shoppingbag').css('background-color', '#131418'); $('.toolbar').css('background-color', '#0a0a0c'); }, function () { $('#shoppingBag, .overlay').css('visibility', 'hidden'); $('#shoppingBag, .overlay').css('opacity', '0'); $('.icon-cart').css('color', '#fff'); $('.toggle__shoppingbag').css('background-color', 'transparent'); $('.toolbar').css('background-color', '#131418'); }); });
tagged with: css
has title: Simplify this code:
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42446917
upvote count: 3
downvote count: 3
has comment: http://stackoverflow.com/comment/42452741

wcf
type: Tag
tag name: wcf
tags question: http://stackoverflow.com/q/26849677

http://stackoverflow.com/comment/42234016
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/26833743
has text: The table is initially hidden just when browser renders your page but it's not locked like that forever. You can still show its contents using javascript, e.g. your `showData()` function.
type: Comment

http://stackoverflow.com/comment/42467965
comment on: http://stackoverflow.com/a/26965218
score: 1
has text: `if(initApp != null && typeof(initApp) == "function") initApp();` It doesn't make sense to initialize in more than one place. Either way, doesn't matter.
type: AnswerComment
type: Comment

http://stackoverflow.com/a/26914129
answers question: http://stackoverflow.com/q/26913970
score: 0
has body: The problem is with your premise: "When a button is clicked, it rotates 50 deg left or right" Actually, when a button is clicked, you are setting the rotation to be exactly -50deg or 50deg. It's an absolute assignment, not an increment. In order to increment (since the rotation property is assigned by a text composed value), you'd need to store the value in a way where you can control it. For example, storing it in an external variable, and use it to increment the final value. Something like this: See working example //Here's where you will store the actual value var rotationValue = 0; moveLeft.onclick = function() { rotationValue -= 50; rotateCube.style.webkitTransform = "rotateY("+ rotationValue +"deg)"; } moveRight.onclick = function() { rotationValue += 50; rotateCube.style.webkitTransform = "rotateY("+ rotationValue +"deg)"; }
accepted answer of: http://stackoverflow.com/q/26913970
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42390093
type: Answer

http://stackoverflow.com/q/26845101
tagged with: javascript
score: 4
tagged with: express
answer count: 3
upvote count: 4
accepted answer: http://stackoverflow.com/a/27579359
tagged with: node.js
favorite count: 0
downvote count: 0
has answer: http://stackoverflow.com/a/27579359
type: AnsweredQuestion
has title: webpack-dev-middleware does not compile output into folder
has body: I'm using webpack-dev-middleware in my server to compile javascript like this: if (development){ app.use(webpackMiddleware(webpack({ // webpack options // webpackMiddleware takes a Compiler object as first parameter // which is returned by webpack(...) without callback. entry: { dashboard: path.join(__dirname, 'scripts/dashboard.jsx'), tasks: path.join(__dirname, 'scripts/tasks.jsx') }, output: { path: __dirname + 'dist', filename: '[name].bundle.js', // no real path is required, just pass "/" // but it will work with other paths too. }, resolve: { extensions: ['', '.js', '.jsx'] }, module: { loaders: [ { test: /\.jsx$/, loader: "jsx" } ] } } ), { stats: { colors: true } })); } Everything works fine in development, I can include the bundles in my views. But in production I cannot include them, because they are not build into 'dist'. This folder is always empty. What do I do wrong? Does somebody has an idea? Best Regards Jan
possible better answer: http://stackoverflow.com/a/39941763
type: Question
has answer: http://stackoverflow.com/a/63367297
has answer: http://stackoverflow.com/a/39941763
tagged with: webpack

safari
tags question: http://stackoverflow.com/q/26850468
tags question: http://stackoverflow.com/q/26916823
tags question: http://stackoverflow.com/q/26968974
tags question: http://stackoverflow.com/q/26898621
tags question: http://stackoverflow.com/q/26899035
tags question: http://stackoverflow.com/q/26905605
tags question: http://stackoverflow.com/q/26898738
tags question: http://stackoverflow.com/q/26917730
type: Tag
tags question: http://stackoverflow.com/q/26947291
tags question: http://stackoverflow.com/q/26849851
tags question: http://stackoverflow.com/q/26844639
tags question: http://stackoverflow.com/q/26984661
tags question: http://stackoverflow.com/q/26920942
tag name: safari

http://stackoverflow.com/a/26914607
answers question: http://stackoverflow.com/q/26914521
score: 0
upvote count: 1
downvote count: 1
has body: With jQuery you can merge two objects with jQuery.getJson("data.json", function(data) { jQuery.getJson("data2.json", function(data2) { var concatenatedJson = $.extend({}, data, data2); }); }); So that you can of course only do, after both json objects are loaded.
type: Answer

http://stackoverflow.com/comment/42411769
type: AnswerComment
has text: @ʰᵈˑ I've using for this the session, because if not, then i need to rewrite **EVERY** url to be there that parameter. What do you think, what is the less work? Parse the whole page before the output, and add the parameter, or just use a session checking?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26933500

http://stackoverflow.com/comment/42374030
score: 1
comment on: http://stackoverflow.com/q/26912097
type: Comment
type: QuestionComment
has text: testArr=[]; is initializing the array every time... place the declaration+init outside the click event. - or am i understanding this wrong? EDIT: Ben Griffiths was faster :D

http://stackoverflow.com/q/26898646
has answer: http://stackoverflow.com/a/53462072
possible better answer: http://stackoverflow.com/a/64040467
has comment: http://stackoverflow.com/comment/42350489
has answer: http://stackoverflow.com/a/64040467
type: Question
has answer: http://stackoverflow.com/a/26898729
has body: I experienced a bug in a deep dependency of a library installed using the npm. I fixed that bug in a fork and created a pull request on github. I'm wondering how to share my fix with my co-workers. I found this article but since it's not my dependency but a dependency of a library I use I don't know how to solve this problem. Even if my pull-request get's accepted fast, I need to wait for the maintainer of the library to update his dependencies, what may never even happen. Is there any common way how to solve such a thing?
tagged with: javascript
has title: How to patch a dependency of a npm library?
accepted answer: http://stackoverflow.com/a/74265028
upvote count: 7
tagged with: dependencies
favorite count: 0
has answer: http://stackoverflow.com/a/74265028
has comment: http://stackoverflow.com/comment/42350437
tagged with: npm
answer count: 4
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
score: 7

http://stackoverflow.com/comment/42492790
type: AnswerComment
type: Comment
has text: It works for me when I tried this locally. If it's not working for you then you may have to post some of your custom page code and the JS code.
comment on: http://stackoverflow.com/a/26978506
score: 0

http://stackoverflow.com/comment/42483342
has text: I am new in angular, so can you give me some idea how i can implement own double tap directive.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26973831

http://stackoverflow.com/comment/42431110
score: 0
comment on: http://stackoverflow.com/q/26944105
type: QuestionComment
type: Comment
has text: the thing is that the content inside "tooltip.show" id DYNAMIC, so it's the USER that is entering the text there..

http://stackoverflow.com/comment/42499118
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26955791
type: Comment
has text: It's been years since I've read a beginner's JS tutorial, you might be right. As far as the solution goes, OP's code works fine, read the top two question comments.

http://stackoverflow.com/comment/42425611
score: 0
type: Comment
type: QuestionComment
has text: @bto.rdz I see that, but the whole point of the function is to parse a string. That's what I'm getting at. Word count with a filter.
comment on: http://stackoverflow.com/q/26940807

http://stackoverflow.com/comment/42274748
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/26856318
has text: I agree with Bill. This seems like a bunch of non-standard work to solve a problem that can probably be solved a better way.
type: Comment

http://stackoverflow.com/comment/42355432
type: AnswerComment
comment on: http://stackoverflow.com/a/26901569
type: Comment
has text: Ahm, thanks. You mean the way i convey or my grammar ?
score: 0

http://stackoverflow.com/comment/42432219
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26940175
has text: ok, thanks! Thats also the way, I was thinking to do it. Maybe out of this, I can release a bower component or sth else ;)

http://stackoverflow.com/q/26874752
type: Question
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/26875138
has answer: http://stackoverflow.com/a/26875036
answer count: 3
tagged with: angularjs-ng-click
tagged with: angularjs
upvote count: 3
has title: How to target just the table row clicked on for angularJS ng-show and ng-hide
has body: I have a table in a angularJS app. What I'm trying to do is add a toggle function to show/hide a table data section. The function works, but it toggles every row on the table. I need it to only toggle the row that was click on: Here is an example screencast: http://screencast.com/t/U5XXU7RN3gm html {{program.startDate}} {{program.deadline}} {{program.status}} {{program.updatedDate}} edit details toggle arrows javascript $scope.toggleArrows = function (index) { $scope.showButtons = !$scope.showButtons; };
accepted answer: http://stackoverflow.com/a/26875036
has answer: http://stackoverflow.com/a/26875230
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/26875230

http://stackoverflow.com/q/26958935
has answer: http://stackoverflow.com/a/26958996
upvote count: 1
has title: Loop over list of names and add Jquery on click listener
type: Question
has answer: http://stackoverflow.com/a/26959024
has answer: http://stackoverflow.com/a/26961530
tagged with: javascript
has comment: http://stackoverflow.com/comment/42456520
downvote count: 0
tagged with: jquery
has body: I'm trying to set it that for every checkbox with the class country on check finds every input with this attribute name and toggleClass on the div. It's only working on the first input. $(".country").each(function(){ var country_name = $(this).attr('name'); if(this.click) { $("."+country_name).each(function() { $( this ).toggleClass('hide'); }); } }); Country Kenya Uganda Tanzania Destination Maasai Mara Serengeti KWS Maasai Mara Serengeti KWS Maasai Mara Serengeti KWS
has comment: http://stackoverflow.com/comment/42456522
favorite count: 0
answer count: 4
has answer: http://stackoverflow.com/a/26959027
type: UnansweredQuestion
score: 1

http://stackoverflow.com/comment/42290455
comment on: http://stackoverflow.com/a/26865421
type: AnswerComment
has text: What about ajax to wait to complete?
score: 0
type: Comment

http://stackoverflow.com/comment/42416839
type: QuestionComment
comment on: http://stackoverflow.com/q/26935283
type: Comment
has text: Do you really just want to make `localhost:8080/hola` behave just like `localhost:8080/`? You can simply copy `static/index.html` into `static/hola` and you've made a copy of your index file into another file. The Express server serves the static HTML of the terminal app directly from the `/static` folder; the server-side logic you're tinkering with only specifies how to respond to requests from the static HTML client, not how to send the base client code to the browser.
score: 0

http://stackoverflow.com/q/26869840
accepted answer: http://stackoverflow.com/a/26870460
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/42298497
has comment: http://stackoverflow.com/comment/42299036
upvote count: 0
tagged with: javascript
tagged with: jquery
score: -1
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42298575
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/26870460
has title: Side by Side Div's with Close Option
has body: Can anyone help me? Looking at making a side by side stream and chat, but being able to close the chat and widening the stream like Twitch.tv. So about chat div box you will have Open/Close Chat. Can anyone help?
type: AnsweredQuestion

http://stackoverflow.com/a/28929323
type: Answer
answers question: http://stackoverflow.com/q/26847251
score: 0
has body: In C# you could just use a hidden WebControl. With that you could execute everything you need.

http://stackoverflow.com/comment/42281007
comment on: http://stackoverflow.com/q/26860089
score: 0
type: Comment
type: QuestionComment
has text: An idea would be to use Javascript to write to a hidden field. Check the value in this field from your server side, to see whether it has the expected value.

http://stackoverflow.com/comment/42344771
type: AnswerComment
type: Comment
has text: either way, both approaches work, I like yours as it's more reusable. but I like mine as it's a simple event you can capture in any controller and quite easy to understand, and you don't need to create a service just to share data.
comment on: http://stackoverflow.com/a/26895645
score: 1

http://stackoverflow.com/comment/75333469
has text: Would not work if input value is changed by javascript
comment on: http://stackoverflow.com/a/26946264
score: 108
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42322360
has text: Thank you for your answer its great. But when the alert appears there are two options displayed. When user click stay on this page then its ok else if he clicks leave the page then i want some calculation that need to take place and then i have to redirect him to an appropriate page. can this be done?
type: AnswerComment
comment on: http://stackoverflow.com/a/26883367
score: 0
type: Comment

http://stackoverflow.com/comment/42392753
score: 2
type: Comment
has text: Seems a bit verbose, I'd do `toArray=Array.call.bind([].slice)`
comment on: http://stackoverflow.com/a/26922627
type: AnswerComment

http://stackoverflow.com/comment/42498722
comment on: http://stackoverflow.com/a/26982190
type: Comment
has text: I agree on the Timeout lol thats obvious, I just did it to get the response, thanks this looks good.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42356203
comment on: http://stackoverflow.com/a/26901573
has text: no.. its not like that.. just use my given snippet.. its not the right way.. okay tell me r u using jquery?? or not??
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/104297846
type: AnswerComment
score: 0
has text: it woorks,but if there are input + select + textarea,we have to clear everyone
type: Comment
comment on: http://stackoverflow.com/a/42680751

http://stackoverflow.com/a/26900537
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26900445
answers question: http://stackoverflow.com/q/26900445
type: Answer
has body: Instead of passing in just the id of the user you follow, pass in the entire user object. {{user.follow_text}} me.toggleFollow = function(user){ var followed = user.followed; };
score: 1
upvote count: 1

http://stackoverflow.com/q/26876077
downvote count: 2
tagged with: handlebars.js
score: -2
has title: Using computed property as value of ember handlebars input helper, deleting part returns undefined
type: AnsweredQuestion
has body: Seems simple enough but it's been driving me crazy. I have an input helper in my view: {{input value=contact.fullName type="text" style="text-align:left;"}} And in my contact model I have these properties and this computed property: firstName: DS.attr('string'), lastName: DS.attr('string'), fullName: function (key, value, previousValue) { if(arguments.length &gt; 1){ var nameParts = value.split(/\s+/); this.set('firstName', nameParts[0], this.get('firstName')); this.set('lastName', nameParts[1], this.get('lastName')); } return this.get('firstName') + ' ' + this.get('lastName'); }.property('firstName', 'lastName') Great so I type "Joe Bob" into my input and it's updated all over the page. But when I delete "Bob" I get this in my input: "Joe undefined". This doesn't happen if I delete "Joe", if I do that I just end up with " Bob". How can I keep it from putting undefined into my view? Been at this for 2 days, any help would be appreciated.
has answer: http://stackoverflow.com/a/26894170
possible better answer: http://stackoverflow.com/a/26876932
type: Question
has answer: http://stackoverflow.com/a/26876932
answer count: 2
upvote count: 0
tagged with: ember-data
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26894170
tagged with: ember.js
favorite count: 0

http://stackoverflow.com/a/26909852
downvote count: 1
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26908373
upvote count: 1
has body: Ok if it helps anyone at some point in the future, the answer is - $("head").find("script").each(function(i) { var scr = $(this).html(); if(scr.indexOf("launchChat") &gt; 0){ var newTxt = scr.split('"'); for (var i = 1; i &lt; newTxt.length; i++) { console.log(newTxt[i].split('"')[3]); } } });

http://stackoverflow.com/a/26905071
answers question: http://stackoverflow.com/q/26904565
has comment: http://stackoverflow.com/comment/42363622
type: Answer
has comment: http://stackoverflow.com/comment/42365051
score: 1
upvote count: 1
has body: It will be better to load the page in your callback function of successful login with: $("#the_div_container_for_new_page").load("SchoolMaterials.html") UPDATED: it is something like this: $(document).ready() { function login() { //post with ajax to login $.post(......, function(result){ if (result.success) { // load some page after successful login. $('#id_of_container_div').load("thepage.html"); return; } else { // handle error } }) } }
downvote count: 0

http://stackoverflow.com/comment/42248093
comment on: http://stackoverflow.com/q/26841741
has text: an example of the error with your HTML would be very helpfull to help you
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26967961
has body: change width using jquery css $('#menu').css('width', '10%'); $(document).ready(function() { $('.reveal').on('click', function(e) { e.preventDefault(); var link = $(this).attr('href'); $('.page').load(link); $('#menu').css('width', '10%'); $(this).show(); });
has comment: http://stackoverflow.com/comment/42681269
has comment: http://stackoverflow.com/comment/42681386
has comment: http://stackoverflow.com/comment/42681353
score: 1
has comment: http://stackoverflow.com/comment/42679280
has comment: http://stackoverflow.com/comment/42681251
has comment: http://stackoverflow.com/comment/42681160
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42681635
has comment: http://stackoverflow.com/comment/42681321
type: Answer
has comment: http://stackoverflow.com/comment/42681508
accepted answer of: http://stackoverflow.com/q/26967838
has comment: http://stackoverflow.com/comment/42681698
answers question: http://stackoverflow.com/q/26967838
has comment: http://stackoverflow.com/comment/42675955
has comment: http://stackoverflow.com/comment/42681243
upvote count: 1
has comment: http://stackoverflow.com/comment/42681482

http://stackoverflow.com/comment/42500011
comment on: http://stackoverflow.com/a/26982721
score: 1
type: AnswerComment
type: Comment
has text: no, i would not use a promise for this. they are nice, but not necessery for just one callback. that´s a promise: https://www.promisejs.org/

http://stackoverflow.com/q/26958173
has body: Good day. guys i got a problem. I need to send my checkbox value via ajax to a php file My question i want to pass the value in both cases whenever it is check or not. if it is checked then it should have pass the value="true" and if it is not check then simply the value in content should be passed. via ajax jquery Note i know code in jquery (AJAX) file should be updated with if condition but i don't know how to do it Update ----- I have fix the issue of check conditon by following answers but in wallajax.php file when i use if(isset($_POST["content"])) then i am getting te value of content via ajax and it is also returing its value in page but when i am using if(isset($_POST["content"]) && isset($_POST["check"]) ) no value is retrieved as a result no return value showing on page i cant understand, where is the problem happeing, is it on ajax script or wallajax.php file my code. wallajax.php if(isset($_POST["content"]) && isset($_POST["check"]) ) { ---fetched value------feed value in databse------ } index.php check it Post
tagged with: php
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26958311
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26958234
accepted answer: http://stackoverflow.com/a/26958234
tagged with: ajax
score: 0
possible better answer: http://stackoverflow.com/a/26958311
has title: Pass the value of checkbox via ajax, php, jquery

http://stackoverflow.com/q/26902772
has comment: http://stackoverflow.com/comment/42362537
favorite count: 0
tagged with: ajax
score: 0
has body: I am trying to edit my entries in a table using Django. The necessary code is given below: urls.py from django.conf.urls import patterns, url, include from updatedb import views urlpatterns = patterns('',url(r'^$', views.index, name='index'), url(r'^submit', views.submit, name='submit'), url(r'^edit', views.edit, name='edit'), url(r'^editdb', views.editdb, name='editdb'), ) views.py from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from updatedb.models import Data from django.core.urlresolvers import reverse from django.views.decorators.csrf import csrf_exempt def index(request): return render(request, 'updatedb/data.html') def submit(request): first = request.POST["first"] second = request.POST["second"] d = Data() d.first = first d.second = second print first print second d.save() if request.POST.get("submit"): qset = Data.objects.all() return render(request, 'updatedb/results.html', {'queryset':qset}) @csrf_exempt def edit(request): qset = Data.objects.all() return render(request, 'updatedb/edit.html', {'queryset':qset}) @csrf_exempt def editdb(request): print "hi" print request.POST.get["data"] return render(request, 'updatedb/editdb.html') edit.html Name Phone Number {% for record in queryset %} {{record.first}} {{record.second}} {%endfor%} Ideally on editing the values in the table, the editdb view should be called but that is not happening. The error alert saying, Error in the request is being generated. Where am I going wrong?
has comment: http://stackoverflow.com/comment/42357908
accepted answer: http://stackoverflow.com/a/26906303
tagged with: python
has comment: http://stackoverflow.com/comment/42358055
has comment: http://stackoverflow.com/comment/42362255
tagged with: django
has comment: http://stackoverflow.com/comment/42362423
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has title: Django: View is not being accessed during edition of the table
has answer: http://stackoverflow.com/a/26906303
type: Question
has comment: http://stackoverflow.com/comment/42363212
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/26950746
favorite count: 0
has title: how to i get this value as a variable
type: UnansweredQuestion
tagged with: php
downvote count: 2
tagged with: forms
type: Question
score: -2
tagged with: javascript
has body: I got this java that sends a user input to php to be verified and put whatever the php echoes into the div "password_feedback" I did have a separate piece of java that tried to see if the "password_feedback" was equal to "Good". but that didn't seem to work(even though it worked with username) so now I'm trying take the Password_feedback result and directly make it a variable to compare. so could anyone help me figure this out, I would appreciate it. &lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ $('#password_feedback').load( 'password-check.php').show(); $('#password_input').change(function(){ //username: is name of variable sent to php, form is name of form, username is name of input $.post('password-check.php', { password: form.password.value}, function(result) { $('#password_feedback').html(result).show(); }); }); if ('#password_feedback' == "Good"){ document.getElementById("check2").innerHTML = "good"; } }); &lt;/script&gt;
upvote count: 0
tagged with: validation
answer count: 1
has answer: http://stackoverflow.com/a/26950779

http://stackoverflow.com/q/26903453
score: 1
favorite count: 0
tagged with: css
accepted answer: http://stackoverflow.com/a/26906823
upvote count: 1
has answer: http://stackoverflow.com/a/26903723
has body: I want to align bottom of legend to X axis. I was thinking about something like that: var legend= chart.legend; var legend.Y= Chart.plotTop + Chart.plotHeight - legend.legendHeight; but, there is no property Y of object legend. Could you provide some sample code or give some tip? I want also to align chart title to left Y axis labels. How can I get width or property "left" of top y axis label? Charts will be generated by users, and they should have a possibility to format charts as they want(for example make visible or hide axis category title). And because of that I do not want to use fixed values, because once it would work ok, once not. Thanks link to image: http://www.fotosik.pl/pokaz_obrazek/pelny/12dadc5d85228db9.html
type: AnsweredQuestion
tagged with: charts
possible better answer: http://stackoverflow.com/a/26903723
tagged with: javascript
type: Question
answer count: 2
has title: How to align bottom of legend to the X axis line?
tagged with: highcharts
has answer: http://stackoverflow.com/a/26906823
downvote count: 0

http://stackoverflow.com/q/26845542
has comment: http://stackoverflow.com/comment/42254175
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26846640
has comment: http://stackoverflow.com/comment/42254385
score: 0
has answer: http://stackoverflow.com/a/26845599
has comment: http://stackoverflow.com/comment/42254384
answer count: 3
has answer: http://stackoverflow.com/a/26869869
tagged with: ajax
has body: I have a hyperlink on my page &lt;a id="delete-file" href=""&gt; &lt;img border="0" src="images/delete_.png" alt="Delete File" width="20" height="20" /&gt; &lt;/a&gt; I'm trying to prevent the default action when it is clicked and run an AJAX function instead. For some reason when I click it, it just brings me to the top of the page and my my AJAX is not fired. No console error messages either. Can someone help me with my syntax? &lt;!---Script to upload file link ---&gt; &lt;cfoutput&gt; &lt;script&gt; $(document).ready(function() { $('##upload-file').submit(function(event){ event.preventDefault(); $.each($('##upload')[0].files, function(i, file) { var formData = new FormData(); formData.append('file-0', file); ajaxUpload(formData); }); $('##delete-file').click(function(event){ event.preventDefault(); ajaxDelete(); }); function ajaxUpload(formData) { console.log("ajaxUpload function called"); $.ajax({ type: 'POST', url: "actionpages/file_upload_action.cfm?ticket_id=#url.ticket_id#", data: formData, cache: false, contentType: false, processData: false, beforeSend: function(){ $('.loader').show(); }, complete: function(){ $('.loader').hide(3000); }, success: function(data) { console.log("File successfully sent."); $("##addFileResponse").append( "File successfully sent." ); PopulateFileUploadDiv(); }, error: function(data) { console.log(data); } }); } }); function ajaxDelete() { console.log("ajaxDelete function called"); $.ajax({ type: 'POST', url: "actionpages/delete_attachment.cfm?ticketID=#URL.ticket_id#&amp;file_path=#filecheck.file_path#", data: formData, cache: false, contentType: false, processData: false, beforeSend: function(){ $('.loader').show(); }, complete: function(){ $('.loader').hide(3000); }, success: function(data) { console.log("File successfully deleted."); $("##addFileResponse").append( "File successfully deleted." ); PopulateFileUploadDiv(); }, error: function(data) { console.log(data); } }); } }); &lt;/script&gt; &lt;/cfoutput&gt;
has comment: http://stackoverflow.com/comment/42254304
has comment: http://stackoverflow.com/comment/42254171
has title: Prevent Default Action on Hyperlink to Run AJAX
has comment: http://stackoverflow.com/comment/42254300
has comment: http://stackoverflow.com/comment/42254234
has comment: http://stackoverflow.com/comment/42254474
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/26845599
type: Question
has comment: http://stackoverflow.com/comment/42255710
has comment: http://stackoverflow.com/comment/42254243
accepted answer: http://stackoverflow.com/a/26869869

http://stackoverflow.com/comment/42298136
type: QuestionComment
comment on: http://stackoverflow.com/q/26869426
score: 0
type: Comment
has text: @voidmain: I don't have ay auto-completion in child window! I just want to show the list of movies with their image (Like amazon)

lodash
tags question: http://stackoverflow.com/q/26967508
tags question: http://stackoverflow.com/q/26908285
tag name: lodash
type: Tag
tags question: http://stackoverflow.com/q/26930692
tags question: http://stackoverflow.com/q/26922957
tags question: http://stackoverflow.com/q/26856067
tags question: http://stackoverflow.com/q/26945389

http://stackoverflow.com/comment/42340166
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26892034
has text: If you are looping through something that calls `renderMarker` multiple times, do a `fitBounds` at the end, rather than during, which will result in unnecessary function calls, and probably bizarre behavior to the user.

http://stackoverflow.com/a/26886948
answers question: http://stackoverflow.com/q/26886562
type: Answer
has body: Your approach is wrong. You should call the function in the callback of your ajax request. This functionality should be done solely in JavaScript. If you are echoing JavaScript from PHP it is most probably the wrong approach.
score: 1
upvote count: 1
downvote count: 0

http://stackoverflow.com/a/26908561
has comment: http://stackoverflow.com/comment/42370480
has body: EDIT: Based on OP update, we made the conversation in the comments, please read them. I think, your problem will be that, if there are not $_GET["p"], then the $query won't exists, so you can not use it as an object. .... year Title <?php if (isset($_GET['p']) && !empty($_GET['p'])) { include('imdbConnection.php'); $query = $conn->prepare("SELECT DISTINCT movieName, year, posterLink FROM film_info WHERE movieName LIKE :p"); $query->execute(array(':p' => '%' . $_GET['p'] . '%')); if ($query->rowCount()) { //If there are no $_GET["p"] then there wont be $query, //So you can not fetch it!!! while ($row = $query->fetch(PDO::FETCH_ASSOC)): ?> <img class='imdbImage' id="image" src='imdbImage.php?url=<?php echo $row['posterLink']; ?>' alt="" /> <?php echo $row['year']; ?> <a href="movie.php?title=<?php echo urlencode($row['movieName']); ?>"><?php echo $row['movieName']; ?> <?php endwhile; } else { echo ' Sorry, there are no film like this '; } } ?>
answers question: http://stackoverflow.com/q/26908215
has comment: http://stackoverflow.com/comment/42369914
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/42370839
downvote count: 0
has comment: http://stackoverflow.com/comment/42370564
has comment: http://stackoverflow.com/comment/42369760
upvote count: 2
has comment: http://stackoverflow.com/comment/42370385
has comment: http://stackoverflow.com/comment/42370699
has comment: http://stackoverflow.com/comment/42370039
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42370614
accepted answer of: http://stackoverflow.com/q/26908215

http://stackoverflow.com/comment/42404401
type: Comment
score: 0
type: AnswerComment
has text: @Slimshadddyyy: I don't understand what you mean? If for example the checkbox in the row `12860` will be checked or unchecked then the `onSelectRow` callback will be called with the first parameter `rowid` equal to `"12860"` and the second boolean parameter inform your whether the row will be checked or unckecked. So you need just include your callback `onSelectRow` in jqGrid which you use and do any required actions inside of the callback.
comment on: http://stackoverflow.com/a/26929359

http://stackoverflow.com/q/26884654
has answer: http://stackoverflow.com/a/26916521
upvote count: 9
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/42324553
has title: Javascript way to locate all elements with margin: auto
accepted answer: http://stackoverflow.com/a/26905495
favorite count: 0
has answer: http://stackoverflow.com/a/26887098
has comment: http://stackoverflow.com/comment/42324561
has answer: http://stackoverflow.com/a/26915724
has comment: http://stackoverflow.com/comment/42374734
has body: I'm looking for an easy way to locate elements on the page that have margin-left and margin-right set to auto. I got this script, that helps me some of the time: (function() { var elementsList = []; for (var i = 0; i &lt; document.styleSheets.length; i++) { var styleSheet = document.styleSheets[i]; if (styleSheet.rules) { for (var j = 0; j &lt; styleSheet.rules.length; j++) { var rule = styleSheet.rules[j]; if (rule &amp;&amp; rule.style &amp;&amp; rule.style.marginLeft == 'auto' &amp;&amp; rule.style.marginRight == 'auto') { var smallList = document.querySelectorAll(rule.selectorText); if (smallList.length) elementsList = elementsList.concat(smallList); } } } } return elementsList })(); While this function gets some of the job done, it doesn't catch most cases of margin: auto I've seen in websites. Can you show me a better way?
tagged with: css
possible better answer: http://stackoverflow.com/a/26887098
answer count: 4
tagged with: margin
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42324488
has answer: http://stackoverflow.com/a/26905495
type: Question
score: 9
has comment: http://stackoverflow.com/comment/42324518

http://stackoverflow.com/comment/42425820
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/26940845
has text: Hey, guys, I wouldn't be so quick to vote to close: the recursion might not be easy to understand here for someone. Aleksandr, I recommend to change the title to something more specific like *Recursion in function creating DOM tree*

http://stackoverflow.com/q/26943428
possible better answer: http://stackoverflow.com/a/26943519
score: 2
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/26943519
type: Question
has answer: http://stackoverflow.com/a/26943520
accepted answer: http://stackoverflow.com/a/26943520
upvote count: 2
answer count: 3
has title: Make input field mandatory based on drop down selection
has comment: http://stackoverflow.com/comment/42429954
tagged with: javascript
tagged with: jquery
has body: If I select A,B,C input field is not mandotory.If I select C,test input box should be mandatory. I tried but its not working. HTML: A B C nil test JS: function selection() { var cat = document.getElementById('select').value; if (cat == "nil") { if (document.getElementById("test1").value == "") { alert('Mandatory'); } } }
favorite count: 0
has answer: http://stackoverflow.com/a/26945180
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/42303767
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26854700
type: AnswerComment
has text: Yes, I have tried that, it doesn't work. that will call the test123() before the popup page loaded.

http://stackoverflow.com/comment/42300415
has text: @JonathanKuhn By the way how do I close this question??
comment on: http://stackoverflow.com/q/26870691
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42423686
has text: `replaceWith` effectively does this: `$('#map')[0].parentNode.replaceChild(newMap);` which is definitely very close to the second option, except it doesn't explicitly remove the old content first.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26939591
score: 0

http://stackoverflow.com/a/26857063
type: Answer
has comment: http://stackoverflow.com/comment/42293927
answers question: http://stackoverflow.com/q/26855002
score: 0
has body: Check the URL in your ajax request, I'm not certain but I don't think '../includes/like.php' is a valid URL I think you actually have to give it a valid server URL like "http://example.com/includes/like.php"

http://stackoverflow.com/a/26896131
has body: I've found solution by adding styling for the default datepicker calendar to hide #ctl00_MainContent_ReportViewer1_ctl04_ctl05_ddDropDownButton { visibility: hidden; }
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/26894271
type: Answer
answers question: http://stackoverflow.com/q/26894271

http://stackoverflow.com/q/26914521
has comment: http://stackoverflow.com/comment/42378249
has answer: http://stackoverflow.com/a/26914607
has answer: http://stackoverflow.com/a/26914820
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/42378086
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/42378355
has title: How to merge/concat two JSON files?
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/26914607
has comment: http://stackoverflow.com/comment/42378167
has body: In some questions here in stackoverflow show how to merge two JSON objects from inner HTML or in a var but I want to merge two external JSON files or URLs with JSON response. Here an exemple with local vars: http://jsfiddle.net/qhoc/agp54/ var object1 = {name: "John"}; var object2 = {location: "San Jose"}; var objectA = $.extend({}, object1, object2); //var objectB = object1.concat(object2); console.log(objectA); Then I will get my JSON like this or similar: jQuery.getJson("data.json", function(data){...}; Any hint for concat my two JSONs: json1.json and json2.json? :)
upvote count: 3
answer count: 2
has comment: http://stackoverflow.com/comment/42380189
downvote count: 1
has comment: http://stackoverflow.com/comment/42378073
accepted answer: http://stackoverflow.com/a/26914820
has comment: http://stackoverflow.com/comment/42378120
favorite count: 0

http://stackoverflow.com/q/26974612
answer count: 1
has comment: http://stackoverflow.com/comment/42484320
downvote count: 0
has answer: http://stackoverflow.com/a/26974850
tagged with: jsp
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/42487277
has title: How to get window object by name in Javascript?
has comment: http://stackoverflow.com/comment/42487229
upvote count: 2
type: AnsweredQuestion
score: 2
has body: my query is, to close all child windows(if open) after logout. I am creating child window from different jsps &amp; i want to close it from Search.jsp. Search.jsp has buttons like Create, Logout. My Search.jsp is - &lt;% String sessionstart = (String)session.getAttribute("sessionstart"); if(sessionstart != null) { %&gt; &lt;body&gt; &lt;div align="center" &gt; &lt;img src="images/Headerimage.png" alt=""&gt; &lt;/img&gt;&lt;/div&gt; &lt;div id = "leftmargin" &gt; &lt;form action="Search" method="post"&gt; &lt;table cellspacing="10" cellpadding="10"&gt; &lt;tr &gt; &lt;td &gt;Type&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="type" value="*" required /&gt;&lt;/td&gt; &lt;td&gt;&amp;nbsp;&amp;nbsp;Name&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="name" value="*" required /&gt;&lt;/td&gt; &lt;td&gt;&amp;nbsp;&amp;nbsp;Description&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="description" value="*" required /&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="submit" value="Search" /&gt;&lt;/td&gt; &lt;td&gt;&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;&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; &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;/td&gt; &lt;td&gt;&lt;h5&gt; &lt;input type="button" value="Create" onclick="Create();" /&gt;&lt;/h5&gt; &lt;/td&gt; &lt;td&gt; &lt;h5&gt; &lt;input type="button" value="Logout" onclick="Logout(); " /&gt; &lt;/h5&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; &lt;/div&gt; &lt;% if (sessionset != null) { %&gt; &lt;div align="center" style="margin-top: 15%"&gt; &lt;img src="image…
accepted answer: http://stackoverflow.com/a/26974850
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/12175930

http://stackoverflow.com/comment/42451545
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26954742
has text: JSON.stringify is javascript method. I am looking for how I can generate that snippet from java beans. Maybe use custom Jackson mapper? Maybe I wasn't much clear on my question, I have updated it.

http://stackoverflow.com/q/26976556
has title: jQuery to regular Javascript - overlay
type: Question
has answer: http://stackoverflow.com/a/26976678
tagged with: javascript
answer count: 2
has body: I've used the following jQuery code to create somewhat of an overlay for my website.. $(function() { var docHeight = $(document).height(); $("body").append("&lt;div id='overlay'&gt;&lt;/div&gt;&lt;div id='my_popup'&gt;&lt;/div&gt;"); $("#overlay") .height(docHeight) .css({ 'opacity' : 0.4, 'position': 'absolute', 'top': 0, 'left': 0, 'background-color': 'black', 'width': '100%', 'z-index': 5000 }); }); I'd like to produce the same results, with regular javascript, no jquery, how would I start/go about this? Also the code I'm currently using results in the overlay being re-loaded on every page, where as it should only load on the main page or landing page. Can anyone suggest a fix for that?
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/26976739
type: UnansweredQuestion
tagged with: popup
upvote count: 2
score: 0
downvote count: 2
tagged with: overlay

http://stackoverflow.com/comment/42389096
score: 0
has text: Finally I found a simple solution. Thanks anyway
comment on: http://stackoverflow.com/q/26897762
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42399041
type: QuestionComment
has text: @newmount The extjs version that I use is 4.2 and the [fiddle is here](https://fiddle.sencha.com/#fiddle/dd5). The fiddle works fine but the same code doesn't work in my web page.
score: 0
comment on: http://stackoverflow.com/q/26924807
type: Comment

http://stackoverflow.com/comment/42302244
comment on: http://stackoverflow.com/q/26871796
has text: For some reason the person edited this post removed it. If you look at the actual post you can see the functions.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42450325
comment on: http://stackoverflow.com/q/26954961
score: 0
type: Comment
type: QuestionComment
has text: I presume you mean `bar.prototype.func1 = function () { ... }` ? ;)

http://stackoverflow.com/comment/42427683
score: 1
has text: It does not *tend* to freeze the browser, it *does* freeze the browser. Every JavaScript function call does. Most of them happen too fast for you to notice, so it's not a problem until you do something time-intensive.
comment on: http://stackoverflow.com/q/26941911
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26844890
accepted answer: http://stackoverflow.com/a/28921149
type: AnsweredQuestion
has body: I'm attempting to implement some simple inheritance using the Selfish library. Here's a cut-down example: var App = Base.extend({ options: { theme: 'b', scriptpath: '', exitPrompt: '' }, initialize: function(opts) { console.log('App initialize'); this.options = $.extend({}, this.options, (opts || {})); } }); var SubApp = App.extend({ intialize: function(opts) { console.log('Subapp initialize'); App.initialize.call(this, opts); } }); $(document).ready(function() { console.log('Document ready'); var sub = SubApp.new({ theme: 'b', scriptpath: '../js/' }); }); The problem being that initialize in SubApp is never called. Curious as to what I am missing.
has title: Implementing simple inheritance in Javascript with Selfish
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28921149
tagged with: inheritance
score: 0
answer count: 1

http://stackoverflow.com/comment/42454407
has text: +1 and thanks. i knew that one day such queries will be added to javascript lol.
type: Comment
comment on: http://stackoverflow.com/a/26957495
score: 0
type: AnswerComment

http://stackoverflow.com/q/26890359
has comment: http://stackoverflow.com/comment/42339026
type: UnansweredQuestion
upvote count: 1
has title: Functions of array elements and interaction with canvas
has comment: http://stackoverflow.com/comment/42339412
linked to: http://stackoverflow.com/q/572897
answer count: 0
score: 1
has body: Trying to do some basic game development. var = mapArray is a 2D array which is filled with random numbers. Random numbers are important and I do not want to come up with a pre-defined 2D array. Numbers are assigned to relevant images and then printed to form a tile map which is essentially a &lt;canvas&gt; element: for (var i = 0; i &lt; mapArray.length; i++) { for (var j = 0; j &lt; mapArray[i].length; j++){ if (mapArray[i][j] === 0) { context.drawImage(grass, posX, posY, 60, 60); } else if (mapArray[i][j] === 1) { context.drawImage(forest, posX, posY, 60, 60); } else if (mapArray[i][j] === 2) { context.drawImage(hills, posX, posY, 60, 60); } else if (mapArray[i][j] === 3) { context.drawImage(mountains, posX, posY, 60, 60); } else if (mapArray[i][j] === 4) { context.drawImage(swamp, posX, posY, 60, 60); } else if (mapArray[i][j] === 5) { context.drawImage(forest, posX, posY, 60, 60); } posX+=60; } posX = 0; posY+=60; } I am able to track mouse clicks on the entire canvas relative to its position on the page and get correct X and Y coordinates of a click. Now I need to actually link the click coordinates with the tiles kept in the 2D array. It is important for me to know which tile is clicked since it will invoke different behavior (e.g. resources, enemies, events, etc). I am entirely at a loss here and have been reading a lot these days. I might need to call every element's function and then check coordinates of each element within array against mouse coordinates as IF statement within the function, or I might broadcast mouse coordinates across all elements to see which one will respond. This does not seem to be a problem (at least for now, he he). My problem is the following: how can I assign functions and other attributes to elements in my array, provided that those are images. May be the way I am building my array in is originally faulty, as I populate it with pure numbers and then translate numbers to images? I might possibly need to push objects with some mor…
tagged with: mouseevent
type: Question
tagged with: canvas
has comment: http://stackoverflow.com/comment/42338098
has comment: http://stackoverflow.com/comment/42338029
tagged with: arrays
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/42335264
favorite count: 0

http://stackoverflow.com/a/26940507
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/42917250
has comment: http://stackoverflow.com/comment/43037141
upvote count: 1
type: AcceptedAnswer
has body: It's most likely this: https://github.com/mustache/spec/issues/52 That's an extension to the Mustache spec that allows anchoring tag names to the current context, basically combining the {{.}} tag with dot notation.
has comment: http://stackoverflow.com/comment/43100832
type: Answer
accepted answer of: http://stackoverflow.com/q/26927324
has comment: http://stackoverflow.com/comment/43072437
answers question: http://stackoverflow.com/q/26927324

http://stackoverflow.com/comment/42454267
score: 0
type: Comment
has text: Thanks a lot for your help!! It worked well for most for all the test cases stated in my question. :-) But I want the regex to match 1,,,, also. I mean any number of commas are allowed before decimal point.
comment on: http://stackoverflow.com/a/26957484
type: AnswerComment

http://stackoverflow.com/comment/42412939
has text: i mean show us the working page
comment on: http://stackoverflow.com/q/26934029
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/26972232
has comment: http://stackoverflow.com/comment/42480022
upvote count: 5
score: 5
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/42480067
has body: You are checking a type of property name (which is obviously a string), not its value. for (p in obj) { if (typeof obj[p] !== 'function') { document.write(p + " : " + obj[p] + "&lt;br/&gt;"); } }
type: Answer
has comment: http://stackoverflow.com/comment/42479917
accepted answer of: http://stackoverflow.com/q/26972178
answers question: http://stackoverflow.com/q/26972178

http://stackoverflow.com/a/26981230
type: Answer
score: 2
downvote count: 0
has body: jQuery Mobile tabs are just the jQueryUI tabs adapted to jQM. You can use the active property to get the currently active tav: http://api.jqueryui.com/tabs/#option-active var active = $( ".selector" ).tabs( "option", "active" ); DEMO
upvote count: 2
accepted answer of: http://stackoverflow.com/q/26980948
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26980948

http://stackoverflow.com/comment/42293927
has text: Actually it's working fine, but it's also working '/includes/like.php' so I'll use this.
type: Comment
comment on: http://stackoverflow.com/a/26857063
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42359414
score: 0
comment on: http://stackoverflow.com/q/26904010
type: QuestionComment
type: Comment
has text: what exactly are you trying to achieve?

http://stackoverflow.com/comment/42298685
has text: @steveax - Sure, but browsers handle tons of invalid stuff just fine. The advice not to do it is sound (see Simon Pieters's comments on that thread) so going against that advice is a slippery slope.
comment on: http://stackoverflow.com/a/26868003
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/42247855
has text: `function` not `fucntion`. Also, what version of jQuery are you using? `.live()` was deprecated in 1.7 and removed in 1.9.
score: 5
comment on: http://stackoverflow.com/q/26842039
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26889172
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26889219
answer count: 3
has body: I am trying to append my form, but adding a checkbox, but I want to add it before the submit button. $('#form').append('&lt;input type="checkbox" id="checking" name="checking" class="required" /&gt;').before($('.clickSubmit')); .clickSubmit is: &lt;p class="clickSubmit"&gt;&lt;input type="submit" name="submit" id="submit" value="Click to submit" class="btn btn-default" disabled="disabled"&gt;&lt;/p&gt; The code above moves the .clickSubmit outside my form and puts it before the form when I want the submit button in the form, I just want to add a checkbox before it. What am I doing wrong?
accepted answer: http://stackoverflow.com/a/26889218
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/26889228
type: Question
has title: How to add checkbox before submit button?
has answer: http://stackoverflow.com/a/26889218
possible better answer: http://stackoverflow.com/a/26889228

http://stackoverflow.com/q/26907794
type: Question
has comment: http://stackoverflow.com/comment/42365721
tagged with: javascript
tagged with: jquery
has title: What does this jQuery function mean?
score: 0
tagged with: jquery-events
accepted answer: http://stackoverflow.com/a/26907852
has comment: http://stackoverflow.com/comment/42365938
answer count: 1
duplicate of: http://stackoverflow.com/q/3755606
has body: I am trying to understand how a js library works, more specifically http://toopay.github.io/bootstrap-markdown/. The whole js file is wrapped in this function: !function ($) { }(window.jQuery); What does this do and how would I be able to call it again from outside the library?
has comment: http://stackoverflow.com/comment/42365906
has comment: http://stackoverflow.com/comment/42365754
linked to: http://stackoverflow.com/q/3755606
has comment: http://stackoverflow.com/comment/42365798
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26907852
has comment: http://stackoverflow.com/comment/42365800

scatter-plot
type: Tag
tags question: http://stackoverflow.com/q/26966736
tag name: scatter-plot

http://stackoverflow.com/comment/42311911
comment on: http://stackoverflow.com/a/26877386
type: AnswerComment
type: Comment
has text: why does everyone use "window.print()" but just "alert(123)" (no window) ?
score: 1

http://stackoverflow.com/a/26917603
type: AcceptedAnswer
downvote count: 0
has body: JSON.parse = turns a formatted JSON string and creates an object... JSON.stringify = turns a JavaScript object into a JSON string.... So you are turning it into a string and then back into an object. Get rid of JSON.parse if you want to print out the string properly. It should look like this: var jString = JSON.stringify(newPosts); alert(jString);
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26917407
answers question: http://stackoverflow.com/q/26917407

http://stackoverflow.com/a/26870329
upvote count: 2
has comment: http://stackoverflow.com/comment/42299413
type: Answer
has body: Use :eq selector with index 0 to target only first element: $(this).parent().siblings(".hide:eq(0)") Working Demo
answers question: http://stackoverflow.com/q/26870300
score: 2
downvote count: 0

http://stackoverflow.com/comment/42445764
comment on: http://stackoverflow.com/q/26952574
score: 0
type: QuestionComment
type: Comment
has text: You are right with your assumptions but wrong with your attitude.

tree
tags question: http://stackoverflow.com/q/26942192
type: Tag
tags question: http://stackoverflow.com/q/26866172
tag name: tree
tags question: http://stackoverflow.com/q/26835214

http://stackoverflow.com/a/26964124
upvote count: 6
score: 6
accepted answer of: http://stackoverflow.com/q/26964025
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26964025
has body: Here's a table that would help. Html: Css: td { border: 1px solid black; height: 50px; width: 50px; }
type: Answer

http://stackoverflow.com/a/26889037
answers question: http://stackoverflow.com/q/26888761
upvote count: 1
has body: Just run the check function again for current checkbox. The problem is that you append the checkboxes dynamically. Js: // Radio and Checkboxes $('input').iCheck({ checkboxClass: 'checkbox-default', radioClass: 'radio-default' }); $('body').on('click', '.add-new-option', function() { $('.new-option-content').append('&lt;div class="checkbox"&gt; &lt;label&gt; &lt;input type="checkbox"&gt; Sample &lt;/label&gt; &lt;/div&gt;'); var $lastCheckBox = $('.new-option-content').find('input').last(); console.log($lastCheckBox); $lastCheckBox.iCheck({ checkboxClass: 'checkbox-default', radioClass: 'radio-default' }); }); Js fiddle : http://jsfiddle.net/8w83nue3/
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/26918171
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/42385109
has answer: http://stackoverflow.com/a/26918512
tagged with: javascript
has comment: http://stackoverflow.com/comment/42385605
tagged with: prototype
answer count: 2
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/42384988
has body: I would love to utilize a function that strips out items from something like .forEach(). An example of what I'm using currently looks like: // return items even if no authentication is present return ArticleModel.find(function (err, articles) { var regularArray = []; function stripOutPremium(element, index, array) { if (element.is_premium === true) { var elementDescAdjustment = element.description; element.description = 'Premium content! ' + elementDescAdjustment.substr(0,15) + '...'; regularArray.push(element); } else { regularArray.push(element); } } articles.forEach(stripOutPremium); return res.send(regularArray); However, this function stripOutPremium() is going to be used in a lot of different places, for this particular application (shown is a bit of a single Express App Route). How can I rewrite this function outside of this return statement so that I can use it on any route in my app? I know it involves doing something new with the var regularArray = []; and possibly even the prototype aspect of JS to do this.
has title: Utilizing array.prototype.forEach() correctly
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42384916
has answer: http://stackoverflow.com/a/26918427
score: 1

http://stackoverflow.com/a/26921644
score: 1
has comment: http://stackoverflow.com/comment/74975401
downvote count: 0
has comment: http://stackoverflow.com/comment/42450217
has comment: http://stackoverflow.com/comment/74975260
type: Answer
has comment: http://stackoverflow.com/comment/42391363
has body: How about this? JSFiddle var quarter = function(date, i){ if(i &gt; 0){ var date2 = new Date(); date2.setMonth(date.getMonth() - 1); q = Math.ceil(( date2.getMonth()) / 3 ); return "Q" + q; } } var xAxis3 = d3.svg.axis() .scale(x) .orient("bottom") .ticks(d3.time.months, 3) .tickSize(5, 0) .tickFormat(quarter); svg.append("g") .attr("class", "x axis") .attr("transform", "translate(0," + (height + 25) + ")") .call(xAxis3);
upvote count: 1
answers question: http://stackoverflow.com/q/26921414
has comment: http://stackoverflow.com/comment/74975338

http://stackoverflow.com/comment/42450839
comment on: http://stackoverflow.com/a/26955393
score: 1
has text: just like `var a = 1; a = 1 + a;` `a` will be 2 after this, its value doesn't change until after the right hand side is evaluated. The `list` is the same, we're not editing `list`, we're changing what it is a reference to. I.e. it was a reference to `{value: 3, rest: null}` now it's a reference to a new object `{value: 2, rest: {value: 3, rest: null}}`. Hope that helps
type: AnswerComment
type: Comment

http://stackoverflow.com/q/26885123
accepted answer: http://stackoverflow.com/a/26885404
has comment: http://stackoverflow.com/comment/42325517
favorite count: 0
score: 2
upvote count: 2
has title: How to work with a Javascript +Date() numeric time stamp in Python?
type: AnsweredQuestion
has body: I've a JavaScript date string which I want to convert in understandable form. E.g. new Date(1415988000000) which gives the output Fri Nov 14 2014 23:30:00 GMT+0530 (IST) I want to do this in python. I don't want to use PyV8. Is there any other alternative ?
has answer: http://stackoverflow.com/a/26885404
type: Question
has comment: http://stackoverflow.com/comment/42325696
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/42325306
tagged with: javascript
has comment: http://stackoverflow.com/comment/42325481
tagged with: python

http://stackoverflow.com/comment/42416196
type: Comment
score: 0
type: AnswerComment
has text: @user2979409 I see; by "bash console" I assumed you meant OS-level instance of the console program `bash` that was running your node.js script. I see now that you mean something entirely different.
comment on: http://stackoverflow.com/a/26935390

http://stackoverflow.com/comment/42498423
has text: Ad networks rely on client-side code. It allows them to get more information about users, enables more ad functionality, and allows you to prevent loading ads until your core content has rendered. There are some ad networks that allow inserting ads into e-mails. Those would be compatible with your method. Are you making your own ad server, or using an existing network?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/26981785
type: Comment

http://stackoverflow.com/comment/42404276
has text: possible duplicate of [How can I check if a jQuery plugin is loaded?](http://stackoverflow.com/questions/400916/how-can-i-check-if-a-jquery-plugin-is-loaded)
type: Comment
comment on: http://stackoverflow.com/q/26929379
type: QuestionComment
score: 1

http://stackoverflow.com/q/26896912
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/42347185
upvote count: 0
has body: If you take a look at gravitatedesign.com and you see the navigation bar is pink, and the letters are there, I want that bar to be there when I first load the page, not necessarily that color but I want it to be up there and to scroll with the page. How do I do this?
type: Question
has answer: http://stackoverflow.com/a/26897010
tagged with: javascript
score: -1
answer count: 2
downvote count: 1
linked to: http://stackoverflow.com/q/10197298
favorite count: 0
has answer: http://stackoverflow.com/a/26897666
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42347322
has title: How do I get my navigation bar to stay fixed like my favorite website?

http://stackoverflow.com/comment/42300552
comment on: http://stackoverflow.com/a/26870813
type: Comment
score: 0
has text: I don't get it. Please show me how my code must look like with this.
type: AnswerComment

http://stackoverflow.com/comment/42368190
score: 1
comment on: http://stackoverflow.com/q/26909128
has text: http://www.smbc-comics.com/index.php#comic
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42364938
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26907070
has text: It tells me "Uncaught ReferenceError: obj is not defined"

http://stackoverflow.com/q/26955989
type: Question
accepted answer: http://stackoverflow.com/a/26965118
possible better answer: http://stackoverflow.com/a/26962221
has body: I'm learning the events in Enyo js framework and can't understand why I get the error and event onModelChanged is not handled. Error message is: "Uncaught TypeError: undefined is not a function" Code: debugger; enyo.kind({ name : "MyModel", kind: "enyo.Model", defaultSource: "mocked", published: { title : "not set", text : "not set", }, events : { onModelChanged : "", }, handlers: { onModelChanged : "modelLoadedHandler" }, modelLoadedHandler : function(inSender, inEvent){ debugger; console.log("handler in model"); console.log(inEvent.textMsg); return true; }, fetch : function(opts){ this.inherited(arguments); debugger; this.doModelChanged({textMsg: "fire event"}); // Uncaught TypeError: undefined is not a function } }); var model = new MyModel(); model.fetch(); P.S. Leave this code as an answer not to be deleted by jsfiddle enyo.kind({ name: "MyMockSource", kind: "enyo.Source", fetch: function(model, opts) { if(model instanceof enyo.Model) { opts.success({title: "testing", text: "Some stuff"}); } else { throw new Error("Model mock only"); } } }); new MyMockSource({name: "mocked"}); enyo.kind({ name : "MyModel", kind: "enyo.Model", source: "mocked", attributes: { title : "not set", text : "not set", }, fetched: function(opts){ this.inherited(arguments); enyo.log("fetched"); // Do something here if you need to, otherwise you might want to overload // the parse method and set parse: true to modify the retrieved data }, titleChanged: function(was, is) { enyo.log("Title is now: " + is); } }); enyo.kind({ name: "MyView", components: [ {kind: "Button", content: "Fetch", ontap: "fetch"}, {name: "title"}, {name: "text"} ], bindings: [ {from: "model.title", to: "$.title.content"}, {from: "model.text", to: "$.text.content"} ], fetch: function() { this.set("model", new MyModel()); // Probably want to create model elsewhere this.model.on("change", enyo.bindSafely(this, "modelChanged")); this.model.fetch(); }, modelChanged: function() { this.log("Something happened to my model!")…
has answer: http://stackoverflow.com/a/26962221
tagged with: javascript
score: 0
answer count: 2
tagged with: dom-events
has title: Enyo custom event is not handled and undefined in simple example
has answer: http://stackoverflow.com/a/26965118
tagged with: enyo
type: AnsweredQuestion

http://stackoverflow.com/q/26943853
has comment: http://stackoverflow.com/comment/42432423
has comment: http://stackoverflow.com/comment/42430841
type: Question
score: 5
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/42430740
answer count: 3
has answer: http://stackoverflow.com/a/26944243
has title: Javascript how `length` is implemented
has comment: http://stackoverflow.com/comment/42430975
has answer: http://stackoverflow.com/a/26944273
type: UnansweredQuestion
has body: You know that in Javascript you can access the length of an text/array with length property: var obj = ["Robert", "Smith", "John", "Mary", "Susan"]; // obj.length returns 5; I want to know how this is implemented. Does Javascript calculates the length property when it is called? Or it is just a static property which is changed whenever the array is changed. My question is asked due to the following confusion in best-practices with javascript: for(var i = 0; i &lt; obj.length; i++) { } My Problem: If it is a static property, then accessing the length property in each iteration is nothing to be concerned, but if it is calculated on each iteration, then it cost some memory. I have read the following definition given by ECMAScript but it doesn't give any clue on how it is implemented. I'm afraid it might give a whole instance of array with the length property calculated in run-time, that if turns out to be true, then the above for() is dangerous to memory and instead the following should be used: var count = obj.length; for(var i = 0; i &lt; count; i++) { }
has answer: http://stackoverflow.com/a/26944625
has comment: http://stackoverflow.com/comment/42431344
upvote count: 5
has comment: http://stackoverflow.com/comment/42431273

http://stackoverflow.com/comment/42303440
type: Comment
comment on: http://stackoverflow.com/q/26872609
type: QuestionComment
has text: Parse hash string in your js and get vars from it
score: 0

http://stackoverflow.com/q/26850437
accepted answer: http://stackoverflow.com/a/26850603
tagged with: apiary.io
has title: node.js - grunt - return parsed data from callback
tagged with: node.js
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/26850603
tagged with: javascript
tagged with: gruntjs
tagged with: callback
score: 0
has body: I want to use API blueprint and make it automatically with grunt. I want to read apiary (tool for API blueprint) file, parsing it (with Protagonist which is API Blueprint Parser for Node.js), stringify it to the JSON format and write into another file. It is a simple task but I don't know how to do it, I always get undefined result. Here is what I have so far: grunt.registerTask('apiary2js', 'Generate js version of apiary file.', function () { var parser = require('protagonist'); var content = grunt.file.read('apiary.apib'); var blueprint = parser.parse(content, function (error, result) { if (error) { console.log(error); return; } return result.ast; &lt;-- (how to return this value?) }); var json = JSON.stringify(blueprint); grunt.file.write('test/frontend/apiary.js', "var apiary = " + json); }); And result in apiary.js is this: var apiary = undefined
answer count: 1

http://stackoverflow.com/comment/42322633
has text: `href="css/style.css"` will fire an HTTP request nonetheless, it's just a relative path instead of an absolute
score: 5
comment on: http://stackoverflow.com/q/26883489
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42374582
type: QuestionComment
comment on: http://stackoverflow.com/q/26912129
score: 0
has text: @MIvanIsten Hmm very odd, I have `console.log` my data and it is there as expected. This is now getting even more odd to me, maybe my error is elsewhere. I just looked, I beleive I am dynamically creating the table after I set the values. So therefore they are getting set to something that doesn't exists? I will rework and post an update. Thank you for showing that my logic was at least correct.
type: Comment

http://stackoverflow.com/q/26986737
favorite count: 0
type: Question
accepted answer: http://stackoverflow.com/a/26986751
has comment: http://stackoverflow.com/comment/42507278
linked to: http://stackoverflow.com/q/16063394
has comment: http://stackoverflow.com/comment/42506844
answer count: 2
upvote count: 1
has title: Empty object prototype is undefined
has answer: http://stackoverflow.com/a/26987521
has comment: http://stackoverflow.com/comment/42508130
has answer: http://stackoverflow.com/a/26986751
tagged with: javascript
has body: (I'm new to JavaScript) If all objects inherit their properties from a prototype, and if the default object is Object, why does the following script return undefined in both cases (I was expecting 'Object')? obj1 = {}; //empty object obj2 = new Object(); console.log(obj1.prototype); console.log(obj2.prototype); Pardon me if it's a silly question!
possible better answer: http://stackoverflow.com/a/26987521
type: AnsweredQuestion
downvote count: 0
score: 1

http://stackoverflow.com/a/26931680
score: 0
has body: Seems weird that they show it like this. Usually you will start working with modules right away, like this: In html &lt;html ng-app="app"&gt; In js angular.module("app",[]) .controller("HelloController",function ($scope) { $scope.greeting = { text: 'Hello' }; }); I'm not sure if your notation should work as well, but this is the standard way of setting up an angular app that is used in all tutorials I have seen.
answers question: http://stackoverflow.com/q/26931568
type: Answer

http://stackoverflow.com/comment/42349590
type: QuestionComment
comment on: http://stackoverflow.com/q/26898209
score: 0
has text: I'd suggest using something like this [Fiddle](http://jsfiddle.net/Jonathan_Ironman/J6JCF/)
type: Comment

http://stackoverflow.com/comment/42409552
score: 0
type: QuestionComment
type: Comment
has text: If Object.extend isn't defined, then Object.prototype.extend will become recursive. Demo code?
comment on: http://stackoverflow.com/q/26932255

mobile
tags question: http://stackoverflow.com/q/26832590
type: Tag
tags question: http://stackoverflow.com/q/26859897
tags question: http://stackoverflow.com/q/26907075
tags question: http://stackoverflow.com/q/26914723
tags question: http://stackoverflow.com/q/26955798
tags question: http://stackoverflow.com/q/26842243
tags question: http://stackoverflow.com/q/26850887
tags question: http://stackoverflow.com/q/26837854
tags question: http://stackoverflow.com/q/26851012
tags question: http://stackoverflow.com/q/26914049
tags question: http://stackoverflow.com/q/26870089
tags question: http://stackoverflow.com/q/26891883
tags question: http://stackoverflow.com/q/26955098
tag name: mobile
tags question: http://stackoverflow.com/q/26977737
tags question: http://stackoverflow.com/q/26868811
tags question: http://stackoverflow.com/q/26920488
tags question: http://stackoverflow.com/q/26961140
tags question: http://stackoverflow.com/q/26976930
tags question: http://stackoverflow.com/q/26881157

http://stackoverflow.com/a/26836375
type: Answer
score: 2
answers question: http://stackoverflow.com/q/26836319
upvote count: 2
downvote count: 0
has body: You can try a regex like $('.filters a').click(function (e) { e.preventDefault(); var slug = $(this).attr('href').match(/[^/]*(?=(\/)?$)/)[0]; alert(slug); }); [^/]* - 0 or more characters other than / (?=(\/)?$) which is followed by 0 or 1 instance / and line end

http://stackoverflow.com/comment/42349166
score: 0
has text: Both urls look fine to me. Have you looked in your console for problems?
type: Comment
comment on: http://stackoverflow.com/q/26897975
type: QuestionComment

http://stackoverflow.com/q/26943599
has body: I wrote a function that takes a collection of json and a html template string. I want to be able to iterate over the collection and set the 'data-adq-uuid' to the uuid of the json model and set any attributes that match input fields from the template. The method seems to be working in some way because on a click callback the data() is showing the proper uuid attribute being set however the html is not being updated. jsfiddle: http://jsfiddle.net/frmsk8na/6/ You can see that when you click save the uuid is being alerted but it is not present in the html. Class and function: class Invoice @append_html_from_collection: (collection, template) -> $($.parseJSON(collection)).each (i, model) -> $template = $(template) $template.find("[data-adq-uuid]").each (i, elem) -> $template.find(elem).replaceWith($(elem).data("adq-uuid", model.uuid)) $.each model, (key, value) -> input = $(template).find("input[data-attr='" + key + "']") if input.length $template.find("input[data-attr='" + key + "']").val(value) $("#invoice-table").append($template) Data to be passed in: collection = '[{"id":28,"uuid":"6683aaee-642d-4484-9edc-4ae7da866367","invoice_id":1,"description":"something","qty":2,"price_cents":500,"total_cents":1000,"created_at":"2014-11-15T04:57:20.277Z","updated_at":"2014-11-15T04:57:20.277Z"},{"id":null,"uuid":"128b0360-3c5f-4ed4-84f1-5bd3c5d21685","invoice_id":null,"description":null,"qty":null,"price_cents":null,"total_cents":null,"created_at":null,"updated_at":null}]' template = ' Save ' Calling the function: Invoice.append_html_from_collection(collection, template) Listener to show that the data is on the element: $(document).on "click", ".persist", (evt) -> alert $(@).data("adq-uuid") Html table: Description Quantity Price
tagged with: javascript
tagged with: jquery
has title: Adding data attributes to a html string not on the dom with jQuery in Coffeescript
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/42438129
favorite count: 0
type: UnansweredQuestion
answer count: 0
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
tagged with: coffeescript
type: Question
has comment: http://stackoverflow.com/comment/42436331

http://stackoverflow.com/comment/42444492
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/26951671
has text: It appears the response array has its own shared scope. Can you break the array apart separately with their own scope?
type: Comment

http://stackoverflow.com/comment/42280359
comment on: http://stackoverflow.com/a/26859579
score: 0
type: AnswerComment
has text: Thanks for you idea. I try this technique before, I did on some action in on change event for file input so if i trigger click event for file input in jquery means the onchange event is not working fine in IE.
type: Comment

http://stackoverflow.com/comment/42311224
type: Comment
has text: Well, you have to, unless you want to change to ng-click (then you could get rid of the whole directive).
type: QuestionComment
comment on: http://stackoverflow.com/q/26876703
score: 0

http://stackoverflow.com/q/26882729
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/26882821
answer count: 1
has title: how to set certain column unclickable
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/26882821
type: Question
has body: I have a 20 columns in my table and I managed to get the rows in my table to be clickable. Is it possible to set the first column until the fifteenth to not clickable. Below is my code. $('#cdcTracking-list tr td:not(:nth-child(1))').click( function () { //....rest of the another code });
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/42572106
type: Comment
comment on: http://stackoverflow.com/a/26953814
has text: Ah, I see. Thanks a lot for your answer! This works out rather well, save for the fact that an actual tab needs to be created and closed, with the flicking that comes with that. I'm guessing there's no way around that, is there? And what do you mean the iframe was being blocked by translate.google.com? Do you mean it was being prevented from being created because the mashup site is on a different domain?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42470722
comment on: http://stackoverflow.com/a/26966441
score: 0
type: AnswerComment
has text: demo works perfectly, but when i implemented in my code its not work,data comes from database as i shown above...
type: Comment

http://stackoverflow.com/comment/109039545
type: Comment
comment on: http://stackoverflow.com/a/28339918
has text: In case anyone is using blueprints, you need to add the CORS() to each blueprint, for example: my_blueprint = Blueprint('my_bp_name', __name__, url_prefix="/my-prefix") CORS(my_blueprint)
score: 13
type: AnswerComment

http://stackoverflow.com/comment/42254302
score: 0
type: Comment
type: AnswerComment
has text: jAndy is there any way to get that reference via jquery or javascript. Because that event is added by thirdparty and that event is attached in window element
comment on: http://stackoverflow.com/a/26845649

http://stackoverflow.com/a/26868774
has comment: http://stackoverflow.com/comment/42296705
type: Answer
has body: One way to fix the proble is to select a nonexistent value: $("&lt;div /&gt;").append($('[name=localeID]:first').clone().val(-1)).html(); Or you can find selected option and remove selected attribute: $("&lt;div /&gt;").append($('[name=localeID]:first').clone() .find(':selected').removeAttr('selected').end()).html(); but this is a little clumsy.
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26868585
answers question: http://stackoverflow.com/q/26868585

http://stackoverflow.com/comment/42935802
type: AnswerComment
has text: Oh, no no That is only showing the tooltip on hover, I need the scatter plot point marker to come on hover along with the tooltip.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26972148

http://stackoverflow.com/comment/42492135
has text: Even doing IP lookup won't work. I use the American way, despite not currently living in the U.S.
comment on: http://stackoverflow.com/q/26978790
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26948720
score: 1
has title: Remove elements in `array` from ` `
type: Question
has body: I have a element which is rendered from an array with some vehicles in it. When I choose a vehicle and add it to another array, I want it to not be displayed in the element. However, I cannot figure out how to achieve this. Here is my current code: var app = angular.module('app', []); function MyCtrl($scope) { $scope.chosenTags = []; $scope.tags = [ { id: 1, name: 'Ford', type: 'Car' }, { id: 2, name: 'Open', type: 'Car' }, { id: 3, name: 'Ferrari', type: 'Car' }, { id: 4, name: 'Mountain', type: 'Bike' }, { id: 5, name: 'BMX', type: 'Bike' }, { id: 6, name: 'Racing', type: 'Bike' }, ]; $scope.currentTag = $scope.tags[0]; $scope.addTag = function() { $scope.chosenTags.push($scope.currentTag); } } Add {{ tag }} And a JSFiddle for those of you who prefers that. How can I get rid of the added vehicles in the element?
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/26948773
accepted answer: http://stackoverflow.com/a/26948773
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
tagged with: angularjs
downvote count: 0
type: AnsweredQuestion

http://stackoverflow.com/comment/42478405
type: AnswerComment
comment on: http://stackoverflow.com/a/26971059
type: Comment
score: 1
has text: @IshanDemon let's just say that if you start using jQuery, you should use all its benefits. Inline JS and these `if (element.options[element.selectedIndex].value` instead of at least `var value = $(element).val();` are sad. Too bad noone took my code - as the result we are stuck with 3 answers with modified (but nevertheless not good) original code. By the way, am I missed something, or `$` and `%` should be set only for particular ` `'s ``, not to all ``s?

http://stackoverflow.com/a/26965019
has body: I believe I have achieved what you are attempting to do in this JSFiddle. DEMO: http://jsfiddle.net/xfkjL3as/1/. The HTML is as follows: My Radio Button The JavaScript is as follows: function updateImageSource(src) { var myImage = document.getElementById("myImage"); myImage.src = src; } var myRadioButton = document.getElementById("myRadioButton"); myRadioButton.addEventListener("mouseover", function(){ updateImageSource('http://www.worldpeace-uk.org/wp-content/uploads/2013/07/smiley-face.jpg'); }, false); I have used JavaScript to attach the mouseover event to the radiobutton HTML element. Sidenote: It is generally a better practice to separate your JavaScript code from your HTML. While HTML provides you attributes such as onmouseover to achieve this, I would recommend to keep the JavaScript code in a separate file (and link it). This question answers how to link a separate JavaScript file.
score: 0
has comment: http://stackoverflow.com/comment/42499114
type: Answer
answers question: http://stackoverflow.com/q/26964664
accepted answer of: http://stackoverflow.com/q/26964664
has comment: http://stackoverflow.com/comment/42482905
has comment: http://stackoverflow.com/comment/42490067
type: AcceptedAnswer

http://stackoverflow.com/comment/42399437
has text: What does the console show??
type: QuestionComment
comment on: http://stackoverflow.com/q/26926502
score: 0
type: Comment

http://stackoverflow.com/comment/42398315
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26926001
has text: Java script working but how to call java script from VB code behind?

http://stackoverflow.com/q/26906131
answer count: 1
linked to: http://stackoverflow.com/q/16529825
has title: How to apply ng class with a condtion statement
tagged with: angularjs
duplicate of: http://stackoverflow.com/q/16529825
tagged with: css
type: UnansweredQuestion
type: Question
tagged with: angularjs-directive
tagged with: javascript
has answer: http://stackoverflow.com/a/26906233
score: 0
has body: I'm new to Angular js and was wondering how to make an ng class apply based on a set of conditions. For example i want to have a set of dates using ng repeat and change the colour of the date if that date is greater than the current date. My question is how would i go about this?

http://stackoverflow.com/a/29592668
answers question: http://stackoverflow.com/q/26879383
upvote count: 1
has body: CBPFWTabs.prototype._init = function() { // tabs elemes this.tabs = [].slice.call( this.el.querySelectorAll( 'nav &gt; ul &gt; li' ) ); // content items this.items = [].slice.call( this.el.querySelectorAll( '.content &gt; section' ) ); // current index this.current = -1; // show current content item this._show(); // init events this._initEvents(); }; You can change this._show(); enter your content number like this._show(1);
score: 1
downvote count: 0
type: Answer

http://stackoverflow.com/q/26929891
tagged with: regex
type: AnsweredQuestion
has title: regex to match a multi-line string
accepted answer: http://stackoverflow.com/a/26929961
type: Question
has answer: http://stackoverflow.com/a/26929955
tagged with: javascript
has comment: http://stackoverflow.com/comment/42406033
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/42405129
has comment: http://stackoverflow.com/comment/42406274
possible better answer: http://stackoverflow.com/a/26929946
has answer: http://stackoverflow.com/a/26929961
has answer: http://stackoverflow.com/a/26929946
has body: Sorry, for the badly named topic. I'm looking for a efficient regular expression to match the following: [2014-11-13 13:05:04] [path/to/class.instagram.php] Options: array ( 'client_id' =&gt; '', 'client_secret' =&gt; '', 'object' =&gt; 'tag', 'object_id' =&gt; 'rwar', 'aspect' =&gt; 'media', 'callback_url' =&gt; 'http://www.localthisday.nl/instagram.callback.php', ) I want it to be split up so it looks like this: 1. [2014-11-13 13:05:04] 2.[path/to/class.instagram.php] 3. Options: array ( 'client_id' =&gt; '', 'client_secret' =&gt; '', 'object' =&gt; 'tag', 'object_id' =&gt; 'rwar', 'aspect' =&gt; 'media', 'callback_url' =&gt; 'http://www.localthisday.nl/instagram.callback.php', ) I'm using this one at the moment: (\[(.*)\])(\s{1})(\[(.*)\])(\s{1})(.*)/gmi I know, it's not a very good one, that's probably why it doesn't work the way I want it to work. Problem is; it's a multi-line string, and for some reason it does not work multi-line. Could someone please help me? I'm not that good in regular expressions unfortunately.

http://stackoverflow.com/comment/42304794
type: Comment
type: QuestionComment
has text: Just out of curiosity, what is the purpose of this pursuit?
comment on: http://stackoverflow.com/q/26873279
score: 0

http://stackoverflow.com/comment/42292638
score: 0
type: Comment
has text: When I say console.log I mean something like this...not connected to the data console.log('here');
comment on: http://stackoverflow.com/a/26849583
type: AnswerComment

http://stackoverflow.com/comment/42720185
comment on: http://stackoverflow.com/a/27007246
has text: this does help a lot. however, what is missed is sort of a message/notification that the request is being processed. do you have an idea how i can do that using jquery/bootstrap/etc?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/26920961
has body: I've been googling for a while and have found nothing that can help me. I'm just trying to retrieve all data from an IndexedDB. Here's what my code looks like so far: var request = window.indexedDB.open("List", 1); request.onsuccess = function (event) { db = request.result; console.log("success: " + db); }; request.onupgradeneeded = function (event) { db = event.target.result; var objectStore = db.createObjectStore("List", { keyPath: "id" }); for (var i in parsedData) { objectStore.add(parsedData[i]); } console.log("RETRIEVING DATA"); var transaction = request.transaction("List"); var store = transaction.objectStore("List"); store.openCursor().onsuccess = function (e) { var cursor = e.target.request; if (cursor) { console.log("List NAMES == " + cursor.value.Name); } } } Now, there's a couple things that need to be said about this code I have written. First of all, I'm aware that I retrieving information should be in a function of its own (I just wrote it this way for printing/logging purposes only). Second, for some reason, the "RETRIEVING DATA" should at least print to the log -- but it doesn't and I don't know why. Third - and most importantly - I keep getting an error on this line: var transaction = request.transaction("List"); The error is: JavaScript runtime error: Function expected Not sure what is causing these 2 problems that I'm having.
tagged with: winjs
has title: How to properly retrieve all data from an IndexedDb in a WinJS Windows 8 app?
tagged with: windows
has answer: http://stackoverflow.com/a/26925631
has answer: http://stackoverflow.com/a/26931233
accepted answer: http://stackoverflow.com/a/26931233
type: AnsweredQuestion
type: Question
tagged with: windows-8
tagged with: indexeddb
possible better answer: http://stackoverflow.com/a/26925631
tagged with: javascript
score: 0
answer count: 2

http://stackoverflow.com/a/26927420
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26923448
has comment: http://stackoverflow.com/comment/42415228
has body: Akamaozu is really too lazy to make his code valid. A regular expression must be included in slashes, not backslashes. A backslash is needed inside a regex when you have to escape a character that otherwise has a special meaning or to create a metacharacter with a special meaning. So when you change your code to this it will work: var thisColor = "#000", search = /{{color}}/g, template = $("#styleTemplate").html(); $('#styleTarget').html(template.replace(search, thisColor)); DEMO.
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/26923448
type: Answer

http://stackoverflow.com/comment/42433487
has text: I'm using 2010, not express, but it should be the same. That is weird.
score: 0
comment on: http://stackoverflow.com/q/26935884
type: QuestionComment
type: Comment

http://stackoverflow.com/a/55601197
has comment: http://stackoverflow.com/comment/111347435
score: 15
upvote count: 15
downvote count: 0
has comment: http://stackoverflow.com/comment/137014758
type: Answer
answers question: http://stackoverflow.com/q/26948400
has body: I think there is a much better approach, that allows for solid type-safety and scalability. First declare interfaces that you want to implement on your target class: interface IBar { doBarThings(): void; } interface IBazz { doBazzThings(): void; } class Foo implements IBar, IBazz {} Now we have to add the implementation to the Foo class. We can use class mixins that also implements these interfaces: class Base {} type Constructor&lt;I = Base&gt; = new (...args: any[]) =&gt; I; function Bar&lt;T extends Constructor&gt;(constructor: T = Base as any) { return class extends constructor implements IBar { public doBarThings() { console.log("Do bar!"); } }; } function Bazz&lt;T extends Constructor&gt;(constructor: T = Base as any) { return class extends constructor implements IBazz { public doBazzThings() { console.log("Do bazz!"); } }; } Extend the Foo class with the class mixins: class Foo extends Bar(Bazz()) implements IBar, IBazz { public doBarThings() { super.doBarThings(); console.log("Override mixin"); } } const foo = new Foo(); foo.doBazzThings(); // Do bazz! foo.doBarThings(); // Do bar! // Override mixin

http://stackoverflow.com/comment/42356979
has text: @vicky: can you create a plunkr for the problem
type: Comment
comment on: http://stackoverflow.com/a/26902473
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42457776
type: QuestionComment
has text: Subh - When i move cursor on div element in HTML (Firebug) content then textfield get highlighted.
comment on: http://stackoverflow.com/q/26958449
score: 0
type: Comment

http://stackoverflow.com/comment/42497735
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/26980488
score: 0
has text: since im getting error 'TypeError: $(...).on is not a function' it probably means it has to do with the script since i have https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js, correct?

http://stackoverflow.com/comment/42377309
type: Comment
comment on: http://stackoverflow.com/a/26913941
has text: yes , this is good way ...but the point is still i can't avoid iteration. anyways thanks a lot
type: AnswerComment
score: 0

uploadcare
tags question: http://stackoverflow.com/q/26850555
tag name: uploadcare
type: Tag

http://stackoverflow.com/comment/42431213
comment on: http://stackoverflow.com/a/26944140
score: 0
type: AnswerComment
has text: this is the actual text variable that I have now: `$numwords = 50;` `preg_match("/(\S+\s*){0,$numwords}/", $this->row->description, $regs);` `$desc = str_replace('"', "", preg_replace('/(\s\s+|\t|\n)/', ' ', JFilterOutput::cleanText($regs[0])));`
type: Comment

http://stackoverflow.com/q/26961508
favorite count: 0
tagged with: ajax
answer count: 3
has title: Asynchronous Problems with Javascript Hacker News API
tagged with: asynchronous
has answer: http://stackoverflow.com/a/26961611
upvote count: 1
type: AnsweredQuestion
has body: Hacker News recently released an API that I am using to display what the current top ten items are on Hacker News. I am running into some problems. When I run the code below, the order of the items on the frontpage are inaccurate, jumping from the second one in the frontpage to the fourth, to the first, to the fifth, to the third and so on. Running the code again results in a slightly different order again. $.getJSON('https://hacker-news.firebaseio.com/v0/topstories.json', function(json) { var convoText = '&lt;ol&gt;'; for (var i = 0; i &lt; 10; i++) { (function(i) { $.getJSON('https://hacker-news.firebaseio.com/v0/item/' + json[i] + '.json', function(json2) { convoText += '&lt;li&gt;&lt;a href="' + json2.url + '"&gt;' + json2.title + '&lt;/a&gt;&lt;/li&gt;'; if (i === 9) { convoText += '&lt;/ol&gt;'; addConvo(convoText); } }); })(i); } }); I understand that this is an effect of Javascript's asynchronous nature. How can I fix it?
has answer: http://stackoverflow.com/a/26961834
accepted answer: http://stackoverflow.com/a/26961611
type: Question
possible better answer: http://stackoverflow.com/a/26961802
has answer: http://stackoverflow.com/a/26961802
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 1

http://stackoverflow.com/a/27080069
score: 1
type: Answer
answers question: http://stackoverflow.com/q/26969271
upvote count: 1
has comment: http://stackoverflow.com/comment/42789806
has comment: http://stackoverflow.com/comment/42782248
has body: You wrote "I am not asking for specific libraries and tools, but rather for approaches and specifications." however you can look closer to ExtJS 5 environment which fulfils all your requirements. If you are not interested in such commercial product you can just get to know patterns and solutions in it. Relation to your requirements: Structure JavaScript code in separate files. It implement Object-Oriented Programming paradigm so you can create classes, subclasses, objects, mixins, plugins. It connect class-based programming and prototype-based programming. Worth noting MVVM architecture (View, Controller, ViewModel), data binding, data session (records/entities client-side management). Config system is also quite interesting. It's very handy. The config property is merged from parent class to subclasses and also during object creation you can pass config which will be merged too. It is very useful when we want have customizable and flexible components. Load relevant modules in the runtime. Each class may has requires or uses directive which are used when builing application to one file. You can also manually load files. ...without having to include every single file as script tag. In dev env files are loaded dynamically (asynchronous or synchronous). In prod env necessary files has been built to one minified file. Support aggregation and minification - ability to build and use a single minified/optimized JavaScript file. You can build application with Sencha cmd tool (and do a few other things). You can use three predefined env (development, testing, production) or create your own (based on config files and ant). Be able to use modules in different combinations - there are often different web pages/clients which need different subsets of modules. You can use workspaces and packages. Supporting documentation (with JSDoc?). JS Duck, tutorial Suitable for testing. You can do unit tests (PhantomJS, JSLint, PhantomLint, Jasmine). You can use dedicated framework like Sies…
downvote count: 0

http://stackoverflow.com/comment/42494064
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26977518
has text: Am I doing something wrong here? http://jsfiddle.net/chfpha7s/14/ I used your code but it's not working.

http://stackoverflow.com/q/26982809
type: Question
tagged with: c#
has answer: http://stackoverflow.com/a/26983148
tagged with: javascript
tagged with: jquery
score: 0
has body: I am trying to call a Javascript from the codebehind but form some reason it is not working. Let me explain what i am trying to accomplish: when the page loads the system needs to check if this is the first time the user visit this page. if so a lightbox will open. So I created a javascript function in the page the onPageLoad i would like to call this function if it is necesary. This is what I have so far, looks pretty straight forward but it is not working. I will appreciate any help. Here is the html: Open Tutorial Code behind: protected void Page_Load(object sender, EventArgs e) { //code to check if this is the first time ..... // it this is the first time, call this function Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "OpenTutorial()", true); }
answer count: 3
has answer: http://stackoverflow.com/a/26983474
has title: Call JavaScript function from codebehind(c#) is not working
tagged with: asp.net
has comment: http://stackoverflow.com/comment/42502685
has comment: http://stackoverflow.com/comment/42528018
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26982900
has comment: http://stackoverflow.com/comment/42502668
has comment: http://stackoverflow.com/comment/42502625
has comment: http://stackoverflow.com/comment/42502520
has comment: http://stackoverflow.com/comment/42527718
has comment: http://stackoverflow.com/comment/42527538

http://stackoverflow.com/comment/42328944
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26887128
has text: @Ghost: yes, I have image links of movies + their year and genre
score: 0

http://stackoverflow.com/q/26890675
tagged with: stylesheet
has answer: http://stackoverflow.com/a/26890814
has title: Can I add a style tag to innerHTML?
downvote count: 7
type: Question
has comment: http://stackoverflow.com/comment/42336052
possible better answer: http://stackoverflow.com/a/26890768
has answer: http://stackoverflow.com/a/26890768
tagged with: javascript
upvote count: 18
score: 11
answer count: 2
accepted answer: http://stackoverflow.com/a/26890814
has comment: http://stackoverflow.com/comment/42336175
favorite count: 0
tagged with: font-size
type: AnsweredQuestion
tagged with: innerhtml
has body: I'm trying to post an innerHTML table. Would like the font size in one cell to be bigger. Is it possible to include a style tag like so? cell4.innerHTML = "&lt;style: font-size:40px&gt;" + "John Doe" + "&lt;/style&gt;" + "&lt;/br&gt;"; I tried the following fiddle, but it isn't working. http://jsfiddle.net/s1dj3x8e/

http://stackoverflow.com/comment/42340037
comment on: http://stackoverflow.com/a/26892755
type: AnswerComment
score: 0
has text: actually the error is gone if I use [] instead of [ui.bootstrap] however I dont see the nicely designed alerts. (but the btn ng-click functionaly works fine)
type: Comment

http://stackoverflow.com/q/26876864
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42311521
tagged with: ruby-on-rails
score: 0
has body: I must split a price in two. Therefore I have the equation price_1 + price_2 = total_price. Because I'm very nice, I will allow the user to change any of the 3 params. I must reflect this on my frontend rails view. Of course, database-wise, I will only store two of these values :) price_1 and total_price So in my views I have : &lt;%= f.number_field :price_1, :step =&gt; 0.1, class: "form-control" %&gt; &lt;%= f.number_field :total_price, :step =&gt; 0.1, class: "form-control" %&gt; What I think I could do for the third : &lt;input id="price_2" type:"number" step="0.1"&gt; And sync with javascript. Of course, the problem being that the 3 inputs are editable. So let's say editing price_1 should change only price_2 and vice-versa, and that changing total_price should only change price_one (and maybe do something about price_2, if some clever user set price_1 to 0 and lower the total_price...) I've seen very few questions about this (or maybe I couldn't find the good answer cause of bad keywords). This is a fast solution but that can surely fail : var global_lock = true $("#price_1").on("change"){ global_lock = !global_lock if(!global_lock){ $("#price_2").attr("value", (Integer.parse($("total_price").attr("value")) - Integer.parse($("price_1").attr("value"))) } } Anything better ? That maybe I could integrate easily using a rails helper ? EDIT : let's abstract a bit :P. Instead I have a random equation f(price_1, price_2, total_price) = 0. Therefore my code becomes var global_lock = 2 $("#price_1").on("change"){ global_lock = (global_lock++) % 3; if(global_lock == 0){ //Jquery stuff that always modifies both price_2 and total_price } } //Similar for price_2 and total_price
has comment: http://stackoverflow.com/comment/42311548
type: Question
has answer: http://stackoverflow.com/a/26878523
has title: Rails | Javascript synchronize several fields, avoid infinite loop
tagged with: infinite-loop
tagged with: javascript
answer count: 1
has comment: http://stackoverflow.com/comment/42311054
tagged with: data-synchronization

http://stackoverflow.com/q/26930546
type: Question
tagged with: angularjs-directive
downvote count: 0
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/26930614
favorite count: 0
tagged with: angularjs
has title: AngularJS directive - link function element param not availble in watch function
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42406306
tagged with: watch
score: 1
has body: I'm trying to do something very simple: I defined a directive ('A' type) that need to manipulate the element when the scope property changed. JS app.directive("autoAnimation", function () { return { restrict: 'A', scope: { animateChanged: '=', maxHeight: '@'//for the first time }, link: function (scope, element, attrs) { var isFirstTime = true; scope.$watch('animateChanged', function (newVal) { console.log(newVal) //Trying to get the 'element' but it's not available - what can I do to get the ul element and manipulate it? //why it's not available? }); } }; }); HTML Test Test Test Test Test The problem is when the 'animateChanged' is changed, the 'element' (and scope) parameter are not available. Here is the plunker. My questions: 1) why it's not available? 2) what can I do to manipulate the 'ul' element (where the directive is declared - see the HTML) when 'animateChanged' is changed? EDIT I didn't check the example, and in this example it's available (my bad, sorry). but in my project it's not available, and I can't bring the example to my situation... (in my project the UL build dynamically with ng-repeat). Any idea what can possibly cause to this behavior?
has answer: http://stackoverflow.com/a/26930594
has comment: http://stackoverflow.com/comment/42406697
upvote count: 1

http://stackoverflow.com/comment/42408795
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/26931648
type: Comment
has text: @Jonast92 `org.replace(word, newWord)` returns undefined. But that isn't an issue. Really - what happens if that word occur multiple times at the paragraph?

http://stackoverflow.com/q/26937972
answer count: 3
has body: Is there a way to trigger an action when a user clicks on the icon of an item in an unordered list? (in javascript and/or jquery)
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26939199
has answer: http://stackoverflow.com/a/26938083
has comment: http://stackoverflow.com/comment/42420478
score: -3
upvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/26938083
has comment: http://stackoverflow.com/comment/42420652
has comment: http://stackoverflow.com/comment/42421431
has comment: http://stackoverflow.com/comment/42421592
has title: Can an event be triggered on a click on a item marker on an html unoredered list?
has comment: http://stackoverflow.com/comment/42421500
downvote count: 4
has comment: http://stackoverflow.com/comment/42420321
has answer: http://stackoverflow.com/a/26938100
has answer: http://stackoverflow.com/a/26939199
has comment: http://stackoverflow.com/comment/42421584
has comment: http://stackoverflow.com/comment/42423745
has comment: http://stackoverflow.com/comment/42420254
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/42420835
has comment: http://stackoverflow.com/comment/42420263
favorite count: 0

http://stackoverflow.com/q/26984513
has comment: http://stackoverflow.com/comment/42517819
tagged with: karma-runner
answer count: 0
has comment: http://stackoverflow.com/comment/42517384
has body: I use Karma and Jasmine to test mmy javascript code (no Angular in the case of the issue). When I launch the units tests, I have this issue for the first js file : Chrome 38.0.2125 (Windows 8.1) ERROR Uncaught TypeError: Cannot set property 'style' of null The code where this error happen is : var source = document.getElementById('workzone'); hw = hw - hauteurmodif; source.style.height = hw + 'px'; I have this message for each similar case : when I try to use a element from a CSS file (here workzone). However there's no error with a normal execution, the css and the element exist, the js script files are called at the end of (after the css links), and in karma.conf.js, the call order is correct : //css 'app/css/*.css', // libraries ... // our app 'app/js/*.js', // test 'test/unit/**/*.js' I thinks the CSS are not loaded in the DOM when the tests run. I try to use differents browser, there was no differences. Moreover, I tested to use Jasmine-Jquery, it was without effect. Thanks for your help
type: Question
has comment: http://stackoverflow.com/comment/42518814
has title: Karma + Jasmine CSS element null from DOM
tagged with: javascript
has comment: http://stackoverflow.com/comment/42503083
score: 0
tagged with: jasmine
has comment: http://stackoverflow.com/comment/42516788
type: UnansweredQuestion

http://stackoverflow.com/a/26958910
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/26958622
has comment: http://stackoverflow.com/comment/42458195
has comment: http://stackoverflow.com/comment/42457129
type: Answer
downvote count: 0
has body: The problem is that your object is not what jQuery considers a PlainObject Here is an example: var obj = {"c":{}}; var arrayOfObjects = [obj]; jQuery.isPlainObject(arrayOfObjects); // false See the [ at the beginning if the screen? This is the documentation for the $.ajax data field data Type: PlainObject or String or Array Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). Here is what jQuery has to say about the traditional setting. Note: Because there is no universally agreed-upon specification for param strings, it is not possible to encode complex data structures using this method in a manner that works ideally across all languages supporting such input. Use JSON format as an alternative for encoding complex data instead. You can fix the problem by doing the following: $.ajax({ type: "POST", url: "user.php?action=save&amp;backup="+backup, data: JSON.stringify(data), // ... }); For the record PHP does not have a problem with empty JSON objects $json = json_decode('{"c":{},"b":2}'); var_dump(json_encode($json,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)); // output string(33) "{ "c": { }, "b": 2 }"
score: 1
accepted answer of: http://stackoverflow.com/q/26958622

http://stackoverflow.com/a/26905878
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: The error is in using for loop and $.inArray inside. $.inArray gives you the index of the date if found or -1 otherwise. Your loop always hit a return statement. So it is always performing one and only one iteration. Hence why you always get i = 0. Get rid of the loop and just return true if found with the corresponding index returned by $.inArray. Refactoring a little bit your code: beforeShowDay: function(date) { var y = date.getFullYear().toString(); // get full year var m = (date.getMonth() + 1).toString(); // get month. var d = date.getDate().toString(); // get Day if(m.length == 1){ m = "0" + m; } // append zero(0) if single digit if(d.length == 1){ d = "0" + d; } // append zero(0) if single digit var ymd = y + '-' + (m) + '-' + d; var i = $.inArray(ymd, highlightdays); if (i != -1) { return [true, "cssdate", whosebday[i]]; } var day = date.getDay(); return [day != 0, ''];//Disable all sundays } See demo
answers question: http://stackoverflow.com/q/26903940
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/26903940

http://stackoverflow.com/comment/42294079
type: QuestionComment
score: 0
has text: Regarding your edit: It very well works in Chrome.
comment on: http://stackoverflow.com/q/26867321
type: Comment

http://stackoverflow.com/comment/42442247
has text: Use subtraction operator for this: `-`
comment on: http://stackoverflow.com/q/26950489
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/42356363
score: 0
type: Comment
has text: check my updated answer... just use this snippet in code behind onIndexChange event and it will prompt the confirm box and if you click 'Cancel' it will clear the `myTextBox` **(PASS your own text box id)**
comment on: http://stackoverflow.com/a/26901573
type: AnswerComment

http://stackoverflow.com/q/26989683
has comment: http://stackoverflow.com/comment/42511080
possible better answer: http://stackoverflow.com/a/26989801
answer count: 5
has comment: http://stackoverflow.com/comment/42511306
has answer: http://stackoverflow.com/a/26989801
has body: My code is like this var searchPreferences = new function() { this.setValues = localStorage.setItem('searchPreferenceData', JSON.stringify({ clientName: document.getElementById('clientName').value, carrier: document.getElementById('carrierName').value, status: document.getElementById('ShipmentStatus').value, genericView: document.getElementById('ddl_view').value })); this.getData = JSON.parse(localStorage.getItem('searchPreferenceData')); this.showValues = new function() { document.getElementById('clientName').value = GetData.clientName; } } And I a calling this function like this searchPreferences.setValues(); inside a button click. But no value is added to local storage. Can any one point out what I am doing wrong?
has answer: http://stackoverflow.com/a/26990238
has answer: http://stackoverflow.com/a/26989752
type: AnsweredQuestion
has title: Unable to set values to local Storage
has answer: http://stackoverflow.com/a/26990301
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26989752
has answer: http://stackoverflow.com/a/26992878
score: 0

http://stackoverflow.com/q/26903806
score: 0
tagged with: node.js
accepted answer: http://stackoverflow.com/a/26924382
has comment: http://stackoverflow.com/comment/42395723
has comment: http://stackoverflow.com/comment/42359067
possible better answer: http://stackoverflow.com/a/26904020
has body: Things are sort of working but, for some reason, I can't get the user_id into the URL, all I get is a literal ":user_id" like so: here is the code in the my users.js route file var main = require('../main'); exports.getAllUsers = function(req, res) { var db = main.db(); db.collection('users').find().toArray(function(err, items) { res.json(items); }); }; exports.routeUserToTheirHome = function(req, res, next) { res.json(req.user); }; and here is the code in my main.js file: app.param('user_id', function(req, res, next, user_id) { // typically we might sanity check that user_id is of the right format User.find(user_id, function(err, user) { if (err) { return next(err); } if (!user) { return new Error("no user matched"); } req.user = user; next(); }); }); app.use('/users/:user_id/home', users.routeUserToTheirHome);
has answer: http://stackoverflow.com/a/26924382
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42359340
has comment: http://stackoverflow.com/comment/42395437
has comment: http://stackoverflow.com/comment/42359107
tagged with: routes
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/26904020
tagged with: javascript
has comment: http://stackoverflow.com/comment/42395937
tagged with: express
has title: node.js - parameterized routes with Express

http://stackoverflow.com/q/26971818
tagged with: console
favorite count: 0
tagged with: facebook
has answer: http://stackoverflow.com/a/26972359
type: AnsweredQuestion
has title: How does Facebook put this formatted text in JavaScript console?
type: Question
score: 5
upvote count: 5
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26972359
has body: By opening JavaScript console on Facebook it warns you not to put anything there, to be safe from scam. This seems a very good counter measure against "make your victim do the work for you" attacks. How do they do this?
downvote count: 0
answer count: 1

kendo-timepicker
tags question: http://stackoverflow.com/q/26976928
type: Tag
tag name: kendo-timepicker

http://stackoverflow.com/q/26913625
has comment: http://stackoverflow.com/comment/42376507
type: Question
has comment: http://stackoverflow.com/comment/42377033
tagged with: javascript
has comment: http://stackoverflow.com/comment/42376670
has body: I'm using the PHP + Ajax version of this template: http://192.241.236.31/themes/preview/smartadmin/1.5/ajaxversion/, Codeception WebDriver (Selenium) to perform my tests. Most of them are working fine, but I have some random, yes, random!, failing tests, so I always get back to them and try to harden, hoping it will not randomly fail sometime in the future. One of the failing reasons are usually due to wrong clicks on the interface. I tell Codeception to click the #element-id and when it fails, I see that it actually had a different page showing in the output png, but the link activated showing it tried to click the correct link. Sometimes I just have to load a different page before clicking that particular link and wait 10 seconds for it to render, and it works, silly huh? Yeah, but sometimes this doesn't work either. This is how I used to test things: $I->click('#element-id'); And I have to use the element id, because it's a multi-language app, all (mostly) strings come from a strings file and they might change at some point and break tests. After too many random tests failing, I decided to make the frontend itself responsible for clicking things during tests, it's a long and silly circunventing shot, but it should be work, so I created a functionalHelper: public function clickElement($element) { $I = $this->getDriver(); $I->executeJS("clickElement('{$element}');"); } And two Javascript functions: function clickElement(element) { element = jQuery(element); if(typeof element !== undefined) { fakeClick(element[0]); } return true; } function fakeClick(object) { if (object.click) { object.click(); } else if(document.createEvent) { var evt = document.createEvent("MouseEvents"); evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); var allowDefault = object.dispatchEvent(evt); } } I'm using jQuery in the first one because it's already available in the template and it's easier to select non-id'ed things. This is working fine…
downvote count: 0
has title: How do we correctly click on a link or button using Javascript?
tagged with: codeception
favorite count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: selenium-webdriver
has comment: http://stackoverflow.com/comment/42379807
answer count: 0
score: 1

http://stackoverflow.com/comment/42349731
comment on: http://stackoverflow.com/a/26897019
has text: Thanks guys! I'm working on a little game and this helped a lot! <3 Stackoverflow! The community is comprised of the best people ever!
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/42455231
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26958154
score: 1
has text: How did you write this within 5 minutes?! Do you have one of those brain-to-keyboard interfaces?

http://stackoverflow.com/a/26861771
answers question: http://stackoverflow.com/q/26861732
upvote count: 1
type: AcceptedAnswer
type: Answer
has body: You need to construct the regex allowing those characters too: var addons = '_-'; re = new RegExp('^[a-zA-Z]+['+addons+']?$','i'); console.log('match a', re.test('a')); console.log('match a_', re.test('a_')); console.log('no match 9', re.test('9')); console.log('no match 9_', re.test('9_')); That will test for any of the characters in addons (the brackets), and they're not required (the ?).
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26861732
score: 1

http://stackoverflow.com/comment/42349108
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26897974
has text: `document.getElementById("div1").innerHTML = data1; document.getElementById("div2").innerHTML = data2;`
score: 0

http://stackoverflow.com/comment/42478444
score: 0
has text: my code is similar to yours I initially thought it was a case of names which were identical but now I can serialize when the name are the same but not when the names are the same. yup the downvote was mine
comment on: http://stackoverflow.com/a/26935873
type: Comment
type: AnswerComment

http://stackoverflow.com/a/26970978
has comment: http://stackoverflow.com/comment/42478122
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42477980
downvote count: 0
has comment: http://stackoverflow.com/comment/42478572
has comment: http://stackoverflow.com/comment/42477929
has comment: http://stackoverflow.com/comment/42477854
type: Answer
answers question: http://stackoverflow.com/q/26970928
accepted answer of: http://stackoverflow.com/q/26970928
has body: The immediate problem here is that the j and keyword variables go on changing before the callbacks are called. A simple solution is to protect this variable in a closure : for (var j=0; j&lt;keywords.length; j++) { (function(j){ var keyword = keywords[j]; ... })(j); } When you're just working with a simple array, then you can also use a closure through forEach : keywords.forEach(function(keyword, j){ ... }); To deal with this kind of asynchronous problems, you should now dive in promises which help structure your code in a clearer (and less indented) way. An introduction.
has comment: http://stackoverflow.com/comment/42478191
has comment: http://stackoverflow.com/comment/42479167
score: 4
upvote count: 4

http://stackoverflow.com/comment/124371985
has text: @RalphDavidAbernathy Good idea. I've edited my code.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/50811654
type: AnswerComment

http://stackoverflow.com/a/26916736
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/42385736
type: Answer
has comment: http://stackoverflow.com/comment/42385888
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/42382425
has comment: http://stackoverflow.com/comment/42385540
has comment: http://stackoverflow.com/comment/42385444
has comment: http://stackoverflow.com/comment/42385383
has comment: http://stackoverflow.com/comment/42382746
has body: Ok, here's how I would do it. First, in your objects, I would assign a minWeight and maxWeight numeric property so it can be checked in the loop. var Automobiles = { "2D": [{ vehicleClass: "0 to 2499", minWeight: 0, maxWeight: 2500, pipe: [14.50, 14.50, 14.50, 14.50, 14.50, 14.50, 14.50, 14.50, 14.50, 14.50, 14.50, 14.50, 29.00, 29.00, 29.00, 1, 27.60, 14.50, 1, 3, 01, 01] }, { vehicleClass: "2500 to 3499", minWeight: 2500, maxWeight: 3500, pipe: [22.50, 22.50, 22.50, 22.50, 22.50, 22.50, 22.50, 22.50, 22.50, 22.50, 22.50, 22.50, 45.00, 45.00, 45.00, 1, 35.60, 22.50, 1, 3, 01, 01] }, { vehicleClass: "3500 and up", minWeight: 3500, maxWeight: Number.MAX_VALUE, pipe: [32.50, 32.50, 32.50, 32.50, 32.50, 32.50, 32.50, 32.50, 32.50, 32.50, 32.50, 32.50, 65.00, 65.00, 65.00, 1, 45.60, 32.50, 1, 3, 01, 01] }], "3D": [{ vehicleClass: "0 to 2499", minWeight: 0, maxWeight: 2500, pipe: [14.50, 14.50, 14.50, 14.50, 14.50, 14.50, 14.50, 14.50, 14.50, 14.50, 14.50, 14.50, 29.00, 29.00, 29.00, 1, 27.60, 14.50, 1, 3, 01, 01] }, { vehicleClass: "2500 to 3499", minWeight: 2500, maxWeight: 3500, pipe: [22.50, 22.50, 22.50, 22.50, 22.50, 22.50, 22.50, 22.50, 22.50, 22.50, 22.50, 22.50, 45.00, 45.00, 45.00, 1, 35.60, 22.50, 1, 3, 01, 01] }, { vehicleClass: "3500 and up", minWeight: 3500, maxWeight: Number.MAX_VALUE, pipe: [32.50, 32.50, 32.50, 32.50, 32.50, 32.50, 32.50, 32.50, 32.50, 32.50, 32.50, 32.50, 65.00, 65.00, 65.00, 1, 45.60, 32.50, 1, 3, 01, 01] }] }; Now, I assign a change event handler (I'm using jQuery, but you could use plain javascript if you like - I saw jQuery in the tag so I opted to use it here). In the event handler, loop through the automobiles object to find the value that's selected in the dropdown. Then loop through the array of objects within that category to see if the weight entered is between the minWeight and maxWeight values that are assigned for that object. If they are, then return the pipe value for that object (which I'm just throwing an alert for an e…
score: 4
accepted answer of: http://stackoverflow.com/q/26916069
has comment: http://stackoverflow.com/comment/42386153
answers question: http://stackoverflow.com/q/26916069
has comment: http://stackoverflow.com/comment/42385946

http://stackoverflow.com/comment/42259300
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/26847948
has text: So are you looking for a hosting (completely off-topic), or finding a solution to run the exe in a particular environment? Which environment, Windows Server? Do you know CGI http://en.wikipedia.org/wiki/Common_Gateway_Interface ?

http://stackoverflow.com/comment/42500763
comment on: http://stackoverflow.com/q/26978599
type: Comment
has text: Do you want to achieve? scroll to a specific element within same page?
score: 0
type: QuestionComment

http://stackoverflow.com/q/26879127
type: UnansweredQuestion
has body: Hello I have a piece of code var date = new Date("11/12/2014 02:58:11 UTC"); console.info(date.toString()); console.info(date.toLocaleTimeString()); console.info(date.toLocaleDateString()); and display: Tue Nov 11 2014 16:58:11 GMT-1000 (Hawaiian Standard Time) 9:58:11 AM 11/12/2014 My time zone is (UTC-10:00) Hawaii date.toString(); displays correctly, but toLocaleTimeString(), toLocaleDateString() displays incorrect output How do I fix this issue?
has title: Javascript toLocaleTimeString() not working
upvote count: 18
type: Question
downvote count: 0
score: 18
tagged with: javascript
has answer: http://stackoverflow.com/a/31999247
answer count: 2
has comment: http://stackoverflow.com/comment/50074560
tagged with: datetime
has answer: http://stackoverflow.com/a/26879197
favorite count: 0

http://stackoverflow.com/comment/42289041
has text: This is how I'd do it, except because I'm lazy I'd just do `\d+`.
type: AnswerComment
comment on: http://stackoverflow.com/a/26864801
score: 0
type: Comment

http://stackoverflow.com/q/26870089
has comment: http://stackoverflow.com/comment/42299411
has comment: http://stackoverflow.com/comment/42298943
type: Question
downvote count: 4
has comment: http://stackoverflow.com/comment/42298974
tagged with: mobile
answer count: 1
tagged with: javascript
has title: How can i build a circular dialog using css/html
has comment: http://stackoverflow.com/comment/42298888
favorite count: 0
has comment: http://stackoverflow.com/comment/42299316
has comment: http://stackoverflow.com/comment/42299168
has answer: http://stackoverflow.com/a/26870552
has body: Im building a mobile app using html/css to display a list of contacts. I want to display a shortcut to call/email on the lines of the attached screenshot. Any thoughts on how i could do this with css/html ? I have tried a couple of changes with JS for callbacks but havent been to represent the pop over.
tagged with: http://stackoverflow.com/tag/html
tagged with: css
upvote count: 0
linked to: http://stackoverflow.com/q/26599782
type: UnansweredQuestion
score: -4
has comment: http://stackoverflow.com/comment/42299096
has comment: http://stackoverflow.com/comment/42299040
has comment: http://stackoverflow.com/comment/42299217

http://stackoverflow.com/comment/42292027
type: Comment
type: AnswerComment
has text: I forgot to mention I also need the div circle text to be able to stay opened if the mouse if hovered over it because there will be "Learn More" buttons at the bottom of the cicletext divs...
comment on: http://stackoverflow.com/a/26865782
score: 0

http://stackoverflow.com/comment/42261306
type: AnswerComment
has text: Or you can use `parent.document.getElementsByName(window.name)[0];` (Documentation: https://developer.mozilla.org/en-US/docs/Web/API/document.getElementsByName)
comment on: http://stackoverflow.com/a/26849302
type: Comment
score: 1

http://stackoverflow.com/q/26949103
type: AnsweredQuestion
tagged with: autocomplete
score: 1
has title: Meteor Google Maps Autocomplete only works once on multiple templates
has body: I am using a Google Places autocomplete package with Meteor and if I have the user select a location in one template, the autocomplete won't work again in a different template. For instance, if the user picks an autocomplete location for an event they are hosting, and then they try to set their profile location in the profile settings, no autocomplete locations pop up. In fact, if they even activate the autocomplete dropdown on one page (without even selecting one of the options), it won't work on the other page. Here's my HTML: Location {{currentUser.profile.location}} Here is the second template: Event Name Event Location I have the mrt:googlemaps package added, and I have set a googlePlaces.js like so: GoogleMaps.init({ 'sensor': true, //optional 'key': '***my api key***', //optional 'language': 'en', //optional 'libraries': 'places' }); It is notable to state that although the autocomplete does not function again after a file update (with server restart), it will work again after a page refresh from the client. Basically, I would like to see a perfect example of how to get this working in multiple templates in meteor.js.
type: Question
accepted answer: http://stackoverflow.com/a/27091785
has answer: http://stackoverflow.com/a/26949284
downvote count: 0
tagged with: javascript
tagged with: google-maps-api-3
has answer: http://stackoverflow.com/a/32128853
tagged with: meteor
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/27086996
has answer: http://stackoverflow.com/a/27091785
upvote count: 1
possible better answer: http://stackoverflow.com/a/27086996

http://stackoverflow.com/q/26958622
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has body: I am trying to pass JSON data from jQuery ajax to PHP with post method. Then i have to save this data to a text file. Here is a JSON node in my main object that i want to submit to PHP. I captured this image from Chrome's console because i am lazy. This is the javascript code that makes the call: function save(data, backup, notify, clear) { $.ajax({ type: "POST", url: "user.php?action=save&amp;backup="+backup, data: data, async: false, success: function(result){ console.log(result); }, error:function(e){ console.log(console.log(e)); } }); } And then when i try to var_dump this $_POST data in my php, the output looks like below: var_dump($_POST); // save file_put_contents($file, json_encode($_POST,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)); As you can see the "files" node disappears. Why? How can i pass empty nodes to PHP? I need "files" node only with key. I will add some values after some time ago. Solution: In JS: data: {"data": JSON.stringify(data) }, In PHP: $data = json_decode(stripslashes($_POST['data'])); file_put_contents($file, json_encode($data, JSON_PRETTY_PRINT));
answer count: 1
has comment: http://stackoverflow.com/comment/42456695
has title: Why PHP ignores empty objects in JSON?
has comment: http://stackoverflow.com/comment/42456108
tagged with: php
has comment: http://stackoverflow.com/comment/42456275
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/14999897
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/42456167
type: Question
has answer: http://stackoverflow.com/a/26958910
accepted answer: http://stackoverflow.com/a/26958910
has comment: http://stackoverflow.com/comment/42456329
linked to: http://stackoverflow.com/q/5319106

http://stackoverflow.com/a/26940585
upvote count: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/26940445
answers question: http://stackoverflow.com/q/26940445
has body: this this.dayCollection.fetch({ success: function(){ this.dayTableView.render(); $("#times_day").html(this.dayTableView.el); }.bind(this) }); or var that = this; this.dayCollection.fetch({ success: function(){ that.dayTableView.render(); $("#times_day").html(that.dayTableView.el); } });
type: Answer
score: 2

http://stackoverflow.com/comment/42345797
has text: I think your method needs to be `static` for the AJAX call to go through. Even with that, I'm not sure if MVC can create a complex object from a plaint http request without having any specific instructions.
comment on: http://stackoverflow.com/q/26896061
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26920920
has answer: http://stackoverflow.com/a/26920980
downvote count: 0
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/26920940
has comment: http://stackoverflow.com/comment/42389981
tagged with: ajax
has answer: http://stackoverflow.com/a/26920940
has body: I am using $.ajax to make a post request. Then, I am trying to call a function before success or failure of the ajax request. Right now my approach is like following var someCallback = function() { //do something }; var Success = false; $.ajax({ type: "POST", url: "/some/service", dataType: "text", data: JSON.stringify(someData), contentType: "application/json; charset=utf-8", success: function (data) { someCallBack(); //&lt;--- this is the function Success = true;//doesnt goes here }, error: function (textStatus, errorThrown) { someCallBack(); Success = false;//doesnt goes here } }); The thing is, i need to run someCallBack() after the ajax request completes irrespective of whether it succeeds or fails but before success or error callback is called. I dont want to use ajaxStart and ajaxStop in this scenario. I looked at 'complete' callback, but it is only called after error or success. I don't want to call the someCallBack() at two places. Any Suggestions, Please.
has answer: http://stackoverflow.com/a/37407269
answer count: 4
favorite count: 0
accepted answer: http://stackoverflow.com/a/26920980
has answer: http://stackoverflow.com/a/26921137
type: AnsweredQuestion
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/42389992
has title: Call a function before ajax Success or Failure
type: Question

http://stackoverflow.com/a/26927270
score: 0
type: Answer
answers question: http://stackoverflow.com/q/26926951
has body: What you are trying to accomplish is building a stateful application. Now with current web technologies there are multiple ways of accomplishing this. Cookies (though this is the worst thing, but would technically work). There are easy to use libs (e.g. this jQuery Plugin: https://github.com/carhartl/jquery-cookie#readme). Use a server side technology to store the state of the app. This could be anything from PHP, Node.js, Ruby. You basically query the server for the state. Obviously for simple stuff like your example not really worth it. Use modern HTML5 APIs, the Session Storage or the Local Storage (http://www.w3schools.com/html/html5_webstorage.asp) which would probably be a good fit for your szenario. What you then have to do is, something like the following (based on jquery) using localStorage $(document).ready(function(){ changeClass(localStorage.getItem("state")); }) In your changeClass function you would need to set the locaStorage. Hope this helps

http://stackoverflow.com/a/26923960
answers question: http://stackoverflow.com/q/26922517
score: 4
accepted answer of: http://stackoverflow.com/q/26922517
type: AcceptedAnswer
has body: When you load the image in Ruby the binary file without any modifications will be encoded directly to base-64. When you load an image in the browser it will apply some processing to the image before you will be able to use it with canvas: ICC profile will be applied (if the image file contains that) Gamma correction (where supported) By the time you draw the image to canvas, the bitmap values has already been changed and won't necessarily be identical to the bitmap that was encoded before loading it as image (if you have an alpha channel in the file this may affect the color values when drawn to canvas - canvas is a little peculiar at this..). As the color values are changed the resulting string from canvas will naturally also be different, before you even get to the stage of re-encoding the bitmap (as PNG is loss-less the encoding/compressing should be fairly identical, but factors may exist depending on the browser implementation that will influence that as well. to test, save out a black unprocessed canvas as PNG and compare with a similar image from your application - all values should be 0 incl. alpha and at the same size of course). The only way to avoid this is to deal with the binary data directly. This is of course a bit overkill (in general at least) and a relative slow process in a browser. A possible solution that works in some cases, is to remove any ICC profile from the image file. To save an image from Photoshop without ICC choose "Save for web.." in the file menu.
has comment: http://stackoverflow.com/comment/42414737
type: Answer
upvote count: 4
downvote count: 0

http://stackoverflow.com/comment/42420321
score: 0
type: Comment
type: QuestionComment
has text: Is the icon set with CSS?
comment on: http://stackoverflow.com/q/26937972

http://stackoverflow.com/a/26864766
type: Answer
has body: var myArray = "left 10 top 50".split(" "); var numbers; for ( var index = 0; index &lt; myArray.length; index++ ) { if ( !isNaN(myArray[index])) numbers= myArray[index] } find working example on the link below http://jsfiddle.net/shouvik1990/cnrbv485/
answers question: http://stackoverflow.com/q/26864672
score: 0

http://stackoverflow.com/q/26971340
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/42483123
has comment: http://stackoverflow.com/comment/42483011
tagged with: .net
tagged with: javascript
tagged with: sharepoint
answer count: 1
has body: I am completely new to SharePoint development. I am trying to create an app for basic CRUD operation using NAPA. I took the reference from http://www.plusconsulting.com/blog/2013/05/crud-on-list-items-using-rest-services-jquery/. There are some basic get commands in REST. I am using Get All List Items From a Single List (where url is like: http://UsersrverName/site/_api/web/lists/getbytitle(‘listname’)/items) Now for getting list items based on ODATA Query, the function is: function getListItems(url, listname, query, complete, failure) { // Executing our items via an ajax request $.ajax({ url: url + "/_api/web/lists/getbytitle('" + listname + "')/items" + query, method: "GET", headers: { "Accept": "application/json; odata=verbose" }, success: function (data) { complete(data); // Returns JSON collection of the results }, error: function (data) { failure(data); } }); } here, as per function arguments, I have assigned the value for url and listname, query is blank as I am selecting all items, and I have no idea what to assign for complete and failure. So my main concern is the arguments to be passed in the function getListItems(). Kindly help. and if there is any other alternative (without using REST), then please suggest.
downvote count: 0
tagged with: sharepoint-2010
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26982655
has comment: http://stackoverflow.com/comment/42478478
has title: CRUD Operation using NAPA in SharePoint 2013

http://stackoverflow.com/comment/42430838
type: Comment
comment on: http://stackoverflow.com/a/26943919
has text: Hi.. big thanks for your answer i just look out these answers and test with my system
score: 0
type: AnswerComment

http://stackoverflow.com/q/26903978
has comment: http://stackoverflow.com/comment/42359335
has comment: http://stackoverflow.com/comment/42359496
score: 1
has comment: http://stackoverflow.com/comment/42359559
upvote count: 1
type: Question
tagged with: javascript
has body: Im having a little trouble with a simple chrome extension that close a specific pop-up by its link. When the pop-up window is popping up the main page is getting disable, and as soon as the pop-up is close, the page is enable again. The problem I'm struggling with is that when I run my extension, the pop-up is more like being removed instead of being closed. so the pop-up window is disappearing, but the main page keeps on being disable. BUT, if I run the javascript in the chrome dev-console the pop-up is closing correctly and the main page gets enable right away. is this a bug? or are they other ways to close a window instead of window.close() this is the simple javascript I'm using (function(){ var x = document.URL; var url = "www.xxxx.com/customurl"; if(x==url){ window.close(); } })(); Manifest { "name": "ReportCloser", "version": "0.1", "permissions": [ "tabs","&lt;all_urls&gt;" ], "browser_action": { "default_icon": "icon.png" }, "content_scripts": [ { "matches": [ "http://*/*", "https://*/*" ], "run_at": "document_end" , "js": ["script.js"] } ], "manifest_version":2 }
has comment: http://stackoverflow.com/comment/42362056
has answer: http://stackoverflow.com/a/26910683
tagged with: google-chrome-extension
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/42360979
has title: close pop-up with javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/42361083
has comment: http://stackoverflow.com/comment/42362809

http://stackoverflow.com/q/26906294
score: 34
answer count: 2
upvote count: 35
has answer: http://stackoverflow.com/a/26917059
tagged with: truthiness
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/26917059
linked to: http://stackoverflow.com/q/784929
has comment: http://stackoverflow.com/comment/42363156
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/42435673
has answer: http://stackoverflow.com/a/26906309
downvote count: 1
has body: In angular.js, there are some code snippets use !! to check whether a value is truthy in if condition. Is it a best practice? I fully understand in return value or other assignment !! is used to make sure the type is Boolean. But is it also true for condition checks? if (!!value) { element[name] = true; element.setAttribute(name, lowercasedName); } else { element[name] = false; element.removeAttribute(lowercasedName); }
type: Question
accepted answer: http://stackoverflow.com/a/26906309
has comment: http://stackoverflow.com/comment/42363165
tagged with: javascript
has title: Is !! a best practice to check a truthy value in an if statement

http://stackoverflow.com/q/26979628
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/26980825
has answer: http://stackoverflow.com/a/26980825
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/26985803
has body: I've recently inherited some code that I need to maintain, part of which is a web-app meant to be used on iPad. Unfortunately, the recent iOS 8 update broke a part of said web-app. In one section, the web-app contained an iframe which loaded in a list of items. This iframe used to scroll with only one finger when run as a web-app, but now only scrolls with two fingers. * The one finger vs. two finger scrolling of iframe content in iOS web-apps is a whole other can of worms, and NOT what I'm looking for help with though * - I need help with implementing my solution. If I place the content in a div I can get it to scroll as I want, however, I then also have to use an object to load in the content (coming from a separate page) - this is where my jQuery problem arises. When an item is selected from the loaded list it is highlighted - once the user is finished and his/her selections are submitted the "highlighted" items are then "deselected" using jQuery to remove the "highlighted" style. This worked fine with the iframe, but I can't manage to change the styling of the items now that they are contained within a div and object. Here are some code snippets to illustrate what's going on: ORIGINAL (works correctly with iframe) MY ATTEMPT (not working) Admittedly, I'm not really a jQuery guy, but this seems like it should be fairly easy... Thanks in advance for any help you can offer.
has title: How to set style of element loaded into as data
upvote count: 1
tagged with: object
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/26985803
score: 1

http://stackoverflow.com/comment/42247963
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/64620/discussion-between-suresh-and-prog).
score: 0
type: Comment
comment on: http://stackoverflow.com/a/26841394
type: AnswerComment

http://stackoverflow.com/comment/42848089
type: Comment
score: 1
comment on: http://stackoverflow.com/a/26878523
type: AnswerComment
has text: Yeah I had the same idea when I was implementing my change events. But no it doesn't trigger any other change events. I suspect this was intentional due to the fact that it could become an infinite loop.

http://stackoverflow.com/comment/42284988
has text: Because on tablet there are no mouse events. Try this then `$('#scrollup').on('mousedown touchstart', function() {}).on('mouseup touchend', function() {})`.
type: Comment
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/26862272

http://stackoverflow.com/a/26846243
answers question: http://stackoverflow.com/q/26845946
type: Answer
has comment: http://stackoverflow.com/comment/42838363
downvote count: 0
has body: Add this to your body http://www.redips.net/javascript/adding-table-rows-and-columns/ Add Row Add Column Remove Row Remove Column
score: 3
has comment: http://stackoverflow.com/comment/42836667
has comment: http://stackoverflow.com/comment/42292700
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/26845946
upvote count: 3

http://stackoverflow.com/comment/42349390
has text: I'm unable to replicate the issue I'm having with jsFiddle. There must be something that is killing my alerts. I added an alert to the start event, and that does not work either.
score: 0
comment on: http://stackoverflow.com/q/26898051
type: Comment
type: QuestionComment

http://stackoverflow.com/q/26978346
upvote count: 2
possible better answer: http://stackoverflow.com/a/26978456
has body: I am trying to split an array of strings, called 'vertices' and store it as an array of floats. Currently the array of strings contains three elemets: ["0 1 0", "1 -1 0", '-1 -1 0"] What I need is an array of floats containing all these digits as individual elements: [0, 1, 0, 1, -1, 0, -1, -1, 0] I used the split() function as follows: for(y = 0; y &lt; vertices.length; y++) { vertices[y] = vertices[y].split(" "); } ...which gives me what looks to be what I am after except it is still made up of three arrays of strings. How might I use parseFloat() with split() to ensure all elements are separate and of type float?
has answer: http://stackoverflow.com/a/26978456
type: AnsweredQuestion
has title: Splitting an array of strings to an array of floats in JavaScript
score: 2
linked to: http://stackoverflow.com/q/10865025
accepted answer: http://stackoverflow.com/a/26978451
type: Question
tagged with: split
tagged with: arrays
tagged with: javascript
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/26978451
linked to: http://stackoverflow.com/q/23457895
has comment: http://stackoverflow.com/comment/42491390
favorite count: 0
tagged with: parsefloat